function setOnclickToChartSelect(){$(".chart-select").unbind("change"),$(".chart-select").on("change",function(){var e=$(this).hasClass("chart-select-tab1")?1:2;App.front_hot_recommends.disable_action_panel(e),$(this).data("chart")&&(1==e?(data=[],barchartData=[]):(corporateNumbersData=[],barchartCorporateNumbersData=[]));var t,n,i,a,s,o=this,r=this.options[this.selectedIndex].text,l=$(this).data("chart"),c=$(this).data("name"),d=$(this).data("value");1==e?(a=$("#hot_approach_scenario_selection").val(),t=$("#checkbox_tel_exists").is(":checked"),n=$("#checkbox_form_url_exists").is(":checked"),i=$("#checkbox_mail_exists").is(":checked"),chartSelectClassifications=$(".chart-select-tab1 option:selected").map(function(){return CLASSIFICATION_MASTER_CONVERTER[this.text]}).get(),updateDataChartTab1=updateDataChartTab1.filter(function(e){return chartSelectClassifications.includes(e.chart_name)}),sessionUpdateDataChartTab1=JSON.parse(sessionStorage.getItem("updateDataChartTab1")),sessionUpdateDataChartTab1=sessionUpdateDataChartTab1.filter(function(e){return chartSelectClassifications.includes(e.chart_name)}),sessionStorage.setItem("updateDataChartTab1",JSON.stringify(sessionUpdateDataChartTab1)),s=mergeArrayData(updateDataChartTab1.concat(sessionUpdateDataChartTab1))):(n=!1,t=$("#checkbox_tel_exists_tab2").is(":checked"),i=$("#checkbox_mail_exists_tab2").is(":checked"),a=$("#hot_approach_scenario_selection_lead").val(),chartSelectClassifications=$(".chart-select-tab2 option:selected").map(function(){return CLASSIFICATION_MASTER_CONVERTER[this.text]}).get(),updateDataChartTab2=updateDataChartTab2.filter(function(e){return chartSelectClassifications.includes(e.chart_name)}),sessionUpdateDataChartTab2=JSON.parse(sessionStorage.getItem("updateDataChartTab2")),sessionUpdateDataChartTab2=sessionUpdateDataChartTab2.filter(function(e){return chartSelectClassifications.includes(e.chart_name)}),sessionStorage.setItem("updateDataChartTab2",JSON.stringify(sessionUpdateDataChartTab2)),s=mergeArrayData(updateDataChartTab2.concat(sessionUpdateDataChartTab2))),$(this).data("chart",CLASSIFICATION_MASTER_CONVERTER[r]),$(this).attr("data-chart",CLASSIFICATION_MASTER_CONVERTER[r]),$(this).data("name",r),$(this).attr("data-name",r),$(this).data("value",$(this).val()),$(this).attr("data-value",$(this).val()),items=[],$(".chart-select-tab"+e).each(function(e,t){items.push($(t).data("chart"))});var u={order_key:$("#order_key").val(),order_type:$("#order_type").val(),order_flg:$("#order_flg").val(),keyword:$("#keyword").val(),search_data_type:$("#search_data_type").val()},_=$("#hot_approach_sort_item").val(),h=$("#hot_approach_sort_order").val(),p=$("#hot_approach_display_number").val(),f=$("#change_display_number").val(),m=$("#hot_recommend_page").val();inactivatedTabClick(e),1==e?$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{data:s,tab:e,items:items,tel_exists:t?1:0,form_url_exists:n?1:0,mail_exists:i?1:0,filter_condition:getHotProfileFilterParam(e),soft_item:_,soft_order:h,per_page:p,lead_per_page:f,scenario_id:a,lead_order_params:u,page:m},success:function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel()},error:function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel(),$(o).data("chart",l),$(o).attr("data-chart",l),$(o).data("name",c),$(o).attr("data-name",c),$(o).data("value",d),$(o).attr("data-value",d)}}):($.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{data:s,tab:e,items:items,tel_exists:t?1:0,form_url_exists:n?1:0,mail_exists:i?1:0,filter_condition:getHotProfileFilterParam(e),soft_item:_,soft_order:h,per_page:p,lead_per_page:f,scenario_id:a,lead_order_params:u,page:m,loading_type:LOADING_TYPE_LEAD}}).always(function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_LEAD)}),$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{data:s,tab:e,items:items,tel_exists:t?1:0,form_url_exists:n?1:0,mail_exists:i?1:0,filter_condition:getHotProfileFilterParam(e),soft_item:_,soft_order:h,per_page:p,lead_per_page:f,scenario_id:a,lead_order_params:u,page:m,loading_type:LOADING_TYPE_CHART}}).fail(function(){$(o).data("chart",l),$(o).attr("data-chart",l),$(o).data("name",c),$(o).attr("data-name",c),$(o).data("value",d),$(o).attr("data-value",d)}).always(function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_CHART)}))})}function mergeArrayData(e){var i=[];return e.forEach(function(t){var e=i.filter(function(e){return e.chart_name==t.chart_name});if(e.length){var n=i.indexOf(e[0]);i[n].ids=i[n].ids.concat(t.ids),i[n].ids=Array.from(new Set(i[n].ids))}else i.push(t)}),i}function firstTimeSearch(){lead_search_tab_click_count++;var e=window.location.search,t=new URLSearchParams(e).get("scenario_id"),n=t?parseInt(t):null,i={order_key:$("#order_key").val(),order_type:$("#order_type").val(),order_flg:$("#order_flg").val(),keyword:$("#keyword").val(),search_data_type:$("#search_data_type").val()},a=1,s=2,o=document.getElementById("hot_approach_scenario_selection_lead"),r={tab:s,page:a,lead_per_page:leadPerPageDefault,lead_order_params:i};if(r.hot_scenario=o.options[0].text,n)for(var l=1;l<o.options.length;l++)if(o.options[l].value==n){r.hot_scenario=o.options[l].text;break}inactivatedTabClick(s),r.loading_type=LOADING_TYPE_LEAD,$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:r}).always(function(){activatedTabClick(s),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_LEAD)}),r.loading_type=LOADING_TYPE_CHART,$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:r}).always(function(){activatedTabClick(s),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_CHART)})}function updateChart(e,t){var n,i,a,s;"lead"==(t=t||null)?$(".ha-loading-part-lead .ha-loading-part__loading").show():"company"==t?$(".ha-loading-part-company .ha-loading-part__loading").show():App.front_hot_recommends.disable_action_panel(e),1==e?(s=$("#hot_approach_scenario_selection").val(),n=$("#checkbox_tel_exists").is(":checked"),i=$("#checkbox_form_url_exists").is(":checked"),a=$("#checkbox_mail_exists").is(":checked")):(i=!1,n=$("#checkbox_tel_exists_tab2").is(":checked"),a=$("#checkbox_mail_exists_tab2").is(":checked"),s=$("#hot_approach_scenario_selection_lead").val());var o=[],r=$("#hot_approach_sort_item").val(),l=$("#hot_approach_sort_order").val(),c=$("#hot_approach_display_number").val(),d=$("#change_display_number").val(),u={order_key:$("#order_key").val(),order_type:$("#order_type").val(),order_flg:$("#order_flg").val(),keyword:$("#keyword").val(),search_data_type:$("#search_data_type").val()};$(".chart-select-tab"+e).each(function(e,t){o.push($(t).data("chart"))});var _=1==e?barchartData:barchartCorporateNumbersData;1==e?updateDataChartTab1=_:updateDataChartTab2=_,inactivatedTabClick(e),1==e?$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{data:_,items:o,tel_exists:n?1:0,form_url_exists:i?1:0,mail_exists:a?1:0,filter_condition:getHotProfileFilterParam(e),soft_item:r,soft_order:l,per_page:c,lead_per_page:d,lead_order_params:u,tab:e,only_update_list:t,scenario_id:s},success:function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel()},error:function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel()}}):($.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{data:_,items:o,tel_exists:n?1:0,form_url_exists:i?1:0,mail_exists:a?1:0,filter_condition:getHotProfileFilterParam(e),soft_item:r,soft_order:l,per_page:c,lead_per_page:d,lead_order_params:u,tab:e,only_update_list:t,scenario_id:s,loading_type:LOADING_TYPE_LEAD}}).always(function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_LEAD)}),$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{data:_,items:o,tel_exists:n?1:0,form_url_exists:i?1:0,mail_exists:a?1:0,filter_condition:getHotProfileFilterParam(e),soft_item:r,soft_order:l,per_page:c,lead_per_page:d,lead_order_params:u,tab:e,only_update_list:t,scenario_id:s,loading_type:LOADING_TYPE_CHART}}).always(function(){activatedTabClick(e),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_CHART)}))}function getHotProfileFilterParam(e){var s=[];return $("#append-filter-condition-tab"+e).find(".filter-condition").each(function(e,t){var n=$(t).find(".registration_condition_selection").val(),i=[];$(t).find("input[type='checkbox']:checked").each(function(){var e=$(this).val();i.push(e)}),i.push($(t).find(".company_condition").val());var a={regis_condition_id:n,regis_condition_options_ids:i.join(", ")};s.push(a)}),s}function updateChartIfChecked(e){checkedConditionOptions=e.parents(".filter-condition").find("input[type='checkbox']:checked"),checkedConditionOptions.length&&(checkedConditionOptions.each(function(){$(this).prop("checked",!1)}),"1"==$('.active [name="search[search_type]"]').val()?updateChart(2):"2"==$('.active [name="search[search_type]"]').val()&&updateChart(1))}function initHaLoadingPart(){$(".ha-loading-part .ha-loading-part__loading").remove(),haLoadingHtml='<div class="ha-loading-part__loading overlay">\n<div class="cv-spinner">\n<i class="fa fa-spinner fa-pulse fa-3x loading-sidebar"></i>\n</div>\n</div>',$(".ha-loading-part").prepend(haLoadingHtml)}function changeRegistrationConditionSelection(e){var n=$(e).val(),r=$(e).attr("condition_index"),l="tab1"===r.substring(0,4)?1:2;return new Promise(function(t,i){$.ajax({url:"/front/xhr/hot_recommends/get_registration_condition_data",type:"GET",data:{condition:n},success:function(e){$("#condition_checkbox_group_".concat(r)).empty(),$("#condition_selection_group_".concat(r)).empty(),e.condition_options.forEach(function(e){var t="checkbox_condition_"+e.id+"_tab"+l,n=$("<div>").attr({"class":"item-checkbox",style:"display: flex; align-items: center;flex-direction: row; grid-gap: 6px; margin-top: 10px; margin-bottom: 10px; margin-right: 20px"}),i=$("<input>").attr({type:"checkbox",value:e.id,id:t}),a=$("<span>").attr({"class":"checkbox-custom"}),s=$("<label>").attr({"class":"checkbox-label registration-condition-checkbox"});s.append(i),s.append(a);var o=$("<label>").text(e.name).attr({style:"font-weight: normal","for":t});n.append(s),n.append(o),$("#condition_checkbox_group_".concat(r)).append(n)});var n=$("<select>").attr({"class":"form-control input-sm mr10-inline company_condition",style:"display:inline-block; width: 400px;"});e.company_conditions.forEach(function(e){var t=$("<option>").attr({value:e.id});t.text(e.name),n.append(t)}),0<e.company_conditions.length&&($("#condition_selection_group_".concat(r)).append(n),$("#condition_selection_group_".concat(r)).append('<span style="font-size: 14px; margin-left: 16px">\u3092\u691c\u7d22\u3059\u308b\u3002</span>')),0<e.company_conditions.length&&updateChart(l),t(e)},error:function(e,t,n){console.log("Error: "+n),i(n)}})})}function inactivatedTabClick(e){1==e?($("#search_search_type_1").parents("li").css("cursor","not-allowed"),$("#search_search_type_1").parent().css("pointer-events","none")):($("#search_search_type_2").parents("li").css("cursor","not-allowed"),$("#search_search_type_2").parent().css("pointer-events","none")),$("#search_search_type_3").parents("li").css("cursor","not-allowed"),$("#search_search_type_3").parent().css("pointer-events","none")}function activatedTabClick(e){1==e?($("#search_search_type_1").parents("li").removeAttr("style"),$("#search_search_type_1").parent().removeAttr("style")):($("#search_search_type_2").parents("li").removeAttr("style"),$("#search_search_type_2").parent().removeAttr("style")),$("#search_search_type_3").parents("li").removeAttr("style"),$("#search_search_type_3").parent().removeAttr("style")}function mapAreaResize(){var e=$(window).height(),t=parseInt($("body").css("padding-top"),10),n=$(".page-header").outerHeight(!0),i=25,a=$(".footer");0<a.length&&(i=a.outerHeight(!0));var s=e-t-n-i;$(".map-container").css("height",s),$("#map").css("height",s),$(".with-nav-tabs").css("height",s);var o=$(".panel-heading").outerHeight(!0);"none"===$(".panel-footer").css("display")?$(".panel-body").css("height",s-o-6):$(".panel-body").css("height",s-o-6-parseInt($(".panel-footer").css("height"),10))}function setDateOption(t,e){var n={};for(var i in e)if(Object.keys(e[i]).length<1){var a=Object.keys(t).map(function(e){return t[e].client[i]}).filter(function(e,t,n){return e&&n.indexOf(e)===t}).sort(),s={};a.forEach(function(e){s[e]={name:e}}),n[i]=s}else n[i]=e[i];return n}function setOptionColor(e,t,n){var i={};for(var a in e){var s=e[a];if("back_ground_color"===a){for(var o in s)s[o].color=back_ground_colors[o];i[a]=s}else{n&&-1!=Object.keys(n).indexOf(a)||(s.no_value={name:I18n.t("js.maps.no_value")});var r=0;for(var o in s)s[o].color=t[r],(r+=1)>=t.length&&(r=0);i[a]=s}}return i}function setOption(e,t){for(var n in t.empty(),e){var i="<div class='checkbox'><label><input type='checkbox' checked='checked' value='"+n+"'>\n<img src='"+getIcon(e[n].color+"_list")+"' style='width: 12px; height: 12px;'>\n"+e[n].name+"</label></div>";t.append(i)}}function getIcon(e){return"/images/map_icons/"+e+".png"}function setMarker(e,t,n,i){for(var a in t){var s=t[a],o=s.client[n]||"no_value",r={position:{lat:s.lat,lng:s.lng},icon:getIcon(i[o].color)};e.set(a,r)}}function selectDisplayMarker(e,n,i,a){for(var s=-1!==a.indexOf("no_value"),t=Object.keys(n).sort(function(e,t){return parseInt(t)-parseInt(e)}).filter(function(e){var t=n[e].client[i];return!(!s||null!==t)||-1!==a.indexOf(String(t))}),o=e.getBounds(),r=o.getSouthWest(),l=o.getNorthEast(),c=r.lat(),d=r.lng(),u=l.lat(),_=l.lng(),h=_<d,p=[],f=0,m=t.length;f<m;f++){var g=t[f],A=n[g];if(A.lat<u&&A.lat>c&&(!h&&A.lng<_&&A.lng>d||h&&(A.lng>_||A.lng<d))&&(p.push(g),1e3<=p.length))break}return p}function showVisitRoute(i,a,e){i.empty(),e.forEach(function(e){var t=a[e],n="<li data-lead-id='"+e+"'><i class='fa fa-bars'></i><div><span>"+t.client.name+"</span><span>"+t.name+"</span></div><i class='fa fa-times route_remove' style='float: right !important;' data-lead-id='"+e+"'></i></li>";i.append(n)})}function initMap(){var e,i=data.leads,t=data.filters,n=data.unset_no_value,a=document.getElementById("map"),s=new HPMap(a,e={center:{lat:35.6953874,lng:139.7000494},zoom:12},i),o=setOptionColor(setDateOption(i,t),colors,n),r=$("#select-item"),l=$("#option-list"),c=$(".js_item_checked"),d=$("#sortable"),u=$("#optimizeWaypoints"),_=r.find("option:selected").val();setOption(e=o[_],l),setMarker(s,i,_,e);var h=Object.keys(i).sort(function(e,t){return parseInt(t)-parseInt(e)}).slice(0,1e3);s.show(h,!0);var p=function(){var e=r.find("option:selected").val(),t=l.find("input:checked").map(function(){return this.value}).get(),n=selectDisplayMarker(s,i,e,t);s.show(n)};s.onOnce("idle",function(){s.on("idle",p),s.on("zoom_changed",p)}),r.on("change",function(){var e=r.find("option:selected").val(),t=o[e];setOption(t,l),setMarker(s,i,e,t),p()}),c.on("click",function(){l.find("input").prop("checked",$(this).data("checked")),p()}),l.on("change","input",p),d.sortable({handle:"i:first",update:function(){for(var e=[],t=d.find("li").map(function(){return $(this).data("leadId")}),n=0,i=t.length;n<i;n++)e.push(t[n]);s.changeOrder(e)}}),s.onChangeOrder(function(e,t){showVisitRoute(d,i,e),t&&u.prop("checked",!1)}),$(document).on("click",".route_remove",function(){var e=$(this).data("leadId");s.removeRoute(e)});var f=$(".js_travel_mode");f.on("click",function(){var e=$(this);e.hasClass("active")||(f.removeClass("active"),e.addClass("active"),s.changeTravelMode(e.data("travelMode")))}),u.on("click",function(){var e=$(this).prop("checked");s.changeOptimizeWaypoints(e)}),$("#js_map_modal").on("click",function(){var e=s.getOrder(),t=f.filter(".active").data("travelMode");visitRouteModal(i,e,t)}),$("#myModal").on("hidden.bs.modal",function(){$("#error_send_mail").hide()}),$("#js_send_mail").on("submit",sendMail)}function visitRouteModal(t,e,n){if(e.length<2)alert(I18n.t("js.maps.save_more"));else{var i="DRIVING"===n?"d":"w";$("#lead_ids").val(e.join(",")),$("#travel_mode").val(i);var a=$("#js_interval_route");a.empty();var s=e.map(function(e){return t[e]}),o=s.map(function(e){return[e.lat,e.lng].join(",")}).join("/");a.append('<h2 style="display: inline-block;"><i class="fa fa-map-o"></i></h2><a href="https://www.google.co.jp/maps/dir/'+o+'" target="_blank" style="margin-left: 5px;">'+I18n.t("js.maps.all_routes")+"</a>");for(var r=0;r<s.length;r++){var l="<div class='modal-route'><div><span>"+s[r].client.name+"\u3001"+s[r].name+"</span><span>"+s[r].address+"</span></div></div>";if(a.append(l),r<s.length-1){var c='<p>\u25bc  <a href="'+("https://maps.google.com/maps?saddr="+[s[r].lat,s[r].lng].join(",")+"&daddr="+[s[r+1].lat,s[r+1].lng].join(",")+"&dirflg="+i)+'" target="_blank">'+I18n.t("js.maps.section_route")+"</a></p>";a.append(c)}}$("#myModal").modal()}}function sendMail(e){e.preventDefault();var t=$(this);t.attr("disabled","disabled");var i=$("#error_send_mail");i.hide();var n=$(this);$.ajax({url:n.attr("action"),type:n.attr("method"),data:n.serialize()}).done(function(e){var t=e.errors;if(t.flg){var n='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul>'+t.messages.map(function(e){return"<li>"+e+"</li>"}).join()+"</ul></div>";i.html(n).show()}else alert(I18n.t("js.maps.sent"))}).always(function(){t.removeAttr("disabled")})}function add_merge_methods(e){e.merge_select_disable=function(){$(this).find('tr input:not(":checked")').prop("disabled",!0),$(this).find("tr").addClass("disabled"),$(this).find("th").parents("tr").removeClass("disabled"),$(this).find("tr input:checked").each(function(){$(this).parents("tr:first").removeClass("disabled")})},e.merge_select_enable=function(){$(this).find("tr input").prop("disabled",!1),$(this).find("tr").removeClass("disabled")}}function setLeadAllConfirmed(e,t){$.ajax({type:"PATCH",url:"/xhr/leads/check_update_all",data:{ids:e,type:t},dataType:"json",timeout:12e4}).done(function(){$('input[type="checkbox"]:not(:checked)[class= "lead_confirm"]').prop("checked",!0),$(".lead_confirm").parent().parent().css("background-color","#e0e0e0"),$(".lead_check_all").removeAttr("disabled"),$(".lead_confirm").removeAttr("disabled")}).fail(function(e){if($("#js_error_message").empty(),$(".lead_check_all").removeAttr("disabled"),$(".lead_confirm").removeAttr("disabled"),"timeout"==e.statusText){$('input[type="checkbox"]:not(:checked)[class= "lead_confirm"]').prop("checked",!0),$(".lead_confirm").parent().parent().css("background-color","#e0e0e0");var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}})}function setLeadConfirmed(e,t,n,i){1==t?$.ajax({type:"PATCH",url:"/xhr/leads/check_update",data:{id:e,type:n},dataType:"json",timeout:12e4}).done(function(){i.parent().parent().css("background-color","#e0e0e0"),i.parent().parent().children(":first, :last").css("background-color","#fafafa"),$(".lead_check_all").removeAttr("disabled"),$(".lead_confirm").removeAttr("disabled")}).fail(function(e){if($("#js_error_message").empty(),$(".lead_check_all").removeAttr("disabled"),$(".lead_confirm").removeAttr("disabled"),"timeout"==e.statusText){i.parent().parent().css("background-color","#e0e0e0"),i.parent().parent().children(":first, :last").css("background-color","#fafafa");var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{i.prop("checked",!1);t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}}):$.ajax({type:"PATCH",url:"/xhr/leads/check_delete",data:{id:e,type:n},dataType:"json",timeout:12e4}).done(function(){i.parent().parent().css("background-color",""),$(".lead_check_all").removeAttr("disabled"),$(".lead_confirm").removeAttr("disabled")}).fail(function(e){if($("#js_error_message").empty(),$(".lead_check_all").removeAttr("disabled"),$(".lead_confirm").removeAttr("disabled"),"timeout"==e.statusText){i.parent().parent().css("background-color","");var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{i.prop("checked",!0);t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}})}function setClientConfirmed(e,t,n,i){1==t?$.ajax({type:"PATCH",url:"/xhr/clients/check_update",data:{id:e,type:n},dataType:"json",timeout:12e4}).done(function(){i.parent().parent().css("background-color","#e0e0e0"),i.parent().parent().children(":first, :last").css("background-color","#fafafa"),$(".client_check_all").removeAttr("disabled"),$(".client_confirm").removeAttr("disabled")}).fail(function(e){if($("#js_error_message").empty(),$(".client_check_all").removeAttr("disabled"),$(".client_confirm").removeAttr("disabled"),"timeout"==e.statusText){i.parent().parent().css("background-color","#e0e0e0"),i.parent().parent().children(":first, :last").css("background-color","#fafafa");var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{i.prop("checked",!1);t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}}):$.ajax({type:"PATCH",url:"/xhr/clients/check_delete",data:{id:e,type:n},dataType:"json",timeout:12e4}).done(function(){i.parent().parent().css("background-color",""),$(".client_check_all").removeAttr("disabled"),$(".client_confirm").removeAttr("disabled")}).fail(function(e){if($("#js_error_message").empty(),$(".client_check_all").removeAttr("disabled"),$(".client_confirm").removeAttr("disabled"),"timeout"==e.statusText){i.parent().parent().css("background-color","");var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{i.prop("checked",!0);t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}})}function checkLeadConfirmed(e){var t=e.is(":checked"),n=e.val(),i=$("#search_type").val();$(".lead_check_all").attr("disabled",!0),$(".lead_confirm").attr("disabled",!0),setLeadConfirmed(n,t,i,e)}function checkClientConfirmed(e){var t=e.is(":checked"),n=e.val(),i=$("#search_type").val();$(".client_check_all").attr("disabled",!0),$(".client_confirm").attr("disabled",!0),setClientConfirmed(n,t,i,e)}function setClientAllConfirmed(e,t){$.ajax({type:"PATCH",url:"/xhr/clients/check_update_all",data:{ids:e,type:t},dataType:"json",timeout:12e4}).done(function(){$('input[type="checkbox"]:not(:checked)[class= "client_confirm"]').prop("checked",!0),$(".client_confirm").parent().parent().css("background-color","#e0e0e0"),$(".client_check_all").removeAttr("disabled"),$(".client_confirm").removeAttr("disabled")}).fail(function(e){if($("#js_error_message").empty(),$(".client_check_all").removeAttr("disabled"),$(".client_confirm").removeAttr("disabled"),"timeout"==e.statusText){$('input[type="checkbox"]:not(:checked)[class= "client_confirm"]').prop("checked",!0),$(".client_confirm").parent().parent().css("background-color","#e0e0e0");var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}})}function removeClientRankSession(){sessionStorage.removeItem("client_ranks_at_this"),sessionStorage.removeItem("client_ranks_at_that")}function removeLeadStageSession(){sessionStorage.removeItem("lead_stages_at_this"),sessionStorage.removeItem("lead_stages_at_that")}function setDateOptions(e){var t=$("#aggregation_point__1i"),n=$("#aggregation_point__2i");if(t.append($("<option>").html(I18n.t("js.life_cycle_funnel.year")).val("")),n.append($("<option>").html(I18n.t("js.life_cycle_funnel.month")).val("")),null!=e)for(e.forEach(function(e){t.append($("<option>").html(e).val(e))}),i=1;i<13;i++)n.append($("<option>").html(i).val(i))}function clearResult(){countrymap.clear()}function form_load(){var e=document.getElementsByClassName("countrylist");document.getElementById("resultlist").innerHTML="";for(var t=0;t<e.length;t++)e[t].value==I18n.t("js.seminars.initialize_country")&&(e[t].checked=!0,countryKey=allcountry[t].value,countrymap.set(countryKey,e[t].value),$("#resultlist").append("<p class='item' id='item' draggable='true'><i class='fa fa-bars' aria-hidden='true'></i>"+e[t].value+"<button type='button' class='close' aria-label='Close' onclick='remove()'><span aria-hidden='true'>&times;</span></button><input type='hidden' value="+countryKey+" ></p>"),document.querySelector("#defaultcty").innerHTML=e[t].value);document.getElementById("check_value").innerHTML=I18n.t("js.seminars.dial")+I18n.t("js.seminars.initialize_country"),document.querySelector("#countrycount").innerHTML=1,document.getElementById("selcountry").value="JP"}function cardListAction(e){checked_count=0;for(var t=document.getElementById("resultlist").innerHTML="",n="",i=0;i<inputElems.length;i++)inputElems[i].value==e.value&&(n=allcountry[i].value);1==e.checked?"on"!=e.value&&countrymap.set(n,e.value):countrymap["delete"](n);for(var a=0;a<countrymap.size;a++)key_array=Array.from(countrymap.keys()),value_array=Array.from(countrymap.values()),$("#resultlist").append("<p class='item' id='item' draggable='true'><i class='fa fa-bars' aria-hidden='true'></i>&nbsp;&nbsp;"+value_array[a]+"<button type='button' class='close' aria-label='Close' onclick='remove()'><span aria-hidden='true'>&times;</span></button><input type='hidden' value="+key_array[a]+" ></p>"),value_array[a],checked_count++;for(i=0;i<inputElems.length;i++)0==inputElems[i].checked&&(t="false");if(search_value=document.getElementById("filter").value,""==search_value)document.getElementById("select-all").checked="false"!=t;else{var s="";$(".countrylist").each(function(){if(this.value.toLowerCase().includes(search_value.toLowerCase()))for(var e=document.getElementsByClassName("countrylist"),t=0;t<e.length;t++)if(e[t].value==this.value&&0==e[t].checked){s="checked_false";break}}),document.getElementById("select-all").checked="checked_false"!=s}document.getElementById("resultlist").style.color="black",document.getElementById("btnsave").disabled=!1,0==checked_count&&(document.getElementById("btnsave").disabled=!0,$("#resultlist").append(I18n.t("js.seminars.country_uncheck"))),document.querySelector("#countrycount").innerHTML=checked_count,document.querySelector("#defaultcty").innerHTML="",default_value()}function empty_setting(){for(var e=0,t=document.getElementsByClassName("countrylist"),n=0;n<t.length;n++)1==t[n].checked&&e++;0==e?(document.getElementById("btnsave").disabled=!0,$("#resultlist").append(I18n.t("js.seminars.country_uncheck")),document.querySelector("#countrycount").innerHTML=e,document.querySelector("#defaultcty").innerHTML=""):(document.getElementById("btnsave").disabled=!1,document.querySelector("#countrycount").innerHTML=e,default_value())}function default_value(){var e=countrymap.values().next().value;return e==undefined?document.querySelector("#defaultcty").innerHTML="":document.querySelector("#defaultcty").innerHTML=e}function remove(){$("#resultlist").one("click","p",function(){$(this).remove();for(var e=document.getElementsByClassName("countrylist"),t=0;t<e.length;t++){$(this).text().slice(0,-1).includes(e[t].value)&&(countrymap["delete"](allcountry[t].value),default_value(),e[t].checked=!1)}empty_setting(),checked_count--,document.querySelector("#countrycount").innerHTML=checked_count,document.getElementById("select-all").checked=!1})}function getLI(e){for(;"p"!=e.nodeName.toLowerCase()&&"body"!=e.nodeName.toLowerCase();)e=e.parentNode;return"body"!=e.nodeName.toLowerCase()&&e}function add_fields_for_teams(e,t,n){add_fields(e,t,n),enable_count=$("#teams_channel_fields").find(".fields").length-$("#teams_channel_fields").find(".fields[style]").length,5<=enable_count&&$("#teams_channel_addition").css("visibility","hidden")}function remove_item_data_fields_for_teams(e){remove_item_data_fields(e),$("#teams_channel_addition").css("visibility","visible")}function add_fields(e,t,n){var i=(new Date).getTime(),a=new RegExp("new_"+t,"g");$(e).before(n.replace(a,i))}function add_fields_prefix(e,t,n,i,a){var s=$(".fields").length,o=0;if($(".fields").each(function(){"none"===$(this).css("display")&&o++}),s-o>=parseInt(i))return alert(a),!1;var r=(new Date).getTime(),l=new RegExp("new_"+t,"g");$(e).before(n.replace(l,r))}function remove_fields(e){var t=$(e).prev();$(e).closest(".fields").hide(),"has-error"===$(t).attr("class")?$(t).children().val(""):$(t).val(""),$(e).prev("input[type=hidden]").val("1")}function remove_item_data_fields(e){$(e).prev("input[type=hidden]").val("1"),$(e).closest(".fields").hide()}function add_fields_for_teams(e,t,n){add_fields(e,t,n),enable_count=$("#teams_channel_fields").find(".fields").length-$("#teams_channel_fields").find(".fields[style]").length,5<=enable_count&&$("#teams_channel_addition").css("visibility","hidden")}function remove_item_data_fields_for_teams(e){remove_item_data_fields(e),$("#teams_channel_addition").css("visibility","visible")}function remove_tel_prefix_fields(e,t,n,i){"true"==t?confirm(n)&&($(e).closest(".fields").hide(),$(".delete_field_"+i).val("1")):($(e).closest(".fields").hide(),$(".delete_field_"+i).val("1"))}function add_search_item_field(e,t,n,i){$(".add_search_field_position").before($("<div/>").addClass("row add_search_items js_search_visibility_search_items").css("margin-top","5px").html($("<div/>").addClass("col-xs-12 form-inline").html(t+" "+n+" "+i)))}function remove_search_item_field(e){$(e).prev();$(e).prev("input").attr("name",""),$(e).closest(".add_search_items").hide()}if(function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(w,e){function r(e){var t=!!e&&"length"in e&&e.length,n=pe.type(e);return"function"!==n&&!pe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function t(e,n,i){if(pe.isFunction(n))return pe.grep(e,function(e,t){return!!n.call(e,t,e)!==i});if(n.nodeType)return pe.grep(e,function(e){return e===n!==i});if("string"==typeof n){if(ke.test(n))return pe.filter(n,e,i);n=pe.filter(n,e)}return pe.grep(e,function(e){return-1<pe.inArray(e,n)!==i})}function n(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function d(e){var n={};return pe.each(e.match(Oe)||[],function(e,t){n[t]=!0}),n}function a(){ae.addEventListener?(ae.removeEventListener("DOMContentLoaded",s),w.removeEventListener("load",s)):(ae.detachEvent("onreadystatechange",s),w.detachEvent("onload",s))}function s(){(ae.addEventListener||"load"===w.event.type||"complete"===ae.readyState)&&(a(),pe.ready())}function l(e,t,n){if(n===undefined&&1===e.nodeType){var i="data-"+t.replace(Ne,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:Be.test(n)?pe.parseJSON(n):n)}catch(a){}pe.data(e,t,n)}else n=undefined}return n}function c(e){var t;for(t in e)if(("data"!==t||!pe.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function i(e,t,n,i){if(Re(e)){var a,s,o=pe.expando,r=e.nodeType,l=r?pe.cache:e,c=r?e[o]:e[o]&&o;if(c&&l[c]&&(i||l[c].data)||n!==undefined||"string"!=typeof t)return c||(c=r?e[o]=ie.pop()||pe.guid++:o),l[c]||(l[c]=r?{}:{toJSON:pe.noop}),"object"!=typeof t&&"function"!=typeof t||(i?l[c]=pe.extend(l[c],t):l[c].data=pe.extend(l[c].data,t)),s=l[c],i||(s.data||(s.data={}),s=s.data),n!==undefined&&(s[pe.camelCase(t)]=n),"string"==typeof t?null==(a=s[t])&&(a=s[pe.camelCase(t)]):a=s,a}}function o(e,t,n){if(Re(e)){var i,a,
s=e.nodeType,o=s?pe.cache:e,r=s?e[pe.expando]:pe.expando;if(o[r]){if(t&&(i=n?o[r]:o[r].data)){a=(t=pe.isArray(t)?t.concat(pe.map(t,pe.camelCase)):t in i?[t]:(t=pe.camelCase(t))in i?[t]:t.split(" ")).length;for(;a--;)delete i[t[a]];if(n?!c(i):!pe.isEmptyObject(i))return}(n||(delete o[r].data,c(o[r])))&&(s?pe.cleanData([e],!0):_e.deleteExpando||o!=o.window?delete o[r]:o[r]=undefined)}}}function u(e,t,n,i){var a,s=1,o=20,r=i?function(){return i.cur()}:function(){return pe.css(e,t,"")},l=r(),c=n&&n[3]||(pe.cssNumber[t]?"":"px"),d=(pe.cssNumber[t]||"px"!==c&&+l)&&Le.exec(pe.css(e,t));if(d&&d[3]!==c)for(c=c||d[3],n=n||[],d=+l||1;d/=s=s||".5",pe.style(e,t,d+c),s!==(s=r()/l)&&1!==s&&--o;);return n&&(d=+d||+l||0,a=n[1]?d+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=d,i.end=a)),a}function m(e){var t=Ye.split("|"),n=e.createDocumentFragment();if(n.createElement)for(;t.length;)n.createElement(t.pop());return n}function g(e,t){var n,i,a=0,s="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):undefined;if(!s)for(s=[],n=e.childNodes||e;null!=(i=n[a]);a++)!t||pe.nodeName(i,t)?s.push(i):pe.merge(s,g(i,t));return t===undefined||t&&pe.nodeName(e,t)?pe.merge([e],s):s}function A(e,t){for(var n,i=0;null!=(n=e[i]);i++)pe._data(n,"globalEval",!t||pe._data(t[i],"globalEval"))}function v(e){Qe.test(e.type)&&(e.defaultChecked=e.checked)}function f(e,t,n,i,a){for(var s,o,r,l,c,d,u,_=e.length,h=m(t),p=[],f=0;f<_;f++)if((o=e[f])||0===o)if("object"===pe.type(o))pe.merge(p,o.nodeType?[o]:o);else if(Ge.test(o)){for(l=l||h.appendChild(t.createElement("div")),c=(ze.exec(o)||["",""])[1].toLowerCase(),u=Ve[c]||Ve._default,l.innerHTML=u[1]+pe.htmlPrefilter(o)+u[2],s=u[0];s--;)l=l.lastChild;if(!_e.leadingWhitespace&&We.test(o)&&p.push(t.createTextNode(We.exec(o)[0])),!_e.tbody)for(s=(o="table"!==c||Xe.test(o)?"<table>"!==u[1]||Xe.test(o)?0:l:l.firstChild)&&o.childNodes.length;s--;)pe.nodeName(d=o.childNodes[s],"tbody")&&!d.childNodes.length&&o.removeChild(d);for(pe.merge(p,l.childNodes),l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=h.lastChild}else p.push(t.createTextNode(o));for(l&&h.removeChild(l),_e.appendChecked||pe.grep(g(p,"input"),v),f=0;o=p[f++];)if(i&&-1<pe.inArray(o,i))a&&a.push(o);else if(r=pe.contains(o.ownerDocument,o),l=g(h.appendChild(o),"script"),r&&A(l),n)for(s=0;o=l[s++];)qe.test(o.type||"")&&n.push(o);return l=null,h}function h(){return!0}function p(){return!1}function b(){try{return ae.activeElement}catch(e){}}function y(e,t,n,i,a,s){var o,r;if("object"==typeof t){for(r in"string"!=typeof n&&(i=i||n,n=undefined),t)y(e,r,n,i,t[r],s);return e}if(null==i&&null==a?(a=n,i=n=undefined):null==a&&("string"==typeof n?(a=i,i=undefined):(a=i,i=n,n=undefined)),!1===a)a=p;else if(!a)return e;return 1===s&&(o=a,(a=function(e){return pe().off(e),o.apply(this,arguments)}).guid=o.guid||(o.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,a,i,n)})}function $(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function k(e){return e.type=(null!==pe.find.attr(e,"type"))+"/"+e.type,e}function C(e){var t=lt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function E(e,t){if(1===t.nodeType&&pe.hasData(e)){var n,i,a,s=pe._data(e),o=pe._data(t,s),r=s.events;if(r)for(n in delete o.handle,o.events={},r)for(i=0,a=r[n].length;i<a;i++)pe.event.add(t,n,r[n][i]);o.data&&(o.data=pe.extend({},o.data))}}function T(e,t){var n,i,a;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!_e.noCloneEvent&&t[pe.expando]){for(i in(a=pe._data(t)).events)pe.removeEvent(t,i,a.handle);t.removeAttribute(pe.expando)}"script"===n&&t.text!==e.text?(k(t).text=e.text,C(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),_e.html5Clone&&e.innerHTML&&!pe.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Qe.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}}function x(n,i,a,s){i=oe.apply([],i);var e,t,o,r,l,c,d=0,u=n.length,_=u-1,h=i[0],p=pe.isFunction(h);if(p||1<u&&"string"==typeof h&&!_e.checkClone&&rt.test(h))return n.each(function(e){var t=n.eq(e);p&&(i[0]=h.call(this,e,t.html())),x(t,i,a,s)});if(u&&(e=(c=f(i,n[0].ownerDocument,!1,n,s)).firstChild,1===c.childNodes.length&&(c=e),e||s)){for(o=(r=pe.map(g(c,"script"),k)).length;d<u;d++)t=c,d!==_&&(t=pe.clone(t,!0,!0),o&&pe.merge(r,g(t,"script"))),a.call(n[d],t,d);if(o)for(l=r[r.length-1].ownerDocument,pe.map(r,C),d=0;d<o;d++)t=r[d],qe.test(t.type||"")&&!pe._data(t,"globalEval")&&pe.contains(l,t)&&(t.src?pe._evalUrl&&pe._evalUrl(t.src):pe.globalEval((t.text||t.textContent||t.innerHTML||"").replace(ct,"")));c=e=null}return n}function I(e,t,n){for(var i,a=t?pe.filter(t,e):e,s=0;null!=(i=a[s]);s++)n||1!==i.nodeType||pe.cleanData(g(i)),i.parentNode&&(n&&pe.contains(i.ownerDocument,i)&&A(g(i,"script")),i.parentNode.removeChild(i));return e}function D(e,t){var n=pe(t.createElement(e)).appendTo(t.body),i=pe.css(n[0],"display");return n.detach(),i}function O(e){var t=ae,n=_t[e];return n||("none"!==(n=D(e,t))&&n||((t=((ut=(ut||pe("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement))[0].contentWindow||ut[0].contentDocument).document).write(),t.close(),n=D(e,t),ut.detach()),_t[e]=n),n}function S(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function R(e){if(e in Tt)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=Et.length;n--;)if((e=Et[n]+t)in Tt)return e}function B(e,t){for(var n,i,a,s=[],o=0,r=e.length;o<r;o++)(i=e[o]).style&&(s[o]=pe._data(i,"olddisplay"),n=i.style.display,t?(s[o]||"none"!==n||(i.style.display=""),""===i.style.display&&Ue(i)&&(s[o]=pe._data(i,"olddisplay",O(i.nodeName)))):(a=Ue(i),(n&&"none"!==n||!a)&&pe._data(i,"olddisplay",a?n:pe.css(i,"display"))));for(o=0;o<r;o++)(i=e[o]).style&&(t&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=t?s[o]||"":"none"));return e}function N(e,t,n){var i=wt.exec(t);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):t}function F(e,t,n,i,a){for(var s=n===(i?"border":"content")?4:"width"===t?1:0,o=0;s<4;s+=2)"margin"===n&&(o+=pe.css(e,n+Pe[s],!0,a)),i?("content"===n&&(o-=pe.css(e,"padding"+Pe[s],!0,a)),"margin"!==n&&(o-=pe.css(e,"border"+Pe[s]+"Width",!0,a))):(o+=pe.css(e,"padding"+Pe[s],!0,a),"padding"!==n&&(o+=pe.css(e,"border"+Pe[s]+"Width",!0,a)));return o}function K(e,t,n){var i=!0,a="width"===t?e.offsetWidth:e.offsetHeight,s=gt(e),o=_e.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,s);if(a<=0||null==a){if(((a=At(e,t,s))<0||null==a)&&(a=e.style[t]),pt.test(a))return a;i=o&&(_e.boxSizingReliable()||a===e.style[t]),a=parseFloat(a)||0}return a+F(e,t,n||(o?"border":"content"),i,s)+"px"}function M(e,t,n,i,a){return new M.prototype.init(e,t,n,i,a)}function j(){return w.setTimeout(function(){xt=undefined}),xt=pe.now()}function L(e,t){var n,i={height:e},a=0;for(t=t?1:0;a<4;a+=2-t)i["margin"+(n=Pe[a])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function P(e,t,n){for(var i,a=(Q.tweeners[t]||[]).concat(Q.tweeners["*"]),s=0,o=a.length;s<o;s++)if(i=a[s].call(n,t,e))return i}function U(t,e,n){var i,a,s,o,r,l,c,d=this,u={},_=t.style,h=t.nodeType&&Ue(t),p=pe._data(t,"fxshow");for(i in n.queue||(null==(r=pe._queueHooks(t,"fx")).unqueued&&(r.unqueued=0,l=r.empty.fire,r.empty.fire=function(){r.unqueued||l()}),r.unqueued++,d.always(function(){d.always(function(){r.unqueued--,pe.queue(t,"fx").length||r.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[_.overflow,_.overflowX,_.overflowY],"inline"===("none"===(c=pe.css(t,"display"))?pe._data(t,"olddisplay")||O(t.nodeName):c)&&"none"===pe.css(t,"float")&&(_e.inlineBlockNeedsLayout&&"inline"!==O(t.nodeName)?_.zoom=1:_.display="inline-block")),n.overflow&&(_.overflow="hidden",_e.shrinkWrapBlocks()||d.always(function(){_.overflow=n.overflow[0],_.overflowX=n.overflow[1],_.overflowY=n.overflow[2]})),e)if(a=e[i],Nt.exec(a)){if(delete e[i],s=s||"toggle"===a,a===(h?"hide":"show")){if("show"!==a||!p||p[i]===undefined)continue;h=!0}u[i]=p&&p[i]||pe.style(t,i)}else c=undefined;if(pe.isEmptyObject(u))"inline"===("none"===c?O(t.nodeName):c)&&(_.display=c);else for(i in p?"hidden"in p&&(h=p.hidden):p=pe._data(t,"fxshow",{}),s&&(p.hidden=!h),h?pe(t).show():d.done(function(){pe(t).hide()}),d.done(function(){var e;for(e in pe._removeData(t,"fxshow"),u)pe.style(t,e,u[e])}),u)o=P(h?p[i]:0,i,d),i in p||(p[i]=o.start,h&&(o.end=o.start,o.start="width"===i||"height"===i?1:0))}function H(e,t){var n,i,a,s,o;for(n in e)if(a=t[i=pe.camelCase(n)],s=e[n],pe.isArray(s)&&(a=s[1],s=e[n]=s[0]),n!==i&&(e[i]=s,delete e[n]),(o=pe.cssHooks[i])&&"expand"in o)for(n in s=o.expand(s),delete e[i],s)n in e||(e[n]=s[n],t[n]=a);else t[i]=a}function Q(s,e,t){var n,o,i=0,a=Q.prefilters.length,r=pe.Deferred().always(function(){delete l.elem}),l=function(){if(o)return!1;for(var e=xt||j(),t=Math.max(0,c.startTime+c.duration-e),n=1-(t/c.duration||0),i=0,a=c.tweens.length;i<a;i++)c.tweens[i].run(n);return r.notifyWith(s,[c,n,t]),n<1&&a?t:(r.resolveWith(s,[c]),!1)},c=r.promise({elem:s,props:pe.extend({},e),opts:pe.extend(!0,{specialEasing:{},easing:pe.easing._default},t),originalProperties:e,originalOptions:t,startTime:xt||j(),duration:t.duration,tweens:[],createTween:function(e,t){var n=pe.Tween(s,c.opts,e,t,c.opts.specialEasing[e]||c.opts.easing);return c.tweens.push(n),n},stop:function(e){var t=0,n=e?c.tweens.length:0;if(o)return this;for(o=!0;t<n;t++)c.tweens[t].run(1);return e?(r.notifyWith(s,[c,1,0]),r.resolveWith(s,[c,e])):r.rejectWith(s,[c,e]),this}}),d=c.props;for(H(d,c.opts.specialEasing);i<a;i++)if(n=Q.prefilters[i].call(c,s,d,c.opts))return pe.isFunction(n.stop)&&(pe._queueHooks(c.elem,c.opts.queue).stop=pe.proxy(n.stop,n)),n;return pe.map(d,P,c),pe.isFunction(c.opts.start)&&c.opts.start.call(s,c),pe.fx.timer(pe.extend(l,{elem:s,anim:c,queue:c.opts.queue})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function z(e){return pe.attr(e,"class")||""}function q(s){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,i=0,a=e.toLowerCase().match(Oe)||[];if(pe.isFunction(t))for(;n=a[i++];)"+"===n.charAt(0)?(n=n.slice(1)||"*",(s[n]=s[n]||[]).unshift(t)):(s[n]=s[n]||[]).push(t)}}function W(t,a,s,o){function r(e){var i;return l[e]=!0,pe.each(t[e]||[],function(e,t){var n=t(a,s,o);return"string"!=typeof n||c||l[n]?c?!(i=n):void 0:(a.dataTypes.unshift(n),r(n),!1)}),i}var l={},c=t===rn;return r(a.dataTypes[0])||!l["*"]&&r("*")}function Y(e,t){var n,i,a=pe.ajaxSettings.flatOptions||{};for(i in t)t[i]!==undefined&&((a[i]?e:n||(n={}))[i]=t[i]);return n&&pe.extend(!0,e,n),e}function V(e,t,n){for(var i,a,s,o,r=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),a===undefined&&(a=e.mimeType||t.getResponseHeader("Content-Type"));if(a)for(o in r)if(r[o]&&r[o].test(a)){l.unshift(o);break}if(l[0]in n)s=l[0];else{for(o in n){if(!l[0]||e.converters[o+" "+l[0]]){s=o;break}i||(i=o)}s=s||i}if(s)return s!==l[0]&&l.unshift(s),n[s]}function G(e,t,n,i){var a,s,o,r,l,c={},d=e.dataTypes.slice();if(d[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(s=d.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=d.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=c[l+" "+s]||c["* "+s]))for(a in c)if((r=a.split(" "))[1]===s&&(o=c[l+" "+r[0]]||c["* "+r[0]])){!0===o?o=c[a]:!0!==c[a]&&(s=r[0],d.unshift(r[1]));break}if(!0!==o)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(u){return{state:"parsererror",error:o?u:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}function X(e){return e.style&&e.style.display||pe.css(e,"display")}function J(e){if(!pe.contains(e.ownerDocument||ae,e))return!0;for(;e&&1===e.nodeType;){if("none"===X(e)||"hidden"===e.type)return!0;e=e.parentNode}return!1}function Z(n,e,i,a){var t;if(pe.isArray(e))pe.each(e,function(e,t){i||_n.test(n)?a(n,t):Z(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,i,a)});else if(i||"object"!==pe.type(e))a(n,e);else for(t in e)Z(n+"["+t+"]",e[t],i,a)}function ee(){try{return new w.XMLHttpRequest}catch(e){}}function te(){try{return new w.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}function ne(e){return pe.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}var ie=[],ae=w.document,se=ie.slice,oe=ie.concat,re=ie.push,le=ie.indexOf,ce={},de=ce.toString,ue=ce.hasOwnProperty,_e={},he="1.12.4",pe=function(e,t){return new pe.fn.init(e,t)},fe=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,me=/^-ms-/,ge=/-([\da-z])/gi,Ae=function(e,t){return t.toUpperCase()};pe.fn=pe.prototype={jquery:he,constructor:pe,selector:"",length:0,toArray:function(){return se.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:se.call(this)},pushStack:function(e){var t=pe.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e){return pe.each(this,e)},map:function(n){return this.pushStack(pe.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(se.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:re,sort:ie.sort,splice:ie.splice},pe.extend=pe.fn.extend=function(e){var t,n,i,a,s,o,r=e||{},l=1,c=arguments.length,d=!1;for("boolean"==typeof r&&(d=r,r=arguments[l]||{},l++),"object"==typeof r||pe.isFunction(r)||(r={}),l===c&&(r=this,l--);l<c;l++)if(null!=(s=arguments[l]))for(a in s)t=r[a],r!==(i=s[a])&&(d&&i&&(pe.isPlainObject(i)||(n=pe.isArray(i)))?(n?(n=!1,o=t&&pe.isArray(t)?t:[]):o=t&&pe.isPlainObject(t)?t:{},r[a]=pe.extend(d,o,i)):i!==undefined&&(r[a]=i));return r},pe.extend({expando:"jQuery"+(he+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===pe.type(e)},isArray:Array.isArray||function(e){return"array"===pe.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){var t=e&&e.toString();return!pe.isArray(e)&&0<=t-parseFloat(t)+1},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},isPlainObject:function(e){var t;if(!e||"object"!==pe.type(e)||e.nodeType||pe.isWindow(e))return!1;try{if(e.constructor&&!ue.call(e,"constructor")&&!ue.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}if(!_e.ownFirst)for(t in e)return ue.call(e,t);for(t in e);return t===undefined||ue.call(e,t)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ce[de.call(e)]||"object":typeof e},globalEval:function(e){e&&pe.trim(e)&&(w.execScript||function(e){w.eval.call(w,e)})(e)},camelCase:function(e){return e.replace(me,"ms-").replace(ge,Ae)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,i=0;if(r(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},trim:function(e){return null==e?"":(e+"").replace(fe,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(r(Object(e))?pe.merge(n,"string"==typeof e?[e]:e):re.call(n,e)),n},inArray:function(e,t,n){var i;if(t){if(le)return le.call(t,e,n);for(i=t.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,t){for(var n=+t.length,i=0,a=e.length;i<n;)e[a++]=t[i++];if(n!=n)for(;t[i]!==undefined;)e[a++]=t[i++];return e.length=a,e},grep:function(e,t,n){for(var i=[],a=0,s=e.length,o=!n;a<s;a++)!t(e[a],a)!==o&&i.push(e[a]);return i},map:function(e,t,n){var i,a,s=0,o=[];if(r(e))for(i=e.length;s<i;s++)null!=(a=t(e[s],s,n))&&o.push(a);else for(s in e)null!=(a=t(e[s],s,n))&&o.push(a);return oe.apply([],o)},guid:1,proxy:function(e,t){var n,i,a;return"string"==typeof t&&(a=e[t],t=e,e=a),pe.isFunction(e)?(n=se.call(arguments,2),(i=function(){return e.apply(t||this,n.concat(se.call(arguments)))}).guid=e.guid=e.guid||pe.guid++,i):undefined},now:function(){return+new Date},support:_e}),"function"==typeof Symbol&&(pe.fn[Symbol.iterator]=ie[Symbol.iterator]),pe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){ce["[object "+t+"]"]=t.toLowerCase()});var ve=function(n){function b(e,t,n,i){var a,s,o,r,l,c,d,u,_=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!i&&((t?t.ownerDocument||t:L)!==S&&O(t),t=t||S,B)){if(11!==h&&(c=ge.exec(e)))if(a=c[1]){if(9===h){if(!(o=t.getElementById(a)))return n;if(o.id===a)return n.push(o),n}else if(_&&(o=_.getElementById(a))&&M(t,o)&&o.id===a)return n.push(o),n}else{if(c[2])return J.apply(n,t.getElementsByTagName(e)),n;if((a=c[3])&&g.getElementsByClassName&&t.getElementsByClassName)return J.apply(n,t.getElementsByClassName(a)),n}if(g.qsa&&!z[e+" "]&&(!N||!N.test(e))){if(1!==h)_=t,u=e;else if("object"!==t.nodeName.toLowerCase()){for((r=t.getAttribute("id"))?r=r.replace(ve,"\\$&"):t.setAttribute("id",r=j),s=(d=C(e)).length,l=_e.test(r)?"#"+r:"[id='"+r+"']";s--;)d[s]=l+" "+m(d[s]);u=d.join(","),_=Ae.test(e)&&f(t.parentNode)||t}if(u)try{return J.apply(n,_.querySelectorAll(u)),n}catch(p){}finally{r===j&&t.removeAttribute("id")}}}return T(e.replace(re,"$1"),t,n,i)}function e(){function n(e,t){return i.push(e+" ")>$.cacheLength&&delete n[i.shift()],n[e+" "]=t}var i=[];return n}function l(e){return e[j]=!0,e}function a(e){var t=S.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function t(e,t){for(var n=e.split("|"),i=n.length;i--;)$.attrHandle[n[i]]=t}function c(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||W)-(~e.sourceIndex||W);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function i(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function s(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function o(o){return l(function(s){return s=+s,l(function(e,t){for(var n,i=o([],e.length,s),a=i.length;a--;)e[n=i[a]]&&(e[n]=!(t[n]=e[n]))})})}function f(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function r(){}function m(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function u(r,e,t){var l=e.dir,c=t&&"parentNode"===l,d=U++;return e.first?function(e,t,n){for(;e=e[l];)if(1===e.nodeType||c)return r(e,t,n)}:function(e,t,n){var i,a,s,o=[P,d];if(n){for(;e=e[l];)if((1===e.nodeType||c)&&r(e,t,n))return!0}else for(;e=e[l];)if(1===e.nodeType||c){if((i=(a=(s=e[j]||(e[j]={}))[e.uniqueID]||(s[e.uniqueID]={}))[l])&&i[0]===P&&i[1]===d)return o[2]=i[2];if((a[l]=o)[2]=r(e,t,n))return!0}}}function _(a){return 1<a.length?function(e,t,n){for(var i=a.length;i--;)if(!a[i](e,t,n))return!1;return!0}:a[0]}function A(e,t,n){for(var i=0,a=t.length;i<a;i++)b(e,t[i],n);return n}function y(e,t,n,i,a){for(var s,o=[],r=0,l=e.length,c=null!=t;r<l;r++)(s=e[r])&&(n&&!n(s,i,a)||(o.push(s),c&&t.push(r)));return o}function v(h,p,f,m,g,e){return m&&!m[j]&&(m=v(m)),g&&!g[j]&&(g=v(g,e)),l(function(e,t,n,i){var a,s,o,r=[],l=[],c=t.length,d=e||A(p||"*",n.nodeType?[n]:n,[]),u=!h||!e&&p?d:y(d,r,h,n,i),_=f?g||(e?h:c||m)?[]:t:u;if(f&&f(u,_,n,i),m)for(a=y(_,l),m(a,[],n,i),s=a.length;s--;)(o=a[s])&&(_[l[s]]=!(u[l[s]]=o));if(e){if(g||h){if(g){for(a=[],s=_.length;s--;)(o=_[s])&&a.push(u[s]=o);g(null,_=[],a,i)}for(s=_.length;s--;)(o=_[s])&&-1<(a=g?ee(e,o):r[s])&&(e[a]=!(t[a]=o))}}else _=y(_===t?_.splice(c,_.length):_),g?g(null,t,_,i):J.apply(t,_)})}function h(e){for(var a,t,n,i=e.length,s=$.relative[e[0].type],o=s||$.relative[" "],r=s?1:0,l=u(function(e){return e===a},o,!0),c=u(function(e){return-1<ee(a,e)},o,!0),d=[function(e,t,n){var i=!s&&(n||t!==x)||((a=t).nodeType?l(e,t,n):c(e,t,n));return a=null,i}];r<i;r++)if(t=$.relative[e[r].type])d=[u(_(d),t)];else{if((t=$.filter[e[r].type].apply(null,e[r].matches))[j]){for(n=++r;n<i&&!$.relative[e[n].type];n++);return v(1<r&&_(d),1<r&&m(e.slice(0,r-1).concat({value:" "===e[r-2].type?"*":""})).replace(re,"$1"),t,r<n&&h(e.slice(r,n)),n<i&&h(e=e.slice(n)),n<i&&m(e))}d.push(t)}return _(d)}function d(m,g){var A=0<g.length,v=0<m.length,e=function(e,t,n,i,a){var s,o,r,l=0,c="0",d=e&&[],u=[],_=x,h=e||v&&$.find.TAG("*",a),p=P+=null==_?1:Math.random()||.1,f=h.length;for(a&&(x=t===S||t||a);c!==f&&null!=(s=h[c]);c++){if(v&&s){for(o=0,t||s.ownerDocument===S||(O(s),n=!B);r=m[o++];)if(r(s,t||S,n)){i.push(s);break}a&&(P=p)}A&&((s=!r&&s)&&l--,e&&d.push(s))}if(l+=c,A&&c!==l){for(o=0;r=g[o++];)r(d,u,t,n);if(e){if(0<l)for(;c--;)d[c]||u[c]||(u[c]=G.call(i));u=y(u)}J.apply(i,u),a&&!e&&0<u.length&&1<l+g.length&&b.uniqueSort(i)}return a&&(P=p,x=_),d};return A?l(e):e}var p,g,$,w,k,C,E,T,x,I,D,O,S,R,B,N,F,K,M,j="sizzle"+1*new Date,L=n.document,P=0,U=0,H=e(),Q=e(),z=e(),q=function(e,t){return e===t&&(D=!0),0},W=1<<31,Y={}.hasOwnProperty,V=[],G=V.pop,X=V.push,J=V.push,Z=V.slice,ee=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",ie="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ae="\\["+ne+"*("+ie+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",se=":("+ie+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ae+")*)|.*)\\)|)",oe=new RegExp(ne+"+","g"),re=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),le=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),de=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),ue=new RegExp(se),_e=new RegExp("^"+ie+"$"),he={ID:new RegExp("^#("+ie+")"),CLASS:new RegExp("^\\.("+ie+")"),TAG:new RegExp("^("+ie+"|[*])"),ATTR:new RegExp("^"+ae),PSEUDO:new RegExp("^"+se),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,fe=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Ae=/[+~]/,ve=/'|\\/g,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),ye=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},$e=function(){O()};try{J.apply(V=Z.call(L.childNodes),L.childNodes),V[L.childNodes.length].nodeType}catch(we){J={apply:V.length?function(e,t){X.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}for(p in g=b.support={},k=b.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},O=b.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:L;return i!==S&&9===i.nodeType&&i.documentElement&&(R=(S=i).documentElement,B=!k(S),(n=S.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",$e,!1):n.attachEvent&&n.attachEvent("onunload",$e)),g.attributes=a(function(e){return e.className="i",!e.getAttribute("className")}),g.getElementsByTagName=a(function(e){return e.appendChild(S.createComment("")),!e.getElementsByTagName("*").length}),g.getElementsByClassName=me.test(S.getElementsByClassName),g.getById=a(function(e){return R.appendChild(e).id=j,!S.getElementsByName||!S.getElementsByName(j).length}),g.getById?($.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&B){var n=t.getElementById(e);return n?[n]:[]}},$.filter.ID=function(e){var t=e.replace(be,ye);return function(e){return e.getAttribute("id")===t}}):(delete $.find.ID,$.filter.ID=function(e){var n=e.replace(be,ye);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}}),$.find.TAG=g.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):g.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],a=0,s=t.getElementsByTagName(e);if("*"!==e)return s;for(;n=s[a++];)1===n.nodeType&&i.push(n);return i},$.find.CLASS=g.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&B)return t.getElementsByClassName(e)},F=[],N=[],(g.qsa=me.test(S.querySelectorAll))&&(a(function(e){R.appendChild(e).innerHTML="<a id='"+j+"'></a><select id='"+j+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&N.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||N.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+j+"-]").length||N.push("~="),e.querySelectorAll(":checked").length||N.push(":checked"),e.querySelectorAll("a#"+j+"+*").length||N.push(".#.+[+~]")}),a(function(e){var t=S.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&N.push("name"+ne+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||N.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),N.push(",.*:")})),(g.matchesSelector=me.test(K=R.matches||R.webkitMatchesSelector||R.mozMatchesSelector||R.oMatchesSelector||R.msMatchesSelector))&&a(function(e){g.disconnectedMatch=K.call(e,"div"),K.call(e,"[s!='']:x"),F.push("!=",se)}),N=N.length&&new RegExp(N.join("|")),F=F.length&&new RegExp(F.join("|")),t=me.test(R.compareDocumentPosition),M=t||me.test(R.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!g.sortDetached&&t.compareDocumentPosition(e)===n?e===S||e.ownerDocument===L&&M(L,e)?-1:t===S||t.ownerDocument===L&&M(L,t)?1:I?ee(I,e)-ee(I,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,i=0,a=e.parentNode,s=t.parentNode,o=[e],r=[t];if(!a||!s)return e===S?-1:t===S?1:a?-1:s?1:I?ee(I,e)-ee(I,t):0;if(a===s)return c(e,t);for(n=e;n=n.parentNode;)o.unshift(n);for(n=t;n=n.parentNode;)r.unshift(n);for(;o[i]===r[i];)i++;return i?c(o[i],r[i]):o[i]===L?-1:r[i]===L?1:0}),S},b.matches=function(e,t){return b(e,null,null,t)},b.matchesSelector=function(e,t){if((e.ownerDocument||e)!==S&&O(e),t=t.replace(de,"='$1']"),g.matchesSelector&&B&&!z[t+" "]&&(!F||!F.test(t))&&(!N||!N.test(t)))try{var n=K.call(e,t);if(n||g.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(we){}return 0<b(t,S,null,[e]).length},b.contains=function(e,t){return(e.ownerDocument||e)!==S&&O(e),M(e,t)},b.attr=function(e,t){(e.ownerDocument||e)!==S&&O(e);var n=$.attrHandle[t.toLowerCase()],i=n&&Y.call($.attrHandle,t.toLowerCase())?n(e,t,!B):undefined;return i!==undefined?i:g.attributes||!B?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},b.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},b.uniqueSort=function(e){var t,n=[],i=0,a=0;if(D=!g.detectDuplicates,I=!g.sortStable&&e.slice(0),e.sort(q),D){for(;t=e[a++];)t===e[a]&&(i=n.push(a));for(;i--;)e.splice(n[i],1)}return I=null,e},w=b.getText=function(e){var t,n="",i=0,a=e.nodeType;if(a){if(1===a||9===a||11===a){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=w(e)}else if(3===a||4===a)return e.nodeValue}else for(;t=e[i++];)n+=w(t);return n},($=b.selectors={cacheLength:50,createPseudo:l,match:he,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(be,ye),e[3]=(e[3]||e[4]||e[5]||"").replace(be,ye),"~="===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]||b.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]&&b.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&ue.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,ye).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=H[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&H(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,i,a){return function(e){var t=b.attr(e,n);return null==t?"!="===i:!i||(t+="","="===i?t===a:"!="===i?t!==a:"^="===i?a&&0===t.indexOf(a):"*="===i?a&&-1<t.indexOf(a):"$="===i?a&&t.slice(-a.length)===a:"~="===i?-1<(" "+t.replace(oe," ")+" ").indexOf(a):"|="===i&&(t===a||t.slice(0,a.length+1)===a+"-"))}},CHILD:function(p,e,t,f,m){var g="nth"!==p.slice(0,3),A="last"!==p.slice(-4),v="of-type"===e;return 1===f&&0===m?function(e){return!!e.parentNode}:function(e,t,n){var i,a,s,o,r,l,c=g!==A?"nextSibling":"previousSibling",d=e.parentNode,u=v&&e.nodeName.toLowerCase(),_=!n&&!v,h=!1;if(d){if(g){for(;c;){for(o=e;o=o[c];)if(v?o.nodeName.toLowerCase()===u:1===o.nodeType)return!1;l=c="only"===p&&!l&&"nextSibling"}return!0}if(l=[A?d.firstChild:d.lastChild],A&&_){for(h=(r=(i=(a=(s=(o=d)[j]||(o[j]={}))[o.uniqueID]||(s[o.uniqueID]={}))[p]||[])[0]===P&&i[1])&&i[2],o=r&&d.childNodes[r];o=++r&&o&&o[c]||(h=r=0)||l.pop();)if(1===o.nodeType&&++h&&o===e){a[p]=[P,r,h];break}}else if(_&&(h=r=(i=(a=(s=(o=e)[j]||(o[j]={}))[o.uniqueID]||(s[o.uniqueID]={}))[p]||[])[0]===P&&i[1]),!1===h)for(;(o=++r&&o&&o[c]||(h=r=0)||l.pop())&&((v?o.nodeName.toLowerCase()!==u:1!==o.nodeType)||!++h||(_&&((a=(s=o[j]||(o[j]={}))[o.uniqueID]||(s[o.uniqueID]={}))[p]=[P,h]),o!==e)););return(h-=m)===f||h%f==0&&0<=h/f}}},PSEUDO:function(e,s){var t,o=$.pseudos[e]||$.setFilters[e.toLowerCase()]||b.error("unsupported pseudo: "+e);return o[j]?o(s):1<o.length?(t=[e,e,"",s],$.setFilters.hasOwnProperty(e.toLowerCase())?l(function(e,t){for(var n,i=o(e,s),a=i.length;a--;)e[n=ee(e,i[a])]=!(t[n]=i[a])}):function(e){return o(e,0,t)}):o}},pseudos:{not:l(function(e){var i=[],a=[],r=E(e.replace(re,"$1"));return r[j]?l(function(e,t,n,i){for(var a,s=r(e,null,i,[]),o=e.length;o--;)(a=s[o])&&(e[o]=!(t[o]=a))}):function(e,t,n){return i[0]=e,r(i,null,n,a),i[0]=null,!a.pop()}}),has:l(function(t){return function(e){return 0<b(t,e).length}}),contains:l(function(t){return t=t.replace(be,ye),function(e){return-1<(e.textContent||e.innerText||w(e)).indexOf(t)}}),lang:l(function(n){return _e.test(n||"")||b.error("unsupported lang: "+n),n=n.replace(be,ye).toLowerCase(),function(e){var t;do{if(t=B?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===R},focus:function(e){return e===S.activeElement&&(!S.hasFocus||S.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},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,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!$.pseudos.empty(e)},header:function(e){return fe.test(e.nodeName)},input:function(e){return pe.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:o(function(){return[0]}),last:o(function(e,t){return[t-1]}),eq:o(function(e,t,n){return[n<0?n+t:n]}),even:o(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:o(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:o(function(e,t,n){for(var i=n<0?n+t:n;0<=--i;)e.push(i);return e}),gt:o(function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i)
;return e})}}).pseudos.nth=$.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})$.pseudos[p]=i(p);for(p in{submit:!0,reset:!0})$.pseudos[p]=s(p);return r.prototype=$.filters=$.pseudos,$.setFilters=new r,C=b.tokenize=function(e,t){var n,i,a,s,o,r,l,c=Q[e+" "];if(c)return t?0:c.slice(0);for(o=e,r=[],l=$.preFilter;o;){for(s in n&&!(i=le.exec(o))||(i&&(o=o.slice(i[0].length)||o),r.push(a=[])),n=!1,(i=ce.exec(o))&&(n=i.shift(),a.push({value:n,type:i[0].replace(re," ")}),o=o.slice(n.length)),$.filter)!(i=he[s].exec(o))||l[s]&&!(i=l[s](i))||(n=i.shift(),a.push({value:n,type:s,matches:i}),o=o.slice(n.length));if(!n)break}return t?o.length:o?b.error(e):Q(e,r).slice(0)},E=b.compile=function(e,t){var n,i=[],a=[],s=z[e+" "];if(!s){for(t||(t=C(e)),n=t.length;n--;)(s=h(t[n]))[j]?i.push(s):a.push(s);(s=z(e,d(a,i))).selector=e}return s},T=b.select=function(e,t,n,i){var a,s,o,r,l,c="function"==typeof e&&e,d=!i&&C(e=c.selector||e);if(n=n||[],1===d.length){if(2<(s=d[0]=d[0].slice(0)).length&&"ID"===(o=s[0]).type&&g.getById&&9===t.nodeType&&B&&$.relative[s[1].type]){if(!(t=($.find.ID(o.matches[0].replace(be,ye),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(s.shift().value.length)}for(a=he.needsContext.test(e)?0:s.length;a--&&(o=s[a],!$.relative[r=o.type]);)if((l=$.find[r])&&(i=l(o.matches[0].replace(be,ye),Ae.test(s[0].type)&&f(t.parentNode)||t))){if(s.splice(a,1),!(e=i.length&&m(s)))return J.apply(n,i),n;break}}return(c||E(e,d))(i,t,!B,n,!t||Ae.test(e)&&f(t.parentNode)||t),n},g.sortStable=j.split("").sort(q).join("")===j,g.detectDuplicates=!!D,O(),g.sortDetached=a(function(e){return 1&e.compareDocumentPosition(S.createElement("div"))}),a(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||t("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),g.attributes&&a(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||t("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),a(function(e){return null==e.getAttribute("disabled")})||t(te,function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),b}(w);pe.find=ve,pe.expr=ve.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=ve.uniqueSort,pe.text=ve.getText,pe.isXMLDoc=ve.isXML,pe.contains=ve.contains;var be=function(e,t,n){for(var i=[],a=n!==undefined;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(a&&pe(e).is(n))break;i.push(e)}return i},ye=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},$e=pe.expr.match.needsContext,we=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,ke=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?pe.find.matchesSelector(i,e)?[i]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n=[],i=this,a=i.length;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t<a;t++)if(pe.contains(i[t],this))return!0}));for(t=0;t<a;t++)pe.find(e,i[t],n);return(n=this.pushStack(1<a?pe.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(t(this,e||[],!1))},not:function(e){return this.pushStack(t(this,e||[],!0))},is:function(e){return!!t(this,"string"==typeof e&&$e.test(e)?pe(e):e||[],!1).length}});var Ce,Ee=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(pe.fn.init=function(e,t,n){var i,a;if(!e)return this;if(n=n||Ce,"string"!=typeof e)return e.nodeType?(this.context=this[0]=e,this.length=1,this):pe.isFunction(e)?"undefined"!=typeof n.ready?n.ready(e):e(pe):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),pe.makeArray(e,this));if(!(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&3<=e.length?[null,e,null]:Ee.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:ae,!0)),we.test(i[1])&&pe.isPlainObject(t))for(i in t)pe.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}if((a=ae.getElementById(i[2]))&&a.parentNode){if(a.id!==i[2])return Ce.find(e);this.length=1,this[0]=a}return this.context=ae,this.selector=e,this}).prototype=pe.fn,Ce=pe(ae);var Te=/^(?:parents|prev(?:Until|All))/,xe={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t,n=pe(e,this),i=n.length;return this.filter(function(){for(t=0;t<i;t++)if(pe.contains(this,n[t]))return!0})},closest:function(e,t){for(var n,i=0,a=this.length,s=[],o=$e.test(e)||"string"!=typeof e?pe(e,t||this.context):0;i<a;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?-1<o.index(n):1===n.nodeType&&pe.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(1<s.length?pe.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?pe.inArray(this[0],pe(e)):pe.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return be(e,"parentNode")},parentsUntil:function(e,t,n){return be(e,"parentNode",n)},next:function(e){return n(e,"nextSibling")},prev:function(e){return n(e,"previousSibling")},nextAll:function(e){return be(e,"nextSibling")},prevAll:function(e){return be(e,"previousSibling")},nextUntil:function(e,t,n){return be(e,"nextSibling",n)},prevUntil:function(e,t,n){return be(e,"previousSibling",n)},siblings:function(e){return ye((e.parentNode||{}).firstChild,e)},children:function(e){return ye(e.firstChild)},contents:function(e){return pe.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:pe.merge([],e.childNodes)}},function(i,a){pe.fn[i]=function(e,t){var n=pe.map(this,a,e);return"Until"!==i.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=pe.filter(t,n)),1<this.length&&(xe[i]||(n=pe.uniqueSort(n)),Te.test(i)&&(n=n.reverse())),this.pushStack(n)}});var Ie,De,Oe=/\S+/g;for(De in pe.Callbacks=function(i){i="string"==typeof i?d(i):pe.extend({},i);var a,e,t,n,s=[],o=[],r=-1,l=function(){for(n=i.once,t=a=!0;o.length;r=-1)for(e=o.shift();++r<s.length;)!1===s[r].apply(e[0],e[1])&&i.stopOnFalse&&(r=s.length,e=!1);i.memory||(e=!1),a=!1,n&&(s=e?[]:"")},c={add:function(){return s&&(e&&!a&&(r=s.length-1,o.push(e)),function n(e){pe.each(e,function(e,t){pe.isFunction(t)?i.unique&&c.has(t)||s.push(t):t&&t.length&&"string"!==pe.type(t)&&n(t)})}(arguments),e&&!a&&l()),this},remove:function(){return pe.each(arguments,function(e,t){for(var n;-1<(n=pe.inArray(t,s,n));)s.splice(n,1),n<=r&&r--}),this},has:function(e){return e?-1<pe.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return n=o=[],s=e="",this},disabled:function(){return!s},lock:function(){return n=!0,e||c.disable(),this},locked:function(){return!!n},fireWith:function(e,t){return n||(t=[e,(t=t||[]).slice?t.slice():t],o.push(t),a||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!t}};return c},pe.extend({Deferred:function(e){var s=[["resolve","done",pe.Callbacks("once memory"),"resolved"],["reject","fail",pe.Callbacks("once memory"),"rejected"],["notify","progress",pe.Callbacks("memory")]],a="pending",o={state:function(){return a},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var a=arguments;return pe.Deferred(function(i){pe.each(s,function(e,t){var n=pe.isFunction(a[e])&&a[e];r[t[1]](function(){var e=n&&n.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[t[0]+"With"](this===o?i.promise():this,n?[e]:arguments)})}),a=null}).promise()},promise:function(e){return null!=e?pe.extend(e,o):o}},r={};return o.pipe=o.then,pe.each(s,function(e,t){var n=t[2],i=t[3];o[t[1]]=n.add,i&&n.add(function(){a=i},s[1^e][2].disable,s[2][2].lock),r[t[0]]=function(){return r[t[0]+"With"](this===r?o:this,arguments),this},r[t[0]+"With"]=n.fireWith}),o.promise(r),e&&e.call(r,r),r},when:function(e){var a,t,n,i=0,s=se.call(arguments),o=s.length,r=1!==o||e&&pe.isFunction(e.promise)?o:0,l=1===r?e:pe.Deferred(),c=function(t,n,i){return function(e){n[t]=this,i[t]=1<arguments.length?se.call(arguments):e,i===a?l.notifyWith(n,i):--r||l.resolveWith(n,i)}};if(1<o)for(a=new Array(o),t=new Array(o),n=new Array(o);i<o;i++)s[i]&&pe.isFunction(s[i].promise)?s[i].promise().progress(c(i,t,a)).done(c(i,n,s)).fail(l.reject):--r;return r||l.resolveWith(n,s),l.promise()}}),pe.fn.ready=function(e){return pe.ready.promise().done(e),this},pe.extend({isReady:!1,readyWait:1,holdReady:function(e){e?pe.readyWait++:pe.ready(!0)},ready:function(e){(!0===e?--pe.readyWait:pe.isReady)||(pe.isReady=!0)!==e&&0<--pe.readyWait||(Ie.resolveWith(ae,[pe]),pe.fn.triggerHandler&&(pe(ae).triggerHandler("ready"),pe(ae).off("ready")))}}),pe.ready.promise=function(e){if(!Ie)if(Ie=pe.Deferred(),"complete"===ae.readyState||"loading"!==ae.readyState&&!ae.documentElement.doScroll)w.setTimeout(pe.ready);else if(ae.addEventListener)ae.addEventListener("DOMContentLoaded",s),w.addEventListener("load",s);else{ae.attachEvent("onreadystatechange",s),w.attachEvent("onload",s);var t=!1;try{t=null==w.frameElement&&ae.documentElement}catch(n){}t&&t.doScroll&&function i(){if(!pe.isReady){try{t.doScroll("left")}catch(n){return w.setTimeout(i,50)}a(),pe.ready()}}()}return Ie.promise(e)},pe.ready.promise(),pe(_e))break;_e.ownFirst="0"===De,_e.inlineBlockNeedsLayout=!1,pe(function(){var e,t,n,i;(n=ae.getElementsByTagName("body")[0])&&n.style&&(t=ae.createElement("div"),(i=ae.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),"undefined"!=typeof t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",_e.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(i))}),function(){var e=ae.createElement("div");_e.deleteExpando=!0;try{delete e.test}catch(t){_e.deleteExpando=!1}e=null}();var Se,Re=function(e){var t=pe.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)},Be=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ne=/([A-Z])/g;pe.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?pe.cache[e[pe.expando]]:e[pe.expando])&&!c(e)},data:function(e,t,n){return i(e,t,n)},removeData:function(e,t){return o(e,t)},_data:function(e,t,n){return i(e,t,n,!0)},_removeData:function(e,t){return o(e,t,!0)}}),pe.fn.extend({data:function(e,t){var n,i,a,s=this[0],o=s&&s.attributes;if(e!==undefined)return"object"==typeof e?this.each(function(){pe.data(this,e)}):1<arguments.length?this.each(function(){pe.data(this,e,t)}):s?l(s,e,pe.data(s,e)):undefined;if(this.length&&(a=pe.data(s),1===s.nodeType&&!pe._data(s,"parsedAttrs"))){for(n=o.length;n--;)o[n]&&0===(i=o[n].name).indexOf("data-")&&l(s,i=pe.camelCase(i.slice(5)),a[i]);pe._data(s,"parsedAttrs",!0)}return a},removeData:function(e){return this.each(function(){pe.removeData(this,e)})}}),pe.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=pe._data(e,t),n&&(!i||pe.isArray(n)?i=pe._data(e,t,pe.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),i=n.length,a=n.shift(),s=pe._queueHooks(e,t),o=function(){pe.dequeue(e,t)};"inprogress"===a&&(a=n.shift(),i--),a&&("fx"===t&&n.unshift("inprogress"),delete s.stop,a.call(e,o,s)),!i&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return pe._data(e,n)||pe._data(e,n,{empty:pe.Callbacks("once memory").add(function(){pe._removeData(e,t+"queue"),pe._removeData(e,n)})})}}),pe.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?pe.queue(this[0],t):n===undefined?this:this.each(function(){var e=pe.queue(this,t,n);pe._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&pe.dequeue(this,t)})},dequeue:function(e){return this.each(function(){pe.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,a=pe.Deferred(),s=this,o=this.length,r=function(){--i||a.resolveWith(s,[s])};for("string"!=typeof e&&(t=e,e=undefined),e=e||"fx";o--;)(n=pe._data(s[o],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(r));return r(),a.promise(t)}}),_e.shrinkWrapBlocks=function(){return null!=Se?Se:(Se=!1,(t=ae.getElementsByTagName("body")[0])&&t.style?(e=ae.createElement("div"),(n=ae.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",t.appendChild(n).appendChild(e),"undefined"!=typeof e.style.zoom&&(e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",e.appendChild(ae.createElement("div")).style.width="5px",Se=3!==e.offsetWidth),t.removeChild(n),Se):void 0);var e,t,n};var Fe,Ke,Me,je=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Le=new RegExp("^(?:([+-])=|)("+je+")([a-z%]*)$","i"),Pe=["Top","Right","Bottom","Left"],Ue=function(e,t){return e=t||e,"none"===pe.css(e,"display")||!pe.contains(e.ownerDocument,e)},He=function(e,t,n,i,a,s,o){var r=0,l=e.length,c=null==n;if("object"===pe.type(n))for(r in a=!0,n)He(e,t,r,n[r],!0,s,o);else if(i!==undefined&&(a=!0,pe.isFunction(i)||(o=!0),c&&(o?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(pe(e),n)})),t))for(;r<l;r++)t(e[r],n,o?i:i.call(e[r],r,t(e[r],n)));return a?e:c?t.call(e):l?t(e[0],n):s},Qe=/^(?:checkbox|radio)$/i,ze=/<([\w:-]+)/,qe=/^$|\/(?:java|ecma)script/i,We=/^\s+/,Ye="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";Fe=ae.createElement("div"),Ke=ae.createDocumentFragment(),Me=ae.createElement("input"),Fe.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",_e.leadingWhitespace=3===Fe.firstChild.nodeType,_e.tbody=!Fe.getElementsByTagName("tbody").length,_e.htmlSerialize=!!Fe.getElementsByTagName("link").length,_e.html5Clone="<:nav></:nav>"!==ae.createElement("nav").cloneNode(!0).outerHTML,Me.type="checkbox",Me.checked=!0,Ke.appendChild(Me),_e.appendChecked=Me.checked,Fe.innerHTML="<textarea>x</textarea>",_e.noCloneChecked=!!Fe.cloneNode(!0).lastChild.defaultValue,Ke.appendChild(Fe),(Me=ae.createElement("input")).setAttribute("type","radio"),Me.setAttribute("checked","checked"),Me.setAttribute("name","t"),Fe.appendChild(Me),_e.checkClone=Fe.cloneNode(!0).cloneNode(!0).lastChild.checked,_e.noCloneEvent=!!Fe.addEventListener,Fe[pe.expando]=1,_e.attributes=!Fe.getAttribute(pe.expando);var Ve={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:_e.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};Ve.optgroup=Ve.option,Ve.tbody=Ve.tfoot=Ve.colgroup=Ve.caption=Ve.thead,Ve.th=Ve.td;var Ge=/<|&#?\w+;/,Xe=/<tbody/i;!function(){var e,t,n=ae.createElement("div");for(e in{submit:!0,change:!0,focusin:!0})t="on"+e,(_e[e]=t in w)||(n.setAttribute(t,"t"),_e[e]=!1===n.attributes[t].expando);n=null}();var Je=/^(?:input|select|textarea)$/i,Ze=/^key/,et=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,tt=/^(?:focusinfocus|focusoutblur)$/,nt=/^([^.]*)(?:\.(.+)|)/;pe.event={global:{},add:function(e,t,n,i,a){var s,o,r,l,c,d,u,_,h,p,f,m=pe._data(e);if(m){for(n.handler&&(n=(l=n).handler,a=l.selector),n.guid||(n.guid=pe.guid++),(o=m.events)||(o=m.events={}),(d=m.handle)||((d=m.handle=function(e){return void 0===pe||e&&pe.event.triggered===e.type?undefined:pe.event.dispatch.apply(d.elem,arguments)}).elem=e),r=(t=(t||"").match(Oe)||[""]).length;r--;)h=f=(s=nt.exec(t[r])||[])[1],p=(s[2]||"").split(".").sort(),h&&(c=pe.event.special[h]||{},h=(a?c.delegateType:c.bindType)||h,c=pe.event.special[h]||{},u=pe.extend({type:h,origType:f,data:i,handler:n,guid:n.guid,selector:a,needsContext:a&&pe.expr.match.needsContext.test(a),namespace:p.join(".")},l),(_=o[h])||((_=o[h]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,i,p,d)||(e.addEventListener?e.addEventListener(h,d,!1):e.attachEvent&&e.attachEvent("on"+h,d))),c.add&&(c.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),a?_.splice(_.delegateCount++,0,u):_.push(u),pe.event.global[h]=!0);e=null}},remove:function(e,t,n,i,a){var s,o,r,l,c,d,u,_,h,p,f,m=pe.hasData(e)&&pe._data(e);if(m&&(d=m.events)){for(c=(t=(t||"").match(Oe)||[""]).length;c--;)if(h=f=(r=nt.exec(t[c])||[])[1],p=(r[2]||"").split(".").sort(),h){for(u=pe.event.special[h]||{},_=d[h=(i?u.delegateType:u.bindType)||h]||[],r=r[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=s=_.length;s--;)o=_[s],!a&&f!==o.origType||n&&n.guid!==o.guid||r&&!r.test(o.namespace)||i&&i!==o.selector&&("**"!==i||!o.selector)||(_.splice(s,1),o.selector&&_.delegateCount--,u.remove&&u.remove.call(e,o));l&&!_.length&&(u.teardown&&!1!==u.teardown.call(e,p,m.handle)||pe.removeEvent(e,h,m.handle),delete d[h])}else for(h in d)pe.event.remove(e,h+t[c],n,i,!0);pe.isEmptyObject(d)&&(delete m.handle,pe._removeData(e,"events"))}},trigger:function(e,t,n,i){var a,s,o,r,l,c,d,u=[n||ae],_=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=c=n=n||ae,3!==n.nodeType&&8!==n.nodeType&&!tt.test(_+pe.event.triggered)&&(-1<_.indexOf(".")&&(_=(h=_.split(".")).shift(),h.sort()),s=_.indexOf(":")<0&&"on"+_,(e=e[pe.expando]?e:new pe.Event(_,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=undefined,e.target||(e.target=n),t=null==t?[e]:pe.makeArray(t,[e]),l=pe.event.special[_]||{},i||!l.trigger||!1!==l.trigger.apply(n,t))){if(!i&&!l.noBubble&&!pe.isWindow(n)){for(r=l.delegateType||_,tt.test(r+_)||(o=o.parentNode);o;o=o.parentNode)u.push(o),c=o;c===(n.ownerDocument||ae)&&u.push(c.defaultView||c.parentWindow||w)}for(d=0;(o=u[d++])&&!e.isPropagationStopped();)e.type=1<d?r:l.bindType||_,(a=(pe._data(o,"events")||{})[e.type]&&pe._data(o,"handle"))&&a.apply(o,t),(a=s&&o[s])&&a.apply&&Re(o)&&(e.result=a.apply(o,t),!1===e.result&&e.preventDefault());if(e.type=_,!i&&!e.isDefaultPrevented()&&(!l._default||!1===l._default.apply(u.pop(),t))&&Re(n)&&s&&n[_]&&!pe.isWindow(n)){(c=n[s])&&(n[s]=null),pe.event.triggered=_;try{n[_]()}catch(p){}pe.event.triggered=undefined,c&&(n[s]=c)}return e.result}},dispatch:function(e){e=pe.event.fix(e);var t,n,i,a,s,o=[],r=se.call(arguments),l=(pe._data(this,"events")||{})[e.type]||[],c=pe.event.special[e.type]||{};if((r[0]=e).delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,e)){for(o=pe.event.handlers.call(this,e,l),t=0;(a=o[t++])&&!e.isPropagationStopped();)for(e.currentTarget=a.elem,n=0;(s=a.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(s.namespace)||(e.handleObj=s,e.data=s.data,(i=((pe.event.special[s.origType]||{}).handle||s.handler).apply(a.elem,r))!==undefined&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,a,s,o=[],r=t.delegateCount,l=e.target;if(r&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],n=0;n<r;n++)i[a=(s=t[n]).selector+" "]===undefined&&(i[a]=s.needsContext?-1<pe(a,this).index(l):pe.find(a,this,null,[l]).length),i[a]&&i.push(s);i.length&&o.push({elem:l,handlers:i})}return r<t.length&&o.push({elem:this,handlers:t.slice(r)}),o},fix:function(e){if(e[pe.expando])return e;var t,n,i,a=e.type,s=e,o=this.fixHooks[a];for(o||(this.fixHooks[a]=o=et.test(a)?this.mouseHooks:Ze.test(a)?this.keyHooks:{}),i=o.props?this.props.concat(o.props):this.props,e=new pe.Event(s),t=i.length;t--;)e[n=i[t]]=s[n];return e.target||(e.target=s.srcElement||ae),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,o.filter?o.filter(e,s):e},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,i,a,s=t.button,o=t.fromElement;return null==e.pageX&&null!=t.clientX&&(a=(i=e.target.ownerDocument||ae).documentElement,n=i.body,e.pageX=t.clientX+(a&&a.scrollLeft||n&&n.scrollLeft||0)-(a&&a.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(a&&a.scrollTop||n&&n.scrollTop||0)-(a&&a.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&o&&(e.relatedTarget=o===e.target?t.toElement:o),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==b()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){if(this===b()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(pe.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1},_default:function(e){return pe.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n){var i=pe.extend(new pe.Event,n,{type:e,isSimulated:!0});pe.event.trigger(i,null,t),i.isDefaultPrevented()&&n.preventDefault()}},pe.removeEvent=ae.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)}:function(e,t,n){var i="on"+t;e.detachEvent&&("undefined"==typeof e[i]&&(e[i]=null),e.detachEvent(i,n))},pe.Event=function(e,t){if(!(this instanceof pe.Event))return new pe.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.defaultPrevented===undefined&&!1===e.returnValue?h:p):this.type=e,t&&pe.extend(this,t),this.timeStamp=e&&e.timeStamp||pe.now(),this[pe.expando]=!0},pe.Event.prototype={constructor:pe.Event,isDefaultPrevented:p,isPropagationStopped:p,isImmediatePropagationStopped:p,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&!this.isSimulated&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),this.stopPropagation()}},pe.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,s){pe.event.special[e]={delegateType:s,bindType:s,handle:function(e){var t,n=this,i=e.relatedTarget,a=e.handleObj;return i&&(i===n||pe.contains(n,i))||(e.type=a.origType,t=a.handler.apply(this,arguments),e.type=s),t}}}),_e.submit||(pe.event.special.submit={setup:function(){if(pe.nodeName(this,"form"))return!1;pe.event.add(this,"click._submit keypress._submit",function(e){var t=e.target,n=pe.nodeName(t,"input")||pe.nodeName(t,"button")?pe.prop(t,"form"):undefined;n&&!pe._data(n,"submit")&&(pe.event.add(n,"submit._submit",function(e){e._submitBubble=!0}),pe._data(n,"submit",!0))})},postDispatch:function(e){e._submitBubble&&(delete e._submitBubble,this.parentNode&&!e.isTrigger&&pe.event.simulate("submit",this.parentNode,e))},teardown:function(){if(pe.nodeName(this,"form"))return!1;pe.event.remove(this,"._submit")}}),_e.change||(pe.event.special.change={setup:function(){if(Je.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(pe.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._justChanged=!0)}),pe.event.add(this,"click._change",function(e){this._justChanged&&!e.isTrigger&&(this._justChanged=!1),pe.event.simulate("change",this,e)})),!1;pe.event.add(this,"beforeactivate._change",function(e){var t=e.target;Je.test(t.nodeName)&&!pe._data(t,"change")&&(pe.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||pe.event.simulate("change",this.parentNode,e)}),pe._data(t,"change",!0))})},handle:function(e){var t=e.target;if(this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return e.handleObj.handler.apply(this,arguments)},teardown:function(){return pe.event.remove(this,"._change"),!Je.test(this.nodeName)}}),_e.focusin||pe.each({focus:"focusin",blur:"focusout"},function(n,i){var a=function(e){pe.event.simulate(i,e.target,pe.event.fix(e))};pe.event.special[i]={setup:function(){var e=this.ownerDocument||this,t=pe._data(e,i);t||e.addEventListener(n,a,!0),pe._data(e,i,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=pe._data(e,i)-1;t?pe._data(e,i,t):(e.removeEventListener(n,a,!0),pe._removeData(e,i))}}}),pe.fn.extend({on:function(e,t,n,i){return y(this,e,t,n,i)},one:function(e,t,n,i){return y(this,e,t,n,i,1)},off:function(e,t,n){var i,a;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,pe(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"!=typeof e)return!1!==t&&"function"!=typeof t||(n=t,t=undefined),!1===n&&(n=p),this.each(function(){pe.event.remove(this,e,n,t)});for(a in e)this.off(a,t,e[a]);return this},trigger:function(e,t){return this.each(function(){pe.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return pe.event.trigger(e,t,n,!0)}});var it=/ jQuery\d+="(?:null|\d+)"/g,at=new RegExp("<(?:"+Ye+")[\\s/>]","i"),st=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ot=/<script|<style|<link/i,rt=/checked\s*(?:[^=]|=\s*.checked.)/i,lt=/^true\/(.*)/,ct=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,dt=m(ae).appendChild(ae.createElement("div"));pe.extend({htmlPrefilter:function(e){return e.replace(st,"<$1></$2>")},clone:function(e,t,n){var i,a,s,o,r,l=pe.contains(e.ownerDocument,e);if(_e.html5Clone||pe.isXMLDoc(e)||!at.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(dt.innerHTML=e.outerHTML,dt.removeChild(s=dt.firstChild)),!(_e.noCloneEvent&&_e.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(i=g(s),r=g(e),o=0;null!=(a=r[o]);++o)i[o]&&T(a,i[o]);if(t)if(n)for(r=r||g(e),i=i||g(s),o=0;null!=(a=r[o]);o++)E(a,i[o]);else E(e,s);return 0<(i=g(s,"script")).length&&A(i,!l&&g(e,"script")),i=r=a=null,s},cleanData:function(e,t){for(var n,i,a,s,o=0,r=pe.expando,l=pe.cache,c=_e.attributes,d=pe.event.special;null!=(n=e[o]);o++)if((t||Re(n))&&(s=(a=n[r])&&l[a])){if(s.events)for(i in s.events)d[i]?pe.event.remove(n,i):pe.removeEvent(n,i,s.handle);l[a]&&(delete l[a],c||"undefined"==typeof n.removeAttribute?n[r]=undefined:n.removeAttribute(r),ie.push(a))}}}),pe.fn.extend({domManip:x,detach:function(e){return I(this,e,!0)},remove:function(e){return I(this,e)},text:function(e){return He(this,function(e){return e===undefined?pe.text(this):this.empty().append((this[0]&&this[0].ownerDocument||ae).createTextNode(e))},null,e,arguments.length)},append:function(){return x(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||$(this,e).appendChild(e)})},prepend:function(){return x(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=$(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return x(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return x(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&pe.cleanData(g(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&pe.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return He(this,function(e){var t=this[0]||{},n=0,i=this.length;if(e===undefined)return 1===t.nodeType?t.innerHTML.replace(it,""):undefined;if("string"==typeof e&&!ot.test(e)&&(_e.htmlSerialize||!at.test(e))&&(_e.leadingWhitespace||!We.test(e))&&!Ve[(ze.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(pe.cleanData(g(t,!1)),t.innerHTML=e);t=0}catch(a){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return x(this,arguments,function(e){var t=this.parentNode;pe.inArray(this,n)<0&&(pe.cleanData(g(this)),t&&t.replaceChild(e,this))},n)}}),pe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,o){pe.fn[e]=function(e){for(var t,n=0,i=[],a=pe(e),s=a.length-1;n<=s;n++)t=n===s?this:this.clone(!0),pe(a[n])[o](t),re.apply(i,t.get());return this.pushStack(i)}});var ut,_t={HTML:"block",BODY:"block"},ht=/^margin/,pt=new RegExp("^("+je+")(?!px)[a-z%]+$","i"),ft=function(e,t,n,i){var a,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];for(s in a=n.apply(e,i||[]),t)e.style[s]=o[s];return a},mt=ae.documentElement;!function(){function e(){var e,t,n=ae.documentElement;n.appendChild(c),d.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",i=s=l=!1,a=r=!0,w.getComputedStyle&&(t=w.getComputedStyle(d),i="1%"!==(t||{}).top,l="2px"===(t||{}).marginLeft,s="4px"===(t||{width:"4px"}).width,d.style.marginRight="50%",a="4px"===(t||{marginRight:"4px"}).marginRight,(e=d.appendChild(ae.createElement("div"))).style.cssText=d.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",e.style.marginRight=e.style.width="0",d.style.width="1px",r=!parseFloat((w.getComputedStyle(e)||{}).marginRight),d.removeChild(e)),d.style.display="none",(o=0===d.getClientRects().length)&&(d.style.display="",d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",d.childNodes[0].style.borderCollapse="separate",(e=d.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(o=0===e[0].offsetHeight)&&(e[0].style.display="",e[1].style.display="none",o=0===e[0].offsetHeight)),n.removeChild(c)}var i,a,s,o,r,l,c=ae.createElement("div"),d=ae.createElement("div");d.style&&(d.style.cssText="float:left;opacity:.5",_e.opacity="0.5"===d.style.opacity,_e.cssFloat=!!d.style.cssFloat,d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",_e.clearCloneStyle="content-box"===d.style.backgroundClip,(c=ae.createElement("div")).style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",d.innerHTML="",c.appendChild(d),_e.boxSizing=""===d.style.boxSizing||""===d.style.MozBoxSizing||""===d.style.WebkitBoxSizing,pe.extend(_e,{reliableHiddenOffsets:function(){return null==i&&e(),o},boxSizingReliable:function(){return null==i&&e(),s},pixelMarginRight:function(){return null==i&&e(),a},pixelPosition:function(){return null==i&&e(),i},reliableMarginRight:function(){return null==i&&e(),r},reliableMarginLeft:function(){return null==i&&e(),l}}))}();var gt,At,vt=/^(top|right|bottom|left)$/;w.getComputedStyle?(gt=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=w),t.getComputedStyle(e)},At=function(e,t,n){var i,a,s,o,r=e.style;return""!==(o=(n=n||gt(e))?n.getPropertyValue(t)||n[t]:undefined)&&o!==undefined||pe.contains(e.ownerDocument,e)||(o=pe.style(e,t)),n&&!_e.pixelMarginRight()&&pt.test(o)&&ht.test(t)&&(i=r.width,a=r.minWidth,s=r.maxWidth,r.minWidth=r.maxWidth=r.width=o,o=n.width,r.width=i,r.minWidth=a,r.maxWidth=s),o===undefined?o:o+""}):mt.currentStyle&&(gt=function(e){return e.currentStyle},At=function(e,t,n){var i,a,s,o,r=e.style;return null==(o=(n=n||gt(e))?n[t]:undefined)&&r&&r[t]&&(o=r[t]),pt.test(o)&&!vt.test(t)&&(i=r.left,(s=(a=e.runtimeStyle)&&a.left)&&(a.left=e.currentStyle.left),r.left="fontSize"===t?"1em":o,o=r.pixelLeft+"px",r.left=i,s&&(a.left=s)),o===undefined?o:o+""||"auto"});var bt=/alpha\([^)]*\)/i,yt=/opacity\s*=\s*([^)]*)/i,
$t=/^(none|table(?!-c[ea]).+)/,wt=new RegExp("^("+je+")(.*)$","i"),kt={position:"absolute",visibility:"hidden",display:"block"},Ct={letterSpacing:"0",fontWeight:"400"},Et=["Webkit","O","Moz","ms"],Tt=ae.createElement("div").style;pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=At(e,"opacity");return""===n?"1":n}}}},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":_e.cssFloat?"cssFloat":"styleFloat"},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var a,s,o,r=pe.camelCase(t),l=e.style;if(t=pe.cssProps[r]||(pe.cssProps[r]=R(r)||r),o=pe.cssHooks[t]||pe.cssHooks[r],n===undefined)return o&&"get"in o&&(a=o.get(e,!1,i))!==undefined?a:l[t];if("string"===(s=typeof n)&&(a=Le.exec(n))&&a[1]&&(n=u(e,t,a),s="number"),null!=n&&n==n&&("number"===s&&(n+=a&&a[3]||(pe.cssNumber[r]?"":"px")),_e.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),!(o&&"set"in o&&(n=o.set(e,n,i))===undefined)))try{l[t]=n}catch(c){}}},css:function(e,t,n,i){var a,s,o,r=pe.camelCase(t);return t=pe.cssProps[r]||(pe.cssProps[r]=R(r)||r),(o=pe.cssHooks[t]||pe.cssHooks[r])&&"get"in o&&(s=o.get(e,!0,n)),s===undefined&&(s=At(e,t,i)),"normal"===s&&t in Ct&&(s=Ct[t]),""===n||n?(a=parseFloat(s),!0===n||isFinite(a)?a||0:s):s}}),pe.each(["height","width"],function(e,a){pe.cssHooks[a]={get:function(e,t,n){if(t)return $t.test(pe.css(e,"display"))&&0===e.offsetWidth?ft(e,kt,function(){return K(e,a,n)}):K(e,a,n)},set:function(e,t,n){var i=n&&gt(e);return N(e,t,n?F(e,a,n,_e.boxSizing&&"border-box"===pe.css(e,"boxSizing",!1,i),i):0)}}}),_e.opacity||(pe.cssHooks.opacity={get:function(e,t){return yt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,i=e.currentStyle,a=pe.isNumeric(t)?"alpha(opacity="+100*t+")":"",s=i&&i.filter||n.filter||"";((n.zoom=1)<=t||""===t)&&""===pe.trim(s.replace(bt,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||i&&!i.filter)||(n.filter=bt.test(s)?s.replace(bt,a):s+" "+a)}}),pe.cssHooks.marginRight=S(_e.reliableMarginRight,function(e,t){if(t)return ft(e,{display:"inline-block"},At,[e,"marginRight"])}),pe.cssHooks.marginLeft=S(_e.reliableMarginLeft,function(e,t){if(t)return(parseFloat(At(e,"marginLeft"))||(pe.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-ft(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}):0))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(a,s){pe.cssHooks[a+s]={expand:function(e){for(var t=0,n={},i="string"==typeof e?e.split(" "):[e];t<4;t++)n[a+Pe[t]+s]=i[t]||i[t-2]||i[0];return n}},ht.test(a)||(pe.cssHooks[a+s].set=N)}),pe.fn.extend({css:function(e,t){return He(this,function(e,t,n){var i,a,s={},o=0;if(pe.isArray(t)){for(i=gt(e),a=t.length;o<a;o++)s[t[o]]=pe.css(e,t[o],!1,i);return s}return n!==undefined?pe.style(e,t,n):pe.css(e,t)},e,t,1<arguments.length)},show:function(){return B(this,!0)},hide:function(){return B(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ue(this)?pe(this).show():pe(this).hide()})}}),(pe.Tween=M).prototype={constructor:M,init:function(e,t,n,i,a,s){this.elem=e,this.prop=n,this.easing=a||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=s||(pe.cssNumber[n]?"":"px")},cur:function(){var e=M.propHooks[this.prop];return e&&e.get?e.get(this):M.propHooks._default.get(this)},run:function(e){var t,n=M.propHooks[this.prop];return this.options.duration?this.pos=t=pe.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),n&&n.set?n.set(this):M.propHooks._default.set(this),this}},M.prototype.init.prototype=M.prototype,M.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=pe.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},M.propHooks.scrollTop=M.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=M.prototype.init,pe.fx.step={};var xt,It,Dt,Ot,St,Rt,Bt,Nt=/^(?:toggle|show|hide)$/,Ft=/queueHooks$/;pe.Animation=pe.extend(Q,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return u(n.elem,e,Le.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(Oe);for(var n,i=0,a=e.length;i<a;i++)n=e[i],Q.tweeners[n]=Q.tweeners[n]||[],Q.tweeners[n].unshift(t)},prefilters:[U],prefilter:function(e,t){t?Q.prefilters.unshift(e):Q.prefilters.push(e)}}),pe.speed=function(e,t,n){var i=e&&"object"==typeof e?pe.extend({},e):{complete:n||!n&&t||pe.isFunction(e)&&e,duration:e,easing:n&&t||t&&!pe.isFunction(t)&&t};return i.duration=pe.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in pe.fx.speeds?pe.fx.speeds[i.duration]:pe.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){pe.isFunction(i.old)&&i.old.call(this),i.queue&&pe.dequeue(this,i.queue)},i},pe.fn.extend({fadeTo:function(e,t,n,i){return this.filter(Ue).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(t,e,n,i){var a=pe.isEmptyObject(t),s=pe.speed(e,n,i),o=function(){var e=Q(this,pe.extend({},t),s);(a||pe._data(this,"finish"))&&e.stop(!0)};return o.finish=o,a||!1===s.queue?this.each(o):this.queue(s.queue,o)},stop:function(a,e,s){var o=function(e){var t=e.stop;delete e.stop,t(s)};return"string"!=typeof a&&(s=e,e=a,a=undefined),e&&!1!==a&&this.queue(a||"fx",[]),this.each(function(){var e=!0,t=null!=a&&a+"queueHooks",n=pe.timers,i=pe._data(this);if(t)i[t]&&i[t].stop&&o(i[t]);else for(t in i)i[t]&&i[t].stop&&Ft.test(t)&&o(i[t]);for(t=n.length;t--;)n[t].elem!==this||null!=a&&n[t].queue!==a||(n[t].anim.stop(s),e=!1,n.splice(t,1));!e&&s||pe.dequeue(this,a)})},finish:function(o){return!1!==o&&(o=o||"fx"),this.each(function(){var e,t=pe._data(this),n=t[o+"queue"],i=t[o+"queueHooks"],a=pe.timers,s=n?n.length:0;for(t.finish=!0,pe.queue(this,o,[]),i&&i.stop&&i.stop.call(this,!0),e=a.length;e--;)a[e].elem===this&&a[e].queue===o&&(a[e].anim.stop(!0),a.splice(e,1));for(e=0;e<s;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),pe.each(["toggle","show","hide"],function(e,i){var a=pe.fn[i];pe.fn[i]=function(e,t,n){return null==e||"boolean"==typeof e?a.apply(this,arguments):this.animate(L(i,!0),e,t,n)}}),pe.each({slideDown:L("show"),slideUp:L("hide"),slideToggle:L("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,i){pe.fn[e]=function(e,t,n){return this.animate(i,e,t,n)}}),pe.timers=[],pe.fx.tick=function(){var e,t=pe.timers,n=0;for(xt=pe.now();n<t.length;n++)(e=t[n])()||t[n]!==e||t.splice(n--,1);t.length||pe.fx.stop(),xt=undefined},pe.fx.timer=function(e){pe.timers.push(e),e()?pe.fx.start():pe.timers.pop()},pe.fx.interval=13,pe.fx.start=function(){It||(It=w.setInterval(pe.fx.tick,pe.fx.interval))},pe.fx.stop=function(){w.clearInterval(It),It=null},pe.fx.speeds={slow:600,fast:200,_default:400},pe.fn.delay=function(i,e){return i=pe.fx&&pe.fx.speeds[i]||i,e=e||"fx",this.queue(e,function(e,t){var n=w.setTimeout(e,i);t.stop=function(){w.clearTimeout(n)}})},Ot=ae.createElement("input"),St=ae.createElement("div"),Rt=ae.createElement("select"),Bt=Rt.appendChild(ae.createElement("option")),(St=ae.createElement("div")).setAttribute("className","t"),St.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",Dt=St.getElementsByTagName("a")[0],Ot.setAttribute("type","checkbox"),St.appendChild(Ot),(Dt=St.getElementsByTagName("a")[0]).style.cssText="top:1px",_e.getSetAttribute="t"!==St.className,_e.style=/top/.test(Dt.getAttribute("style")),_e.hrefNormalized="/a"===Dt.getAttribute("href"),_e.checkOn=!!Ot.value,_e.optSelected=Bt.selected,_e.enctype=!!ae.createElement("form").enctype,Rt.disabled=!0,_e.optDisabled=!Bt.disabled,(Ot=ae.createElement("input")).setAttribute("value",""),_e.input=""===Ot.getAttribute("value"),Ot.value="t",Ot.setAttribute("type","radio"),_e.radioValue="t"===Ot.value;var Kt=/\r/g,Mt=/[\x20\t\r\n\f]+/g;pe.fn.extend({val:function(n){var i,e,a,t=this[0];return arguments.length?(a=pe.isFunction(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=a?n.call(this,e,pe(this).val()):n)?t="":"number"==typeof t?t+="":pe.isArray(t)&&(t=pe.map(t,function(e){return null==e?"":e+""})),(i=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()])&&"set"in i&&i.set(this,t,"value")!==undefined||(this.value=t))})):t?(i=pe.valHooks[t.type]||pe.valHooks[t.nodeName.toLowerCase()])&&"get"in i&&(e=i.get(t,"value"))!==undefined?e:"string"==typeof(e=t.value)?e.replace(Kt,""):null==e?"":e:void 0}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:pe.trim(pe.text(e)).replace(Mt," ")}},select:{get:function(e){for(var t,n,i=e.options,a=e.selectedIndex,s="select-one"===e.type||a<0,o=s?null:[],r=s?a+1:i.length,l=a<0?r:s?a:0;l<r;l++)if(((n=i[l]).selected||l===a)&&(_e.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!pe.nodeName(n.parentNode,"optgroup"))){if(t=pe(n).val(),s)return t;o.push(t)}return o},set:function(e,t){for(var n,i,a=e.options,s=pe.makeArray(t),o=a.length;o--;)if(i=a[o],-1<pe.inArray(pe.valHooks.option.get(i),s))try{i.selected=n=!0}catch(_){i.scrollHeight}else i.selected=!1;return n||(e.selectedIndex=-1),a}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=-1<pe.inArray(pe(e).val(),t)}},_e.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var jt,Lt,Pt=pe.expr.attrHandle,Ut=/^(?:checked|selected)$/i,Ht=_e.getSetAttribute,Qt=_e.input;pe.fn.extend({attr:function(e,t){return He(this,pe.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var i,a,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===s&&pe.isXMLDoc(e)||(t=t.toLowerCase(),a=pe.attrHooks[t]||(pe.expr.match.bool.test(t)?Lt:jt)),n!==undefined?null===n?void pe.removeAttr(e,t):a&&"set"in a&&(i=a.set(e,n,t))!==undefined?i:(e.setAttribute(t,n+""),n):a&&"get"in a&&null!==(i=a.get(e,t))?i:null==(i=pe.find.attr(e,t))?undefined:i)},attrHooks:{type:{set:function(e,t){if(!_e.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i,a=0,s=t&&t.match(Oe);if(s&&1===e.nodeType)for(;n=s[a++];)i=pe.propFix[n]||n,pe.expr.match.bool.test(n)?Qt&&Ht||!Ut.test(n)?e[i]=!1:e[pe.camelCase("default-"+n)]=e[i]=!1:pe.attr(e,n,""),e.removeAttribute(Ht?n:i)}}),Lt={set:function(e,t,n){return!1===t?pe.removeAttr(e,n):Qt&&Ht||!Ut.test(n)?e.setAttribute(!Ht&&pe.propFix[n]||n,n):e[pe.camelCase("default-"+n)]=e[n]=!0,n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var s=Pt[t]||pe.find.attr;Qt&&Ht||!Ut.test(t)?Pt[t]=function(e,t,n){var i,a;return n||(a=Pt[t],Pt[t]=i,i=null!=s(e,t,n)?t.toLowerCase():null,Pt[t]=a),i}:Pt[t]=function(e,t,n){if(!n)return e[pe.camelCase("default-"+t)]?t.toLowerCase():null}}),Qt&&Ht||(pe.attrHooks.value={set:function(e,t,n){if(!pe.nodeName(e,"input"))return jt&&jt.set(e,t,n);e.defaultValue=t}}),Ht||(jt={set:function(e,t,n){var i=e.getAttributeNode(n);if(i||e.setAttributeNode(i=e.ownerDocument.createAttribute(n)),i.value=t+="","value"===n||t===e.getAttribute(n))return t}},Pt.id=Pt.name=Pt.coords=function(e,t,n){var i;if(!n)return(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},pe.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:jt.set},pe.attrHooks.contenteditable={set:function(e,t,n){jt.set(e,""!==t&&t,n)}},pe.each(["width","height"],function(e,n){pe.attrHooks[n]={set:function(e,t){if(""===t)return e.setAttribute(n,"auto"),t}}})),_e.style||(pe.attrHooks.style={get:function(e){return e.style.cssText||undefined},set:function(e,t){return e.style.cssText=t+""}});var zt=/^(?:input|select|textarea|button|object)$/i,qt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return He(this,pe.prop,e,t,1<arguments.length)},removeProp:function(t){return t=pe.propFix[t]||t,this.each(function(){try{this[t]=undefined,delete this[t]}catch(e){}})}}),pe.extend({prop:function(e,t,n){var i,a,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,a=pe.propHooks[t]),n!==undefined?a&&"set"in a&&(i=a.set(e,n,t))!==undefined?i:e[t]=n:a&&"get"in a&&null!==(i=a.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):zt.test(e.nodeName)||qt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),_e.hrefNormalized||pe.each(["href","src"],function(e,t){pe.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),_e.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),_e.enctype||(pe.propFix.enctype="encoding");var Wt=/[\t\r\n\f]/g;pe.fn.extend({addClass:function(t){var e,n,i,a,s,o,r,l=0;if(pe.isFunction(t))return this.each(function(e){pe(this).addClass(t.call(this,e,z(this)))});if("string"==typeof t&&t)for(e=t.match(Oe)||[];n=this[l++];)if(a=z(n),i=1===n.nodeType&&(" "+a+" ").replace(Wt," ")){for(o=0;s=e[o++];)i.indexOf(" "+s+" ")<0&&(i+=s+" ");a!==(r=pe.trim(i))&&pe.attr(n,"class",r)}return this},removeClass:function(t){var e,n,i,a,s,o,r,l=0;if(pe.isFunction(t))return this.each(function(e){pe(this).removeClass(t.call(this,e,z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(Oe)||[];n=this[l++];)if(a=z(n),i=1===n.nodeType&&(" "+a+" ").replace(Wt," ")){for(o=0;s=e[o++];)for(;-1<i.indexOf(" "+s+" ");)i=i.replace(" "+s+" "," ");a!==(r=pe.trim(i))&&pe.attr(n,"class",r)}return this},toggleClass:function(a,t){var s=typeof a;return"boolean"==typeof t&&"string"===s?t?this.addClass(a):this.removeClass(a):pe.isFunction(a)?this.each(function(e){pe(this).toggleClass(a.call(this,e,z(this),t),t)}):this.each(function(){var e,t,n,i;if("string"===s)for(t=0,n=pe(this),i=a.match(Oe)||[];e=i[t++];)n.hasClass(e)?n.removeClass(e):n.addClass(e);else a!==undefined&&"boolean"!==s||((e=z(this))&&pe._data(this,"__className__",e),pe.attr(this,"class",e||!1===a?"":pe._data(this,"__className__")||""))})},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&-1<(" "+z(n)+" ").replace(Wt," ").indexOf(t))return!0;return!1}}),pe.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,n){pe.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var Yt=w.location,Vt=pe.now(),Gt=/\?/,Xt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;pe.parseJSON=function(e){if(w.JSON&&w.JSON.parse)return w.JSON.parse(e+"");var a,s=null,t=pe.trim(e+"");return t&&!pe.trim(t.replace(Xt,function(e,t,n,i){return a&&t&&(s=0),0===s?e:(a=n||t,s+=!i-!n,"")}))?Function("return "+t)():pe.error("Invalid JSON: "+e)},pe.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{w.DOMParser?t=(new w.DOMParser).parseFromString(e,"text/xml"):((t=new w.ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e))}catch(n){t=undefined}return t&&t.documentElement&&!t.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+e),t};var Jt=/#.*$/,Zt=/([?&])_=[^&]*/,en=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,tn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,nn=/^(?:GET|HEAD)$/,an=/^\/\//,sn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,on={},rn={},ln="*/".concat("*"),cn=Yt.href,dn=sn.exec(cn.toLowerCase())||[];pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:cn,type:"GET",isLocal:tn.test(dn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":ln,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":pe.parseJSON,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Y(Y(e,pe.ajaxSettings),t):Y(pe.ajaxSettings,e)},ajaxPrefilter:q(on),ajaxTransport:q(rn),ajax:function(e,t){function n(e,t,n,i){var a,s,o,r,l,c=t;2!==y&&(y=2,_&&w.clearTimeout(_),p=undefined,u=i||"",$.readyState=0<e?4:0,a=200<=e&&e<300||304===e,n&&(r=V(f,$,n)),r=G(f,r,$,a),a?(f.ifModified&&((l=$.getResponseHeader("Last-Modified"))&&(pe.lastModified[d]=l),(l=$.getResponseHeader("etag"))&&(pe.etag[d]=l)),204===e||"HEAD"===f.type?c="nocontent":304===e?c="notmodified":(c=r.state,s=r.data,a=!(o=r.error))):(o=c,!e&&c||(c="error",e<0&&(e=0))),$.status=e,$.statusText=(t||c)+"",a?A.resolveWith(m,[s,c,$]):A.rejectWith(m,[$,c,o]),$.statusCode(b),b=undefined,h&&g.trigger(a?"ajaxSuccess":"ajaxError",[$,f,a?s:o]),v.fireWith(m,[$,c]),h&&(g.trigger("ajaxComplete",[$,f]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof e&&(t=e,e=undefined),t=t||{};var i,a,d,u,_,h,p,s,f=pe.ajaxSetup({},t),m=f.context||f,g=f.context&&(m.nodeType||m.jquery)?pe(m):pe.event,A=pe.Deferred(),v=pe.Callbacks("once memory"),b=f.statusCode||{},o={},r={},y=0,l="canceled",$={readyState:0,getResponseHeader:function(e){var t;if(2===y){if(!s)for(s={};t=en.exec(u);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===y?u:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return y||(e=r[n]=r[n]||e,o[e]=t),this},overrideMimeType:function(e){return y||(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(y<2)for(t in e)b[t]=[b[t],e[t]];else $.always(e[$.status]);return this},abort:function(e){var t=e||l;return p&&p.abort(t),n(0,t),this}};if(A.promise($).complete=v.add,$.success=$.done,$.error=$.fail,f.url=((e||f.url||cn)+"").replace(Jt,"").replace(an,dn[1]+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=pe.trim(f.dataType||"*").toLowerCase().match(Oe)||[""],null==f.crossDomain&&(i=sn.exec(f.url.toLowerCase()),f.crossDomain=!(!i||i[1]===dn[1]&&i[2]===dn[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(dn[3]||("http:"===dn[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=pe.param(f.data,f.traditional)),W(on,f,t,$),2===y)return $;for(a in(h=pe.event&&f.global)&&0==pe.active++&&pe.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!nn.test(f.type),d=f.url,f.hasContent||(f.data&&(d=f.url+=(Gt.test(d)?"&":"?")+f.data,delete f.data),!1===f.cache&&(f.url=Zt.test(d)?d.replace(Zt,"$1_="+Vt++):d+(Gt.test(d)?"&":"?")+"_="+Vt++)),f.ifModified&&(pe.lastModified[d]&&$.setRequestHeader("If-Modified-Since",pe.lastModified[d]),pe.etag[d]&&$.setRequestHeader("If-None-Match",pe.etag[d])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&$.setRequestHeader("Content-Type",f.contentType),$.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+ln+"; q=0.01":""):f.accepts["*"]),f.headers)$.setRequestHeader(a,f.headers[a]);if(f.beforeSend&&(!1===f.beforeSend.call(m,$,f)||2===y))return $.abort();for(a in l="abort",{success:1,error:1,complete:1})$[a](f[a]);if(p=W(rn,f,t,$)){if($.readyState=1,h&&g.trigger("ajaxSend",[$,f]),2===y)return $;f.async&&0<f.timeout&&(_=w.setTimeout(function(){$.abort("timeout")},f.timeout));try{y=1,p.send(o,n)}catch(c){if(!(y<2))throw c;n(-1,c)}}else n(-1,"No Transport");return $},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,undefined,t,"script")}}),pe.each(["get","post"],function(e,a){pe[a]=function(e,t,n,i){return pe.isFunction(t)&&(i=i||n,n=t,t=undefined),pe.ajax(pe.extend({url:e,type:a,dataType:i,data:t,success:n},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},pe.fn.extend({wrapAll:function(t){if(pe.isFunction(t))return this.each(function(e){pe(this).wrapAll(t.call(this,e))});if(this[0]){var e=pe(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(n){return pe.isFunction(n)?this.each(function(e){pe(this).wrapInner(n.call(this,e))}):this.each(function(){var e=pe(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=pe.isFunction(t);return this.each(function(e){pe(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(){return this.parent().each(function(){pe.nodeName(this,"body")||pe(this).replaceWith(this.childNodes)}).end()}}),pe.expr.filters.hidden=function(e){return _e.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:J(e)},pe.expr.filters.visible=function(e){return!pe.expr.filters.hidden(e)};var un=/%20/g,_n=/\[\]$/,hn=/\r?\n/g,pn=/^(?:submit|button|image|reset|file)$/i,fn=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,i=[],a=function(e,t){t=pe.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=pe.ajaxSettings&&pe.ajaxSettings.traditional),pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){a(this.name,this.value)});else for(n in e)Z(n,e[n],t,a);return i.join("&").replace(un,"+")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&fn.test(this.nodeName)&&!pn.test(e)&&(this.checked||!Qe.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(hn,"\r\n")}}):{name:t.name,value:n.replace(hn,"\r\n")}}).get()}}),pe.ajaxSettings.xhr=w.ActiveXObject!==undefined?function(){return this.isLocal?te():8<ae.documentMode?ee():/^(get|post|head|put|delete|options)$/i.test(this.type)&&ee()||te()}:ee;var mn=0,gn={},An=pe.ajaxSettings.xhr();w.attachEvent&&w.attachEvent("onunload",function(){for(var e in gn)gn[e](undefined,!0)}),_e.cors=!!An&&"withCredentials"in An,(An=_e.ajax=!!An)&&pe.ajaxTransport(function(c){var d;if(!c.crossDomain||_e.cors)return{send:function(e,o){var t,r=c.xhr(),l=++mn;if(r.open(c.type,c.url,c.async,c.username,c.password),c.xhrFields)for(t in c.xhrFields)r[t]=c.xhrFields[t];for(t in c.mimeType&&r.overrideMimeType&&r.overrideMimeType(c.mimeType),c.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)e[t]!==undefined&&r.setRequestHeader(t,e[t]+"");r.send(c.hasContent&&c.data||null),d=function(e,t){var n,i,a;if(d&&(t||4===r.readyState))if(delete gn[l],d=undefined,r.onreadystatechange=pe.noop,t)4!==r.readyState&&r.abort();else{a={},n=r.status,"string"==typeof r.responseText&&(a.text=r.responseText);try{i=r.statusText}catch(s){i=""}n||!c.isLocal||c.crossDomain?1223===n&&(n=204):n=a.text?200:404}a&&o(n,i,a,r.getAllResponseHeaders())},c.async?4===r.readyState?w.setTimeout(d):r.onreadystatechange=gn[l]=d:d()},abort:function(){d&&d(undefined,!0)}}}),pe.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 pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),pe.ajaxTransport("script",function(t){if(t.crossDomain){var i,a=ae.head||pe("head")[0]||ae.documentElement;return{send:function(e,n){(i=ae.createElement("script")).async=!0,t.scriptCharset&&(i.charset=t.scriptCharset),i.src=t.url,i.onload=i.onreadystatechange=function(e,t){(t||!i.readyState||/loaded|complete/.test(i.readyState))&&(i.onload=i.onreadystatechange=null,i.parentNode&&i.parentNode.removeChild(i),i=null,t||n(200,"success"))},a.insertBefore(i,a.firstChild)},abort:function(){i&&i.onload(undefined,!0)}}}});var vn=[],bn=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=vn.pop()||pe.expando+"_"+Vt++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(e,t,n){var i,a,s,o=!1!==e.jsonp&&(bn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&bn.test(e.data)&&"data");if(o||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=pe.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,o?e[o]=e[o].replace(bn,"$1"+i):!1!==e.jsonp&&(e.url+=(Gt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return s||pe.error(i+" was not called"),s[0]},e.dataTypes[0]="json",a=w[i],w[i]=function(){s=arguments},n.always(function(){a===undefined?pe(w).removeProp(i):w[i]=a,e[i]&&(e.jsonpCallback=t.jsonpCallback,vn.push(i)),s&&pe.isFunction(a)&&a(s[0]),s=a=undefined}),"script"}),pe.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||ae;var i=we.exec(e),a=!n&&[];return i?[t.createElement(i[1])]:(i=f([e],t,a),a&&a.length&&pe(a).remove(),pe.merge([],i.childNodes))};var yn=pe.fn.load;pe.fn.load=function(e,t,n){if("string"!=typeof e&&yn)return yn.apply(this,arguments);var i,a,s,o=this,r=e.indexOf(" ");return-1<r&&(i=pe.trim(e.slice(r,e.length)),e=e.slice(0,r)),pe.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(a="POST"),0<o.length&&pe.ajax({url:e,type:a||"GET",dataType:"html",data:t}).done(function(e){s=arguments,o.html(i?pe("<div>").append(pe.parseHTML(e)).find(i):e)}).always(n&&function(e,t){o.each(function(){n.apply(this,s||[e.responseText,t,e])})}),this},pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.expr.filters.animated=function(t){return pe.grep(pe.timers,function(e){return t===e.elem}).length},pe.offset={setOffset:function(e,t,n){var i,a,s,o,r,l,c=pe.css(e,"position"),d=pe(e),u={};"static"===c&&(e.style.position="relative"),r=d.offset(),s=pe.css(e,"top"),l=pe.css(e,"left"),("absolute"===c||"fixed"===c)&&-1<pe.inArray("auto",[s,l])?(o=(i=d.position()).top,a=i.left):(o=parseFloat(s)||0,a=parseFloat(l)||0),pe.isFunction(t)&&(t=t.call(e,n,pe.extend({},r))),null!=t.top&&(u.top=t.top-r.top+o),null!=t.left&&(u.left=t.left-r.left+a),"using"in t?t.using.call(e,u):d.css(u)}},pe.fn.extend({offset:function(t){if(arguments.length)return t===undefined?this:this.each(function(e){pe.offset.setOffset(this,t,e)});var e,n,i={top:0,left:0},a=this[0],s=a&&a.ownerDocument;return s?(e=s.documentElement,pe.contains(e,a)?("undefined"!=typeof a.getBoundingClientRect&&(i=a.getBoundingClientRect()),n=ne(s),{top:i.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):i):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},i=this[0];return"fixed"===pe.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),pe.nodeName(e[0],"html")||(n=e.offset()),n.top+=pe.css(e[0],"borderTopWidth",!0),n.left+=pe.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-pe.css(i,"marginTop",!0),left:t.left-n.left-pe.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&!pe.nodeName(e,"html")&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||mt})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,a){var s=/Y/.test(a);pe.fn[t]=function(e){return He(this,function(e,t,n){var i=ne(e);if(n===undefined)return i?a in i?i[a]:i.document.documentElement[t]:e[t];i?i.scrollTo(s?pe(i).scrollLeft():n,s?n:pe(i).scrollTop()):e[t]=n},t,e,arguments.length,null)}}),pe.each(["top","left"],function(e,n){pe.cssHooks[n]=S(_e.pixelPosition,function(e,t){if(t)return t=At(e,n),pt.test(t)?pe(e).position()[n]+"px":t})}),pe.each({Height:"height",Width:"width"},function(s,o){pe.each({padding:"inner"+s,content:o,"":"outer"+s},function(i,e){pe.fn[e]=function(e,t){var n=arguments.length&&(i||"boolean"!=typeof e),a=i||(!0===e||!0===t?"margin":"border");return He(this,function(e,t,n){var i;return pe.isWindow(e)?e.document.documentElement["client"+s]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+s],i["scroll"+s],e.body["offset"+s],i["offset"+s],i["client"+s])):n===undefined?pe.css(e,t,a):pe.style(e,t,n,a)},o,n?e:undefined,n,null)}})}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),pe.fn.size=function(){return this.length},pe.fn.andSelf=pe.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return pe});var $n=w.jQuery,wn=w.$;return pe.noConflict=function(e){return w.$===pe&&(w.$=wn),e&&w.jQuery===pe&&(w.jQuery=$n),pe},e||(w.jQuery=w.$=pe),pe}),function(){"use strict";var e=function(d,l){var c;d.rails!==l&&d.error("jquery-ujs has already been loaded!");var e=d(document);d.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form:not([data-turbo=true])",formInputClickSelector:"form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]), textarea[name][required]:not([disabled])",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",csrfToken:function(){return d("meta[name=csrf-token]").attr("content")},csrfParam:function(){return d("meta[name=csrf-param]").attr("content")},CSRFProtection:function(e){var t=c.csrfToken();t&&e.setRequestHeader("X-CSRF-Token",t)},refreshCSRFTokens:function(){d('form input[name="'+c.csrfParam()+'"]').val(c.csrfToken())},fire:function(e,t,n){var i=d.Event(t);return e.trigger(i,n),!1!==i.result},confirm:function(e){return confirm(e)},ajax:function(e){return d.ajax(e)},href:function(e){return e[0].href},isRemote:function(e){return e.data("remote")!==l&&!1!==e.data("remote")},handleRemote:function(i){var e,t,n,a,s,o;if(c.fire(i,"ajax:before")){if(a=i.data("with-credentials")||null,s=i.data("type")||d.ajaxSettings&&d.ajaxSettings.dataType,i.is("form")){e=i.data("ujs:submit-button-formmethod")||i.attr("method"),t=i.data("ujs:submit-button-formaction")||i.attr("action"),n=d(i[0]).serializeArray()
;var r=i.data("ujs:submit-button");r&&(n.push(r),i.data("ujs:submit-button",null)),i.data("ujs:submit-button-formmethod",null),i.data("ujs:submit-button-formaction",null)}else i.is(c.inputChangeSelector)?(e=i.data("method"),t=i.data("url"),n=i.serialize(),i.data("params")&&(n=n+"&"+i.data("params"))):i.is(c.buttonClickSelector)?(e=i.data("method")||"get",t=i.data("url"),n=i.serialize(),i.data("params")&&(n=n+"&"+i.data("params"))):(e=i.data("method"),t=c.href(i),n=i.data("params")||null);return o={type:e||"GET",data:n,dataType:s,beforeSend:function(e,t){if(t.dataType===l&&e.setRequestHeader("accept","*/*;q=0.5, "+t.accepts.script),!c.fire(i,"ajax:beforeSend",[e,t]))return!1;i.trigger("ajax:send",e)},success:function(e,t,n){i.trigger("ajax:success",[e,t,n])},complete:function(e,t){i.trigger("ajax:complete",[e,t])},error:function(e,t,n){i.trigger("ajax:error",[e,t,n])},crossDomain:c.isCrossDomain(t)},a&&(o.xhrFields={withCredentials:a}),t&&(o.url=t),c.ajax(o)}return!1},isCrossDomain:function(e){var t=document.createElement("a");t.href=location.href;var n=document.createElement("a");try{return n.href=e,n.href=n.href,!((!n.protocol||":"===n.protocol)&&!n.host||t.protocol+"//"+t.host==n.protocol+"//"+n.host)}catch(i){return!0}},handleMethod:function(e){var t=c.href(e),n=e.data("method"),i=e.attr("target"),a=c.csrfToken(),s=c.csrfParam(),o=d('<form method="post" action="'+t+'"></form>'),r='<input name="_method" value="'+n+'" type="hidden" />';s===l||a===l||c.isCrossDomain(t)||(r+='<input name="'+s+'" value="'+a+'" type="hidden" />'),i&&o.attr("target",i),o.hide().append(r).appendTo("body"),o.submit()},formElements:function(e,t){return e.is("form")?d(e[0].elements).filter(t):e.find(t)},disableFormElements:function(e){c.formElements(e,c.disableSelector).each(function(){c.disableFormElement(d(this))})},disableFormElement:function(e){var t,n;t=e.is("button")?"html":"val",(n=e.data("disable-with"))!==l&&(e.data("ujs:enable-with",e[t]()),e[t](n)),e.prop("disabled",!0),e.data("ujs:disabled",!0)},enableFormElements:function(e){c.formElements(e,c.enableSelector).each(function(){c.enableFormElement(d(this))})},enableFormElement:function(e){var t=e.is("button")?"html":"val";e.data("ujs:enable-with")!==l&&(e[t](e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.prop("disabled",!1),e.removeData("ujs:disabled")},allowAction:function(e){var t,n=e.data("confirm"),i=!1;if(!n)return!0;if(c.fire(e,"confirm")){try{i=c.confirm(n)}catch(a){(console.error||console.log).call(console,a.stack||a)}t=c.fire(e,"confirm:complete",[i])}return i&&t},blankInputs:function(e,t,n){var i,a,s,o=d(),r=t||"input,textarea",l=e.find(r),c={};return l.each(function(){(i=d(this)).is("input[type=radio]")?(s=i.attr("name"),c[s]||(0===e.find('input[type=radio]:checked[name="'+s+'"]').length&&(a=e.find('input[type=radio][name="'+s+'"]'),o=o.add(a)),c[s]=s)):(i.is("input[type=checkbox],input[type=radio]")?i.is(":checked"):!!i.val())===n&&(o=o.add(i))}),!!o.length&&o},nonBlankInputs:function(e,t){return c.blankInputs(e,t,!0)},stopEverything:function(e){return d(e.target).trigger("ujs:everythingStopped"),e.stopImmediatePropagation(),!1},disableElement:function(e){var t=e.data("disable-with");t!==l&&(e.data("ujs:enable-with",e.html()),e.html(t)),e.on("click.railsDisable",function(e){return c.stopEverything(e)}),e.data("ujs:disabled",!0)},enableElement:function(e){e.data("ujs:enable-with")!==l&&(e.html(e.data("ujs:enable-with")),e.removeData("ujs:enable-with")),e.off("click.railsDisable"),e.removeData("ujs:disabled")}},c.fire(e,"rails:attachBindings")&&(d.ajaxPrefilter(function(e,t,n){e.crossDomain||c.CSRFProtection(n)}),d(window).on("pageshow.rails",function(){d(d.rails.enableSelector).each(function(){var e=d(this);e.data("ujs:disabled")&&d.rails.enableFormElement(e)}),d(d.rails.linkDisableSelector).each(function(){var e=d(this);e.data("ujs:disabled")&&d.rails.enableElement(e)})}),e.on("ajax:complete",c.linkDisableSelector,function(){c.enableElement(d(this))}),e.on("ajax:complete",c.buttonDisableSelector,function(){c.enableFormElement(d(this))}),e.on("click.rails",c.linkClickSelector,function(e){var t=d(this),n=t.data("method"),i=t.data("params"),a=e.metaKey||e.ctrlKey;if(!c.allowAction(t))return c.stopEverything(e);if(!a&&t.is(c.linkDisableSelector)&&c.disableElement(t),c.isRemote(t)){if(a&&(!n||"GET"===n)&&!i)return!0;var s=c.handleRemote(t);return!1===s?c.enableElement(t):s.fail(function(){c.enableElement(t)}),!1}return n?(c.handleMethod(t),!1):void 0}),e.on("click.rails",c.buttonClickSelector,function(e){var t=d(this);if(!c.allowAction(t)||!c.isRemote(t))return c.stopEverything(e);t.is(c.buttonDisableSelector)&&c.disableFormElement(t);var n=c.handleRemote(t);return!1===n?c.enableFormElement(t):n.fail(function(){c.enableFormElement(t)}),!1}),e.on("change.rails",c.inputChangeSelector,function(e){var t=d(this);return c.allowAction(t)&&c.isRemote(t)?(c.handleRemote(t),!1):c.stopEverything(e)}),e.on("submit.rails",c.formSubmitSelector,function(e){var t,n,i=d(this),a=c.isRemote(i);if(!c.allowAction(i))return c.stopEverything(e);if(i.attr("novalidate")===l)if(i.data("ujs:formnovalidate-button")===l){if((t=c.blankInputs(i,c.requiredInputSelector,!1))&&c.fire(i,"ajax:aborted:required",[t]))return c.stopEverything(e)}else i.data("ujs:formnovalidate-button",l);if(a){if(n=c.nonBlankInputs(i,c.fileInputSelector)){setTimeout(function(){c.disableFormElements(i)},13);var s=c.fire(i,"ajax:aborted:file",[n]);return s||setTimeout(function(){c.enableFormElements(i)},13),s}return c.handleRemote(i),!1}setTimeout(function(){c.disableFormElements(i)},13)}),e.on("click.rails",c.formInputClickSelector,function(e){var t=d(this);if(!c.allowAction(t))return c.stopEverything(e);var n=t.attr("name"),i=n?{name:n,value:t.val()}:null,a=t.closest("form");0===a.length&&(a=d("#"+t.attr("form"))),a.data("ujs:submit-button",i),a.data("ujs:formnovalidate-button",t.attr("formnovalidate")),a.data("ujs:submit-button-formaction",t.attr("formaction")),a.data("ujs:submit-button-formmethod",t.attr("formmethod"))}),e.on("ajax:send.rails",c.formSubmitSelector,function(e){this===e.target&&c.disableFormElements(d(this))}),e.on("ajax:complete.rails",c.formSubmitSelector,function(e){this===e.target&&c.enableFormElements(d(this))}),d(function(){c.refreshCSRFTokens()}))};window.jQuery?e(jQuery):"object"==typeof exports&&"object"==typeof module&&(module.exports=e)}(),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");var AutonumericRails;!function(){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(i){"use strict";function e(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(e.style[n]!==undefined)return{end:t[n]};return!1}i.fn.emulateTransitionEnd=function(e){var t=!1,n=this;return i(this).one("bsTransitionEnd",function(){t=!0}),setTimeout(function(){t||i(n).trigger(i.support.transition.end)},e),this},i(function(){i.support.transition=e(),i.support.transition&&(i.event.special.bsTransitionEnd={bindType:i.support.transition.end,delegateType:i.support.transition.end,handle:function(e){if(i(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";function e(n){return this.each(function(){var e=s(this),t=e.data("bs.alert");t||e.data("bs.alert",t=new o(this)),"string"==typeof n&&t[n].call(e)})}var t='[data-dismiss="alert"]',o=function(e){s(e).on("click",t,this.close)};o.VERSION="3.3.7",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function t(){a.detach().trigger("closed.bs.alert").remove()}var n=s(this),i=n.attr("data-target");i||(i=(i=n.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,""));var a=s("#"===i?[]:i);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=s.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),s.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",t).emulateTransitionEnd(o.TRANSITION_DURATION):t())};var n=s.fn.alert;s.fn.alert=e,s.fn.alert.Constructor=o,s.fn.alert.noConflict=function(){return s.fn.alert=n,this},s(document).on("click.bs.alert.data-api",t,o.prototype.close)}(jQuery),function(s){"use strict";function n(i){return this.each(function(){var e=s(this),t=e.data("bs.button"),n="object"==typeof i&&i;t||e.data("bs.button",t=new a(this,n)),"toggle"==i?t.toggle():i&&t.setState(i)})}var a=function(e,t){this.$element=s(e),this.options=s.extend({},a.DEFAULTS,t),this.isLoading=!1};a.VERSION="3.3.7",a.DEFAULTS={loadingText:"loading..."},a.prototype.setState=function(e){var t="disabled",n=this.$element,i=n.is("input")?"val":"html",a=n.data();e+="Text",null==a.resetText&&n.data("resetText",n[i]()),setTimeout(s.proxy(function(){n[i](null==a[e]?this.options[e]:a[e]),"loadingText"==e?(this.isLoading=!0,n.addClass(t).attr(t,t).prop(t,!0)):this.isLoading&&(this.isLoading=!1,n.removeClass(t).removeAttr(t).prop(t,!1))},this),0)},a.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var e=s.fn.button;s.fn.button=n,s.fn.button.Constructor=a,s.fn.button.noConflict=function(){return s.fn.button=e,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(e){var t=s(e.target).closest(".btn");n.call(t,"toggle"),s(e.target).is('input[type="radio"], input[type="checkbox"]')||(e.preventDefault(),t.is("input,button")?t.trigger("focus"):t.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){s(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),function(u){"use strict";function o(a){return this.each(function(){var e=u(this),t=e.data("bs.carousel"),n=u.extend({},_.DEFAULTS,e.data(),"object"==typeof a&&a),i="string"==typeof a?a:n.slide;t||e.data("bs.carousel",t=new _(this,n)),"number"==typeof a?t.to(a):i?t[i]():n.interval&&t.pause().cycle()})}var _=function(e,t){this.$element=u(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=t,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",u.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",u.proxy(this.pause,this)).on("mouseleave.bs.carousel",u.proxy(this.cycle,this))};_.VERSION="3.3.7",_.TRANSITION_DURATION=600,_.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},_.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},_.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(u.proxy(this.next,this),this.options.interval)),this},_.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},_.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t);if(("prev"==e&&0===n||"next"==e&&n==this.$items.length-1)&&!this.options.wrap)return t;var i=(n+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(i)},_.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){t.to(e)}):n==e?this.pause().cycle():this.slide(n<e?"next":"prev",this.$items.eq(e))},_.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&u.support.transition&&(this.$element.trigger(u.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},_.prototype.next=function(){if(!this.sliding)return this.slide("next")},_.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},_.prototype.slide=function(e,t){var n=this.$element.find(".item.active"),i=t||this.getItemForDirection(e,n),a=this.interval,s="next"==e?"left":"right",o=this;if(i.hasClass("active"))return this.sliding=!1;var r=i[0],l=u.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var c=u(this.$indicators.children()[this.getItemIndex(i)]);c&&c.addClass("active")}var d=u.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return u.support.transition&&this.$element.hasClass("slide")?(i.addClass(e),i[0].offsetWidth,n.addClass(s),i.addClass(s),n.one("bsTransitionEnd",function(){i.removeClass([e,s].join(" ")).addClass("active"),n.removeClass(["active",s].join(" ")),o.sliding=!1,setTimeout(function(){o.$element.trigger(d)},0)}).emulateTransitionEnd(_.TRANSITION_DURATION)):(n.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger(d)),a&&this.cycle(),this}};var e=u.fn.carousel;u.fn.carousel=o,u.fn.carousel.Constructor=_,u.fn.carousel.noConflict=function(){return u.fn.carousel=e,this};var t=function(e){var t,n=u(this),i=u(n.attr("data-target")||(t=n.attr("href"))&&t.replace(/.*(?=#[^\s]+$)/,""));if(i.hasClass("carousel")){var a=u.extend({},i.data(),n.data()),s=n.attr("data-slide-to");s&&(a.interval=!1),o.call(i,a),s&&i.data("bs.carousel").to(s),e.preventDefault()}};u(document).on("click.bs.carousel.data-api","[data-slide]",t).on("click.bs.carousel.data-api","[data-slide-to]",t),u(window).on("load",function(){u('[data-ride="carousel"]').each(function(){var e=u(this);o.call(e,e.data())})})}(jQuery),function(o){"use strict";function a(e){var t,n=e.attr("data-target")||(t=e.attr("href"))&&t.replace(/.*(?=#[^\s]+$)/,"");return o(n)}function r(i){return this.each(function(){var e=o(this),t=e.data("bs.collapse"),n=o.extend({},l.DEFAULTS,e.data(),"object"==typeof i&&i);!t&&n.toggle&&/show|hide/.test(i)&&(n.toggle=!1),t||e.data("bs.collapse",t=new l(this,n)),"string"==typeof i&&t[i]()})}var l=function(e,t){this.$element=o(e),this.options=o.extend({},l.DEFAULTS,t),this.$trigger=o('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};l.VERSION="3.3.7",l.TRANSITION_DURATION=350,l.DEFAULTS={toggle:!0},l.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},l.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,t=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(t&&t.length&&(e=t.data("bs.collapse"))&&e.transitioning)){var n=o.Event("show.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){t&&t.length&&(r.call(t,"hide"),e||t.data("bs.collapse",null));var i=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[i](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[i](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!o.support.transition)return a.call(this);var s=o.camelCase(["scroll",i].join("-"));this.$element.one("bsTransitionEnd",o.proxy(a,this)).emulateTransitionEnd(l.TRANSITION_DURATION)[i](this.$element[0][s])}}}},l.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=o.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var t=this.dimension();this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!o.support.transition)return n.call(this);this.$element[t](0).one("bsTransitionEnd",o.proxy(n,this)).emulateTransitionEnd(l.TRANSITION_DURATION)}}},l.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},l.prototype.getParent=function(){return o(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(o.proxy(function(e,t){var n=o(t);this.addAriaAndCollapsedClass(a(n),n)},this)).end()},l.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var e=o.fn.collapse;o.fn.collapse=r,o.fn.collapse.Constructor=l,o.fn.collapse.noConflict=function(){return o.fn.collapse=e,this},o(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(e){var t=o(this);t.attr("data-target")||e.preventDefault();var n=a(t),i=n.data("bs.collapse")?"toggle":t.data();r.call(n,i)})}(jQuery),function(r){"use strict";function l(e){var t=e.attr("data-target");t||(t=(t=e.attr("href"))&&/#[A-Za-z]/.test(t)&&t.replace(/.*(?=#[^\s]*$)/,""));var n=t&&r(t);return n&&n.length?n:e.parent()}function s(i){i&&3===i.which||(r(t).remove(),r(c).each(function(){var e=r(this),t=l(e),n={relatedTarget:this};t.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&r.contains(t[0],i.target)||(t.trigger(i=r.Event("hide.bs.dropdown",n)),i.isDefaultPrevented()||(e.attr("aria-expanded","false"),t.removeClass("open").trigger(r.Event("hidden.bs.dropdown",n)))))}))}function e(n){return this.each(function(){var e=r(this),t=e.data("bs.dropdown");t||e.data("bs.dropdown",t=new i(this)),"string"==typeof n&&t[n].call(e)})}var t=".dropdown-backdrop",c='[data-toggle="dropdown"]',i=function(e){r(e).on("click.bs.dropdown",this.toggle)};i.VERSION="3.3.7",i.prototype.toggle=function(e){var t=r(this);if(!t.is(".disabled, :disabled")){var n=l(t),i=n.hasClass("open");if(s(),!i){"ontouchstart"in document.documentElement&&!n.closest(".navbar-nav").length&&r(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(r(this)).on("click",s);var a={relatedTarget:this};if(n.trigger(e=r.Event("show.bs.dropdown",a)),e.isDefaultPrevented())return;t.trigger("focus").attr("aria-expanded","true"),n.toggleClass("open").trigger(r.Event("shown.bs.dropdown",a))}return!1}},i.prototype.keydown=function(e){if(/(38|40|27|32)/.test(e.which)&&!/input|textarea/i.test(e.target.tagName)){var t=r(this);if(e.preventDefault(),e.stopPropagation(),!t.is(".disabled, :disabled")){var n=l(t),i=n.hasClass("open");if(!i&&27!=e.which||i&&27==e.which)return 27==e.which&&n.find(c).trigger("focus"),t.trigger("click");var a=" li:not(.disabled):visible a",s=n.find(".dropdown-menu"+a);if(s.length){var o=s.index(e.target);38==e.which&&0<o&&o--,40==e.which&&o<s.length-1&&o++,~o||(o=0),s.eq(o).trigger("focus")}}}};var n=r.fn.dropdown;r.fn.dropdown=e,r.fn.dropdown.Constructor=i,r.fn.dropdown.noConflict=function(){return r.fn.dropdown=n,this},r(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",c,i.prototype.toggle).on("keydown.bs.dropdown.data-api",c,i.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",i.prototype.keydown)}(jQuery),function(s){"use strict";function o(i,a){return this.each(function(){var e=s(this),t=e.data("bs.modal"),n=s.extend({},r.DEFAULTS,e.data(),"object"==typeof i&&i);t||e.data("bs.modal",t=new r(this,n)),"string"==typeof i?t[i](a):n.show&&t.show(a)})}var r=function(e,t){this.options=t,this.$body=s(document.body),this.$element=s(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,s.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};r.VERSION="3.3.7",r.TRANSITION_DURATION=300,r.BACKDROP_TRANSITION_DURATION=150,r.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},r.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},r.prototype.show=function(n){var i=this,e=s.Event("show.bs.modal",{relatedTarget:n});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',s.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){i.$element.one("mouseup.dismiss.bs.modal",function(e){s(e.target).is(i.$element)&&(i.ignoreBackdropClick=!0)})}),this.backdrop(function(){var e=s.support.transition&&i.$element.hasClass("fade");i.$element.parent().length||i.$element.appendTo(i.$body),i.$element.show().scrollTop(0),i.adjustDialog(),e&&i.$element[0].offsetWidth,i.$element.addClass("in"),i.enforceFocus();var t=s.Event("shown.bs.modal",{relatedTarget:n});e?i.$dialog.one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(t)}).emulateTransitionEnd(r.TRANSITION_DURATION):i.$element.trigger("focus").trigger(t)}))},r.prototype.hide=function(e){e&&e.preventDefault(),e=s.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),s(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),s.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",s.proxy(this.hideModal,this)).emulateTransitionEnd(r.TRANSITION_DURATION):this.hideModal())},r.prototype.enforceFocus=function(){s(document).off("focusin.bs.modal").on("focusin.bs.modal",s.proxy(function(e){document===e.target||this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},r.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",s.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},r.prototype.resize=function(){this.isShown?s(window).on("resize.bs.modal",s.proxy(this.handleUpdate,this)):s(window).off("resize.bs.modal")},r.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},r.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},r.prototype.backdrop=function(e){var t=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=s.support.transition&&n;if(this.$backdrop=s(document.createElement("div")).addClass("modal-backdrop "+n).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",s.proxy(function(e){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;i?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(r.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){t.removeBackdrop(),e&&e()};s.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(r.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},r.prototype.handleUpdate=function(){this.adjustDialog()},r.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},r.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},r.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth<e,this.scrollbarWidth=this.measureScrollbar()},r.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},r.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},r.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var e=s.fn.modal;s.fn.modal=o,s.fn.modal.Constructor=r,s.fn.modal.noConflict=function(){return s.fn.modal=e,this},s(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(e){var t=s(this),n=t.attr("href"),i=s(t.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=i.data("bs.modal")?"toggle":s.extend({remote:!/#/.test(n)&&n},i.data(),t.data());t.is("a")&&e.preventDefault(),i.one("show.bs.modal",function(e){e.isDefaultPrevented()||i.one("hidden.bs.modal",function(){t.is(":visible")&&t.trigger("focus")})}),o.call(i,a,this)})}(jQuery),function(f){"use strict";function e(i){return this.each(function(){var e=f(this),t=e.data("bs.tooltip"),n="object"==typeof i&&i;!t&&/destroy|hide/.test(i)||(t||e.data("bs.tooltip",t=new m(this,n)),"string"==typeof i&&t[i]())})}var m=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};m.VERSION="3.3.7",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},m.prototype.init=function(e,t,n){if(this.enabled=!0,this.type=e,this.$element=f(t),this.options=this.getOptions(n),this.$viewport=this.options.viewport&&f(f.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var i=this.options.trigger.split(" "),a=i.length;a--;){var s=i[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,f.proxy(this.toggle,this));else if("manual"!=s){var o="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,f.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,f.proxy(this.leave,this))}}this.options.selector?this._options=f.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(e){return(e=f.extend({},this.getDefaults(),this.$element.data(),e)).delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},m.prototype.getDelegateOptions=function(){var n={},i=this.getDefaults();return this._options&&f.each(this._options,function(e,t){i[e]!=t&&(n[e]=t)}),n},m.prototype.enter=function(e){var t=e instanceof this.constructor?e:f(e.currentTarget).data("bs."+this.type);if(t||(t=new this.constructor(e.currentTarget,this.getDelegateOptions()),f(e.currentTarget).data("bs."+this.type,t)),e instanceof f.Event&&(t.inState["focusin"==e.type?"focus":"hover"]=!0),t.tip().hasClass("in")||"in"==t.hoverState)t.hoverState="in";else{if(clearTimeout(t.timeout),t.hoverState="in",!t.options.delay||!t.options.delay.show)return t.show();t.timeout=setTimeout(function(){"in"==t.hoverState&&t.show()},t.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},m.prototype.leave=function(e){var t=e instanceof this.constructor?e:f(e.currentTarget).data("bs."+this.type);if(t||(t=new this.constructor(e.currentTarget,this.getDelegateOptions()),f(e.currentTarget).data("bs."+this.type,t)),e instanceof f.Event&&(t.inState["focusout"==e.type?"focus":"hover"]=!1),!t.isInStateTrue()){if(clearTimeout(t.timeout),t.hoverState="out",!t.options.delay||!t.options.delay.hide)return t.hide();t.timeout=setTimeout(function(){"out"==t.hoverState&&t.hide()},t.options.delay.hide)}},m.prototype.show=function(){var e=f.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var t=f.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!t)return;var n=this,i=this.tip(),a=this.getUID(this.type);this.setContent(),i.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&i.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,o=/\s?auto?\s?/i,r=o.test(s);r&&(s=s.replace(o,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),c=i[0].offsetWidth,d=i[0].offsetHeight;if(r){var u=s,_=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>_.bottom?"top":"top"==s&&l.top-d<_.top?"bottom":"right"==s&&l.right+c>_.width?"left":"left"==s&&l.left-c<_.left?"right":s,i.removeClass(u).addClass(s)}var h=this.getCalculatedOffset(s,l,c,d);this.applyPlacement(h,s);var p=function(){var e=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==e&&n.leave(n)};f.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",p).emulateTransitionEnd(m.TRANSITION_DURATION):p()}},m.prototype.applyPlacement=function(e,t){var n=this.tip(),i=n[0].offsetWidth,a=n[0].offsetHeight,s=parseInt(n.css("margin-top"),10),o=parseInt(n.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(o)&&(o=0),e.top+=s,e.left+=o,f.offset.setOffset(n[0],f.extend({using:function(e){n.css({top:Math.round(e.top),left:Math.round(e.left)})}},e),0),n.addClass("in");var r=n[0].offsetWidth,l=n[0].offsetHeight;"top"==t&&l!=a&&(e.top=e.top+a-l);var c=this.getViewportAdjustedDelta(t,e,r,l);c.left?e.left+=c.left:e.top+=c.top;var d=/top|bottom/.test(t),u=d?2*c.left-i+r:2*c.top-a+l,_=d?"offsetWidth":"offsetHeight";n.offset(e),this.replaceArrow(u,n[0][_],d)},m.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},m.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},m.prototype.hide=function(e){function t(){"in"!=n.hoverState&&i.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,i=f(this.$tip),a=f.Event("hide.bs."+this.type);if(this.$element.trigger(a),!a.isDefaultPrevented())return i.removeClass("in"),f.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",t).emulateTransitionEnd(m.TRANSITION_DURATION):t(),this.hoverState=null,this},m.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(e){var t=(e=e||this.$element)[0],n="BODY"==t.tagName,i=t.getBoundingClientRect();null==i.width&&(i=f.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var a=window.SVGElement&&t instanceof window.SVGElement,s=n?{top:0,left:0}:a?null:e.offset(),o={
scroll:n?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},r=n?{width:f(window).width(),height:f(window).height()}:null;return f.extend({},i,o,r,s)},m.prototype.getCalculatedOffset=function(e,t,n,i){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-i,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-i/2,left:t.left-n}:{top:t.top+t.height/2-i/2,left:t.left+t.width}},m.prototype.getViewportAdjustedDelta=function(e,t,n,i){var a={top:0,left:0};if(!this.$viewport)return a;var s=this.options.viewport&&this.options.viewport.padding||0,o=this.getPosition(this.$viewport);if(/right|left/.test(e)){var r=t.top-s-o.scroll,l=t.top+s-o.scroll+i;r<o.top?a.top=o.top-r:l>o.top+o.height&&(a.top=o.top+o.height-l)}else{var c=t.left-s,d=t.left+s+n;c<o.left?a.left=o.left-c:d>o.right&&(a.left=o.left+o.width-d)}return a},m.prototype.getTitle=function(){var e=this.$element,t=this.options;return e.attr("data-original-title")||("function"==typeof t.title?t.title.call(e[0]):t.title)},m.prototype.getUID=function(e){for(;e+=~~(1e6*Math.random()),document.getElementById(e););return e},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=f(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(e){var t=this;e&&((t=f(e.currentTarget).data("bs."+this.type))||(t=new this.constructor(e.currentTarget,this.getDelegateOptions()),f(e.currentTarget).data("bs."+this.type,t))),e?(t.inState.click=!t.inState.click,t.isInStateTrue()?t.enter(t):t.leave(t)):t.tip().hasClass("in")?t.leave(t):t.enter(t)},m.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null})};var t=f.fn.tooltip;f.fn.tooltip=e,f.fn.tooltip.Constructor=m,f.fn.tooltip.noConflict=function(){return f.fn.tooltip=t,this}}(jQuery),function(a){"use strict";function e(i){return this.each(function(){var e=a(this),t=e.data("bs.popover"),n="object"==typeof i&&i;!t&&/destroy|hide/.test(i)||(t||e.data("bs.popover",t=new s(this,n)),"string"==typeof i&&t[i]())})}var s=function(e,t){this.init("popover",e,t)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.3.7",s.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),s.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),(s.prototype.constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof n?"html":"append":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=a.fn.popover;a.fn.popover=e,a.fn.popover.Constructor=s,a.fn.popover.noConflict=function(){return a.fn.popover=t,this}}(jQuery),function(s){"use strict";function a(e,t){this.$body=s(document.body),this.$scrollElement=s(e).is(document.body)?s(window):s(e),this.options=s.extend({},a.DEFAULTS,t),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function t(i){return this.each(function(){var e=s(this),t=e.data("bs.scrollspy"),n="object"==typeof i&&i;t||e.data("bs.scrollspy",t=new a(this,n)),"string"==typeof i&&t[i]()})}a.VERSION="3.3.7",a.DEFAULTS={offset:10},a.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},a.prototype.refresh=function(){var e=this,i="offset",a=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(i="position",a=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=s(this),t=e.data("target")||e.attr("href"),n=/^#./.test(t)&&s(t);return n&&n.length&&n.is(":visible")&&[[n[i]().top+a,t]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},a.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),a=this.offsets,s=this.targets,o=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),i<=t)return o!=(e=s[s.length-1])&&this.activate(e);if(o&&t<a[0])return this.activeTarget=null,this.clear();for(e=a.length;e--;)o!=s[e]&&t>=a[e]&&(a[e+1]===undefined||t<a[e+1])&&this.activate(s[e])},a.prototype.activate=function(e){this.activeTarget=e,this.clear();var t=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',n=s(t).parents("li").addClass("active");n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate.bs.scrollspy")},a.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var e=s.fn.scrollspy;s.fn.scrollspy=t,s.fn.scrollspy.Constructor=a,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=e,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var e=s(this);t.call(e,e.data())})})}(jQuery),function(r){"use strict";function t(n){return this.each(function(){var e=r(this),t=e.data("bs.tab");t||e.data("bs.tab",t=new o(this)),"string"==typeof n&&t[n]()})}var o=function(e){this.element=r(e)};o.VERSION="3.3.7",o.TRANSITION_DURATION=150,o.prototype.show=function(){var e=this.element,t=e.closest("ul:not(.dropdown-menu)"),n=e.data("target");if(n||(n=(n=e.attr("href"))&&n.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var i=t.find(".active:last a"),a=r.Event("hide.bs.tab",{relatedTarget:e[0]}),s=r.Event("show.bs.tab",{relatedTarget:i[0]});if(i.trigger(a),e.trigger(s),!s.isDefaultPrevented()&&!a.isDefaultPrevented()){var o=r(n);this.activate(e.closest("li"),t),this.activate(o,o.parent(),function(){i.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:i[0]})})}}},o.prototype.activate=function(e,t,n){function i(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=t.find("> .active"),s=n&&r.support.transition&&(a.length&&a.hasClass("fade")||!!t.find("> .fade").length);a.length&&s?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i(),a.removeClass("in")};var e=r.fn.tab;r.fn.tab=t,r.fn.tab.Constructor=o,r.fn.tab.noConflict=function(){return r.fn.tab=e,this};var n=function(e){e.preventDefault(),t.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),function(l){"use strict";function n(i){return this.each(function(){var e=l(this),t=e.data("bs.affix"),n="object"==typeof i&&i;t||e.data("bs.affix",t=new c(this,n)),"string"==typeof i&&t[i]()})}var c=function(e,t){this.options=l.extend({},c.DEFAULTS,t),this.$target=l(this.options.target).on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.7",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(e,t,n,i){var a=this.$target.scrollTop(),s=this.$element.offset(),o=this.$target.height();if(null!=n&&"top"==this.affixed)return a<n&&"top";if("bottom"==this.affixed)return null!=n?!(a+this.unpin<=s.top)&&"bottom":!(a+o<=e-i)&&"bottom";var r=null==this.affixed,l=r?a:s.top;return null!=n&&a<=n?"top":null!=i&&e-i<=l+(r?o:t)&&"bottom"},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},c.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),t=this.options.offset,n=t.top,i=t.bottom,a=Math.max(l(document).height(),l(document.body).height());"object"!=typeof t&&(i=n=t),"function"==typeof n&&(n=t.top(this.$element)),"function"==typeof i&&(i=t.bottom(this.$element));var s=this.getState(a,e,n,i);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var o="affix"+(s?"-"+s:""),r=l.Event(o+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(o).trigger(o.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:a-e-i})}};var e=l.fn.affix;l.fn.affix=n,l.fn.affix.Constructor=c,l.fn.affix.noConflict=function(){return l.fn.affix=e,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var e=l(this),t=e.data();t.offset=t.offset||{},null!=t.offsetBottom&&(t.offset.bottom=t.offsetBottom),null!=t.offsetTop&&(t.offset.top=t.offsetTop),n.call(e,t)})})}(jQuery),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(r){function i(e,t){var n,i,a,s=e.nodeName.toLowerCase();return"area"===s?(i=(n=e.parentNode).name,!(!e.href||!i||"map"!==n.nodeName.toLowerCase())&&(!!(a=r("img[usemap='#"+i+"']")[0])&&o(a))):(/^(input|select|textarea|button|object)$/.test(s)?!e.disabled:"a"===s&&e.href||t)&&o(e)}function o(e){return r.expr.filters.visible(e)&&!r(e).parents().addBack().filter(function(){return"hidden"===r.css(this,"visibility")}).length}var e,t,n,a;r.ui=r.ui||{},r.extend(r.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),r.fn.extend({scrollParent:function(e){var t=this.css("position"),n="absolute"===t,i=e?/(auto|scroll|hidden)/:/(auto|scroll)/,a=this.parents().filter(function(){var e=r(this);return(!n||"static"!==e.css("position"))&&i.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==t&&a.length?a:r(this[0].ownerDocument||document)},uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&r(this).removeAttr("id")})}}),r.extend(r.expr[":"],{data:r.expr.createPseudo?r.expr.createPseudo(function(t){return function(e){return!!r.data(e,t)}}):function(e,t,n){return!!r.data(e,n[3])},focusable:function(e){return i(e,!isNaN(r.attr(e,"tabindex")))},tabbable:function(e){var t=r.attr(e,"tabindex"),n=isNaN(t);return(n||0<=t)&&i(e,!n)}}),r("<a>").outerWidth(1).jquery||r.each(["Width","Height"],function(e,n){function i(e,t,n,i){return r.each(a,function(){t-=parseFloat(r.css(e,"padding"+this))||0,n&&(t-=parseFloat(r.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(r.css(e,"margin"+this))||0)}),t}var a="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),o={innerWidth:r.fn.innerWidth,innerHeight:r.fn.innerHeight,outerWidth:r.fn.outerWidth,outerHeight:r.fn.outerHeight};r.fn["inner"+n]=function(e){return e===undefined?o["inner"+n].call(this):this.each(function(){r(this).css(s,i(this,e)+"px")})},r.fn["outer"+n]=function(e,t){return"number"!=typeof e?o["outer"+n].call(this,e):this.each(function(){r(this).css(s,i(this,e,!0,t)+"px")})}}),r.fn.addBack||(r.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),r("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(r.fn.removeData=(t=r.fn.removeData,function(e){return arguments.length?t.call(this,r.camelCase(e)):t.call(this)})),r.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),r.fn.extend({focus:(a=r.fn.focus,function(t,n){return"number"==typeof t?this.each(function(){var e=this;setTimeout(function(){r(e).focus(),n&&n.call(e)},t)}):a.apply(this,arguments)}),disableSelection:(n="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.bind(n+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(e!==undefined)return this.css("zIndex",e);if(this.length)for(var t,n,i=r(this[0]);i.length&&i[0]!==document;){if(("absolute"===(t=i.css("position"))||"relative"===t||"fixed"===t)&&(n=parseInt(i.css("zIndex"),10),!isNaN(n)&&0!==n))return n;i=i.parent()}return 0}}),r.ui.plugin={add:function(e,t,n){var i,a=r.ui[e].prototype;for(i in n)a.plugins[i]=a.plugins[i]||[],a.plugins[i].push([t,n[i]])},call:function(e,t,n,i){var a,s=e.plugins[t];if(s&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(a=0;a<s.length;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,n)}}}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(d){var s,n=0,r=Array.prototype.slice;return d.cleanData=(s=d.cleanData,function(e){var t,n,i;for(i=0;null!=(n=e[i]);i++)try{(t=d._data(n,"events"))&&t.remove&&d(n).triggerHandler("remove")}catch(a){}s(e)}),d.widget=function(e,n,t){var i,a,s,o,r={},l=e.split(".")[0];return e=e.split(".")[1],i=l+"-"+e,t||(t=n,n=d.Widget),d.expr[":"][i.toLowerCase()]=function(e){return!!d.data(e,i)},d[l]=d[l]||{},a=d[l][e],s=d[l][e]=function(e,t){if(!this._createWidget)return new s(e,t);arguments.length&&this._createWidget(e,t)},d.extend(s,a,{version:t.version,_proto:d.extend({},t),_childConstructors:[]}),(o=new n).options=d.widget.extend({},o.options),d.each(t,function(t,i){var a,s;d.isFunction(i)?r[t]=(a=function(){return n.prototype[t].apply(this,arguments)},s=function(e){return n.prototype[t].apply(this,e)},function(){var e,t=this._super,n=this._superApply;return this._super=a,this._superApply=s,e=i.apply(this,arguments),this._super=t,this._superApply=n,e}):r[t]=i}),s.prototype=d.widget.extend(o,{widgetEventPrefix:a&&o.widgetEventPrefix||e},r,{constructor:s,namespace:l,widgetName:e,widgetFullName:i}),a?(d.each(a._childConstructors,function(e,t){var n=t.prototype;d.widget(n.namespace+"."+n.widgetName,s,t._proto)}),delete a._childConstructors):n._childConstructors.push(s),d.widget.bridge(e,s),s},d.widget.extend=function(e){for(var t,n,i=r.call(arguments,1),a=0,s=i.length;a<s;a++)for(t in i[a])n=i[a][t],i[a].hasOwnProperty(t)&&n!==undefined&&(d.isPlainObject(n)?e[t]=d.isPlainObject(e[t])?d.widget.extend({},e[t],n):d.widget.extend({},n):e[t]=n);return e},d.widget.bridge=function(s,t){var o=t.prototype.widgetFullName||s;d.fn[s]=function(n){var e="string"==typeof n,i=r.call(arguments,1),a=this;return e?this.each(function(){var e,t=d.data(this,o);return"instance"===n?(a=t,!1):t?d.isFunction(t[n])&&"_"!==n.charAt(0)?(e=t[n].apply(t,i))!==t&&e!==undefined?(a=e&&e.jquery?a.pushStack(e.get()):e,!1):void 0:d.error("no such method '"+n+"' for "+s+" widget instance"):d.error("cannot call methods on "+s+" prior to initialization; attempted to call method '"+n+"'")}):(i.length&&(n=d.widget.extend.apply(null,[n].concat(i))),this.each(function(){var e=d.data(this,o);e?(e.option(n||{}),e._init&&e._init()):d.data(this,o,new t(n,this))})),a}},d.Widget=function(){},d.Widget._childConstructors=[],d.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(e,t){t=d(t||this.defaultElement||this)[0],this.element=d(t),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=d(),this.hoverable=d(),this.focusable=d(),t!==this&&(d.data(t,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===t&&this.destroy()}}),this.document=d(t.style?t.ownerDocument:t.document||t),this.window=d(this.document[0].defaultView||this.document[0].parentWindow)),this.options=d.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:d.noop,_getCreateEventData:d.noop,_create:d.noop,_init:d.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(d.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:d.noop,widget:function(){return this.element},option:function(e,t){var n,i,a,s=e;if(0===arguments.length)return d.widget.extend({},this.options);if("string"==typeof e)if(s={},e=(n=e.split(".")).shift(),n.length){for(i=s[e]=d.widget.extend({},this.options[e]),a=0;a<n.length-1;a++)i[n[a]]=i[n[a]]||{},i=i[n[a]];if(e=n.pop(),1===arguments.length)return i[e]===undefined?null:i[e];i[e]=t}else{if(1===arguments.length)return this.options[e]===undefined?null:this.options[e];s[e]=t}return this._setOptions(s),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(o,r,e){var l,c=this;"boolean"!=typeof o&&(e=r,r=o,o=!1),e?(r=l=d(r),this.bindings=this.bindings.add(r)):(e=r,r=this.element,l=this.widget()),d.each(e,function(e,t){function n(){if(o||!0!==c.options.disabled&&!d(this).hasClass("ui-state-disabled"))return("string"==typeof t?c[t]:t).apply(c,arguments)}"string"!=typeof t&&(n.guid=t.guid=t.guid||n.guid||d.guid++);var i=e.match(/^([\w:-]*)\s*(.*)$/),a=i[1]+c.eventNamespace,s=i[2];s?l.delegate(s,a,n):r.bind(a,n)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t),this.bindings=d(this.bindings.not(e).get()),this.focusable=d(this.focusable.not(e).get()),this.hoverable=d(this.hoverable.not(e).get())},_delay:function(e,t){function n(){return("string"==typeof e?i[e]:e).apply(i,arguments)}var i=this;return setTimeout(n,t||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){d(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){d(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){d(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){d(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,t,n){var i,a,s=this.options[e];if(n=n||{},(t=d.Event(t)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),t.target=this.element[0],a=t.originalEvent)for(i in a)i in t||(t[i]=a[i]);return this.element.trigger(t,n),!(d.isFunction(s)&&!1===s.apply(this.element[0],[t].concat(n))||t.isDefaultPrevented())}},d.each({show:"fadeIn",hide:"fadeOut"},function(s,o){d.Widget.prototype["_"+s]=function(t,e,n){"string"==typeof e&&(e={effect:e});var i,a=e?!0===e||"number"==typeof e?o:e.effect||o:s;"number"==typeof(e=e||{})&&(e={duration:e}),i=!d.isEmptyObject(e),e.complete=n,e.delay&&t.delay(e.delay),i&&d.effects&&d.effects.effect[a]?t[s](e):a!==s&&t[a]?t[a](e.duration,e.easing,n):t.queue(function(e){d(this)[s](),n&&n.call(t[0]),e()})}}),d.widget}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],e):e(jQuery)}(function(c){return c.widget("ui.accordion",{version:"1.11.4",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=c(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():c()}},_createIcons:function(){var e=this.options.icons;e&&(c("<span>").addClass("ui-accordion-header-icon ui-icon "+e.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(e.header).addClass(e.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").css("display","").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"!==e?("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&(this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t))):this._activate(t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var t=c.ui.keyCode,n=this.headers.length,i=this.headers.index(e.target),a=!1;switch(e.keyCode){case t.RIGHT:case t.DOWN:a=this.headers[(i+1)%n];break;case t.LEFT:case t.UP:a=this.headers[(i-1+n)%n];break;case t.SPACE:case t.ENTER:this._eventHandler(e);break;case t.HOME:a=this.headers[0];break;case t.END:a=this.headers[n-1]}a&&(c(e.target).attr("tabIndex",-1),c(a).attr("tabIndex",0),a.focus(),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===c.ui.keyCode.UP&&e.ctrlKey&&c(e.currentTarget).prev().focus()},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=c()):!1===e.active?this._activate(0):this.active.length&&!c.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=c()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-state-default ui-corner-all"),this.panels=this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide(),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var n,e=this.options,t=e.heightStyle,i=this.element.parent();this.active=this._findActive(e.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(){var e=c(this),t=e.uniqueId().attr("id"),n=e.next(),i=n.uniqueId().attr("id");e.attr("aria-controls",i),n.attr("aria-labelledby",t)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(e.event),"fill"===t?(n=i.height(),this.element.siblings(":visible").each(function(){var e=c(this),t=e.css("position");"absolute"!==t&&"fixed"!==t&&(n-=e.outerHeight(!0))}),this.headers.each(function(){n-=c(this).outerHeight(!0)}),this.headers.next().each(function(){c(this).height(Math.max(0,n-c(this).innerHeight()+c(this).height()))}).css("overflow","auto")):"auto"===t&&(n=0,this.headers.next().each(function(){n=Math.max(n,c(this).css("height","").height())}).height(n))},_activate:function(e){var t=this._findActive(e)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:c.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):c()},_setupEvents:function(e){var n={keydown:"_keydown"};e&&c.each(e.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,n),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var t=this.options,n=this.active,i=c(e.currentTarget),a=i[0]===n[0],s=a&&t.collapsible,o=s?c():i.next(),r=n.next(),l={oldHeader:n,oldPanel:r,newHeader:s?c():i,newPanel:o};e.preventDefault(),a&&!t.collapsible||!1===this._trigger("beforeActivate",e,l)||(t.active=!s&&this.headers.index(i),this.active=a?c():i,this._toggle(l),n.removeClass("ui-accordion-header-active ui-state-active"),t.icons&&n.children(".ui-accordion-header-icon").removeClass(t.icons.activeHeader).addClass(t.icons.header),a||(i.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),t.icons&&i.children(".ui-accordion-header-icon").removeClass(t.icons.header).addClass(t.icons.activeHeader),i.next().addClass("ui-accordion-content-active")))},_toggle:function(e){var t=e.newPanel,n=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=t,this.prevHide=n,this.options.animate?this._animate(t,n,e):(n.hide(),t.show(),this._toggleComplete(e)),n.attr({"aria-hidden":"true"}),n.prev().attr({"aria-selected":"false","aria-expanded":"false"}),t.length&&n.length?n.prev().attr({tabIndex:-1,"aria-expanded":"false"}):t.length&&this.headers.filter(function(){return 0===parseInt(c(this).attr("tabIndex"),10)}).attr("tabIndex",-1),t.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,n,t){var i,a,s,o=this,r=0,l=e.css("box-sizing"),c=e.length&&(!n.length||e.index()<n.index()),d=this.options.animate||{},u=c&&d.down||d,_=function(){o._toggleComplete(t)};return"number"==typeof u&&(s=u),"string"==typeof u&&(a=u),a=a||u.easing||d.easing,s=s||u.duration||d.duration,n.length?e.length?(i=e.show().outerHeight(),n.animate(this.hideProps,{duration:s,easing:a,step:function(e,t){t.now=Math.round(e)}}),void e.hide().animate(this.showProps,{duration:s,easing:a,complete:_,step:function(e,t){t.now=Math.round(e),"height"!==t.prop?"content-box"===l&&(r+=t.now):"content"!==o.options.heightStyle&&(t.now=Math.round(i-n.outerHeight()-r),r=0)}})):n.animate(this.hideProps,s,a,_):e.animate(this.showProps,s,a,_)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(x){return function(){function $(e,t,n){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?n/100:1)]}function w(e,t){return parseInt(x.css(e,t),10)||0}function t(e){var t=e[0];return 9===t.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:x.isWindow(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}x.ui=x.ui||{};var a,k,C=Math.max,E=Math.abs,T=Math.round,i=/left|center|right/,s=/top|center|bottom/,o=/[\+\-]\d+(\.[\d]+)?%?/,r=/^\w+/,l=/%$/,n=x.fn.position;x.position={scrollbarWidth:function(){if(a!==undefined)return a;var e,t,n=x("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),i=n.children()[0];return x("body").append(n),e=i.offsetWidth,n.css("overflow","scroll"),e===(t=i.offsetWidth)&&(t=n[0].clientWidth),n.remove(),a=e-t},getScrollInfo:function(e){var t=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),n=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),i="scroll"===t||"auto"===t&&e.width<e.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&e.height<e.element[0].scrollHeight?x.position.scrollbarWidth():0,height:i?x.position.scrollbarWidth():0}},getWithinInfo:function(e){var t=x(e||window),n=x.isWindow(t[0]),i=!!t[0]&&9===t[0].nodeType;return{element:t,isWindow:n,isDocument:i,offset:t.offset()||{left:0,top:0},scrollLeft:t.scrollLeft(),scrollTop:t.scrollTop(),width:n||i?t.width():t.outerWidth(),height:n||i?t.height():t.outerHeight()}}},x.fn.position=function(u){if(!u||!u.of)return n.apply(this,arguments);u=x.extend({},u);var _,h,p,f,m,e,g=x(u.of),A=x.position.getWithinInfo(u.within),v=x.position.getScrollInfo(A),b=(u.collision||"flip").split(" "),y={};return e=t(g),g[0].preventDefault&&(u.at="left top"),h=e.width,p=e.height,f=e.offset,m=x.extend({},f),x.each(["my","at"],function(){var e,t,n=(u[this]||"").split(" ");1===n.length&&(n=i.test(n[0])?n.concat(["center"]):s.test(n[0])?["center"].concat(n):["center","center"]),n[0]=i.test(n[0])?n[0]:"center",n[1]=s.test(n[1])?n[1]:"center",e=o.exec(n[0]),t=o.exec(n[1]),y[this]=[e?e[0]:0,t?t[0]:0],u[this]=[r.exec(n[0])[0],r.exec(n[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===u.at[0]?m.left+=h:"center"===u.at[0]&&(m.left+=h/2),"bottom"===u.at[1]?m.top+=p:"center"===u.at[1]&&(m.top+=p/2),_=$(y.at,h,p),m.left+=_[0],m.top+=_[1],this.each(function(){var n,e,o=x(this),r=o.outerWidth(),l=o.outerHeight(),t=w(this,"marginLeft"),i=w(this,"marginTop"),a=r+t+w(this,"marginRight")+v.width,s=l+i+w(this,"marginBottom")+v.height,c=x.extend({},m),d=$(y.my,o.outerWidth(),o.outerHeight());"right"===u.my[0]?c.left-=r:"center"===u.my[0]&&(c.left-=r/2),"bottom"===u.my[1]?c.top-=l:"center"===u.my[1]&&(c.top-=l/2),c.left+=d[0],c.top+=d[1],k||(c.left=T(c.left),c.top=T(c.top)),n={marginLeft:t,marginTop:i},x.each(["left","top"],function(e,t){x.ui.position[b[e]]&&x.ui.position[b[e]][t](c,{targetWidth:h,targetHeight:p,elemWidth:r,elemHeight:l,collisionPosition:n,collisionWidth:a,collisionHeight:s,offset:[_[0]+d[0],_[1]+d[1]],my:u.my,at:u.at,within:A,elem:o})}),u.using&&(e=function(e){var t=f.left-c.left,n=t+h-r,i=f.top-c.top,a=i+p-l,s={target:{element:g,left:f.left,top:f.top,width:h,height:p},element:{element:o,left:c.left,top:c.top,width:r,height:l},
horizontal:n<0?"left":0<t?"right":"center",vertical:a<0?"top":0<i?"bottom":"middle"};h<r&&E(t+n)<h&&(s.horizontal="center"),p<l&&E(i+a)<p&&(s.vertical="middle"),C(E(t),E(n))>C(E(i),E(a))?s.important="horizontal":s.important="vertical",u.using.call(this,e,s)}),o.offset(x.extend(c,{using:e}))})},x.ui.position={fit:{left:function(e,t){var n,i=t.within,a=i.isWindow?i.scrollLeft:i.offset.left,s=i.width,o=e.left-t.collisionPosition.marginLeft,r=a-o,l=o+t.collisionWidth-s-a;t.collisionWidth>s?0<r&&l<=0?(n=e.left+r+t.collisionWidth-s-a,e.left+=r-n):e.left=0<l&&r<=0?a:l<r?a+s-t.collisionWidth:a:0<r?e.left+=r:0<l?e.left-=l:e.left=C(e.left-o,e.left)},top:function(e,t){var n,i=t.within,a=i.isWindow?i.scrollTop:i.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,r=a-o,l=o+t.collisionHeight-s-a;t.collisionHeight>s?0<r&&l<=0?(n=e.top+r+t.collisionHeight-s-a,e.top+=r-n):e.top=0<l&&r<=0?a:l<r?a+s-t.collisionHeight:a:0<r?e.top+=r:0<l?e.top-=l:e.top=C(e.top-o,e.top)}},flip:{left:function(e,t){var n,i,a=t.within,s=a.offset.left+a.scrollLeft,o=a.width,r=a.isWindow?a.scrollLeft:a.offset.left,l=e.left-t.collisionPosition.marginLeft,c=l-r,d=l+t.collisionWidth-o-r,u="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,_="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,h=-2*t.offset[0];c<0?((n=e.left+u+_+h+t.collisionWidth-o-s)<0||n<E(c))&&(e.left+=u+_+h):0<d&&(0<(i=e.left-t.collisionPosition.marginLeft+u+_+h-r)||E(i)<d)&&(e.left+=u+_+h)},top:function(e,t){var n,i,a=t.within,s=a.offset.top+a.scrollTop,o=a.height,r=a.isWindow?a.scrollTop:a.offset.top,l=e.top-t.collisionPosition.marginTop,c=l-r,d=l+t.collisionHeight-o-r,u="top"===t.my[1]?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,_="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,h=-2*t.offset[1];c<0?((i=e.top+u+_+h+t.collisionHeight-o-s)<0||i<E(c))&&(e.top+=u+_+h):0<d&&(0<(n=e.top-t.collisionPosition.marginTop+u+_+h-r)||E(n)<d)&&(e.top+=u+_+h)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}},function(){var e,t,n,i,a,s=document.getElementsByTagName("body")[0],o=document.createElement("div");for(a in e=document.createElement(s?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},s&&x.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"}),n)e.style[a]=n[a];e.appendChild(o),(t=s||document.documentElement).insertBefore(e,t.firstChild),o.style.cssText="position: absolute; left: 10.7432222px;",i=x(o).offset().left,k=10<i&&i<11,e.innerHTML="",t.removeChild(e)}()}(),x.ui.position}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./position"],e):e(jQuery)}(function(r){return r.widget("ui.menu",{version:"1.11.4",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(e){var t=r(e.target);!this.mouseHandled&&t.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),t.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&r(this.document[0].activeElement).closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var t=r(e.currentTarget);t.siblings(".ui-state-active").removeClass("ui-state-active"),this.focus(e,t)}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,n)},blur:function(e){this._delay(function(){r.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=r(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){var t,n,i,a,s=!0;switch(e.keyCode){case r.ui.keyCode.PAGE_UP:this.previousPage(e);break;case r.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case r.ui.keyCode.HOME:this._move("first","first",e);break;case r.ui.keyCode.END:this._move("last","last",e);break;case r.ui.keyCode.UP:this.previous(e);break;case r.ui.keyCode.DOWN:this.next(e);break;case r.ui.keyCode.LEFT:this.collapse(e);break;case r.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case r.ui.keyCode.ENTER:case r.ui.keyCode.SPACE:this._activate(e);break;case r.ui.keyCode.ESCAPE:this.collapse(e);break;default:s=!1,n=this.previousFilter||"",i=String.fromCharCode(e.keyCode),a=!1,clearTimeout(this.filterTimer),i===n?a=!0:i=n+i,t=this._filterMenuItems(i),(t=a&&-1!==t.index(this.active.next())?this.active.nextAll(".ui-menu-item"):t).length||(i=String.fromCharCode(e.keyCode),t=this._filterMenuItems(i)),t.length?(this.focus(e,t),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}s&&e.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.is("[aria-haspopup='true']")?this.expand(e):this.select(e))},refresh:function(){var e,t=this,i=this.options.icons.submenu,n=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length),n.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=r(this),t=e.parent(),n=r("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);t.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",t.attr("id"))}),(e=n.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var e=r(this);t._isDivider(e)&&e.addClass("ui-widget-content ui-menu-divider")}),e.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),e.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!r.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},focus:function(e,t){var n,i;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),i=this.active.addClass("ui-state-focus").removeClass("ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),this.active.parent().closest(".ui-menu-item").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(n=t.children(".ui-menu")).length&&e&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(e){var t,n,i,a,s,o;this._hasScroll()&&(t=parseFloat(r.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(r.css(this.activeMenu[0],"paddingTop"))||0,i=e.offset().top-this.activeMenu.offset().top-t-n,a=this.activeMenu.scrollTop(),s=this.activeMenu.height(),o=e.outerHeight(),i<0?this.activeMenu.scrollTop(a+i):s<i+o&&this.activeMenu.scrollTop(a+i-s+o))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(e){var t=r.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(t)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var e=n?this.element:r(t&&t.target).closest(this.element.find(".ui-menu"));e.length||(e=this.element),this._close(e),this.blur(t),this.activeMenu=e},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")},_closeOnDocumentClick:function(e){return!r(e.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var i;this.active&&(i="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),i&&i.length&&this.active||(i=this.activeMenu.find(this.options.items)[t]()),this.focus(n,i)},nextPage:function(e){var t,n,i;this.active?this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(t=r(this)).offset().top-n-i<0}),this.focus(e,t)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var t,n,i;this.active?this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return 0<(t=r(this)).offset().top-n+i}),this.focus(e,t)):this.focus(e,this.activeMenu.find(this.options.items).first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||r(e.target).closest(".ui-menu-item");var t={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,t)},_filterMenuItems:function(e){var t=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),n=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return n.test(r.trim(r(this).text()))})}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./position","./menu"],e):e(jQuery)}(function(o){return o.widget("ui.autocomplete",{version:"1.11.4",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var n,i,a,e=this.element[0].nodeName.toLowerCase(),t="textarea"===e,s="input"===e;this.isMultiLine=!!t||!s&&this.element.prop("isContentEditable"),this.valueMethod=this.element[t||s?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly"))i=a=n=!0;else{i=a=n=!1;var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:n=!0,this._move("previousPage",e);break;case t.PAGE_DOWN:n=!0,this._move("nextPage",e);break;case t.UP:n=!0,this._keyEvent("previous",e);break;case t.DOWN:n=!0,this._keyEvent("next",e);break;case t.ENTER:this.menu.active&&(n=!0,e.preventDefault(),this.menu.select(e));break;case t.TAB:this.menu.active&&this.menu.select(e);break;case t.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(e),e.preventDefault());break;default:i=!0,this._searchTimeout(e)}}},keypress:function(e){if(n)return n=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||e.preventDefault());if(!i){var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:this._move("previousPage",e);break;case t.PAGE_DOWN:this._move("nextPage",e);break;case t.UP:this._keyEvent("previous",e);break;case t.DOWN:this._keyEvent("next",e)}}},input:function(e){if(a)return a=!1,void e.preventDefault();this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(e),this._change(e))}}),this._initSource(),this.menu=o("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var n=this.menu.element[0];o(e.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(e){e.target===t.element[0]||e.target===n||o.contains(n,e.target)||t.close()})})},menufocus:function(e,t){var n,i;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){o(e.target).trigger(e.originalEvent)});i=t.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:i})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(i.value),(n=t.item.attr("aria-label")||i.value)&&o.trim(n).length&&(this.liveRegion.children().hide(),o("<div>").text(n).appendTo(this.liveRegion))},menuselect:function(e,t){var n=t.item.data("ui-autocomplete-item"),i=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=i,this._delay(function(){this.previous=i,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=o("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?o(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var n,i,a=this;o.isArray(this.options.source)?(n=this.options.source,this.source=function(e,t){t(o.ui.autocomplete.filter(n,e.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,t){a.xhr&&a.xhr.abort(),a.xhr=o.ajax({url:i,data:e,dataType:"json",success:function(e){t(e)},error:function(){t([])}})}):this.source=this.options.source},_searchTimeout:function(i){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),t=this.menu.element.is(":visible"),n=i.altKey||i.ctrlKey||i.metaKey||i.shiftKey;e&&(!e||t||n)||(this.selectedItem=null,this.search(null,i))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):!1!==this._trigger("search",t)?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return o.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this.element.removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:o.map(e,function(e){return"string"==typeof e?{label:e,value:e}:o.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var t=this.menu.element.empty();this._renderMenu(t,e),this.isNewMenu=!0,this.menu.refresh(),t.show(),this._resizeMenu(),t.position(o.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(n,e){var i=this;o.each(e,function(e,t){i._renderItemData(n,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(e,t){return o("<li>").text(t.label).appendTo(e)},_move:function(e,t){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[e](t);this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())}}),o.extend(o.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,t){var n=new RegExp(o.ui.autocomplete.escapeRegex(t),"i");return o.grep(e,function(e){return n.test(e.label||e.value||e)})}}),o.widget("ui.autocomplete",o.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(1<e?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),o("<div>").text(t).appendTo(this.liveRegion))}}),o.ui.autocomplete}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],e):e(jQuery)}(function(s){var a,o="ui-button ui-widget ui-state-default ui-corner-all",r="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",l=function(){var e=s(this);setTimeout(function(){e.find(":ui-button").button("refresh")},1)},c=function(e){var t=e.name,n=e.form,i=s([]);return t&&(t=t.replace(/'/g,"\\'"),i=n?s(n).find("[name='"+t+"'][type=radio]"):s("[name='"+t+"'][type=radio]",e.ownerDocument).filter(function(){return!this.form})),i};return s.widget("ui.button",{version:"1.11.4",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,l),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,n=this.options,e="checkbox"===this.type||"radio"===this.type,i=e?"":"ui-state-active";null===n.label&&(n.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){n.disabled||this===a&&s(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){n.disabled||s(this).removeClass(i)}).bind("click"+this.eventNamespace,function(e){n.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),e&&this.element.bind("change"+this.eventNamespace,function(){t.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(n.disabled)return!1}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(n.disabled)return!1;s(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var e=t.element[0];c(e).not(e).map(function(){return s(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(n.disabled)return!1;s(this).addClass("ui-state-active"),a=this,t.document.one("mouseup",function(){a=null})}).bind("mouseup"+this.eventNamespace,function(){if(n.disabled)return!1;s(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(e){if(n.disabled)return!1;e.keyCode!==s.ui.keyCode.SPACE&&e.keyCode!==s.ui.keyCode.ENTER||s(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){s(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===s.ui.keyCode.SPACE&&s(this).click()})),this._setOption("disabled",n.disabled),this._resetButton()},_determineButtonType:function(){var e,t,n;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),(n=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",n)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" ui-state-active "+r).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){if(this._super(e,t),"disabled"===e)return this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),void(t&&("checkbox"===this.type||"radio"===this.type?this.buttonElement.removeClass("ui-state-focus"):this.buttonElement.removeClass("ui-state-focus ui-state-active")));this._resetButton()},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?c(this.element[0]).each(function(){s(this).is(":checked")?s(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):s(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"!==this.type){var e=this.buttonElement.removeClass(r),t=s("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),n=this.options.icons,i=n.primary&&n.secondary,a=[];n.primary||n.secondary?(this.options.text&&a.push("ui-button-text-icon"+(i?"s":n.primary?"-primary":"-secondary")),n.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(a.push(i?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",s.trim(t)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}else this.options.label&&this.element.val(this.options.label)}}),s.widget("ui.buttonset",{version:"1.11.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var e="rtl"===this.element.css("direction"),t=this.element.find(this.options.items),n=t.filter(":ui-button");t.not(":ui-button").button(),n.button("refresh"),this.buttons=t.map(function(){return s(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return s(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}}),s.ui.button}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(w){function l(e){for(var t,n;e.length&&e[0]!==document;){if(("absolute"===(t=e.css("position"))||"relative"===t||"fixed"===t)&&(n=parseInt(e.css("zIndex"),10),!isNaN(n)&&0!==n))return n;e=e.parent()}return 0}function e(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},w.extend(this._defaults,this.regional[""]),this.regional.en=w.extend(!0,{},this.regional[""]),this.regional["en-US"]=w.extend(!0,{},this.regional.en),this.dpDiv=n(w("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(t,"mouseout",function(){w(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&w(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&w(this).removeClass("ui-datepicker-next-hover")}).delegate(t,"mouseover",o)}function o(){w.datepicker._isDisabledDatepicker(r.inline?r.dpDiv.parent()[0]:r.input[0])||(w(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),w(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&w(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&w(this).addClass("ui-datepicker-next-hover"))}function u(e,t){for(var n in w.extend(e,t),t)null==t[n]&&(e[n]=t[n]);return e}var r;return w.extend(w.ui,{datepicker:{version:"1.11.4"}}),w.extend(e.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return u(this._defaults,e||{}),this},_attachDatepicker:function(e,t){var n,i,a;i="div"===(n=e.nodeName.toLowerCase())||"span"===n,e.id||(this.uuid+=1,e.id="dp"+this.uuid),(a=this._newInst(w(e),i)).settings=w.extend({},t||{}),"input"===n?this._connectDatepicker(e,a):i&&this._inlineDatepicker(e,a)},_newInst:function(e,t){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?n(w("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,t){var n=w(e);t.append=w([]),t.trigger=w([]),n.hasClass(this.markerClassName)||(this._attachments(n,t),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(t),w.data(e,"datepicker",t),t.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,t){var n,i,a,s=this._get(t,"appendText"),o=this._get(t,"isRTL");t.append&&t.append.remove(),s&&(t.append=w("<span class='"+this._appendClass+"'>"+s+"</span>"),e[o?"before":"after"](t.append)),e.unbind("focus",this._showDatepicker),t.trigger&&t.trigger.remove(),"focus"!==(n=this._get(t,"showOn"))&&"both"!==n||e.focus(this._showDatepicker),"button"!==n&&"both"!==n||(i=this._get(t,"buttonText"),a=this._get(t,"buttonImage"),t.trigger=w(this._get(t,"buttonImageOnly")?w("<img/>").addClass(this._triggerClass).attr({src:a,alt:i,title:i}):w("<button type='button'></button>").addClass(this._triggerClass).html(a?w("<img/>").attr({src:a,alt:i,title:i}):i)),e[o?"before":"after"](t.trigger),t.trigger.click(function(){return w.datepicker._datepickerShowing&&w.datepicker._lastInput===e[0]?w.datepicker._hideDatepicker():(w.datepicker._datepickerShowing&&w.datepicker._lastInput!==e[0]&&w.datepicker._hideDatepicker(),w.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,n,i,a,s=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(a=i=n=0;a<e.length;a++)e[a].length>n&&(n=e[a].length,i=a);return i},s.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),s.setDate(t(this._get(e,
o.match(/DD/)?"dayNames":"dayNamesShort"))+20-s.getDay())),e.input.attr("size",this._formatDate(e,s).length)}},_inlineDatepicker:function(e,t){var n=w(e);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(t.dpDiv),w.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,n,i,a){var s,o,r,l,c,d=this._dialogInst;return d||(this.uuid+=1,s="dp"+this.uuid,this._dialogInput=w("<input type='text' id='"+s+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),w("body").append(this._dialogInput),(d=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},w.data(this._dialogInput[0],"datepicker",d)),u(d.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(d,t):t,this._dialogInput.val(t),this._pos=a?a.length?a:[a.pageX,a.pageY]:null,this._pos||(o=document.documentElement.clientWidth,r=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[o/2-100+l,r/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),w.blockUI&&w.blockUI(this.dpDiv),w.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var t,n=w(e),i=w.data(e,"datepicker");n.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),w.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),n.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||n.removeClass(this.markerClassName).empty(),r===i&&(r=null))},_enableDatepicker:function(t){var e,n,i=w(t),a=w.data(t,"datepicker");i.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((n=i.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=w.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,n,i=w(t),a=w.data(t,"datepicker");i.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((n=i.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=w.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(e){try{return w.data(e,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,n){var i,a,s,o,r=this._getInst(e);if(2===arguments.length&&"string"==typeof t)return"defaults"===t?w.extend({},w.datepicker._defaults):r?"all"===t?w.extend({},r.settings):this._get(r,t):null;i=t||{},"string"==typeof t&&((i={})[t]=n),r&&(this._curInst===r&&this._hideDatepicker(),a=this._getDateDatepicker(e,!0),s=this._getMinMaxDate(r,"min"),o=this._getMinMaxDate(r,"max"),u(r.settings,i),null!==s&&i.dateFormat!==undefined&&i.minDate===undefined&&(r.settings.minDate=this._formatDate(r,s)),null!==o&&i.dateFormat!==undefined&&i.maxDate===undefined&&(r.settings.maxDate=this._formatDate(r,o)),"disabled"in i&&(i.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(w(e),r),this._autoSize(r),this._setDate(r,a),this._updateAlternate(r),this._updateDatepicker(r))},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(e){var t,n,i,a=w.datepicker._getInst(e.target),s=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,w.datepicker._datepickerShowing)switch(e.keyCode){case 9:w.datepicker._hideDatepicker(),s=!1;break;case 13:return(i=w("td."+w.datepicker._dayOverClass+":not(."+w.datepicker._currentClass+")",a.dpDiv))[0]&&w.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,i[0]),(t=w.datepicker._get(a,"onSelect"))?(n=w.datepicker._formatDate(a),t.apply(a.input?a.input[0]:null,[n,a])):w.datepicker._hideDatepicker(),!1;case 27:w.datepicker._hideDatepicker();break;case 33:w.datepicker._adjustDate(e.target,e.ctrlKey?-w.datepicker._get(a,"stepBigMonths"):-w.datepicker._get(a,"stepMonths"),"M");break;case 34:w.datepicker._adjustDate(e.target,e.ctrlKey?+w.datepicker._get(a,"stepBigMonths"):+w.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&w.datepicker._clearDate(e.target),s=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&w.datepicker._gotoToday(e.target),s=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&w.datepicker._adjustDate(e.target,o?1:-1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&w.datepicker._adjustDate(e.target,e.ctrlKey?-w.datepicker._get(a,"stepBigMonths"):-w.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&w.datepicker._adjustDate(e.target,-7,"D"),s=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&w.datepicker._adjustDate(e.target,o?-1:1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&w.datepicker._adjustDate(e.target,e.ctrlKey?+w.datepicker._get(a,"stepBigMonths"):+w.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&w.datepicker._adjustDate(e.target,7,"D"),s=e.ctrlKey||e.metaKey;break;default:s=!1}else 36===e.keyCode&&e.ctrlKey?w.datepicker._showDatepicker(this):s=!1;s&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t,n,i=w.datepicker._getInst(e.target);if(w.datepicker._get(i,"constrainInput"))return t=w.datepicker._possibleChars(w.datepicker._get(i,"dateFormat")),n=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||n<" "||!t||-1<t.indexOf(n)},_doKeyUp:function(e){var t=w.datepicker._getInst(e.target);if(t.input.val()!==t.lastVal)try{w.datepicker.parseDate(w.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,w.datepicker._getFormatConfig(t))&&(w.datepicker._setDateFromField(t),w.datepicker._updateAlternate(t),w.datepicker._updateDatepicker(t))}catch(n){}return!0},_showDatepicker:function(e){var t,n,i,a,s,o,r;("input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=w("input",e.parentNode)[0]),w.datepicker._isDisabledDatepicker(e)||w.datepicker._lastInput===e)||(t=w.datepicker._getInst(e),w.datepicker._curInst&&w.datepicker._curInst!==t&&(w.datepicker._curInst.dpDiv.stop(!0,!0),t&&w.datepicker._datepickerShowing&&w.datepicker._hideDatepicker(w.datepicker._curInst.input[0])),!1!==(i=(n=w.datepicker._get(t,"beforeShow"))?n.apply(e,[e,t]):{})&&(u(t.settings,i),t.lastVal=null,w.datepicker._lastInput=e,w.datepicker._setDateFromField(t),w.datepicker._inDialog&&(e.value=""),w.datepicker._pos||(w.datepicker._pos=w.datepicker._findPos(e),w.datepicker._pos[1]+=e.offsetHeight),a=!1,w(e).parents().each(function(){return!(a|="fixed"===w(this).css("position"))}),s={left:w.datepicker._pos[0],top:w.datepicker._pos[1]},w.datepicker._pos=null,t.dpDiv.empty(),t.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),w.datepicker._updateDatepicker(t),s=w.datepicker._checkOffset(t,s,a),t.dpDiv.css({position:w.datepicker._inDialog&&w.blockUI?"static":a?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),t.inline||(o=w.datepicker._get(t,"showAnim"),r=w.datepicker._get(t,"duration"),t.dpDiv.css("z-index",l(w(e))+1),w.datepicker._datepickerShowing=!0,w.effects&&w.effects.effect[o]?t.dpDiv.show(o,w.datepicker._get(t,"showOptions"),r):t.dpDiv[o||"show"](o?r:null),w.datepicker._shouldFocusInput(t)&&t.input.focus(),w.datepicker._curInst=t)))},_updateDatepicker:function(e){this.maxRows=4,(r=e).dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var t,n=this._getNumberOfMonths(e),i=n[1],a=17,s=e.dpDiv.find("."+this._dayOverClass+" a");0<s.length&&o.apply(s.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<i&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",a*i+"em"),e.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===w.datepicker._curInst&&w.datepicker._datepickerShowing&&w.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(t=e.yearshtml,setTimeout(function(){t===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),t=e.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(e,t,n){var i=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),s=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,r=document.documentElement.clientWidth+(n?0:w(document).scrollLeft()),l=document.documentElement.clientHeight+(n?0:w(document).scrollTop());return t.left-=this._get(e,"isRTL")?i-s:0,t.left-=n&&t.left===e.input.offset().left?w(document).scrollLeft():0,t.top-=n&&t.top===e.input.offset().top+o?w(document).scrollTop():0,t.left-=Math.min(t.left,t.left+i>r&&i<r?Math.abs(t.left+i-r):0),t.top-=Math.min(t.top,t.top+a>l&&a<l?Math.abs(a+o):0),t},_findPos:function(e){for(var t,n=this._getInst(e),i=this._get(n,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||w.expr.filters.hidden(e));)e=e[i?"previousSibling":"nextSibling"];return[(t=w(e).offset()).left,t.top]},_hideDatepicker:function(e){var t,n,i,a,s=this._curInst;!s||e&&s!==w.data(e,"datepicker")||this._datepickerShowing&&(t=this._get(s,"showAnim"),n=this._get(s,"duration"),i=function(){w.datepicker._tidyDialog(s)},w.effects&&(w.effects.effect[t]||w.effects[t])?s.dpDiv.hide(t,w.datepicker._get(s,"showOptions"),n,i):s.dpDiv["slideDown"===t?"slideUp":"fadeIn"===t?"fadeOut":"hide"](t?n:null,i),t||i(),this._datepickerShowing=!1,(a=this._get(s,"onClose"))&&a.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),w.blockUI&&(w.unblockUI(),w("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(w.datepicker._curInst){var t=w(e.target),n=w.datepicker._getInst(t[0]);(t[0].id===w.datepicker._mainDivId||0!==t.parents("#"+w.datepicker._mainDivId).length||t.hasClass(w.datepicker.markerClassName)||t.closest("."+w.datepicker._triggerClass).length||!w.datepicker._datepickerShowing||w.datepicker._inDialog&&w.blockUI)&&(!t.hasClass(w.datepicker.markerClassName)||w.datepicker._curInst===n)||w.datepicker._hideDatepicker()}},_adjustDate:function(e,t,n){var i=w(e),a=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(a,t+("M"===n?this._get(a,"showCurrentAtPos"):0),n),this._updateDatepicker(a))},_gotoToday:function(e){var t,n=w(e),i=this._getInst(n[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(t=new Date,i.selectedDay=t.getDate(),i.drawMonth=i.selectedMonth=t.getMonth(),i.drawYear=i.selectedYear=t.getFullYear()),this._notifyChange(i),this._adjustDate(n)},_selectMonthYear:function(e,t,n){var i=w(e),a=this._getInst(i[0]);a["selected"+("M"===n?"Month":"Year")]=a["draw"+("M"===n?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(i)},_selectDay:function(e,t,n,i){var a,s=w(e);w(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(s[0])||((a=this._getInst(s[0])).selectedDay=a.currentDay=w("a",i).html(),a.selectedMonth=a.currentMonth=t,a.selectedYear=a.currentYear=n,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var t=w(e);this._selectDate(t,"")},_selectDate:function(e,t){var n,i=w(e),a=this._getInst(i[0]);t=null!=t?t:this._formatDate(a),a.input&&a.input.val(t),this._updateAlternate(a),(n=this._get(a,"onSelect"))?n.apply(a.input?a.input[0]:null,[t,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var t,n,i,a=this._get(e,"altField");a&&(t=this._get(e,"altFormat")||this._get(e,"dateFormat"),n=this._getDate(e),i=this.formatDate(t,n,this._getFormatConfig(e)),w(a).each(function(){w(this).val(i)}))},noWeekends:function(e){var t=e.getDay();return[0<t&&t<6,""]},iso8601Week:function(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1},parseDate:function(n,s,e){if(null==n||null==s)throw"Invalid arguments";if(""===(s="object"==typeof s?s.toString():s+""))return null;var i,t,a,o,r=0,l=(e?e.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),d=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,u=(e?e.dayNames:null)||this._defaults.dayNames,_=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,h=(e?e.monthNames:null)||this._defaults.monthNames,p=-1,f=-1,m=-1,g=-1,A=!1,v=function(e){var t=i+1<n.length&&n.charAt(i+1)===e;return t&&i++,t},b=function(e){var t=v(e),n="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,i=new RegExp("^\\d{"+("y"===e?n:1)+","+n+"}"),a=s.substring(r).match(i);if(!a)throw"Missing number at position "+r;return r+=a[0].length,parseInt(a[0],10)},y=function(e,t,n){var i=-1,a=w.map(v(e)?n:t,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(w.each(a,function(e,t){var n=t[1];if(s.substr(r,n.length).toLowerCase()===n.toLowerCase())return i=t[0],r+=n.length,!1}),-1!==i)return i+1;throw"Unknown name at position "+r},$=function(){if(s.charAt(r)!==n.charAt(i))throw"Unexpected literal at position "+r;r++};for(i=0;i<n.length;i++)if(A)"'"!==n.charAt(i)||v("'")?$():A=!1;else switch(n.charAt(i)){case"d":m=b("d");break;case"D":y("D",d,u);break;case"o":g=b("o");break;case"m":f=b("m");break;case"M":f=y("M",_,h);break;case"y":p=b("y");break;case"@":p=(o=new Date(b("@"))).getFullYear(),f=o.getMonth()+1,m=o.getDate();break;case"!":p=(o=new Date((b("!")-this._ticksTo1970)/1e4)).getFullYear(),f=o.getMonth()+1,m=o.getDate();break;case"'":v("'")?$():A=!0;break;default:$()}if(r<s.length&&(a=s.substr(r),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===p?p=(new Date).getFullYear():p<100&&(p+=(new Date).getFullYear()-(new Date).getFullYear()%100+(p<=c?0:-100)),-1<g)for(f=1,m=g;;){if(m<=(t=this._getDaysInMonth(p,f-1)))break;f++,m-=t}if((o=this._daylightSavingAdjust(new Date(p,f-1,m))).getFullYear()!==p||o.getMonth()+1!==f||o.getDate()!==m)throw"Invalid date";return o},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(n,e,t){if(!e)return"";var i,a=(t?t.dayNamesShort:null)||this._defaults.dayNamesShort,s=(t?t.dayNames:null)||this._defaults.dayNames,o=(t?t.monthNamesShort:null)||this._defaults.monthNamesShort,r=(t?t.monthNames:null)||this._defaults.monthNames,l=function(e){var t=i+1<n.length&&n.charAt(i+1)===e;return t&&i++,t},c=function(e,t,n){var i=""+t;if(l(e))for(;i.length<n;)i="0"+i;return i},d=function(e,t,n,i){return l(e)?i[t]:n[t]},u="",_=!1;if(e)for(i=0;i<n.length;i++)if(_)"'"!==n.charAt(i)||l("'")?u+=n.charAt(i):_=!1;else switch(n.charAt(i)){case"d":u+=c("d",e.getDate(),2);break;case"D":u+=d("D",e.getDay(),a,s);break;case"o":u+=c("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=c("m",e.getMonth()+1,2);break;case"M":u+=d("M",e.getMonth(),o,r);break;case"y":u+=l("y")?e.getFullYear():(e.getYear()%100<10?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?u+="'":_=!0;break;default:u+=n.charAt(i)}return u},_possibleChars:function(n){var i,e="",t=!1,a=function(e){var t=i+1<n.length&&n.charAt(i+1)===e;return t&&i++,t};for(i=0;i<n.length;i++)if(t)"'"!==n.charAt(i)||a("'")?e+=n.charAt(i):t=!1;else switch(n.charAt(i)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":a("'")?e+="'":t=!0;break;default:e+=n.charAt(i)}return e},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var n=this._get(e,"dateFormat"),i=e.lastVal=e.input?e.input.val():null,a=this._getDefaultDate(e),s=a,o=this._getFormatConfig(e);try{s=this.parseDate(n,i,o)||a}catch(event){i=t?"":i}e.selectedDay=s.getDate(),e.drawMonth=e.selectedMonth=s.getMonth(),e.drawYear=e.selectedYear=s.getFullYear(),e.currentDay=i?s.getDate():0,e.currentMonth=i?s.getMonth():0,e.currentYear=i?s.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(l,e,t){var n=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=null==e||""===e?t:"string"==typeof e?function(e){try{return w.datepicker.parseDate(w.datepicker._get(l,"dateFormat"),e,w.datepicker._getFormatConfig(l))}catch(r){}for(var t=(e.toLowerCase().match(/^c/)?w.datepicker._getDate(l):null)||new Date,n=t.getFullYear(),i=t.getMonth(),a=t.getDate(),s=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,o=s.exec(e);o;){switch(o[2]||"d"){case"d":case"D":a+=parseInt(o[1],10);break;case"w":case"W":a+=7*parseInt(o[1],10);break;case"m":case"M":i+=parseInt(o[1],10),a=Math.min(a,w.datepicker._getDaysInMonth(n,i));break;case"y":case"Y":n+=parseInt(o[1],10),a=Math.min(a,w.datepicker._getDaysInMonth(n,i))}o=s.exec(e)}return new Date(n,i,a)}(e):"number"==typeof e?isNaN(e)?t:n(e):new Date(e.getTime());return(i=i&&"Invalid Date"===i.toString()?t:i)&&(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0)),this._daylightSavingAdjust(i)},_daylightSavingAdjust:function(e){return e?(e.setHours(12<e.getHours()?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var i=!t,a=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),a===e.selectedMonth&&s===e.selectedYear||n||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(i?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){w.datepicker._adjustDate(n,-t,"M")},next:function(){w.datepicker._adjustDate(n,+t,"M")},hide:function(){w.datepicker._hideDatepicker()},today:function(){w.datepicker._gotoToday(n)},selectDay:function(){return w.datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return w.datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return w.datepicker._selectMonthYear(n,this,"Y"),!1}};w(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,n,i,a,s,o,r,l,c,d,u,_,h,p,f,m,g,A,v,b,y,$,w,k,C,E,T,x,I,D,O,S,R,B,N,F,K,M,j,L=new Date,P=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),U=this._get(e,"isRTL"),H=this._get(e,"showButtonPanel"),Q=this._get(e,"hideIfNoPrevNext"),z=this._get(e,"navigationAsDateFormat"),q=this._getNumberOfMonths(e),W=this._get(e,"showCurrentAtPos"),Y=this._get(e,"stepMonths"),V=1!==q[0]||1!==q[1],G=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),X=this._getMinMaxDate(e,"min"),J=this._getMinMaxDate(e,"max"),Z=e.drawMonth-W,ee=e.drawYear;if(Z<0&&(Z+=12,ee--),J)for(t=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-q[0]*q[1]+1,J.getDate())),t=X&&t<X?X:t;this._daylightSavingAdjust(new Date(ee,Z,1))>t;)--Z<0&&(Z=11,ee--);for(e.drawMonth=Z,e.drawYear=ee,n=this._get(e,"prevText"),n=z?this.formatDate(n,this._daylightSavingAdjust(new Date(ee,Z-Y,1)),this._getFormatConfig(e)):n,i=this._canAdjustMonth(e,-1,ee,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>":Q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>",a=this._get(e,"nextText"),a=z?this.formatDate(a,this._daylightSavingAdjust(new Date(ee,Z+Y,1)),this._getFormatConfig(e)):a,s=this._canAdjustMonth(e,1,ee,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+a+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+a+"</span></a>":Q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+a+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+a+"</span></a>",o=this._get(e,"currentText"),r=this._get(e,"gotoCurrent")&&e.currentDay?G:P,o=z?this.formatDate(o,r,this._getFormatConfig(e)):o,l=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=H?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(U?l:"")+(this._isInRange(e,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(U?"":l)+"</div>":"",d=parseInt(this._get(e,"firstDay"),10),d=isNaN(d)?0:d,u=this._get(e,"showWeek"),_=this._get(e,"dayNames"),h=this._get(e,"dayNamesMin"),p=this._get(e,"monthNames"),f=this._get(e,"monthNamesShort"),m=this._get(e,"beforeShowDay"),g=this._get(e,"showOtherMonths"),A=this._get(e,"selectOtherMonths"),v=this._getDefaultDate(e),b="",$=0;$<q[0];$++){for(w="",this.maxRows=4,k=0;k<q[1];k++){if(C=this._daylightSavingAdjust(new Date(ee,Z,e.selectedDay)),E=" ui-corner-all",T="",V){if(T+="<div class='ui-datepicker-group",1<q[1])switch(k){case 0:T+=" ui-datepicker-group-first",E=" ui-corner-"+(U?"right":"left");break;case q[1]-1:T+=" ui-datepicker-group-last",E=" ui-corner-"+(U?"left":"right");break;default:T+=" ui-datepicker-group-middle",E=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+E+"'>"+(/all|left/.test(E)&&0===$?U?s:i:"")+(/all|right/.test(E)&&0===$?U?i:s:"")+this._generateMonthYearHeader(e,Z,ee,X,J,0<$||0<k,p,f)+"</div><table class='ui-datepicker-calendar'><thead><tr>",x=u?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",y=0;y<7;y++)x+="<th scope='col'"+(5<=(y+d+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+_[I=(y+d)%7]+"'>"+h[I]+"</span></th>";for(T+=x+"</tr></thead><tbody>",D=this._getDaysInMonth(ee,Z),ee===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,D)),O=(this._getFirstDayOfMonth(ee,Z)-d+7)%7,S=Math.ceil((O+D)/7),R=V&&this.maxRows>S?this.maxRows:S,this.maxRows=R,B=this._daylightSavingAdjust(new Date(ee,Z,1-O)),N=0;N<R;N++){for(T+="<tr>",F=u?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(B)+"</td>":"",y=0;y<7;y++)K=m?m.apply(e.input?e.input[0]:null,[B]):[!0,""],j=(M=B.getMonth()!==Z)&&!A||!K[0]||X&&B<X||J&&J<B,F+="<td class='"+(5<=(y+d+6)%7?" ui-datepicker-week-end":"")+(M?" ui-datepicker-other-month":"")+(B.getTime()===C.getTime()&&Z===e.selectedMonth&&e._keyEvent||v.getTime()===B.getTime()&&v.getTime()===C.getTime()?" "+this._dayOverClass:"")+(j?" "+this._unselectableClass+" ui-state-disabled":"")+(M&&!g?"":" "+K[1]+(B.getTime()===G.getTime()?" "+this._currentClass:"")+(B.getTime()===P.getTime()?" ui-datepicker-today":""))+"'"+(M&&!g||!K[2]?"":" title='"+K[2].replace(/'/g,"&#39;")+"'")+(j?"":" data-handler='selectDay' data-event='click' data-month='"+B.getMonth()+"' data-year='"+B.getFullYear()+"'")+">"+(M&&!g?"&#xa0;":j?"<span class='ui-state-default'>"+B.getDate()+"</span>":"<a class='ui-state-default"+(B.getTime()===P.getTime()?" ui-state-highlight":"")+(B.getTime()===G.getTime()?" ui-state-active":"")+(M?" ui-priority-secondary":"")+"' href='#'>"+B.getDate()+"</a>")+"</td>",B.setDate(B.getDate()+1),B=this._daylightSavingAdjust(B);T+=F+"</tr>"}11<++Z&&(Z=0,ee++),w+=T+="</tbody></table>"+(V?"</div>"+(0<q[0]&&k===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}b+=w}return b+=c,e._keyEvent=!1,b},_generateMonthYearHeader:function(e,t,n,i,a,s,o,r){var l,c,d,u,_,h,p,f,m=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),A=this._get(e,"showMonthAfterYear"),v="<div class='ui-datepicker-title'>",b="";if(s||!m)b+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(l=i&&i.getFullYear()===n,c=a&&a.getFullYear()===n,b+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",d=0;d<12;d++)(!l||d>=i.getMonth())&&(!c||d<=a.getMonth())&&(b+="<option value='"+d+"'"+(d===t?" selected='selected'":"")+">"+r[d]+"</option>");b+="</select>"}if(A||(v+=b+(!s&&m&&g?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",s||!g)v+="<span class='ui-datepicker-year'>"+n+"</span>";else{for(u=this._get(e,"yearRange").split(":"),_=(new Date).getFullYear(),p=(h=function(e){var t=e.match(/c[+\-].*/)?n+parseInt(e.substring(1),10):e.match(/[+\-].*/)?_+parseInt(e,10):parseInt(e,10);return isNaN(t)?_:t})(u[0]),f=Math.max(p,h(u[1]||"")),p=i?Math.max(p,i.getFullYear()):p,f=a?Math.min(f,a.getFullYear()):f,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";p<=f;p++)e.yearshtml+="<option value='"+p+"'"+(p===n?" selected='selected'":"")+">"+p+"</option>";e.yearshtml+="</select>",v+=e.yearshtml,e.yearshtml=null}return v+=this._get(e,"yearSuffix"),A&&(v+=(!s&&m&&g?"":"&#xa0;")+b),v+="</div>"},_adjustInstDate:function(e,t,n){var i=e.drawYear+("Y"===n?t:0),a=e.drawMonth+("M"===n?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(i,a))+("D"===n?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,a,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),"M"!==n&&"Y"!==n||this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),i=this._getMinMaxDate(e,"max"),a=n&&t<n?n:t;return i&&i<a?i:a},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,n,i){var a=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,i+(t<0?t:a[0]*a[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n,i,a=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),o=null,r=null,l=this._get(e,"yearRange");return l&&(n=l.split(":"),i=(new Date).getFullYear(),o=parseInt(n[0],10),r=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(o+=i),n[1].match(/[+\-].*/)&&(r+=i)),(!a||t.getTime()>=a.getTime())&&(!s||t.getTime()<=s.getTime())&&(!o||t.getFullYear()>=o)&&(!r||t.getFullYear()<=r)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var a=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),a,this._getFormatConfig(e))}}),w.fn.datepicker=function(e,t){if(!this.length)return this;w.datepicker.initialized||(w(document).mousedown(w.datepicker._checkExternalClick),w.datepicker.initialized=!0),0===w("#"+w.datepicker._mainDivId).length&&w("body").append(w.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof t?w.datepicker["_"+e+"Datepicker"].apply(w.datepicker,[this[0]].concat(n)):this.each(function(){"string"==typeof e?w.datepicker["_"+e+"Datepicker"].apply(w.datepicker,[this].concat(n)):w.datepicker._attachDatepicker(this,e)}):w.datepicker["_"+e+"Datepicker"].apply(w.datepicker,[this[0]].concat(n))},w.datepicker=new e,w.datepicker.initialized=!1,w.datepicker.uuid=(new Date).getTime(),w.datepicker.version="1.11.4",w.datepicker}),function(e){"function"==typeof define&&define.amd?define(["jquery","./widget"],e):e(jQuery)}(function(a){var s=!1;return a(document).mouseup(function(){s=!1}),a.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(e){if(!0===a.data(e.target,t.widgetName+".preventClickEvent"))return a.removeData(e.target,t.widgetName+".preventClickEvent"),e.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!s){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var t=this,n=1===e.which,i=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&a(e.target).closest(this.options.cancel).length;return!(n&&!i&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){t.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===a.data(e.target,this.widgetName+".preventClickEvent")&&a.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return t._mouseMove(e)},this._mouseUpDelegate=function(e){return t._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),s=!0))}},_mouseMove:function(e){if(this._mouseMoved){if(a.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e))
,!this._mouseStarted)},_mouseUp:function(e){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&a.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),s=!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(v){return v.widget("ui.draggable",v.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(e){var t=this.options;return this._blurActiveElement(e),!(this.helper||t.disabled||0<v(e.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blockFrames(!0===t.iframeFix?"iframe":t.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=v(this);return v("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var t=this.document[0];if(this.handleElement.is(e.target))try{t.activeElement&&"body"!==t.activeElement.nodeName.toLowerCase()&&v(t.activeElement).blur()}catch(n){}},_mouseStart:function(e){var t=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),v.ui.ddmanager&&(v.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===v(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,t.cursorAt&&this._adjustOffsetFromHelper(t.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),v.ui.ddmanager&&!t.dropBehaviour&&v.ui.ddmanager.prepareOffsets(this,e),this._normalizeRightBottom(),this._mouseDrag(e,!0),v.ui.ddmanager&&v.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(e,t){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!t){var n=this._uiHash();if(!1===this._trigger("drag",e,n))return this._mouseUp({}),!1;this.position=n.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",v.ui.ddmanager&&v.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var t=this,n=!1;return v.ui.ddmanager&&!this.options.dropBehaviour&&(n=v.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||v.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?v(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==t._trigger("stop",e)&&t._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),v.ui.ddmanager&&v.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.focus(),v.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!v(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(e){var t=this.options,n=v.isFunction(t.helper),i=n?v(t.helper.apply(this.element[0],[e])):"clone"===t.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"===t.appendTo?this.element[0].parentNode:t.appendTo),n&&i[0]===this.element[0]&&this._setPositionRelative(),i[0]===this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),v.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),t=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==t&&v.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,n,i=this.options,a=this.document[0];this.relativeContainer=null,i.containment?"window"!==i.containment?"document"!==i.containment?i.containment.constructor!==Array?("parent"===i.containment&&(i.containment=this.helper[0].parentNode),(n=(t=v(i.containment))[0])&&(e=/(scroll|auto)/.test(t.css("overflow")),this.containment=[(parseInt(t.css("borderLeftWidth"),10)||0)+(parseInt(t.css("paddingLeft"),10)||0),(parseInt(t.css("borderTopWidth"),10)||0)+(parseInt(t.css("paddingTop"),10)||0),(e?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(t.css("borderRightWidth"),10)||0)-(parseInt(t.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(t.css("borderBottomWidth"),10)||0)-(parseInt(t.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=t)):this.containment=i.containment:this.containment=[0,0,v(a).width()-this.helperProportions.width-this.margins.left,(v(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=[v(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,v(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,v(window).scrollLeft()+v(window).width()-this.helperProportions.width-this.margins.left,v(window).scrollTop()+(v(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:this.containment=null},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:i?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:i?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,i,a,s,o=this.options,r=this._isRootNode(this.scrollParent[0]),l=e.pageX,c=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(i=this.relativeContainer.offset(),n=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]):n=this.containment,e.pageX-this.offset.click.left<n[0]&&(l=n[0]+this.offset.click.left),e.pageY-this.offset.click.top<n[1]&&(c=n[1]+this.offset.click.top),e.pageX-this.offset.click.left>n[2]&&(l=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(c=n[3]+this.offset.click.top)),o.grid&&(a=o.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,c=n?a-this.offset.click.top>=n[1]||a-this.offset.click.top>n[3]?a:a-this.offset.click.top>=n[1]?a-o.grid[1]:a+o.grid[1]:a,s=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s),"y"===o.axis&&(l=this.originalPageX),"x"===o.axis&&(c=this.originalPageY)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(e,t,n){return n=n||this._uiHash(),v.ui.plugin.call(this,e,[t,n,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),n.offset=this.positionAbs),v.Widget.prototype._trigger.call(this,e,t,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),v.ui.plugin.add("draggable","connectToSortable",{start:function(t,e,n){var i=v.extend({},e,{item:n.element});n.sortables=[],v(n.options.connectToSortable).each(function(){var e=v(this).sortable("instance");e&&!e.options.disabled&&(n.sortables.push(e),e.refreshPositions(),e._trigger("activate",t,i))})},stop:function(t,e,n){var i=v.extend({},e,{item:n.element});n.cancelHelperRemoval=!1,v.each(n.sortables,function(){var e=this;e.isOver?(e.isOver=0,n.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,i))})},drag:function(n,i,a){v.each(a.sortables,function(){var e=!1,t=this;t.positionAbs=a.positionAbs,t.helperProportions=a.helperProportions,t.offset.click=a.offset.click,t._intersectsWith(t.containerCache)&&(e=!0,v.each(a.sortables,function(){return this.positionAbs=a.positionAbs,this.helperProportions=a.helperProportions,this.offset.click=a.offset.click,this!==t&&this._intersectsWith(this.containerCache)&&v.contains(t.element[0],this.element[0])&&(e=!1),e})),e?(t.isOver||(t.isOver=1,a._parent=i.helper.parent(),t.currentItem=i.helper.appendTo(t.element).data("ui-sortable-item",!0),t.options._helper=t.options.helper,t.options.helper=function(){return i.helper[0]},n.target=t.currentItem[0],t._mouseCapture(n,!0),t._mouseStart(n,!0,!0),t.offset.click.top=a.offset.click.top,t.offset.click.left=a.offset.click.left,t.offset.parent.left-=a.offset.parent.left-t.offset.parent.left,t.offset.parent.top-=a.offset.parent.top-t.offset.parent.top,a._trigger("toSortable",n),a.dropped=t.element,v.each(a.sortables,function(){this.refreshPositions()}),a.currentItem=a.element,t.fromOutside=a),t.currentItem&&(t._mouseDrag(n),i.position=t.position)):t.isOver&&(t.isOver=0,t.cancelHelperRemoval=!0,t.options._revert=t.options.revert,t.options.revert=!1,t._trigger("out",n,t._uiHash(t)),t._mouseStop(n,!0),t.options.revert=t.options._revert,t.options.helper=t.options._helper,t.placeholder&&t.placeholder.remove(),i.helper.appendTo(a._parent),a._refreshOffsets(n),i.position=a._generatePosition(n,!0),a._trigger("fromSortable",n),a.dropped=!1,v.each(a.sortables,function(){this.refreshPositions()}))})}}),v.ui.plugin.add("draggable","cursor",{start:function(e,t,n){var i=v("body"),a=n.options;i.css("cursor")&&(a._cursor=i.css("cursor")),i.css("cursor",a.cursor)},stop:function(e,t,n){var i=n.options;i._cursor&&v("body").css("cursor",i._cursor)}}),v.ui.plugin.add("draggable","opacity",{start:function(e,t,n){var i=v(t.helper),a=n.options;i.css("opacity")&&(a._opacity=i.css("opacity")),i.css("opacity",a.opacity)},stop:function(e,t,n){var i=n.options;i._opacity&&v(t.helper).css("opacity",i._opacity)}}),v.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(e,t,n){var i=n.options,a=!1,s=n.scrollParentNotHidden[0],o=n.document[0];s!==o&&"HTML"!==s.tagName?(i.axis&&"x"===i.axis||(n.overflowOffset.top+s.offsetHeight-e.pageY<i.scrollSensitivity?s.scrollTop=a=s.scrollTop+i.scrollSpeed:e.pageY-n.overflowOffset.top<i.scrollSensitivity&&(s.scrollTop=a=s.scrollTop-i.scrollSpeed)),i.axis&&"y"===i.axis||(n.overflowOffset.left+s.offsetWidth-e.pageX<i.scrollSensitivity?s.scrollLeft=a=s.scrollLeft+i.scrollSpeed:e.pageX-n.overflowOffset.left<i.scrollSensitivity&&(s.scrollLeft=a=s.scrollLeft-i.scrollSpeed))):(i.axis&&"x"===i.axis||(e.pageY-v(o).scrollTop()<i.scrollSensitivity?a=v(o).scrollTop(v(o).scrollTop()-i.scrollSpeed):v(window).height()-(e.pageY-v(o).scrollTop())<i.scrollSensitivity&&(a=v(o).scrollTop(v(o).scrollTop()+i.scrollSpeed))),i.axis&&"y"===i.axis||(e.pageX-v(o).scrollLeft()<i.scrollSensitivity?a=v(o).scrollLeft(v(o).scrollLeft()-i.scrollSpeed):v(window).width()-(e.pageX-v(o).scrollLeft())<i.scrollSensitivity&&(a=v(o).scrollLeft(v(o).scrollLeft()+i.scrollSpeed)))),!1!==a&&v.ui.ddmanager&&!i.dropBehaviour&&v.ui.ddmanager.prepareOffsets(n,e)}}),v.ui.plugin.add("draggable","snap",{start:function(e,t,n){var i=n.options;n.snapElements=[],v(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var e=v(this),t=e.offset();this!==n.element[0]&&n.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:t.top,left:t.left})})},drag:function(e,t,n){var i,a,s,o,r,l,c,d,u,_,h=n.options,p=h.snapTolerance,f=t.offset.left,m=f+n.helperProportions.width,g=t.offset.top,A=g+n.helperProportions.height;for(u=n.snapElements.length-1;0<=u;u--)l=(r=n.snapElements[u].left-n.margins.left)+n.snapElements[u].width,d=(c=n.snapElements[u].top-n.margins.top)+n.snapElements[u].height,m<r-p||l+p<f||A<c-p||d+p<g||!v.contains(n.snapElements[u].item.ownerDocument,n.snapElements[u].item)?(n.snapElements[u].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,e,v.extend(n._uiHash(),{snapItem:n.snapElements[u].item})),n.snapElements[u].snapping=!1):("inner"!==h.snapMode&&(i=Math.abs(c-A)<=p,a=Math.abs(d-g)<=p,s=Math.abs(r-m)<=p,o=Math.abs(l-f)<=p,i&&(t.position.top=n._convertPositionTo("relative",{top:c-n.helperProportions.height,left:0}).top),a&&(t.position.top=n._convertPositionTo("relative",{top:d,left:0}).top),s&&(t.position.left=n._convertPositionTo("relative",{top:0,left:r-n.helperProportions.width}).left),o&&(t.position.left=n._convertPositionTo("relative",{top:0,left:l}).left)),_=i||a||s||o,"outer"!==h.snapMode&&(i=Math.abs(c-g)<=p,a=Math.abs(d-A)<=p,s=Math.abs(r-f)<=p,o=Math.abs(l-m)<=p,i&&(t.position.top=n._convertPositionTo("relative",{top:c,left:0}).top),a&&(t.position.top=n._convertPositionTo("relative",{top:d-n.helperProportions.height,left:0}).top),s&&(t.position.left=n._convertPositionTo("relative",{top:0,left:r}).left),o&&(t.position.left=n._convertPositionTo("relative",{top:0,left:l-n.helperProportions.width}).left)),!n.snapElements[u].snapping&&(i||a||s||o||_)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,e,v.extend(n._uiHash(),{snapItem:n.snapElements[u].item})),n.snapElements[u].snapping=i||a||s||o||_)}}),v.ui.plugin.add("draggable","stack",{start:function(e,t,n){var i,a=n.options,s=v.makeArray(v(a.stack)).sort(function(e,t){return(parseInt(v(e).css("zIndex"),10)||0)-(parseInt(v(t).css("zIndex"),10)||0)});s.length&&(i=parseInt(v(s[0]).css("zIndex"),10)||0,v(s).each(function(e){v(this).css("zIndex",i+e)}),this.css("zIndex",i+s.length))}}),v.ui.plugin.add("draggable","zIndex",{start:function(e,t,n){var i=v(t.helper),a=n.options;i.css("zIndex")&&(a._zIndex=i.css("zIndex")),i.css("zIndex",a.zIndex)},stop:function(e,t,n){var i=n.options;i._zIndex&&v(t.helper).css("zIndex",i._zIndex)}}),v.ui.draggable}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(A){return A.widget("ui.resizable",A.ui.mouse,{version:"1.11.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseInt(e,10)||0},_isNumber:function(e){return!isNaN(parseInt(e,10))},_hasScroll:function(e,t){if("hidden"===A(e).css("overflow"))return!1;var n=t&&"left"===t?"scrollLeft":"scrollTop",i=!1;return 0<e[n]||(e[n]=1,i=0<e[n],e[n]=0,i)},_create:function(){var e,t,n,i,s=this,a=this.options;if(this.element.addClass("ui-resizable"),A.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(A("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=a.handles||(A(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=A(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},t=0;t<e.length;t++)n=A.trim(e[t]),(i=A("<div class='ui-resizable-handle "+("ui-resizable-"+n)+"'></div>")).css({zIndex:a.zIndex}),"se"===n&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[n]=".ui-resizable-"+n,this.element.append(i);this._renderAxis=function(e){var t,n,i,a;for(t in e=e||this.element,this.handles)this.handles[t].constructor===String?this.handles[t]=this.element.children(this.handles[t]).first().show():(this.handles[t].jquery||this.handles[t].nodeType)&&(this.handles[t]=A(this.handles[t]),this._on(this.handles[t],{mousedown:s._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(n=A(this.handles[t],this.element),a=/sw|ne|nw|se|n|s/.test(t)?n.outerHeight():n.outerWidth(),i=["padding",/ne|nw|n/.test(t)?"Top":/se|sw|s/.test(t)?"Bottom":/^e$/.test(t)?"Right":"Left"].join(""),e.css(i,a),this._proportionallyResize()),this._handles=this._handles.add(this.handles[t])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.mouseover(function(){s.resizing||(this.className&&(i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),s.axis=i&&i[1]?i[1]:"se")}),a.autoHide&&(this._handles.hide(),A(this.element).addClass("ui-resizable-autohide").mouseenter(function(){a.disabled||(A(this).removeClass("ui-resizable-autohide"),s._handles.show())}).mouseleave(function(){a.disabled||s.resizing||(A(this).addClass("ui-resizable-autohide"),s._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,t=function(e){A(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_mouseCapture:function(e){var t,n,i=!1;for(t in this.handles)((n=A(this.handles[t])[0])===e.target||A.contains(n,e.target))&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(e){var t,n,i,a=this.options,s=this.element;return this.resizing=!0,this._renderProxy(),t=this._num(this.helper.css("left")),n=this._num(this.helper.css("top")),a.containment&&(t+=A(a.containment).scrollLeft()||0,n+=A(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:t,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:s.width(),height:s.height()},this.originalSize=this._helper?{width:s.outerWidth(),height:s.outerHeight()}:{width:s.width(),height:s.height()},this.sizeDiff={width:s.outerWidth()-s.width(),height:s.outerHeight()-s.height()},this.originalPosition={left:t,top:n},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,i=A(".ui-resizable-"+this.axis).css("cursor"),A("body").css("cursor","auto"===i?this.axis+"-resize":i),s.addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var t,n,i=this.originalMousePosition,a=this.axis,s=e.pageX-i.left||0,o=e.pageY-i.top||0,r=this._change[a];return this._updatePrevProperties(),r&&(t=r.apply(this,[e,s,o]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(t=this._updateRatio(t,e)),t=this._respectSize(t,e),this._updateCache(t),this._propagate("resize",e),n=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),A.isEmptyObject(n)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges())),!1},_mouseStop:function(e){this.resizing=!1;var t,n,i,a,s,o,r,l=this.options,c=this;return this._helper&&(i=(n=(t=this._proportionallyResizeElements).length&&/textarea/i.test(t[0].nodeName))&&this._hasScroll(t[0],"left")?0:c.sizeDiff.height,a=n?0:c.sizeDiff.width,s={width:c.helper.width()-a,height:c.helper.height()-i},o=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,r=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(A.extend(s,{top:r,left:o})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),A("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,n,i,a,s,o=this.options;s={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity},(this._aspectRatio||e)&&(t=s.minHeight*this.aspectRatio,i=s.minWidth/this.aspectRatio,n=s.maxHeight*this.aspectRatio,a=s.maxWidth/this.aspectRatio,t>s.minWidth&&(s.minWidth=t),i>s.minHeight&&(s.minHeight=i),n<s.maxWidth&&(s.maxWidth=n),a<s.maxHeight&&(s.maxHeight=a)),this._vBoundaries=s},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,i=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===i&&(e.left=t.left+(n.width-e.width),e.top=null),"nw"===i&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,i=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,a=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,s=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,r=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(n),d=/nw|ne|n/.test(n);return s&&(e.width=t.minWidth),o&&(e.height=t.minHeight),i&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),s&&c&&(e.left=r-t.minWidth),i&&c&&(e.left=r-t.maxWidth),o&&d&&(e.top=l-t.minHeight),a&&d&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,n=[],i=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],a=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];t<4;t++)n[t]=parseInt(i[t],10)||0,n[t]+=parseInt(a[t],10)||0;return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,n=this.helper||this.element;t<this._proportionallyResizeElements.length;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,t=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||A("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++t.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var n=this.originalSize;return{left:this.originalPosition.left+t,width:n.width-t}},n:function(e,t,n){var i=this.originalSize;return{top:this.originalPosition.top+n,height:i.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(e,t,n){return A.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,t,n]))},sw:function(e,t,n){return A.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,t,n]))},ne:function(e,t,n){return A.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,t,n]))},nw:function(e,t,n){return A.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,t,n]))}},_propagate:function(e,t){A.ui.plugin.call(this,e,[t,this.ui()]),"resize"!==e&&this._trigger(e,t,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),A.ui.plugin.add("resizable","animate",{stop:function(t){var n=A(this).resizable("instance"),e=n.options,i=n._proportionallyResizeElements,a=i.length&&/textarea/i.test(i[0].nodeName),s=a&&n._hasScroll(i[0],"left")?0:n.sizeDiff.height,o=a?0:n.sizeDiff.width,r={width:n.size.width-o,height:n.size.height-s},l=parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left)||null,c=parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top)||null;n.element.animate(A.extend(r,c&&l?{top:c,left:l}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var e={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};i&&i.length&&A(i[0]).css({width:e.width,height:e.height}),n._updateCache(e),n._propagate("resize",t)}})}}),A.ui.plugin.add("resizable","containment",{start:function(){var n,i,e,t,a,s,o,r=A(this).resizable("instance"),l=r.options,c=r.element,d=l.containment,u=d instanceof A?d.get(0):/parent/.test(d)?c.parent().get(0):d;u&&(r.containerElement=A(u),/document/.test(d)||d===document?(r.containerOffset={left:0,top:0},r.containerPosition={left:0,top:0},r.parentData={element:A(document),left:0,top:0,width:A(document).width(),height:A(document).height()||document.body.parentNode.scrollHeight}):(n=A(u),i=[],A(["Top","Right","Left","Bottom"]).each(function(e,t){i[e]=r._num(n.css("padding"+t))}),r.containerOffset=n.offset(),
r.containerPosition=n.position(),r.containerSize={height:n.innerHeight()-i[3],width:n.innerWidth()-i[1]},e=r.containerOffset,t=r.containerSize.height,a=r.containerSize.width,s=r._hasScroll(u,"left")?u.scrollWidth:a,o=r._hasScroll(u)?u.scrollHeight:t,r.parentData={element:u,left:e.left,top:e.top,width:s,height:o}))},resize:function(e){var t,n,i,a,s=A(this).resizable("instance"),o=s.options,r=s.containerOffset,l=s.position,c=s._aspectRatio||e.shiftKey,d={top:0,left:0},u=s.containerElement,_=!0;u[0]!==document&&/static/.test(u.css("position"))&&(d=r),l.left<(s._helper?r.left:0)&&(s.size.width=s.size.width+(s._helper?s.position.left-r.left:s.position.left-d.left),c&&(s.size.height=s.size.width/s.aspectRatio,_=!1),s.position.left=o.helper?r.left:0),l.top<(s._helper?r.top:0)&&(s.size.height=s.size.height+(s._helper?s.position.top-r.top:s.position.top),c&&(s.size.width=s.size.height*s.aspectRatio,_=!1),s.position.top=s._helper?r.top:0),i=s.containerElement.get(0)===s.element.parent().get(0),a=/relative|absolute/.test(s.containerElement.css("position")),i&&a?(s.offset.left=s.parentData.left+s.position.left,s.offset.top=s.parentData.top+s.position.top):(s.offset.left=s.element.offset().left,s.offset.top=s.element.offset().top),t=Math.abs(s.sizeDiff.width+(s._helper?s.offset.left-d.left:s.offset.left-r.left)),n=Math.abs(s.sizeDiff.height+(s._helper?s.offset.top-d.top:s.offset.top-r.top)),t+s.size.width>=s.parentData.width&&(s.size.width=s.parentData.width-t,c&&(s.size.height=s.size.width/s.aspectRatio,_=!1)),n+s.size.height>=s.parentData.height&&(s.size.height=s.parentData.height-n,c&&(s.size.width=s.size.height*s.aspectRatio,_=!1)),_||(s.position.left=s.prevPosition.left,s.position.top=s.prevPosition.top,s.size.width=s.prevSize.width,s.size.height=s.prevSize.height)},stop:function(){var e=A(this).resizable("instance"),t=e.options,n=e.containerOffset,i=e.containerPosition,a=e.containerElement,s=A(e.helper),o=s.offset(),r=s.outerWidth()-e.sizeDiff.width,l=s.outerHeight()-e.sizeDiff.height;e._helper&&!t.animate&&/relative/.test(a.css("position"))&&A(this).css({left:o.left-i.left-n.left,width:r,height:l}),e._helper&&!t.animate&&/static/.test(a.css("position"))&&A(this).css({left:o.left-i.left-n.left,width:r,height:l})}}),A.ui.plugin.add("resizable","alsoResize",{start:function(){var e=A(this).resizable("instance").options;A(e.alsoResize).each(function(){var e=A(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})},resize:function(e,n){var t=A(this).resizable("instance"),i=t.options,a=t.originalSize,s=t.originalPosition,o={height:t.size.height-a.height||0,width:t.size.width-a.width||0,top:t.position.top-s.top||0,left:t.position.left-s.left||0};A(i.alsoResize).each(function(){var e=A(this),i=A(this).data("ui-resizable-alsoresize"),a={},t=e.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];A.each(t,function(e,t){var n=(i[t]||0)+(o[t]||0);n&&0<=n&&(a[t]=n||null)}),e.css(a)})},stop:function(){A(this).removeData("resizable-alsoresize")}}),A.ui.plugin.add("resizable","ghost",{start:function(){var e=A(this).resizable("instance"),t=e.options,n=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof t.ghost?t.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=A(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=A(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),A.ui.plugin.add("resizable","grid",{resize:function(){var e,t=A(this).resizable("instance"),n=t.options,i=t.size,a=t.originalSize,s=t.originalPosition,o=t.axis,r="number"==typeof n.grid?[n.grid,n.grid]:n.grid,l=r[0]||1,c=r[1]||1,d=Math.round((i.width-a.width)/l)*l,u=Math.round((i.height-a.height)/c)*c,_=a.width+d,h=a.height+u,p=n.maxWidth&&n.maxWidth<_,f=n.maxHeight&&n.maxHeight<h,m=n.minWidth&&n.minWidth>_,g=n.minHeight&&n.minHeight>h;n.grid=r,m&&(_+=l),g&&(h+=c),p&&(_-=l),f&&(h-=c),/^(se|s|e)$/.test(o)?(t.size.width=_,t.size.height=h):/^(ne)$/.test(o)?(t.size.width=_,t.size.height=h,t.position.top=s.top-u):/^(sw)$/.test(o)?(t.size.width=_,t.size.height=h,t.position.left=s.left-d):((h-c<=0||_-l<=0)&&(e=t._getPaddingPlusBorderDimensions(this)),0<h-c?(t.size.height=h,t.position.top=s.top-u):(h=c-e.height,t.size.height=h,t.position.top=s.top+a.height-h),0<_-l?(t.size.width=_,t.position.left=s.left-d):(_=l-e.width,t.size.width=_,t.position.left=s.left+a.width-_))}}),A.ui.resizable}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./button","./draggable","./mouse","./position","./resizable"],e):e(jQuery)}(function(l){return l.widget("ui.dialog",{version:"1.11.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"Close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var t=l(this).css(e).offset().top;t<0&&l(this).css("top",e.top-t)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&l.fn.draggable&&this._makeDraggable(),this.options.resizable&&l.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?l(e):this.document.find(e||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(e=t.parent.children().eq(t.index)).length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:l.noop,enable:l.noop,close:function(e){var t,n=this;if(this._isOpen&&!1!==this._trigger("beforeClose",e)){if(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),!this.opener.filter(":focusable").focus().length)try{(t=this.document[0].activeElement)&&"body"!==t.nodeName.toLowerCase()&&l(t).blur()}catch(i){}this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",e)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var n=!1,i=this.uiDialog.siblings(".ui-front:visible").map(function(){return+l(this).css("z-index")}).get(),a=Math.max.apply(null,i);return a>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",a+1),n=!0),n&&!t&&this._trigger("focus",e),n},open:function(){var e=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=l(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(e){function t(){var e=this.document[0].activeElement;this.uiDialog[0]===e||l.contains(this.uiDialog[0],e)||this._focusTabbable()}e.preventDefault(),t.call(this),this._delay(t)},_createWrapper:function(){this.uiDialog=l("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===l.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===l.ui.keyCode.TAB&&!e.isDefaultPrevented()){var t=this.uiDialog.find(":tabbable"),n=t.filter(":first"),i=t.filter(":last");e.target!==i[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==n[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){i.focus()}),e.preventDefault()):(this._delay(function(){n.focus()}),e.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=l("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){l(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=l("<button type='button'></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),e=l("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(e){this.options.title||e.html("&#160;"),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=l("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=l("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var a=this,e=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),l.isEmptyObject(e)||l.isArray(e)&&!e.length?this.uiDialog.removeClass("ui-dialog-buttons"):(l.each(e,function(e,t){var n,i;t=l.isFunction(t)?{click:t,text:e}:t,t=l.extend({type:"button"},t),n=t.click,t.click=function(){n.apply(a.element[0],arguments)},i={icons:t.icons,text:t.showText},delete t.icons,delete t.showText,l("<button></button>",t).button(i).appendTo(a.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){function a(e){return{position:e.position,offset:e.offset}}var s=this,o=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(e,t){l(this).addClass("ui-dialog-dragging"),s._blockFrames(),s._trigger("dragStart",e,a(t))},drag:function(e,t){s._trigger("drag",e,a(t))},stop:function(e,t){var n=t.offset.left-s.document.scrollLeft(),i=t.offset.top-s.document.scrollTop();o.position={my:"left top",at:"left"+(0<=n?"+":"")+n+" top"+(0<=i?"+":"")+i,of:s.window},l(this).removeClass("ui-dialog-dragging"),s._unblockFrames(),s._trigger("dragStop",e,a(t))}})},_makeResizable:function(){function s(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var o=this,r=this.options,e=r.resizable,t=this.uiDialog.css("position"),n="string"==typeof e?e:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:r.maxWidth,maxHeight:r.maxHeight,minWidth:r.minWidth,minHeight:this._minHeight(),handles:n,start:function(e,t){l(this).addClass("ui-dialog-resizing"),o._blockFrames(),o._trigger("resizeStart",e,s(t))},resize:function(e,t){o._trigger("resize",e,s(t))},stop:function(e,t){var n=o.uiDialog.offset(),i=n.left-o.document.scrollLeft(),a=n.top-o.document.scrollTop();r.height=o.uiDialog.height(),r.width=o.uiDialog.width(),r.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=a?"+":"")+a,of:o.window},l(this).removeClass("ui-dialog-resizing"),o._unblockFrames(),o._trigger("resizeStop",e,s(t))}}).css("position",t)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=l(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),t=l.inArray(this,e);-1!==t&&e.splice(t,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(e){var n=this,i=!1,a={};l.each(e,function(e,t){n._setOption(e,t),e in n.sizeRelatedOptions&&(i=!0),e in n.resizableRelatedOptions&&(a[e]=t)}),i&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(e,t){var n,i,a=this.uiDialog;"dialogClass"===e&&a.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&((n=a.is(":data(ui-draggable)"))&&!t&&a.draggable("destroy"),!n&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&((i=a.is(":data(ui-resizable)"))&&!t&&a.resizable("destroy"),i&&"string"==typeof t&&a.resizable("option","handles",t),i||!1===t||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,n,i=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),i.minWidth>i.width&&(i.width=i.minWidth),e=this.uiDialog.css({height:"auto",width:i.width}).outerHeight(),t=Math.max(0,i.minHeight-e),n="number"==typeof i.maxHeight?Math.max(0,i.maxHeight-e):"none","auto"===i.height?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,i.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=l(this);return l("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!l(e.target).closest(".ui-dialog").length||!!l(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=l("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):this.document.unbind("focusin").removeData("ui-dialog-overlays"),this.overlay.remove(),this.overlay=null}}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./mouse","./draggable"],e):e(jQuery)}(function(r){return r.widget("ui.droppable",{version:"1.11.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,n=e.accept;this.isover=!1,this.isout=!0,this.accept=r.isFunction(n)?n:function(e){return e.is(n)},this.proportions=function(e){if(!arguments.length)return t||(t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});t=e},this._addToManager(e.scope),e.addClasses&&this.element.addClass("ui-droppable")},_addToManager:function(e){r.ui.ddmanager.droppables[e]=r.ui.ddmanager.droppables[e]||[],r.ui.ddmanager.droppables[e].push(this)},_splice:function(e){for(var t=0;t<e.length;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var e=r.ui.ddmanager.droppables[this.options.scope];this._splice(e),this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,t){if("accept"===e)this.accept=r.isFunction(t)?t:function(e){return e.is(t)};else if("scope"===e){var n=r.ui.ddmanager.droppables[this.options.scope];this._splice(n),this._addToManager(t)}this._super(e,t)},_activate:function(e){var t=r.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),t&&this._trigger("activate",e,this.ui(t))},_deactivate:function(e){var t=r.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),t&&this._trigger("deactivate",e,this.ui(t))},_over:function(e){var t=r.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(t)))},_out:function(e){var t=r.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(t)))},_drop:function(t,e){var n=e||r.ui.ddmanager.current,i=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=r(this).droppable("instance");if(e.options.greedy&&!e.options.disabled&&e.options.scope===n.options.scope&&e.accept.call(e.element[0],n.currentItem||n.element)&&r.ui.intersect(n,r.extend(e,{offset:e.element.offset()}),e.options.tolerance,t))return!(i=!0)}),!i&&(!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(n)),this.element)))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),r.ui.intersect=function(){function _(e,t,n){return t<=e&&e<t+n}return function(e,t,n,i){if(!t.offset)return!1;var a=(e.positionAbs||e.position.absolute).left+e.margins.left,s=(e.positionAbs||e.position.absolute).top+e.margins.top,o=a+e.helperProportions.width,r=s+e.helperProportions.height,l=t.offset.left,c=t.offset.top,d=l+t.proportions().width,u=c+t.proportions().height;switch(n){case"fit":return l<=a&&o<=d&&c<=s&&r<=u;case"intersect":return l<a+e.helperProportions.width/2&&o-e.helperProportions.width/2<d&&c<s+e.helperProportions.height/2&&r-e.helperProportions.height/2<u;case"pointer":return _(i.pageY,c,t.proportions().height)&&_(i.pageX,l,t.proportions().width);case"touch":return(c<=s&&s<=u||c<=r&&r<=u||s<c&&u<r)&&(l<=a&&a<=d||l<=o&&o<=d||a<l&&d<o);default:return!1}}}(),r.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,t){var n,i,a=r.ui.ddmanager.droppables[e.options.scope]||[],s=t?t.type:null,o=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<a.length;n++)if(!(a[n].options.disabled||e&&!a[n].accept.call(a[n].element[0],e.currentItem||e.element))){for(i=0;i<o.length;i++)if(o[i]===a[n].element[0]){a[n].proportions().height=0;continue e}a[n].visible="none"!==a[n].element.css("display"),a[n].visible&&("mousedown"===s&&a[n]._activate.call(a[n],t),a[n].offset=a[n].element.offset(),a[n].proportions({width:a[n].element[0].offsetWidth,height:a[n].element[0].offsetHeight}))}},drop:function(e,t){var n=!1;return r.each((r.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&r.ui.intersect(e,this,this.options.tolerance,t)&&(n=this._drop.call(this,t)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,t)))}),n},dragStart:function(e,t){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||r.ui.ddmanager.prepareOffsets(e,t)})},drag:function(s,o){s.options.refreshPositions&&r.ui.ddmanager.prepareOffsets(s,o),r.each(r.ui.ddmanager.droppables[s.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var e,t,n,i=r.ui.intersect(s,this,this.options.tolerance,o),a=!i&&this.isover?"isout":i&&!this.isover?"isover":null;a&&(this.options.greedy&&(t=this.options.scope,(n=this.element.parents(":data(ui-droppable)").filter(function(){return r(this).droppable("instance").options.scope===t})).length&&((e=r(n[0]).droppable("instance")).greedyChild="isover"===a)),e&&"isover"===a&&(e.isover=!1,e.isout=!0,e._out.call(e,o)),this[a]=!0,this["isout"===a?"isover":"isout"]=!1,this["isover"===a?"_over":"_out"].call(this,o),e&&"isout"===a&&(e.isout=!1,e.isover=!0,e._over.call(e,o)))}})},dragStop:function(e,t){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||r.ui.ddmanager.prepareOffsets(e,t)}},r.ui.droppable}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(u){var n,r="ui-effects-",i=u;return u.effects={effect:{}},function(d,u){function _(e,t,n){var i=m[t.type]||{};return null==e?n||!t.def?null:t.def:(e=i.floor?~~e:parseFloat(e),isNaN(e)?t.def:i.mod?(e+i.mod)%i.mod:e<0?0:i.max<e?i.max:e)}function r(o){var r=p(),l=r._rgba=[];return o=o.toLowerCase(),A(t,function(e,t){var n,i=t.re.exec(o),a=i&&t.parse(i),s=t.space||"rgba";if(a)return n=r[s](a),r[f[s].cache]=n[f[s].cache],l=r._rgba=n._rgba,!1}),l.length?("0,0,0,0"===l.join()&&d.extend(l,c.transparent),r):c[o]}function l(e,t,n){return 6*(n=(n+1)%1)<1?e+(t-e)*n*6:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}var c,e="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",h=/^([\-+])=\s*(\d+\.?\d*)/,t=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],p=d.Color=function(e,t,n,i){return new d.Color.fn.parse(e,t,n,i)},f={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},m={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},g=p.support={},n=d("<p>")[0],A=d.each;n.style.cssText="background-color:rgba(1,1,1,.5)",g.rgba=-1<n.style.backgroundColor.indexOf("rgba"),A(f,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),p.fn=d.extend(p.prototype,{parse:function(a,e,t,n){if(a===u)return this._rgba=[null,null,null,null],this;(a.jquery||a.nodeType)&&(a=d(a).css(e),e=u);var s=this,i=d.type(a),o=this._rgba=[];return e!==u&&(a=[a,e,t,n],i="array"),"string"===i?this.parse(r(a)||c._default):"array"===i?(A(f.rgba.props,function(e,t){o[t.idx]=_(a[t.idx],t)}),this):"object"===i?(A(f,a instanceof p?function(e,t){a[t.cache]&&(s[t.cache]=a[t.cache].slice())}:function(e,n){var i=n.cache;A(n.props,function(e,t){if(!s[i]&&n.to){if("alpha"===e||null==a[e])return;s[i]=n.to(s._rgba)}s[i][t.idx]=_(a[e],t,!0)}),s[i]&&d.inArray(null,s[i].slice(0,3))<0&&(s[i][3]=1,n.from&&(s._rgba=n.from(s[i])))}),this):void 0},is:function(e){var a=p(e),s=!0,o=this;return A(f,function(e,t){var n,i=a[t.cache];return i&&(n=o[t.cache]||t.to&&t.to(o._rgba)||[],A(t.props,function(e,t){if(null!=i[t.idx])return s=i[t.idx]===n[t.idx]})),s}),s},_space:function(){var n=[],i=this;return A(f,function(e,t){i[t.cache]&&n.push(e)}),n.pop()},transition:function(e,o){var r=p(e),t=r._space(),n=f[t],i=0===this.alpha()?p("transparent"):this,l=i[n.cache]||n.to(i._rgba),c=l.slice();return r=r[n.cache],A(n.props,function(e,t){var n=t.idx,i=l[n],a=r[n],s=m[t.type]||{};null!==a&&(null===i?c[n]=a:(s.mod&&(a-i>s.mod/2?i+=s.mod:i-a>s.mod/2&&(i-=s.mod)),c[n]=_((a-i)*o+i,t)))}),this[t](c)},blend:function(e){if(1===this._rgba[3])return this;var t=this._rgba.slice(),n=t.pop(),i=p(e)._rgba;return p(d.map(t,function(e,t){return(1-n)*i[t]+n*e}))},toRgbaString:function(){var e="rgba(",t=d.map(this._rgba,function(e,t){return null==e?2<t?1:0:e});return 1===t[3]&&(t.pop(),e="rgb("),e+t.join()+")"},toHslaString:function(){var e="hsla(",t=d.map(this.hsla(),function(e,t){return null==e&&(e=2<t?1:0),t&&t<3&&(e=Math.round(100*e)+"%"),e});return 1===t[3]&&(t.pop(),e="hsl("),e+t.join()+")"},toHexString:function(e){var t=this._rgba.slice(),n=t.pop();return e&&t.push(~~(255*n)),"#"+d.map(t,function(e){return 1===(e=(e||0).toString(16)).length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),p.fn.parse.prototype=p.fn,f.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,n,i=e[0]/255,a=e[1]/255,s=e[2]/255,o=e[3],r=Math.max(i,a,s),l=Math.min(i,a,s),c=r-l,d=r+l,u=.5*d;return t=l===r?0:i===r?60*(a-s)/c+360:a===r?60*(s-i)/c+120:60*(i-a)/c+240,n=0===c?0:u<=.5?c/d:c/(2-d),[Math.round(t)%360,n,u,null==o?1:o]},f.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,n=e[1],i=e[2],a=e[3],s=i<=.5?i*(1+n):i+n-i*n,o=2*i-s;return[Math.round(255*l(o,s,t+1/3)),Math.round(255*l(o,s,t)),Math.round(255*l(o,s,t-1/3)),a]},A(f,function(l,e){var n=e.props,o=e.cache,r=e.to,c=e.from;p.fn[l]=function(e){if(r&&!this[o]&&(this[o]=r(this._rgba)),e===u)return this[o].slice();var t,i=d.type(e),a="array"===i||"object"===i?e:arguments,s=this[o].slice();return A(n,function(e,t){var n=a["object"===i?e:t.idx];null==n&&(n=s[t.idx]),s[t.idx]=_(n,t)}),c?((t=p(c(s)))[o]=s,t):p(s)},A(n,function(o,r){p.fn[o]||(p.fn[o]=function(e){var t,n=d.type(e),i="alpha"===o?this._hsla?"hsla":"rgba":l,a=this[i](),s=a[r.idx];return"undefined"===n?s:("function"===n&&(e=e.call(this,s),n=d.type(e)),null==e&&r.empty?this:("string"===n&&(t=h.exec(e))&&(e=s+parseFloat(t[2])*("+"===t[1]?1:-1)),a[r.idx]=e,this[i](a)))})})}),p.hook=function(e){var t=e.split(" ");A(t,function(e,o){d.cssHooks[o]={set:function(e,t){var n,i,a="";if("transparent"!==t&&("string"!==d.type(t)||(n=r(t)))){if(t=p(n||t),!g.rgba&&1!==t._rgba[3]){for(i="backgroundColor"===o?e.parentNode:e;(""===a||"transparent"===a)&&i&&i.style;)try{a=d.css(i,"backgroundColor"),i=i.parentNode}catch(s){}t=t.blend(a&&"transparent"!==a?a:"_default")}t=t.toRgbaString()}try{e.style[o]=t}catch(s){}}},d.fx.step[o]=function(e){e.colorInit||(e.start=p(e.elem,o),e.end=p(e.end),e.colorInit=!0),d.cssHooks[o].set(e.elem,e.start.transition(e.end,e.pos))}})},p.hook(e),d.cssHooks.borderColor={expand:function(n){var i={};return A(["Top","Right","Bottom","Left"],function(e,t){i["border"+t+"Color"]=n}),i}},c=d.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(i),function(){function o(e){var t,n,i=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(i&&i.length&&i[0]&&i[i[0]])for(n=i.length;n--;)"string"==typeof i[t=i[n]]&&(a[u.camelCase(t)]=i[t]);else for(t in i)"string"==typeof i[t]&&(a[t]=i[t]);return a}function r(e,t){var n,i,a={};for(n in t)i=t[n],e[n]!==i&&(d[n]||!u.fx.step[n]&&isNaN(parseFloat(i))||(a[n]=i));return a}var s,a,l,c=["add","remove","toggle"],d={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};u.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,t){u.fx.step[t]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(i.style(e.elem,t,e.end),e.setAttr=!0)}}),u.fn.addBack||(u.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),u.effects.animateClass=function(a,e,t,n){var s=u.speed(e,t,n);return this.queue(function(){var e,n=u(this),t=n.attr("class")||"",i=s.children?n.find("*").addBack():n;i=i.map(function(){return{el:u(this),start:o(this)}}),(e=function(){u.each(c,function(e,t){a[t]&&n[t+"Class"](a[t])})})(),i=i.map(function(){return this.end=o(this.el[0]),this.diff=r(this.start,this.end),this}),n.attr("class",t),i=i.map(function(){var e=this,t=u.Deferred(),n=u.extend({},s,{queue:!1,complete:function(){t.resolve(e)}});return this.el.animate(this.diff,n),t.promise()}),u.when.apply(u,i.get()).done(function(){e(),u.each(arguments,function(){var t=this.el;u.each(this.diff,function(e){t.css(e,"")})}),s.complete.call(n[0])})})},u.fn.extend({addClass:(l=u.fn.addClass,function(e,t,n,i){return t?u.effects.animateClass.call(this,{add:e},t,n,i):l.apply(this,arguments)}),removeClass:(a=u.fn.removeClass,function(e,t,n,i){return 1<arguments.length?u.effects.animateClass.call(this,{remove:e},t,n,i):a.apply(this,arguments)}),toggleClass:(s=u.fn.toggleClass,function(e,t,n,i,a){return"boolean"==typeof t||t===undefined?n?u.effects.animateClass.call(this,t?{add:e}:{remove:e},n,i,a):s.apply(this,arguments):u.effects.animateClass.call(this,{toggle:e},t,n,i)}),switchClass:function(e,t,n,i,a){return u.effects.animateClass.call(this,{add:t,remove:e},n,i,a)}})}(),function(){function i(e,t,n,i){return u.isPlainObject(e)&&(e=(t=e).effect),e={effect:e},null==t&&(t={}),u.isFunction(t)&&(i=t,n=null,t={}),("number"==typeof t||u.fx.speeds[t])&&(i=n,n=t,t={}),u.isFunction(n)&&(i=n,n=null),t&&u.extend(e,t),n=n||t.duration,e.duration=u.fx.off?0:"number"==typeof n?n:n in u.fx.speeds?u.fx.speeds[n]:u.fx.speeds._default,e.complete=i||t.complete,e}function n(e){return!(e&&"number"!=typeof e&&!u.fx.speeds[e])||("string"==typeof e&&!u.effects.effect[e]||(!!u.isFunction(e)||"object"==typeof e&&!e.effect))}var a,s,o;u.extend(u.effects,{version:"1.11.4",save:function(e,t){for(var n=0;n<t.length;n++)null!==t[n]&&e.data(r+t[n],e[0].style[t[n]])},restore:function(e,t){var n,i;for(i=0;i<t.length;i++)null!==t[i]&&((n=e.data(r+t[i]))===undefined&&(n=""),e.css(t[i],n))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,i;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":i=0;break;case"center":i=.5;break;case"right":i=1;break;default:i=e[1]/t.width}return{x:i,y:n}},createWrapper:function(n){if(n.parent().is(".ui-effects-wrapper"))return n.parent();var i={width:n.outerWidth(!0),
height:n.outerHeight(!0),"float":n.css("float")},e=u("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),t={width:n.width(),height:n.height()},a=document.activeElement;try{a.id}catch(s){a=document.body}return n.wrap(e),(n[0]===a||u.contains(n[0],a))&&u(a).focus(),e=n.parent(),"static"===n.css("position")?(e.css({position:"relative"}),n.css({position:"relative"})):(u.extend(i,{position:n.css("position"),zIndex:n.css("z-index")}),u.each(["top","left","bottom","right"],function(e,t){i[t]=n.css(t),isNaN(parseInt(i[t],10))&&(i[t]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(t),e.css(i).show()},removeWrapper:function(e){var t=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===t||u.contains(e[0],t))&&u(t).focus()),e},setTransition:function(i,e,a,s){return s=s||{},u.each(e,function(e,t){var n=i.cssUnit(t);0<n[0]&&(s[t]=n[0]*a+n[1])}),s}}),u.fn.extend({effect:function(){function e(e){function t(){u.isFunction(i)&&i.call(n[0]),u.isFunction(e)&&e()}var n=u(this),i=s.complete,a=s.mode;(n.is(":hidden")?"hide"===a:"show"===a)?(n[a](),t()):o.call(n[0],s,t)}var s=i.apply(this,arguments),t=s.mode,n=s.queue,o=u.effects.effect[s.effect];return u.fx.off||!o?t?this[t](s.duration,s.complete):this.each(function(){s.complete&&s.complete.call(this)}):!1===n?this.each(e):this.queue(n||"fx",e)},show:(o=u.fn.show,function(e){if(n(e))return o.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="show",this.effect.call(this,t)}),hide:(s=u.fn.hide,function(e){if(n(e))return s.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="hide",this.effect.call(this,t)}),toggle:(a=u.fn.toggle,function(e){if(n(e)||"boolean"==typeof e)return a.apply(this,arguments);var t=i.apply(this,arguments);return t.mode="toggle",this.effect.call(this,t)}),cssUnit:function(e){var n=this.css(e),i=[];return u.each(["em","px","%","pt"],function(e,t){0<n.indexOf(t)&&(i=[parseFloat(n),t])}),i}})}(),n={},u.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,e){n[e]=function(e){return Math.pow(e,t+2)}}),u.extend(n,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}}),u.each(n,function(e,t){u.easing["easeIn"+e]=t,u.easing["easeOut"+e]=function(e){return 1-t(1-e)},u.easing["easeInOut"+e]=function(e){return e<.5?t(2*e)/2:1-t(-2*e+2)/2}}),u.effects}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(g){return g.effects.effect.blind=function(e,t){var n,i,a,s=g(this),o=/up|down|vertical/,r=/up|left|vertical|horizontal/,l=["position","top","bottom","left","right","height","width"],c=g.effects.setMode(s,e.mode||"hide"),d=e.direction||"up",u=o.test(d),_=u?"height":"width",h=u?"top":"left",p=r.test(d),f={},m="show"===c;s.parent().is(".ui-effects-wrapper")?g.effects.save(s.parent(),l):g.effects.save(s,l),s.show(),i=(n=g.effects.createWrapper(s).css({overflow:"hidden"}))[_](),a=parseFloat(n.css(h))||0,f[_]=m?i:0,p||(s.css(u?"bottom":"right",0).css(u?"top":"left","auto").css({position:"absolute"}),f[h]=m?a:i+a),m&&(n.css(_,0),p||n.css(h,a+i)),n.animate(f,{duration:e.duration,easing:e.easing,queue:!1,complete:function(){"hide"===c&&s.hide(),g.effects.restore(s,l),g.effects.removeWrapper(s),t()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(b){return b.effects.effect.bounce=function(e,t){var n,i,a,s=b(this),o=["position","top","bottom","left","right","height","width"],r=b.effects.setMode(s,e.mode||"effect"),l="hide"===r,c="show"===r,d=e.direction||"up",u=e.distance,_=e.times||5,h=2*_+(c||l?1:0),p=e.duration/h,f=e.easing,m="up"===d||"down"===d?"top":"left",g="up"===d||"left"===d,A=s.queue(),v=A.length;for((c||l)&&o.push("opacity"),b.effects.save(s,o),s.show(),b.effects.createWrapper(s),u||(u=s["top"===m?"outerHeight":"outerWidth"]()/3),c&&((a={opacity:1})[m]=0,s.css("opacity",0).css(m,g?2*-u:2*u).animate(a,p,f)),l&&(u/=Math.pow(2,_-1)),n=(a={})[m]=0;n<_;n++)(i={})[m]=(g?"-=":"+=")+u,s.animate(i,p,f).animate(a,p,f),u=l?2*u:u/2;l&&((i={opacity:0})[m]=(g?"-=":"+=")+u,s.animate(i,p,f)),s.queue(function(){l&&s.hide(),b.effects.restore(s,o),b.effects.removeWrapper(s),t()}),1<v&&A.splice.apply(A,[1,0].concat(A.splice(v,h+1))),s.dequeue()}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(_){return _.effects.effect.clip=function(e,t){var n,i,a,s=_(this),o=["position","top","bottom","left","right","height","width"],r="show"===_.effects.setMode(s,e.mode||"hide"),l="vertical"===(e.direction||"vertical"),c=l?"height":"width",d=l?"top":"left",u={};_.effects.save(s,o),s.show(),n=_.effects.createWrapper(s).css({overflow:"hidden"}),a=(i="IMG"===s[0].tagName?n:s)[c](),r&&(i.css(c,0),i.css(d,a/2)),u[c]=r?a:0,u[d]=r?0:a/2,i.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){r||s.hide(),_.effects.restore(s,o),_.effects.removeWrapper(s),t()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(u){return u.effects.effect.drop=function(e,t){var n,i=u(this),a=["position","top","bottom","left","right","opacity","height","width"],s=u.effects.setMode(i,e.mode||"hide"),o="show"===s,r=e.direction||"left",l="up"===r||"down"===r?"top":"left",c="up"===r||"left"===r?"pos":"neg",d={opacity:o?1:0};u.effects.save(i,a),i.show(),u.effects.createWrapper(i),n=e.distance||i["top"===l?"outerHeight":"outerWidth"](!0)/2,o&&i.css("opacity",0).css(l,"pos"===c?-n:n),d[l]=(o?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+n,i.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===s&&i.hide(),u.effects.restore(i,a),u.effects.removeWrapper(i),t()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(A){return A.effects.effect.explode=function(e,t){function n(){g.push(this),g.length===d*u&&i()}function i(){_.css({visibility:"visible"}),A(g).remove(),h||_.hide(),t()}var a,s,o,r,l,c,d=e.pieces?Math.round(Math.sqrt(e.pieces)):3,u=d,_=A(this),h="show"===A.effects.setMode(_,e.mode||"hide"),p=_.show().css("visibility","hidden").offset(),f=Math.ceil(_.outerWidth()/u),m=Math.ceil(_.outerHeight()/d),g=[];for(a=0;a<d;a++)for(r=p.top+a*m,c=a-(d-1)/2,s=0;s<u;s++)o=p.left+s*f,l=s-(u-1)/2,_.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-s*f,top:-a*m}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:f,height:m,left:o+(h?l*f:0),top:r+(h?c*m:0),opacity:h?0:1}).animate({left:o+(h?0:l*f),top:r+(h?0:c*m),opacity:h?1:0},e.duration||500,e.easing,n)}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(a){return a.effects.effect.fade=function(e,t){var n=a(this),i=a.effects.setMode(n,e.mode||"toggle");n.animate({opacity:i},{queue:!1,duration:e.duration,easing:e.easing,complete:t})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(g){return g.effects.effect.fold=function(e,t){var n,i,a=g(this),s=["position","top","bottom","left","right","height","width"],o=g.effects.setMode(a,e.mode||"hide"),r="show"===o,l="hide"===o,c=e.size||15,d=/([0-9]+)%/.exec(c),u=!!e.horizFirst,_=r!==u,h=_?["width","height"]:["height","width"],p=e.duration/2,f={},m={};g.effects.save(a,s),a.show(),n=g.effects.createWrapper(a).css({overflow:"hidden"}),i=_?[n.width(),n.height()]:[n.height(),n.width()],d&&(c=parseInt(d[1],10)/100*i[l?0:1]),r&&n.css(u?{height:0,width:c}:{height:c,width:0}),f[h[0]]=r?i[0]:c,m[h[1]]=r?i[1]:0,n.animate(f,p,e.easing).animate(m,p,e.easing,function(){l&&a.hide(),g.effects.restore(a,s),g.effects.removeWrapper(a),t()})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(o){return o.effects.effect.highlight=function(e,t){var n=o(this),i=["backgroundImage","backgroundColor","opacity"],a=o.effects.setMode(n,e.mode||"show"),s={backgroundColor:n.css("backgroundColor")};"hide"===a&&(s.opacity=0),o.effects.save(n,i),n.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(s,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&n.hide(),o.effects.restore(n,i),t()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(v){return v.effects.effect.size=function(n,e){var t,i,a,s=v(this),o=["position","top","bottom","left","right","width","height","overflow","opacity"],r=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],u=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],_=v.effects.setMode(s,n.mode||"effect"),h=n.restore||"effect"!==_,p=n.scale||"both",f=n.origin||["middle","center"],m=s.css("position"),g=h?o:r,A={height:0,width:0,outerHeight:0,outerWidth:0};"show"===_&&s.show(),t={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},"toggle"===n.mode&&"show"===_?(s.from=n.to||A,s.to=n.from||t):(s.from=n.from||("show"===_?A:t),s.to=n.to||("hide"===_?A:t)),a={from:{y:s.from.height/t.height,x:s.from.width/t.width},to:{y:s.to.height/t.height,x:s.to.width/t.width}},"box"!==p&&"both"!==p||(a.from.y!==a.to.y&&(g=g.concat(d),s.from=v.effects.setTransition(s,d,a.from.y,s.from),s.to=v.effects.setTransition(s,d,a.to.y,s.to)),a.from.x!==a.to.x&&(g=g.concat(u),s.from=v.effects.setTransition(s,u,a.from.x,s.from),s.to=v.effects.setTransition(s,u,a.to.x,s.to))),"content"!==p&&"both"!==p||a.from.y!==a.to.y&&(g=g.concat(c).concat(l),s.from=v.effects.setTransition(s,c,a.from.y,s.from),s.to=v.effects.setTransition(s,c,a.to.y,s.to)),v.effects.save(s,g),s.show(),v.effects.createWrapper(s),s.css("overflow","hidden").css(s.from),f&&(i=v.effects.getBaseline(f,t),s.from.top=(t.outerHeight-s.outerHeight())*i.y,s.from.left=(t.outerWidth-s.outerWidth())*i.x,s.to.top=(t.outerHeight-s.to.outerHeight)*i.y,s.to.left=(t.outerWidth-s.to.outerWidth)*i.x),s.css(s.from),"content"!==p&&"both"!==p||(d=d.concat(["marginTop","marginBottom"]).concat(c),u=u.concat(["marginLeft","marginRight"]),l=o.concat(d).concat(u),s.find("*[width]").each(function(){var e=v(this),t={height:e.height(),width:e.width(),outerHeight:e.outerHeight(),outerWidth:e.outerWidth()};h&&v.effects.save(e,l),e.from={height:t.height*a.from.y,width:t.width*a.from.x,outerHeight:t.outerHeight*a.from.y,outerWidth:t.outerWidth*a.from.x},e.to={height:t.height*a.to.y,width:t.width*a.to.x,outerHeight:t.height*a.to.y,outerWidth:t.width*a.to.x},a.from.y!==a.to.y&&(e.from=v.effects.setTransition(e,d,a.from.y,e.from),e.to=v.effects.setTransition(e,d,a.to.y,e.to)),a.from.x!==a.to.x&&(e.from=v.effects.setTransition(e,u,a.from.x,e.from),e.to=v.effects.setTransition(e,u,a.to.x,e.to)),e.css(e.from),e.animate(e.to,n.duration,n.easing,function(){h&&v.effects.restore(e,l)})})),s.animate(s.to,{queue:!1,duration:n.duration,easing:n.easing,complete:function(){0===s.to.opacity&&s.css("opacity",s.from.opacity),"hide"===_&&s.hide(),v.effects.restore(s,g),h||("static"===m?s.css({position:"relative",top:s.to.top,left:s.to.left}):v.each(["top","left"],function(a,e){s.css(e,function(e,t){var n=parseInt(t,10),i=a?s.to.left:s.to.top;return"auto"===t?i+"px":n+i+"px"})})),v.effects.removeWrapper(s),e()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect","./effect-size"],e):e(jQuery)}(function(d){return d.effects.effect.scale=function(e,t){var n=d(this),i=d.extend(!0,{},e),a=d.effects.setMode(n,e.mode||"effect"),s=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),o=e.direction||"both",r=e.origin,l={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()},c={y:"horizontal"!==o?s/100:1,x:"vertical"!==o?s/100:1};i.effect="size",i.queue=!1,i.complete=t,"effect"!==a&&(i.origin=r||["middle","center"],i.restore=!0),i.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),i.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},i.fade&&("show"===a&&(i.from.opacity=0,i.to.opacity=1),"hide"===a&&(i.from.opacity=1,i.to.opacity=0)),n.effect(i)}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect","./effect-scale"],e):e(jQuery)}(function(l){return l.effects.effect.puff=function(e,t){var n=l(this),i=l.effects.setMode(n,e.mode||"hide"),a="hide"===i,s=parseInt(e.percent,10)||150,o=s/100,r={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};l.extend(e,{effect:"scale",queue:!1,fade:!0,mode:i,complete:t,percent:a?s:100,from:a?r:{height:r.height*o,width:r.width*o,outerHeight:r.outerHeight*o,outerWidth:r.outerWidth*o}}),n.effect(e)}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(h){return h.effects.effect.pulsate=function(e,t){var n,i=h(this),a=h.effects.setMode(i,e.mode||"show"),s="show"===a,o="hide"===a,r=s||"hide"===a,l=2*(e.times||5)+(r?1:0),c=e.duration/l,d=0,u=i.queue(),_=u.length;for(!s&&i.is(":visible")||(i.css("opacity",0).show(),d=1),n=1;n<l;n++)i.animate({opacity:d},c,e.easing),d=1-d;i.animate({opacity:d},c,e.easing),i.queue(function(){o&&i.hide(),t()}),1<_&&u.splice.apply(u,[1,0].concat(u.splice(_,l+1))),i.dequeue()}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(A){return A.effects.effect.shake=function(e,t){var n,i=A(this),a=["position","top","bottom","left","right","height","width"],s=A.effects.setMode(i,e.mode||"effect"),o=e.direction||"left",r=e.distance||20,l=e.times||3,c=2*l+1,d=Math.round(e.duration/c),u="up"===o||"down"===o?"top":"left",_="up"===o||"left"===o,h={},p={},f={},m=i.queue(),g=m.length;for(A.effects.save(i,a),i.show(),A.effects.createWrapper(i),h[u]=(_?"-=":"+=")+r,p[u]=(_?"+=":"-=")+2*r,f[u]=(_?"-=":"+=")+2*r,i.animate(h,d,e.easing),n=1;n<l;n++)i.animate(p,d,e.easing).animate(f,d,e.easing);i.animate(p,d,e.easing).animate(h,d/2,e.easing).queue(function(){"hide"===s&&i.hide(),A.effects.restore(i,a),A.effects.removeWrapper(i),t()}),1<g&&m.splice.apply(m,[1,0].concat(m.splice(g,c+1))),i.dequeue()}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(u){return u.effects.effect.slide=function(e,t){var n,i=u(this),a=["position","top","bottom","left","right","width","height"],s=u.effects.setMode(i,e.mode||"show"),o="show"===s,r=e.direction||"left",l="up"===r||"down"===r?"top":"left",c="up"===r||"left"===r,d={};u.effects.save(i,a),i.show(),n=e.distance||i["top"===l?"outerHeight":"outerWidth"](!0),u.effects.createWrapper(i).css({overflow:"hidden"}),o&&i.css(l,c?isNaN(n)?"-"+n:-n:n),d[l]=(o?c?"+=":"-=":c?"-=":"+=")+n,i.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===s&&i.hide(),u.effects.restore(i,a),u.effects.removeWrapper(i),t()}})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(_){return _.effects.effect.transfer=function(e,t){var n=_(this),i=_(e.to),a="fixed"===i.css("position"),s=_("body"),o=a?s.scrollTop():0,r=a?s.scrollLeft():0,l=i.offset(),c={top:l.top-o,left:l.left-r,height:i.innerHeight(),width:i.innerWidth()},d=n.offset(),u=_("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(e.className).css({top:d.top-o,left:d.left-r,height:n.innerHeight(),width:n.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){u.remove(),t()})}}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],e):e(jQuery)}(function(n){return n.widget("ui.progressbar",{version:"1.11.4",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=n("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){if(e===undefined)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return e===undefined&&(e=this.options.value),this.indeterminate=!1===e,"number"!=typeof e&&(e=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t).attr("aria-disabled",t),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,t=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(t.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=n("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(c){return c.widget("ui.selectable",c.ui.mouse,{version:"1.11.4",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e,t=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){(e=c(t.options.filter,t.element[0])).addClass("ui-selectee"),e.each(function(){var e=c(this),t=e.offset();c.data(this,"selectable-item",{element:this,$element:e,left:t.left,top:t.top,right:t.left+e.outerWidth(),bottom:t.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=e.addClass("ui-selectee"),this._mouseInit(),this.helper=c("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(n){var i=this,e=this.options;this.opos=[n.pageX,n.pageY],this.options.disabled||(this.selectees=c(e.filter,this.element[0]),this._trigger("start",n),c(e.appendTo).append(this.helper),this.helper.css({left:n.pageX,top:n.pageY,width:0,height:0}),e.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var e=c.data(this,"selectable-item");e.startselected=!0,n.metaKey||n.ctrlKey||(e.$element.removeClass("ui-selected"),e.selected=!1,e.$element.addClass("ui-unselecting"),e.unselecting=!0,i._trigger("unselecting",n,{unselecting:e.element}))}),c(n.target).parents().addBack().each(function(){var e,t=c.data(this,"selectable-item");if(t)return e=!n.metaKey&&!n.ctrlKey||!t.$element.hasClass("ui-selected"),t.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),t.unselecting=!e,t.selecting=e,(t.selected=e)?i._trigger("selecting",n,{selecting:t.element}):i._trigger("unselecting",n,{unselecting:t.element}),!1}))},_mouseDrag:function(n){if(this.dragged=!0,!this.options.disabled){var e,i=this,a=this.options,s=this.opos[0],o=this.opos[1],r=n.pageX,l=n.pageY;return r<s&&(e=r,r=s,s=e),l<o&&(e=l,l=o,o=e),this.helper.css({left:s,top:o,width:r-s,height:l-o}),this.selectees.each(function(){var e=c.data(this,"selectable-item"),t=!1;e&&e.element!==i.element[0]&&("touch"===a.tolerance?t=!(e.left>r||e.right<s||e.top>l||e.bottom<o):"fit"===a.tolerance&&(t=e.left>s&&e.right<r&&e.top>o&&e.bottom<l),t?(e.selected&&(e.$element.removeClass("ui-selected"),e.selected=!1),e.unselecting&&(e.$element.removeClass("ui-unselecting"),e.unselecting=!1),e.selecting||(e.$element.addClass("ui-selecting"),e.selecting=!0,i._trigger("selecting",n,{selecting:e.element}))):(e.selecting&&((n.metaKey||n.ctrlKey)&&e.startselected?(e.$element.removeClass("ui-selecting"),e.selecting=!1,e.$element.addClass("ui-selected"),e.selected=!0):(e.$element.removeClass("ui-selecting"),e.selecting=!1,e.startselected&&(e.$element.addClass("ui-unselecting"),e.unselecting=!0),i._trigger("unselecting",n,{unselecting:e.element}))),e.selected&&(n.metaKey||n.ctrlKey||e.startselected||(e.$element.removeClass("ui-selected"),e.selected=!1,e.$element.addClass("ui-unselecting"),e.unselecting=!0,i._trigger("unselecting",n,{unselecting:e.element})))))}),!1}},_mouseStop:function(t){var n=this;return this.dragged=!1,c(".ui-unselecting",this.element[0]).each(function(){var e=c.data(this,"selectable-item");e.$element.removeClass("ui-unselecting"),e.unselecting=!1,e.startselected=!1,n._trigger("unselected",t,{unselected:e.element})}),c(".ui-selecting",this.element[0]).each(function(){var e=c.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected"),e.selecting=!1,e.selected=!0,e.startselected=!0,n._trigger("selected",t,{selected:e.element})}),this._trigger("stop",t),this.helper.remove(),!1}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./position","./menu"],e):e(jQuery)}(function(s){return s.widget("ui.selectmenu",{version:"1.11.4",defaultElement:"<select>",options:{appendTo:null,disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:null,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this.options.disabled&&this.disable()},_drawButton:function(){var e=this;this.label=s("label[for='"+this.ids.element+"']").attr("for",this.ids.button),this._on(this.label,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=s("<span>",{"class":"ui-selectmenu-button ui-widget ui-state-default ui-corner-all",tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true"}).insertAfter(this.element),s("<span>",{"class":"ui-icon "+this.options.icons.button}).prependTo(this.button),this.buttonText=s("<span>",{"class":"ui-selectmenu-text"}).appendTo(this.button),this._setText(this.buttonText,this.element.find("option:selected").text()),this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e.menuItems||e._refreshMenu()}),this._hoverable(this.button),this._focusable(this.button)},_drawMenu:function(){var i=this;this.menu=s("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=s("<div>",{"class":"ui-selectmenu-menu ui-front"}).append(this.menu).appendTo(this._appendTo()),this.menuInstance=this.menu.menu({role:"listbox",select:function(e,t){e.preventDefault(),i._setSelection(),i._select(t.item.data("ui-selectmenu-item"),e)},focus:function(e,t){var n=t.item.data("ui-selectmenu-item");null!=i.focusIndex&&n.index!==i.focusIndex&&(i._trigger("focus",e,{item:n}),i.isOpen||i._select(n,e)),i.focusIndex=n.index,i.button.attr("aria-activedescendant",i.menuItems.eq(n.index).attr("id"))}}).menu("instance"),this.menu.addClass("ui-corner-bottom").removeClass("ui-corner-all"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this._setText(this.buttonText,this._getSelectedItem().text()),this.options.width||this._resizeButton()},_refreshMenu:function(){this.menu.empty();var e,t=this.element.find("option");t.length&&(this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup"),e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this.menuItems?(this.menu.find(".ui-state-focus").removeClass("ui-state-focus"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e))},_position:function(){this.menuWrap.position(s.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderMenu:function(n,e){var i=this,a="";s.each(e,function(e,t){t.optgroup!==a&&(s("<li>",{"class":"ui-selectmenu-optgroup ui-menu-divider"+(t.element.parent("optgroup").prop("disabled")?" ui-state-disabled":""),text:t.optgroup}).appendTo(n),a=t.optgroup),i._renderItemData(n,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(e,t){var n=s("<li>");return t.disabled&&n.addClass("ui-state-disabled"),this._setText(n,t.label),n.appendTo(e)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var n,i,a=".ui-menu-item";this.isOpen?n=this.menuItems.eq(this.focusIndex):(n=this.menuItems.eq(this.element[0].selectedIndex),a+=":not(.ui-state-disabled)"),(i="first"===e||"last"===e?n["first"===e?"prevAll":"nextAll"](a).eq(-1):n[e+"All"](a).eq(0)).length&&this.menuInstance.focus(t,i)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex)},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?((e=window.getSelection()).removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(s(e.target).closest(".ui-selectmenu-menu, #"+this.ids.button).length||this.close(e))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection()).rangeCount&&(this.range=e.getRangeAt(0)):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(e){var t=!0;switch(e.keyCode){case s.ui.keyCode.TAB:case s.ui.keyCode.ESCAPE:this.close(e),t=!1;break;case s.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case s.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case s.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case s.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case s.ui.keyCode.LEFT:this._move("prev",e);break;case s.ui.keyCode.RIGHT:this._move("next",e);break;case s.ui.keyCode.HOME:case s.ui.keyCode.PAGE_UP:this._move("first",e);break;case s.ui.keyCode.END:case s.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),t=!1}t&&e.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex);t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var n=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this._setText(this.buttonText,e.label),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==n&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){"icons"===e&&this.button.find("span.ui-icon").removeClass(this.options.icons.button).addClass(t.button),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"disabled"===e&&(this.menuInstance.option("disabled",t),this.button.toggleClass("ui-state-disabled",t).attr("aria-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)),"width"===e&&this._resizeButton()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?s(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.toggleClass("ui-corner-top",this.isOpen).toggleClass("ui-corner-all",!this.isOpen).attr("aria-expanded",this.isOpen),this.menuWrap.toggleClass("ui-selectmenu-open",this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;e||(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){return{disabled:this.element.prop("disabled")}},_parseOptions:function(e){var a=[];e.each(function(e,t){var n=s(t),i=n.parent("optgroup");a.push({element:n,index:e,value:n.val(),label:n.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||n.prop("disabled")})}),this.items=a},_destroy:function(){this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.label.attr("for",this.ids.element)}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(d){return d.widget("ui.slider",d.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,t,n=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",s=[];for(t=n.values&&n.values.length||1,i.length>t&&(i.slice(t).remove(),i=i.slice(0,t)),e=i.length;e<t;e++)s.push(a);this.handles=i.add(d(s.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){d(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,t="";e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:d.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=d("<div></div>").appendTo(this.element),t="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(t+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),
this._mouseDestroy()},_mouseCapture:function(e){var t,n,i,a,s,o,r,l=this,c=this.options;return!c.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var t=Math.abs(n-l.values(e));(t<i||i===t&&(e===l._lastChangedValue||l.values(e)===c.min))&&(i=t,a=d(this),s=e)}),!1!==this._start(e,s)&&(this._mouseSliding=!0,this._handleIndex=s,a.addClass("ui-state-active").focus(),o=a.offset(),r=!d(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=r?{left:0,top:0}:{left:e.pageX-o.left-a.width()/2,top:e.pageY-o.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,s,n),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,i,a,s;return"horizontal"===this.orientation?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),1<(i=n/t)&&(i=1),i<0&&(i=0),"vertical"===this.orientation&&(i=1-i),a=this._valueMax()-this._valueMin(),s=this._valueMin()+i*a,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var i,a,s;this.options.values&&this.options.values.length?(i=this.values(t?0:1),2===this.options.values.length&&!0===this.options.range&&(0===t&&i<n||1===t&&n<i)&&(n=i),n!==this.values(t)&&((a=this.values())[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:a}),i=this.values(t?0:1),!1!==s&&this.values(t,n))):n!==this.value()&&!1!==(s=this._trigger("slide",e,{handle:this.handles[t],value:n}))&&this.value(n)},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,n)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,t){var n,i,a;if(1<arguments.length)return this.options.values[e]=this._trimAlignValue(t),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!d.isArray(e))return this.options.values&&this.options.values.length?this._values(e):this.value();for(n=this.options.values,i=e,a=0;a<n.length;a+=1)n[a]=this._trimAlignValue(i[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,t){var n,i=0;switch("range"===e&&!0===this.options.range&&("min"===t?(this.options.value=this._values(0),this.options.values=null):"max"===t&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),d.isArray(this.options.values)&&(i=this.options.values.length),"disabled"===e&&this.element.toggleClass("ui-state-disabled",!!t),this._super(e,t),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue(),this.handles.css("horizontal"===t?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),n=0;n<i;n+=1)this._change(null,n);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,n,i;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(n=this.options.values.slice(),i=0;i<n.length;i+=1)n[i]=this._trimAlignValue(n[i]);return n}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=0<this.options.step?this.options.step:1,n=(e-this._valueMin())%t,i=e-n;return 2*Math.abs(n)>=t&&(i+=0<n?t:-t),parseFloat(i.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),n=this.options.step;e=Math.floor(+(e-t).toFixed(this._precision())/n)*n+t,this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return-1===n?0:t.length-n-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshValue:function(){var t,n,e,i,a,s=this.options.range,o=this.options,r=this,l=!this._animateOff&&o.animate,c={};this.options.values&&this.options.values.length?this.handles.each(function(e){n=(r.values(e)-r._valueMin())/(r._valueMax()-r._valueMin())*100,c["horizontal"===r.orientation?"left":"bottom"]=n+"%",d(this).stop(1,1)[l?"animate":"css"](c,o.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===e&&r.range.stop(1,1)[l?"animate":"css"]({left:n+"%"},o.animate),1===e&&r.range[l?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:o.animate})):(0===e&&r.range.stop(1,1)[l?"animate":"css"]({bottom:n+"%"},o.animate),1===e&&r.range[l?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:o.animate}))),t=n}):(e=this.value(),i=this._valueMin(),a=this._valueMax(),n=a!==i?(e-i)/(a-i)*100:0,c["horizontal"===this.orientation?"left":"bottom"]=n+"%",this.handle.stop(1,1)[l?"animate":"css"](c,o.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:n+"%"},o.animate),"max"===s&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-n+"%"},{queue:!1,duration:o.animate}),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:n+"%"},o.animate),"max"===s&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-n+"%"},{queue:!1,duration:o.animate}))},_handleEvents:{keydown:function(e){var t,n,i,a=d(e.target).data("ui-slider-handle-index");switch(e.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,d(e.target).addClass("ui-state-active"),!1===this._start(e,a)))return}switch(i=this.options.step,t=n=this.options.values&&this.options.values.length?this.values(a):this.value(),e.keyCode){case d.ui.keyCode.HOME:n=this._valueMin();break;case d.ui.keyCode.END:n=this._valueMax();break;case d.ui.keyCode.PAGE_UP:n=this._trimAlignValue(t+(this._valueMax()-this._valueMin())/this.numPages);break;case d.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(t-(this._valueMax()-this._valueMin())/this.numPages);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(t===this._valueMax())return;n=this._trimAlignValue(t+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(t===this._valueMin())return;n=this._trimAlignValue(t-i)}this._slide(e,a,n)},keyup:function(e){var t=d(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,t),this._change(e,t),d(e.target).removeClass("ui-state-active"))}}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(h){return h.widget("ui.sortable",h.ui.mouse,{version:"1.11.4",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,n){return t<=e&&e<t+n},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle"),h.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle")})},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle"),this._mouseDestroy();for(var e=this.items.length-1;0<=e;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,t){var n=null,i=!1,a=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),h(e.target).parents().each(function(){if(h.data(this,a.widgetName+"-item")===a)return n=h(this),!1}),h.data(e.target,a.widgetName+"-item")===a&&(n=h(e.target)),!!n&&(!(this.options.handle&&!t&&(h(this.options.handle,n).find("*").addBack().each(function(){this===e.target&&(i=!0)}),!i))&&(this.currentItem=n,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,t,n){var i,a,s=this.options;if((this.currentContainer=this).refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},h.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,s.cursorAt&&this._adjustOffsetFromHelper(s.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),s.containment&&this._setContainment(),s.cursor&&"auto"!==s.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",s.cursor),this.storedStylesheet=h("<style>*{ cursor: "+s.cursor+" !important; }</style>").appendTo(a)),s.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",s.opacity)),s.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",s.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(i=this.containers.length-1;0<=i;i--)this.containers[i]._trigger("activate",e,this._uiHash(this));return h.ui.ddmanager&&(h.ui.ddmanager.current=this),h.ui.ddmanager&&!s.dropBehaviour&&h.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var t,n,i,a,s=this.options,o=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<s.scrollSensitivity?this.scrollParent[0].scrollTop=o=this.scrollParent[0].scrollTop+s.scrollSpeed:e.pageY-this.overflowOffset.top<s.scrollSensitivity&&(this.scrollParent[0].scrollTop=o=this.scrollParent[0].scrollTop-s.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<s.scrollSensitivity?this.scrollParent[0].scrollLeft=o=this.scrollParent[0].scrollLeft+s.scrollSpeed:e.pageX-this.overflowOffset.left<s.scrollSensitivity&&(this.scrollParent[0].scrollLeft=o=this.scrollParent[0].scrollLeft-s.scrollSpeed)):(e.pageY-this.document.scrollTop()<s.scrollSensitivity?o=this.document.scrollTop(this.document.scrollTop()-s.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<s.scrollSensitivity&&(o=this.document.scrollTop(this.document.scrollTop()+s.scrollSpeed)),e.pageX-this.document.scrollLeft()<s.scrollSensitivity?o=this.document.scrollLeft(this.document.scrollLeft()-s.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<s.scrollSensitivity&&(o=this.document.scrollLeft(this.document.scrollLeft()+s.scrollSpeed))),!1!==o&&h.ui.ddmanager&&!s.dropBehaviour&&h.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t=this.items.length-1;0<=t;t--)if(i=(n=this.items[t]).item[0],(a=this._intersectsWithPointer(n))&&n.instance===this.currentContainer&&!(i===this.currentItem[0]||this.placeholder[1===a?"next":"prev"]()[0]===i||h.contains(this.placeholder[0],i)||"semi-dynamic"===this.options.type&&h.contains(this.element[0],i))){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(e,n),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),h.ui.ddmanager&&h.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,t){if(e){if(h.ui.ddmanager&&!this.options.dropBehaviour&&h.ui.ddmanager.drop(this,e),this.options.revert){var n=this,i=this.placeholder.offset(),a=this.options.axis,s={};a&&"x"!==a||(s.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(s.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,h(this.helper).animate(s,parseInt(this.options.revert,10)||500,function(){n._clear(e)})}else this._clear(e,t);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;0<=e;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),h.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?h(this.domPosition.prev).after(this.currentItem):h(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var e=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},h(e).each(function(){var e=(h(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);e&&n.push((t.key||e[1]+"[]")+"="+(t.key&&t.expression?e[1]:e[2]))}),!n.length&&t.key&&n.push(t.key+"="),n.join("&")},toArray:function(e){var t=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t.each(function(){n.push(h(e.item||this).attr(e.attribute||"id")||"")}),n},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,i=this.positionAbs.top,a=i+this.helperProportions.height,s=e.left,o=s+e.width,r=e.top,l=r+e.height,c=this.offset.click.top,d=this.offset.click.left,u="x"===this.options.axis||r<i+c&&i+c<l,_="y"===this.options.axis||s<t+d&&t+d<o,h=u&&_;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?h:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&r<i+this.helperProportions.height/2&&a-this.helperProportions.height/2<l},_intersectsWithPointer:function(e){var t="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),i=t&&n,a=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return!!i&&(this.floating?s&&"right"===s||"down"===a?2:1:a&&("down"===a?2:1))},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),i=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&n||"left"===a&&!n:i&&("down"===i&&t||"up"===i&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(0<e?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(0<e?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(e){function t(){o.push(this)}var n,i,a,s,o=[],r=[],l=this._connectWith();if(l&&e)for(n=l.length-1;0<=n;n--)for(i=(a=h(l[n],this.document[0])).length-1;0<=i;i--)(s=h.data(a[i],this.widgetFullName))&&s!==this&&!s.options.disabled&&r.push([h.isFunction(s.options.items)?s.options.items.call(s.element):h(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s]);for(r.push([h.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):h(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=r.length-1;0<=n;n--)r[n][0].each(t);return h(o)},_removeCurrentsFromItems:function(){var n=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=h.grep(this.items,function(e){for(var t=0;t<n.length;t++)if(n[t]===e.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var t,n,i,a,s,o,r,l,c=this.items,d=[[h.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):h(this.options.items,this.element),this]],u=this._connectWith();if(u&&this.ready)for(t=u.length-1;0<=t;t--)for(n=(i=h(u[t],this.document[0])).length-1;0<=n;n--)(a=h.data(i[n],this.widgetFullName))&&a!==this&&!a.options.disabled&&(d.push([h.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):h(a.options.items,a.element),a]),this.containers.push(a));for(t=d.length-1;0<=t;t--)for(s=d[t][1],n=0,l=(o=d[t][0]).length;n<l;n++)(r=h(o[n])).data(this.widgetName+"-item",s),c.push({item:r,instance:s,width:0,height:0,left:0,top:0})},refreshPositions:function(e){var t,n,i,a;for(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),t=this.items.length-1;0<=t;t--)(n=this.items[t]).instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?h(this.options.toleranceElement,n.item):n.item,e||(n.width=i.outerWidth(),n.height=i.outerHeight()),a=i.offset(),n.left=a.left,n.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(t=this.containers.length-1;0<=t;t--)a=this.containers[t].element.offset(),this.containers[t].containerCache.left=a.left,this.containers[t].containerCache.top=a.top,this.containers[t].containerCache.width=this.containers[t].element.outerWidth(),this.containers[t].containerCache.height=this.containers[t].element.outerHeight();return this},_createPlaceholder:function(n){var i,a=(n=n||this).options;a.placeholder&&a.placeholder.constructor!==String||(i=a.placeholder,a.placeholder={element:function(){var e=n.currentItem[0].nodeName.toLowerCase(),t=h("<"+e+">",n.document[0]).addClass(i||n.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===e?n._createTrPlaceholder(n.currentItem.find("tr").eq(0),h("<tr>",n.document[0]).appendTo(t)):"tr"===e?n._createTrPlaceholder(n.currentItem,t):"img"===e&&t.attr("src",n.currentItem.attr("src")),i||t.css("visibility","hidden"),t},update:function(e,t){i&&!a.forcePlaceholderSize||(t.height()||t.height(n.currentItem.innerHeight()-parseInt(n.currentItem.css("paddingTop")||0,10)-parseInt(n.currentItem.css("paddingBottom")||0,10)),t.width()||t.width(n.currentItem.innerWidth()-parseInt(n.currentItem.css("paddingLeft")||0,10)-parseInt(n.currentItem.css("paddingRight")||0,10)))}}),n.placeholder=h(a.placeholder.element.call(n.element,n.currentItem)),n.currentItem.after(n.placeholder),a.placeholder.update(n,n.placeholder)},_createTrPlaceholder:function(e,t){var n=this;e.children().each(function(){h("<td>&#160;</td>",n.document[0]).attr("colspan",h(this).attr("colspan")||1).appendTo(t)})},_contactContainers:function(e){var t,n,i,a,s,o,r,l,c,d,u=null,_=null;for(t=this.containers.length-1;0<=t;t--)if(!h.contains(this.currentItem[0],this.containers[t].element[0]))if(this._intersectsWith(this.containers[t].containerCache)){if(u&&h.contains(this.containers[t].element[0],u.element[0]))continue;u=this.containers[t],_=t}else this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",e,this._uiHash(this)),this.containers[t].containerCache.over=0);if(u)if(1===this.containers.length)this.containers[_].containerCache.over||(this.containers[_]._trigger("over",e,this._uiHash(this)),this.containers[_].containerCache.over=1);else{for(i=1e4,a=null,s=(c=u.floating||this._isFloating(this.currentItem))?"left":"top",o=c?"width":"height",d=c?"clientX":"clientY",n=this.items.length-1;0<=n;n--)h.contains(this.containers[_].element[0],this.items[n].item[0])&&this.items[n].item[0]!==this.currentItem[0]&&(r=this.items[n].item.offset()[s],l=!1,e[d]-r>this.items[n][o]/2&&(l=!0),Math.abs(e[d]-r)<i&&(i=Math.abs(e[d]-r),a=this.items[n],this.direction=l?"up":"down"));if(!a&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[_])return void(this.currentContainer.containerCache.over||(this.containers[_]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));a?this._rearrange(e,a,null,!0):this._rearrange(e,null,this.containers[_].element,!0),this._trigger("change",e,this._uiHash()),this.containers[_]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[_],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[_]._trigger("over",e,this._uiHash(this)),this.containers[_].containerCache.over=1}},_createHelper:function(e){var t=this.options,n=h.isFunction(t.helper)?h(t.helper.apply(this.element[0],[e,this.currentItem])):"clone"===t.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||h("parent"!==t.appendTo?t.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),n[0].style.width&&!t.forceHelperSize||n.width(this.currentItem.width()),n[0].style.height&&!t.forceHelperSize||n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),h.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&h.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&h.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,t,n,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(e=h(i.containment)[0],t=h(i.containment).offset(),n="hidden"!==h(e).css("overflow"),this.containment=[t.left+(parseInt(h(e).css("borderLeftWidth"),10)||0)+(parseInt(h(e).css("paddingLeft"),10)||0)-this.margins.left,t.top+(parseInt(h(e).css("borderTopWidth"),10)||0)+(parseInt(h(e).css("paddingTop"),10)||0)-this.margins.top,t.left+(n?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(h(e).css("borderLeftWidth"),10)||0)-(parseInt(h(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,t.top+(n?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(h(e).css("borderTopWidth"),10)||0)-(parseInt(h(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&h.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(i[0].tagName);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:i.scrollTop())*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:i.scrollLeft())*n}},_generatePosition:function(e){var t,n,i=this.options,a=e.pageX,s=e.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&h.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),i.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/i.grid[1])*i.grid[1],s=this.containment?t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-i.grid[1]:t+i.grid[1]:t,n=this.originalPageX+Math.round((a-this.originalPageX)/i.grid[0])*i.grid[0],a=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-i.grid[0]:n+i.grid[0]:n)),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(e,t,n,i){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var a=this.counter;this._delay(function(){a===this.counter&&this.refreshPositions(!i)})},_clear:function(e,t){function n(t,n,i){return function(e){i._trigger(t,e,n._uiHash(n))}}this.reverting=!1;var i,a=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&a.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||a.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(a.push(function(e){this._trigger("remove",e,this._uiHash())}),a.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),a.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)t||a.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(a.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(i=0;i<a.length;i++)a[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,
!this.cancelHelperRemoval},_trigger:function(){!1===h.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var t=e||this;return{helper:t.helper,placeholder:t.placeholder||h([]),position:t.position,originalPosition:t.originalPosition,offset:t.positionAbs,item:t.currentItem,sender:e?e.element:null}}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./button"],e):e(jQuery)}(function(s){function t(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}return s.widget("ui.spinner",{version:"1.11.4",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var i={},a=this.element;return s.each(["min","max","step"],function(e,t){var n=a.attr(t);n!==undefined&&n.length&&(i[t]=n)}),i},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e))},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((0<t?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(e){function t(){this.element[0]===this.document[0].activeElement||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),t.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,t.call(this)}),!1!==this._start(e)&&this._repeat(null,s(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(s(e.currentTarget).hasClass("ui-state-active"))return!1!==this._start(e)&&void this._repeat(null,s(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&0<e.height()&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(e){var t=this.options,n=s.ui.keyCode;switch(e.keyCode){case n.UP:return this._repeat(null,1,e),!0;case n.DOWN:return this._repeat(null,-1,e),!0;case n.PAGE_UP:return this._repeat(null,t.page,e),!0;case n.PAGE_DOWN:return this._repeat(null,-t.page,e),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>&#9650;</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>&#9660;</span></a>"},_start:function(e){return!(!this.spinning&&!1===this._trigger("start",e))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",t,{value:n})||(this._value(n),this.counter++)},_increment:function(e){var t=this.options.incremental;return t?s.isFunction(t)?t(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),n=t.indexOf(".");return-1===n?0:t.length-n-1},_adjustValue:function(e){var t,n,i=this.options;return n=e-(t=null!==i.min?i.min:0),e=t+(n=Math.round(n/i.step)*i.step),e=parseFloat(e.toFixed(this._precision())),null!==i.max&&e>i.max?i.max:null!==i.min&&e<i.min?i.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var n=this._parse(this.element.val());return this.options[e]=t,void this.element.val(this._format(n))}"max"!==e&&"min"!==e&&"step"!==e||"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(this.widget().toggleClass("ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable"))},_setOptions:t(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null!==e&&e===this._adjustValue(e)},_value:function(e,t){var n;""!==e&&null!==(n=this._parse(e))&&(t||(n=this._adjustValue(n)),e=this._format(n)),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],e):e(jQuery)}(function(c){return c.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(a=/#.*$/,function(e){var t,n;t=(e=e.cloneNode(!1)).href.replace(a,""),n=location.href.replace(a,"");try{t=decodeURIComponent(t)}catch(i){}try{n=decodeURIComponent(n)}catch(i){}return 1<e.hash.length&&t===n}),_create:function(){var t=this,e=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",e.collapsible),this._processTabs(),e.active=this._initialActive(),c.isArray(e.disabled)&&(e.disabled=c.unique(e.disabled.concat(c.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(e.active):this.active=c(),this._refresh(),this.active.length&&this.load(e.active)},_initialActive:function(){var n=this.options.active,e=this.options.collapsible,i=location.hash.substring(1);return null===n&&(i&&this.tabs.each(function(e,t){if(c(t).attr("aria-controls")===i)return n=e,!1}),null===n&&(n=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==n&&-1!==n||(n=!!this.tabs.length&&0)),!1!==n&&-1===(n=this.tabs.index(this.tabs.eq(n)))&&(n=!e&&0),!e&&!1===n&&this.anchors.length&&(n=0),n},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):c()}},_tabKeydown:function(e){var t=c(this.document[0].activeElement).closest("li"),n=this.tabs.index(t),i=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case c.ui.keyCode.RIGHT:case c.ui.keyCode.DOWN:n++;break;case c.ui.keyCode.UP:case c.ui.keyCode.LEFT:i=!1,n--;break;case c.ui.keyCode.END:n=this.anchors.length-1;break;case c.ui.keyCode.HOME:n=0;break;case c.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(n);case c.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(n!==this.options.active&&n);default:return}e.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,i),e.ctrlKey||e.metaKey||(t.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===c.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(e){return e.altKey&&e.keyCode===c.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===c.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,t){function n(){return i<e&&(e=0),e<0&&(e=i),e}for(var i=this.tabs.length-1;-1!==c.inArray(n(),this.options.disabled);)e=t?e+1:e-1;return e},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){"active"!==e?"disabled"!==e?(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||!1!==this.options.active||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t)):this._setupDisabled(t):this._activate(t)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,t=this.tablist.children(":has(a[href])");e.disabled=c.map(t.filter(".ui-state-disabled"),function(e){return t.index(e)}),this._processTabs(),!1!==e.active&&this.anchors.length?this.active.length&&!c.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=c()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=c()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var l=this,e=this.tabs,t=this.anchors,n=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(e){c(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){c(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return c("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=c(),this.anchors.each(function(e,t){var n,i,a,s=c(t).uniqueId().attr("id"),o=c(t).closest("li"),r=o.attr("aria-controls");l._isLocal(t)?(a=(n=t.hash).substring(1),i=l.element.find(l._sanitizeSelector(n))):(n="#"+(a=o.attr("aria-controls")||c({}).uniqueId()[0].id),(i=l.element.find(n)).length||(i=l._createPanel(a)).insertAfter(l.panels[e-1]||l.tablist),i.attr("aria-live","polite")),i.length&&(l.panels=l.panels.add(i)),r&&o.data("ui-tabs-aria-controls",r),o.attr({"aria-controls":a,"aria-labelledby":s}),i.attr("aria-labelledby",s)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),e&&(this._off(e.not(this.tabs)),this._off(t.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return c("<div>").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){c.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var t,n=0;t=this.tabs[n];n++)!0===e||-1!==c.inArray(n,e)?c(t).addClass("ui-state-disabled").attr("aria-disabled","true"):c(t).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var n={};e&&c.each(e.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var n,t=this.element.parent();"fill"===e?(n=t.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=c(this),t=e.css("position");"absolute"!==t&&"fixed"!==t&&(n-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){n-=c(this).outerHeight(!0)}),this.panels.each(function(){c(this).height(Math.max(0,n-c(this).innerHeight()+c(this).height()))}).css("overflow","auto")):"auto"===e&&(n=0,this.panels.each(function(){n=Math.max(n,c(this).height("").height())}).height(n))},_eventHandler:function(e){var t=this.options,n=this.active,i=c(e.currentTarget).closest("li"),a=i[0]===n[0],s=a&&t.collapsible,o=s?c():this._getPanelForTab(i),r=n.length?this._getPanelForTab(n):c(),l={oldTab:n,oldPanel:r,newTab:s?c():i,newPanel:o};e.preventDefault(),i.hasClass("ui-state-disabled")||i.hasClass("ui-tabs-loading")||this.running||a&&!t.collapsible||!1===this._trigger("beforeActivate",e,l)||(t.active=!s&&this.tabs.index(i),this.active=a?c():i,this.xhr&&this.xhr.abort(),r.length||o.length||c.error("jQuery UI Tabs: Mismatching fragment identifier."),o.length&&this.load(this.tabs.index(i),e),this._toggle(e,l))},_toggle:function(e,t){function n(){a.running=!1,a._trigger("activate",e,t)}function i(){t.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),s.length&&a.options.show?a._show(s,a.options.show,n):(s.show(),n())}var a=this,s=t.newPanel,o=t.oldPanel;this.running=!0,o.length&&this.options.hide?this._hide(o,this.options.hide,function(){t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),i()}):(t.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),o.hide(),i()),o.attr("aria-hidden","true"),t.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&o.length?t.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===c(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),t.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var t,n=this._findActive(e);n[0]!==this.active[0]&&(n.length||(n=this.active),t=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:c.noop}))},_findActive:function(e){return!1===e?c():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){c.data(this,"ui-tabs-destroy")?c(this).remove():c(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=c(this),t=e.data("ui-tabs-aria-controls");t?e.attr("aria-controls",t).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(n){var e=this.options.disabled;!1!==e&&(n===undefined?e=!1:(n=this._getIndex(n),e=c.isArray(e)?c.map(e,function(e){return e!==n?e:null}):c.map(this.tabs,function(e,t){return t!==n?t:null})),this._setupDisabled(e))},disable:function(e){var t=this.options.disabled;if(!0!==t){if(e===undefined)t=!0;else{if(e=this._getIndex(e),-1!==c.inArray(e,t))return;t=c.isArray(t)?c.merge([e],t).sort():[e]}this._setupDisabled(t)}},load:function(e,i){e=this._getIndex(e);var a=this,n=this.tabs.eq(e),t=n.find(".ui-tabs-anchor"),s=this._getPanelForTab(n),o={tab:n,panel:s},r=function(e,t){"abort"===t&&a.panels.stop(!1,!0),n.removeClass("ui-tabs-loading"),s.removeAttr("aria-busy"),e===a.xhr&&delete a.xhr};this._isLocal(t[0])||(this.xhr=c.ajax(this._ajaxSettings(t,i,o)),this.xhr&&"canceled"!==this.xhr.statusText&&(n.addClass("ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.done(function(e,t,n){setTimeout(function(){s.html(e),a._trigger("load",i,o),r(n,t)},1)}).fail(function(e,t){setTimeout(function(){r(e,t)},1)})))},_ajaxSettings:function(e,n,i){var a=this;return{url:e.attr("href"),beforeSend:function(e,t){return a._trigger("beforeLoad",n,c.extend({jqXHR:e,ajaxSettings:t},i))}}},_getPanelForTab:function(e){var t=c(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}});var a}),function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./position"],e):e(jQuery)}(function(c){return c.widget("ui.tooltip",{version:"1.11.4",options:{content:function(){var e=c(this).attr("title")||"";return c("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_addDescribedBy:function(e,t){var n=(e.attr("aria-describedby")||"").split(/\s+/);n.push(t),e.data("ui-tooltip-id",t).attr("aria-describedby",c.trim(n.join(" ")))},_removeDescribedBy:function(e){var t=e.data("ui-tooltip-id"),n=(e.attr("aria-describedby")||"").split(/\s+/),i=c.inArray(t,n);-1!==i&&n.splice(i,1),e.removeData("ui-tooltip-id"),(n=c.trim(n.join(" ")))?e.attr("aria-describedby",n):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable(),this.liveRegion=c("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body)},_setOption:function(e,t){var n=this;if("disabled"===e)return this[t?"_disable":"_enable"](),void(this.options[e]=t);this._super(e,t),"content"===e&&c.each(this.tooltips,function(e,t){n._updateContent(t.element)})},_disable:function(){var i=this;c.each(this.tooltips,function(e,t){var n=c.Event("blur");n.target=n.currentTarget=t.element[0],i.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=c(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).removeAttr("title")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=c(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var n=this,t=c(e?e.target:this.element).closest(this.options.items);t.length&&!t.data("ui-tooltip-id")&&(t.attr("title")&&t.data("ui-tooltip-title",t.attr("title")),t.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&t.parents().each(function(){var e,t=c(this);t.data("ui-tooltip-open")&&((e=c.Event("blur")).target=e.currentTarget=this,n.close(e,!0)),t.attr("title")&&(t.uniqueId(),n.parents[this.id]={element:this,title:t.attr("title")},t.attr("title",""))}),this._registerCloseHandlers(e,t),this._updateContent(t,e))},_updateContent:function(t,n){var e,i=this.options.content,a=this,s=n?n.type:null;if("string"==typeof i)return this._open(n,t,i);(e=i.call(t[0],function(e){a._delay(function(){t.data("ui-tooltip-open")&&(n&&(n.type=s),this._open(n,t,e))})}))&&this._open(n,t,e)},_open:function(e,t,n){function i(e){l.of=e,s.is(":hidden")||s.position(l)}var a,s,o,r,l=c.extend({},this.options.position);n&&((a=this._find(t))?a.tooltip.find(".ui-tooltip-content").html(n):(t.is("[title]")&&(e&&"mouseover"===e.type?t.attr("title",""):t.removeAttr("title")),a=this._tooltip(t),s=a.tooltip,this._addDescribedBy(t,s.attr("id")),s.find(".ui-tooltip-content").html(n),this.liveRegion.children().hide(),n.clone?(r=n.clone()).removeAttr("id").find("[id]").removeAttr("id"):r=n,c("<div>").html(r).appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:i}),i(e)):s.position(c.extend({of:t},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){s.is(":visible")&&(i(l.of),clearInterval(o))},c.fx.interval)),this._trigger("open",e,{tooltip:s})))},_registerCloseHandlers:function(e,n){var t={keyup:function(e){if(e.keyCode===c.ui.keyCode.ESCAPE){var t=c.Event(e);t.currentTarget=n[0],this.close(t,!0)}}};n[0]!==this.element[0]&&(t.remove=function(){this._removeTooltip(this._find(n).tooltip)}),e&&"mouseover"!==e.type||(t.mouseleave="close"),e&&"focusin"!==e.type||(t.focusout="close"),this._on(!0,n,t)},close:function(e){var t,n=this,i=c(e?e.currentTarget:this.element),a=this._find(i);a?(t=a.tooltip,a.closing||(clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&!i.attr("title")&&i.attr("title",i.data("ui-tooltip-title")),this._removeDescribedBy(i),a.hiding=!0,t.stop(!0),this._hide(t,this.options.hide,function(){n._removeTooltip(c(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&c.each(this.parents,function(e,t){c(t.element).attr("title",t.title),delete n.parents[e]}),a.closing=!0,this._trigger("close",e,{tooltip:t}),a.hiding||(a.closing=!1))):i.removeData("ui-tooltip-open")},_tooltip:function(e){var t=c("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||"")),n=t.uniqueId().attr("id");return c("<div>").addClass("ui-tooltip-content").appendTo(t),t.appendTo(this.document[0].body),this.tooltips[n]={element:e,tooltip:t}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var a=this;c.each(this.tooltips,function(e,t){var n=c.Event("blur"),i=t.element;n.target=n.currentTarget=i[0],a.close(n,!0),c("#"+e).remove(),i.data("ui-tooltip-title")&&(i.attr("title")||i.attr("title",i.data("ui-tooltip-title")),i.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}})}),function(d){"use strict";d.ajaxPrefilter(function(e){if(e.iframe)return e.originalURL=e.url,"iframe"}),d.ajaxTransport("iframe",function(e,t,l){function c(){s.each(function(e,t){var n=d(t);n.data("clone").replaceWith(n)}),n.remove(),i.one("load",function(){i.remove()}),i.attr("src","about:blank")}var n=null,i=null,a="iframe-"+d.now(),s=d(e.files).filter(":file:enabled"),o=null;if(e.dataTypes.shift(),e.data=t.data,s.length)return n=d("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:e.originalURL,target:a}),"string"==typeof e.data&&0<e.data.length&&d.error("data must not be serialized"),d.each(e.data||{},function(e,t){d.isPlainObject(t)&&(e=t.name,t=t.value),d("<input type='hidden' />").attr({name:e,value:t}).appendTo(n)}),d("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(n),o=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", */*; q=0.01":""):e.accepts["*"],d("<input type='hidden' name='X-HTTP-Accept'>").attr("value",o).appendTo(n),s.after(function(){var e=d(this),t=e.clone().prop("disabled",!0);return e.data("clone",t),t}).next(),s.appendTo(n),{send:function(e,r){(i=d("<iframe src='about:blank' name='"+a+"' id='"+a+"' style='display:none'></iframe>")).one("load",function(){i.one("load",function(){var e=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,t=e.documentElement?e.documentElement:e.body,n=t.getElementsByTagName("textarea")[0],i=n&&n.getAttribute("data-type")||null,a=n&&n.getAttribute("data-status")||200,s=n&&n.getAttribute("data-statusText")||"OK",o={text:i?n.value:t?t.textContent||t.innerText:null};c(),l.responseText||(l.responseText=o.text),r(a,s,o,i?"Content-Type: "+i:null)}),n[0].submit()}),d("body").append(n,i)},abort:function(){null!==i&&(i.unbind("load").attr("src","about:blank"),c())}}})}(jQuery),function(l){var c;l.remotipart=c={setup:function(n){var a=n.data("ujs:submit-button"),s=l('meta[name="csrf-param"]').attr("content"),o=l('meta[name="csrf-token"]').attr("content"),r=n.find('input[name="'+s+'"]').length;n.one("ajax:beforeSend.remotipart",function(e,t,i){return delete i.beforeSend,i.iframe=!0,i.files=l(l.rails.fileInputSelector,n),i.data=n.serializeArray(),a&&i.data.push(a),i.files.each(function(e,t){for(var n=i.data.length-1;0<=n;n--)i.data[n].name==t.name&&i.data.splice(n,1)}),i.processData=!1,i.dataType===undefined&&(i.dataType="script *"),i.data.push({name:"remotipart_submitted",value:!0}),o&&s&&!r&&i.data.push({name:s,value:o}),l.rails.fire(n,"ajax:remotipartSubmit",[t,i])&&(l.rails.ajax(i).always(function(e){l.rails.fire(n,"ajax:remotipartComplete",[e])}),setTimeout(function(){l.rails.disableFormElements(n)},20)),c.teardown(n),!1}).data("remotipartSubmitted",!0)},teardown:function(e){e.unbind("ajax:beforeSend.remotipart").removeData("remotipartSubmitted")}},l(document).on("ajax:aborted:file","form",function(){var e=l(this);return c.setup(e),l.rails.handleRemote(e),!1})}(jQuery),function(u){window.NestedFormEvents=function(){this.addFields=u.proxy(this.addFields,this),this.removeFields=u.proxy(this.removeFields,this)},NestedFormEvents.prototype={addFields:function(e){var t=e.currentTarget,n=u(t).data("association"),i=u("#"+u(t).data("blueprint-id")).data("blueprint"),a=(u(t).closest(".fields").closestChild("input, textarea, select").eq(0).attr("name")||"").replace(new RegExp("[[a-z_]+]$"),"");if(a)for(var s=a.match(/[a-z_]+_attributes(?=\]\[(new_)?\d+\])/g)||[],o=a.match(/[0-9]+/g)||[],r=0;r<s.length;r++)o[r]&&(i=(i=i.replace(new RegExp("(_"+s[r]+")_.+?_","g"),"$1_"+o[r]+"_")).replace(new RegExp("(\\["+s[r]+"\\])\\[.+?\\]","g"),"$1["+o[r]+"]"));var l=new RegExp("new_"+n,"g"),c=this.newId();i=u.trim(i.replace(l,c));var d=this.insertFields(i,n,t);return d.trigger({type:"nested:fieldAdded",field:d}).trigger({type:"nested:fieldAdded:"+n,field:d}),!1},newId:function(){return(new Date).getTime()},insertFields:function(e,t,n){var i=u(n).data("target");return i?u(e).appendTo(u(i)):u(e).insertBefore(n)},removeFields:function(e){var t=u(e.currentTarget),n=t.data("association");t.prev("input[type=hidden]").val("1");var i=t.closest(".fields");return i.hide(),i.trigger({type:"nested:fieldRemoved",field:i}).trigger({type:"nested:fieldRemoved:"+n,field:i}),!1}},window.nestedFormEvents=new NestedFormEvents,u(document).delegate("form a.add_nested_fields","click",nestedFormEvents.addFields).delegate("form a.remove_nested_fields","click",nestedFormEvents.removeFields)}(jQuery),function(s){s.fn.closestChild=function(e){if(e&&""!=e){var t=[];for(t.push(this);0<t.length;)for(var n=t.shift().children(),i=0;i<n.length;++i){var a=s(n[i]);if(a.is(e))return a;t.push(a)}}return s()}}(jQuery),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(window.jQuery)}(function(_){"use strict";function t(e){var t={};if(e.selectionStart===undefined){e.focus();var n=document.selection.createRange();t.length=n.text.length,n.moveStart("character",-e.value.length),t.end=n.text.length,t.start=t.end-t.length}else t.start=e.selectionStart,t.end=e.selectionEnd,t.length=t.end-t.start;return t}function r(e,t,n){if(e.selectionStart===undefined){e.focus();var i=e.createTextRange();i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i.select()}else e.selectionStart=t,e.selectionEnd=n}function l(n,i){_.each(i,function(e,t){"function"==typeof t?i[e]=t(n,i,e):"function"==typeof n.autoNumeric[t]&&(i[e]=n.autoNumeric[t](n,i,e))})}function m(e,t){"string"==typeof e[t]&&(e[t]*=1)}function n(e,t){l(e,t),t.tagList=["b","caption","cite","code","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","ins","kdb","label","li","output","p","q","s","sample","span","strong","td","th","u","var"];var n=t.vMax.toString().split("."),i=t.vMin||0===t.vMin?t.vMin.toString().split("."):[];if(m(t,"vMax"),m(t,"vMin"),m(t,"mDec"),t.mDec="CHF"===t.mRound?"2":t.mDec,t.allowLeading=!0,t.aNeg=t.vMin<0?"-":"",n[0]=n[0].replace("-",""),i[0]=i[0].replace("-",""),t.mInt=Math.max(n[0].length,i[0].length,1),null===t.mDec){var a=0,s=0;n[1]&&(a=n[1].length),i[1]&&(s=i[1].length),t.mDec=Math.max(a,s)}null===t.altDec&&0<t.mDec&&("."===t.aDec&&","!==t.aSep?t.altDec=",":","===t.aDec&&"."!==t.aSep&&(t.altDec="."));var o=t.aNeg?"([-\\"+t.aNeg+"]?)":"(-?)";t.aNegRegAutoStrip=o,t.skipFirstAutoStrip=new RegExp(o+"[^-"+(t.aNeg?"\\"+t.aNeg:"")+"\\"+t.aDec+"\\d].*?(\\d|\\"+t.aDec+"\\d)"),t.skipLastAutoStrip=new RegExp("(\\d\\"+t.aDec+"?)[^\\"+t.aDec+"\\d]\\D*$");var r="-"+t.aNum+"\\"+t.aDec;return t.allowedAutoStrip=new RegExp("[^"+r+"]","gi"),t.numRegAutoStrip=new RegExp(o+"(?:\\"+t.aDec+"?(\\d+\\"+t.aDec+"\\d+)|(\\d*(?:\\"+t.aDec+"\\d*)?))"),t}function c(e,t,n){if(t.aSign)for(;-1<e.indexOf(t.aSign);)e=e.replace(t.aSign,"");e=(e=(e=e.replace(t.skipFirstAutoStrip,"$1$2")).replace(t.skipLastAutoStrip,"$1")).replace(t.allowedAutoStrip,""),t.altDec&&(e=e.replace(t.altDec,t.aDec));var i=e.match(t.numRegAutoStrip);if(e=i?[i[1],i[2],i[3]].join(""):"",("allow"===t.lZero||"keep"===t.lZero)&&"strip"!==n){var a=[],s="";-1!==(a=e.split(t.aDec))[0].indexOf("-")&&(s="-",a[0]=a[0].replace("-","")),a[0].length>t.mInt&&"0"===a[0].charAt(0)&&(a[0]=a[0].slice(1)),e=s+a.join(t.aDec)}if(n&&"deny"===t.lZero||n&&"allow"===t.lZero&&!1===t.allowLeading){var o="^"+t.aNegRegAutoStrip+"0*(\\d"+("leading"===n?")":"|$)");o=new RegExp(o),e=e.replace(o,"$1$2")}return e}function d(e,t){if("p"===t.pSign){var n=t.nBracket.split(",");t.hasFocus||t.removeBrackets?(t.hasFocus&&e.charAt(0)===n[0]||t.removeBrackets&&e.charAt(0)===n[0])&&(e=(e=e.replace(n[0],t.aNeg)).replace(n[1],"")):(e=e.replace(t.aNeg,""),e=n[0]+e+n[1])}return e}function o(e,t){if(e){var n=+e;if(n<1e-6&&-1<n)(e=+e)<1e-6&&0<e&&(e=(e=(e+10).toString()).substring(1)),e<0&&-1<e&&(e="-"+(e=(e-10).toString()).substring(2)),e=e.toString();else{var i=e.split(".");i[1]!==undefined&&(0==+i[1]?e=i[0]:(i[1]=i[1].replace(/0*$/,""),e=i.join(".")))}}return"keep"===t.lZero?e:e.replace(/^0*(\d)/,"$1")}function u(e,t,n){return t&&"."!==t&&(e=e.replace(t,".")),n&&"-"!==n&&(e=e.replace(n,"-")),e.match(/\d/)||(e+="0"),e}function h(e,t,n){return n&&"-"!==n&&(e=e.replace("-",n)),t&&"."!==t&&(e=e.replace(".",t)),e}function p(e
,t,n){return""===e||e===t.aNeg?"zero"===t.wEmpty?e+"0":"sign"===t.wEmpty||n?e+t.aSign:e:null}function f(e,t){var n=(e=c(e,t)).replace(",","."),i=p(e,t,!0);if(null!==i)return i;var a="";a=2===t.dGroup?/(\d)((\d)(\d{2}?)+)$/:4===t.dGroup?/(\d)((\d{4}?)+)$/:/(\d)((\d{3}?)+)$/;var s=e.split(t.aDec);t.altDec&&1===s.length&&(s=e.split(t.altDec));var o=s[0];if(t.aSep)for(;a.test(o);)o=o.replace(a,"$1"+t.aSep+"$2");if(0!==t.mDec&&1<s.length?(s[1].length>t.mDec&&(s[1]=s[1].substring(0,t.mDec)),e=o+t.aDec+s[1]):e=o,t.aSign){var r=-1!==e.indexOf(t.aNeg);e=e.replace(t.aNeg,""),e="p"===t.pSign?t.aSign+e:e+t.aSign,r&&(e=t.aNeg+e)}return n<0&&null!==t.nBracket&&(e=d(e,t)),e}function g(e,t){e=""===e?"0":e.toString(),m(t,"mDec"),"CHF"===t.mRound&&(e=(Math.round(20*e)/20).toString());var n="",i=0,a="",s="boolean"==typeof t.aPad||null===t.aPad?t.aPad?t.mDec:0:+t.aPad,o=function(e){var t=0===s?/(\.(?:\d*[1-9])?)0*$/:1===s?/(\.\d(?:\d*[1-9])?)0*$/:new RegExp("(\\.\\d{"+s+"}(?:\\d*[1-9])?)0*$");return e=e.replace(t,"$1"),0===s&&(e=e.replace(/\.$/,"")),e};"-"===e.charAt(0)&&(a="-",e=e.replace("-","")),e.match(/^\d/)||(e="0"+e),"-"===a&&0==+e&&(a=""),(0<+e&&"keep"!==t.lZero||0<e.length&&"allow"===t.lZero)&&(e=e.replace(/^0*(\d)/,"$1"));var r=e.lastIndexOf("."),l=-1===r?e.length-1:r,c=e.length-1-l;if(c<=t.mDec){if(n=e,c<s){-1===r&&(n+=t.aDec);for(var d="000000";c<s;)n+=d=d.substring(0,s-c),c+=d.length}else s<c?n=o(n):0===c&&0===s&&(n=n.replace(/\.$/,""));if("CHF"!==t.mRound)return 0==+n?n:a+n;"CHF"===t.mRound&&(r=n.lastIndexOf("."),e=n)}var u=r+t.mDec,_=+e.charAt(u+1),h=e.substring(0,u+1).split(""),p="."===e.charAt(u)?e.charAt(u-1)%2:e.charAt(u)%2,f=!0;if(1!==p&&(p=0===p&&0<e.substring(u+2,e.length)?1:0),4<_&&"S"===t.mRound||4<_&&"A"===t.mRound&&""===a||5<_&&"A"===t.mRound&&"-"===a||5<_&&"s"===t.mRound||5<_&&"a"===t.mRound&&""===a||4<_&&"a"===t.mRound&&"-"===a||5<_&&"B"===t.mRound||5===_&&"B"===t.mRound&&1===p||0<_&&"C"===t.mRound&&""===a||0<_&&"F"===t.mRound&&"-"===a||0<_&&"U"===t.mRound||"CHF"===t.mRound)for(i=h.length-1;0<=i;i-=1)if("."!==h[i]){if("CHF"===t.mRound&&h[i]<=2&&f){h[i]=0,f=!1;break}if("CHF"===t.mRound&&h[i]<=7&&f){f=!(h[i]=5);break}if("CHF"===t.mRound&&f?f=!(h[i]=10):h[i]=+h[i]+1,h[i]<10)break;0<i&&(h[i]="0")}return 0==+(n=o((h=h.slice(0,u+1)).join("")))?n:a+n}function A(e,t,n){var i=t.aDec,a=t.mDec;if(e="paste"===n?g(e,t):e,i&&a){var s=e.split(i);s[1]&&s[1].length>a&&(0<a?(s[1]=s[1].substring(0,a),e=s.join(i)):e=s[0])}return e}function v(e,t){var n=+(e=u(e=A(e=c(e,t),t),t.aDec,t.aNeg));return n>=t.vMin&&n<=t.vMax}function s(e,t){this.settings=t,this.that=e,this.$that=_(e),this.formatted=!1,this.settingsClone=n(this.$that,this.settings),this.value=e.value}function b(e){return"string"==typeof e&&(e="#"+(e=e.replace(/\[/g,"\\[").replace(/\]/g,"\\]")).replace(/(:|\.)/g,"\\$1")),_(e)}function y(e,t,n){var i=e.data("autoNumeric");i||(i={},e.data("autoNumeric",i));var a=i.holder;return(a===undefined&&t||n)&&(a=new s(e.get(0),t),i.holder=a),a}s.prototype={init:function(e){this.value=this.that.value,this.settingsClone=n(this.$that,this.settings),this.ctrlKey=e.ctrlKey,this.cmdKey=e.metaKey,this.shiftKey=e.shiftKey,this.selection=t(this.that),"keydown"!==e.type&&"keyup"!==e.type||(this.kdCode=e.keyCode),this.which=e.which,this.processed=!1,this.formatted=!1},setSelection:function(e,t,n){e=Math.max(e,0),t=Math.min(t,this.that.value.length),this.selection={start:e,end:t,length:t-e},(n===undefined||n)&&r(this.that,e,t)},setPosition:function(e,t){this.setSelection(e,e,t)},getBeforeAfter:function(){var e=this.value;return[e.substring(0,this.selection.start),e.substring(this.selection.end,e.length)]},getBeforeAfterStriped:function(){var e=this.getBeforeAfter();return e[0]=c(e[0],this.settingsClone),e[1]=c(e[1],this.settingsClone),e},normalizeParts:function(e,t){var n=this.settingsClone;""!==(e=c(e,n,!!(t=c(t,n)).match(/^\d/)||"leading"))&&e!==n.aNeg||"deny"!==n.lZero||""<t&&(t=t.replace(/^0*(\d)/,"$1"));var i=e+t;if(n.aDec){var a=i.match(new RegExp("^"+n.aNegRegAutoStrip+"\\"+n.aDec));a&&(i=(e=e.replace(a[1],a[1]+"0"))+t)}return"zero"!==n.wEmpty||i!==n.aNeg&&""!==i||(e+="0"),[e,t]},setValueParts:function(e,t,n){var i=this.settingsClone,a=this.normalizeParts(e,t),s=a.join(""),o=a[0].length;return!!v(s,i)&&(o>(s=A(s,i,n)).length&&(o=s.length),this.value=s,this.setPosition(o,!1),!0)},signPosition:function(){var e=this.settingsClone,t=e.aSign,n=this.that;if(t){var i=t.length;if("p"===e.pSign)return e.aNeg&&n.value&&n.value.charAt(0)===e.aNeg?[1,i+1]:[0,i];var a=n.value.length;return[a-i,a]}return[1e3,-1]},expandSelectionOnSign:function(e){var t=this.signPosition(),n=this.selection;n.start<t[1]&&n.end>t[0]&&((n.start<t[0]||n.end>t[1])&&this.value.substring(Math.max(n.start,t[0]),Math.min(n.end,t[1])).match(/^\s*$/)?n.start<t[0]?this.setSelection(n.start,t[0],e):this.setSelection(t[1],n.end,e):this.setSelection(Math.min(n.start,t[0]),Math.max(n.end,t[1]),e))},checkPaste:function(){if(this.valuePartsBeforePaste!==undefined){var e=this.getBeforeAfter(),t=this.valuePartsBeforePaste;delete this.valuePartsBeforePaste,e[0]=e[0].substr(0,t[0].length)+c(e[0].substr(t[0].length),this.settingsClone),this.setValueParts(e[0],e[1],"paste")||(this.value=t.join(""),this.setPosition(t[0].length,!1))}},skipAllways:function(e){var t=this.kdCode,n=this.which,i=this.ctrlKey,a=this.cmdKey,s=this.shiftKey;if((i||a)&&"keyup"===e.type&&this.valuePartsBeforePaste!==undefined||s&&45===t)return this.checkPaste(),!1;if(112<=t&&t<=123||91<=t&&t<=93||9<=t&&t<=31||t<8&&(0===n||n===t)||144===t||145===t||45===t||224===t)return!0;if((i||a)&&65===t)return!0;if((i||a)&&(67===t||86===t||88===t))return"keydown"===e.type&&this.expandSelectionOnSign(),86!==t&&45!==t||("keydown"===e.type||"keypress"===e.type?this.valuePartsBeforePaste===undefined&&(this.valuePartsBeforePaste=this.getBeforeAfter()):this.checkPaste()),"keydown"===e.type||"keypress"===e.type||67===t;if(i||a)return!0;if(37!==t&&39!==t)return 34<=t&&t<=40;var o=this.settingsClone.aSep,r=this.selection.start,l=this.that.value;return"keydown"===e.type&&o&&!this.shiftKey&&(37===t&&l.charAt(r-2)===o?this.setPosition(r-1):39===t&&l.charAt(r+1)===o&&this.setPosition(r+1)),!0},processAllways:function(){var e;return(8===this.kdCode||46===this.kdCode)&&(this.selection.length?(this.expandSelectionOnSign(!1),e=this.getBeforeAfterStriped()):(e=this.getBeforeAfterStriped(),8===this.kdCode?e[0]=e[0].substring(0,e[0].length-1):e[1]=e[1].substring(1,e[1].length)),this.setValueParts(e[0],e[1]),!0)},processKeypress:function(){var e=this.settingsClone,t=String.fromCharCode(this.which),n=this.getBeforeAfterStriped(),i=n[0],a=n[1];return t===e.aDec||e.altDec&&t===e.altDec||("."===t||","===t)&&110===this.kdCode?e.mDec&&e.aDec&&(e.aNeg&&-1<a.indexOf(e.aNeg)||-1<i.indexOf(e.aDec)||0<a.indexOf(e.aDec)||(0===a.indexOf(e.aDec)&&(a=a.substr(1)),this.setValueParts(i+e.aDec,a))):"-"===t||"+"===t?e.aNeg&&(""===i&&-1<a.indexOf(e.aNeg)&&(i=e.aNeg,a=a.substring(1,a.length)),i=i.charAt(0)===e.aNeg?i.substring(1,i.length):"-"===t?e.aNeg+i:i,this.setValueParts(i,a)):"0"<=t&&t<="9"&&(e.aNeg&&""===i&&-1<a.indexOf(e.aNeg)&&(i=e.aNeg,a=a.substring(1,a.length)),e.vMax<=0&&e.vMin<e.vMax&&-1===this.value.indexOf(e.aNeg)&&"0"!==t&&(i=e.aNeg+i),this.setValueParts(i+t,a)),!0},formatQuick:function(){var e=this.settingsClone,t=this.getBeforeAfterStriped(),n=this.value;if((""===e.aSep||""!==e.aSep&&-1===n.indexOf(e.aSep))&&(""===e.aSign||""!==e.aSign&&-1===n.indexOf(e.aSign))){var i=[],a="";-1<(i=n.split(e.aDec))[0].indexOf("-")&&(a="-",i[0]=i[0].replace("-",""),t[0]=t[0].replace("-","")),i[0].length>e.mInt&&"0"===t[0].charAt(0)&&(t[0]=t[0].slice(1)),t[0]=a+t[0]}var s=f(this.value,this.settingsClone),o=s.length;if(s){for(var r=t[0].split(""),l=0;l<r.length;l+=1)r[l].match("\\d")||(r[l]="\\"+r[l]);var c=new RegExp("^.*?"+r.join(".*?")),d=s.match(c);d?(0===(o=d[0].length)&&s.charAt(0)!==e.aNeg||1===o&&s.charAt(0)===e.aNeg)&&e.aSign&&"p"===e.pSign&&(o=this.settingsClone.aSign.length+("-"===s.charAt(0)?1:0)):e.aSign&&"s"===e.pSign&&(o-=e.aSign.length)}this.that.value!==s&&(this.that.value=s,this.setPosition(o)),this.formatted=!0}};var i={init:function(a){return this.each(function(){var s=_(this),e=s.data("autoNumeric"),t=s.data(),n=s.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])");if("object"==typeof e)return this;(e=_.extend({},_.fn.autoNumeric.defaults,t,a,{aNum:"0123456789",hasFocus:!1,removeBrackets:!1,runOnce:!1,tagList:["b","caption","cite","code","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","ins","kdb","label","li","output","p","q","s","sample","span","strong","td","th","u","var"]})).aDec===e.aSep&&_.error("autoNumeric will not function properly when the decimal character aDec: '"+e.aDec+"' and thousand separator aSep: '"+e.aSep+"' are the same character"),s.data("autoNumeric",e);var o=y(s,e);if(n||"input"!==s.prop("tagName").toLowerCase()||_.error('The input type "'+s.prop("type")+'" is not supported by autoNumeric()'),-1===_.inArray(s.prop("tagName").toLowerCase(),e.tagList)&&"input"!==s.prop("tagName").toLowerCase()&&_.error("The <"+s.prop("tagName").toLowerCase()+"> is not supported by autoNumeric()"),!1===e.runOnce&&e.aForm){if(n){var i=!0;""===s[0].value&&"empty"===e.wEmpty&&(s[0].value="",i=!1),""===s[0].value&&"sign"===e.wEmpty&&(s[0].value=e.aSign,i=!1),i&&""!==s.val()&&(null===e.anDefault&&s[0].value===s.prop("defaultValue")||null!==e.anDefault&&e.anDefault.toString()===s.val())&&s.autoNumeric("set",s.val())}-1!==_.inArray(s.prop("tagName").toLowerCase(),e.tagList)&&""!==s.text()&&s.autoNumeric("set",s.text())}e.runOnce=!0,s.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])")&&(s.on("keydown.autoNumeric",function(e){return(o=y(s)).settings.aDec===o.settings.aSep&&_.error("autoNumeric will not function properly when the decimal character aDec: '"+o.settings.aDec+"' and thousand separator aSep: '"+o.settings.aSep+"' are the same character"),o.that.readOnly?o.processed=!0:(o.init(e),o.skipAllways(e)?o.processed=!0:o.processAllways()?(o.processed=!0,o.formatQuick(),e.preventDefault(),!1):!(o.formatted=!1))}),s.on("keypress.autoNumeric",function(e){var t=(o=y(s)).processed;return o.init(e),!!o.skipAllways(e)||(t?(e.preventDefault(),!1):o.processAllways()||o.processKeypress()?(o.formatQuick(),e.preventDefault(),!1):void(o.formatted=!1))}),s.on("keyup.autoNumeric",function(e){(o=y(s)).init(e);var t=o.skipAllways(e),n=o.kdCode;return o.kdCode=0,delete o.valuePartsBeforePaste,s[0].value===o.settings.aSign?"s"===o.settings.pSign?r(this,0,0):r(this,o.settings.aSign.length,o.settings.aSign.length):9===n&&r(this,0,s.val().length),!!t||(""===this.value||void(o.formatted||o.formatQuick()))}),s.on("focusin.autoNumeric",function(){var e=(o=y(s)).settingsClone;if(e.hasFocus=!0,null!==e.nBracket){var t=s.val();s.val(d(t,e))}o.inVal=s.val();var n=p(o.inVal,e,!0);null!==n&&""!==n&&s.val(n)}),s.on("focusout.autoNumeric",function(){var e=(o=y(s)).settingsClone,t=s.val(),n=t;e.hasFocus=!1;var i="";"allow"===e.lZero&&(e.allowLeading=!1,i="leading"),""!==t&&(t=null===p(t=c(t,e,i),e)&&v(t,e,s[0])?h(t=g(t=u(t,e.aDec,e.aNeg),e),e.aDec,e.aNeg):"");var a=p(t,e,!1);null===a&&(a=f(t,e)),a===o.inVal&&a===n||(s.val(a),s.change(),delete o.inVal)}))})},destroy:function(){return _(this).each(function(){var e=_(this);e.removeData("autoNumeric"),e.off(".autoNumeric")})},update:function(i){return _(this).each(function(){var e=b(_(this)),t=e.data("autoNumeric");"object"!=typeof t&&_.error("You must initialize autoNumeric('init', {options}) prior to calling the 'update' method");var n=e.autoNumeric("get");if(y(e,t=_.extend(t,i),!0),t.aDec===t.aSep&&_.error("autoNumeric will not function properly when the decimal character aDec: '"+t.aDec+"' and thousand separator aSep: '"+t.aSep+"' are the same character"),e.data("autoNumeric",t),""!==e.val()||""!==e.text())return e.autoNumeric("set",n)})},set:function(s){if(null!==s&&!isNaN(s))return _(this).each(function(){var e=b(_(this)),t=e.data("autoNumeric"),n=s.toString(),i=s.toString(),a=e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])");return"object"!=typeof t&&_.error("You must initialize autoNumeric('init', {options}) prior to calling the 'set' method"),i!==e.attr("value")&&i!==e.text()||!1!==t.runOnce||(n=n.replace(",",".")),_.isNumeric(+n)||_.error("The value ("+n+") being 'set' is not numeric and has caused a error to be thrown"),n=o(n,t),t.setEvent=!0,n.toString(),""!==n&&(n=g(n,t)),v(n=h(n,t.aDec,t.aNeg),t)||(n=g("",t)),n=f(n,t),a?e.val(n):-1!==_.inArray(e.prop("tagName").toLowerCase(),t.tagList)&&e.text(n)})},get:function(){var e=b(_(this)),t=e.data("autoNumeric");"object"!=typeof t&&_.error("You must initialize autoNumeric('init', {options}) prior to calling the 'get' method");var n="";return e.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])")?n=e.eq(0).val():-1!==_.inArray(e.prop("tagName").toLowerCase(),t.tagList)?n=e.eq(0).text():_.error("The <"+e.prop("tagName").toLowerCase()+"> is not supported by autoNumeric()"),""===n&&"empty"===t.wEmpty||n===t.aSign&&("sign"===t.wEmpty||"empty"===t.wEmpty)?"":(""!==n&&null!==t.nBracket&&(t.removeBrackets=!0,n=d(n,t),t.removeBrackets=!1),(t.runOnce||!1===t.aForm)&&(n=c(n,t)),0==+(n=u(n,t.aDec,t.aNeg))&&"keep"!==t.lZero&&(n="0"),"keep"===t.lZero?n:n=o(n,t))},getString:function(){var i=!1,e=b(_(this)),a=e.serialize().split("&"),s=_("form").index(e),t=_("form:eq("+s+")"),o=[],r=[],n=/^(?:submit|button|image|reset|file)$/i,l=/^(?:input|select|textarea|keygen)/i,c=/^(?:checkbox|radio)$/i,d=/^(?:button|checkbox|color|date|datetime|datetime-local|email|file|image|month|number|password|radio|range|reset|search|submit|time|url|week)/i,u=0;return _.each(t[0],function(e,t){""===t.name||!l.test(t.localName)||n.test(t.type)||t.disabled||!t.checked&&c.test(t.type)?r.push(-1):(r.push(u),u+=1)}),u=0,_.each(t[0],function(e,t){"input"!==t.localName||""!==t.type&&"text"!==t.type&&"hidden"!==t.type&&"tel"!==t.type?(o.push(-1),"input"===t.localName&&d.test(t.type)&&(u+=1)):(o.push(u),u+=1)}),_.each(a,function(e,t){t=a[e].split("=");var n=_.inArray(e,r);-1<n&&-1<o[n]&&("object"==typeof _("form:eq("+s+") input:eq("+o[n]+")").data("autoNumeric")&&null!==t[1]&&(t[1]=_("form:eq("+s+") input:eq("+o[n]+")").autoNumeric("get").toString(),a[e]=t.join("="),i=!0))}),i||_.error("You must initialize autoNumeric('init', {options}) prior to calling the 'getString' method"),a.join("&")},getArray:function(){var i=!1,e=b(_(this)),t=e.serializeArray(),a=_("form").index(e),n=_("form:eq("+a+")"),s=[],o=[],r=/^(?:submit|button|image|reset|file)$/i,l=/^(?:input|select|textarea|keygen)/i,c=/^(?:checkbox|radio)$/i,d=/^(?:button|checkbox|color|date|datetime|datetime-local|email|file|image|month|number|password|radio|range|reset|search|submit|time|url|week)/i,u=0;return _.each(n[0],function(e,t){""===t.name||!l.test(t.localName)||r.test(t.type)||t.disabled||!t.checked&&c.test(t.type)?o.push(-1):(o.push(u),u+=1)}),u=0,_.each(n[0],function(e,t){"input"!==t.localName||""!==t.type&&"text"!==t.type&&"hidden"!==t.type&&"tel"!==t.type?(s.push(-1),"input"===t.localName&&d.test(t.type)&&(u+=1)):(s.push(u),u+=1)}),_.each(t,function(e,t){var n=_.inArray(e,o);-1<n&&-1<s[n]&&("object"==typeof _("form:eq("+a+") input:eq("+s[n]+")").data("autoNumeric")&&(t.value=_("form:eq("+a+") input:eq("+s[n]+")").autoNumeric("get").toString(),i=!0))}),i||_.error("None of the successful form inputs are initialized by autoNumeric."),t},getSettings:function(){return b(_(this)).eq(0).data("autoNumeric")}};_.fn.autoNumeric=function(e){return i[e]?i[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void _.error('Method "'+e+'" is not supported by autoNumeric()'):i.init.apply(this,arguments)},_.fn.autoNumeric.defaults={aSep:",",dGroup:"3",aDec:".",altDec:null,aSign:"",pSign:"p",vMax:"9999999999999.99",vMin:"-9999999999999.99",mDec:null,mRound:"S",aPad:!0,nBracket:null,wEmpty:"empty",lZero:"allow",sNumber:!0,aForm:!0,anDefault:null}}),window.AutonumericRails=AutonumericRails=function(){function e(e){this.field=e,this.field.data("autonumeric-initialized",!0),this.create_hidden_field(),this.init_autonumeric(),this.sanitize_value(),this.field.on("keyup blur",$.proxy(function(){this.sanitize_value()},this))}return e.create_autonumeric_object=function(e){if(!e.data("autonumeric-initialized"))return new this(e)},e.delete_autonumeric_object=function(e){e.data("autonumeric-initialized")&&(e.removeData("autonumeric-initialized").removeData("autonumeric").removeAttr("data-autonumeric").off("keyup blur").autoNumeric("destroy"),$("input#"+e.attr("id")+'_val[type="hidden"][name="'+e.attr("name")+'"]').remove())},e.prototype.create_hidden_field=function(){this.hidden=$("<input>").attr("type","hidden").attr("id",this.field.attr("id")+"_val").attr("name",this.field.attr("name")),this.hidden.insertAfter(this.field)},e.prototype.init_autonumeric=function(){this.field.autoNumeric("init",$.parseJSON(this.field.attr("data-autonumeric")))},e.prototype.sanitize_value=function(){this.hidden.val(this.field.autoNumeric("get"))},e}(),window.refresh_autonumeric=function(){$("input[data-autonumeric]").each(function(){AutonumericRails.create_autonumeric_object($(this))})},jQuery(function(){window.refresh_autonumeric(),$(document).on("refresh_autonumeric",function(){window.refresh_autonumeric()}),$(document).on("ajaxComplete",function(){window.refresh_autonumeric()})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";function u(){return ta.apply(null,arguments)}function e(e){ta=e}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function r(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(c(e,t))return!1;return!0}function d(e){return void 0===e}function _(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function a(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function i(e,t){var n,i=[],a=e.length;for(n=0;n<a;++n)i.push(t(e[n],n));return i}function h(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function p(e,t,n,i){return Et(e,t,n,i,!0).utc()}function t(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function f(e){return null==e._pf&&(e._pf=t()),e._pf}function m(e){if(null==e._isValid){var t=f(e),n=na.call(t.parsedDateParts,function(e){return null!=e}),i=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&t.bigHour===undefined),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function s(e){var t=p(NaN);return null!=e?h(f(t),e):f(t).userInvalidated=!0,t}function g(e,t){var n,i,a,s=aa.length;if(d(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),d(t._i)||(e._i=t._i),d(t._f)||(e._f=t._f),d(t._l)||(e._l=t._l),d(t._strict)||(e._strict=t._strict),d(t._tzm)||(e._tzm=t._tzm),d(t._isUTC)||(e._isUTC=t._isUTC),d(t._offset)||(e._offset=t._offset),d(t._pf)||(e._pf=f(t)),d(t._locale)||(e._locale=t._locale),0<s)for(n=0;n<s;n++)d(a=t[i=aa[n]])||(e[i]=a);return e}function A(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===sa&&(sa=!0,u.updateOffset(this),sa=!1)}function v(e){return e instanceof A||null!=e&&null!=e._isAMomentObject}function b(e){!1===u.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function n(o,r){var l=!0;return h(function(e){if(null!=u.deprecationHandler&&u.deprecationHandler(null,o),l){var t,n,i,a=[],s=arguments.length;for(n=0;n<s;n++){if(t="","object"==typeof arguments[n]){for(i in t+="\n["+n+"] ",e)c(arguments[0],i)&&(t+=i+": "+arguments[0][i]+", ");t=t.slice(0,-2)}else t=arguments[n];a.push(t)}b(o+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+(new Error).stack),l=!1}return r.apply(this,arguments)},r)}function y(e,t){null!=u.deprecationHandler&&u.deprecationHandler(e,t),oa[e]||(b(t),oa[e]=!0)}function $(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function w(e){var t,n;for(n in e)c(e,n)&&($(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function k(e,t){var n,i=h({},e);for(n in t)c(t,n)&&(r(e[n])&&r(t[n])?(i[n]={},h(i[n],e[n]),h(i[n],t[n])):null!=t[n]?i[n]=t[n]:delete i[n]);for(n in e)c(e,n)&&!c(t,n)&&r(e[n])&&(i[n]=h({},i[n]));return i}function C(e){null!=e&&this.set(e)}function E(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return $(i)?i.call(t,n):i}function T(e,t,n){var i=""+Math.abs(e),a=t-i.length;return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,a)).toString().substr(1)+i}function x(e,t,n,i){var a=i;"string"==typeof i&&(a=function(){return this[i]()}),e&&(_a[e]=a),t&&(_a[t[0]]=function(){return T(a.apply(this,arguments),t[1],t[2])}),n&&(_a[n]=function(){return this.localeData().ordinal(a.apply(this,arguments),e)})}function I(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function D(i){var e,a,s=i.match(ca);for(e=0,a=s.length;e<a;e++)_a[s[e]]?s[e]=_a[s[e]]:s[e]=I(s[e]);return function(e){var t,n="";for(t=0;t<a;t++)n+=$(s[t])?s[t].call(e,i):s[t];return n}}function O(e,t){return e.isValid()?(t=S(t,e.localeData()),ua[t]=ua[t]||D(t),ua[t](e)):e.localeData().invalidDate()}function S(e,t){function n(e){return t.longDateFormat(e)||e}var i=5;for(da.lastIndex=0;0<=i&&da.test(e);)e=e.replace(da,n),da.lastIndex=0,i-=1;return e}function R(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(ca).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])}function B(){return this._invalidDate}function N(e){return this._ordinal.replace("%d",e)}function F(e,t,n,i){var a=this._relativeTime[n];return $(a)?a(e,t,n,i):a.replace(/%d/i,e)}function K(e,t){var n=this._relativeTime[0<e?"future":"past"];return $(n)?n(t):n.replace(/%s/i,t)}function M(e,t){var n=e.toLowerCase();Aa[n]=Aa[n+"s"]=Aa[t]=e}function j(e){return"string"==typeof e?Aa[e]||Aa[e.toLowerCase()]:undefined}function L(e){var t,n,i={};for(n in e)c(e,n)&&(t=j(n))&&(i[t]=e[n]);return i}function P(e,t){va[e]=t}function U(e){var t,n=[];for(t in e)c(e,t)&&n.push({unit:t,priority:va[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}function H(e){return e%4==0&&e%100!=0||e%400==0}function Q(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function z(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=Q(t)),n}function q(t,n){return function(e){return null!=e?(Y(this,t,e),u.updateOffset(this,n),this):W(this,t)}}function W(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Y(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&H(e.year())&&1===e.month()&&29===e.date()?(n=z(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),se(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function V(e){return $(this[e=j(e)])?this[e]():this}function G(e,t){if("object"==typeof e){var n,i=U(e=L(e)),a=i.length;for(n=0;n<a;n++)this[i[n].unit](e[i[n].unit])}else if($(this[e=j(e)]))return this[e](t);return this}function X(e,t,n){ra[e]=$(t)?t:function(e){return e&&n?n:t}}function J(e,t){return c(ra,e)?ra[e](t._strict,t._locale):new RegExp(Z(e))}function Z(e){return ee(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,a){return t||n||i||a}))}function ee(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function te(e,n){var t,i,a=n;for("string"==typeof e&&(e=[e]),_(n)&&(a=function(e,t){t[n]=z(e)}),i=e.length,t=0;t<i;t++)Ma[e[t]]=a}function ne(e,a){te(e,function(e,t,n,i){n._w=n._w||{},a(e,n._w,n,i)})}function ie(e,t,n){null!=t&&c(Ma,e)&&Ma[e](t,n._a,n,e)}function ae(e,t){return(e%t+t)%t}function se(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ae(t,12);return e+=(t-n)/12,1===n?H(e)?29:28:31-n%7%2}function oe(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ga).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone}function re(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ga.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function le(e,t,n){var i,a,s,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)s=p([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(s,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(a=Ka.call(this._shortMonthsParse,o))?a:null:-1!==(a=Ka.call(this._longMonthsParse,o))?a:null:"MMM"===t?-1!==(a=Ka.call(this._shortMonthsParse,o))?a:-1!==(a=Ka.call(this._longMonthsParse,o))?a:null:-1!==(a=Ka.call(this._longMonthsParse,o))?a:-1!==(a=Ka.call(this._shortMonthsParse,o))?a:null}function ce(e,t,n){var i,a,s;if(this._monthsParseExact)return le.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(a=p([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(a,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(a,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(s="^"+this.months(a,"")+"|^"+this.monthsShort(a,""),this._monthsParse[i]=new RegExp(s.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}}function de(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=z(t);else if(!_(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),se(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function ue(e){return null!=e?(de(this,e),u.updateOffset(this,!0),this):W(this,"Month")}function _e(){return se(this.year(),this.month())}function he(e){return this._monthsParseExact?(c(this,"_monthsRegex")||fe.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Xa),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function pe(e){return this._monthsParseExact?(c(this,"_monthsRegex")||fe.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Ja),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function fe(){function e(e,t){return t.length-e.length}var t,n,i=[],a=[],s=[];for(t=0;t<12;t++)n=p([2e3,t]),i.push(this.monthsShort(n,"")),a.push(this.months(n,"")),s.push(this.months(n,"")),s.push(this.monthsShort(n,""));for(i.sort(e),a.sort(e),s.sort(e),t=0;t<12;t++)i[t]=ee(i[t]),a[t]=ee(a[t]);for(t=0;t<24;t++)s[t]=ee(s[t]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function me(e){return H(e)?366:365}function ge(){return H(this.year())}function Ae(e,t,n,i,a,s,o){var r;return e<100&&0<=e?(r=new Date(e+400,t,n,i,a,s,o),isFinite(r.getFullYear())&&r.setFullYear(e)):r=new Date(e,t,n,i,a,s,o),r}function ve(e){var t,n;return e<100&&0<=e?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function be(e,t,n){var i=7+t-n;return-((7+ve(e,0,i).getUTCDay()-t)%7)+i-1}function ye(e,t,n,i,a){var s,o,r=1+7*(t-1)+(7+n-i)%7+be(e,i,a);return r<=0?o=me(s=e-1)+r:r>me(e)?(s=e+1,o=r-me(e)):(s=e,o=r),{year:s,dayOfYear:o}}function $e(e,t,n){var i,a,s=be(e.year(),t,n),o=Math.floor((e.dayOfYear()-s-1)/7)+1;return o<1?i=o+we(a=e.year()-1,t,n):o>we(e.year(),t,n)?(i=o-we(e.year(),t,n),a=e.year()+1):(a=e.year(),i=o),{week:i,year:a}}function we(e,t,n){var i=be(e,t,n),a=be(e+1,t,n);return(me(e)-i+a)/7}function ke(e){return $e(e,this._week.dow,this._week.doy).week}function Ce(){return this._week.dow}function Ee(){return this._week.doy}function Te(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function xe(e){var t=$e(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function Ie(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function De(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Oe(e,t){return e.slice(t,7).concat(e.slice(0,t))}function Se(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?Oe(n,this._week.dow):e?n[e.day()]:n}function Re(e){return!0===e?Oe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Be(e){return!0===e?Oe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ne(e,t,n){var i,a,s,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)s=p([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(s,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(a=Ka.call(this._weekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Ka.call(this._shortWeekdaysParse,o))?a:null:-1!==(a=Ka.call(this._minWeekdaysParse,o))?a:null:"dddd"===t?-1!==(a=Ka.call(this._weekdaysParse,o))?a:-1!==(a=Ka.call(this._shortWeekdaysParse,o))?a:-1!==(a=Ka.call(this._minWeekdaysParse,o))?a:null:"ddd"===t?-1!==(a=Ka.call(this._shortWeekdaysParse,o))?a:-1!==(a=Ka.call(this._weekdaysParse,o))?a:-1!==(a=Ka.call(this._minWeekdaysParse,o))?a:null:-1!==(a=Ka.call(this._minWeekdaysParse,o))?a:-1!==(a=Ka.call(this._weekdaysParse,o))?a:-1!==(a=Ka.call(this._shortWeekdaysParse,o))?a:null}function Fe(e,t,n){var i,a,s;if(this._weekdaysParseExact)return Ne.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(a=p([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(a,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(a,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(a,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(s="^"+this.weekdays(a,"")+"|^"+this.weekdaysShort(a,"")+"|^"+this.weekdaysMin(a,""),this._weekdaysParse[i]=new RegExp(s.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}}function Ke(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Ie(e,this.localeData()),this.add(e-t,"d")):t}function Me(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function je(e){if(!this.isValid())return null!=e?this:NaN;if(null==e)return this.day()||7;var t=De(e,this.localeData());return this.day(this.day()%7?t:t-7)}function Le(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||He.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=as),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function Pe(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||He.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(
this._weekdaysShortRegex=ss),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ue(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||He.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=os),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function He(){function e(e,t){return t.length-e.length}var t,n,i,a,s,o=[],r=[],l=[],c=[];for(t=0;t<7;t++)n=p([2e3,1]).day(t),i=ee(this.weekdaysMin(n,"")),a=ee(this.weekdaysShort(n,"")),s=ee(this.weekdays(n,"")),o.push(i),r.push(a),l.push(s),c.push(i),c.push(a),c.push(s);o.sort(e),r.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function Qe(){return this.hours()%12||12}function ze(){return this.hours()||24}function qe(e,t){x(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function We(e,t){return t._meridiemParse}function Ye(e){return"p"===(e+"").toLowerCase().charAt(0)}function Ve(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"}function Ge(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n<i;n+=1)if(e[n]!==t[n])return n;return i}function Xe(e){return e?e.toLowerCase().replace("_","-"):e}function Je(e){for(var t,n,i,a,s=0;s<e.length;){for(t=(a=Xe(e[s]).split("-")).length,n=(n=Xe(e[s+1]))?n.split("-"):null;0<t;){if(i=et(a.slice(0,t).join("-")))return i;if(n&&n.length>=t&&Ge(a,n)>=t-1)break;t--}s++}return rs}function Ze(e){return null!=e.match("^[^/\\\\]*$")}function et(e){var t=null;if(us[e]===undefined&&"undefined"!=typeof module&&module&&module.exports&&Ze(e))try{t=rs._abbr,require("./locale/"+e),tt(t)}catch(n){us[e]=null}return us[e]}function tt(e,t){var n;return e&&((n=d(t)?at(e):nt(e,t))?rs=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),rs._abbr}function nt(e,t){if(null===t)return delete us[e],null;var n,i=ds;if(t.abbr=e,null!=us[e])y("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=us[e]._config;else if(null!=t.parentLocale)if(null!=us[t.parentLocale])i=us[t.parentLocale]._config;else{if(null==(n=et(t.parentLocale)))return _s[t.parentLocale]||(_s[t.parentLocale]=[]),_s[t.parentLocale].push({name:e,config:t}),null;i=n._config}return us[e]=new C(k(i,t)),_s[e]&&_s[e].forEach(function(e){nt(e.name,e.config)}),tt(e),us[e]}function it(e,t){if(null!=t){var n,i,a=ds;null!=us[e]&&null!=us[e].parentLocale?us[e].set(k(us[e]._config,t)):(null!=(i=et(e))&&(a=i._config),t=k(a,t),null==i&&(t.abbr=e),(n=new C(t)).parentLocale=us[e],us[e]=n),tt(e)}else null!=us[e]&&(null!=us[e].parentLocale?(us[e]=us[e].parentLocale,e===tt()&&tt(e)):null!=us[e]&&delete us[e]);return us[e]}function at(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return rs;if(!o(e)){if(t=et(e))return t;e=[e]}return Je(e)}function st(){return ia(us)}function ot(e){var t,n=e._a;return n&&-2===f(e).overflow&&(t=n[La]<0||11<n[La]?La:n[Pa]<1||n[Pa]>se(n[ja],n[La])?Pa:n[Ua]<0||24<n[Ua]||24===n[Ua]&&(0!==n[Ha]||0!==n[Qa]||0!==n[za])?Ua:n[Ha]<0||59<n[Ha]?Ha:n[Qa]<0||59<n[Qa]?Qa:n[za]<0||999<n[za]?za:-1,f(e)._overflowDayOfYear&&(t<ja||Pa<t)&&(t=Pa),f(e)._overflowWeeks&&-1===t&&(t=qa),f(e)._overflowWeekday&&-1===t&&(t=Wa),f(e).overflow=t),e}function rt(e){var t,n,i,a,s,o,r=e._i,l=hs.exec(r)||ps.exec(r),c=ms.length,d=gs.length;if(l){for(f(e).iso=!0,t=0,n=c;t<n;t++)if(ms[t][1].exec(l[1])){a=ms[t][0],i=!1!==ms[t][2];break}if(null==a)return void(e._isValid=!1);if(l[3]){for(t=0,n=d;t<n;t++)if(gs[t][1].exec(l[3])){s=(l[2]||" ")+gs[t][0];break}if(null==s)return void(e._isValid=!1)}if(!i&&null!=s)return void(e._isValid=!1);if(l[4]){if(!fs.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=a+(s||"")+(o||""),vt(e)}else e._isValid=!1}function lt(e,t,n,i,a,s){var o=[ct(e),Va.indexOf(t),parseInt(n,10),parseInt(i,10),parseInt(a,10)];return s&&o.push(parseInt(s,10)),o}function ct(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function dt(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ut(e,t,n){if(e&&ns.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay())return f(n).weekdayMismatch=!0,n._isValid=!1;return!0}function _t(e,t,n){if(e)return bs[e];if(t)return 0;var i=parseInt(n,10),a=i%100;return 60*((i-a)/100)+a}function ht(e){var t,n=vs.exec(dt(e._i));if(n){if(t=lt(n[4],n[3],n[2],n[5],n[6],n[7]),!ut(n[1],t,e))return;e._a=t,e._tzm=_t(n[8],n[9],n[10]),e._d=ve.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),f(e).rfc2822=!0}else e._isValid=!1}function pt(e){var t=As.exec(e._i);null===t?(rt(e),!1===e._isValid&&(delete e._isValid,ht(e),!1===e._isValid&&(delete e._isValid,e._strict?e._isValid=!1:u.createFromInputFallback(e)))):e._d=new Date(+t[1])}function ft(e,t,n){return null!=e?e:null!=t?t:n}function mt(e){var t=new Date(u.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function gt(e){var t,n,i,a,s,o=[];if(!e._d){for(i=mt(e),e._w&&null==e._a[Pa]&&null==e._a[La]&&At(e),null!=e._dayOfYear&&(s=ft(e._a[ja],i[ja]),(e._dayOfYear>me(s)||0===e._dayOfYear)&&(f(e)._overflowDayOfYear=!0),n=ve(s,0,e._dayOfYear),e._a[La]=n.getUTCMonth(),e._a[Pa]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=i[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Ua]&&0===e._a[Ha]&&0===e._a[Qa]&&0===e._a[za]&&(e._nextDay=!0,e._a[Ua]=0),e._d=(e._useUTC?ve:Ae).apply(null,o),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Ua]=24),e._w&&"undefined"!=typeof e._w.d&&e._w.d!==a&&(f(e).weekdayMismatch=!0)}}function At(e){var t,n,i,a,s,o,r,l,c;null!=(t=e._w).GG||null!=t.W||null!=t.E?(s=1,o=4,n=ft(t.GG,e._a[ja],$e(Tt(),1,4).year),i=ft(t.W,1),((a=ft(t.E,1))<1||7<a)&&(l=!0)):(s=e._locale._week.dow,o=e._locale._week.doy,c=$e(Tt(),s,o),n=ft(t.gg,e._a[ja],c.year),i=ft(t.w,c.week),null!=t.d?((a=t.d)<0||6<a)&&(l=!0):null!=t.e?(a=t.e+s,(t.e<0||6<t.e)&&(l=!0)):a=s),i<1||i>we(n,s,o)?f(e)._overflowWeeks=!0:null!=l?f(e)._overflowWeekday=!0:(r=ye(n,i,a,s,o),e._a[ja]=r.year,e._dayOfYear=r.dayOfYear)}function vt(e){if(e._f!==u.ISO_8601)if(e._f!==u.RFC_2822){e._a=[],f(e).empty=!0;var t,n,i,a,s,o,r,l=""+e._i,c=l.length,d=0;for(r=(i=S(e._f,e._locale).match(ca)||[]).length,t=0;t<r;t++)a=i[t],(n=(l.match(J(a,e))||[])[0])&&(0<(s=l.substr(0,l.indexOf(n))).length&&f(e).unusedInput.push(s),l=l.slice(l.indexOf(n)+n.length),d+=n.length),_a[a]?(n?f(e).empty=!1:f(e).unusedTokens.push(a),ie(a,n,e)):e._strict&&!n&&f(e).unusedTokens.push(a);f(e).charsLeftOver=c-d,0<l.length&&f(e).unusedInput.push(l),e._a[Ua]<=12&&!0===f(e).bigHour&&0<e._a[Ua]&&(f(e).bigHour=undefined),f(e).parsedDateParts=e._a.slice(0),f(e).meridiem=e._meridiem,e._a[Ua]=bt(e._locale,e._a[Ua],e._meridiem),null!==(o=f(e).era)&&(e._a[ja]=e._locale.erasConvertYear(o,e._a[ja])),gt(e),ot(e)}else ht(e);else rt(e)}function bt(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):(null!=e.isPM&&((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0)),t)}function yt(e){var t,n,i,a,s,o,r=!1,l=e._f.length;if(0===l)return f(e).invalidFormat=!0,void(e._d=new Date(NaN));for(a=0;a<l;a++)s=0,o=!1,t=g({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[a],vt(t),m(t)&&(o=!0),s+=f(t).charsLeftOver,s+=10*f(t).unusedTokens.length,f(t).score=s,r?s<i&&(i=s,n=t):(null==i||s<i||o)&&(i=s,n=t,o&&(r=!0));h(e,n||t)}function $t(e){if(!e._d){var t=L(e._i),n=t.day===undefined?t.date:t.day;e._a=i([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),gt(e)}}function wt(e){var t=new A(ot(kt(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=undefined),t}function kt(e){var t=e._i,n=e._f;return e._locale=e._locale||at(e._l),null===t||n===undefined&&""===t?s({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),v(t)?new A(ot(t)):(a(t)?e._d=t:o(n)?yt(e):n?vt(e):Ct(e),m(e)||(e._d=null),e))}function Ct(e){var t=e._i;d(t)?e._d=new Date(u.now()):a(t)?e._d=new Date(t.valueOf()):"string"==typeof t?pt(e):o(t)?(e._a=i(t.slice(0),function(e){return parseInt(e,10)}),gt(e)):r(t)?$t(e):_(t)?e._d=new Date(t):u.createFromInputFallback(e)}function Et(e,t,n,i,a){var s={};return!0!==t&&!1!==t||(i=t,t=undefined),!0!==n&&!1!==n||(i=n,n=undefined),(r(e)&&l(e)||o(e)&&0===e.length)&&(e=undefined),s._isAMomentObject=!0,s._useUTC=s._isUTC=a,s._l=n,s._i=e,s._f=t,s._strict=i,wt(s)}function Tt(e,t,n,i){return Et(e,t,n,i,!1)}function xt(e,t){var n,i;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Tt();for(n=t[0],i=1;i<t.length;++i)t[i].isValid()&&!t[i][e](n)||(n=t[i]);return n}function It(){return xt("isBefore",[].slice.call(arguments,0))}function Dt(){return xt("isAfter",[].slice.call(arguments,0))}function Ot(e){var t,n,i=!1,a=ks.length;for(t in e)if(c(e,t)&&(-1===Ka.call(ks,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<a;++n)if(e[ks[n]]){if(i)return!1;parseFloat(e[ks[n]])!==z(e[ks[n]])&&(i=!0)}return!0}function St(){return this._isValid}function Rt(){return Zt(NaN)}function Bt(e){var t=L(e),n=t.year||0,i=t.quarter||0,a=t.month||0,s=t.week||t.isoWeek||0,o=t.day||0,r=t.hour||0,l=t.minute||0,c=t.second||0,d=t.millisecond||0;this._isValid=Ot(t),this._milliseconds=+d+1e3*c+6e4*l+1e3*r*60*60,this._days=+o+7*s,this._months=+a+3*i+12*n,this._data={},this._locale=at(),this._bubble()}function Nt(e){return e instanceof Bt}function Ft(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Kt(e,t,n){var i,a=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),o=0;for(i=0;i<a;i++)(n&&e[i]!==t[i]||!n&&z(e[i])!==z(t[i]))&&o++;return o+s}function Mt(e,n){x(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+T(~~(e/60),2)+n+T(~~e%60,2)})}function jt(e,t){var n,i,a=(t||"").match(e);return null===a?null:0===(i=60*(n=((a[a.length-1]||[])+"").match(Cs)||["-",0,0])[1]+z(n[2]))?0:"+"===n[0]?i:-i}function Lt(e,t){var n,i;return t._isUTC?(n=t.clone(),i=(v(e)||a(e)?e.valueOf():Tt(e).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+i),u.updateOffset(n,!1),n):Tt(e).local()}function Pt(e){return-Math.round(e._d.getTimezoneOffset())}function Ut(e,t,n){var i,a=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?a:Pt(this);if("string"==typeof e){if(null===(e=jt(Ba,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(i=Pt(this)),this._offset=e,this._isUTC=!0,null!=i&&this.add(i,"m"),a!==e&&(!t||this._changeInProgress?sn(this,Zt(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,u.updateOffset(this,!0),this._changeInProgress=null)),this}function Ht(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Qt(e){return this.utcOffset(0,e)}function zt(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Pt(this),"m")),this}function qt(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=jt(Ra,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Wt(e){return!!this.isValid()&&(e=e?Tt(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function Yt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Vt(){if(!d(this._isDSTShifted))return this._isDSTShifted;var e,t={};return g(t,this),(t=kt(t))._a?(e=t._isUTC?p(t._a):Tt(t._a),this._isDSTShifted=this.isValid()&&0<Kt(t._a,e.toArray())):this._isDSTShifted=!1,this._isDSTShifted}function Gt(){return!!this.isValid()&&!this._isUTC}function Xt(){return!!this.isValid()&&this._isUTC}function Jt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Zt(e,t){var n,i,a,s=e,o=null;return Nt(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:_(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(o=Es.exec(e))?(n="-"===o[1]?-1:1,s={y:0,d:z(o[Pa])*n,h:z(o[Ua])*n,m:z(o[Ha])*n,s:z(o[Qa])*n,ms:z(Ft(1e3*o[za]))*n}):(o=Ts.exec(e))?(n="-"===o[1]?-1:1,s={y:en(o[2],n),M:en(o[3],n),w:en(o[4],n),d:en(o[5],n),h:en(o[6],n),m:en(o[7],n),s:en(o[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(a=nn(Tt(s.from),Tt(s.to)),(s={}).ms=a.milliseconds,s.M=a.months),i=new Bt(s),Nt(e)&&c(e,"_locale")&&(i._locale=e._locale),Nt(e)&&c(e,"_isValid")&&(i._isValid=e._isValid),i}function en(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function tn(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function nn(e,t){var n;return e.isValid()&&t.isValid()?(t=Lt(t,e),e.isBefore(t)?n=tn(e,t):((n=tn(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function an(i,a){return function(e,t){var n;return null===t||isNaN(+t)||(y(a,"moment()."+a+"(period, number) is deprecated. Please use moment()."+a+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),sn(this,Zt(e,t),i),this}}function sn(e,t,n,i){var a=t._milliseconds,s=Ft(t._days),o=Ft(t._months);e.isValid()&&(i=null==i||i,o&&de(e,W(e,"Month")+o*n),s&&Y(e,"Date",W(e,"Date")+s*n),a&&e._d.setTime(e._d.valueOf()+a*n),i&&u.updateOffset(e,s||o))}function on(e){return"string"==typeof e||e instanceof String}function rn(e){return v(e)||a(e)||on(e)||_(e)||cn(e)||ln(e)||null===e||e===undefined}function ln(e){var t,n,i=r(e)&&!l(e),a=!1,s=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],o=s.length;for(t=0;t<o;t+=1)n=s[t],a=a||c(e,n);return i&&a}function cn(t){var e=o(t),n=!1;return e&&(n=0===t.filter(function(e){return!_(e)&&on(t)}).length),e&&n}function dn(e){var t,n,i=r(e)&&!l(e),a=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<s.length;t+=1)n=s[t],a=a||c(e,n);return i&&a}function un(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function _n(e,t){1===arguments.length&&(arguments[0]?rn(arguments[0])?(e=arguments[0],t=undefined):dn(arguments[0])&&(t=arguments[0],e=undefined):(e=undefined,t=undefined));var n=e||Tt(),i=Lt(n,this).startOf("day"),a=u.calendarFormat(this,i)||"sameElse",s=t&&($(t[a])?t[a].call(this,n):t[a]);return this.format(s||this.localeData().calendar(a,this,Tt(n)))}function hn(){return new A(this)}function pn(e,t){var n=v(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=j(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function fn(e,t){var n=v(e)?e:Tt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=j(t)||"millisecond")?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function mn(e,t,n,i){var a=v(e)?e:Tt(e),s=v(t)?t:Tt(t);return!!(this.isValid()&&a.isValid()&&s.isValid())&&(("("===(i=i||"()")[0]?this.isAfter(a,n):!this.isBefore(a,n))&&(")"===i[1]?this.isBefore(s,n):!this.isAfter(s,n)))}function gn(e,t){var n,i=v(e)?e:Tt(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=j(t)||"millisecond")?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function An(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function vn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function bn(e,t,n){var i,a,s;if(!this.isValid())return NaN;if(!(i=Lt(e,this)).isValid())return NaN;switch(a=6e4*(i.utcOffset()-this.utcOffset()),t=j(t)){case"year":s=yn(this,i)/12;break;case"month":s=yn(this,i);break;case"quarter":s=yn(this,i)/3;break;case"second":s=(this-i)/1e3;break;case"minute":s=(this-i)/6e4;break;case"hour":s=(this-i)/36e5;break;case"day":s=(this-i-a)/864e5;break;case"week":s=(this-i-a)/6048e5;break;default:s=this-i}return n?s:Q(s)}function yn(e,t){if(e.date()<t.date())return-yn(t,e);var n=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(n,"months");return-(n+(t-i<0?(t-i)/(i-e.clone().add(n-1,"months")):(t-i)/(e.clone().add(n+1,"months")-i)))||0}function $n(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function wn(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||9999<n.year()?O(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):$(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",O(n,"Z")):O(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function kn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,i,a="moment",s="";return this.isLocal()||(a=0===this.utcOffset()?"moment.utc":"moment.parseZone",s="Z"),e="["+a+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",i=s+'[")]',this.format(e+t+n+i)}function Cn(e){e||(e=this.isUtc()?u.defaultFormatUtc:u.defaultFormat);var t=O(this,e);return this.localeData().postformat(t)}function En(e,t){return this.isValid()&&(v(e)&&e.isValid()||Tt(e).isValid())?Zt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Tn(e){return this.from(Tt(),e)}function xn(e,t){return this.isValid()&&(v(e)&&e.isValid()||Tt(e).isValid())?Zt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function In(e){return this.to(Tt(),e)}function Dn(e){var t;return e===undefined?this._locale._abbr:(null!=(t=at(e))&&(this._locale=t),this)}function On(){return this._locale}function Sn(e,t){return(e%t+t)%t}function Rn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-Bs:new Date(e,t,n).valueOf()}function Bn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-Bs:Date.UTC(e,t,n)}function Nn(e){var t,n;if((e=j(e))===undefined||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?Bn:Rn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Sn(t+(this._isUTC?0:this.utcOffset()*Ss),Rs);break;case"minute":t=this._d.valueOf(),t-=Sn(t,Ss);break;case"second":t=this._d.valueOf(),t-=Sn(t,Os)}return this._d.setTime(t),u.updateOffset(this,!0),this}function Fn(e){var t,n;if((e=j(e))===undefined||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?Bn:Rn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=Rs-Sn(t+(this._isUTC?0:this.utcOffset()*Ss),Rs)-1;break;case"minute":t=this._d.valueOf(),t+=Ss-Sn(t,Ss)-1;break;case"second":t=this._d.valueOf(),t+=Os-Sn(t,Os)-1}return this._d.setTime(t),u.updateOffset(this,!0),this}function Kn(){return this._d.valueOf()-6e4*(this._offset||0)}function Mn(){return Math.floor(this.valueOf()/1e3)}function jn(){return new Date(this.valueOf())}function Ln(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Pn(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Un(){return this.isValid()?this.toISOString():null}function Hn(){return m(this)}function Qn(){return h({},f(this))}function zn(){return f(this).overflow}function qn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Wn(){var e,t,n,i=this._eras||at("en")._eras;for(e=0,t=i.length;e<t;++e){switch(typeof i[e].since){case"string":n=u(i[e].since).startOf("day"),i[e].since=n.valueOf()}switch(typeof i[e].until){case"undefined":i[e].until=+Infinity;break;case"string":n=u(i[e].until).startOf("day").valueOf(),i[e].until=n.valueOf()}}return i}function Yn(e,t,n){var i,a,s,o,r,l=this.eras();for(e=e.toUpperCase(),i=0,a=l.length;i<a;++i)if(s=l[i].name.toUpperCase(),o=l[i].abbr.toUpperCase(),r=l[i].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(o===e)return l[i];break;case"NNNN":if(s===e)return l[i];break;case"NNNNN":if(r===e)return l[i]}else if(0<=[s,o,r].indexOf(e))return l[i]}function Vn(e,t){var n=e.since<=e.until?1:-1;return t===undefined?u(e.since).year():u(e.since).year()+(t-e.offset)*n}function Gn(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].name;if(i[e].until<=n&&n<=i[e].since)return i[e].name}return""}function Xn(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].narrow;if(i[e].until<=n&&n<=i[e].since)return i[e].narrow}return""}function Jn(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].abbr;if(i[e].until<=n&&n<=i[e].since)return i[e].abbr}return""}function Zn(){var e,t,n,i,a=this.localeData().eras();for(e=0,t=a.length;e<t;++e)if(n=a[e].since<=a[e].until?1:-1,i=this.clone().startOf("day").valueOf(),a[e].since<=i&&i<=a[e].until||a[e].until<=i&&i<=a[e].since)return(this.year()-u(a[e].since).year())*n+a[e].offset;return this.year()}function ei(e){return c(this,"_erasNameRegex")||ri.call(this),e?this._erasNameRegex:this._erasRegex}function ti(e){return c(this,"_erasAbbrRegex")||ri.call(this),e?this._erasAbbrRegex:this._erasRegex}function ni(e){return c(this,"_erasNarrowRegex")||ri.call(this),e?this._erasNarrowRegex:this._erasRegex}function ii(e,t){return t.erasAbbrRegex(e)}function ai(e,t){return t.erasNameRegex(e)}function si(e,t){return t.erasNarrowRegex(e)}function oi(e,t){return t._eraYearOrdinalRegex||Oa}function ri(){var e,t,n=[],i=[],a=[],s=[],o=this.eras();for(e=0,t=o.length;e<t;++e)i.push(ee(o[e].name)),n.push(ee(o[e].abbr)),a.push(ee(o[e].narrow)),s.push(ee(o[e].name)),s.push(ee(o[e].abbr)),s.push(ee(o[e].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+a.join("|")+")","i")}function li(e,t){x(0,[e,e.length],0,t)}function ci(e){return fi.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function di(e){return fi.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function ui(){return we(this.year(),1,4)}function _i(){return we(this.isoWeekYear(),1,4)}function hi(){var e=this.localeData()._week;return we(this.year(),e.dow,e.doy)}function pi(){var e=this.localeData()._week;return we(this.weekYear(),e.dow,e.doy)}function fi(e,t,n,i,a){var s;return null==e?$e(this,i,a).year:((s=we(e,i,a))<t&&(t=s),mi.call(this,e,t,n,i,a))}function mi(e,t,n,i,a){var s=ye(e,t,n,i,a),o=ve(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function gi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Ai(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function vi(e,t){t[za]=z(1e3*("0."+e))}function bi(){return this._isUTC?"UTC":""}function yi(){return this._isUTC?"Coordinated Universal Time":""}function $i(e){return Tt(1e3*e)}function wi(){return Tt.apply(null,arguments).parseZone()}function ki(e){return e}function Ci(e,t,n,i){var a=at(),s=p().set(i,t);return a[n](s,e)}function Ei(e,t,n){if(_(e)&&(t=e,e=undefined),e=e||"",null!=t)return Ci(e,t,n,"month");var i,a=[];for(i=0;i<12;i++)a[i]=Ci(e,i,n,"month");return a}function Ti(e,t,n,i){"boolean"==typeof e?_(t)&&(n=t,t=undefined):(t=e,e=!1,_(n=t)&&(n=t,t=undefined)),t=t||"";var a,s=at(),o=e?s._week.dow:0,r=[];if(null!=n)return Ci(t,(n+o)%7,i,"day");for(a=0;a<7;a++)r[a]=Ci(t,(a+o)%7,i,"day");return r}function xi(e,t){return Ei(e,t,"months")}function Ii(e,t){return Ei(e,t,"monthsShort")}function Di(e,t,n){return Ti(e,t,n,"weekdays")}function Oi(e,t,n){return Ti(e,t,n,"weekdaysShort")}function Si(e,t,n){return Ti(e,t,n,"weekdaysMin")}function Ri(){var e=this._data;return this._milliseconds=Us(this._milliseconds),this._days=Us(this._days),this._months=Us(this._months),e.milliseconds=Us(e.milliseconds),e.seconds=Us(e.seconds),e.minutes=Us(e.minutes),e.hours=Us(e.hours),e.months=Us(e.months),e.years=Us(e.years),this}function Bi(e,t,n,i){var a=Zt(t,n);return e._milliseconds+=i*a._milliseconds,e._days+=i*a._days,e._months+=i*a._months,e._bubble()}function Ni(e,t){return Bi(this,e,t,1)}function Fi(e,t){return Bi(this,e,t,-1)}function Ki(e){return e<0?Math.floor(e):Math.ceil(e)}function Mi(){var e,t,n,i,a,s=this._milliseconds,o=this._days,r=this._months,l=this._data;return 0<=s&&0<=o&&0<=r||s<=0&&o<=0&&r<=0||(s+=864e5*Ki(Li(r)+o),r=o=0),l.milliseconds=s%1e3,e=Q(s/1e3),l.seconds=e%60,t=Q(e/60),l.minutes=t%60,n=Q(t/60),l.hours=n%24,r+=a=Q(ji(o+=Q(n/24))),o-=Ki(Li(a)),i=Q(r/12),r%=12,l.days=o,l.months=r,l.years=i,this}function ji(e){return 4800*e/146097}function Li(e){return 146097*e/4800}function Pi(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=j(e))||"quarter"===e||"year"===e)switch(t=this._days+i/864e5,n=this._months+ji(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Li(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}}function Ui(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*z(this._months/12):NaN}function Hi(e){return function(){return this.as(e)}}function Qi(){return Zt(this)}function zi(e){return e=j(e),this.isValid()?this[e+"s"]():NaN}function qi(e){return function(){return this.isValid()?this._data[e]:NaN}}function Wi(){return Q(this.days()/7)}function Yi(e,t,n,i,a){return a.relativeTime(t||1,!!n,e,i)}function Vi(e,t,n,i){var a=Zt(e).abs(),s=so(a.as("s")),o=so(a.as("m")),r=so(a.as("h")),l=so(a.as("d")),c=so(a.as("M")),d=so(a.as("w")),u=so(a.as("y")),_=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||o<=1&&["m"]||o<n.m&&["mm",o]||r<=1&&["h"]||r<n.h&&["hh",r]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(_=_||d<=1&&["w"]||d<n.w&&["ww",d]),(_=_||c<=1&&["M"]||c<n.M&&["MM",c]||u<=1&&["y"]||["yy",u])[2]=t,_[3]=0<+e,_[4]=i,Yi.apply(null,_)}function Gi(e){return e===undefined?so:"function"==typeof e&&(so=e,!0)}function Xi(e,t){return oo[e]!==undefined&&(t===undefined?oo[e]:(oo[e]=t,"s"===e&&(oo.ss=t-1),!0))}function Ji(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,i,a=!1,s=oo;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(a=e),"object"==typeof t&&(s=Object.assign({},oo,t),null!=t.s&&null==t.ss&&(s.ss=t.s-1)),i=Vi(this,!a,s,n=this.localeData()),a&&(i=n.pastFuture(+this,i)),n.postformat(i)}function Zi(e){return(0<e)-(e<0)||+e}function ea(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,i,a,s,o,r,l=ro(this._milliseconds)/1e3,c=ro(this._days),d=ro(this._months),u=this.asSeconds();return u?(t=Q((e=Q(l/60))/60),l%=60,e%=60,n=Q(d/12),d%=12,i=l?l.toFixed(3).replace(/\.?0+$/,""):"",a=u<0?"-":"",s=Zi(this._months)!==Zi(u)?"-":"",o=Zi(this._days)!==Zi(u)?"-":"",r=Zi(this._milliseconds)!==Zi(u)?"-":"",a+"P"+(n?s+n+"Y":"")+(d?s+d+"M":"")+(c?o+c+"D":"")+(t||e||l?"T":"")+(t?r+t+"H":"")+(e?r+e+"M":"")+(l?r+i+"S":"")):"P0D"}var ta,na;na=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),i=n.length>>>0;for(t=0;t<i;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var ia,aa=u.momentProperties=[],sa=!1,oa={};u.suppressDeprecationWarnings=!1,u.deprecationHandler=null,ia=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};var ra,la={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},ca=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,da=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ua={},_a={},ha={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},pa="Invalid date",fa="%d",ma=/\d{1,2}/,ga={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Aa={},va={},ba=/\d/,ya=/\d\d/,$a=/\d{3}/,wa=/\d{4}/,ka=/[+-]?\d{6}/,Ca=/\d\d?/,Ea=/\d\d\d\d?/,Ta=/\d\d\d\d\d\d?/,xa=/\d{1,3}/,Ia=/\d{1,4}/,Da=/[+-]?\d{1,6}/,Oa=/\d+/,Sa=/[+-]?\d+/,Ra=/Z|[+-]\d\d:?\d\d/gi,Ba=/Z|[+-]\d\d(?::?\d\d)?/gi,Na=/[+-]?\d+(\.\d{1,3})?/,Fa=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;ra={};var Ka,Ma={},ja=0,La=1,Pa=2,Ua=3,Ha=4,Qa=5,za=6,qa=7,Wa=8;Ka=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},x("M",["MM",2],"Mo",function(){return this.month()+1}),x("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),x("MMMM",0,0,function(e){return this.localeData().months(this,e)}),M("month","M"),P("month",8),X("M",Ca),X("MM",Ca,ya),X("MMM",function(e,t){return t.monthsShortRegex(e)}),X("MMMM",function(e,t){return t.monthsRegex(e)}),te(["M","MM"],function(e,t){t[La]=z(e)-1}),te(["MMM","MMMM"],function(e,t,n,i){var a=n._locale.monthsParse(e,i,n._strict);null!=a?t[La]=a:f(n).invalidMonth=e});var Ya="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Va="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ga=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Xa=Fa,Ja=Fa;x("Y",0,0,function(){var e=this.year();return e<=9999?T(e,4):"+"+e}),x(0,["YY",2],0,function(){return this.year()%100}),x(0,["YYYY",4],0,"year"),x(0,["YYYYY",5],0,"year"),x(0,["YYYYYY",6,!0],0,"year"),M("year","y"),P("year",1),X("Y",Sa),X("YY",Ca,ya),X("YYYY",Ia,wa),X("YYYYY",Da,ka),X("YYYYYY",Da,ka),te(["YYYYY","YYYYYY"],ja),te("YYYY",function(e,t){t[ja]=2===e.length?u.parseTwoDigitYear(e):z(e)}),te("YY",function(e,t){t[ja]=u.parseTwoDigitYear(e)}),te("Y",function(e,t){t[ja]=parseInt(e,10)}),u.parseTwoDigitYear=function(e){return z(e)+(68<z(e)?1900:2e3)};var Za=q("FullYear",!0);x("w",["ww",2],"wo","week"),x("W",["WW",2],"Wo","isoWeek"),M("week","w"),M("isoWeek","W"),P("week",5),P("isoWeek",5),X("w",Ca),X("ww",Ca,ya),X("W",Ca),X("WW",Ca,ya),ne(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=z(e)});var es={dow:0,doy:6};x("d",0,"do","day"),x("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),x("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),x("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),x("e",0,0,"weekday"),x("E",0,0,"isoWeekday"),M("day","d"),M("weekday","e"),M("isoWeekday","E"),P("day",11),P("weekday",11),P("isoWeekday",11),X("d",Ca),X("e",Ca),X("E",Ca),X("dd",function(e,t){return t.weekdaysMinRegex(e)}),X("ddd",function(e,t){return t.weekdaysShortRegex(e)}),X("dddd",function(e,t){return t.weekdaysRegex(e)}),ne(["dd","ddd","dddd"],function(e,t,n,i){var a=n._locale.weekdaysParse(e,i,n._strict);null!=a?t.d=a:f(n).invalidWeekday=e}),ne(["d","e","E"],function(e,t,n,i){t[i]=z(e)});var ts="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
ns="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),is="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),as=Fa,ss=Fa,os=Fa;x("H",["HH",2],0,"hour"),x("h",["hh",2],0,Qe),x("k",["kk",2],0,ze),x("hmm",0,0,function(){return""+Qe.apply(this)+T(this.minutes(),2)}),x("hmmss",0,0,function(){return""+Qe.apply(this)+T(this.minutes(),2)+T(this.seconds(),2)}),x("Hmm",0,0,function(){return""+this.hours()+T(this.minutes(),2)}),x("Hmmss",0,0,function(){return""+this.hours()+T(this.minutes(),2)+T(this.seconds(),2)}),qe("a",!0),qe("A",!1),M("hour","h"),P("hour",13),X("a",We),X("A",We),X("H",Ca),X("h",Ca),X("k",Ca),X("HH",Ca,ya),X("hh",Ca,ya),X("kk",Ca,ya),X("hmm",Ea),X("hmmss",Ta),X("Hmm",Ea),X("Hmmss",Ta),te(["H","HH"],Ua),te(["k","kk"],function(e,t){var n=z(e);t[Ua]=24===n?0:n}),te(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),te(["h","hh"],function(e,t,n){t[Ua]=z(e),f(n).bigHour=!0}),te("hmm",function(e,t,n){var i=e.length-2;t[Ua]=z(e.substr(0,i)),t[Ha]=z(e.substr(i)),f(n).bigHour=!0}),te("hmmss",function(e,t,n){var i=e.length-4,a=e.length-2;t[Ua]=z(e.substr(0,i)),t[Ha]=z(e.substr(i,2)),t[Qa]=z(e.substr(a)),f(n).bigHour=!0}),te("Hmm",function(e,t){var n=e.length-2;t[Ua]=z(e.substr(0,n)),t[Ha]=z(e.substr(n))}),te("Hmmss",function(e,t){var n=e.length-4,i=e.length-2;t[Ua]=z(e.substr(0,n)),t[Ha]=z(e.substr(n,2)),t[Qa]=z(e.substr(i))});var rs,ls=/[ap]\.?m?\.?/i,cs=q("Hours",!0),ds={calendar:la,longDateFormat:ha,invalidDate:pa,ordinal:fa,dayOfMonthOrdinalParse:ma,relativeTime:ga,months:Ya,monthsShort:Va,week:es,weekdays:ts,weekdaysMin:is,weekdaysShort:ns,meridiemParse:ls},us={},_s={},hs=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ps=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,fs=/Z|[+-]\d\d(?::?\d\d)?/,ms=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],gs=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],As=/^\/?Date\((-?\d+)/i,vs=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,bs={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};u.createFromInputFallback=n("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),u.ISO_8601=function(){},u.RFC_2822=function(){};var ys=n("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:s()}),$s=n("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Tt.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:s()}),ws=function(){return Date.now?Date.now():+new Date},ks=["year","quarter","month","week","day","hour","minute","second","millisecond"];Mt("Z",":"),Mt("ZZ",""),X("Z",Ba),X("ZZ",Ba),te(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=jt(Ba,e)});var Cs=/([\+\-]|\d\d)/gi;u.updateOffset=function(){};var Es=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Ts=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Zt.fn=Bt.prototype,Zt.invalid=Rt;var xs=an(1,"add"),Is=an(-1,"subtract");u.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",u.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Ds=n("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===undefined?this.localeData():this.locale(e)}),Os=1e3,Ss=60*Os,Rs=60*Ss,Bs=3506328*Rs;x("N",0,0,"eraAbbr"),x("NN",0,0,"eraAbbr"),x("NNN",0,0,"eraAbbr"),x("NNNN",0,0,"eraName"),x("NNNNN",0,0,"eraNarrow"),x("y",["y",1],"yo","eraYear"),x("y",["yy",2],0,"eraYear"),x("y",["yyy",3],0,"eraYear"),x("y",["yyyy",4],0,"eraYear"),X("N",ii),X("NN",ii),X("NNN",ii),X("NNNN",ai),X("NNNNN",si),te(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,i){var a=n._locale.erasParse(e,i,n._strict);a?f(n).era=a:f(n).invalidEra=e}),X("y",Oa),X("yy",Oa),X("yyy",Oa),X("yyyy",Oa),X("yo",oi),te(["y","yy","yyy","yyyy"],ja),te(["yo"],function(e,t,n){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[ja]=n._locale.eraYearOrdinalParse(e,i):t[ja]=parseInt(e,10)}),x(0,["gg",2],0,function(){return this.weekYear()%100}),x(0,["GG",2],0,function(){return this.isoWeekYear()%100}),li("gggg","weekYear"),li("ggggg","weekYear"),li("GGGG","isoWeekYear"),li("GGGGG","isoWeekYear"),M("weekYear","gg"),M("isoWeekYear","GG"),P("weekYear",1),P("isoWeekYear",1),X("G",Sa),X("g",Sa),X("GG",Ca,ya),X("gg",Ca,ya),X("GGGG",Ia,wa),X("gggg",Ia,wa),X("GGGGG",Da,ka),X("ggggg",Da,ka),ne(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,i){t[i.substr(0,2)]=z(e)}),ne(["gg","GG"],function(e,t,n,i){t[i]=u.parseTwoDigitYear(e)}),x("Q",0,"Qo","quarter"),M("quarter","Q"),P("quarter",7),X("Q",ba),te("Q",function(e,t){t[La]=3*(z(e)-1)}),x("D",["DD",2],"Do","date"),M("date","D"),P("date",9),X("D",Ca),X("DD",Ca,ya),X("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),te(["D","DD"],Pa),te("Do",function(e,t){t[Pa]=z(e.match(Ca)[0])});var Ns=q("Date",!0);x("DDD",["DDDD",3],"DDDo","dayOfYear"),M("dayOfYear","DDD"),P("dayOfYear",4),X("DDD",xa),X("DDDD",$a),te(["DDD","DDDD"],function(e,t,n){n._dayOfYear=z(e)}),x("m",["mm",2],0,"minute"),M("minute","m"),P("minute",14),X("m",Ca),X("mm",Ca,ya),te(["m","mm"],Ha);var Fs=q("Minutes",!1);x("s",["ss",2],0,"second"),M("second","s"),P("second",15),X("s",Ca),X("ss",Ca,ya),te(["s","ss"],Qa);var Ks,Ms,js=q("Seconds",!1);for(x("S",0,0,function(){return~~(this.millisecond()/100)}),x(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),x(0,["SSS",3],0,"millisecond"),x(0,["SSSS",4],0,function(){return 10*this.millisecond()}),x(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),x(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),x(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),x(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),x(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),M("millisecond","ms"),P("millisecond",16),X("S",xa,ba),X("SS",xa,ya),X("SSS",xa,$a),Ks="SSSS";Ks.length<=9;Ks+="S")X(Ks,Oa);for(Ks="S";Ks.length<=9;Ks+="S")te(Ks,vi);Ms=q("Milliseconds",!1),x("z",0,0,"zoneAbbr"),x("zz",0,0,"zoneName");var Ls=A.prototype;Ls.add=xs,Ls.calendar=_n,Ls.clone=hn,Ls.diff=bn,Ls.endOf=Fn,Ls.format=Cn,Ls.from=En,Ls.fromNow=Tn,Ls.to=xn,Ls.toNow=In,Ls.get=V,Ls.invalidAt=zn,Ls.isAfter=pn,Ls.isBefore=fn,Ls.isBetween=mn,Ls.isSame=gn,Ls.isSameOrAfter=An,Ls.isSameOrBefore=vn,Ls.isValid=Hn,Ls.lang=Ds,Ls.locale=Dn,Ls.localeData=On,Ls.max=$s,Ls.min=ys,Ls.parsingFlags=Qn,Ls.set=G,Ls.startOf=Nn,Ls.subtract=Is,Ls.toArray=Ln,Ls.toObject=Pn,Ls.toDate=jn,Ls.toISOString=wn,Ls.inspect=kn,"undefined"!=typeof Symbol&&null!=Symbol["for"]&&(Ls[Symbol["for"]("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ls.toJSON=Un,Ls.toString=$n,Ls.unix=Mn,Ls.valueOf=Kn,Ls.creationData=qn,Ls.eraName=Gn,Ls.eraNarrow=Xn,Ls.eraAbbr=Jn,Ls.eraYear=Zn,Ls.year=Za,Ls.isLeapYear=ge,Ls.weekYear=ci,Ls.isoWeekYear=di,Ls.quarter=Ls.quarters=gi,Ls.month=ue,Ls.daysInMonth=_e,Ls.week=Ls.weeks=Te,Ls.isoWeek=Ls.isoWeeks=xe,Ls.weeksInYear=hi,Ls.weeksInWeekYear=pi,Ls.isoWeeksInYear=ui,Ls.isoWeeksInISOWeekYear=_i,Ls.date=Ns,Ls.day=Ls.days=Ke,Ls.weekday=Me,Ls.isoWeekday=je,Ls.dayOfYear=Ai,Ls.hour=Ls.hours=cs,Ls.minute=Ls.minutes=Fs,Ls.second=Ls.seconds=js,Ls.millisecond=Ls.milliseconds=Ms,Ls.utcOffset=Ut,Ls.utc=Qt,Ls.local=zt,Ls.parseZone=qt,Ls.hasAlignedHourOffset=Wt,Ls.isDST=Yt,Ls.isLocal=Gt,Ls.isUtcOffset=Xt,Ls.isUtc=Jt,Ls.isUTC=Jt,Ls.zoneAbbr=bi,Ls.zoneName=yi,Ls.dates=n("dates accessor is deprecated. Use date instead.",Ns),Ls.months=n("months accessor is deprecated. Use month instead",ue),Ls.years=n("years accessor is deprecated. Use year instead",Za),Ls.zone=n("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ht),Ls.isDSTShifted=n("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Vt);var Ps=C.prototype;Ps.calendar=E,Ps.longDateFormat=R,Ps.invalidDate=B,Ps.ordinal=N,Ps.preparse=ki,Ps.postformat=ki,Ps.relativeTime=F,Ps.pastFuture=K,Ps.set=w,Ps.eras=Wn,Ps.erasParse=Yn,Ps.erasConvertYear=Vn,Ps.erasAbbrRegex=ti,Ps.erasNameRegex=ei,Ps.erasNarrowRegex=ni,Ps.months=oe,Ps.monthsShort=re,Ps.monthsParse=ce,Ps.monthsRegex=pe,Ps.monthsShortRegex=he,Ps.week=ke,Ps.firstDayOfYear=Ee,Ps.firstDayOfWeek=Ce,Ps.weekdays=Se,Ps.weekdaysMin=Be,Ps.weekdaysShort=Re,Ps.weekdaysParse=Fe,Ps.weekdaysRegex=Le,Ps.weekdaysShortRegex=Pe,Ps.weekdaysMinRegex=Ue,Ps.isPM=Ye,Ps.meridiem=Ve,tt("en",{eras:[{since:"0001-01-01",until:+Infinity,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-Infinity,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===z(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),u.lang=n("moment.lang is deprecated. Use moment.locale instead.",tt),u.langData=n("moment.langData is deprecated. Use moment.localeData instead.",at);var Us=Math.abs,Hs=Hi("ms"),Qs=Hi("s"),zs=Hi("m"),qs=Hi("h"),Ws=Hi("d"),Ys=Hi("w"),Vs=Hi("M"),Gs=Hi("Q"),Xs=Hi("y"),Js=qi("milliseconds"),Zs=qi("seconds"),eo=qi("minutes"),to=qi("hours"),no=qi("days"),io=qi("months"),ao=qi("years"),so=Math.round,oo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11},ro=Math.abs,lo=Bt.prototype;return lo.isValid=St,lo.abs=Ri,lo.add=Ni,lo.subtract=Fi,lo.as=Pi,lo.asMilliseconds=Hs,lo.asSeconds=Qs,lo.asMinutes=zs,lo.asHours=qs,lo.asDays=Ws,lo.asWeeks=Ys,lo.asMonths=Vs,lo.asQuarters=Gs,lo.asYears=Xs,lo.valueOf=Ui,lo._bubble=Mi,lo.clone=Qi,lo.get=zi,lo.milliseconds=Js,lo.seconds=Zs,lo.minutes=eo,lo.hours=to,lo.days=no,lo.weeks=Wi,lo.months=io,lo.years=ao,lo.humanize=Ji,lo.toISOString=ea,lo.toString=ea,lo.toJSON=ea,lo.locale=Dn,lo.localeData=On,lo.toIsoString=n("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ea),lo.lang=Ds,x("X",0,0,"unix"),x("x",0,0,"valueOf"),X("x",Sa),X("X",Na),te("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),te("x",function(e,t,n){n._d=new Date(z(e))}),u.version="2.29.4",e(Tt),u.fn=Ls,u.min=It,u.max=Dt,u.now=ws,u.utc=p,u.unix=$i,u.months=xi,u.isDate=a,u.locale=tt,u.invalid=s,u.duration=Zt,u.isMoment=v,u.weekdays=Di,u.parseZone=wi,u.localeData=at,u.isDuration=Nt,u.monthsShort=Ii,u.weekdaysMin=Si,u.defineLocale=nt,u.updateLocale=it,u.locales=st,u.weekdaysShort=Oi,u.normalizeUnits=j,u.relativeTimeRounding=Gi,u.relativeTimeThreshold=Xi,u.calendarFormat=un,u.prototype=Ls,u.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},u}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module&&"function"==typeof require?t(require("../moment")):"function"==typeof define&&define.amd?define(["../moment"],t):t(e.moment)}(this,function(e){"use strict";return e.defineLocale("ja",{eras:[{since:"2019-05-01",offset:1,name:"\u4ee4\u548c",narrow:"\u32ff",abbr:"R"},{since:"1989-01-08",until:"2019-04-30",offset:1,name:"\u5e73\u6210",narrow:"\u337b",abbr:"H"},{since:"1926-12-25",until:"1989-01-07",offset:1,name:"\u662d\u548c",narrow:"\u337c",abbr:"S"},{since:"1912-07-30",until:"1926-12-24",offset:1,name:"\u5927\u6b63",narrow:"\u337d",abbr:"T"},{since:"1873-01-01",until:"1912-07-29",offset:6,name:"\u660e\u6cbb",narrow:"\u337e",abbr:"M"},{since:"0001-01-01",until:"1873-12-31",offset:1,name:"\u897f\u66a6",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-Infinity,offset:1,name:"\u7d00\u5143\u524d",narrow:"BC",abbr:"BC"}],eraYearOrdinalRegex:/(\u5143|\d+)\u5e74/,eraYearOrdinalParse:function(e,t){return"\u5143"===t[1]?1:parseInt(t[1]||e,10)},months:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),weekdays:"\u65e5\u66dc\u65e5_\u6708\u66dc\u65e5_\u706b\u66dc\u65e5_\u6c34\u66dc\u65e5_\u6728\u66dc\u65e5_\u91d1\u66dc\u65e5_\u571f\u66dc\u65e5".split("_"),weekdaysShort:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),weekdaysMin:"\u65e5_\u6708_\u706b_\u6c34_\u6728_\u91d1_\u571f".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5e74M\u6708D\u65e5",LLL:"YYYY\u5e74M\u6708D\u65e5 HH:mm",LLLL:"YYYY\u5e74M\u6708D\u65e5 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY\u5e74M\u6708D\u65e5",lll:"YYYY\u5e74M\u6708D\u65e5 HH:mm",llll:"YYYY\u5e74M\u6708D\u65e5(ddd) HH:mm"},meridiemParse:/\u5348\u524d|\u5348\u5f8c/i,isPM:function(e){return"\u5348\u5f8c"===e},meridiem:function(e){return e<12?"\u5348\u524d":"\u5348\u5f8c"},calendar:{sameDay:"[\u4eca\u65e5] LT",nextDay:"[\u660e\u65e5] LT",nextWeek:function(e){return e.week()!==this.week()?"[\u6765\u9031]dddd LT":"dddd LT"},lastDay:"[\u6628\u65e5] LT",lastWeek:function(e){return this.week()!==e.week()?"[\u5148\u9031]dddd LT":"dddd LT"},sameElse:"L"},dayOfMonthOrdinalParse:/\d{1,2}\u65e5/,ordinal:function(e,t){switch(t){case"y":return 1===e?"\u5143\u5e74":e+"\u5e74";case"d":case"D":case"DDD":return e+"\u65e5";default:return e}},relativeTime:{future:"%s\u5f8c",past:"%s\u524d",s:"\u6570\u79d2",ss:"%d\u79d2",m:"1\u5206",mm:"%d\u5206",h:"1\u6642\u9593",hh:"%d\u6642\u9593",d:"1\u65e5",dd:"%d\u65e5",M:"1\u30f6\u6708",MM:"%d\u30f6\u6708",y:"1\u5e74",yy:"%d\u5e74"}})}),function(e){"use strict";if("function"==typeof define&&define.amd)define(["jquery","moment"],e);else if("object"==typeof exports)module.exports=e(require("jquery"),require("moment"));else{if("undefined"==typeof jQuery)throw"bootstrap-datetimepicker requires jQuery to be loaded first";if("undefined"==typeof moment)throw"bootstrap-datetimepicker requires Moment.js to be loaded first";e(jQuery,moment)}}(function(pe,fe){"use strict";if(!fe)throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");var s=function(s,d){var c,u,n,o,i,a,r,_={},l=!0,h=!1,p=!1,f=0,t=[{clsName:"days",navFnc:"M",navStep:1},{clsName:"months",navFnc:"y",navStep:1},{clsName:"years",navFnc:"y",navStep:10},{clsName:"decades",navFnc:"y",navStep:100}],m=["days","months","years","decades"],g=["top","bottom","auto"],A=["left","right","auto"],v=["default","top","bottom"],b={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t","delete":46,46:"delete"},y={},$=function(){return fe.tz!==undefined&&d.timeZone!==undefined&&null!==d.timeZone&&""!==d.timeZone},w=function(e){var t;return t=e===undefined||null===e?fe():fe.isDate(e)||fe.isMoment(e)?fe(e):$()?fe.tz(e,a,d.useStrict,d.timeZone):fe(e,a,d.useStrict),$()&&t.tz(d.timeZone),t},k=function(e){if("string"!=typeof e||1<e.length)throw new TypeError("isEnabled expects a single character string parameter");switch(e){case"y":return-1!==i.indexOf("Y");case"M":return-1!==i.indexOf("M");case"d":return-1!==i.toLowerCase().indexOf("d");case"h":case"H":return-1!==i.toLowerCase().indexOf("h");case"m":return-1!==i.indexOf("m");case"s":return-1!==i.indexOf("s");default:return!1}},C=function(){return k("h")||k("m")||k("s")},E=function(){return k("y")||k("M")||k("d")},T=function(){var e=pe("<thead>").append(pe("<tr>").append(pe("<th>").addClass("prev").attr("data-action","previous").append(pe("<span>").addClass(d.icons.previous))).append(pe("<th>").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",d.calendarWeeks?"6":"5")).append(pe("<th>").addClass("next").attr("data-action","next").append(pe("<span>").addClass(d.icons.next)))),t=pe("<tbody>").append(pe("<tr>").append(pe("<td>").attr("colspan",d.calendarWeeks?"8":"7")));return[pe("<div>").addClass("datepicker-days").append(pe("<table>").addClass("table-condensed").append(e).append(pe("<tbody>"))),pe("<div>").addClass("datepicker-months").append(pe("<table>").addClass("table-condensed").append(e.clone()).append(t.clone())),pe("<div>").addClass("datepicker-years").append(pe("<table>").addClass("table-condensed").append(e.clone()).append(t.clone())),pe("<div>").addClass("datepicker-decades").append(pe("<table>").addClass("table-condensed").append(e.clone()).append(t.clone()))]},x=function(){var e=pe("<tr>"),t=pe("<tr>"),n=pe("<tr>");return k("h")&&(e.append(pe("<td>").append(pe("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(pe("<span>").addClass(d.icons.up)))),t.append(pe("<td>").append(pe("<span>").addClass("timepicker-hour").attr({"data-time-component":"hours",title:d.tooltips.pickHour}).attr("data-action","showHours"))),n.append(pe("<td>").append(pe("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(pe("<span>").addClass(d.icons.down))))),k("m")&&(k("h")&&(e.append(pe("<td>").addClass("separator")),t.append(pe("<td>").addClass("separator").html(":")),n.append(pe("<td>").addClass("separator"))),e.append(pe("<td>").append(pe("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(pe("<span>").addClass(d.icons.up)))),t.append(pe("<td>").append(pe("<span>").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:d.tooltips.pickMinute}).attr("data-action","showMinutes"))),n.append(pe("<td>").append(pe("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(pe("<span>").addClass(d.icons.down))))),k("s")&&(k("m")&&(e.append(pe("<td>").addClass("separator")),t.append(pe("<td>").addClass("separator").html(":")),n.append(pe("<td>").addClass("separator"))),e.append(pe("<td>").append(pe("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(pe("<span>").addClass(d.icons.up)))),t.append(pe("<td>").append(pe("<span>").addClass("timepicker-second").attr({"data-time-component":"seconds",title:d.tooltips.pickSecond}).attr("data-action","showSeconds"))),n.append(pe("<td>").append(pe("<a>").attr({href:"#",tabindex:"-1",title:d.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(pe("<span>").addClass(d.icons.down))))),o||(e.append(pe("<td>").addClass("separator")),t.append(pe("<td>").append(pe("<button>").addClass("btn btn-primary").attr({"data-action":"togglePeriod",tabindex:"-1",title:d.tooltips.togglePeriod}))),n.append(pe("<td>").addClass("separator"))),pe("<div>").addClass("timepicker-picker").append(pe("<table>").addClass("table-condensed").append([e,t,n]))},I=function(){var e=pe("<div>").addClass("timepicker-hours").append(pe("<table>").addClass("table-condensed")),t=pe("<div>").addClass("timepicker-minutes").append(pe("<table>").addClass("table-condensed")),n=pe("<div>").addClass("timepicker-seconds").append(pe("<table>").addClass("table-condensed")),i=[x()];return k("h")&&i.push(e),k("m")&&i.push(t),k("s")&&i.push(n),i},D=function(){var e=[];return d.showTodayButton&&e.push(pe("<td>").append(pe("<a>").attr({"data-action":"today",title:d.tooltips.today}).append(pe("<span>").addClass(d.icons.today)))),!d.sideBySide&&E()&&C()&&e.push(pe("<td>").append(pe("<a>").attr({"data-action":"togglePicker",title:d.tooltips.selectTime}).append(pe("<span>").addClass(d.icons.time)))),d.showClear&&e.push(pe("<td>").append(pe("<a>").attr({"data-action":"clear",title:d.tooltips.clear}).append(pe("<span>").addClass(d.icons.clear)))),d.showClose&&e.push(pe("<td>").append(pe("<a>").attr({"data-action":"close",title:d.tooltips.close}).append(pe("<span>").addClass(d.icons.close)))),pe("<table>").addClass("table-condensed").append(pe("<tbody>").append(pe("<tr>").append(e)))},O=function(){var e=pe("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),t=pe("<div>").addClass("datepicker").append(T()),n=pe("<div>").addClass("timepicker").append(I()),i=pe("<ul>").addClass("list-unstyled"),a=pe("<li>").addClass("picker-switch"+(d.collapse?" accordion-toggle":"")).append(D());return d.inline&&e.removeClass("dropdown-menu"),o&&e.addClass("usetwentyfour"),k("s")&&!o&&e.addClass("wider"),d.sideBySide&&E()&&C()?(e.addClass("timepicker-sbs"),"top"===d.toolbarPlacement&&e.append(a),e.append(pe("<div>").addClass("row").append(t.addClass("col-md-6")).append(n.addClass("col-md-6"))),"bottom"===d.toolbarPlacement&&e.append(a),e):("top"===d.toolbarPlacement&&i.append(a),E()&&i.append(pe("<li>").addClass(d.collapse&&C()?"collapse in":"").append(t)),"default"===d.toolbarPlacement&&i.append(a),C()&&i.append(pe("<li>").addClass(d.collapse&&E()?"collapse":"").append(n)),"bottom"===d.toolbarPlacement&&i.append(a),e.append(i))},e=function(){var n,i={};return(n=s.is("input")||d.inline?s.data():s.find("input").data()).dateOptions&&n.dateOptions instanceof Object&&(i=pe.extend(!0,i,n.dateOptions)),pe.each(d,function(e){var t="date"+e.charAt(0).toUpperCase()+e.slice(1);n[t]!==undefined&&(i[e]=n[t])}),i},S=function(){var e,t=(h||s).position(),n=(h||s).offset(),i=d.widgetPositioning.vertical,a=d.widgetPositioning.horizontal;if(d.widgetParent)e=d.widgetParent.append(p);else if(s.is("input"))e=s.after(p).parent();else{if(d.inline)return void(e=s.append(p));(e=s).children().first().after(p)}if("auto"===i&&(i=n.top+1.5*p.height()>=pe(window).height()+pe(window).scrollTop()&&p.height()+s.outerHeight()<n.top?"top":"bottom"),"auto"===a&&(a=e.width()<n.left+p.outerWidth()/2&&n.left+p.outerWidth()>pe(window).width()?"right":"left"),"top"===i?p.addClass("top").removeClass("bottom"):p.addClass("bottom").removeClass("top"),"right"===a?p.addClass("pull-right"):p.removeClass("pull-right"),"static"===e.css("position")&&(e=e.parents().filter(function(){return"static"!==pe(this).css("position")}).first()),0===e.length)throw new Error("datetimepicker component should be placed within a non-static positioned container");p.css({top:"top"===i?"auto":t.top+s.outerHeight(),bottom:"top"===i?e.outerHeight()-(e===s?0:t.top):"auto",left:"left"===a?e===s?0:t.left:"auto",right:"left"===a?"auto":e.outerWidth()-s.outerWidth()-(e===s?0:t.left)})},R=function(e){"dp.change"===e.type&&(e.date&&e.date.isSame(e.oldDate)||!e.date&&!e.oldDate)||s.trigger(e)},B=function(e){"y"===e&&(e="YYYY"),R({type:"dp.update",change:e,viewDate:u.clone()})},N=function(e){p&&(e&&(r=Math.max(f,Math.min(3,r+e))),p.find(".datepicker > div").hide().filter(".datepicker-"+t[r].clsName).show())},F=function(){var e=pe("<tr>"),t=u.clone().startOf("w").startOf("d");for(!0===d.calendarWeeks&&e.append(pe("<th>").addClass("cw").text("#"));t.isBefore(u.clone().endOf("w"));)e.append(pe("<th>").addClass("dow").text(t.format("dd"))),t.add(1,"d");p.find(".datepicker-days thead").append(e)},K=function(e){return!0===d.disabledDates[e.format("YYYY-MM-DD")]},M=function(e){return!0===d.enabledDates[e.format("YYYY-MM-DD")]},j=function(e){return!0===d.disabledHours[e.format("H")]},L=function(e){return!0===d.enabledHours[e.format("H")]},P=function(e,t){if(!e.isValid())return!1;if(d.disabledDates&&"d"===t&&K(e))return!1;if(d.enabledDates&&"d"===t&&!M(e))return!1;if(d.minDate&&e.isBefore(d.minDate,t))return!1;if(d.maxDate&&e.isAfter(d.maxDate,t))return!1;if(d.daysOfWeekDisabled&&"d"===t&&-1!==d.daysOfWeekDisabled.indexOf(e.day()))return!1;if(d.disabledHours&&("h"===t||"m"===t||"s"===t)&&j(e))return!1;if(d.enabledHours&&("h"===t||"m"===t||"s"===t)&&!L(e))return!1;if(d.disabledTimeIntervals&&("h"===t||"m"===t||"s"===t)){var n=!1;if(pe.each(d.disabledTimeIntervals,function(){if(e.isBetween(this[0],this[1]))return!(n=!0)}),n)return!1}return!0},U=function(){for(var e=[],t=u.clone().startOf("y").startOf("d");t.isSame(u,"y");)e.push(pe("<span>").attr("data-action","selectMonth").addClass("month").text(t.format("MMM"))),t.add(1,"M");p.find(".datepicker-months td").empty().append(e)},H=function(){var e=p.find(".datepicker-months"),t=e.find("th"),n=e.find("tbody").find("span");t.eq(0).find("span").attr("title",d.tooltips.prevYear),t.eq(1).attr("title",d.tooltips.selectYear),t.eq(2).find("span").attr("title",d.tooltips.nextYear),e.find(".disabled").removeClass("disabled"),P(u.clone().subtract(1,"y"),"y")||t.eq(0).addClass("disabled"),t.eq(1).text(u.year()),P(u.clone().add(1,"y"),"y")||t.eq(2).addClass("disabled"),n.removeClass("active"),c.isSame(u,"y")&&!l&&n.eq(c.month()).addClass("active"),n.each(function(e){P(u.clone().month(e),"M")||pe(this).addClass("disabled")})},Q=function(){var e=p.find(".datepicker-years"),t=e.find("th"),n=u.clone().subtract(5,"y"),i=u.clone().add(6,"y"),a="";for(t.eq(0).find("span").attr("title",d.tooltips.prevDecade),t.eq(1).attr("title",d.tooltips.selectDecade),t.eq(2).find("span").attr("title",d.tooltips.nextDecade),e.find(".disabled").removeClass("disabled"),d.minDate&&d.minDate.isAfter(n,"y")&&t.eq(0).addClass("disabled"),t.eq(1).text(n.year()+"-"+i.year()),d.maxDate&&d.maxDate.isBefore(i,"y")&&t.eq(2).addClass("disabled");!n.isAfter(i,"y");)a+='<span data-action="selectYear" class="year'+(n.isSame(c,"y")&&!l?" active":"")+(P(n,"y")?"":" disabled")+'">'+n.year()+"</span>",n.add(1,"y");e.find("td").html(a)},z=function(){var e,t=p.find(".datepicker-decades"),n=t.find("th"),i=fe({y:u.year()-u.year()%100-1}),a=i.clone().add(100,"y"),s=i.clone(),o=!1,r=!1,l="";for(n.eq(0).find("span").attr("title",d.tooltips.prevCentury),n.eq(2).find("span").attr("title",d.tooltips.nextCentury),t.find(".disabled").removeClass("disabled"),(i.isSame(fe({y:1900}))||d.minDate&&d.minDate.isAfter(i,"y"))&&n.eq(0).addClass("disabled"),n.eq(1).text(i.year()+"-"+a.year()),(i.isSame(fe({y:2e3}))||d.maxDate&&d.maxDate.isBefore(a,"y"))&&n.eq(2).addClass("disabled");!i.isAfter(a,"y");)e=i.year()+12,o=d.minDate&&d.minDate.isAfter(i,"y")&&d.minDate.year()<=e,r=d.maxDate&&d.maxDate.isAfter(i,"y")&&d.maxDate.year()<=e,l+='<span data-action="selectDecade" class="decade'+(c.isAfter(i)&&c.year()<=e?" active":"")+(P(i,"y")||o||r?"":" disabled")+'" data-selection="'+(i.year()+6)+'">'+(i.year()+1)+" - "+(i.year()+12)+"</span>",i.add(12,"y");l+="<span></span><span></span><span></span>",t.find("td").html(l),n.eq(1).text(s.year()+1+"-"+i.year())},q=function(){var e,t,n,i=p.find(".datepicker-days"),a=i.find("th"),s=[],o=[];if(E()){for(a.eq(0).find("span").attr("title",d.tooltips.prevMonth),a.eq(1).attr("title",d.tooltips.selectMonth),a.eq(2).find("span").attr("title",d.tooltips.nextMonth),i.find(".disabled").removeClass("disabled"),a.eq(1).text(u.format(d.dayViewHeaderFormat)),P(u.clone().subtract(1,"M"),"M")||a.eq(0).addClass("disabled"),P(u.clone().add(1,"M"),"M")||a.eq(2).addClass("disabled"),e=u.clone().startOf("M").startOf("w").startOf("d"),n=0;n<42;n++)0===e.weekday()&&(t=pe("<tr>"),d.calendarWeeks&&t.append('<td class="cw">'+e.week()+"</td>"),s.push(t)),o=["day"],e.isBefore(u,"M")&&o.push("old"),e.isAfter(u,"M")&&o.push("new"),e.isSame(c,"d")&&!l&&o.push("active"),P(e,"d")||o.push("disabled"),e.isSame(w(),"d")&&o.push("today"),0!==e.day()&&6!==e.day()||o.push("weekend"),R({type:"dp.classify",date:e,classNames:o}),t.append('<td data-action="selectDay" data-day="'+e.format("L")+'" class="'+o.join(" ")+'">'+e.date()+"</td>"),e.add(1,"d");i.find("tbody").empty().append(s),H(),Q(),z()}},W=function(){var e=p.find(".timepicker-hours table"),t=u.clone().startOf("d"),n=[],i=pe("<tr>");for(11<u.hour()&&!o&&t.hour(12);t.isSame(u,"d")&&(o||u.hour()<12&&t.hour()<12||11<u.hour());)t.hour()%4==0&&(i=pe("<tr>"),n.push(i)),i.append('<td data-action="selectHour" class="hour'+(P(t,"h")?"":" disabled")+'">'+t.format(o?"HH":"hh")+"</td>"),t.add(1,"h");e.empty().append(n)},Y=function(){for(var e=p.find(".timepicker-minutes table"),t=u.clone().startOf("h"),n=[],i=pe("<tr>"),a=1===d.stepping?5:d.stepping;u.isSame(t,"h");)t.minute()%(4*a)==0&&(i=pe("<tr>"),n.push(i)),i.append('<td data-action="selectMinute" class="minute'+(P(t,"m")?"":" disabled")+'">'+t.format("mm")+"</td>"),t.add(a,"m");e.empty().append(n)},V=function(){for(var e=p.find(".timepicker-seconds table"),t=u.clone().startOf("m"),n=[],i=pe("<tr>");u.isSame(t,"m");)t.second()%20==0&&(i=pe("<tr>"),n.push(i)),i.append('<td data-action="selectSecond" class="second'+(P(t,"s")?"":" disabled")+'">'+t.format("ss")+"</td>"),t.add(5,"s");e.empty().append(n)},G=function(){var e,t,n=p.find(".timepicker span[data-time-component]");o||(e=p.find(".timepicker [data-action=togglePeriod]"),t=c.clone().add(12<=c.hours()?-12:12,"h"),e.text(c.format("A")),P(t,"h")?e.removeClass("disabled"):e.addClass("disabled")),n.filter("[data-time-component=hours]").text(c.format(o?"HH":"hh")),n.filter("[data-time-component=minutes]").text(c.format("mm")),n.filter("[data-time-component=seconds]").text(c.format("ss")),W(),Y(),V()},X=function(){p&&(q(),G())},J=function(e){var t=l?null:c;if(!e)return l=!0,n.val(""),s.data("date",""),R({type:"dp.change",date:!1,oldDate:t}),void X();if(e=e.clone().locale(d.locale),$()&&e.tz(d.timeZone),1!==d.stepping)for(e.minutes(Math.round(e.minutes()/d.stepping)*d.stepping).seconds(0);d.minDate&&e.isBefore(d.minDate);)e.add(d.stepping,"minutes");P(e)?(u=(c=e).clone(),n.val(c.format(i)),s.data("date",c.format(i)),l=!1,X(),R({type:"dp.change",date:c.clone(),oldDate:t})):(d.keepInvalid?R({type:"dp.change",date:e,oldDate:t}):n.val(l?"":c.format(i)),R({type:"dp.error",date:e,oldDate:t}))},Z=function(){var t=!1;return p?(p.find(".collapse").each(function(){var e=pe(this).data("collapse");return!e||!e.transitioning||!(t=!0)}),t||(h&&h.hasClass("btn")&&h.toggleClass("active"),p.hide(),pe(window).off("resize",S),p.off("click","[data-action]"),p.off("mousedown",!1),p.remove(),p=!1,R({type:"dp.hide",date:c.clone()}),n.blur(),u=c.clone()),_):_},ee=function(){J(null)},te=function(e){return d.parseInputDate===undefined?(!fe.isMoment(e)||e instanceof Date)&&(e=w(e)):e=d.parseInputDate(e),e},ne={next:function(){var e=t[r].navFnc;u.add(t[r].navStep,e),q(),B(e)},previous:function(){var e=t[r].navFnc;u.subtract(t[r].navStep,e),q(),B(e)},pickerSwitch:function(){N(1)},selectMonth:function(e){var t=pe(e.target).closest("tbody").find("span").index(pe(e.target));u.month(t),r===f?(J(c.clone().year(u.year()).month(u.month())),d.inline||Z()):(N(-1),q()),B("M")},selectYear:function(e){var t=parseInt(pe(e.target).text(),10)||0;u.year(t),r===f?(J(c.clone().year(u.year())),d.inline||Z()):(N(-1),q()),B("YYYY")},selectDecade:function(e){var t=parseInt(pe(e.target).data("selection"),10)||0;u.year(t),r===f?(J(c.clone().year(u.year())),d.inline||Z()):(N(-1),q()),B("YYYY")},selectDay:function(e){var t=u.clone();pe(e.target).is(".old")&&t.subtract(1,"M"),pe(e.target).is(".new")&&t.add(1,"M"),J(t.date(parseInt(pe(e.target).text(),10))),C()||d.keepOpen||d.inline||Z()},incrementHours:function(){var e=c.clone().add(1,"h");P(e,"h")&&J(e)},incrementMinutes:function(){var e=c.clone().add(d.stepping,"m");P(e,"m")&&J(e)},incrementSeconds:function(){var e=c.clone().add(1,"s");P(e,"s")&&J(e)},decrementHours:function(){var e=c.clone().subtract(1,"h");P(e,"h")&&J(e)},decrementMinutes:function(){var e=c.clone().subtract(d.stepping,"m");P(e,"m")&&J(e)},decrementSeconds:function(){var e=c.clone().subtract(1,"s");P(e,"s")&&J(e)},togglePeriod:function(){J(c.clone().add(12<=c.hours()?-12:12,"h"))},togglePicker:function(e){var t,n=pe(e.target),i=n.closest("ul"),a=i.find(".in"),s=i.find(".collapse:not(.in)");if(a&&a.length){if((t=a.data("collapse")
)&&t.transitioning)return;a.collapse?(a.collapse("hide"),s.collapse("show")):(a.removeClass("in"),s.addClass("in")),n.is("span")?n.toggleClass(d.icons.time+" "+d.icons.date):n.find("span").toggleClass(d.icons.time+" "+d.icons.date)}},showPicker:function(){p.find(".timepicker > div:not(.timepicker-picker)").hide(),p.find(".timepicker .timepicker-picker").show()},showHours:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-hours").show()},showMinutes:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){p.find(".timepicker .timepicker-picker").hide(),p.find(".timepicker .timepicker-seconds").show()},selectHour:function(e){var t=parseInt(pe(e.target).text(),10);o||(12<=c.hours()?12!==t&&(t+=12):12===t&&(t=0)),J(c.clone().hours(t)),ne.showPicker.call(_)},selectMinute:function(e){J(c.clone().minutes(parseInt(pe(e.target).text(),10))),ne.showPicker.call(_)},selectSecond:function(e){J(c.clone().seconds(parseInt(pe(e.target).text(),10))),ne.showPicker.call(_)},clear:ee,today:function(){var e=w();P(e,"d")&&J(e)},close:Z},ie=function(e){return pe(e.currentTarget).is(".disabled")||ne[pe(e.currentTarget).data("action")].apply(_,arguments),!1},ae=function(){var e,t={year:function(e){return e.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(e){return e.date(1).hours(0).seconds(0).minutes(0)},day:function(e){return e.hours(0).seconds(0).minutes(0)},hour:function(e){return e.seconds(0).minutes(0)},minute:function(e){return e.seconds(0)}};return n.prop("disabled")||!d.ignoreReadonly&&n.prop("readonly")||p||(n.val()!==undefined&&0!==n.val().trim().length?J(te(n.val().trim())):l&&d.useCurrent&&(d.inline||n.is("input")&&0===n.val().trim().length)&&(e=w(),"string"==typeof d.useCurrent&&(e=t[d.useCurrent](e)),J(e)),p=O(),F(),U(),p.find(".timepicker-hours").hide(),p.find(".timepicker-minutes").hide(),p.find(".timepicker-seconds").hide(),X(),N(),pe(window).on("resize",S),p.on("click","[data-action]",ie),p.on("mousedown",!1),h&&h.hasClass("btn")&&h.toggleClass("active"),S(),p.show(),d.focusOnShow&&!n.is(":focus")&&n.focus(),R({type:"dp.show"})),_},se=function(){return p?Z():ae()},oe=function(e){var t,n,i,a,s=null,o=[],r={},l=e.which,c="p";for(t in y[l]=c,y)y.hasOwnProperty(t)&&y[t]===c&&(o.push(t),parseInt(t,10)!==l&&(r[t]=!0));for(t in d.keyBinds)if(d.keyBinds.hasOwnProperty(t)&&"function"==typeof d.keyBinds[t]&&(i=t.split(" ")).length===o.length&&b[l]===i[i.length-1]){for(a=!0,n=i.length-2;0<=n;n--)if(!(b[i[n]]in r)){a=!1;break}if(a){s=d.keyBinds[t];break}}s&&(s.call(_,p),e.stopPropagation(),e.preventDefault())},re=function(e){y[e.which]="r",e.stopPropagation(),e.preventDefault()},le=function(e){var t=pe(e.target).val().trim(),n=t?te(t):null;return J(n),e.stopImmediatePropagation(),!1},ce=function(){n.on({change:le,blur:d.debug?"":Z,keydown:oe,keyup:re,focus:d.allowInputToggle?ae:""}),s.is("input")?n.on({focus:ae}):h&&(h.on("click",se),h.on("mousedown",!1))},de=function(){n.off({change:le,blur:blur,keydown:oe,keyup:re,focus:d.allowInputToggle?Z:""}),s.is("input")?n.off({focus:ae}):h&&(h.off("click",se),h.off("mousedown",!1))},ue=function(e){var t={};return pe.each(e,function(){var e=te(this);e.isValid()&&(t[e.format("YYYY-MM-DD")]=!0)}),!!Object.keys(t).length&&t},_e=function(e){var t={};return pe.each(e,function(){t[this]=!0}),!!Object.keys(t).length&&t},he=function(){var e=d.format||"L LT";i=e.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return(c.localeData().longDateFormat(e)||e).replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return c.localeData().longDateFormat(e)||e})}),(a=d.extraFormats?d.extraFormats.slice():[]).indexOf(e)<0&&a.indexOf(i)<0&&a.push(i),o=i.toLowerCase().indexOf("a")<1&&i.replace(/\[.*?\]/g,"").indexOf("h")<1,k("y")&&(f=2),k("M")&&(f=1),k("d")&&(f=0),r=Math.max(f,r),l||J(c)};if(_.destroy=function(){Z(),de(),s.removeData("DateTimePicker"),s.removeData("date")},_.toggle=se,_.show=ae,_.hide=Z,_.disable=function(){return Z(),h&&h.hasClass("btn")&&h.addClass("disabled"),n.prop("disabled",!0),_},_.enable=function(){return h&&h.hasClass("btn")&&h.removeClass("disabled"),n.prop("disabled",!1),_},_.ignoreReadonly=function(e){if(0===arguments.length)return d.ignoreReadonly;if("boolean"!=typeof e)throw new TypeError("ignoreReadonly () expects a boolean parameter");return d.ignoreReadonly=e,_},_.options=function(e){if(0===arguments.length)return pe.extend(!0,{},d);if(!(e instanceof Object))throw new TypeError("options() options parameter should be an object");return pe.extend(!0,d,e),pe.each(d,function(e,t){if(_[e]===undefined)throw new TypeError("option "+e+" is not recognized!");_[e](t)}),_},_.date=function(e){if(0===arguments.length)return l?null:c.clone();if(!(null===e||"string"==typeof e||fe.isMoment(e)||e instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");return J(null===e?null:te(e)),_},_.format=function(e){if(0===arguments.length)return d.format;if("string"!=typeof e&&("boolean"!=typeof e||!1!==e))throw new TypeError("format() expects a string or boolean:false parameter "+e);return d.format=e,i&&he(),_},_.timeZone=function(e){if(0===arguments.length)return d.timeZone;if("string"!=typeof e)throw new TypeError("newZone() expects a string parameter");return d.timeZone=e,_},_.dayViewHeaderFormat=function(e){if(0===arguments.length)return d.dayViewHeaderFormat;if("string"!=typeof e)throw new TypeError("dayViewHeaderFormat() expects a string parameter");return d.dayViewHeaderFormat=e,_},_.extraFormats=function(e){if(0===arguments.length)return d.extraFormats;if(!1!==e&&!(e instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");return d.extraFormats=e,a&&he(),_},_.disabledDates=function(e){if(0===arguments.length)return d.disabledDates?pe.extend({},d.disabledDates):d.disabledDates;if(!e)return d.disabledDates=!1,X(),_;if(!(e instanceof Array))throw new TypeError("disabledDates() expects an array parameter");return d.disabledDates=ue(e),d.enabledDates=!1,X(),_},_.enabledDates=function(e){if(0===arguments.length)return d.enabledDates?pe.extend({},d.enabledDates):d.enabledDates;if(!e)return d.enabledDates=!1,X(),_;if(!(e instanceof Array))throw new TypeError("enabledDates() expects an array parameter");return d.enabledDates=ue(e),d.disabledDates=!1,X(),_},_.daysOfWeekDisabled=function(e){if(0===arguments.length)return d.daysOfWeekDisabled.splice(0);if("boolean"==typeof e&&!e)return d.daysOfWeekDisabled=!1,X(),_;if(!(e instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(d.daysOfWeekDisabled=e.reduce(function(e,t){return 6<(t=parseInt(t,10))||t<0||isNaN(t)||-1===e.indexOf(t)&&e.push(t),e},[]).sort(),d.useCurrent&&!d.keepInvalid){for(var t=0;!P(c,"d");){if(c.add(1,"d"),31===t)throw"Tried 31 times to find a valid date";t++}J(c)}return X(),_},_.maxDate=function(e){if(0===arguments.length)return d.maxDate?d.maxDate.clone():d.maxDate;if("boolean"==typeof e&&!1===e)return d.maxDate=!1,X(),_;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=w()));var t=te(e);if(!t.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+e);if(d.minDate&&t.isBefore(d.minDate))throw new TypeError("maxDate() date parameter is before options.minDate: "+t.format(i));return d.maxDate=t,d.useCurrent&&!d.keepInvalid&&c.isAfter(e)&&J(d.maxDate),u.isAfter(t)&&(u=t.clone().subtract(d.stepping,"m")),X(),_},_.minDate=function(e){if(0===arguments.length)return d.minDate?d.minDate.clone():d.minDate;if("boolean"==typeof e&&!1===e)return d.minDate=!1,X(),_;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=w()));var t=te(e);if(!t.isValid())throw new TypeError("minDate() Could not parse date parameter: "+e);if(d.maxDate&&t.isAfter(d.maxDate))throw new TypeError("minDate() date parameter is after options.maxDate: "+t.format(i));return d.minDate=t,d.useCurrent&&!d.keepInvalid&&c.isBefore(e)&&J(d.minDate),u.isBefore(t)&&(u=t.clone().add(d.stepping,"m")),X(),_},_.defaultDate=function(e){if(0===arguments.length)return d.defaultDate?d.defaultDate.clone():d.defaultDate;if(!e)return d.defaultDate=!1,_;"string"==typeof e&&(e="now"===e||"moment"===e?w():w(e));var t=te(e);if(!t.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+e);if(!P(t))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");return d.defaultDate=t,(d.defaultDate&&d.inline||""===n.val().trim())&&J(d.defaultDate),_},_.locale=function(e){if(0===arguments.length)return d.locale;if(!fe.localeData(e))throw new TypeError("locale() locale "+e+" is not loaded from moment locales!");return d.locale=e,c.locale(d.locale),u.locale(d.locale),i&&he(),p&&(Z(),ae()),_},_.stepping=function(e){return 0===arguments.length?d.stepping:(e=parseInt(e,10),(isNaN(e)||e<1)&&(e=1),d.stepping=e,_)},_.useCurrent=function(e){var t=["year","month","day","hour","minute"];if(0===arguments.length)return d.useCurrent;if("boolean"!=typeof e&&"string"!=typeof e)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof e&&-1===t.indexOf(e.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+t.join(", "));return d.useCurrent=e,_},_.collapse=function(e){if(0===arguments.length)return d.collapse;if("boolean"!=typeof e)throw new TypeError("collapse() expects a boolean parameter");return d.collapse===e||(d.collapse=e,p&&(Z(),ae())),_},_.icons=function(e){if(0===arguments.length)return pe.extend({},d.icons);if(!(e instanceof Object))throw new TypeError("icons() expects parameter to be an Object");return pe.extend(d.icons,e),p&&(Z(),ae()),_},_.tooltips=function(e){if(0===arguments.length)return pe.extend({},d.tooltips);if(!(e instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");return pe.extend(d.tooltips,e),p&&(Z(),ae()),_},_.useStrict=function(e){if(0===arguments.length)return d.useStrict;if("boolean"!=typeof e)throw new TypeError("useStrict() expects a boolean parameter");return d.useStrict=e,_},_.sideBySide=function(e){if(0===arguments.length)return d.sideBySide;if("boolean"!=typeof e)throw new TypeError("sideBySide() expects a boolean parameter");return d.sideBySide=e,p&&(Z(),ae()),_},_.viewMode=function(e){if(0===arguments.length)return d.viewMode;if("string"!=typeof e)throw new TypeError("viewMode() expects a string parameter");if(-1===m.indexOf(e))throw new TypeError("viewMode() parameter must be one of ("+m.join(", ")+") value");return d.viewMode=e,r=Math.max(m.indexOf(e),f),N(),_},_.toolbarPlacement=function(e){if(0===arguments.length)return d.toolbarPlacement;if("string"!=typeof e)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===v.indexOf(e))throw new TypeError("toolbarPlacement() parameter must be one of ("+v.join(", ")+") value");return d.toolbarPlacement=e,p&&(Z(),ae()),_},_.widgetPositioning=function(e){if(0===arguments.length)return pe.extend({},d.widgetPositioning);if("[object Object]"!=={}.toString.call(e))throw new TypeError("widgetPositioning() expects an object variable");if(e.horizontal){if("string"!=typeof e.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(e.horizontal=e.horizontal.toLowerCase(),-1===A.indexOf(e.horizontal))throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+A.join(", ")+")");d.widgetPositioning.horizontal=e.horizontal}if(e.vertical){if("string"!=typeof e.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(e.vertical=e.vertical.toLowerCase(),-1===g.indexOf(e.vertical))throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+g.join(", ")+")");d.widgetPositioning.vertical=e.vertical}return X(),_},_.calendarWeeks=function(e){if(0===arguments.length)return d.calendarWeeks;if("boolean"!=typeof e)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");return d.calendarWeeks=e,X(),_},_.showTodayButton=function(e){if(0===arguments.length)return d.showTodayButton;if("boolean"!=typeof e)throw new TypeError("showTodayButton() expects a boolean parameter");return d.showTodayButton=e,p&&(Z(),ae()),_},_.showClear=function(e){if(0===arguments.length)return d.showClear;if("boolean"!=typeof e)throw new TypeError("showClear() expects a boolean parameter");return d.showClear=e,p&&(Z(),ae()),_},_.widgetParent=function(e){if(0===arguments.length)return d.widgetParent;if("string"==typeof e&&(e=pe(e)),null!==e&&"string"!=typeof e&&!(e instanceof pe))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");return d.widgetParent=e,p&&(Z(),ae()),_},_.keepOpen=function(e){if(0===arguments.length)return d.keepOpen;if("boolean"!=typeof e)throw new TypeError("keepOpen() expects a boolean parameter");return d.keepOpen=e,_},_.focusOnShow=function(e){if(0===arguments.length)return d.focusOnShow;if("boolean"!=typeof e)throw new TypeError("focusOnShow() expects a boolean parameter");return d.focusOnShow=e,_},_.inline=function(e){if(0===arguments.length)return d.inline;if("boolean"!=typeof e)throw new TypeError("inline() expects a boolean parameter");return d.inline=e,_},_.clear=function(){return ee(),_},_.keyBinds=function(e){return 0===arguments.length?d.keyBinds:(d.keyBinds=e,_)},_.getMoment=function(e){return w(e)},_.debug=function(e){if("boolean"!=typeof e)throw new TypeError("debug() expects a boolean parameter");return d.debug=e,_},_.allowInputToggle=function(e){if(0===arguments.length)return d.allowInputToggle;if("boolean"!=typeof e)throw new TypeError("allowInputToggle() expects a boolean parameter");return d.allowInputToggle=e,_},_.showClose=function(e){if(0===arguments.length)return d.showClose;if("boolean"!=typeof e)throw new TypeError("showClose() expects a boolean parameter");return d.showClose=e,_},_.keepInvalid=function(e){if(0===arguments.length)return d.keepInvalid;if("boolean"!=typeof e)throw new TypeError("keepInvalid() expects a boolean parameter");return d.keepInvalid=e,_},_.datepickerInput=function(e){if(0===arguments.length)return d.datepickerInput;if("string"!=typeof e)throw new TypeError("datepickerInput() expects a string parameter");return d.datepickerInput=e,_},_.parseInputDate=function(e){if(0===arguments.length)return d.parseInputDate;if("function"!=typeof e)throw new TypeError("parseInputDate() sholud be as function");return d.parseInputDate=e,_},_.disabledTimeIntervals=function(e){if(0===arguments.length)return d.disabledTimeIntervals?pe.extend({},d.disabledTimeIntervals):d.disabledTimeIntervals;if(!e)return d.disabledTimeIntervals=!1,X(),_;if(!(e instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");return d.disabledTimeIntervals=e,X(),_},_.disabledHours=function(e){if(0===arguments.length)return d.disabledHours?pe.extend({},d.disabledHours):d.disabledHours;if(!e)return d.disabledHours=!1,X(),_;if(!(e instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(d.disabledHours=_e(e),d.enabledHours=!1,d.useCurrent&&!d.keepInvalid){for(var t=0;!P(c,"h");){if(c.add(1,"h"),24===t)throw"Tried 24 times to find a valid date";t++}J(c)}return X(),_},_.enabledHours=function(e){if(0===arguments.length)return d.enabledHours?pe.extend({},d.enabledHours):d.enabledHours;if(!e)return d.enabledHours=!1,X(),_;if(!(e instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(d.enabledHours=_e(e),d.disabledHours=!1,d.useCurrent&&!d.keepInvalid){for(var t=0;!P(c,"h");){if(c.add(1,"h"),24===t)throw"Tried 24 times to find a valid date";t++}J(c)}return X(),_},_.viewDate=function(e){if(0===arguments.length)return u.clone();if(!e)return u=c.clone(),_;if(!("string"==typeof e||fe.isMoment(e)||e instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");return u=te(e),B(),_},s.is("input"))n=s;else if(0===(n=s.find(d.datepickerInput)).length)n=s.find("input");else if(!n.is("input"))throw new Error('CSS class "'+d.datepickerInput+'" cannot be applied to non input element');if(s.hasClass("input-group")&&(h=0===s.find(".datepickerbutton").length?s.find(".input-group-addon"):s.find(".datepickerbutton")),!d.inline&&!n.is("input"))throw new Error("Could not initialize DateTimePicker without an input element");return c=w(),u=c.clone(),pe.extend(!0,d,e()),_.options(d),he(),ce(),n.prop("disabled")&&_.disable(),n.is("input")&&0!==n.val().trim().length?J(te(n.val().trim())):d.defaultDate&&n.attr("placeholder")===undefined&&J(d.defaultDate),d.inline&&ae(),_};return pe.fn.datetimepicker=function(n){n=n||{};var t,i=Array.prototype.slice.call(arguments,1),a=!0,e=["destroy","hide","show","toggle"];if("object"==typeof n)return this.each(function(){var e,t=pe(this);t.data("DateTimePicker")||(e=pe.extend(!0,{},pe.fn.datetimepicker.defaults,n),t.data("DateTimePicker",s(t,e)))});if("string"==typeof n)return this.each(function(){var e=pe(this).data("DateTimePicker");if(!e)throw new Error('bootstrap-datetimepicker("'+n+'") method was called on an element that is not using DateTimePicker');t=e[n].apply(e,i),a=t===e}),a||-1<pe.inArray(n,e)?this:t;throw new TypeError("Invalid arguments for DateTimePicker: "+n)},pe.fn.datetimepicker.defaults={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:fe.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down",previous:"glyphicon glyphicon-chevron-left",next:"glyphicon glyphicon-chevron-right",today:"glyphicon glyphicon-screenshot",clear:"glyphicon glyphicon-trash",close:"glyphicon glyphicon-remove"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",showTodayButton:!1,showClear:!1,showClose:!1,widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,datepickerInput:".datepickerinput",keyBinds:{up:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(7,"d")):this.date(t.clone().add(this.stepping(),"m"))}},down:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(7,"d")):this.date(t.clone().subtract(this.stepping(),"m"))}else this.show()},"control up":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(1,"y")):this.date(t.clone().add(1,"h"))}},"control down":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(1,"y")):this.date(t.clone().subtract(1,"h"))}},left:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"d"))}},right:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"d"))}},pageUp:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"M"))}},pageDown:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"M"))}},enter:function(){this.hide()},escape:function(){this.hide()},"control space":function(e){e&&e.find(".timepicker").is(":visible")&&e.find('.btn[data-action="togglePeriod"]').click()},t:function(){this.date(this.getMoment())},"delete":function(){this.clear()}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1},pe.fn.datetimepicker}),function(p,t,e,s){"use strict";var a="treeview",f=!1,m=!1,g=!1,A={},v=!1;A.settings={injectStyle:!0,levels:2,expandIcon:"glyphicon glyphicon-plus",collapseIcon:"glyphicon glyphicon-minus",emptyIcon:"glyphicon",nodeIcon:"",selectedIcon:"",checkedIcon:"glyphicon glyphicon-check",uncheckedIcon:"glyphicon glyphicon-unchecked",color:s,backColor:s,borderColor:s,onhoverColor:"#F5F5F5",selectedColor:"#FFFFFF",selectedBackColor:"#428bca",searchResultColor:"#D9534F",searchResultBackColor:s,enableLinks:!1,highlightSelected:!0,highlightSearchResults:!0,showBorder:!0,showIcon:!0,showCheckbox:!1,showTags:!1,multiSelect:!1,onNodeChecked:s,onNodeCollapsed:s,onNodeDisabled:s,onNodeEnabled:s,onNodeExpanded:s,onNodeSelected:s,onNodeUnchecked:s,onNodeUnselected:s,onSearchComplete:s,onSearchCleared:s},A.options={silent:!1,ignoreChildren:!1},A.searchOptions={ignoreCase:!0,exactMatch:!1,revealResults:!0};var o=function(e,t){return this.$element=p(e),this.elementId=e.id,this.styleId=this.elementId+"-style",this.init(t),{options:this.options,init:p.proxy(this.init,this),remove:p.proxy(this.remove,this),getNode:p.proxy(this.getNode,this),getParent:p.proxy(this.getParent,this),getSiblings:p.proxy(this.getSiblings,this),getSelected:p.proxy(this.getSelected,this),getUnselected:p.proxy(this.getUnselected,this),getExpanded:p.proxy(this.getExpanded,this),getCollapsed:p.proxy(this.getCollapsed,this),getChecked:p.proxy(this.getChecked,this),getUnchecked:p.proxy(this.getUnchecked,this),getDisabled:p.proxy(this.getDisabled,this),getEnabled:p.proxy(this.getEnabled,this),selectNode:p.proxy(this.selectNode,this),unselectNode:p.proxy(this.unselectNode,this),toggleNodeSelected:p.proxy(this.toggleNodeSelected,this),collapseAll:p.proxy(this.collapseAll,this),collapseNode:p.proxy(this.collapseNode,this),expandAll:p.proxy(this.expandAll,this),expandNode:p.proxy(this.expandNode,this),toggleNodeExpanded:p.proxy(this.toggleNodeExpanded,this),revealNode:p.proxy(this.revealNode,this),checkAll:p.proxy(this.checkAll,this),checkNode:p.proxy(this.checkNode,this),uncheckAll:p.proxy(this.uncheckAll,this),uncheckNode:p.proxy(this.uncheckNode,this),toggleNodeChecked:p.proxy(this.toggleNodeChecked,this),disableAll:p.proxy(this.disableAll,this),disableNode:p.proxy(this.disableNode,this),enableAll:p.proxy(this.enableAll,this),enableNode:p.proxy(this.enableNode,this),toggleNodeDisabled:p.proxy(this.toggleNodeDisabled,this),search:p.proxy(this.search,this),clearSearch:p.proxy(this.clearSearch,this),showMore:p.proxy(this.showMore,this),showLess:p.proxy(this.showLess,this)}};o.prototype.init=function(e){this.tree=[],this.nodes=[],e.data&&("string"==typeof e.data&&(e.data=p.parseJSON(e.data)),this.tree=p.extend(!0,[],e.data),delete e.data),this.options=p.extend({},A.settings,e),this.destroy(),this.subscribeEvents(),this.setInitialStates({nodes:this.tree},0),this.render()},o.prototype.remove=function(){this.destroy(),p.removeData(this,a),p("#"+this.styleId).remove()},o.prototype.destroy=function(){this.initialized&&(this.$wrapper.remove(),this.$wrapper=null,this.$wrapper2.remove(),this.$wrapper2=null,this.unsubscribeEvents(),this.initialized=!1)},o.prototype.unsubscribeEvents=function(){this.$element.off("click"),this.$element.off("nodeChecked"),this.$element.off("nodeCollapsed"),this.$element.off("nodeDisabled"),this.$element.off("nodeEnabled"),this.$element.off("nodeExpanded"),this.$element.off("nodeSelected"),this.$element.off("nodeUnchecked"),this.$element.off("nodeUnselected"),this.$element.off("searchComplete"),this.$element.off("searchCleared")},o.prototype.subscribeEvents=function(){this.unsubscribeEvents(),this.$element.on("click",p.proxy(this.clickHandler,this)),"function"==typeof this.options.onNodeChecked&&this.$element.on("nodeChecked",this.options.onNodeChecked),"function"==typeof this.options.onNodeCollapsed&&this.$element.on("nodeCollapsed",this.options.onNodeCollapsed),"function"==typeof this.options.onNodeDisabled&&this.$element.on("nodeDisabled",this.options.onNodeDisabled),"function"==typeof this.options.onNodeEnabled&&this.$element.on("nodeEnabled",this.options.onNodeEnabled),"function"==typeof this.options.onNodeExpanded&&this.$element.on("nodeExpanded",this.options.onNodeExpanded),"function"==typeof this.options.onNodeSelected&&this.$element.on("nodeSelected",this.options.onNodeSelected),"function"==typeof this.options.onNodeUnchecked&&this.$element.on("nodeUnchecked",this.options.onNodeUnchecked),"function"==typeof this.options.onNodeUnselected&&this.$element.on("nodeUnselected",this.options.onNodeUnselected),"function"==typeof this.options.onSearchComplete&&this.$element.on("searchComplete",this.options.onSearchComplete),"function"==typeof this.options.onSearchCleared&&this.$element.on("searchCleared",this.options.onSearchCleared)},o.prototype.setInitialStates=function(e,n){if(e.nodes){n+=1;var i=e,a=this;p.each(e.nodes,function s(e,t){t.nodeId=a.nodes.length,t.parentId=i.nodeId,t.hasOwnProperty("selectable")||(t.selectable=!0),t.state=t.state||{},t.state.hasOwnProperty("checked")||(t.state.checked=!1),t.state.hasOwnProperty("disabled")||(t.state.disabled=!1),t.state.hasOwnProperty("expanded")||(!t.state.disabled&&n<a.options.levels&&t.nodes&&0<t.nodes.length?t.state.expanded=!0:t.text.includes(I18n.t("js.clients.contactless_officers"))&&f&&1==a.options.expand?t.state.expanded=!0:(m&&a.options.expand&&g?t.state.expanded=!0:(g=!1,t.state.expanded=!1),f=!1)),t.state.hasOwnProperty("selected")||(t.state.selected=!1),a.nodes.push(t),t.nodes&&a.setInitialStates(t,n)})}},o.prototype.clickHandler=function(e){this.options.enableLinks||e.preventDefault();var t=p(e.target),n=this.findNode(t);if(n&&!n.state.disabled){var i=t.attr("class")?t.attr("class").split(" "):[];-1!==i.indexOf("expand-icon")?(this.toggleExpandedState(n,A.options),this.render(),p(".hp-tooltip").tooltip()):-1!==i.indexOf("check-icon")?(this.toggleCheckedState(n,A.options),this.render()):(n.selectable?this.toggleSelectedState(n,A.options):this.toggleExpandedState(n,A.options),this.render(),p(".hp-tooltip").tooltip())}},o.prototype.findNode=function(e){var t=e.closest("li.list-group-item").attr("data-nodeid"),n=this.nodes[t],i=this.options.client_id,a=this.options.show_uncontacted_officers_flg,s=this.options.customer_sheets_flg,o=this.options.hide_any_lead_organization?1:null,r=this.options.expand,l=this.options.show_flg,c=this.options.old_org_tree_flg,d=this.options.show_having_business_card_flg,u=this.options.show_org_managiment_button_flg;return n&&!r&&n.text.includes(I18n.t("js.clients.contactless_officers"))&&(f=!0,p.ajax({url:"/xhr/organizations/"+i,type:"post",data:{show_flg:l,search:{lead_status:o,show_having_business_card_flg:d},show_uncontacted_officers_flg:a,expand:!0,customer_sheets_flg:s,old_org_tree_flg:c,show_org_managiment_button_flg:u},error:function(){setTimeout(function(){p("#keyman_spinner").hide()},5e3)}})),n||console.log("Error: node does not exist"),n},o.prototype.toggleExpandedState=function(e,t){e&&this.setExpandedState(e,!e.state.expanded,t)},o.prototype.setExpandedState=function(e,t,n){t!==e.state.expanded&&(t&&e.nodes?(e.text.includes(I18n.t("js.clients.contactless_officers"))&&(f=!0),e.state.expanded=!0,n.silent||this.$element.trigger("nodeExpanded",p.extend(!0,{},e))):t||(e.text.includes(I18n.t("js.clients.contactless_officers"))&&(f=!1),e.state.expanded=!1,n.silent||this.$element.trigger("nodeCollapsed",p.extend(!0,{},e)),e.nodes&&!n.ignoreChildren&&p.each(e.nodes,p.proxy(function(e,t){this.setExpandedState(t,!1,n)},this))))},o.prototype.toggleSelectedState=function(e,t){e&&this.setSelectedState(e,!e.state.selected,t)},o.prototype.setSelectedState=function(e,t,n){t!==e.state.selected&&(t?(this.options.multiSelect||p.each(this.findNodes("true","g","state.selected"),p.proxy(function(e,t){this.setSelectedState(t,!1,n)},this)),e.state.selected=!0,n.silent||this.$element.trigger("nodeSelected",p.extend(!0,{},e))):(e.state.selected=!1,n.silent||this.$element.trigger("nodeUnselected",p.extend(!0,{},e))))},o.prototype.toggleCheckedState=function(e,t){e&&this.setCheckedState(e,!e.state.checked,t)},o.prototype.setCheckedState=function(e,t,n){t!==e.state.checked&&(t?(e.state.checked=!0,n.silent||this.$element.trigger("nodeChecked",p.extend(!0,{},e))):(e.state.checked=!1,n.silent||this.$element.trigger("nodeUnchecked",p.extend(!0,{},e))))},o.prototype.setDisabledState=function(e,t,n){t!==e.state.disabled&&(t?(e.state.disabled=!0,this.setExpandedState(e,!1,n),this.setSelectedState(e,!1,n),this.setCheckedState(e,!1,n),n.silent||this.$element.trigger("nodeDisabled",p.extend(!0,{},e))):(e.state.disabled=!1,n.silent||this.$element.trigger("nodeEnabled",p.extend(!0,{},e))))},o.prototype.render=function(){this.initialized||(this.$element.addClass(a),this.$wrapper=p(this.template.list),this.$wrapper2=p(this.template.show_more_area),this.injectStyle(),this.initialized=!0),this.$element.empty().append(this.$wrapper.empty()).append(this.$wrapper2.empty()),this.buildTree(this.tree,0)},o.prototype.buildTree=function(d,u){if(d){u+=1;var _=this;p.each(d,function h(e,t){for(var n=p(_.template.item).addClass("node-"+_.elementId).addClass(t.state.checked?"node-checked":"").addClass(t.state.disabled?"node-disabled":"").addClass(t.state.selected?"node-selected":"").addClass(t.searchResult?"search-result":"").attr("data-nodeid",t.nodeId).attr("style",_.buildStyleOverride(t)),i=p(_.template.left_item),a=0;a<u-1;a++)i.append(_.template.indent);var s=[];(t.nodes||t.text.includes(I18n.t("js.clients.contactless_officers"))?(s.push("expand-icon"),t.state.expanded?s.push(_.options.collapseIcon):s.push(_.options.expandIcon)):s.push(_.options.emptyIcon),i.append(p(_.template.icon).addClass(s.join(" "))),_.options.showIcon)&&((s=["node-icon"]).push(t.icon||_.options.nodeIcon),t.state.selected&&(s.pop(),s.push(t.selectedIcon||_.options.selectedIcon||t.icon||_.options.nodeIcon)),i.append(p(_.template.icon).addClass(s.join(" "))));if(_.options.showCheckbox){s=["check-icon"];t.state.checked?s.push(_.options.checkedIcon):s.push(_.options.uncheckedIcon),i.append(p(_.template.icon).addClass(s.join(" ")))}var o=p(_.template.right_item);_.options.enableLinks?o.append(p(_.template.link).attr("href",t.href).append(t.text)):(t.text&&(o.append(t.text),t.text.includes(I18n.t("js.clients.contactless_officers"))&&(m=!0)),t.text.includes(I18n.t("js.clients.contactless_officers"))&&!_.options.expand&&f&&o.append('<span style="margin-left:15px" id="keyman_spinner"><i class="fa fa-spinner fa-pulse fa-1x fa-fw"></i></span>')),_.options.showTags&&t.tags&&p.each(t.tags,function c(e,t){o.append(p(_.template.badge).append(t))}),n.append(i),n.append(o);var r=p(_.template.show_more_area);if(_.elementId.includes("old_organization_tree")&&_.options.data_cleansing_flg){var l=_.getParent(t);2==u&&2<e?(v?n.addClass("hidden-items"):v||n.addClass("hidden-items hidden"),t.state.checked=!0):2<u&&l.state.checked&&(v?n.addClass("hidden-items"):v||n.addClass("hidden-items hidden")),r.append(_.template.indent).addClass("list-group-item").attr("style","color: #428bca;"),2==e&&e<d.length-1&&1==a?(r.append("\u3055\u3089\u306b\u8868\u793a..."),v?r.addClass("show-more hidden"):r.addClass("show-more"),_.$wrapper2.append(r)):e==d.length-1&&3<e&&(r.append("\u8868\u793a\u3092\u6e1b\u3089\u3059..."),v?r.addClass("show-less"):r.addClass("show-less hidden"),_.$wrapper2.append(r))}if(_.$wrapper.append(n),t.nodes&&t.state.expanded&&!t.state.disabled)return _.buildTree(t.nodes,u)})}},o.prototype.buildStyleOverride=function(e){if(e.state.disabled)return"";var t=e.color,n=e.backColor;return this.options.highlightSelected&&e.state.selected&&(this.options.selectedColor&&(t=this.options.selectedColor),this.options.selectedBackColor&&(n=this.options.selectedBackColor)),this.options.highlightSearchResults&&e.searchResult&&!e.state.disabled&&(this.options.searchResultColor&&(t=this.options.searchResultColor),this.options.searchResultBackColor&&(n=this.options.searchResultBackColor)),"color:"+t+";background-color:"+n+";"},o.prototype.injectStyle=function(){this.options.injectStyle&&!e.getElementById(this.styleId)&&p('<style type="text/css" id="'+this.styleId+'"> '+this.buildStyle()+" </style>").appendTo("head")},
o.prototype.buildStyle=function(){var e=".node-"+this.elementId+"{";return this.options.color&&(e+="color:"+this.options.color+";"),this.options.backColor&&(e+="background-color:"+this.options.backColor+";"),this.options.showBorder?this.options.borderColor&&(e+="border:1px solid "+this.options.borderColor+";"):e+="border:none;",e+="}",this.options.onhoverColor&&(e+=".node-"+this.elementId+":not(.node-disabled):hover{background-color:"+this.options.onhoverColor+";}"),this.css+e},o.prototype.template={list:'<ul class="list-group" style="margin-bottom: -1px;"></ul>',item:'<li class="list-group-item"></li>',indent:'<span class="indent"></span>',icon:'<span class="icon"></span>',link:'<a href="#" style="color:inherit;"></a>',badge:'<span class="badge"></span>',left_item:'<div style="float: left;"></div>',right_item:'<div style="overflow: hidden;"></div>',show_more_area:'<div style=" margin-bottom: 15px;"></div>'},o.prototype.css=".treeview .list-group-item{cursor:pointer}.treeview span.indent{margin-left:10px;margin-right:10px}.treeview span.icon{width:12px;margin-right:4px}.treeview .node-disabled{color:silver;cursor:not-allowed}",o.prototype.getNode=function(e){return this.nodes[e]},o.prototype.getParent=function(e){var t=this.identifyNode(e);return this.nodes[t.parentId]},o.prototype.getSiblings=function(e){var t=this.identifyNode(e),n=this.getParent(t);return(n?n.nodes:this.tree).filter(function(e){return e.nodeId!==t.nodeId})},o.prototype.getSelected=function(){return this.findNodes("true","g","state.selected")},o.prototype.getUnselected=function(){return this.findNodes("false","g","state.selected")},o.prototype.getExpanded=function(){return this.findNodes("true","g","state.expanded")},o.prototype.getCollapsed=function(){return this.findNodes("false","g","state.expanded")},o.prototype.getChecked=function(){return this.findNodes("true","g","state.checked")},o.prototype.getUnchecked=function(){return this.findNodes("false","g","state.checked")},o.prototype.getDisabled=function(){return this.findNodes("true","g","state.disabled")},o.prototype.getEnabled=function(){return this.findNodes("false","g","state.disabled")},o.prototype.selectNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setSelectedState(e,!0,t)},this)),this.render()},o.prototype.unselectNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setSelectedState(e,!1,t)},this)),this.render()},o.prototype.toggleNodeSelected=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.toggleSelectedState(e,t)},this)),this.render()},o.prototype.collapseAll=function(e){var t=this.findNodes("true","g","state.expanded");this.forEachIdentifier(t,e,p.proxy(function(e,t){this.setExpandedState(e,!1,t)},this)),this.render(),p(".hp-tooltip").tooltip()},o.prototype.collapseNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setExpandedState(e,!1,t)},this)),this.render()},o.prototype.showMore=function(){v=!0},o.prototype.showLess=function(){v=!1},o.prototype.expandAll=function(e){var t=new p.Deferred;if(e=p.extend({},A.options,e),g=!0,null==this.nodes[1])return!1;if(m=this.nodes[1].text.includes(I18n.t("js.clients.contactless_officers")),e&&e.levels)this.expandLevels(this.tree,e.levels,e),t.resolve();else if(m&&!this.options.expand&&g&&this.options.is_keyman_flg_on){var n=1,i=this.nodes[n],a=this.options.client_id,s=this.options.show_uncontacted_officers_flg,o=this.options.customer_sheets_flg,r=this.options.hide_any_lead_organization?1:null,l=this.options.expand,c=this.options.show_flg,d=this.options.old_org_tree_flg,u=this.options.show_having_business_card_flg,_=this.options.show_org_managiment_button_flg;!l&&i.text.includes(I18n.t("js.clients.contactless_officers"))&&(f=!0,p.ajax({url:"/xhr/organizations/"+a,type:"post",data:{show_flg:c,search:{lead_status:r,show_having_business_card_flg:u},show_uncontacted_officers_flg:s,expand:!0,customer_sheets_flg:o,old_org_tree_flg:d,show_org_managiment_button_flg:_},error:function(){setTimeout(function(){p("#keyman_spinner").hide()},5e3)}}).then(function(){t.resolve()}))}else{var h=this.findNodes("false","g","state.expanded");this.forEachIdentifier(h,e,p.proxy(function(e,t){this.setExpandedState(e,!0,t)},this)),t.resolve()}return this.render(),p(".hp-tooltip").tooltip(),t.promise()},o.prototype.expandNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setExpandedState(e,!0,t),e.nodes&&t&&t.levels&&this.expandLevels(e.nodes,t.levels-1,t)},this)),this.render()},o.prototype.expandLevels=function(e,n,i){i=p.extend({},A.options,i),p.each(e,p.proxy(function(e,t){this.setExpandedState(t,0<n,i),t.nodes&&this.expandLevels(t.nodes,n-1,i)},this))},o.prototype.revealNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){for(var n=this.getParent(e);n;)this.setExpandedState(n,!0,t),n=this.getParent(n)},this)),this.render()},o.prototype.toggleNodeExpanded=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.toggleExpandedState(e,t)},this)),this.render()},o.prototype.checkAll=function(e){var t=this.findNodes("false","g","state.checked");this.forEachIdentifier(t,e,p.proxy(function(e,t){this.setCheckedState(e,!0,t)},this)),this.render()},o.prototype.checkNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setCheckedState(e,!0,t)},this)),this.render()},o.prototype.uncheckAll=function(e){var t=this.findNodes("true","g","state.checked");this.forEachIdentifier(t,e,p.proxy(function(e,t){this.setCheckedState(e,!1,t)},this)),this.render()},o.prototype.uncheckNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setCheckedState(e,!1,t)},this)),this.render()},o.prototype.toggleNodeChecked=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.toggleCheckedState(e,t)},this)),this.render()},o.prototype.disableAll=function(e){var t=this.findNodes("false","g","state.disabled");this.forEachIdentifier(t,e,p.proxy(function(e,t){this.setDisabledState(e,!0,t)},this)),this.render()},o.prototype.disableNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setDisabledState(e,!0,t)},this)),this.render()},o.prototype.enableAll=function(e){var t=this.findNodes("true","g","state.disabled");this.forEachIdentifier(t,e,p.proxy(function(e,t){this.setDisabledState(e,!1,t)},this)),this.render()},o.prototype.enableNode=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setDisabledState(e,!1,t)},this)),this.render()},o.prototype.toggleNodeDisabled=function(e,t){this.forEachIdentifier(e,t,p.proxy(function(e,t){this.setDisabledState(e,!e.state.disabled,t)},this)),this.render()},o.prototype.forEachIdentifier=function(e,n,i){n=p.extend({},A.options,n),e instanceof Array||(e=[e]),p.each(e,p.proxy(function(e,t){i(this.identifyNode(t),n)},this))},o.prototype.identifyNode=function(e){return"number"==typeof e?this.nodes[e]:e},o.prototype.search=function(e,t){t=p.extend({},A.searchOptions,t),this.clearSearch({render:!1});var n=[];if(e&&0<e.length){t.exactMatch&&(e="^"+e+"$");var i="g";t.ignoreCase&&(i+="i"),n=this.findNodes(e,i),p.each(n,function(e,t){t.searchResult=!0})}return t.revealResults?this.revealNode(n):this.render(),this.$element.trigger("searchComplete",p.extend(!0,{},n)),n},o.prototype.clearSearch=function(e){e=p.extend({},{render:!0},e);var t=p.each(this.findNodes("true","g","searchResult"),function(e,t){t.searchResult=!1});e.render&&this.render(),this.$element.trigger("searchCleared",p.extend(!0,{},t))},o.prototype.findNodes=function(n,i,a){i=i||"g",a=a||"text";var s=this;return p.grep(this.nodes,function(e){var t=s.getNodeValue(e,a);if("string"==typeof t)return t.match(new RegExp(n,i))})},o.prototype.getNodeValue=function(e,t){var n=t.indexOf(".");if(0<n){var i=e[t.substring(0,n)],a=t.substring(n+1,t.length);return this.getNodeValue(i,a)}return e.hasOwnProperty(t)?e[t].toString():s};var r=function(e){t.console&&t.console.error(e)};p.fn[a]=function(t,n){var i;return this.each(function(){var e=p.data(this,a);"string"==typeof t?e?p.isFunction(e[t])&&"_"!==t.charAt(0)?(n instanceof Array||(n=[n]),i=e[t].apply(e,n)):r("No such method : "+t):r("Not initialized, can not call method : "+t):"boolean"==typeof t?i=e:p.data(this,a,new o(this,p.extend(!0,{},t)))}),i||this}}(jQuery,window,document),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}(function(x,I){function D(){return new Date(Date.UTC.apply(Date,arguments))}function O(){var e=new Date;return D(e.getFullYear(),e.getMonth(),e.getDate())}function s(e,t){return e.getUTCFullYear()===t.getUTCFullYear()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCDate()===t.getUTCDate()}function e(e,t){return function(){return t!==I&&x.fn.datepicker.deprecated(t),this[e].apply(this,arguments)}}function c(e){return e&&!isNaN(e.getTime())}function d(e,t){function n(e,t){return t.toLowerCase()}var i=x(e).data(),a={},s=new RegExp("^"+t.toLowerCase()+"([A-Z])");for(var o in t=new RegExp("^"+t.toLowerCase()),i)t.test(o)&&(a[o.replace(s,n)]=i[o]);return a}function u(e){var n={};if(S[e]||(e=e.split("-")[0],S[e])){var i=S[e];return x.each(o,function(e,t){t in i&&(n[t]=i[t])}),n}}var t,n=(t={get:function(e){return this.slice(e)[0]},contains:function(e){for(var t=e&&e.valueOf(),n=0,i=this.length;n<i;n++)if(0<=this[n].valueOf()-t&&this[n].valueOf()-t<864e5)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(e){e&&(Array.isArray(e)||(e=[e]),this.clear(),this.push.apply(this,e))},clear:function(){this.length=0},copy:function(){var e=new n;return e.replace(this),e}},function(){var e=[];return e.push.apply(e,arguments),x.extend(e,t),e}),$=function(e,t){x.data(e,"datepicker",this),this._events=[],this._secondaryEvents=[],this._process_options(t),this.dates=new n,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=x(e),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn"),this.component&&0===this.component.length&&(this.component=!1),null===this.o.isInline?this.isInline=!this.component&&!this.isInput:this.isInline=this.o.isInline,this.picker=x(R.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(e,t){return Number(t)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};$.prototype={constructor:$,_resolveViewName:function(n){return x.each(R.viewModes,function(e,t){if(n===e||-1!==x.inArray(n,t.names))return n=e,!1}),n},_resolveDaysOfWeek:function(e){return Array.isArray(e)||(e=e.split(/[,\s]*/)),x.map(e,Number)},_check_template:function(e){try{return e!==I&&""!==e&&((e.match(/[<>]/g)||[]).length<=0||0<x(e).length)}catch(t){return!1}},_process_options:function(e){this._o=x.extend({},this._o,e);var t=this.o=x.extend({},this._o),n=t.language;S[n]||(n=n.split("-")[0],S[n]||(n=h.language)),t.language=n,t.startView=this._resolveViewName(t.startView),t.minViewMode=this._resolveViewName(t.minViewMode),t.maxViewMode=this._resolveViewName(t.maxViewMode),t.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,t.startView)),!0!==t.multidate&&(t.multidate=Number(t.multidate)||!1,!1!==t.multidate&&(t.multidate=Math.max(0,t.multidate))),t.multidateSeparator=String(t.multidateSeparator),t.weekStart%=7,t.weekEnd=(t.weekStart+6)%7;var i=R.parseFormat(t.format);t.startDate!==-Infinity&&(t.startDate?t.startDate instanceof Date?t.startDate=this._local_to_utc(this._zero_time(t.startDate)):t.startDate=R.parseDate(t.startDate,i,t.language,t.assumeNearbyYear):t.startDate=-Infinity),t.endDate!==Infinity&&(t.endDate?t.endDate instanceof Date?t.endDate=this._local_to_utc(this._zero_time(t.endDate)):t.endDate=R.parseDate(t.endDate,i,t.language,t.assumeNearbyYear):t.endDate=Infinity),t.daysOfWeekDisabled=this._resolveDaysOfWeek(t.daysOfWeekDisabled||[]),t.daysOfWeekHighlighted=this._resolveDaysOfWeek(t.daysOfWeekHighlighted||[]),t.datesDisabled=t.datesDisabled||[],Array.isArray(t.datesDisabled)||(t.datesDisabled=t.datesDisabled.split(",")),t.datesDisabled=x.map(t.datesDisabled,function(e){return R.parseDate(e,i,t.language,t.assumeNearbyYear)});var a=String(t.orientation).toLowerCase().split(/\s+/g),s=t.orientation.toLowerCase();if(a=x.grep(a,function(e){return/^auto|left|right|top|bottom$/.test(e)}),t.orientation={x:"auto",y:"auto"},s&&"auto"!==s)if(1===a.length)switch(a[0]){case"top":case"bottom":t.orientation.y=a[0];break;case"left":case"right":t.orientation.x=a[0]}else s=x.grep(a,function(e){return/^left|right$/.test(e)}),t.orientation.x=s[0]||"auto",s=x.grep(a,function(e){return/^top|bottom$/.test(e)}),t.orientation.y=s[0]||"auto";else;if(t.defaultViewDate instanceof Date||"string"==typeof t.defaultViewDate)t.defaultViewDate=R.parseDate(t.defaultViewDate,i,t.language,t.assumeNearbyYear);else if(t.defaultViewDate){var o=t.defaultViewDate.year||(new Date).getFullYear(),r=t.defaultViewDate.month||0,l=t.defaultViewDate.day||1;t.defaultViewDate=D(o,r,l)}else t.defaultViewDate=O()},_applyEvents:function(e){for(var t,n,i,a=0;a<e.length;a++)t=e[a][0],2===e[a].length?(n=I,i=e[a][1]):3===e[a].length&&(n=e[a][1],i=e[a][2]),t.on(i,n)},_unapplyEvents:function(e){for(var t,n,i,a=0;a<e.length;a++)t=e[a][0],2===e[a].length?(i=I,n=e[a][1]):3===e[a].length&&(i=e[a][1],n=e[a][2]),t.off(n,i)},_buildEvents:function(){var e={keyup:x.proxy(function(e){-1===x.inArray(e.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:x.proxy(this.keydown,this),paste:x.proxy(this.paste,this)};!0===this.o.showOnFocus&&(e.focus=x.proxy(this.show,this)),this.isInput?this._events=[[this.element,e]]:this.component&&this.inputField.length?this._events=[[this.inputField,e],[this.component,{click:x.proxy(this.show,this)}]]:this._events=[[this.element,{click:x.proxy(this.show,this),keydown:x.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:x.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:x.proxy(function(e){this._focused_from=e.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":x.proxy(function(e){this.update(e.date)},this)}]),this._secondaryEvents=[[this.picker,{click:x.proxy(this.click,this)}],[this.picker,".prev, .next",{click:x.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:x.proxy(this.dayCellClick,this)}],[x(window),{resize:x.proxy(this.place,this)}],[x(document),{"mousedown touchstart":x.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(e,t){var n=t||this.dates.get(-1),i=this._utc_to_local(n);this.element.trigger({type:e,date:i,viewMode:this.viewMode,dates:x.map(this.dates,this._utc_to_local),format:x.proxy(function(e,t){0===arguments.length?(e=this.dates.length-1,t=this.o.format):"string"==typeof e&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return R.formatDate(n,t,this.o.language)},this)})},show:function(){if(!(this.inputField.is(":disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&x(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")||(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide")),this},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(e){var t;if(e.originalEvent.clipboardData&&e.originalEvent.clipboardData.types&&-1!==x.inArray("text/plain",e.originalEvent.clipboardData.types))t=e.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;t=window.clipboardData.getData("Text")}this.setDate(t),this.update(),e.preventDefault()},_utc_to_local:function(e){if(!e)return e;var t=new Date(e.getTime()+6e4*e.getTimezoneOffset());return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(t=new Date(e.getTime()+6e4*t.getTimezoneOffset())),t},_local_to_utc:function(e){return e&&new Date(e.getTime()-6e4*e.getTimezoneOffset())},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&D(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())},getDates:function(){return x.map(this.dates,this._utc_to_local)},getUTCDates:function(){return x.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var e=this.dates.get(-1);return e!==I?new Date(e):null},clearDates:function(){this.inputField.val(""),this._trigger("changeDate"),this.update(),this.o.autoclose&&this.hide()},setDates:function(e){var t=Array.isArray(e)?e:arguments;return this.update.apply(this,t),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(e){var t=Array.isArray(e)?e:arguments;return this.setDates.apply(this,x.map(t,this._utc_to_local)),this},setDate:e("setDates"),setUTCDate:e("setUTCDates"),remove:e("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var e=this.getFormattedDate();return this.inputField.val(e),this},getFormattedDate:function(t){t===I&&(t=this.o.format);var n=this.o.language;return x.map(this.dates,function(e){return R.formatDate(e,t,n)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(e){return this._process_options({startDate:e}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(e){return this._process_options({endDate:e}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(e){return this._process_options({daysOfWeekDisabled:e}),this.update(),this},setDaysOfWeekHighlighted:function(e){return this._process_options({daysOfWeekHighlighted:e}),this.update(),this},setDatesDisabled:function(e){return this._process_options({datesDisabled:e}),this.update(),this},place:function(){if(this.isInline)return this;var e=this.picker.outerWidth(),t=this.picker.outerHeight(),n=10,i=x(this.o.container),a=i.width(),s="body"===this.o.container?x(document).scrollTop():i.scrollTop(),o=i.offset(),r=[0];this.element.parents().each(function(){var e=x(this).css("z-index");"auto"!==e&&0!==Number(e)&&r.push(Number(e))});var l=Math.max.apply(Math,r)+this.o.zIndexOffset,c=this.component?this.component.parent().offset():this.element.offset(),d=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),u=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),_=c.left-o.left,h=c.top-o.top;"body"!==this.o.container&&(h+=s),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(_-=e-u)):c.left<0?(this.picker.addClass("datepicker-orient-left"),_-=c.left-n):a<_+e?(this.picker.addClass("datepicker-orient-right"),_+=u-e):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var p=this.o.orientation.y;if("auto"===p&&(p=-s+h-t<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+p),"top"===p?h-=t+parseInt(this.picker.css("padding-top")):h+=d,this.o.rtl){var f=a-(_+u);this.picker.css({top:h,right:f,zIndex:l})}else this.picker.css({top:h,left:_,zIndex:l});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var e=this.dates.copy(),n=[],t=!1;return arguments.length?(x.each(arguments,x.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),t=!0):(n=(n=this.isInput?this.element.val():this.element.data("date")||this.inputField.val())&&this.o.multidate?n.split(this.o.multidateSeparator):[n],delete this.element.data().date),n=x.map(n,x.proxy(function(e){return R.parseDate(e,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),n=x.grep(n,x.proxy(function(e){return!this.dateWithinRange(e)||!e},this),!0),this.dates.replace(n),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),t?(this.setValue(),this.element.change()):this.dates.length&&String(e)!==String(this.dates)&&t&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&e.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var e=this.o.weekStart,t="<tr>";for(this.o.calendarWeeks&&(t+='<th class="cw">&#160;</th>');e<this.o.weekStart+7;)t+='<th class="dow',-1!==x.inArray(e,this.o.daysOfWeekDisabled)&&(t+=" disabled"),t+='">'+S[this.o.language].daysMin[e++%7]+"</th>";t+="</tr>",this.picker.find(".datepicker-days thead").append(t)}},fillMonths:function(){for(var e=this._utc_to_local(this.viewDate),t="",n=0;n<12;n++)t+='<span class="month'+(e&&e.getMonth()===n?" focused":"")+'">'+S[this.o.language].monthsShort[n]+"</span>";this.picker.find(".datepicker-months td").html(t)},setRange:function(e){e&&e.length?this.range=x.map(e,function(e){return e.valueOf()}):delete this.range,this.fill()},getClassNames:function(e){var t=[],n=this.viewDate.getUTCFullYear(),i=this.viewDate.getUTCMonth(),a=O();return e.getUTCFullYear()<n||e.getUTCFullYear()===n&&e.getUTCMonth()<i?t.push("old"):(e.getUTCFullYear()>n||e.getUTCFullYear()===n&&e.getUTCMonth()>i)&&t.push("new"),this.focusDate&&e.valueOf()===this.focusDate.valueOf()&&t.push("focused"),this.o.todayHighlight&&s(e,a)&&t.push("today"),-1!==this.dates.contains(e)&&t.push("active"),this.dateWithinRange(e)||t.push("disabled"),this.dateIsDisabled(e)&&t.push("disabled","disabled-date"),-1!==x.inArray(e.getUTCDay(),this.o.daysOfWeekHighlighted)&&t.push("highlighted"),this.range&&(e>this.range[0]&&e<this.range[this.range.length-1]&&t.push("range"),-1!==x.inArray(e.valueOf(),this.range)&&t.push("selected"),e.valueOf()===this.range[0]&&t.push("range-start"),e.valueOf()===this.range[this.range.length-1]&&t.push("range-end")),t},_fill_yearsView:function(e,t,n,i,a,s,o){for(var r,l,c,d="",u=n/10,_=this.picker.find(e),h=Math.floor(i/n)*n,p=h+9*u,f=Math.floor(this.viewDate.getFullYear()/u)*u,m=x.map(this.dates,function(e){return Math.floor(e.getUTCFullYear()/u)*u}),g=h-u;g<=p+u;g+=u)r=[t],l=null,g===h-u?r.push("old"):g===p+u&&r.push("new"),-1!==x.inArray(g,m)&&r.push("active"),(g<a||s<g)&&r.push("disabled"),g===f&&r.push("focused"),o!==x.noop&&((c=o(new Date(g,0,1)))===I?c={}:"boolean"==typeof c?c={enabled:c}:"string"==typeof c&&(c={classes:c}),!1===c.enabled&&r.push("disabled"),c.classes&&(r=r.concat(c.classes.split(/\s+/))),c.tooltip&&(l=c.tooltip)),d+='<span class="'+r.join(" ")+'"'+(l?' title="'+l+'"':"")+">"+g+"</span>";_.find(".datepicker-switch").text(h+"-"+p),_.find("td").html(d)},fill:function(){var e,t,n=new Date(this.viewDate),a=n.getUTCFullYear(),i=n.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,r=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,l=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,c=S[this.o.language].today||S.en.today||"",d=S[this.o.language].clear||S.en.clear||"",u=S[this.o.language].titleFormat||S.en.titleFormat,_=O(),h=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&_>=this.o.startDate&&_<=this.o.endDate&&!this.weekOfDateIsDisabled(_);if(!isNaN(a)&&!isNaN(i)){this.picker.find(".datepicker-days .datepicker-switch").text(R.formatDate(n,u,this.o.language)),this.picker.find("tfoot .today").text(c).css("display",h?"table-cell":"none"),this.picker.find("tfoot .clear").text(d).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var p=D(a,i,0),f=p.getUTCDate();p.setUTCDate(f-(p.getUTCDay()-this.o.weekStart+7)%7);var m=new Date(p);p.getUTCFullYear()<100&&m.setUTCFullYear(p.getUTCFullYear()),m.setUTCDate(m.getUTCDate()+42),m=m.valueOf();for(var g,A,v=[];p.valueOf()<m;){if((g=p.getUTCDay())===this.o.weekStart&&(v.push("<tr>"),this.o.calendarWeeks)){var b=new Date(+p+(this.o.weekStart-g-7)%7*864e5),y=new Date(Number(b)+(11-b.getUTCDay())%7*864e5),$=new Date(Number($=D(y.getUTCFullYear(),0,1))+(11-$.getUTCDay())%7*864e5),w=(y-$)/864e5/7+1;v.push('<td class="cw">'+w+"</td>")}(A=this.getClassNames(p)).push("day");var k=p.getUTCDate();this.o.beforeShowDay!==x.noop&&((t=this.o.beforeShowDay(this._utc_to_local(p)))===I?t={}:"boolean"==typeof t?t={enabled:t}:"string"==typeof t&&(t={classes:t}),!1===t.enabled&&A.push("disabled"),t.classes&&(A=A.concat(t.classes.split(/\s+/))),t.tooltip&&(e=t.tooltip),t.content&&(k=t.content)),A="function"==typeof x.uniqueSort?x.uniqueSort(A):x.unique(A),v.push('<td class="'+A.join(" ")+'"'+(e?' title="'+e+'"':"")+' data-date="'+p.getTime().toString()+'">'+k+"</td>"),e=null,g===this.o.weekEnd&&v.push("</tr>"),p.setUTCDate(p.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(v.join(""));var C=S[this.o.language].monthsTitle||S.en.monthsTitle||"Months",E=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?C:a).end().find("tbody span").removeClass("active");if(x.each(this.dates,function(e,t){t.getUTCFullYear()===a&&E.eq(t.getUTCMonth()).addClass("active")}),(a<s||r<a)&&E.addClass("disabled"),a===s&&E.slice(0,o).addClass("disabled"),a===r&&E.slice(l+1).addClass("disabled"),this.o.beforeShowMonth!==x.noop){var T=this;x.each(E,function(e,t){var n=new Date(a,e,1),i=T.o.beforeShowMonth(n);i===I?i={}:"boolean"==typeof i?i={enabled:i}:"string"==typeof i&&(i={classes:i}),!1!==i.enabled||x(t).hasClass("disabled")||x(t).addClass("disabled"),i.classes&&x(t).addClass(i.classes),i.tooltip&&x(t).prop("title",i.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,a,s,r,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,a,s,r,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,a,s,r,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var e,t,n=new Date(this.viewDate),i=n.getUTCFullYear(),a=n.getUTCMonth(),s=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,o=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,r=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,l=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,c=1;switch(this.viewMode){case 4:c*=10;case 3:c*=10;case 2:c*=10;case 1:e=Math.floor(i/c)*c<=s,t=Math.floor(i/c)*c+c>r;break;case 0:e=i<=s&&a<=o,t=r<=i&&l<=a}this.picker.find(".prev").toggleClass("disabled",e),this.picker.find(".next").toggleClass("disabled",t)}},click:function(e){var t,n,i,a;e.preventDefault(),e.stopPropagation(),(t=x(e.target)).hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),t.hasClass("today")&&!t.hasClass("day")&&(this.setViewMode(0),this._setDate(O(),"linked"===this.o.todayBtn?null:"view")),t.hasClass("clear")&&this.clearDates(),t.hasClass("disabled")||(t.hasClass("month")||t.hasClass("year")||t.hasClass("decade")||t.hasClass("century"))&&(this.viewDate.setUTCDate(1),(n=1)===this.viewMode?(a=t.parent().find("span").index(t),i=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(a)):(a=0,i=Number(t.text()),this.viewDate.setUTCFullYear(i)),this._trigger(R.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(D(i,a,n)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(e){var t=x(e.currentTarget).data("date"),n=new Date(t);this.o.updateViewDate&&(n.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),n.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(n)},navArrowsClick:function(e){var t=x(e.currentTarget).hasClass("prev")?-1:1;0!==this.viewMode&&(t*=12*R.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,t),this._trigger(R.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(e){var t=this.dates.contains(e);if(e||this.dates.clear(),-1!==t?(!0===this.o.multidate||1<this.o.multidate||this.o.toggleActive)&&this.dates.remove(t):(!1===this.o.multidate&&this.dates.clear(),this.dates.push(e)),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(e,t){t&&"date"!==t||this._toggle_multidate(e&&new Date(e)),(!t&&this.o.updateViewDate||"view"===t)&&(this.viewDate=e&&new Date(e)),this.fill(),this.setValue(),t&&"view"===t||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||t&&"date"!==t||this.hide()},moveDay:function(e,t){var n=new Date(e);return n.setUTCDate(e.getUTCDate()+t),n},moveWeek:function(e,t){return this.moveDay(e,7*t)},moveMonth:function(e,t){if(!c(e))return this.o.defaultViewDate;if(!t)return e;var n,i,a=new Date(e.valueOf()),s=a.getUTCDate(),o=a.getUTCMonth(),r=Math.abs(t);if(t=0<t?1:-1,1===r)i=-1===t?function(){return a.getUTCMonth()===o}:function(){return a.getUTCMonth()!==n},n=o+t,a.setUTCMonth(n),n=(n+12)%12;else{for(var l=0;l<r;l++)a=this.moveMonth(a,t);n=a.getUTCMonth(),a.setUTCDate(s),i=function(){return n!==a.getUTCMonth()}}for(;i();)a.setUTCDate(--s),a.setUTCMonth(n);return a},moveYear:function(e,t){return this.moveMonth(e,12*t)},moveAvailableDate:function(e,t,n){do{if(e=this[n](e,t),!this.dateWithinRange(e))return!1;n="moveDay"}while(this.dateIsDisabled(e));return e},weekOfDateIsDisabled:function(e){return-1!==x.inArray(e.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(t){return this.weekOfDateIsDisabled(t)||0<x.grep(this.o.datesDisabled,function(e){return s(t,e)}).length},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":visible")){var t,n,i=!1,a=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault(),e.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;t=37===e.keyCode||38===e.keyCode?-1:1,0===this.viewMode?e.ctrlKey?(n=this.moveAvailableDate(a,t,"moveYear"))&&this._trigger("changeYear",this.viewDate):e.shiftKey?(n=this.moveAvailableDate(a,t,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===e.keyCode||39===e.keyCode?n=this.moveAvailableDate(a,t,"moveDay"):this.weekOfDateIsDisabled(a)||(n=this.moveAvailableDate(a,t,"moveWeek")):1===this.viewMode?(
38!==e.keyCode&&40!==e.keyCode||(t*=4),n=this.moveAvailableDate(a,t,"moveMonth")):2===this.viewMode&&(38!==e.keyCode&&40!==e.keyCode||(t*=4),n=this.moveAvailableDate(a,t,"moveYear")),n&&(this.focusDate=this.viewDate=n,this.setValue(),this.fill(),e.preventDefault());break;case 13:if(!this.o.forceParse)break;a=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(a),i=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),e.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}i&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))}else 40!==e.keyCode&&27!==e.keyCode||(this.show(),e.stopPropagation())},setViewMode:function(e){this.viewMode=e,this.picker.children("div").hide().filter(".datepicker-"+R.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var _=function(e,t){x.data(e,"datepicker",this),this.element=x(e),this.inputs=x.map(t.inputs,function(e){return e.jquery?e[0]:e}),delete t.inputs,this.keepEmptyValues=t.keepEmptyValues,delete t.keepEmptyValues,a.call(x(this.inputs),t).on("changeDate",x.proxy(this.dateUpdated,this)),this.pickers=x.map(this.inputs,function(e){return x.data(e,"datepicker")}),this.updateDates()};_.prototype={updateDates:function(){this.dates=x.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var n=x.map(this.dates,function(e){return e.valueOf()});x.each(this.pickers,function(e,t){t.setRange(n)})},clearDates:function(){x.each(this.pickers,function(e,t){t.clearDates()})},dateUpdated:function(e){if(!this.updating){this.updating=!0;var n=x.data(e.target,"datepicker");if(n!==I){var i=n.getUTCDate(),a=this.keepEmptyValues,t=x.inArray(e.target,this.inputs),s=t-1,o=t+1,r=this.inputs.length;if(-1!==t){if(x.each(this.pickers,function(e,t){t.getUTCDate()||t!==n&&a||t.setUTCDate(i)}),i<this.dates[s])for(;0<=s&&i<this.dates[s]&&0<(this.pickers[s].element.val()||"").length;)this.pickers[s--].setUTCDate(i);else if(i>this.dates[o])for(;o<r&&i>this.dates[o]&&0<(this.pickers[o].element.val()||"").length;)this.pickers[o++].setUTCDate(i);this.updateDates(),delete this.updating}}}},destroy:function(){x.map(this.pickers,function(e){e.destroy()}),x(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:e("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var i=x.fn.datepicker,a=function(o){var r,l=Array.apply(null,arguments);if(l.shift(),this.each(function(){var e=x(this),t=e.data("datepicker"),n="object"==typeof o&&o;if(!t){var i=d(this,"date"),a=u(x.extend({},h,i,n).language),s=x.extend({},h,a,i,n);e.hasClass("input-daterange")||s.inputs?(x.extend(s,{inputs:s.inputs||e.find("input").toArray()}),t=new _(this,s)):t=new $(this,s),e.data("datepicker",t)}"string"==typeof o&&"function"==typeof t[o]&&(r=t[o].apply(t,l))}),r===I||r instanceof $||r instanceof _)return this;if(1<this.length)throw new Error("Using only allowed for the collection of a single element ("+o+" function)");return r};x.fn.datepicker=a;var h=x.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:x.noop,beforeShowMonth:x.noop,beforeShowYear:x.noop,beforeShowDecade:x.noop,beforeShowCentury:x.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",isInline:null,keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&#x00AB;",rightArrow:"&#x00BB;"},showWeekDays:!0},o=x.fn.datepicker.locale_opts=["format","rtl","weekStart"];x.fn.datepicker.Constructor=$;var S=x.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},R={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(e){if("function"==typeof e.toValue&&"function"==typeof e.toDisplay)return e;var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||0===n.length)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(e,t,n,i){function a(e,t){return!0===t&&(t=10),e<100&&(e+=2e3)>(new Date).getFullYear()+t&&(e-=100),e}function s(){var e=this.slice(0,o[c].length),t=o[c].slice(0,e.length);return e.toLowerCase()===t.toLowerCase()}if(!e)return I;if(e instanceof Date)return e;if("string"==typeof t&&(t=R.parseFormat(t)),t.toValue)return t.toValue(e,t,n);var o,r,l,c,d,u={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},_={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(e in _&&(e=_[e]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(e)){for(o=e.match(/([\-+]\d+)([dmwy])/gi),e=new Date,c=0;c<o.length;c++)r=o[c].match(/([\-+]\d+)([dmwy])/i),l=Number(r[1]),d=u[r[2].toLowerCase()],e=$.prototype[d](e,l);return $.prototype._zero_utc_time(e)}o=e&&e.match(this.nonpunctuation)||[];var h,p,f={},m=["yyyy","yy","M","MM","m","mm","d","dd"],g={yyyy:function(e,t){return e.setUTCFullYear(i?a(t,i):t)},m:function(e,t){if(isNaN(e))return e;for(t-=1;t<0;)t+=12;for(t%=12,e.setUTCMonth(t);e.getUTCMonth()!==t;)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}};g.yy=g.yyyy,g.M=g.MM=g.mm=g.m,g.dd=g.d,e=O();var A=t.parts.slice();if(o.length!==A.length&&(A=x(A).filter(function(e,t){return-1!==x.inArray(t,m)}).toArray()),o.length===A.length){var v,b,y;for(c=0,v=A.length;c<v;c++){if(h=parseInt(o[c],10),r=A[c],isNaN(h))switch(r){case"MM":p=x(S[n].months).filter(s),h=x.inArray(p[0],S[n].months)+1;break;case"M":p=x(S[n].monthsShort).filter(s),h=x.inArray(p[0],S[n].monthsShort)+1}f[r]=h}for(c=0;c<m.length;c++)(y=m[c])in f&&!isNaN(f[y])&&(b=new Date(e),g[y](b,f[y]),isNaN(b)||(e=b))}return e},formatDate:function(e,t,n){if(!e)return"";if("string"==typeof t&&(t=R.parseFormat(t)),t.toDisplay)return t.toDisplay(e,t,n);var i={d:e.getUTCDate(),D:S[n].daysShort[e.getUTCDay()],DD:S[n].days[e.getUTCDay()],m:e.getUTCMonth()+1,M:S[n].monthsShort[e.getUTCMonth()],MM:S[n].months[e.getUTCMonth()],yy:e.getUTCFullYear().toString().substring(2),yyyy:e.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,e=[];for(var a=x.extend([],t.separators),s=0,o=t.parts.length;s<=o;s++)a.length&&e.push(a.shift()),e.push(i[t.parts[s]]);return e.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+h.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+h.templates.rightArrow+"</th></tr></thead>",contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};R.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+R.headTemplate+"<tbody></tbody>"+R.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+R.headTemplate+R.contTemplate+R.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+R.headTemplate+R.contTemplate+R.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+R.headTemplate+R.contTemplate+R.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+R.headTemplate+R.contTemplate+R.footTemplate+"</table></div></div>",x.fn.datepicker.DPGlobal=R,x.fn.datepicker.noConflict=function(){return x.fn.datepicker=i,this},x.fn.datepicker.version="1.10.0",x.fn.datepicker.deprecated=function(e){var t=window.console;t&&t.warn&&t.warn("DEPRECATED: "+e)},x(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var t=x(this);t.data("datepicker")||(e.preventDefault(),a.call(t,"show"))}),x(function(){a.call(x('[data-provide="datepicker-inline"]'))})}),function(e){e.fn.datepicker.dates["en-CA"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:0,format:"yyyy-mm-dd"},e.fn.datepicker.deprecated("This filename doesn't follow the convention, use bootstrap-datepicker.en-CA.js instead.")}(jQuery),jQuery.fn.datepicker.dates["ar-DZ"]={days:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a","\u0627\u0644\u0623\u062d\u062f"],daysShort:["\u0623\u062d\u062f","\u0627\u062b\u0646\u064a\u0646","\u062b\u0644\u0627\u062b\u0627\u0621","\u0623\u0631\u0628\u0639\u0627\u0621","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639\u0629","\u0633\u0628\u062a","\u0623\u062d\u062f"],daysMin:["\u062d","\u0646","\u062b","\u0639","\u062e","\u062c","\u0633","\u062d"],months:["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0647","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],monthsShort:["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0647","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],today:"\u0647\u0630\u0627 \u0627\u0644\u064a\u0648\u0645",rtl:!0,monthsTitle:"\u0623\u0634\u0647\u0631",clear:"\u0625\u0632\u0627\u0644\u0629",format:"yyyy/mm/dd",weekStart:0},jQuery.fn.datepicker.dates["ar-tn"]={days:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a","\u0627\u0644\u0623\u062d\u062f"],daysShort:["\u0623\u062d\u062f","\u0627\u062b\u0646\u064a\u0646","\u062b\u0644\u0627\u062b\u0627\u0621","\u0623\u0631\u0628\u0639\u0627\u0621","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639\u0629","\u0633\u0628\u062a","\u0623\u062d\u062f"],daysMin:["\u062d","\u0646","\u062b","\u0639","\u062e","\u062c","\u0633","\u062d"],months:["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0647","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],monthsShort:["\u062c\u0627\u0646\u0641\u064a","\u0641\u064a\u0641\u0631\u064a","\u0645\u0627\u0631\u0633","\u0623\u0641\u0631\u064a\u0644","\u0645\u0627\u064a","\u062c\u0648\u0627\u0646","\u062c\u0648\u064a\u0644\u064a\u0647","\u0623\u0648\u062a","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],today:"\u0647\u0630\u0627 \u0627\u0644\u064a\u0648\u0645",rtl:!0},jQuery.fn.datepicker.dates.ar={days:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a","\u0627\u0644\u0623\u062d\u062f"],daysShort:["\u0623\u062d\u062f","\u0627\u062b\u0646\u064a\u0646","\u062b\u0644\u0627\u062b\u0627\u0621","\u0623\u0631\u0628\u0639\u0627\u0621","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639\u0629","\u0633\u0628\u062a","\u0623\u062d\u062f"],daysMin:["\u062d","\u0646","\u062b","\u0639","\u062e","\u062c","\u0633","\u062d"],months:["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],monthsShort:["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],today:"\u0647\u0630\u0627 \u0627\u0644\u064a\u0648\u0645",rtl:!0},jQuery.fn.datepicker.dates.az={days:["Bazar","Bazar ert\u0259si","\xc7\u0259r\u015f\u0259nb\u0259 ax\u015fam\u0131","\xc7\u0259r\u015f\u0259nb\u0259","C\xfcm\u0259 ax\u015fam\u0131","C\xfcm\u0259","\u015e\u0259nb\u0259"],daysShort:["B.","B.e","\xc7.a","\xc7.","C.a","C.","\u015e."],daysMin:["B.","B.e","\xc7.a","\xc7.","C.a","C.","\u015e."],months:["Yanvar","Fevral","Mart","Aprel","May","\u0130yun","\u0130yul","Avqust","Sentyabr","Oktyabr","Noyabr","Dekabr"],monthsShort:["Yan","Fev","Mar","Apr","May","\u0130yun","\u0130yul","Avq","Sen","Okt","Noy","Dek"],today:"Bu g\xfcn",weekStart:1,clear:"T\u0259mizl\u0259",monthsTitle:"Aylar"},jQuery.fn.datepicker.dates.bg={days:["\u041d\u0435\u0434\u0435\u043b\u044f","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u044f\u0434\u0430","\u0427\u0435\u0442\u0432\u044a\u0440\u0442\u044a\u043a","\u041f\u0435\u0442\u044a\u043a","\u0421\u044a\u0431\u043e\u0442\u0430"],daysShort:["\u041d\u0435\u0434","\u041f\u043e\u043d","\u0412\u0442\u043e","\u0421\u0440\u044f","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u044a\u0431"],daysMin:["\u041d","\u041f","\u0412","\u0421","\u0427","\u041f","\u0421"],months:["\u042f\u043d\u0443\u0430\u0440\u0438","\u0424\u0435\u0432\u0440\u0443\u0430\u0440\u0438","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0439","\u042e\u043d\u0438","\u042e\u043b\u0438","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438","\u041e\u043a\u0442\u043e\u043c\u0432\u0440\u0438","\u041d\u043e\u0435\u043c\u0432\u0440\u0438","\u0414\u0435\u043a\u0435\u043c\u0432\u0440\u0438"],monthsShort:["\u042f\u043d","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0439","\u042e\u043d\u0438","\u042e\u043b\u0438","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0435","\u0414\u0435\u043a"],today:"\u0434\u043d\u0435\u0441"},jQuery.fn.datepicker.dates.bm={days:["Kari","Nt\u025bn\u025bn","Tarata","Araba","Alamisa","Juma","Sibiri"],daysShort:["Kar","Nt\u025b","Tar","Ara","Ala","Jum","Sib"],daysMin:["Ka","Nt","Ta","Ar","Al","Ju","Si"],months:["Zanwuyekalo","Fewuruyekalo","Marisikalo","Awirilikalo","M\u025bkalo","Zuw\u025bnkalo","Zuluyekalo","Utikalo","S\u025btanburukalo","\u0254kut\u0254burukalo","Nowanburukalo","Desanburukalo"],monthsShort:["Zan","Few","Mar","Awi","M\u025b","Zuw","Zul","Uti","S\u025bt","\u0254ku","Now","Des"],today:"Bi",monthsTitle:"Kalo",clear:"Ka j\u0254si",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.bn={days:["\u09b0\u09ac\u09bf\u09ac\u09be\u09b0","\u09b8\u09cb\u09ae\u09ac\u09be\u09b0","\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0","\u09ac\u09c1\u09a7\u09ac\u09be\u09b0","\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0","\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0","\u09b6\u09a8\u09bf\u09ac\u09be\u09b0"],daysShort:["\u09b0\u09ac\u09bf\u09ac\u09be\u09b0","\u09b8\u09cb\u09ae\u09ac\u09be\u09b0","\u09ae\u0999\u09cd\u0997\u09b2\u09ac\u09be\u09b0","\u09ac\u09c1\u09a7\u09ac\u09be\u09b0","\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf\u09ac\u09be\u09b0","\u09b6\u09c1\u0995\u09cd\u09b0\u09ac\u09be\u09b0","\u09b6\u09a8\u09bf\u09ac\u09be\u09b0"],daysMin:["\u09b0\u09ac\u09bf","\u09b8\u09cb\u09ae","\u09ae\u0999\u09cd\u0997\u09b2","\u09ac\u09c1\u09a7","\u09ac\u09c3\u09b9\u09b8\u09cd\u09aa\u09a4\u09bf","\u09b6\u09c1\u0995\u09cd\u09b0","\u09b6\u09a8\u09bf"],months:["\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0","\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09bf","\u09ae\u09be\u09b0\u09cd\u099a","\u098f\u09aa\u09cd\u09b0\u09bf\u09b2","\u09ae\u09c7","\u099c\u09c1\u09a8","\u099c\u09c1\u09b2\u09be\u0987","\u0985\u0997\u09be\u09b8\u09cd\u099f","\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0","\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0","\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0","\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0"],monthsShort:["\u099c\u09be\u09a8\u09c1\u09af\u09bc\u09be\u09b0\u09c0","\u09ab\u09c7\u09ac\u09cd\u09b0\u09c1\u09af\u09bc\u09be\u09b0\u09bf","\u09ae\u09be\u09b0\u09cd\u099a","\u098f\u09aa\u09cd\u09b0\u09bf\u09b2","\u09ae\u09c7","\u099c\u09c1\u09a8","\u099c\u09c1\u09b2\u09be\u0987","\u0985\u0997\u09be\u09b8\u09cd\u099f","\u09b8\u09c7\u09aa\u09cd\u099f\u09c7\u09ae\u09cd\u09ac\u09b0","\u0985\u0995\u09cd\u099f\u09cb\u09ac\u09b0","\u09a8\u09ad\u09c7\u09ae\u09cd\u09ac\u09b0","\u09a1\u09bf\u09b8\u09c7\u09ae\u09cd\u09ac\u09b0"],today:"\u0986\u099c",monthsTitle:"\u09ae\u09be\u09b8",clear:"\u09aa\u09b0\u09bf\u09b7\u09cd\u0995\u09be\u09b0",weekStart:0,format:"mm/dd/yyyy"},jQuery.fn.datepicker.dates.br={days:["Sul","Lun","Meurzh","Merc'her","Yaou","Gwener","Sadorn"],daysShort:["Sul","Lun","Meu.","Mer.","Yao.","Gwe.","Sad."],daysMin:["Su","L","Meu","Mer","Y","G","Sa"],months:["Genver","C'hwevrer","Meurzh","Ebrel","Mae","Mezheven","Gouere","Eost","Gwengolo","Here","Du","Kerzu"],monthsShort:["Genv.","C'hw.","Meur.","Ebre.","Mae","Mezh.","Goue.","Eost","Gwen.","Here","Du","Kerz."],today:"Hiziv",monthsTitle:"Miz",clear:"Dilemel",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.bs={days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","\u010cetvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sri","\u010cet","Pet","Sub"],daysMin:["N","Po","U","Sr","\u010c","Pe","Su"],months:["Januar","Februar","Mart","April","Maj","Juni","Juli","August","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.ca={days:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],daysShort:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],daysMin:["dg","dl","dt","dc","dj","dv","ds"],months:["gener","febrer","mar\xe7","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],monthsShort:["gen.","febr.","mar\xe7","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],today:"Avui",monthsTitle:"Mesos",clear:"Esborra",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.cs={days:["Ned\u011ble","Pond\u011bl\xed","\xdater\xfd","St\u0159eda","\u010ctvrtek","P\xe1tek","Sobota"],daysShort:["Ned","Pon","\xdate","St\u0159","\u010ctv","P\xe1t","Sob"],daysMin:["Ne","Po","\xdat","St","\u010ct","P\xe1","So"],months:["Leden","\xdanor","B\u0159ezen","Duben","Kv\u011bten","\u010cerven","\u010cervenec","Srpen","Z\xe1\u0159\xed","\u0158\xedjen","Listopad","Prosinec"],monthsShort:["Led","\xdano","B\u0159e","Dub","Kv\u011b","\u010cer","\u010cnc","Srp","Z\xe1\u0159","\u0158\xedj","Lis","Pro"],today:"Dnes",clear:"Vymazat",monthsTitle:"M\u011bs\xedc",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.cy={days:["Sul","Llun","Mawrth","Mercher","Iau","Gwener","Sadwrn"],daysShort:["Sul","Llu","Maw","Mer","Iau","Gwe","Sad"],daysMin:["Su","Ll","Ma","Me","Ia","Gwe","Sa"],months:["Ionawr","Chewfror","Mawrth","Ebrill","Mai","Mehefin","Gorfennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"],monthsShort:["Ion","Chw","Maw","Ebr","Mai","Meh","Gor","Aws","Med","Hyd","Tach","Rha"],today:"Heddiw"},jQuery.fn.datepicker.dates.da={days:["S\xf8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\xf8rdag"],daysShort:["S\xf8n","Man","Tir","Ons","Tor","Fre","L\xf8r"],daysMin:["S\xf8","Ma","Ti","On","To","Fr","L\xf8"],months:["Januar","Februar","Marts","April","Maj","Juni","Juli","August","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I Dag",weekStart:1,clear:"Nulstil",format:"dd/mm/yyyy",monthsTitle:"M\xe5neder"},jQuery.fn.datepicker.dates.de={days:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],daysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],daysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],months:["Januar","Februar","M\xe4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","M\xe4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],today:"Heute",monthsTitle:"Monate",clear:"L\xf6schen",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.el={days:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],daysShort:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],daysMin:["\u039a\u03c5","\u0394\u03b5","\u03a4\u03c1","\u03a4\u03b5","\u03a0\u03b5","\u03a0\u03b1","\u03a3\u03b1"],months:["\u0399\u03b1\u03bd\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03ac\u03c1\u03b9\u03bf\u03c2","\u039c\u03ac\u03c1\u03c4\u03b9\u03bf\u03c2","\u0391\u03c0\u03c1\u03af\u03bb\u03b9\u03bf\u03c2","\u039c\u03ac\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bd\u03b9\u03bf\u03c2","\u0399\u03bf\u03cd\u03bb\u03b9\u03bf\u03c2","\u0391\u03cd\u03b3\u03bf\u03c5\u03c3\u03c4\u03bf\u03c2","\u03a3\u03b5\u03c0\u03c4\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u039f\u03ba\u03c4\u03ce\u03b2\u03c1\u03b9\u03bf\u03c2","\u039d\u03bf\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2","\u0394\u03b5\u03ba\u03ad\u03bc\u03b2\u03c1\u03b9\u03bf\u03c2"],monthsShort:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03ac\u03b9","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],today:"\u03a3\u03ae\u03bc\u03b5\u03c1\u03b1",clear:"\u039a\u03b1\u03b8\u03b1\u03c1\u03b9\u03c3\u03bc\u03cc\u03c2",weekStart:1,format:"d/m/yyyy"},jQuery.fn.datepicker.dates["en-AU"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:1,format:"d/mm/yyyy"},jQuery.fn.datepicker.dates["en-CA"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:0,format:"yyyy-mm-dd"},jQuery.fn.datepicker.dates["en-GB"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates["en-IE"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates["en-NZ"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:1,format:"d/mm/yyyy"},jQuery.fn.datepicker.dates["en-US"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:0,format:"m/d/yyyy"},jQuery.fn.datepicker.dates["en-ZA"]={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",monthsTitle:"Months",clear:"Clear",weekStart:1,format:"yyyy/mm/d"},jQuery.fn.datepicker.dates.eo={days:["diman\u0109o","lundo","mardo","merkredo","\u0135a\u016ddo","vendredo","sabato"],daysShort:["dim.","lun.","mar.","mer.","\u0135a\u016d.","ven.","sam."],daysMin:["d","l","ma","me","\u0135","v","s"],months:["januaro","februaro","marto","aprilo","majo","junio","julio","a\u016dgusto","septembro","oktobro","novembro","decembro"],monthsShort:["jan.","feb.","mar.","apr.","majo","jun.","jul.","a\u016dg.","sep.","okt.","nov.","dec."],today:"Hodia\u016d",clear:"Nuligi",weekStart:1,format:"yyyy-mm-dd"},jQuery.fn.datepicker.dates.es={days:["Domingo","Lunes","Martes","Mi\xe9rcoles","Jueves","Viernes","S\xe1bado"],daysShort:["Dom","Lun","Mar","Mi\xe9","Jue","Vie","S\xe1b"],daysMin:["Do","Lu","Ma","Mi","Ju","Vi","Sa"],months:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],monthsShort:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],today:"Hoy",monthsTitle:"Meses",clear:"Borrar",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.et={days:["P\xfchap\xe4ev","Esmasp\xe4ev","Teisip\xe4ev","Kolmap\xe4ev","Neljap\xe4ev","Reede","Laup\xe4ev"],daysShort:["P\xfchap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup"],daysMin:["P","E","T","K","N","R","L"],months:["Jaanuar","Veebruar","M\xe4rts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],monthsShort:["Jaan","Veebr","M\xe4rts","Apr","Mai","Juuni","Juuli","Aug","Sept","Okt","Nov","Dets"],today:"T\xe4na",clear:"T\xfchjenda",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.eu={days:["Igandea","Astelehena","Asteartea","Asteazkena","Osteguna","Ostirala","Larunbata"],daysShort:["Ig","Al","Ar","Az","Og","Ol","Lr"],daysMin:["Ig","Al","Ar","Az","Og","Ol","Lr"],months:["Urtarrila","Otsaila","Martxoa","Apirila","Maiatza","Ekaina","Uztaila","Abuztua","Iraila","Urria","Azaroa","Abendua"],monthsShort:["Urt","Ots","Mar","Api","Mai","Eka","Uzt","Abu","Ira","Urr","Aza","Abe"],today:"Gaur",monthsTitle:"Hilabeteak",clear:"Ezabatu",weekStart:1,format:"yyyy/mm/dd"},jQuery.fn.datepicker.dates.fa={days:["\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647","\u062f\u0648\u0634\u0646\u0628\u0647","\u0633\u0647\u200c\u0634\u0646\u0628\u0647","\u0686\u0647\u0627\u0631\u0634\u0646\u0628\u0647","\u067e\u0646\u062c\u200c\u0634\u0646\u0628\u0647","\u062c\u0645\u0639\u0647","\u0634\u0646\u0628\u0647","\u06cc\u06a9\u200c\u0634\u0646\u0628\u0647"],daysShort:["\u06cc\u06a9","\u062f\u0648","\u0633\u0647","\u0686\u0647\u0627\u0631","\u067e\u0646\u062c","\u062c\u0645\u0639\u0647","\u0634\u0646\u0628\u0647","\u06cc\u06a9"],daysMin:["\u06cc","\u062f","\u0633","\u0686","\u067e","\u062c","\u0634","\u06cc"],months:["\u0698\u0627\u0646\u0648\u06cc\u0647","\u0641\u0648\u0631\u06cc\u0647","\u0645\u0627\u0631\u0633","\u0622\u0648\u0631\u06cc\u0644","\u0645\u0647","\u0698\u0648\u0626\u0646","\u0698\u0648\u0626\u06cc\u0647","\u0627\u0648\u062a","\u0633\u067e\u062a\u0627\u0645\u0628\u0631","\u0627\u06a9\u062a\u0628\u0631","\u0646\u0648\u0627\u0645\u0628\u0631","\u062f\u0633\u0627\u0645\u0628\u0631"],monthsShort:["\u0698\u0627\u0646","\u0641\u0648\u0631","\u0645\u0627\u0631","\u0622\u0648\u0631","\u0645\u0647","\u0698\u0648\u0646","\u0698\u0648\u06cc","\u0627\u0648\u062a","\u0633\u067e\u062a","\u0627\u06a9\u062a","\u0646\u0648\u0627","\u062f\u0633\u0627"],today:"\u0627\u0645\u0631\u0648\u0632",clear:"\u067e\u0627\u06a9 \u06a9\u0646",weekStart:1,format:"yyyy/mm/dd"},jQuery.fn.datepicker.dates.fi={days:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],daysShort:["sun","maa","tii","kes","tor","per","lau"],daysMin:["su","ma","ti","ke","to","pe","la"],months:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kes\xe4kuu","hein\xe4kuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],monthsShort:["tammi","helmi","maalis","huhti","touko","kes\xe4","hein\xe4","elo","syys","loka","marras","joulu"],today:"t\xe4n\xe4\xe4n",clear:"Tyhjenn\xe4",weekStart:1,format:"d.m.yyyy"},jQuery.fn.datepicker.dates.fo={days:["Sunnudagur","M\xe1nadagur","T\xfdsdagur","Mikudagur","H\xf3sdagur","Fr\xedggjadagur","Leygardagur"],daysShort:["Sun","M\xe1n","T\xfds","Mik","H\xf3s","Fr\xed","Ley"],daysMin:["Su","M\xe1","T\xfd","Mi","H\xf3","Fr","Le"],months:["Januar","Februar","Marts","Apr\xedl","Mei","Juni","Juli","August","Septembur","Oktobur","Novembur","Desembur"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"],today:"\xcd Dag",clear:"Reinsa"},jQuery.fn.datepicker.dates.fr={days:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],daysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],daysMin:["D",
"L","Ma","Me","J","V","S"],months:["Janvier","F\xe9vrier","Mars","Avril","Mai","Juin","Juillet","Ao\xfbt","Septembre","Octobre","Novembre","D\xe9cembre"],monthsShort:["Jan","F\xe9v","Mar","Avr","Mai","Jui","Jul","Aou","Sep","Oct","Nov","D\xe9c"],today:"Aujourd'hui",monthsTitle:"Mois",clear:"Effacer",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.fr={days:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],daysShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],daysMin:["d","l","ma","me","j","v","s"],months:["janvier","f\xe9vrier","mars","avril","mai","juin","juillet","ao\xfbt","septembre","octobre","novembre","d\xe9cembre"],monthsShort:["janv.","f\xe9vr.","mars","avril","mai","juin","juil.","ao\xfbt","sept.","oct.","nov.","d\xe9c."],today:"Aujourd'hui",monthsTitle:"Mois",clear:"Effacer",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.gl={days:["Domingo","Luns","Martes","M\xe9rcores","Xoves","Venres","S\xe1bado"],daysShort:["Dom","Lun","Mar","M\xe9r","Xov","Ven","S\xe1b"],daysMin:["Do","Lu","Ma","Me","Xo","Ve","Sa"],months:["Xaneiro","Febreiro","Marzo","Abril","Maio","Xu\xf1o","Xullo","Agosto","Setembro","Outubro","Novembro","Decembro"],monthsShort:["Xan","Feb","Mar","Abr","Mai","Xun","Xul","Ago","Sep","Out","Nov","Dec"],today:"Hoxe",clear:"Limpar",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.he={days:["\u05e8\u05d0\u05e9\u05d5\u05df","\u05e9\u05e0\u05d9","\u05e9\u05dc\u05d9\u05e9\u05d9","\u05e8\u05d1\u05d9\u05e2\u05d9","\u05d7\u05de\u05d9\u05e9\u05d9","\u05e9\u05d9\u05e9\u05d9","\u05e9\u05d1\u05ea","\u05e8\u05d0\u05e9\u05d5\u05df"],daysShort:["\u05d0","\u05d1","\u05d2","\u05d3","\u05d4","\u05d5","\u05e9","\u05d0"],daysMin:["\u05d0","\u05d1","\u05d2","\u05d3","\u05d4","\u05d5","\u05e9","\u05d0"],months:["\u05d9\u05e0\u05d5\u05d0\u05e8","\u05e4\u05d1\u05e8\u05d5\u05d0\u05e8","\u05de\u05e8\u05e5","\u05d0\u05e4\u05e8\u05d9\u05dc","\u05de\u05d0\u05d9","\u05d9\u05d5\u05e0\u05d9","\u05d9\u05d5\u05dc\u05d9","\u05d0\u05d5\u05d2\u05d5\u05e1\u05d8","\u05e1\u05e4\u05d8\u05de\u05d1\u05e8","\u05d0\u05d5\u05e7\u05d8\u05d5\u05d1\u05e8","\u05e0\u05d5\u05d1\u05de\u05d1\u05e8","\u05d3\u05e6\u05de\u05d1\u05e8"],monthsShort:["\u05d9\u05e0\u05d5","\u05e4\u05d1\u05e8","\u05de\u05e8\u05e5","\u05d0\u05e4\u05e8","\u05de\u05d0\u05d9","\u05d9\u05d5\u05e0","\u05d9\u05d5\u05dc","\u05d0\u05d5\u05d2","\u05e1\u05e4\u05d8","\u05d0\u05d5\u05e7","\u05e0\u05d5\u05d1","\u05d3\u05e6\u05de"],today:"\u05d4\u05d9\u05d5\u05dd",rtl:!0},jQuery.fn.datepicker.dates.hi={days:["\u0930\u0935\u093f\u0935\u093e\u0930","\u0938\u094b\u092e\u0935\u093e\u0930","\u092e\u0902\u0917\u0932\u0935\u093e\u0930","\u092c\u0941\u0927\u0935\u093e\u0930","\u0917\u0941\u0930\u0941\u0935\u093e\u0930","\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930","\u0936\u0928\u093f\u0935\u093e\u0930"],daysShort:["\u0938\u0942\u0930\u094d\u092f","\u0938\u094b\u092e","\u092e\u0902\u0917\u0932","\u092c\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094d\u0930","\u0936\u0928\u093f"],daysMin:["\u0930","\u0938\u094b","\u092e\u0902","\u092c\u0941","\u0917\u0941","\u0936\u0941","\u0936"],months:["\u091c\u0928\u0935\u0930\u0940","\u092b\u093c\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u091f\u0942\u092c\u0930","\u0928\u0935\u0902\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],monthsShort:["\u091c\u0928","\u092b\u093c\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u0902","\u0905\u0915\u094d\u091f\u0942\u092c\u0930","\u0928\u0935\u0902","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],today:"\u0906\u091c",monthsTitle:"\u092e\u0939\u0940\u0928\u0947",clear:"\u0938\u093e\u092b",weekStart:1,format:"dd / mm / yyyy"},jQuery.fn.datepicker.dates.hr={days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","\u010cetvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sri","\u010cet","Pet","Sub"],daysMin:["Ne","Po","Ut","Sr","\u010ce","Pe","Su"],months:["Sije\u010danj","Velja\u010da","O\u017eujak","Travanj","Svibanj","Lipanj","Srpanj","Kolovoz","Rujan","Listopad","Studeni","Prosinac"],monthsShort:["Sij","Velj","O\u017eu","Tra","Svi","Lip","Srp","Kol","Ruj","Lis","Stu","Pro"],today:"Danas"},jQuery.fn.datepicker.dates.hu={days:["vas\xe1rnap","h\xe9tf\u0151","kedd","szerda","cs\xfct\xf6rt\xf6k","p\xe9ntek","szombat"],daysShort:["vas","h\xe9t","ked","sze","cs\xfc","p\xe9n","szo"],daysMin:["V","H","K","Sze","Cs","P","Szo"],months:["janu\xe1r","febru\xe1r","m\xe1rcius","\xe1prilis","m\xe1jus","j\xfanius","j\xfalius","augusztus","szeptember","okt\xf3ber","november","december"],monthsShort:["jan","feb","m\xe1r","\xe1pr","m\xe1j","j\xfan","j\xfal","aug","sze","okt","nov","dec"],today:"ma",weekStart:1,clear:"t\xf6r\xf6l",titleFormat:"yyyy. MM",format:"yyyy.mm.dd"},jQuery.fn.datepicker.dates.hy={days:["\u053f\u056b\u0580\u0561\u056f\u056b","\u0535\u0580\u056f\u0578\u0582\u0577\u0561\u0562\u0569\u056b","\u0535\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b","\u0549\u0578\u0580\u0565\u0584\u0577\u0561\u0562\u0569\u056b","\u0540\u056b\u0576\u0563\u0577\u0561\u0562\u0569\u056b","\u0548\u0582\u0580\u0562\u0561\u0569","\u0547\u0561\u0562\u0561\u0569"],daysShort:["\u053f\u056b\u0580","\u0535\u0580\u056f","\u0535\u0580\u0565","\u0549\u0578\u0580","\u0540\u056b\u0576","\u0548\u0582\u0580\u0562","\u0547\u0561\u0562"],daysMin:["\u053f\u056b","\u0535\u056f","\u0535\u0584","\u0549\u0578","\u0540\u056b","\u0548\u0582","\u0547\u0561"],months:["\u0540\u0578\u0582\u0576\u057e\u0561\u0580","\u0553\u0565\u057f\u0580\u057e\u0561\u0580","\u0544\u0561\u0580\u057f","\u0531\u057a\u0580\u056b\u056c","\u0544\u0561\u0575\u056b\u057d","\u0540\u0578\u0582\u0576\u056b\u057d","\u0540\u0578\u0582\u056c\u056b\u057d","\u0555\u0563\u0578\u057d\u057f\u0578\u057d","\u054d\u0565\u057a\u057f\u0565\u0574\u0562\u0565\u0580","\u0540\u0578\u056f\u057f\u0565\u0574\u0562\u0565\u0580","\u0546\u0578\u0575\u0565\u0574\u0562\u0565\u0580","\u0534\u0565\u056f\u057f\u0565\u0574\u0562\u0565\u0580"],monthsShort:["\u0540\u0576\u057e","\u0553\u0565\u057f","\u0544\u0561\u0580","\u0531\u057a\u0580","\u0544\u0561\u0575","\u0540\u0578\u0582\u0576","\u0540\u0578\u0582\u056c","\u0555\u0563\u057d","\u054d\u0565\u057a","\u0540\u0578\u056f","\u0546\u0578\u0575","\u0534\u0565\u056f"],today:"\u0531\u0575\u057d\u0585\u0580",clear:"\u054b\u0576\u057b\u0565\u056c",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"\u0531\u0574\u056b\u057d\u0576\u0567\u0580"},jQuery.fn.datepicker.dates.id={days:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],daysShort:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],daysMin:["Mg","Sn","Sl","Rb","Km","Jm","Sb"],months:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],today:"Hari Ini",monthsTitle:"Bulan",clear:"Kosongkan",weekStart:0,format:"dd-mm-yyyy"},jQuery.fn.datepicker.dates.is={days:["Sunnudagur","M\xe1nudagur","\xderi\xf0judagur","Mi\xf0vikudagur","Fimmtudagur","F\xf6studagur","Laugardagur"],daysShort:["Sun","M\xe1n","\xderi","Mi\xf0","Fim","F\xf6s","Lau"],daysMin:["Su","M\xe1","\xder","Mi","Fi","F\xf6","La"],months:["Jan\xfaar","Febr\xfaar","Mars","Apr\xedl","Ma\xed","J\xfan\xed","J\xfal\xed","\xc1g\xfast","September","Okt\xf3ber","N\xf3vember","Desember"],monthsShort:["Jan","Feb","Mar","Apr","Ma\xed","J\xfan","J\xfal","\xc1g\xfa","Sep","Okt","N\xf3v","Des"],today:"\xcd Dag"},jQuery.fn.datepicker.dates.it={days:["Domenica","Luned\xec","Marted\xec","Mercoled\xec","Gioved\xec","Venerd\xec","Sabato"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.it={days:["Domenica","Luned\xec","Marted\xec","Mercoled\xec","Gioved\xec","Venerd\xec","Sabato"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",monthsTitle:"Mesi",clear:"Cancella",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.ja={days:["\u65e5\u66dc","\u6708\u66dc","\u706b\u66dc","\u6c34\u66dc","\u6728\u66dc","\u91d1\u66dc","\u571f\u66dc"],daysShort:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],daysMin:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],months:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],monthsShort:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],today:"\u4eca\u65e5",format:"yyyy/mm/dd",titleFormat:"yyyy\u5e74mm\u6708",clear:"\u30af\u30ea\u30a2"},jQuery.fn.datepicker.dates.ka={days:["\u10d9\u10d5\u10d8\u10e0\u10d0","\u10dd\u10e0\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10e1\u10d0\u10db\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10dd\u10d7\u10ee\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10ee\u10e3\u10d7\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8","\u10de\u10d0\u10e0\u10d0\u10e1\u10d9\u10d4\u10d5\u10d8","\u10e8\u10d0\u10d1\u10d0\u10d7\u10d8"],daysShort:["\u10d9\u10d5\u10d8","\u10dd\u10e0\u10e8","\u10e1\u10d0\u10db","\u10dd\u10d7\u10ee","\u10ee\u10e3\u10d7","\u10de\u10d0\u10e0","\u10e8\u10d0\u10d1"],daysMin:["\u10d9\u10d5","\u10dd\u10e0","\u10e1\u10d0","\u10dd\u10d7","\u10ee\u10e3","\u10de\u10d0","\u10e8\u10d0"],months:["\u10d8\u10d0\u10dc\u10d5\u10d0\u10e0\u10d8","\u10d7\u10d4\u10d1\u10d4\u10e0\u10d5\u10d0\u10da\u10d8","\u10db\u10d0\u10e0\u10e2\u10d8","\u10d0\u10de\u10e0\u10d8\u10da\u10d8","\u10db\u10d0\u10d8\u10e1\u10d8","\u10d8\u10d5\u10dc\u10d8\u10e1\u10d8","\u10d8\u10d5\u10da\u10d8\u10e1\u10d8","\u10d0\u10d2\u10d5\u10d8\u10e1\u10e2\u10dd","\u10e1\u10d4\u10e5\u10e2\u10d4\u10db\u10d1\u10d4\u10e0\u10d8","\u10dd\u10e5\u10e2\u10dd\u10db\u10d1\u10d4\u10e0\u10d8","\u10dc\u10dd\u10d4\u10db\u10d1\u10d4\u10e0\u10d8","\u10d3\u10d4\u10d9\u10d4\u10db\u10d1\u10d4\u10e0\u10d8"],monthsShort:["\u10d8\u10d0\u10dc","\u10d7\u10d4\u10d1","\u10db\u10d0\u10e0","\u10d0\u10de\u10e0","\u10db\u10d0\u10d8","\u10d8\u10d5\u10dc","\u10d8\u10d5\u10da","\u10d0\u10d2\u10d5","\u10e1\u10d4\u10e5","\u10dd\u10e5\u10e2","\u10dc\u10dd\u10d4","\u10d3\u10d4\u10d9"],today:"\u10d3\u10e6\u10d4\u10e1",clear:"\u10d2\u10d0\u10e1\u10e3\u10e4\u10d7\u10d0\u10d5\u10d4\u10d1\u10d0",weekStart:1,format:"dd.mm.yyyy"},function(e){e.fn.datepicker.dates.kh={days:["\u17a2\u17b6\u1791\u17b7\u178f\u17d2\u1799","\u1785\u1793\u17d2\u1791","\u17a2\u1784\u17d2\u1782\u17b6\u179a","\u1796\u17bb\u1792","\u1796\u17d2\u179a\u17a0\u179f\u17d2\u1794\u178f\u17b7\u17cd","\u179f\u17bb\u1780\u17d2\u179a","\u179f\u17c5\u179a\u17cd"],daysShort:["\u17a2\u17b6.\u1791\u17b7","\u1785\u1793\u17d2\u1791","\u17a2\u1784\u17d2\u1782\u17b6\u179a","\u1796\u17bb\u1792","\u1796\u17d2\u179a.\u17a0","\u179f\u17bb\u1780\u17d2\u179a","\u179f\u17c5\u179a\u17cd"],daysMin:["\u17a2\u17b6.\u1791\u17b7","\u1785\u1793\u17d2\u1791","\u17a2\u1784\u17d2\u1782\u17b6\u179a","\u1796\u17bb\u1792","\u1796\u17d2\u179a.\u17a0","\u179f\u17bb\u1780\u17d2\u179a","\u179f\u17c5\u179a\u17cd"],months:["\u1798\u1780\u179a\u17b6","\u1780\u17bb\u1798\u17d2\u1797\u17c7","\u1798\u17b7\u1793\u17b6","\u1798\u17c1\u179f\u17b6","\u17a7\u179f\u1797\u17b6","\u1798\u17b7\u1790\u17bb\u1793\u17b6","\u1780\u1780\u17d2\u1780\u178a\u17b6","\u179f\u17b8\u17a0\u17b6","\u1780\u1789\u17d2\u1789\u17b6","\u178f\u17bb\u179b\u17b6","\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6","\u1792\u17d2\u1793\u17bc"],monthsShort:["\u1798\u1780\u179a\u17b6","\u1780\u17bb\u1798\u17d2\u1797\u17c7","\u1798\u17b7\u1793\u17b6","\u1798\u17c1\u179f\u17b6","\u17a7\u179f\u1797\u17b6","\u1798\u17b7\u1790\u17bb\u1793\u17b6","\u1780\u1780\u17d2\u1780\u178a\u17b6","\u179f\u17b8\u17a0\u17b6","\u1780\u1789\u17d2\u1789\u17b6","\u178f\u17bb\u179b\u17b6","\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6","\u1792\u17d2\u1793\u17bc"],today:"\u1790\u17d2\u1784\u17c3\u1793\u17c1\u17c7",clear:"\u179f\u17c6\u17a2\u17b6\u178f"},e.fn.datepicker.deprecated('The language code "kh" is deprecated and will be removed in 2.0. For Khmer support use "km" instead.')}(jQuery),jQuery.fn.datepicker.dates.kk={days:["\u0416\u0435\u043a\u0441\u0435\u043d\u0431\u0456","\u0414\u04af\u0439\u0441\u0435\u043d\u0431\u0456","\u0421\u0435\u0439\u0441\u0435\u043d\u0431\u0456","\u0421\u04d9\u0440\u0441\u0435\u043d\u0431\u0456","\u0411\u0435\u0439\u0441\u0435\u043d\u0431\u0456","\u0416\u04b1\u043c\u0430","\u0421\u0435\u043d\u0431\u0456"],daysShort:["\u0416\u0435\u043a","\u0414\u04af\u0439","\u0421\u0435\u0439","\u0421\u04d9\u0440","\u0411\u0435\u0439","\u0416\u04b1\u043c","\u0421\u0435\u043d"],daysMin:["\u0416\u043a","\u0414\u0441","\u0421\u0441","\u0421\u0440","\u0411\u0441","\u0416\u043c","\u0421\u043d"],months:["\u049a\u0430\u04a3\u0442\u0430\u0440","\u0410\u049b\u043f\u0430\u043d","\u041d\u0430\u0443\u0440\u044b\u0437","\u0421\u04d9\u0443\u0456\u0440","\u041c\u0430\u043c\u044b\u0440","\u041c\u0430\u0443\u0441\u044b\u043c","\u0428\u0456\u043b\u0434\u0435","\u0422\u0430\u043c\u044b\u0437","\u049a\u044b\u0440\u043a\u04af\u0439\u0435\u043a","\u049a\u0430\u0437\u0430\u043d","\u049a\u0430\u0440\u0430\u0448\u0430","\u0416\u0435\u043b\u0442\u043e\u049b\u0441\u0430\u043d"],monthsShort:["\u049a\u0430\u04a3","\u0410\u049b\u043f","\u041d\u0430\u0443","\u0421\u04d9\u0443","\u041c\u0430\u043c","\u041c\u0430\u0443","\u0428\u0456\u043b","\u0422\u0430\u043c","\u049a\u044b\u0440","\u049a\u0430\u0437","\u049a\u0430\u0440","\u0416\u0435\u043b"],today:"\u0411\u04af\u0433\u0456\u043d",weekStart:1},jQuery.fn.datepicker.dates.km={days:["\u17a2\u17b6\u1791\u17b7\u178f\u17d2\u1799","\u1785\u1793\u17d2\u1791","\u17a2\u1784\u17d2\u1782\u17b6\u179a","\u1796\u17bb\u1792","\u1796\u17d2\u179a\u17a0\u179f\u17d2\u1794\u178f\u17b7\u17cd","\u179f\u17bb\u1780\u17d2\u179a","\u179f\u17c5\u179a\u17cd"],daysShort:["\u17a2\u17b6.\u1791\u17b7","\u1785\u1793\u17d2\u1791","\u17a2\u1784\u17d2\u1782\u17b6\u179a","\u1796\u17bb\u1792","\u1796\u17d2\u179a.\u17a0","\u179f\u17bb\u1780\u17d2\u179a","\u179f\u17c5\u179a\u17cd"],daysMin:["\u17a2\u17b6.\u1791\u17b7","\u1785\u1793\u17d2\u1791","\u17a2\u1784\u17d2\u1782\u17b6\u179a","\u1796\u17bb\u1792","\u1796\u17d2\u179a.\u17a0","\u179f\u17bb\u1780\u17d2\u179a","\u179f\u17c5\u179a\u17cd"],months:["\u1798\u1780\u179a\u17b6","\u1780\u17bb\u1798\u17d2\u1797\u17c7","\u1798\u17b7\u1793\u17b6","\u1798\u17c1\u179f\u17b6","\u17a7\u179f\u1797\u17b6","\u1798\u17b7\u1790\u17bb\u1793\u17b6","\u1780\u1780\u17d2\u1780\u178a\u17b6","\u179f\u17b8\u17a0\u17b6","\u1780\u1789\u17d2\u1789\u17b6","\u178f\u17bb\u179b\u17b6","\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6","\u1792\u17d2\u1793\u17bc"],monthsShort:["\u1798\u1780\u179a\u17b6","\u1780\u17bb\u1798\u17d2\u1797\u17c7","\u1798\u17b7\u1793\u17b6","\u1798\u17c1\u179f\u17b6","\u17a7\u179f\u1797\u17b6","\u1798\u17b7\u1790\u17bb\u1793\u17b6","\u1780\u1780\u17d2\u1780\u178a\u17b6","\u179f\u17b8\u17a0\u17b6","\u1780\u1789\u17d2\u1789\u17b6","\u178f\u17bb\u179b\u17b6","\u179c\u17b7\u1785\u17d2\u1786\u17b7\u1780\u17b6","\u1792\u17d2\u1793\u17bc"],today:"\u1790\u17d2\u1784\u17c3\u1793\u17c1\u17c7",clear:"\u179f\u17c6\u17a2\u17b6\u178f"},jQuery.fn.datepicker.dates.ko={days:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],daysShort:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],daysMin:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],months:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],monthsShort:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],today:"\uc624\ub298",clear:"\uc0ad\uc81c",format:"yyyy-mm-dd",titleFormat:"yyyy\ub144mm\uc6d4",weekStart:0},function(e){e.fn.datepicker.dates.kr={days:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],daysShort:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],daysMin:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],months:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],monthsShort:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"]},e.fn.datepicker.deprecated('The language code "kr" is deprecated and will be removed in 2.0. For korean support use "ko" instead.')}(jQuery),jQuery.fn.datepicker.dates.lt={days:["Sekmadienis","Pirmadienis","Antradienis","Tre\u010diadienis","Ketvirtadienis","Penktadienis","\u0160e\u0161tadienis"],daysShort:["S","Pr","A","T","K","Pn","\u0160"],daysMin:["Sk","Pr","An","Tr","Ke","Pn","\u0160t"],months:["Sausis","Vasaris","Kovas","Balandis","Gegu\u017e\u0117","Bir\u017eelis","Liepa","Rugpj\u016btis","Rugs\u0117jis","Spalis","Lapkritis","Gruodis"],monthsShort:["Sau","Vas","Kov","Bal","Geg","Bir","Lie","Rugp","Rugs","Spa","Lap","Gru"],today:"\u0160iandien",monthsTitle:"M\u0117nesiai",clear:"I\u0161valyti",weekStart:1,format:"yyyy-mm-dd"},jQuery.fn.datepicker.dates.lv={days:["Sv\u0113tdiena","Pirmdiena","Otrdiena","Tre\u0161diena","Ceturtdiena","Piektdiena","Sestdiena"],daysShort:["Sv","P","O","T","C","Pk","S"],daysMin:["Sv","Pr","Ot","Tr","Ce","Pk","Se"],months:["Janv\u0101ris","Febru\u0101ris","Marts","Apr\u012blis","Maijs","J\u016bnijs","J\u016blijs","Augusts","Septembris","Oktobris","Novembris","Decembris"],monthsShort:["Jan","Feb","Mar","Apr","Mai","J\u016bn","J\u016bl","Aug","Sep","Okt","Nov","Dec"],monthsTitle:"M\u0113ne\u0161i",today:"\u0160odien",clear:"Nodz\u0113st",weekStart:1},jQuery.fn.datepicker.dates.me={days:["Nedjelja","Ponedjeljak","Utorak","Srijeda","\u010cetvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sri","\u010cet","Pet","Sub"],daysMin:["Ne","Po","Ut","Sr","\u010ce","Pe","Su"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,clear:"Izbri\u0161i",format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.mk={days:["\u041d\u0435\u0434\u0435\u043b\u0430","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0440\u0442\u043e\u043a","\u041f\u0435\u0442\u043e\u043a","\u0421\u0430\u0431\u043e\u0442\u0430"],daysShort:["\u041d\u0435\u0434","\u041f\u043e\u043d","\u0412\u0442\u043e","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u0430\u0431"],daysMin:["\u041d\u0435","\u041f\u043e","\u0412\u0442","\u0421\u0440","\u0427\u0435","\u041f\u0435","\u0421\u0430"],months:["\u0408\u0430\u043d\u0443\u0430\u0440\u0438","\u0424\u0435\u0432\u0440\u0443\u0430\u0440\u0438","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0458","\u0408\u0443\u043d\u0438","\u0408\u0443\u043b\u0438","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0432\u0440\u0438","\u041e\u043a\u0442\u043e\u043c\u0432\u0440\u0438","\u041d\u043e\u0435\u043c\u0432\u0440\u0438","\u0414\u0435\u043a\u0435\u043c\u0432\u0440\u0438"],monthsShort:["\u0408\u0430\u043d","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0435","\u0414\u0435\u043a"],today:"\u0414\u0435\u043d\u0435\u0441",format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.mn={days:["\u041d\u044f\u043c","\u0414\u0430\u0432\u0430\u0430","\u041c\u044f\u0433\u043c\u0430\u0440","\u041b\u0445\u0430\u0433\u0432\u0430","\u041f\u04af\u0440\u044d\u0432","\u0411\u0430\u0430\u0441\u0430\u043d","\u0411\u044f\u043c\u0431\u0430"],daysShort:["\u041d\u044f\u043c","\u0414\u0430\u0432","\u041c\u044f\u0433","\u041b\u0445\u0430","\u041f\u04af\u0440","\u0411\u0430\u0430","\u0411\u044f\u043c"],daysMin:["\u041d\u044f","\u0414\u0430","\u041c\u044f","\u041b\u0445","\u041f\u04af","\u0411\u0430","\u0411\u044f"],months:["\u0425\u0443\u043b\u0433\u0430\u043d\u0430","\u04ae\u0445\u044d\u0440","\u0411\u0430\u0440","\u0422\u0443\u0443\u043b\u0430\u0439","\u041b\u0443\u0443","\u041c\u043e\u0433\u043e\u0439","\u041c\u043e\u0440\u044c","\u0425\u043e\u043d\u044c","\u0411\u0438\u0447","\u0422\u0430\u0445\u0438\u0430","\u041d\u043e\u0445\u043e\u0439","\u0413\u0430\u0445\u0430\u0439"],monthsShort:["\u0425\u0443\u043b","\u04ae\u0445\u044d","\u0411\u0430\u0440","\u0422\u0443\u0443","\u041b\u0443\u0443","\u041c\u043e\u0433","\u041c\u043e\u0440","\u0425\u043e\u043d","\u0411\u0438\u0447","\u0422\u0430\u0445","\u041d\u043e\u0445","\u0413\u0430\u0445"],today:"\u04e8\u043d\u04e9\u04e9\u0434\u04e9\u0440",clear:"\u0422\u043e\u0434\u043e\u0440\u0445\u043e\u0439",format:"yyyy.mm.dd",weekStart:1},jQuery.fn.datepicker.dates.mar={days:["\u0930\u0935\u093f\u0935\u093e\u0930","\u0938\u094b\u092e\u0935\u093e\u0930","\u092e\u0902\u0917\u0933\u0935\u093e\u0930","\u092c\u0941\u0927\u0935\u093e\u0930","\u0917\u0941\u0930\u0941\u0935\u093e\u0930","\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930","\u0936\u0928\u093f\u0935\u093e\u0930"],daysShort:["\u0930\u0935\u093f","\u0938\u094b\u092e","\u092e\u0902\u0917\u0933","\u092c\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094d\u0930","\u0936\u0928\u093f"],daysMin:["\u0930","\u0938\u094b","\u092e\u0902","\u092c\u0941","\u0917\u0941","\u0936\u0941","\u0936"],months:["\u091c\u093e\u0928\u0947\u0935\u093e\u0930\u0940","\u092b\u0947\u092c\u094d\u0930\u0941\u0935\u093e\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u090f\u092a\u094d\u0930\u093f\u0932","\u092e\u0947","\u091c\u0942\u0928","\u091c\u0941\u0932\u0948","\u0911\u0917\u0938\u094d\u091f","\u0938\u092a\u094d\u091f\u0947\u0902\u092c\u0930","\u0911\u0915\u094d\u091f\u094b\u092c\u0930","\u0928\u094b\u0935\u094d\u0939\u0947\u0902\u092c\u0930","\u0921\u093f\u0938\u0947\u0902\u092c\u0930"],monthsShort:["\u091c\u093e\u0928\u0947.","\u092b\u0947\u092c\u094d\u0930\u0941.","\u092e\u093e\u0930\u094d\u091a","\u090f\u092a\u094d\u0930\u093f\u0932","\u092e\u0947","\u091c\u0942\u0928","\u091c\u0941\u0932\u0948","\u0911\u0917\u0938\u094d\u091f","\u0938\u092a\u094d\u091f\u0947\u0902.","\u0911\u0915\u094d\u091f\u094b.","\u0928\u094b\u0935\u094d\u0939\u0947\u0902.","\u0921\u093f\u0938\u0947\u0902."],today:"\u0906\u091c",monthsTitle:"\u092e\u0939\u0940\u0928\u0947",clear:"\u0939\u091f\u0935\u093e",weekStart:1,format:"dd / mm / yyyy"},jQuery.fn.datepicker.dates.ms={days:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],daysShort:["Aha","Isn","Sel","Rab","Kha","Jum","Sab"],daysMin:["Ah","Is","Se","Ra","Kh","Ju","Sa"],months:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],monthsShort:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],today:"Hari Ini",clear:"Bersihkan"},jQuery.fn.datepicker.dates["nl-BE"]={days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],daysShort:["zo","ma","di","wo","do","vr","za"],daysMin:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthsShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],today:"Vandaag",monthsTitle:"Maanden",clear:"Leegmaken",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.nl={days:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],daysShort:["zo","ma","di","wo","do","vr","za"],daysMin:["zo","ma","di","wo","do","vr","za"],months:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],monthsShort:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],today:"Vandaag",monthsTitle:"Maanden",clear:"Wissen",weekStart:1,format:"dd-mm-yyyy"},jQuery.fn.datepicker.dates.no={days:["s\xf8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\xf8rdag"],daysShort:["s\xf8n","man","tir","ons","tor","fre","l\xf8r"],daysMin:["s\xf8","ma","ti","on","to","fr","l\xf8"],months:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],monthsShort:["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des"],today:"i dag",monthsTitle:"M\xe5neder",clear:"Nullstill",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.oc={days:["Dimenge","Diluns","Dimars","Dim\xe8cres","Dij\xf2us","Divendres","Dissabte"],daysShort:["Dim","Dil","Dmr","Dmc","Dij","Div","Dis"],daysMin:["dg","dl","dr","dc","dj","dv","ds"],months:["Geni\xe8r","Febri\xe8r","Mar\xe7","Abrial","Mai","Junh","Julhet","Agost","Setembre","Octobre","Novembre","Decembre"],monthsShort:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Dec"],today:"U\xe8i",monthsTitle:"Meses",clear:"Escafar",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.pl={days:["Niedziela","Poniedzia\u0142ek","Wtorek","\u015aroda","Czwartek","Pi\u0105tek","Sobota"],daysShort:["Niedz.","Pon.","Wt.","\u015ar.","Czw.","Pi\u0105t.","Sob."],daysMin:["Ndz.","Pn.","Wt.","\u015ar.","Czw.","Pt.","Sob."],months:["Stycze\u0144","Luty","Marzec","Kwiecie\u0144","Maj","Czerwiec","Lipiec","Sierpie\u0144","Wrzesie\u0144","Pa\u017adziernik","Listopad","Grudzie\u0144"],monthsShort:["Sty.","Lut.","Mar.","Kwi.","Maj","Cze.","Lip.","Sie.","Wrz.","Pa\u017a.","Lis.","Gru."],today:"Dzisiaj",weekStart:1,clear:"Wyczy\u015b\u0107",format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates["pt-BR"]={days:["Domingo","Segunda","Ter\xe7a","Quarta","Quinta","Sexta","S\xe1bado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","S\xe1b"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Mar\xe7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.pt={days:["Domingo","Segunda","Ter\xe7a","Quarta","Quinta","Sexta","S\xe1bado"],daysShort:["Dom","Seg","Ter","Qua","Qui","Sex","S\xe1b"],daysMin:["Do","Se","Te","Qu","Qu","Se","Sa"],months:["Janeiro","Fevereiro","Mar\xe7o","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"],today:"Hoje",monthsTitle:"Meses",clear:"Limpar",format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.ro={days:["Duminic\u0103","Luni","Mar\u0163i","Miercuri","Joi","Vineri","S\xe2mb\u0103t\u0103"],daysShort:["Dum","Lun","Mar","Mie","Joi","Vin","S\xe2m"],daysMin:["Du","Lu","Ma","Mi","Jo","Vi","S\xe2"],months:["Ianuarie","Februarie","Martie","Aprilie","Mai","Iunie","Iulie","August","Septembrie","Octombrie","Noiembrie","Decembrie"],monthsShort:["Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Nov","Dec"],today:"Ast\u0103zi",clear:"\u0218terge",weekStart:1,format:"dd/mm/yyyy"},function(e){e.fn.datepicker.dates["rs-latin"]={days:["Nedelja","Ponedeljak","Utorak","Sreda","\u010cetvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sre","\u010cet","Pet","Sub"],daysMin:["N","Po","U","Sr","\u010c","Pe","Su"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,format:"dd.mm.yyyy"},e.fn.datepicker.deprecated('This language code "rs-latin" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian latin support use "sr-latin" instead.')}(jQuery),function(e){e.fn.datepicker.dates.rs={days:["\u041d\u0435\u0434\u0435\u0459\u0430","\u041f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a","\u0423\u0442\u043e\u0440\u0430\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0440\u0442\u0430\u043a","\u041f\u0435\u0442\u0430\u043a","\u0421\u0443\u0431\u043e\u0442\u0430"],daysShort:["\u041d\u0435\u0434","\u041f\u043e\u043d","\u0423\u0442\u043e","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u0443\u0431"],daysMin:["\u041d","\u041f\u043e","\u0423","\u0421\u0440","\u0427","\u041f\u0435","\u0421\u0443"],months:["\u0408\u0430\u043d\u0443\u0430\u0440","\u0424\u0435\u0431\u0440\u0443\u0430\u0440","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440","\u041e\u043a\u0442\u043e\u0431\u0430\u0440","\u041d\u043e\u0432\u0435\u043c\u0431\u0430\u0440","\u0414\u0435\u0446\u0435\u043c\u0431\u0430\u0440"],monthsShort:["\u0408\u0430\u043d","\u0424\u0435\u0431","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0432","\u0414\u0435\u0446"],today:"\u0414\u0430\u043d\u0430\u0441",weekStart:1,format:"dd.mm.yyyy"},e.fn.datepicker.deprecated('This language code "rs" is deprecated (invalid serbian language code) and will be removed in 2.0. For Serbian support use "sr" instead.')}(jQuery),jQuery.fn.datepicker.dates.ru={days:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],daysShort:["\u0412\u0441\u043a","\u041f\u043d\u0434","\u0412\u0442\u0440","\u0421\u0440\u0434","\u0427\u0442\u0432","\u041f\u0442\u043d","\u0421\u0443\u0431"],daysMin:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],months:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c"],monthsShort:["\u042f\u043d\u0432","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0439","\u0418\u044e\u043d","\u0418\u044e\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a"],today:"\u0421\u0435\u0433\u043e\u0434\u043d\u044f",clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"\u041c\u0435\u0441\u044f\u0446\u044b"},jQuery.fn.datepicker.dates.si={days:["\u0d89\u0dbb\u0dd2\u0daf\u0dcf","\u0dc3\u0db3\u0dd4\u0daf\u0dcf","\u0d85\u0d9f\u0dc4\u0dbb\u0dd4\u0dc0\u0dcf\u0daf\u0dcf","\u0db6\u0daf\u0dcf\u0daf\u0dcf","\u0db6\u0dca\u200d\u0dbb\u0dc4\u0dc3\u0dca\u0db4\u0dad\u0dd2\u0db1\u0dca\u0daf\u0dcf","\u0dc3\u0dd2\u0d9a\u0dd4\u0dbb\u0dcf\u0daf\u0dcf","\u0dc3\u0dd9\u0db1\u0dc3\u0dd4\u0dbb\u0dcf\u0daf\u0dcf"],daysShort:["\u0d89\u0dbb\u0dd2","\u0dc3\u0db3\u0dd4","\u0d85\u0d9f","\u0db6\u0daf\u0dcf","\u0db6\u0dca\u200d\u0dbb\u0dc4","\u0dc3\u0dd2\u0d9a\u0dd4","\u0dc3\u0dd9\u0db1"],daysMin:["\u0d89","\u0dc3","\u0d85","\u0db6","\u0db6\u0dca\u200d\u0dbb","\u0dc3\u0dd2","\u0dc3\u0dd9"],months:["\u0da2\u0db1\u0dc0\u0dcf\u0dbb\u0dd2","\u0db4\u0dd9\u0db6\u0dbb\u0dc0\u0dcf\u0dbb\u0dd2","\u0db8\u0dcf\u0dbb\u0dca\u0dad\u0dd4","\u0d85\u0db4\u0dca\u200d\u0dbb\u0dda\u0dbd\u0dca","\u0db8\u0dd0\u0dba\u0dd2","\u0da2\u0dd4\u0db1\u0dd2","\u0da2\u0dd6\u0dbd\u0dd2","\u0d85\u0d9c\u0ddd\u0dc3\u0dca\u0dad\u0dd4",
"\u0dc3\u0dd0\u0db4\u0dca\u0dad\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca","\u0d94\u0d9a\u0dca\u0dad\u0ddd\u0db6\u0dbb\u0dca","\u0db1\u0ddc\u0dc0\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca","\u0daf\u0dd9\u0dc3\u0dd0\u0db8\u0dca\u0db6\u0dbb\u0dca"],monthsShort:["\u0da2\u0db1","\u0db4\u0dd9\u0db6","\u0db8\u0dcf\u0dbb\u0dca","\u0d85\u0db4\u0dca\u200d\u0dbb\u0dda","\u0db8\u0dd0\u0dba\u0dd2","\u0da2\u0dd4\u0db1\u0dd2","\u0da2\u0dd6\u0dbd\u0dd2","\u0d85\u0d9c\u0ddd","\u0dc3\u0dd0\u0db4\u0dca","\u0d94\u0d9a\u0dca","\u0db1\u0ddc\u0dc0\u0dd0","\u0daf\u0dd9\u0dc3\u0dd0"],today:"\u0d85\u0daf",monthsTitle:"\u0db8\u0dcf\u0dc3",clear:"\u0db8\u0d9a\u0db1\u0dca\u0db1",weekStart:0,format:"yyyy-mm-dd"},jQuery.fn.datepicker.dates.sk={days:["Nede\u013ea","Pondelok","Utorok","Streda","\u0160tvrtok","Piatok","Sobota"],daysShort:["Ned","Pon","Uto","Str","\u0160tv","Pia","Sob"],daysMin:["Ne","Po","Ut","St","\u0160t","Pia","So"],months:["Janu\xe1r","Febru\xe1r","Marec","Apr\xedl","M\xe1j","J\xfan","J\xfal","August","September","Okt\xf3ber","November","December"],monthsShort:["Jan","Feb","Mar","Apr","M\xe1j","J\xfan","J\xfal","Aug","Sep","Okt","Nov","Dec"],today:"Dnes",clear:"Vymaza\u0165",weekStart:1,format:"d.m.yyyy"},jQuery.fn.datepicker.dates.sl={days:["Nedelja","Ponedeljek","Torek","Sreda","\u010cetrtek","Petek","Sobota"],daysShort:["Ned","Pon","Tor","Sre","\u010cet","Pet","Sob"],daysMin:["Ne","Po","To","Sr","\u010ce","Pe","So"],months:["Januar","Februar","Marec","April","Maj","Junij","Julij","Avgust","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danes",weekStart:1},jQuery.fn.datepicker.dates.sq={days:["E Diel","E H\xebn\xeb","E Mart\u0113","E M\xebrkur\xeb","E Enjte","E Premte","E Shtun\xeb"],daysShort:["Die","H\xebn","Mar","M\xebr","Enj","Pre","Shtu"],daysMin:["Di","H\xeb","Ma","M\xeb","En","Pr","Sht"],months:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","N\xebntor","Dhjetor"],monthsShort:["Jan","Shk","Mar","Pri","Maj","Qer","Korr","Gu","Sht","Tet","N\xebn","Dhjet"],monthsTitle:"Muaj",today:"Sot",weekStart:1,format:"dd/mm/yyyy",clear:"Pastro"},jQuery.fn.datepicker.dates["sr-latin"]={days:["Nedelja","Ponedeljak","Utorak","Sreda","\u010cetvrtak","Petak","Subota"],daysShort:["Ned","Pon","Uto","Sre","\u010cet","Pet","Sub"],daysMin:["N","Po","U","Sr","\u010c","Pe","Su"],months:["Januar","Februar","Mart","April","Maj","Jun","Jul","Avgust","Septembar","Oktobar","Novembar","Decembar"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Avg","Sep","Okt","Nov","Dec"],today:"Danas",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.sr={days:["\u041d\u0435\u0434\u0435\u0459\u0430","\u041f\u043e\u043d\u0435\u0434\u0435\u0459\u0430\u043a","\u0423\u0442\u043e\u0440\u0430\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0440\u0442\u0430\u043a","\u041f\u0435\u0442\u0430\u043a","\u0421\u0443\u0431\u043e\u0442\u0430"],daysShort:["\u041d\u0435\u0434","\u041f\u043e\u043d","\u0423\u0442\u043e","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041f\u0435\u0442","\u0421\u0443\u0431"],daysMin:["\u041d","\u041f\u043e","\u0423","\u0421\u0440","\u0427","\u041f\u0435","\u0421\u0443"],months:["\u0408\u0430\u043d\u0443\u0430\u0440","\u0424\u0435\u0431\u0440\u0443\u0430\u0440","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0438\u043b","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043f\u0442\u0435\u043c\u0431\u0430\u0440","\u041e\u043a\u0442\u043e\u0431\u0430\u0440","\u041d\u043e\u0432\u0435\u043c\u0431\u0430\u0440","\u0414\u0435\u0446\u0435\u043c\u0431\u0430\u0440"],monthsShort:["\u0408\u0430\u043d","\u0424\u0435\u0431","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0458","\u0408\u0443\u043d","\u0408\u0443\u043b","\u0410\u0432\u0433","\u0421\u0435\u043f","\u041e\u043a\u0442","\u041d\u043e\u0432","\u0414\u0435\u0446"],today:"\u0414\u0430\u043d\u0430\u0441",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.sv={days:["s\xf6ndag","m\xe5ndag","tisdag","onsdag","torsdag","fredag","l\xf6rdag"],daysShort:["s\xf6n","m\xe5n","tis","ons","tor","fre","l\xf6r"],daysMin:["s\xf6","m\xe5","ti","on","to","fr","l\xf6"],months:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],monthsShort:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],today:"Idag",format:"yyyy-mm-dd",weekStart:1,clear:"Rensa"},jQuery.fn.datepicker.dates.sw={days:["Jumapili","Jumatatu","Jumanne","Jumatano","Alhamisi","Ijumaa","Jumamosi"],daysShort:["J2","J3","J4","J5","Alh","Ij","J1"],daysMin:["2","3","4","5","A","I","1"],months:["Januari","Februari","Machi","Aprili","Mei","Juni","Julai","Agosti","Septemba","Oktoba","Novemba","Desemba"],monthsShort:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ago","Sep","Okt","Nov","Des"],today:"Leo"},jQuery.fn.datepicker.dates.ta={days:["\u0b9e\u0bbe\u0baf\u0bbf\u0bb1\u0bc1","\u0ba4\u0bbf\u0b99\u0bcd\u0b95\u0bb3\u0bcd","\u0b9a\u0bc6\u0bb5\u0bcd\u0bb5\u0bbe\u0baf\u0bcd","\u0baa\u0bc1\u0ba4\u0ba9\u0bcd","\u0bb5\u0bbf\u0baf\u0bbe\u0bb4\u0ba9\u0bcd","\u0bb5\u0bc6\u0bb3\u0bcd\u0bb3\u0bbf","\u0b9a\u0ba9\u0bbf"],daysShort:["\u0b9e\u0bbe\u0baf\u0bbf","\u0ba4\u0bbf\u0b99\u0bcd","\u0b9a\u0bc6\u0bb5\u0bcd","\u0baa\u0bc1\u0ba4","\u0bb5\u0bbf\u0baf\u0bbe","\u0bb5\u0bc6\u0bb3\u0bcd","\u0b9a\u0ba9\u0bbf"],daysMin:["\u0b9e\u0bbe","\u0ba4\u0bbf","\u0b9a\u0bc6","\u0baa\u0bc1","\u0bb5\u0bbf","\u0bb5\u0bc6","\u0b9a"],months:["\u0b9c\u0ba9\u0bb5\u0bb0\u0bbf","\u0baa\u0bbf\u0baa\u0bcd\u0bb0\u0bb5\u0bb0\u0bbf","\u0bae\u0bbe\u0bb0\u0bcd\u0b9a\u0bcd","\u0b8f\u0baa\u0bcd\u0bb0\u0bb2\u0bcd","\u0bae\u0bc7","\u0b9c\u0bc2\u0ba9\u0bcd","\u0b9c\u0bc2\u0bb2\u0bc8","\u0b86\u0b95\u0bb8\u0bcd\u0b9f\u0bc1","\u0b9a\u0bc6\u0baa\u0bcd\u0b9f\u0bae\u0bcd\u0baa\u0bb0\u0bcd","\u0b85\u0b95\u0bcd\u0b9f\u0bcb\u0baa\u0bb0\u0bcd","\u0ba8\u0bb5\u0bae\u0bcd\u0baa\u0bb0\u0bcd","\u0b9f\u0bbf\u0b9a\u0bae\u0bcd\u0baa\u0bb0\u0bcd"],monthsShort:["\u0b9c\u0ba9","\u0baa\u0bbf\u0baa\u0bcd","\u0bae\u0bbe\u0bb0\u0bcd","\u0b8f\u0baa\u0bcd","\u0bae\u0bc7","\u0b9c\u0bc2\u0ba9\u0bcd","\u0b9c\u0bc2\u0bb2\u0bc8","\u0b86\u0b95","\u0b9a\u0bc6\u0baa\u0bcd","\u0b85\u0b95\u0bcd","\u0ba8\u0bb5","\u0b9f\u0bbf\u0b9a"],today:"\u0b87\u0ba9\u0bcd\u0bb1\u0bc1",monthsTitle:"\u0bae\u0bbe\u0ba4\u0b99\u0bcd\u0b95\u0bb3\u0bcd",clear:"\u0ba8\u0bc0\u0b95\u0bcd\u0b95\u0bc1",weekStart:1,format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates.tg={days:["\u042f\u043a\u0448\u0430\u043d\u0431\u0435","\u0414\u0443\u0448\u0430\u043d\u0431\u0435","\u0421\u0435\u0448\u0430\u043d\u0431\u0435","\u0427\u043e\u0440\u0448\u0430\u043d\u0431\u0435","\u041f\u0430\u043d\u04b7\u0448\u0430\u043d\u0431\u0435","\u04b6\u0443\u043c\u044a\u0430","\u0428\u0430\u043d\u0431\u0435"],daysShort:["\u042f\u0448\u0431","\u0414\u0448\u0431","\u0421\u0448\u0431","\u0427\u0448\u0431","\u041f\u0448\u0431","\u04b6\u0443\u043c","\u0428\u043d\u0431"],daysMin:["\u042f\u0448","\u0414\u0448","\u0421\u0448","\u0427\u0448","\u041f\u0448","\u04b6\u043c","\u0428\u0431"],months:["\u042f\u043d\u0432\u0430\u0440","\u0424\u0435\u0432\u0440\u0430\u043b","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b","\u041c\u0430\u0439","\u0418\u044e\u043d","\u0418\u044e\u043b","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440","\u041e\u043a\u0442\u044f\u0431\u0440","\u041d\u043e\u044f\u0431\u0440","\u0414\u0435\u043a\u0430\u0431\u0440"],monthsShort:["\u042f\u043d\u0432","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0439","\u0418\u044e\u043d","\u0418\u044e\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a"],today:"\u0418\u043c\u0440\u04ef\u0437",monthsTitle:"\u041c\u043e\u04b3\u04b3\u043e",clear:"\u0422\u043e\u0437\u0430 \u043d\u0430\u043c\u0443\u0434\u0430\u043d",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.th={days:["\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c","\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c","\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23","\u0e1e\u0e38\u0e18","\u0e1e\u0e24\u0e2b\u0e31\u0e2a","\u0e28\u0e38\u0e01\u0e23\u0e4c","\u0e40\u0e2a\u0e32\u0e23\u0e4c","\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c"],daysShort:["\u0e2d\u0e32","\u0e08","\u0e2d","\u0e1e","\u0e1e\u0e24","\u0e28","\u0e2a","\u0e2d\u0e32"],daysMin:["\u0e2d\u0e32","\u0e08","\u0e2d","\u0e1e","\u0e1e\u0e24","\u0e28","\u0e2a","\u0e2d\u0e32"],months:["\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21","\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c","\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21","\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19","\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21","\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19","\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21","\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21","\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19","\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21","\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19","\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"],monthsShort:["\u0e21.\u0e04.","\u0e01.\u0e1e.","\u0e21\u0e35.\u0e04.","\u0e40\u0e21.\u0e22.","\u0e1e.\u0e04.","\u0e21\u0e34.\u0e22.","\u0e01.\u0e04.","\u0e2a.\u0e04.","\u0e01.\u0e22.","\u0e15.\u0e04.","\u0e1e.\u0e22.","\u0e18.\u0e04."],today:"\u0e27\u0e31\u0e19\u0e19\u0e35\u0e49"},jQuery.fn.datepicker.dates.tk={days:["\xddek\u015fenbe","Du\u015fenbe","Si\u015fenbe","\xc7ar\u015fenbe","Pen\u015fenbe","Anna","\u015eenbe"],daysShort:["\xddek","Du\u015f","Si\u015f","\xc7ar","Pen","Ann","\u015een"],daysMin:["\xdde","Du","Si","\xc7a","Pe","An","\u015ee"],months:["\xddanwar","Fewral","Mart","Aprel","Ma\xfd","I\xfdun","I\xfdul","Awgust","Sent\xfdabr","Okt\xfdabr","No\xfdabr","Dekabr"],monthsShort:["\xddan","Few","Mar","Apr","Ma\xfd","I\xfdn","I\xfdl","Awg","Sen","Okt","No\xfd","Dek"],today:"Bu g\xfcn",monthsTitle:"A\xfdlar",clear:"A\xfdyr",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.tr={days:["Pazar","Pazartesi","Sal\u0131","\xc7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],daysShort:["Pz","Pzt","Sal","\xc7r\u015f","Pr\u015f","Cu","Cts"],daysMin:["Pz","Pzt","Sa","\xc7r","Pr","Cu","Ct"],months:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\xfcl","Ekim","Kas\u0131m","Aral\u0131k"],monthsShort:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara"],today:"Bug\xfcn",clear:"Temizle",weekStart:1,format:"dd.mm.yyyy"},jQuery.fn.datepicker.dates.uk={days:["\u041d\u0435\u0434\u0456\u043b\u044f","\u041f\u043e\u043d\u0435\u0434\u0456\u043b\u043e\u043a","\u0412\u0456\u0432\u0442\u043e\u0440\u043e\u043a","\u0421\u0435\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440","\u041f'\u044f\u0442\u043d\u0438\u0446\u044f","\u0421\u0443\u0431\u043e\u0442\u0430"],daysShort:["\u041d\u0435\u0434","\u041f\u043d\u0434","\u0412\u0442\u0440","\u0421\u0440\u0434","\u0427\u0442\u0432","\u041f\u0442\u043d","\u0421\u0443\u0431"],daysMin:["\u041d\u0434","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],months:["\u0421\u0456\u0447\u0435\u043d\u044c","\u041b\u044e\u0442\u0438\u0439","\u0411\u0435\u0440\u0435\u0437\u0435\u043d\u044c","\u041a\u0432\u0456\u0442\u0435\u043d\u044c","\u0422\u0440\u0430\u0432\u0435\u043d\u044c","\u0427\u0435\u0440\u0432\u0435\u043d\u044c","\u041b\u0438\u043f\u0435\u043d\u044c","\u0421\u0435\u0440\u043f\u0435\u043d\u044c","\u0412\u0435\u0440\u0435\u0441\u0435\u043d\u044c","\u0416\u043e\u0432\u0442\u0435\u043d\u044c","\u041b\u0438\u0441\u0442\u043e\u043f\u0430\u0434","\u0413\u0440\u0443\u0434\u0435\u043d\u044c"],monthsShort:["\u0421\u0456\u0447","\u041b\u044e\u0442","\u0411\u0435\u0440","\u041a\u0432\u0456","\u0422\u0440\u0430","\u0427\u0435\u0440","\u041b\u0438\u043f","\u0421\u0435\u0440","\u0412\u0435\u0440","\u0416\u043e\u0432","\u041b\u0438\u0441","\u0413\u0440\u0443"],today:"\u0421\u044c\u043e\u0433\u043e\u0434\u043d\u0456",clear:"\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u0438",format:"dd.mm.yyyy",weekStart:1},jQuery.fn.datepicker.dates["uz-cyrl"]={days:["\u042f\u043a\u0448\u0430\u043d\u0431\u0430","\u0414\u0443\u0448\u0430\u043d\u0431\u0430","\u0421\u0435\u0448\u0430\u043d\u0431\u0430","\u0427\u043e\u0440\u0448\u0430\u043d\u0431\u0430","\u041f\u0430\u0439\u0448\u0430\u043d\u0431\u0430","\u0416\u0443\u043c\u0430","\u0428\u0430\u043d\u0431\u0430"],daysShort:["\u042f\u043a\u0448","\u0414\u0443","\u0421\u0435","\u0427\u043e\u0440","\u041f\u0430\u0439","\u0416\u0443","\u0428\u0430"],daysMin:["\u042f\u043a","\u0414\u0443","\u0421\u0435","\u0427\u043e","\u041f\u0430","\u0416\u0443","\u0428\u0430"],months:["\u042f\u043d\u0432\u0430\u0440\u044c","\u0424\u0435\u0432\u0440\u0430\u043b\u044c","\u041c\u0430\u0440\u0442","\u0410\u043f\u0440\u0435\u043b\u044c","\u041c\u0430\u0439","\u0418\u044e\u043d\u044c","\u0418\u044e\u043b\u044c","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043d\u0442\u044f\u0431\u0440\u044c","\u041e\u043a\u0442\u044f\u0431\u0440\u044c","\u041d\u043e\u044f\u0431\u0440\u044c","\u0414\u0435\u043a\u0430\u0431\u0440\u044c"],monthsShort:["\u042f\u043d\u0432","\u0424\u0435\u0432","\u041c\u0430\u0440","\u0410\u043f\u0440","\u041c\u0430\u0439","\u0418\u044e\u043d","\u0418\u044e\u043b","\u0410\u0432\u0433","\u0421\u0435\u043d","\u041e\u043a\u0442","\u041d\u043e\u044f","\u0414\u0435\u043a"],today:"\u0411\u0443\u0433\u0443\u043d",clear:"\u040e\u0447\u0438\u0440\u0438\u0448",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"\u041e\u0439\u043b\u0430\u0440"},jQuery.fn.datepicker.dates["uz-latn"]={days:["Yakshanba","Dushanba","Seshanba","Chorshanba","Payshanba","Juma","Shanba"],daysShort:["Yak","Du","Se","Chor","Pay","Ju","Sha"],daysMin:["Ya","Du","Se","Cho","Pa","Ju","Sha"],months:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avgust","Sentabr","Oktabr","Noyabr","Dekabr"],monthsShort:["Yan","Fev","Mar","Apr","May","Iyn","Iyl","Avg","Sen","Okt","Noy","Dek"],today:"Bugun",clear:"O'chirish",format:"dd.mm.yyyy",weekStart:1,monthsTitle:"Oylar"},jQuery.fn.datepicker.dates.vi={days:["Ch\u1ee7 nh\u1eadt","Th\u1ee9 hai","Th\u1ee9 ba","Th\u1ee9 t\u01b0","Th\u1ee9 n\u0103m","Th\u1ee9 s\xe1u","Th\u1ee9 b\u1ea3y"],daysShort:["CN","Th\u1ee9 2","Th\u1ee9 3","Th\u1ee9 4","Th\u1ee9 5","Th\u1ee9 6","Th\u1ee9 7"],daysMin:["CN","T2","T3","T4","T5","T6","T7"],months:["Th\xe1ng 1","Th\xe1ng 2","Th\xe1ng 3","Th\xe1ng 4","Th\xe1ng 5","Th\xe1ng 6","Th\xe1ng 7","Th\xe1ng 8","Th\xe1ng 9","Th\xe1ng 10","Th\xe1ng 11","Th\xe1ng 12"],monthsShort:["Th1","Th2","Th3","Th4","Th5","Th6","Th7","Th8","Th9","Th10","Th11","Th12"],today:"H\xf4m nay",clear:"X\xf3a",format:"dd/mm/yyyy"},jQuery.fn.datepicker.dates["zh-CN"]={days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],daysShort:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],daysMin:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],months:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthsShort:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],today:"\u4eca\u5929",monthsTitle:"\u9009\u62e9\u6708\u4efd",clear:"\u6e05\u9664",format:"yyyy-mm-dd",titleFormat:"yyyy\u5e74mm\u6708",weekStart:1},jQuery.fn.datepicker.dates["zh-TW"]={days:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],daysShort:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],daysMin:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],months:["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"],monthsShort:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],today:"\u4eca\u5929",monthsTitle:"\u6708\u4efd",format:"yyyy/mm/dd",weekStart:0,titleFormat:"yyyy\u5e74mm\u6708",clear:"\u6e05\u9664"},$(function(e){e.fn.datepicker.defaults.language="ja",e.fn.datepicker.defaults.autoclose=!0,e.fn.datepicker.defaults.todayHighlight=!0}),function(f){"use strict";function e(i){return this.each(function(){var e=f(this),t=e.data("bs.tooltip"),n="object"==typeof i&&i;!t&&/destroy|hide/.test(i)||(t||e.data("bs.tooltip",t=new m(this,n)),"string"==typeof i&&t[i]())})}var m=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};m.VERSION="3.3.7",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},m.prototype.init=function(e,t,n){if(this.enabled=!0,this.type=e,this.$element=f(t),this.options=this.getOptions(n),this.$viewport=this.options.viewport&&f(f.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var i=this.options.trigger.split(" "),a=i.length;a--;){var s=i[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,f.proxy(this.toggle,this));else if("manual"!=s){var o="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,f.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,f.proxy(this.leave,this))}}this.options.selector?this._options=f.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(e){return(e=f.extend({},this.getDefaults(),this.$element.data(),e)).delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},m.prototype.getDelegateOptions=function(){var n={},i=this.getDefaults();return this._options&&f.each(this._options,function(e,t){i[e]!=t&&(n[e]=t)}),n},m.prototype.enter=function(e){var t=e instanceof this.constructor?e:f(e.currentTarget).data("bs."+this.type);if(t||(t=new this.constructor(e.currentTarget,this.getDelegateOptions()),f(e.currentTarget).data("bs."+this.type,t)),e instanceof f.Event&&(t.inState["focusin"==e.type?"focus":"hover"]=!0),t.tip().hasClass("in")||"in"==t.hoverState)t.hoverState="in";else{if(clearTimeout(t.timeout),t.hoverState="in",!t.options.delay||!t.options.delay.show)return t.show();t.timeout=setTimeout(function(){"in"==t.hoverState&&t.show()},t.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},m.prototype.leave=function(e){var t=e instanceof this.constructor?e:f(e.currentTarget).data("bs."+this.type);if(t||(t=new this.constructor(e.currentTarget,this.getDelegateOptions()),f(e.currentTarget).data("bs."+this.type,t)),e instanceof f.Event&&(t.inState["focusout"==e.type?"focus":"hover"]=!1),!t.isInStateTrue()){if(clearTimeout(t.timeout),t.hoverState="out",!t.options.delay||!t.options.delay.hide)return t.hide();t.timeout=setTimeout(function(){"out"==t.hoverState&&t.hide()},t.options.delay.hide)}},m.prototype.show=function(){var e=f.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var t=f.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!t)return;var n=this,i=this.tip(),a=this.getUID(this.type);this.setContent(),i.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&i.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,o=/\s?auto?\s?/i,r=o.test(s);r&&(s=s.replace(o,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),c=i[0].offsetWidth,d=i[0].offsetHeight;if(r){var u=s,_=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>_.bottom?"top":"top"==s&&l.top-d<_.top?"bottom":"right"==s&&l.right+c>_.width?"left":"left"==s&&l.left-c<_.left?"right":s,i.removeClass(u).addClass(s)}var h=this.getCalculatedOffset(s,l,c,d);this.applyPlacement(h,s);var p=function(){var e=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==e&&n.leave(n)};f.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",p).emulateTransitionEnd(m.TRANSITION_DURATION):p()}},m.prototype.applyPlacement=function(e,t){var n=this.tip(),i=n[0].offsetWidth,a=n[0].offsetHeight,s=parseInt(n.css("margin-top"),10),o=parseInt(n.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(o)&&(o=0),e.top+=s,e.left+=o,f.offset.setOffset(n[0],f.extend({using:function(e){n.css({top:Math.round(e.top),left:Math.round(e.left)})}},e),0),n.addClass("in");var r=n[0].offsetWidth,l=n[0].offsetHeight;"top"==t&&l!=a&&(e.top=e.top+a-l);var c=this.getViewportAdjustedDelta(t,e,r,l);c.left?e.left+=c.left:e.top+=c.top;var d=/top|bottom/.test(t),u=d?2*c.left-i+r:2*c.top-a+l,_=d?"offsetWidth":"offsetHeight";n.offset(e),this.replaceArrow(u,n[0][_],d)},m.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},m.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},m.prototype.hide=function(e){function t(){"in"!=n.hoverState&&i.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,i=f(this.$tip),a=f.Event("hide.bs."+this.type);if(this.$element.trigger(a),!a.isDefaultPrevented())return i.removeClass("in"),f.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",t).emulateTransitionEnd(m.TRANSITION_DURATION):t(),this.hoverState=null,this},m.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(e){var t=(e=e||this.$element)[0],n="BODY"==t.tagName,i=t.getBoundingClientRect();null==i.width&&(i=f.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var a=window.SVGElement&&t instanceof window.SVGElement,s=n?{top:0,left:0}:a?null:e.offset(),o={scroll:n?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},r=n?{width:f(window).width(),height:f(window).height()}:null;return f.extend({},i,o,r,s)},m.prototype.getCalculatedOffset=function(e,t,n,i){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-i,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-i/2,left:t.left-n}:{top:t.top+t.height/2-i/2,left:t.left+t.width}},m.prototype.getViewportAdjustedDelta=function(e,t,n,i){var a={top:0,left:0};if(!this.$viewport)return a;var s=this.options.viewport&&this.options.viewport.padding||0,o=this.getPosition(this.$viewport);if(/right|left/.test(e)){var r=t.top-s-o.scroll,l=t.top+s-o.scroll+i;r<o.top?a.top=o.top-r:l>o.top+o.height&&(a.top=o.top+o.height-l)}else{var c=t.left-s,d=t.left+s+n;c<o.left?a.left=o.left-c:d>o.right&&(a.left=o.left+o.width-d)}return a},m.prototype.getTitle=function(){var e=this.$element,t=this.options;return e.attr("data-original-title")||("function"==typeof t.title?t.title.call(e[0]):t.title)},m.prototype.getUID=function(e){for(;e+=~~(1e6*Math.random()),document.getElementById(e););return e},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=f(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(e){var t=this;e&&((t=f(e.currentTarget).data("bs."+this.type))||(t=new this.constructor(e.currentTarget,this.getDelegateOptions()),f(e.currentTarget).data("bs."+this.type,t))),e?(t.inState.click=!t.inState.click,t.isInStateTrue()?t.enter(t):t.leave(t)):t.tip().hasClass("in")?t.leave(t):t.enter(t)},m.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null})};var t=f.fn.tooltip;f.fn.tooltip=e,f.fn.tooltip.Constructor=m,f.fn.tooltip.noConflict=function(){return f.fn.tooltip=t,this}}(jQuery),function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(e){for(var t=a([0]),n=-1,i=this.length;++n<i&&(t.context=t[0]=this[n])&&!1!==e.call(t[0],n,t););return this}})}(jQuery),function(w,b){"use strict";function o(e){var t=w(document.createTextNode(""));e.before(t),t.before(e),t.remove()}function r(e){function t(e){return P[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function d(e,t){for(var n=0,i=t.length;n<i;n+=1)if(h(e,t[n]))return n;return-1}function l(){var e=w(L);e.appendTo(document.body);var t={width:e.width()-e[0].clientWidth,height:e.height()-e[0].clientHeight};return e.remove(),t}function h(e,t){return e===t||e!==b&&t!==b&&(null!==e&&null!==t&&(e.constructor===String?e+""==t+"":t.constructor===String&&t+""==e+""))}function c(e,t,n){var i,a,s;if(null===e||e.length<1)return[];for(a=0,s=(i=e.split(t)).length;a<s;a+=1)i[a]=n(i[a]);return i}function s(e){return e.outerWidth(!1)-e.width()}function u(t){var n="keyup-change-value";t.on("keydown",function(){w.data(t,n)===b&&w.data(t,n,t.val())}),t.on("keyup",function(){var e=w.data(t,n);e!==b&&t.val()!==e&&(w.removeData(t,n),t.trigger("keyup-change"))})}function _(e){e.on("mousemove",function(e){var t=M;t!==b&&t.x===e.pageX&&t.y===e.pageY||w(e.target).trigger("mousemove-filtered",e)})}function i(t,n,i){var a;return i=i||b,function(){var e=arguments;window.clearTimeout(a),a=window.setTimeout(function(){n.apply(i,e)},t)}}function p(e,t){var n=i(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){0<=d(e.target,t.get())&&n(e)})}function e(i){i[0]!==document.activeElement&&window.setTimeout(function(){var e,t=i[0],n=i.val().length;i.focus(),(0<t.offsetWidth||0<t.offsetHeight)&&t===document.activeElement&&(t.setSelectionRange?t.setSelectionRange(n,n):t.createTextRange&&((e=t.createTextRange()).collapse(!1),e.select()))},0)}function f(e){var t=0,n=0;if("selectionStart"in(e=w(e)[0]))t=e.selectionStart,n=e.selectionEnd-t;else if("selection"in document){e.focus();var i=document.selection.createRange();n=document.selection.createRange().text.length,i.moveStart("character",-e.value.length),t=i.text.length-n}return{offset:t,length:n}}function m(e){e.preventDefault(),e.stopPropagation()}function g(e){e.preventDefault(),e.stopImmediatePropagation()}function A(e){if(!B){var t=e[0].currentStyle||window.getComputedStyle(e[0],null);(B=w(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:t.fontSize,fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,textTransform:t.textTransform,whiteSpace:"nowrap"})).attr("class","select2-sizer"),w(document.body).append(B)}return B.text(e.val()),B.width()}function v(e,t,n){var i,a,s=[];(i=w.trim(e.attr("class")))&&w((i=""+i).split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&s.push(this)}),(i=w.trim(t.attr("class")))&&w((i=""+i).split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(a=n(this))&&s.push(a)}),e.attr("class",s.join(" "))}function y(e,t,n,i){var a=r(e.toUpperCase()).indexOf(r(t.toUpperCase())),s=t.length;a<0?n.push(i(e)):(n.push(i(e.substring(0,a))),n.push("<span class='select2-match'>"),n.push(i(e.substring(a,a+s))),n.push("</span>"),n.push(i(e.substring(a+s,e.length))))}function t(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function $(o){var e,r=null,t=o.quietMillis||100,l=o.url,c=this;return function(s){window.clearTimeout(e),e=window.setTimeout(function(){var e=o.data,t=l,n=o.transport||w.fn.select2.ajaxDefaults.transport,i={type:o.type||"GET",cache:o.cache||!1,jsonpCallback:o.jsonpCallback||b,dataType:o.dataType||"json"},a=w.extend({},w.fn.select2.ajaxDefaults.params,i);e=e?e.call(c,s.term,s.page,s.context):null,t="function"==typeof t?t.call(c,s.term,s.page,s.context):t,r&&"function"==typeof r.abort&&r.abort(),o.params&&(w.isFunction(o.params)?w.extend(a,o.params.call(c)):w.extend(a,o.params)),w.extend(a,{url:t,dataType:o.dataType,data:e,success:function(e){var t=o.results(e,s.page,s);s.callback(t)},error:function(e,t,n){var i={hasError:!0,jqXHR:e,textStatus:t,errorThrown:n};s.callback(i)}}),r=n.call(c,a)},t)}}function k(e){var t,n,i=e,r=function(e){return""+e.text};w.isArray(i)&&(i={results:n=i}),!1===w.isFunction(i)&&(n=i,i=function(){return n});var a=i();return a.text&&(r=a.text,w.isFunction(r)||(t=a.text,r=function(e){return e[t]})),function(a){var s,o=a.term,n={results:[]};""!==o?(s=function(e,t){var n,i;if((e=e[0]).children){for(i in n={},e)e.hasOwnProperty(i)&&(n[i]=e[i]);n.children=[],w(e.children).each2(function(e,t){s(t,n.children)}),(n.children.length||a.matcher(o,r(n),e))&&t.push(n)}else a.matcher(o,r(e),e)&&t.push(e)},w(i().results).each2(function(e,t){s(t,n.results)}),a.callback(n)):a.callback(i())}}function C(t){var s=w.isFunction(t);return function(n){var i=n.term,a={results:[]},e=s?t(n):t;w.isArray(e)&&(w(e).each(function(){var e=this.text!==b,t=e?this.text:this;(""===i||n.matcher(i,t))&&a.results.push(e?this:{id:this,text:this})}),n.callback(a))}}function E(e,t){if(w.isFunction(e))return!0;if(!e)return!1;if("string"==typeof e)return!0;throw new Error(t+" must be a string, function, or falsy value")}function T(e,t){if(w.isFunction(e)){var n=Array.prototype.slice.call(arguments,2);return e.apply(t,n)}return e}function x(e){var n=0;return w.each(e,function(e,t){t.children?n+=x(t.children):n++}),n}function n(e,t,n,i){var a,s,o,r,l,c=e,d=!1;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return b;for(;;){for(s=-1,o=0,r=i.tokenSeparators.length;o<r&&(l=i.tokenSeparators[o],!(0<=(s=e.indexOf(l))));o++);if(s<0)break;if(a=e.substring(0,s),e=e.substring(s+l.length),0<a.length&&(a=i.createSearchChoice.call(this,a,t))!==b&&null!==a&&i.id(a)!==b&&null!==i.id(a)){for(d=!1,o=0,r=t.length;o<r;o++)if(h(i.id(a),i.id(t[o]))){d=!0;break}d||n(a)}}return c!==e?e:void 0}function a(){var n=this;w.each(arguments,function(e,t){n[t].remove(),n[t]=null})}function I(e,t){var n=function(){};return n.prototype=new e,(n.prototype.constructor=n).prototype.parent=e.prototype,n.prototype=w.extend(n.prototype,t),n}if(window.Select2===b){var D,O,S,R,B,N,F,K,M={x:0,y:0},j={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case j.LEFT:case j.RIGHT:case j.UP:case j.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case j.SHIFT:case j.CTRL:case j.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return 112<=(e=e.which?e.which:e)&&e<=123}},L="<div class='select2-measure-scrollbar'></div>",P={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B",
"\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};N=w(document),K=1,R=function(){return K++},O=I(D=I(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(e){var s,t,n=".select2-results";this.opts=e=this.prepareOpts(e),this.id=e.id,e.element.data("select2")!==b&&null!==e.element.data("select2")&&e.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=w(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=w("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(e.element.attr("id")||"autogen"+R()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",e.element.attr("title")),this.body=w(document.body),v(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",e.element.attr("style")),this.container.css(T(e.containerCss,this.opts.element)),this.container.addClass(T(e.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",m),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),v(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(T(e.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",m),this.results=s=this.container.find(n),this.search=t=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",m),_(this.results),this.dropdown.on("mousemove-filtered",n,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",n,this.bind(function(e){this._touchEvent=!0,this.highlightUnderEvent(e)})),this.dropdown.on("touchmove",n,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",n,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),p(80,this.results),this.dropdown.on("scroll-debounced",n,this.bind(this.loadMoreIfNeeded)),w(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),w(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),w.fn.mousewheel&&s.mousewheel(function(e,t,n,i){var a=s.scrollTop();0<i&&a-i<=0?(s.scrollTop(0),m(e)):i<0&&s.get(0).scrollHeight-s.scrollTop()+i<=s.height()&&(s.scrollTop(s.get(0).scrollHeight-s.height()),m(e))}),u(t),t.on("keyup-change input paste",this.bind(this.updateResults)),t.on("focus",function(){t.addClass("select2-focused")}),t.on("blur",function(){t.removeClass("select2-focused")}),this.dropdown.on("mouseup",n,this.bind(function(e){0<w(e.target).closest(".select2-result-selectable").length&&(this.highlightUnderEvent(e),this.selectHighlighted(e))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.lastSearchTerm=b,w.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==e.maximumInputLength&&this.search.attr("maxlength",e.maximumInputLength);var i=e.element.prop("disabled");i===b&&(i=!1),this.enable(!i);var a=e.element.prop("readonly");a===b&&(a=!1),this.readonly(a),F=F||l(),this.autofocus=e.element.prop("autofocus"),e.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",e.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,t=e.data("select2"),n=this;this.close(),e.length&&e[0].detachEvent&&n._sync&&e.each(function(){n._sync&&this.detachEvent("onpropertychange",n._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,t!==b&&(t.container.remove(),t.liveRegion.remove(),t.dropdown.remove(),e.removeData("select2").off(".select2"),e.is("input[type='hidden']")?e.css("display",""):(e.show().prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show())),a.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:h(e.attr("locked"),"locked")||h(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(A){var o,e,t,n,v=this;if("select"===(o=A.element).get(0).tagName.toLowerCase()&&(this.select=e=A.element),e&&w.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in A)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),A.debug=A.debug||w.fn.select2.defaults.debug,A.debug&&console&&console.warn&&(null!=A.id&&console.warn("Select2: The `id` option has been removed in Select2 4.0.0, consider renaming your `id` property or mapping the property before your data makes it to Select2. You can read more at https://select2.github.io/announcements-4.0.html#changed-id"),null!=A.text&&console.warn("Select2: The `text` option has been removed in Select2 4.0.0, consider renaming your `text` property or mapping the property before your data makes it to Select2. You can read more at https://select2.github.io/announcements-4.0.html#changed-id"),null!=A.sortResults&&console.warn("Select2: the `sortResults` option has been renamed to `sorter` in Select2 4.0.0. "),null!=A.selectOnBlur&&console.warn("Select2: The `selectOnBlur` option has been renamed to `selectOnClose` in Select2 4.0.0."),null!=A.ajax&&null!=A.ajax.results&&console.warn("Select2: The `ajax.results` option has been renamed to `ajax.processResults` in Select2 4.0.0."),null!=A.formatNoResults&&console.warn("Select2: The `formatNoResults` option has been renamed to `language.noResults` in Select2 4.0.0."),null!=A.formatSearching&&console.warn("Select2: The `formatSearching` option has been renamed to `language.searching` in Select2 4.0.0."),null!=A.formatInputTooShort&&console.warn("Select2: The `formatInputTooShort` option has been renamed to `language.inputTooShort` in Select2 4.0.0."),null!=A.formatInputTooLong&&console.warn("Select2: The `formatInputTooLong` option has been renamed to `language.inputTooLong` in Select2 4.0.0."),null!=A.formatLoading&&console.warn("Select2: The `formatLoading` option has been renamed to `language.loadingMore` in Select2 4.0.0."),null!=A.formatSelectionTooBig&&console.warn("Select2: The `formatSelectionTooBig` option has been renamed to `language.maximumSelected` in Select2 4.0.0."),A.element.data("select2Tags")&&console.warn("Select2: The `data-select2-tags` attribute has been renamed to `data-tags` in Select2 4.0.0.")),null!=A.element.data("tags")){var i=A.element.data("tags");w.isArray(i)||(i=[]),A.element.data("select2Tags",i)}if(null!=A.sorter&&(A.sortResults=A.sorter),null!=A.selectOnClose&&(A.selectOnBlur=A.selectOnClose),null!=A.ajax&&w.isFunction(A.ajax.processResults)&&(A.ajax.results=A.ajax.processResults),null!=A.language){var a=A.language;w.isFunction(a.noMatches)&&(A.formatNoMatches=a.noMatches),w.isFunction(a.searching)&&(A.formatSearching=a.searching),w.isFunction(a.inputTooShort)&&(A.formatInputTooShort=a.inputTooShort),w.isFunction(a.inputTooLong)&&(A.formatInputTooLong=a.inputTooLong),w.isFunction(a.loadingMore)&&(A.formatLoading=a.loadingMore),w.isFunction(a.maximumSelected)&&(A.formatSelectionTooBig=a.maximumSelected)}if("function"!=typeof(A=w.extend({},{populateResults:function(e,t,p){var f,m=this.opts.id,g=this.liveRegion;(f=function(e,t,n){var i,a,s,o,r,l,c,d,u,_,h=[];for(i=0,a=(e=A.sortResults(e,t,p)).length;i<a;i+=1)o=!(r=!0===(s=e[i]).disabled)&&m(s)!==b,l=s.children&&0<s.children.length,(c=w("<li></li>")).addClass("select2-results-dept-"+n),c.addClass("select2-result"),c.addClass(o?"select2-result-selectable":"select2-result-unselectable"),r&&c.addClass("select2-disabled"),l&&c.addClass("select2-result-with-children"),c.addClass(v.opts.formatResultCssClass(s)),c.attr("role","presentation"),(d=w(document.createElement("div"))).addClass("select2-result-label"),d.attr("id","select2-result-label-"+R()),d.attr("role","option"),(_=A.formatResult(s,d,p,v.opts.escapeMarkup))!==b&&(d.html(_),c.append(d)),l&&((u=w("<ul></ul>")).addClass("select2-result-sub"),f(s.children,u,n+1),c.append(u)),c.data("select2-data",s),h.push(c[0]);t.append(h),g.text(A.formatMatches(e.length))})(t,e,0)}},w.fn.select2.defaults,A)).id&&(t=A.id,A.id=function(e){return e[t]}),w.isArray(A.element.data("select2Tags"))){if("tags"in A)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+A.element.attr("id");A.tags=A.element.data("select2Tags")}if(e?(A.query=this.bind(function(i){var e,t,a,n={results:[],more:!1},s=i.term;a=function(e,t){var n;e.is("option")?i.matcher(s,e.text(),e)&&t.push(v.optionToData(e)):e.is("optgroup")&&(n=v.optionToData(e),e.children().each2(function(e,t){a(t,n.children)}),0<n.children.length&&t.push(n))},e=o.children(),this.getPlaceholder()!==b&&0<e.length&&(t=this.getPlaceholderOption())&&(e=e.not(t)),e.each2(function(e,t){a(t,n.results)}),i.callback(n)}),A.id=function(e){return e.id}):"query"in A||("ajax"in A?((n=A.element.data("ajax-url"))&&0<n.length&&(A.ajax.url=n),A.query=$.call(A.element,A.ajax)):"data"in A?A.query=k(A.data):"tags"in A&&(A.query=C(A.tags),A.createSearchChoice===b&&(A.createSearchChoice=function(e){return{id:w.trim(e),text:w.trim(e)}}),A.initSelection===b&&(A.initSelection=function(e,t){var n=[];w(c(e.val(),A.separator,A.transformVal)).each(function(){var e={id:this,text:this},t=A.tags;w.isFunction(t)&&(t=t()),w(t).each(function(){if(h(this.id,e.id))return e=this,!1}),n.push(e)}),t(n)}))),"function"!=typeof A.query)throw"query function not defined for Select2 "+A.element.attr("id");if("top"===A.createSearchChoicePosition)A.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===A.createSearchChoicePosition)A.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof A.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return A},monitorSource:function(){var e,n=this.opts.element,t=this;n.on("change.select2",this.bind(function(){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),this._sync=this.bind(function(){var e=n.prop("disabled");e===b&&(e=!1),this.enable(!e);var t=n.prop("readonly");t===b&&(t=!1),this.readonly(t),this.container&&(v(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(T(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(v(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(T(this.opts.dropdownCssClass,this.opts.element)))}),n.length&&n[0].attachEvent&&n.each(function(){this.attachEvent("onpropertychange",t._sync)}),(e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==b&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new e(function(e){w.each(e,t._sync)}),this.propertyObserver.observe(n.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(e){var t=w.Event("select2-selecting",{val:this.id(e),object:e,choice:e});return this.opts.element.trigger(t),!t.isDefaultPrevented()},triggerChange:function(e){e=e||{},e=w.extend({},e,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(e),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===b&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===b&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var e,t,n,i,a,s=this.dropdown,o=this.container,r=o.offset(),l=o.outerHeight(!1),c=o.outerWidth(!1),d=s.outerHeight(!1),u=w(window),_=u.width(),h=u.height(),p=u.scrollLeft()+_,f=u.scrollTop()+h,m=r.top+l,g=r.left,A=m+d<=f,v=r.top-d>=u.scrollTop(),b=s.outerWidth(!1),y=function(){return g+b<=p},$=function(){return r.left+p+o.outerWidth(!1)>b};s.hasClass("select2-drop-above")?(t=!0,!v&&A&&(t=!(n=!0))):(t=!1,!A&&v&&(t=n=!0)),n&&(s.hide(),r=this.container.offset(),l=this.container.outerHeight(!1),c=this.container.outerWidth(!1),d=s.outerHeight(!1),p=u.scrollLeft()+_,f=u.scrollTop()+h,m=r.top+l,g=r.left,b=s.outerWidth(!1),s.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(a=w(".select2-results",s)[0],s.addClass("select2-drop-auto-width"),s.css("width",""),c<(b=s.outerWidth(!1)+(a.scrollHeight===a.clientHeight?0:F.width))?c=b:b=c,d=s.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(m-=(e=this.body.offset()).top,g-=e.left),!y()&&$()&&(g=r.left+this.container.outerWidth(!1)-b),i={left:g,width:c},t?(this.container.addClass("select2-drop-above"),s.addClass("select2-drop-above"),d=s.outerHeight(!1),i.top=r.top-d,i.bottom="auto"):(i.top=m,i.bottom="auto",this.container.removeClass("select2-drop-above"),s.removeClass("select2-drop-above")),i=w.extend(i,T(this.opts.dropdownCss,this.opts.element)),s.css(i)},shouldOpen:function(){var e;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(e=w.Event("select2-opening"),this.opts.element.trigger(e),!e.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),N.on("mousemove.select2Event",function(e){M.x=e.pageX,M.y=e.pageY}),!0)},opening:function(){var i,e=this.containerEventName,t="scroll."+e,n="resize."+e,a="orientationchange."+e;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),0===(i=w("#select2-drop-mask")).length&&((i=w(document.createElement("div"))).attr("id","select2-drop-mask").attr("class","select2-drop-mask"),i.hide(),i.appendTo(this.body),i.on("mousedown touchstart click",function(e){o(i);var t,n=w("#select2-drop");0<n.length&&((t=n.data("select2")).opts.selectOnBlur&&t.selectHighlighted({noFocus:!0}),t.close(),e.preventDefault(),e.stopPropagation())})),this.dropdown.prev()[0]!==i[0]&&this.dropdown.before(i),w("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),i.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var s=this;this.container.parents().add(window).each(function(){w(this).on(n+" "+t+" "+a,function(){s.opened()&&s.positionDropdown()})})},close:function(){if(this.opened()){var e=this.containerEventName,t="scroll."+e,n="resize."+e,i="orientationchange."+e;this.container.parents().add(window).each(function(){w(this).off(t).off(n).off(i)}),this.clearDropdownAlignmentPreference(),w("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),N.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.search.removeAttr("aria-activedescendant"),this.opts.element.trigger(w.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},prefillNextSearchTerm:function(){if(""!==this.search.val())return!1;var e=this.opts.nextSearchTerm(this.data(),this.lastSearchTerm);return e!==b&&(this.search.val(e),this.search.select(),!0)},getMaximumSelectionSize:function(){return T(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var e,t,n,i,a,s,o,r,l=this.results;(t=this.highlight())<0||(0!=t?(e=this.findHighlightableChoices().find(".select2-result-label"),i=(r=((n=w(e[t])).offset()||{}).top||0)+n.outerHeight(!0),t===e.length-1&&0<(o=l.find("li.select2-more-results")).length&&(i=o.offset().top+o.outerHeight(!0)),(a=l.offset().top+l.outerHeight(!1))<i&&l.scrollTop(l.scrollTop()+(i-a)),(s=r-l.offset().top)<0&&"none"!=n.css("display")&&l.scrollTop(l.scrollTop()+s)):l.scrollTop(0))},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(e){for(var t=this.findHighlightableChoices(),n=this.highlight();-1<n&&n<t.length;){var i=w(t[n+=e]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(n);break}}},highlight:function(e){var t,n,i=this.findHighlightableChoices();if(0===arguments.length)return d(i.filter(".select2-highlighted")[0],i.get());e>=i.length&&(e=i.length-1),e<0&&(e=0),this.removeHighlight(),(t=w(i[e])).addClass("select2-highlighted"),this.search.attr("aria-activedescendant",t.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(t.text()),(n=t.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(n),choice:n})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(e){var t=w(e.target).closest(".select2-result-selectable");if(0<t.length&&!t.is(".select2-highlighted")){var n=this.findHighlightableChoices();this.highlight(n.index(t))}else 0==t.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var t=this.results,n=t.find("li.select2-more-results"),i=this.resultsPage+1,a=this,s=this.search.val(),o=this.context;0!==n.length&&n.offset().top-t.offset().top-t.height()<=this.opts.loadMorePadding&&(n.addClass("select2-active"),this.opts.query({element:this.opts.element,term:s,page:i,context:o,matcher:this.opts.matcher,callback:this.bind(function(e){a.opened()&&(a.opts.populateResults.call(this,t,e.results,{term:s,page:i,context:o}),a.postprocessResults(e,!1,!1),!0===e.more?(n.detach().appendTo(t).html(a.opts.escapeMarkup(T(a.opts.formatLoadMore,a.opts.element,i+1))),window.setTimeout(function(){a.loadMoreIfNeeded()},10)):n.remove(),a.positionDropdown(),a.resultsPage=i,a.context=e.context,this.opts.element.trigger({type:"select2-loaded",items:e}))})}))},tokenize:function(){},updateResults:function(n){function i(){o.removeClass("select2-active"),c.positionDropdown(),r.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?c.liveRegion.text(r.text()):c.liveRegion.text(c.opts.formatMatches(r.find('.select2-result-selectable:not(".select2-selected")').length))}function a(e){r.html(e),i()}var e,t,s,o=this.search,r=this.results,l=this.opts,c=this,d=o.val(),u=w.data(this.container,"select2-last-term");if((!0===n||!u||!h(d,u))&&(w.data(this.container,"select2-last-term",d),!0===n||!1!==this.showSearchInput&&this.opened())){s=++this.queryCount;var _=this.getMaximumSelectionSize();if(!(1<=_&&(e=this.data(),w.isArray(e)&&e.length>=_&&E(l.formatSelectionTooBig,"formatSelectionTooBig"))))return o.val().length<l.minimumInputLength?(E(l.formatInputTooShort,"formatInputTooShort")?a("<li class='select2-no-results'>"+T(l.formatInputTooShort,l.element,o.val(),l.minimumInputLength)+"</li>"):a(""),void(n&&this.showSearch&&this.showSearch(!0))):void(l.maximumInputLength&&o.val().length>l.maximumInputLength?E(l.formatInputTooLong,"formatInputTooLong")?a("<li class='select2-no-results'>"+T(l.formatInputTooLong,l.element,o.val(),l.maximumInputLength)+"</li>"):a(""):(l.formatSearching&&0===this.findHighlightableChoices().length&&a("<li class='select2-searching'>"+T(l.formatSearching,l.element)+"</li>"),o.addClass("select2-active"),this.removeHighlight(),(t=this.tokenize())!=b&&null!=t&&o.val(t),this.resultsPage=1,l.query({element:l.element,term:o.val(),page:this.resultsPage,context:null,matcher:l.matcher,callback:this.bind(function(e){var t;if(s==this.queryCount)if(this.opened())if(e.hasError!==b&&E(l.formatAjaxError,"formatAjaxError"))a("<li class='select2-ajax-error'>"+T(l.formatAjaxError,l.element,e.jqXHR,e.textStatus,e.errorThrown)+"</li>");else{if(this.context=e.context===b?null:e.context,this.opts.createSearchChoice&&""!==o.val()&&(t=this.opts.createSearchChoice.call(c,o.val(),e.results))!==b&&null!==t&&c.id(t)!==b&&null!==c.id(t)&&0===w(e.results).filter(function(){return h(c.id(this),c.id(t))}).length&&this.opts.createSearchChoicePosition(e.results,t),0===e.results.length&&E(l.formatNoMatches,"formatNoMatches"))return a("<li class='select2-no-results'>"+T(l.formatNoMatches,l.element,o.val())+"</li>"),void(this.showSearch&&this.showSearch(o.val()));r.empty(),c.opts.populateResults.call(this,r,e.results,{term:o.val(),page:this.resultsPage,context:null}),!0===e.more&&E(l.formatLoadMore,"formatLoadMore")&&(r.append("<li class='select2-more-results'>"+l.escapeMarkup(T(l.formatLoadMore,l.element,this.resultsPage))+"</li>"),window.setTimeout(function(){c.loadMoreIfNeeded()},10)),this.postprocessResults(e,n),i(),this.opts.element.trigger({type:"select2-loaded",items:e})}else this.search.removeClass("select2-active")})})));a("<li class='select2-selection-limit'>"+T(l.formatSelectionTooBig,l.element,_)+"</li>")}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(
),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){e(this.search)},selectHighlighted:function(e){if(this._touchMoved)this.clearTouchMoved();else{var t=this.highlight(),n=this.results.find(".select2-highlighted").closest(".select2-result").data("select2-data");n?(this.highlight(t),this.onSelect(n,e)):e&&e.noFocus&&this.close()}},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==b?e.text():b)},getPlaceholderOption:function(){if(this.select){var e=this.select.children("option").first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&e||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===w.trim(e.text())&&""===e.val())return e}},initContainerWidth:function(){function e(){var e,t,n,i,a;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"!==this.opts.width&&"resolve"!==this.opts.width)return w.isFunction(this.opts.width)?this.opts.width():this.opts.width;if("string"==typeof(e=this.opts.element.attr("style")))for(i=0,a=(t=e.split(";")).length;i<a;i+=1)if(null!==(n=t[i].replace(/\s/g,"").match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&1<=n.length)return n[1];return"resolve"===this.opts.width?0<(e=this.opts.element.css("width")).indexOf("%")?e:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px":null}var t=e.call(this);null!==t&&this.container.css("width",t)}}),{createContainer:function(){return w(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <label for='' class='select2-offscreen'></label>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'","       aria-autocomplete='list' />","   </div>","   <ul class='select2-results' role='listbox'>","   </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var e,t,n;0<=this.opts.minimumResultsForSearch&&this.showSearch(!0),this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),(e=this.search.get(0)).createTextRange?((t=e.createTextRange()).collapse(!1),t.select()):e.setSelectionRange&&(n=this.search.val().length,e.setSelectionRange(n,n))),this.prefillNextSearchTerm(),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(w.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){w("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),a.call(this,"selection","focusser")},initContainer:function(){var t,e,n=this.container,i=this.dropdown,a=R();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+a),this.focusser.attr("aria-labelledby","select2-chosen-"+a),this.results.attr("id","select2-results-"+a),this.search.attr("aria-owns","select2-results-"+a),this.focusser.attr("id","s2id_autogen"+a),e=w("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.focusser.prev().text(e.text()).attr("for",this.focusser.attr("id"));var s=this.opts.element.attr("title");this.opts.element.attr("title",s||e.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(w("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode)if(e.which!==j.PAGE_UP&&e.which!==j.PAGE_DOWN)switch(e.which){case j.UP:case j.DOWN:return this.moveHighlight(e.which===j.UP?-1:1),void m(e);case j.ENTER:return this.selectHighlighted(),void m(e);case j.TAB:return void this.selectHighlighted({noFocus:!0});case j.ESC:return this.cancel(e),void m(e)}else m(e)})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.results&&1<this.results.length&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==j.TAB&&!j.isControl(e)&&!j.isFunctionKey(e)&&e.which!==j.ESC){if(!1!==this.opts.openOnEnter||e.which!==j.ENTER){if(e.which==j.DOWN||e.which==j.UP||e.which==j.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void m(e)}return e.which==j.DELETE||e.which==j.BACKSPACE?(this.opts.allowClear&&this.clear(),void m(e)):void 0}m(e)}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(0<=this.opts.minimumResultsForSearch){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),g(e),this.close(),this.selection&&this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(e){o(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(w.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),m(e)})),i.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){m(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(w.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(w.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(w.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(e){var t=this.selection.data("select2-data");if(t){var n=w.Event("select2-clearing");if(this.opts.element.trigger(n),n.isDefaultPrevented())return;var i=this.getPlaceholderOption();this.opts.element.val(i?i.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==e&&(this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var t=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==b&&null!==e&&(t.updateSelection(e),t.close(),t.setPlaceholder(),t.lastSearchTerm=t.search.val())})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()!==b&&((e=this.getPlaceholderOption())!==b&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val())},prepareOpts:function(){var o=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===o.element.get(0).tagName.toLowerCase()?o.initSelection=function(e,t){var n=e.find("option").filter(function(){return this.selected&&!this.disabled});t(i.optionToData(n))}:"data"in o&&(o.initSelection=o.initSelection||function(e,t){var a=e.val(),s=null;o.query({matcher:function(e,t,n){var i=h(a,o.id(n));return i&&(s=n),i},callback:w.isFunction(t)?function(){t(s)}:w.noop})}),o},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,n){var i=0,a=this;if(this.findHighlightableChoices().each2(function(e,t){if(h(a.id(t.data("select2-data")),a.opts.element.val()))return i=e,!1}),!1!==n&&(!0===t&&0<=i?this.highlight(i):this.highlight(0)),!0===t){var s=this.opts.minimumResultsForSearch;0<=s&&this.showSearch(x(e.results)>=s)}},showSearch:function(e){this.showSearchInput!==e&&(this.showSearchInput=e,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!e),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!e),w(this.dropdown,this.container).toggleClass("select2-with-searchbox",e))},onSelect:function(e,t){if(this.triggerSelect(e)){var n=this.opts.element.val(),i=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.lastSearchTerm=this.search.val(),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),h(n,this.id(e))||this.triggerChange({added:e,removed:i})}},updateSelection:function(e){var t,n,i=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),i.empty(),null!==e&&(t=this.opts.formatSelection(e,i,this.opts.escapeMarkup)),t!==b&&i.append(t),(n=this.opts.formatSelectionCssClass(e,i))!==b&&i.addClass(n),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(e,t){var n,i=!1,a=null,s=this,o=this.data();if(0===arguments.length)return this.opts.element.val();if(n=e,1<arguments.length&&(i=t,this.opts.debug&&console&&console.warn&&console.warn('Select2: The second option to `select2("val")` is not supported in Select2 4.0.0. The `change` event will always be triggered in 4.0.0.')),this.select)this.opts.debug&&console&&console.warn&&console.warn('Select2: Setting the value on a <select> using `select2("val")` is no longer supported in 4.0.0. You can use the `.val(newValue).trigger("change")` method provided by jQuery instead.'),this.select.val(n).find("option").filter(function(){return this.selected}).each2(function(e,t){return a=s.optionToData(t),!1}),this.updateSelection(a),this.setPlaceholder(),i&&this.triggerChange({added:a,removed:o});else{if(!n&&0!==n)return void this.clear(i);if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(n),this.opts.initSelection(this.opts.element,function(e){s.opts.element.val(e?s.id(e):""),s.updateSelection(e),s.setPlaceholder(),i&&s.triggerChange({added:e,removed:o})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e,t){var n,i=!1;if(0===arguments.length)return(n=this.selection.data("select2-data"))==b&&(n=null),n;this.opts.debug&&console&&console.warn&&console.warn('Select2: The `select2("data")` method can no longer set selected values in 4.0.0, consider using the `.val()` method instead.'),1<arguments.length&&(i=t),e?(n=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),i&&this.triggerChange({added:e,removed:n})):this.clear(i)}}),S=I(D,{createContainer:function(){return w(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <label for='' class='select2-offscreen'></label>","    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},prepareOpts:function(){var l=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===l.element.get(0).tagName.toLowerCase()?l.initSelection=function(e,t){var n=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){n.push(i.optionToData(t))}),t(n)}:"data"in l&&(l.initSelection=l.initSelection||function(e,s){var o=c(e.val(),l.separator,l.transformVal),r=[];l.query({matcher:function(e,t,n){var i=w.grep(o,function(e){return h(e,l.id(n))}).length;return i&&r.push(n),i},callback:w.isFunction(s)?function(){for(var e=[],t=0;t<o.length;t++)for(var n=o[t],i=0;i<r.length;i++){var a=r[i];if(h(n,l.id(a))){e.push(a),r.splice(i,1);break}}s(e)}:w.noop})}),l},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){w("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),a.call(this,"searchContainer","selection")},initContainer:function(){var o,e=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=o=this.container.find(e);var t=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(){t.search[0].focus(),t.selectChoice(w(this))}),this.search.attr("id","s2id_autogen"+R()),this.search.prev().text(w("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.on("focus.select2",this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var t=o.find(".select2-search-choice-focus"),n=t.prev(".select2-search-choice:not(.select2-locked)"),i=t.next(".select2-search-choice:not(.select2-locked)"),a=f(this.search);if(t.length&&(e.which==j.LEFT||e.which==j.RIGHT||e.which==j.BACKSPACE||e.which==j.DELETE||e.which==j.ENTER)){var s=t;return e.which==j.LEFT&&n.length?s=n:e.which==j.RIGHT?s=i.length?i:null:e.which===j.BACKSPACE?this.unselect(t.first())&&(this.search.width(10),s=n.length?n:i):e.which==j.DELETE?this.unselect(t.first())&&(this.search.width(10),s=i.length?i:null):e.which==j.ENTER&&(s=null),this.selectChoice(s),m(e),void(s&&s.length||this.open())}if((e.which===j.BACKSPACE&&1==this.keydowns||e.which==j.LEFT)&&0==a.offset&&!a.length)return this.selectChoice(o.find(".select2-search-choice:not(.select2-locked)").last()),void m(e);if(this.selectChoice(null),this.opened())switch(e.which){case j.UP:case j.DOWN:return this.moveHighlight(e.which===j.UP?-1:1),void m(e);case j.ENTER:return this.selectHighlighted(),void m(e);case j.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case j.ESC:return this.cancel(e),void m(e)}if(e.which!==j.TAB&&!j.isControl(e)&&!j.isFunctionKey(e)&&e.which!==j.BACKSPACE&&e.which!==j.ESC){if(e.which===j.ENTER){if(!1===this.opts.openOnEnter)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),e.which!==j.PAGE_UP&&e.which!==j.PAGE_DOWN||m(e),e.which===j.ENTER&&m(e)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(e){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),e.stopImmediatePropagation(),this.opts.element.trigger(w.Event("select2-blur"))})),this.container.on("click",e,this.bind(function(e){this.isInterfaceEnabled()&&(0<w(e.target).closest(".select2-search-choice").length||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(w.Event("select2-focus")),this.open(),this.focusSearch(),e.preventDefault()))})),this.container.on("focus",e,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(w.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var t=this;this.opts.initSelection.call(null,this.opts.element,function(e){e!==b&&null!==e&&(t.updateSelection(e),t.close(),t.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),t=this.getMaxSearchWidth();e!==b&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(0<t?t:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.prefillNextSearchTerm(),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(w.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(e){var t={},n=[],i=this;w(e).each(function(){i.id(this)in t||(t[i.id(this)]=0,n.push(this))}),this.selection.find(".select2-search-choice").remove(),this.addSelectedChoice(n),i.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts))&&e!=b&&(this.search.val(e),0<e.length&&this.open())},onSelect:function(e,t){this.triggerSelect(e)&&""!==e.text&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.lastSearchTerm=this.search.val(),this.clearSearch(),this.updateResults(),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect?(this.close(),this.search.width(10)):0<this.countSelectableResults()?(this.search.width(10),this.resizeSearch(),0<this.getMaximumSelectionSize()&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.prefillNextSearchTerm()&&this.updateResults(),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),t&&t.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(e){var t=this.getVal(),n=this;w(e).each(function(){t.push(n.createChoice(this))}),this.setVal(t)},createChoice:function(e){var t,n,i=!e.locked,a=w("<li class='select2-search-choice'>    <div></div>    <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=w("<li class='select2-search-choice select2-locked'><div></div></li>"),o=i?a:s,r=this.id(e);return(t=this.opts.formatSelection(e,o.find("div"),this.opts.escapeMarkup))!=b&&o.find("div").replaceWith(w("<div></div>").html(t)),(n=this.opts.formatSelectionCssClass(e,o.find("div")))!=b&&o.addClass(n),i&&o.find(".select2-search-choice-close").on("mousedown",m).on("click dblclick",this.bind(function(e){this.isInterfaceEnabled()&&(this.unselect(w(e.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),m(e),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),o.data("select2-data",e),o.insertBefore(this.searchContainer),r},unselect:function(e){var t,n,i=this.getVal();if(0===(e=e.closest(".select2-search-choice")).length)throw"Invalid argument: "+e+". Must be .select2-search-choice";if(t=e.data("select2-data")){var a=w.Event("select2-removing");if(a.val=this.id(t),a.choice=t,this.opts.element.trigger(a),a.isDefaultPrevented())return!1;for(;0<=(n=d(this.id(t),i));)i.splice(n,1),this.setVal(i),this.select&&this.postprocessResults();return e.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}),!0}},postprocessResults:function(e,t,n){var i=this.getVal(),a=this.results.find(".select2-result"),s=this.results.find(".select2-result-with-children"),o=this;a.each2(function(e,t){0<=d(o.id(t.data("select2-data")),i)&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),s.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&!1!==n&&!0===this.opts.closeOnSelect&&o.highlight(0),!this.opts.createSearchChoice&&0<!a.filter(".select2-result:not(.select2-selected)").length&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&E(o.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+T(o.opts.formatNoMatches,o.opts.element,o.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-s(this.search)},resizeSearch:function(){var e,t,n,i,a=s(this.search);e=A(this.search)+10,t=this.search.offset().left,(i=(n=this.selection.width())-(t-this.selection.offset().left)-a)<e&&(i=n-a),i<40&&(i=n-a),i<=0&&(i=e),this.search.width(Math.floor(i))},getVal:function(){var e;return this.select?null===(e=this.select.val())?[]:e:c(e=this.opts.element.val(),this.opts.separator,this.opts.transformVal)},setVal:function(e){if(this.select)this.select.val(e);else{var t=[],n={};w(e).each(function(){this in n||(t.push(this),n[this]=0)}),this.opts.element.val(0===t.length?"":t.join(this.opts.separator))}},buildChangeDetails:function(e,t){t=t.slice(0),e=e.slice(0);for(var n=0;n<t.length;n++)for(var i=0;i<e.length;i++)if(h(this.opts.id(t[n]),this.opts.id(e[i]))){t.splice(n,1),n--,e.splice(i,1);break}return{added:t,removed:e}},val:function(e,n){var i,a=this;if(0===arguments.length)return this.getVal();if((i=this.data()).length||(i=[]),!e&&0!==e)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(n&&this.triggerChange({added:this.data(),removed:i}));if(this.setVal(e),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),n&&this.triggerChange(this.buildChangeDetails(i,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(e){var t=w.map(e,a.id);a.setVal(t),a.updateSelection(e),a.clearSearch(),n&&a.triggerChange(a.buildChangeDetails(i,a.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var e=[],t=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){e.push(t.opts.id(w(this).data("select2-data")))}),this.setVal(e),this.triggerChange()},data:function(e,t){var n,i,a=this;if(0===arguments.length)return this.selection.children(".select2-search-choice").map(function(){return w(this).data("select2-data")}).get();i=this.data(),e||(e=[]),n=w.map(e,function(e){return a.opts.id(e)}),this.setVal(n),this.updateSelection(e),this.clearSearch(),t&&this.triggerChange(this.buildChangeDetails(i,this.data()))}}),w.fn.select2=function(){var e,t,n,i,a,s=Array.prototype.slice.call(arguments,0),o=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],r=["opened","isFocused","container","dropdown"],l=["val","data"],c={search:"externalSearch"};return this.each(function(){if(0===s.length||"object"==typeof s[0])(e=0===s.length?{}:w.extend({},s[0])).element=w(this),"select"===e.element.get(0).tagName.toLowerCase()?a=e.element.prop("multiple"):(a=e.multiple||!1,"tags"in e&&(e.multiple=a=!0)),(t=a?new window.Select2["class"].multi:new window.Select2["class"].single).init(e);else{if("string"!=typeof s[0])throw"Invalid arguments to select2 plugin: "+s;if(d(s[0],o)<0)throw"Unknown method: "+s[0];if(i=b,(t=w(this).data("select2"))===b)return;if("container"===(n=s[0])?i=t.container:"dropdown"===n?i=t.dropdown:(c[n]&&(n=c[n]),i=t[n].apply(t,s.slice(1))),0<=d(s[0],r)||0<=d(s[0],l)&&1==s.length)return!1}}),i===b?this:i},w.fn.select2.defaults={debug:!1,width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,i){var a=[];return y(this.text(e),n.term,a,i),a.join("")},transformVal:function(e){return w.trim(e)},formatSelection:function(e,t,n){return e?n(this.text(e)):b},sortResults:function(e){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(){return b},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==b?null:e.id},text:function(e){return e&&this.data&&this.data.text?w.isFunction(this.data.text)?this.data.text(e):e[this.data.text]:e.text},matcher:function(e,t){return 0<=r(""+t).toUpperCase().indexOf(r(""+e).toUpperCase())},separator:",",tokenSeparators:[],tokenizer:n,escapeMarkup:t,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){return!("ontouchstart"in window||0<navigator.msMaxTouchPoints)||!(e.opts.minimumResultsForSearch<0)}},w.fn.select2.locales=[],w.fn.select2.locales.en={formatMatches:function(e){return 1===e?"One result is available, press enter to select it.":e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(){return"Loading failed"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" or more character"+(1==n?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please delete "+n+" character"+(1==n?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"}},w.extend(w.fn.select2.defaults,w.fn.select2.locales.en),w.fn.select2.ajaxDefaults={transport:w.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:$,local:k,tags:C},util:{debounce:i,markMatch:y,escapeMarkup:t,stripDiacritics:r},"class":{"abstract":D,single:O,multi:S}}}}(jQuery),function(e){"use strict";e.fn.select2.locales.ja={formatNoMatches:function(){return"\u8a72\u5f53\u306a\u3057"},formatInputTooShort:function(e,t){return"\u5f8c"+(t-e.length)+"\u6587\u5b57\u5165\u308c\u3066\u304f\u3060\u3055\u3044"},formatInputTooLong:function(e,t){return"\u691c\u7d22\u6587\u5b57\u5217\u304c"+(e.length-t)+"\u6587\u5b57\u9577\u3059\u304e\u307e\u3059"},formatSelectionTooBig:function(e){return"\u6700\u591a\u3067"+e+"\u9805\u76ee\u307e\u3067\u3057\u304b\u9078\u629e\u3067\u304d\u307e\u305b\u3093"},formatLoadMore:function(){return"\u8aad\u8fbc\u4e2d\uff65\uff65\uff65"},formatSearching:function(){return"\u691c\u7d22\u4e2d\uff65\uff65\uff65"}},e.extend(e.fn.select2.defaults,e.fn.select2.locales.ja)}(jQuery),function(){"undefined"!=typeof window.CKEDITOR_BASEPATH&&null!==window.CKEDITOR_BASEPATH||(window.CKEDITOR_BASEPATH="/assets/ckeditor/")}.call(this),function(){function e(e,t){CKEDITOR.tools.extend(this,t,{editor:e,id:"cke-"+CKEDITOR.tools.getUniqueId(),area:e._.notificationArea}),t.type||(this.type="info"),this.element=this._createElement(),e.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(this.element)}function t(e){var t=this;this.editor=e,this.notifications=[],this.element=this._createElement(),this._uiBuffer=CKEDITOR.tools.eventsBuffer(10,this._layout,this),this._changeBuffer=CKEDITOR.tools.eventsBuffer(500,this._layout,this),e.on("destroy",function(){t._removeListeners(),t.element.remove()})}var n,i,a,s,o,r,l,c,d,u,_,h,p,f,m,g,A,v,b,y,$,w,k,C,E,T,x,I,D,O,S,R,B,N,F,K,M,j,L,P,U,H,Q,z,q,W,Y,V,G,X,J;window.CKEDITOR&&window.CKEDITOR.dom||(window.CKEDITOR||(window.CKEDITOR=function(){var a=/(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,t={timestamp:"H5SC",version:"4.7.1",revision:"08ffd39",rnd:Math.floor(900*Math.random())+100,_:{pending:[],basePathSrcPattern:a},status:"unloaded",basePath:function(){var e=window.CKEDITOR_BASEPATH||"";if(!e)for(var t=document.getElementsByTagName("script"),n=0;n<t.length;n++){var i=t[n].src.match(a);if(i){e=i[1];break}}if(-1==e.indexOf(":/")&&"//"!=e.slice(0,2)&&(e=0===e.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+e:location.href.match(/^[^\?]*\/(?:)/)[0]+e),!e)throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';return e}(),getUrl:function(e){return-1==e.indexOf(":/")&&0!==e.indexOf("/")&&(e=this.basePath+e),this.timestamp&&"/"!=e.charAt(e.length-1)&&!/[&?]t=/.test(e)&&(e+=(0<=e.indexOf("?")?"&":"?")+"t="+this.timestamp),e},domReady:function(){function i(){try{document.addEventListener?(document.removeEventListener("DOMContentLoaded",i,!1),e()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",i),e())}catch(a){}}function e(){for(var e;e=a.shift();)e()}var a=[];return function(e){function t(){try{document.documentElement.doScroll("left")}catch(e){return void setTimeout(t,1)}i()}if(a.push(e),"complete"===document.readyState&&setTimeout(i,1),1==a.length)if(document.addEventListener)document.addEventListener("DOMContentLoaded",i,!1),window.addEventListener("load",i,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",i),window.attachEvent("onload",i),e=!1;try{e=!window.frameElement}catch(n){}document.documentElement.doScroll&&e&&t()}}}()},n=window.CKEDITOR_GETURL;if(n){var i=t.getUrl;t.getUrl=function(e){return n.call(t,e)||i.call(t,e)}}return t}()),CKEDITOR.event||(CKEDITOR.event=function(){},CKEDITOR.event.implementOn=function(e){var t,n=CKEDITOR.event.prototype;for(t in n)null==e[t]&&(e[t]=n[t])},CKEDITOR.event.prototype=function(){function d(e){var t=p(this);return t[e]||(t[e]=new n(e))}var c,u,_,h,p=function(e){return(e=e.getPrivate&&e.getPrivate()||e._||(e._={})).events||(e.events={})},n=function(e){this.name=e,this.listeners=[]};return n.prototype={getListenerIndex:function(e){for(var t=0,n=this.listeners;t<n.length;t++)if(n[t].fn==e)return t;return-1}},{define:function(e,t){var n=d.call(this,e)
;CKEDITOR.tools.extend(n,t,!0)},on:function(a,s,o,r,e){function t(e,t,n,i){return!(e={name:a,sender:this,editor:e,data:t,listenerData:r,stop:n,cancel:i,removeListener:l})!==s.call(o,e)&&e.data}function l(){i.removeListener(a,s)}var n=d.call(this,a);if(n.getListenerIndex(s)<0){n=n.listeners,o||(o=this),isNaN(e)&&(e=10);var i=this;t.fn=s,t.priority=e;for(var c=n.length-1;0<=c;c--)if(n[c].priority<=e)return n.splice(c+1,0,t),{removeListener:l};n.unshift(t)}return{removeListener:l}},once:function(){var e=Array.prototype.slice.call(arguments),t=e[1];return e[1]=function(e){return e.removeListener(),t.apply(this,arguments)},this.on.apply(this,e)},capture:function(){CKEDITOR.event.useCapture=1;var e=this.on.apply(this,arguments);return CKEDITOR.event.useCapture=0,e},fire:(c=0,u=function(){c=1},_=0,h=function(){_=1},function(e,t,n){var i=p(this)[e];e=c;var a=_;if(c=_=0,i&&(o=i.listeners).length)for(var s,o=o.slice(0),r=0;r<o.length;r++){if(i.errorProof)try{s=o[r].call(this,n,t,u,h)}catch(l){}else s=o[r].call(this,n,t,u,h);if(!1===s?_=1:void 0!==s&&(t=s),c||_)break}return t=!_&&(void 0===t||t),c=e,_=a,t}),fireOnce:function(e,t,n){return t=this.fire(e,t,n),delete p(this)[e],t},removeListener:function(e,t){var n=p(this)[e];if(n){var i=n.getListenerIndex(t);0<=i&&n.listeners.splice(i,1)}},removeAllListeners:function(){var e,t=p(this);for(e in t)delete t[e]},hasListeners:function(e){return(e=p(this)[e])&&0<e.listeners.length}}}()),CKEDITOR.editor||(CKEDITOR.editor=function(){CKEDITOR._.pending.push([this,arguments]),CKEDITOR.event.call(this)},CKEDITOR.editor.prototype.fire=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fire.call(this,e,t,this)},CKEDITOR.editor.prototype.fireOnce=function(e,t){return e in{instanceReady:1,loaded:1}&&(this[e]=!0),CKEDITOR.event.prototype.fireOnce.call(this,e,t,this)},CKEDITOR.event.implementOn(CKEDITOR.editor.prototype)),CKEDITOR.env||(CKEDITOR.env=function(){var e=navigator.userAgent.toLowerCase(),t=e.match(/edge[ \/](\d+.?\d*)/),n=-1<e.indexOf("trident/");(n={ie:n=!(!t&&!n),edge:!!t,webkit:!n&&-1<e.indexOf(" applewebkit/"),air:-1<e.indexOf(" adobeair/"),mac:-1<e.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode&&(!document.documentMode||document.documentMode<10),mobile:-1<e.indexOf("mobile"),iOS:/(ipad|iphone|ipod)/.test(e),isCustomDomain:function(){if(!this.ie)return!1;var e=document.domain,t=window.location.hostname;return e!=t&&e!="["+t+"]"},secure:"https:"==location.protocol}).gecko="Gecko"==navigator.product&&!n.webkit&&!n.ie,n.webkit&&(-1<e.indexOf("chrome")?n.chrome=!0:n.safari=!0);var i=0;return n.ie&&(i=t?parseFloat(t[1]):n.quirks||!document.documentMode?parseFloat(e.match(/msie (\d+)/)[1]):document.documentMode,n.ie9Compat=9==i,n.ie8Compat=8==i,n.ie7Compat=7==i,n.ie6Compat=i<7||n.quirks),n.gecko&&(t=e.match(/rv:([\d\.]+)/))&&(i=1e4*(t=t[1].split("."))[0]+100*(t[1]||0)+1*(t[2]||0)),n.air&&(i=parseFloat(e.match(/ adobeair\/(\d+)/)[1])),n.webkit&&(i=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),n.version=i,n.isCompatible=!(n.ie&&i<7||n.gecko&&i<4e4||n.webkit&&i<534),n.hidpi=2<=window.devicePixelRatio,n.needsBrFiller=n.gecko||n.webkit||n.ie&&10<i,n.needsNbspFiller=n.ie&&i<11,n.cssClass="cke_browser_"+(n.ie?"ie":n.gecko?"gecko":n.webkit?"webkit":"unknown"),n.quirks&&(n.cssClass+=" cke_browser_quirks"),n.ie&&(n.cssClass+=" cke_browser_ie"+(n.quirks?"6 cke_browser_iequirks":n.version)),n.air&&(n.cssClass+=" cke_browser_air"),n.iOS&&(n.cssClass+=" cke_browser_ios"),n.hidpi&&(n.cssClass+=" cke_hidpi"),n}()),"unloaded"==CKEDITOR.status&&(CKEDITOR.event.implementOn(CKEDITOR),CKEDITOR.loadFullCore=function(){if("basic_ready"!=CKEDITOR.status)CKEDITOR.loadFullCore._load=1;else{delete CKEDITOR.loadFullCore;var e=document.createElement("script");e.type="text/javascript",e.src=CKEDITOR.basePath+"ckeditor.js",document.getElementsByTagName("head")[0].appendChild(e)}},CKEDITOR.loadFullCoreTimeout=0,CKEDITOR.add=function(e){(this._.pending||(this._.pending=[])).push(e)},CKEDITOR.domReady(function(){var e=CKEDITOR.loadFullCore,t=CKEDITOR.loadFullCoreTimeout;e&&(CKEDITOR.status="basic_ready",e&&e._load?e():t&&setTimeout(function(){CKEDITOR.loadFullCore&&CKEDITOR.loadFullCore()},1e3*t))}),CKEDITOR.status="basic_loaded"),CKEDITOR.VERBOSITY_WARN=1,CKEDITOR.VERBOSITY_ERROR=2,CKEDITOR.verbosity=CKEDITOR.VERBOSITY_WARN|CKEDITOR.VERBOSITY_ERROR,CKEDITOR.warn=function(e,t){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_WARN&&CKEDITOR.fire("log",{type:"warn",errorCode:e,additionalData:t})},CKEDITOR.error=function(e,t){CKEDITOR.verbosity&CKEDITOR.VERBOSITY_ERROR&&CKEDITOR.fire("log",{type:"error",errorCode:e,additionalData:t})},CKEDITOR.on("log",function(e){if(window.console&&window.console.log){var t=console[e.data.type]?e.data.type:"log",n=e.data.errorCode;(e=e.data.additionalData)?console[t]("[CKEDITOR] Error code: "+n+".",e):console[t]("[CKEDITOR] Error code: "+n+"."),console[t]("[CKEDITOR] For more information about this error go to http://docs.ckeditor.com/#!/guide/dev_errors-section-"+n)}},null,null,999),CKEDITOR.dom={},u=[],_=CKEDITOR.env.gecko?"-moz-":CKEDITOR.env.webkit?"-webkit-":CKEDITOR.env.ie?"-ms-":"",h=/&/g,p=/>/g,f=/</g,m=/"/g,g=/&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,A={lt:"<",gt:">",amp:"&",quot:'"',nbsp:"\xa0",shy:"\xad"},v=function(e,t){return"#"==t[0]?String.fromCharCode(parseInt(t.slice(1),10)):A[t]},CKEDITOR.on("reset",function(){u=[]}),CKEDITOR.tools={arrayCompare:function(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0},getIndex:function(e,t){for(var n=0;n<e.length;++n)if(t(e[n]))return n;return-1},clone:function(e){var t;if(e&&e instanceof Array){t=[];for(var n=0;n<e.length;n++)t[n]=CKEDITOR.tools.clone(e[n]);return t}if(null===e||"object"!=typeof e||e instanceof String||e instanceof Number||e instanceof Boolean||e instanceof Date||e instanceof RegExp||e.nodeType||e.window===e)return e;for(n in t=new e.constructor,e)t[n]=CKEDITOR.tools.clone(e[n]);return t},capitalize:function(e,t){return e.charAt(0).toUpperCase()+(t?e.slice(1):e.slice(1).toLowerCase())},extend:function(e){var t,n,i=arguments.length;"boolean"==typeof(t=arguments[i-1])?i--:"boolean"==typeof(t=arguments[i-2])&&(n=arguments[i-1],i-=2);for(var a=1;a<i;a++){var s,o=arguments[a];for(s in o)!0!==t&&null!=e[s]||(!n||s in n)&&(e[s]=o[s])}return e},prototypedCopy:function(e){var t=function(){};return t.prototype=e,new t},copy:function(e){var t,n={};for(t in e)n[t]=e[t];return n},isArray:function(e){return"[object Array]"==Object.prototype.toString.call(e)},isEmpty:function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},cssVendorPrefix:function(e,t,n){return n?_+e+":"+t+";"+e+":"+t:((n={})[e]=t,n[_+e]=t,n)},cssStyleToDomStyle:(c=document.createElement("div").style,d="undefined"!=typeof c.cssFloat?"cssFloat":"undefined"!=typeof c.styleFloat?"styleFloat":"float",function(e){return"float"==e?d:e.replace(/-./g,function(e){return e.substr(1).toUpperCase()})}),buildStyleHtml:function(e){e=[].concat(e);for(var t,n=[],i=0;i<e.length;i++)(t=e[i])&&(/@import|[{}]/.test(t)?n.push("<style>"+t+"</style>"):n.push('<link type="text/css" rel=stylesheet href="'+t+'">'));return n.join("")},htmlEncode:function(e){return null==e?"":String(e).replace(h,"&amp;").replace(p,"&gt;").replace(f,"&lt;")},htmlDecode:function(e){return e.replace(g,v)},htmlEncodeAttr:function(e){return CKEDITOR.tools.htmlEncode(e).replace(m,"&quot;")},htmlDecodeAttr:function(e){return CKEDITOR.tools.htmlDecode(e)},transformPlainTextToHtml:function(e,t){var n=t==CKEDITOR.ENTER_BR,i=(i=this.htmlEncode(e.replace(/\r\n/g,"\n"))).replace(/\t/g,"&nbsp;&nbsp; &nbsp;"),a=t==CKEDITOR.ENTER_P?"p":"div";if(!n){var s=/\n{2}/g;if(s.test(i)){var o="<"+a+">",r="</"+a+">";i=o+i.replace(s,function(){return r+o})+r}}return i=i.replace(/\n/g,"<br>"),n||(i=i.replace(new RegExp("<br>(?=</"+a+">)"),function(e){return CKEDITOR.tools.repeat(e,2)})),(i=i.replace(/^ | $/g,"&nbsp;")).replace(/(>|\s) /g,function(e,t){return t+"&nbsp;"}).replace(/ (?=<)/g,"&nbsp;")},getNextNumber:(l=0,function(){return++l}),getNextId:function(){return"cke_"+this.getNextNumber()},getUniqueId:function(){for(var e="e",t=0;t<8;t++)e+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return e},override:function(e,t){var n=t(e);return n.prototype=e.prototype,n},setTimeout:function(e,t,n,i,a){return a||(a=window),n||(n=a),a.setTimeout(function(){i?e.apply(n,[].concat(i)):e.apply(n)},t||0)},trim:(r=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,function(e){return e.replace(r,"")}),ltrim:(o=/^[ \t\n\r]+/g,function(e){return e.replace(o,"")}),rtrim:(s=/[ \t\n\r]+$/g,function(e){return e.replace(s,"")}),indexOf:function(e,t){if("function"==typeof t){for(var n=0,i=e.length;n<i;n++)if(t(e[n]))return n}else{if(e.indexOf)return e.indexOf(t);for(n=0,i=e.length;n<i;n++)if(e[n]===t)return n}return-1},search:function(e,t){var n=CKEDITOR.tools.indexOf(e,t);return 0<=n?e[n]:null},bind:function(e,t){return function(){return e.apply(t,arguments)}},createClass:function(e){var t=e.$,n=e.base,i=e.privates||e._,a=e.proto;if(e=e.statics,!t&&(t=function(){n&&this.base.apply(this,arguments)}),i){var s=t;t=function(){var e,t=this._||(this._={});for(e in i){var n=i[e];t[e]="function"==typeof n?CKEDITOR.tools.bind(n,this):n}s.apply(this,arguments)}}return n&&(t.prototype=this.prototypedCopy(n.prototype),(t.prototype.constructor=t).base=n,t.baseProto=n.prototype,t.prototype.base=function(){this.base=n.prototype.base,n.apply(this,arguments),this.base=arguments.callee}),a&&this.extend(t.prototype,a,!0),e&&this.extend(t,e,!0),t},addFunction:function(e,t){return u.push(function(){return e.apply(t||this,arguments)})-1},removeFunction:function(e){u[e]=null},callFunction:function(e){var t=u[e];return t&&t.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:(a=/^-?\d+\.?\d*px$/,function(e){return i=CKEDITOR.tools.trim(e+"")+"px",a.test(i)?i:e||""}),convertToPx:function(e){return n||(n=CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>',CKEDITOR.document),CKEDITOR.document.getBody().append(n)),/%$/.test(e)?e:(n.setStyle("width",e),n.$.clientWidth)},repeat:function(e,t){return Array(t+1).join(e)},tryThese:function(){for(var e,t=0,n=arguments.length;t<n;t++){var i=arguments[t];try{e=i();break}catch(A){}}return e},genKey:function(){return Array.prototype.slice.call(arguments).join("-")},defer:function(n){return function(){var e=arguments,t=this;window.setTimeout(function(){n.apply(t,e)},0)}},normalizeCssText:function(e,t){var n,i=[],a=CKEDITOR.tools.parseCssText(e,!0,t);for(n in a)i.push(n+":"+a[n]);return i.sort(),i.length?i.join(";")+";":""},convertRgbToHex:function(e){return e.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi,function(e,t,n,i){for(e=[t,n,i],t=0;t<3;t++)e[t]=("0"+parseInt(e[t],10).toString(16)).slice(-2);return"#"+e.join("")})},normalizeHex:function(e){return e.replace(/#(([0-9a-f]{3}){1,2})($|;|\s+)/gi,function(e,t,n,i){return 3==(e=t.toLowerCase()).length&&(e=[(e=e.split(""))[0],e[0],e[1],e[1],e[2],e[2]].join("")),"#"+e+i})},parseCssText:function(e,i,t){var a={};return t&&(e=new CKEDITOR.dom.element("span").setAttribute("style",e).getAttribute("style")||""),e&&(e=CKEDITOR.tools.normalizeHex(CKEDITOR.tools.convertRgbToHex(e))),e&&";"!=e&&e.replace(/&quot;/g,'"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,t,n){i&&("font-family"==(t=t.toLowerCase())&&(n=n.replace(/\s*,\s*/g,",")),n=CKEDITOR.tools.trim(n)),a[t]=n}),a},writeCssText:function(e,t){var n,i=[];for(n in e)i.push(n+":"+e[n]);return t&&i.sort(),i.join("; ")},objectCompare:function(e,t,n){var i;if(!e&&!t)return!0;if(!e||!t)return!1;for(i in e)if(e[i]!=t[i])return!1;if(!n)for(i in t)if(e[i]!=t[i])return!1;return!0},objectKeys:function(e){var t,n=[];for(t in e)n.push(t);return n},convertArrayToObject:function(e,t){var n={};1==arguments.length&&(t=!0);for(var i=0,a=e.length;i<a;++i)n[e[i]]=t;return n},fixDomain:function(){for(var e;;)try{e=window.parent.document.domain;break}catch(h){if(!(e=e?e.replace(/.+?(?:\.|$)/,""):document.domain))break;document.domain=e}return!!e},eventsBuffer:function(t,e,n){function i(){s=(new Date).getTime(),a=!1,n?e.call(n):e()}var a,s=0;return{input:function(){if(!a){var e=(new Date).getTime()-s;e<t?a=setTimeout(i,t-e):i()}},reset:function(){a&&clearTimeout(a),a=s=0}}},enableHtml5Elements:function(e,t){for(var n,i="abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "),a=i.length;a--;)n=e.createElement(i[a]),t&&e.appendChild(n)},checkIfAnyArrayItemMatches:function(e,t){for(var n=0,i=e.length;n<i;++n)if(e[n].match(t))return!0;return!1},checkIfAnyObjectPropertyMatches:function(e,t){for(var n in e)if(n.match(t))return!0;return!1},keystrokeToString:function(e,t){var n=16711680&t,i=65535&t,a=CKEDITOR.env.mac,s=[],o=[];return n&CKEDITOR.CTRL&&(s.push(a?"\u2318":e[17]),o.push(a?e[224]:e[17])),n&CKEDITOR.ALT&&(s.push(a?"\u2325":e[18]),o.push(e[18])),n&CKEDITOR.SHIFT&&(s.push(a?"\u21e7":e[16]),o.push(e[16])),i&&(e[i]?(s.push(e[i]),o.push(e[i])):(s.push(String.fromCharCode(i)),o.push(String.fromCharCode(i)))),{display:s.join("+"),aria:o.join("+")}},transparentImageData:"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==",getCookie:function(e){e=e.toLowerCase();for(var t,n=document.cookie.split(";"),i=0;i<n.length;i++)if(t=n[i].split("="),decodeURIComponent(CKEDITOR.tools.trim(t[0]).toLowerCase())===e)return decodeURIComponent(1<t.length?t[1]:"");return null},setCookie:function(e,t){document.cookie=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/"},getCsrfToken:function(){if(!(e=CKEDITOR.tools.getCookie("ckCsrfToken"))||40!=e.length){var e=[],t="";if(window.crypto&&window.crypto.getRandomValues)e=new Uint8Array(40),window.crypto.getRandomValues(e);else for(var n=0;n<40;n++)e.push(Math.floor(256*Math.random()));for(n=0;n<e.length;n++){var i="abcdefghijklmnopqrstuvwxyz0123456789".charAt(e[n]%36);t+=.5<Math.random()?i.toUpperCase():i}e=t,CKEDITOR.tools.setCookie("ckCsrfToken",e)}return e},escapeCss:function(e){return e?window.CSS&&CSS.escape?CSS.escape(e):isNaN(parseInt(e.charAt(0),10))?e:"\\3"+e.charAt(0)+" "+e.substring(1,e.length):""},style:{parse:{_colors:{aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",green:"#008000",greenyellow:"#ADFF2F",grey:"#808080",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},_rgbaRegExp:/rgba?\(\s*\d+%?\s*,\s*\d+%?\s*,\s*\d+%?\s*(?:,\s*[0-9.]+\s*)?\)/gi,_hslaRegExp:/hsla?\(\s*[0-9.]+\s*,\s*\d+%\s*,\s*\d+%\s*(?:,\s*[0-9.]+\s*)?\)/gi,background:function(t){var e={},n=this._findColor(t);return n.length&&(e.color=n[0],CKEDITOR.tools.array.forEach(n,function(e){t=t.replace(e,"")})),(t=CKEDITOR.tools.trim(t))&&(e.unprocessed=t),e},margin:function(e){function t(e){n.top=i[e[0]],n.right=i[e[1]],n.bottom=i[e[2]],n.left=i[e[3]]}var n={},i=e.match(/(?:\-?[\.\d]+(?:%|\w*)|auto|inherit|initial|unset)/g)||["0px"];switch(i.length){case 1:t([0,0,0,0]);break;case 2:t([0,1,0,1]);break;case 3:t([0,1,2,1]);break;case 4:t([0,1,2,3])}return n},_findColor:function(e){var t=[],n=CKEDITOR.tools.array;return(t=(t=t.concat(e.match(this._rgbaRegExp)||[])).concat(e.match(this._hslaRegExp)||[])).concat(n.filter(e.split(/\s+/),function(e){return!!e.match(/^\#[a-f0-9]{3}(?:[a-f0-9]{3})?$/gi)||e.toLowerCase()in CKEDITOR.tools.style.parse._colors}))}}},array:{filter:function(n,i,a){var s=[];return this.forEach(n,function(e,t){i.call(a,e,t,n)&&s.push(e)}),s},forEach:function(e,t,n){var i,a=e.length;for(i=0;i<a;i++)t.call(n,e[i],i,e)},map:function(e,t,n){for(var i=[],a=0;a<e.length;a++)i.push(t.call(n,e[a],a,e));return i},reduce:function(e,t,n,i){for(var a=0;a<e.length;a++)n=t.call(i,n,e[a],a,e);return n}},object:{findKey:function(e,t){if("object"!=typeof e)return null;for(var n in e)if(e[n]===t)return n;return null}}},CKEDITOR.tools.array.indexOf=CKEDITOR.tools.indexOf,CKEDITOR.tools.array.isArray=CKEDITOR.tools.isArray,CKEDITOR.dtd=(b=CKEDITOR.tools.extend,y=function(e,t){for(var n=CKEDITOR.tools.clone(e),i=1;i<arguments.length;i++)for(var a in t=arguments[i])delete n[a];return n},w={},k={address:1,article:1,aside:1,blockquote:1,details:1,div:1,dl:1,fieldset:1,figure:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,hr:1,main:1,menu:1,nav:1,ol:1,p:1,pre:1,section:1,table:1,ul:1},C={command:1,link:1,meta:1,noscript:1,script:1,style:1},E={},x={center:1,dir:1,noframes:1},b($={},{a:1,abbr:1,area:1,audio:1,b:1,bdi:1,bdo:1,br:1,button:1,canvas:1,cite:1,code:1,command:1,datalist:1,del:1,dfn:1,em:1,embed:1,i:1,iframe:1,img:1,input:1,ins:1,kbd:1,keygen:1,label:1,map:1,mark:1,meter:1,noscript:1,object:1,output:1,progress:1,q:1,ruby:1,s:1,samp:1,script:1,select:1,small:1,span:1,strong:1,sub:1,sup:1,textarea:1,time:1,u:1,"var":1,video:1,wbr:1},T={"#":1},{acronym:1,applet:1,basefont:1,big:1,font:1,isindex:1,strike:1,style:1,tt:1}),b(w,k,$,x),b(y={a:y($,{a:1,button:1}),abbr:$,address:w,area:E,article:w,aside:w,audio:b({source:1,track:1},w),b:$,base:E,bdi:$,bdo:$,blockquote:w,body:w,br:E,button:y($,{a:1,button:1}),canvas:$,caption:w,cite:$,code:$,col:E,colgroup:{col:1},command:E,datalist:b({option:1},$),dd:w,del:$,details:b({summary:1},w),dfn:$,div:w,dl:{dt:1,dd:1},dt:w,em:$,embed:E,fieldset:b({legend:1},w),figcaption:w,figure:b({figcaption:1},w),footer:w,form:w,h1:$,h2:$,h3:$,h4:$,h5:$,h6:$,head:b({title:1,base:1},C),header:w,hgroup:{h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},hr:E,html:b({head:1,body:1},w,C),i:$,iframe:T,img:E,input:E,ins:$,kbd:$,keygen:E,label:$,legend:$,li:w,link:E,main:w,map:w,mark:$,menu:b({li:1},w),meta:E,meter:y($,{meter:1}),nav:w,noscript:b({link:1,meta:1,style:1},$),object:b({param:1},$),ol:{li:1},optgroup:{option:1},option:T,output:$,p:$,param:E,pre:$,progress:y($,{progress:1}),q:$,rp:$,rt:$,ruby:b({rp:1,rt:1},$),s:$,samp:$,script:T,section:w,select:{optgroup:1,option:1},small:$,source:E,span:$,strong:$,style:T,sub:$,summary:b({h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},$),sup:$,table:{caption:1,colgroup:1,thead:1,tfoot:1,tbody:1,tr:1},tbody:{tr:1},td:w,textarea:T,tfoot:{tr:1},th:w,thead:{tr:1},time:y($,{time:1}),title:T,tr:{th:1,td:1},track:E,u:$,ul:{li:1},"var":$,video:b({source:1,track:1},w),wbr:E,acronym:$,applet:b({param:1},w),basefont:E,big:$,center:w,dialog:E,dir:{li:1},font:$,isindex:E,noframes:w,strike:$,tt:$},{$block:b({audio:1,dd:1,dt:1,figcaption:1,li:1,video:1},k,x),$blockLimit:{article:1,aside:1,audio:1,body:1,caption:1,details:1,dir:1,div:1,dl:1,fieldset:1,figcaption:1,figure:1,footer:1,form:1,header:1,hgroup:1,main:1,menu:1,nav:1,ol:1,section:1,table:1,td:1,th:1,tr:1,ul:1,video:1},$cdata:{script:1,style:1},$editable:{address:1,article:1,aside:1,blockquote:1,body:1,details:1,div:1,fieldset:1,figcaption:1,footer:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,header:1,hgroup:1,main:1,nav:1,p:1,pre:1,section:1},$empty:{area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},$inline:$,$list:{dl:1,ol:1,ul:1},$listItem:{dd:1,dt:1,li:1},$nonBodyContent:b({body:1,head:1,html:1},y.head),$nonEditable:{applet:1,audio:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,param:1,script:1,textarea:1,video:1},$object:{applet:1,audio:1,button:1,hr:1,iframe:1,img:1,input:1,object:1,select:1,table:1,textarea:1,video:1},$removeEmpty:{abbr:1,acronym:1,b:1,bdi:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,mark:1,meter:1,output:1,q:1,ruby:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},$transparent:{a:1,audio:1,canvas:1,del:1,ins:1,map:1,noscript:1,object:1,video:1},$intermediate:{caption:1,colgroup:1,dd:1,dt:1,figcaption:1,legend:1,li:1,optgroup:1,option:1,rp:1,rt:1,summary:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1}}),y),CKEDITOR.dom.event=function(e){this.$=e},CKEDITOR.dom.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var e=this.getKey();return(this.$.ctrlKey||this.$.metaKey)&&(e+=CKEDITOR.CTRL),this.$.shiftKey&&(e+=CKEDITOR.SHIFT),this.$.altKey&&(e+=CKEDITOR.ALT),e},preventDefault:function(e){var t=this.$;t.preventDefault?t.preventDefault():t.returnValue=!1,e&&this.stopPropagation()},stopPropagation:function(){var e=this.$;e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},getTarget:function(){var e=this.$.target||this.$.srcElement;return e?new CKEDITOR.dom.node(e):null},getPhase:function(){return this.$.eventPhase||2},getPageOffset:function(){var e=this.getTarget().getDocument().$;return{x:this.$.pageX||this.$.clientX+(e.documentElement.scrollLeft||e.body.scrollLeft),y:this.$.pageY||this.$.clientY+(e.documentElement.scrollTop||e.body.scrollTop)}}},CKEDITOR.CTRL=1114112,CKEDITOR.SHIFT=2228224,CKEDITOR.ALT=4456448,CKEDITOR.EVENT_PHASE_CAPTURING=1,CKEDITOR.EVENT_PHASE_AT_TARGET=2,CKEDITOR.EVENT_PHASE_BUBBLING=3,CKEDITOR.dom.domObject=function(e){e&&(this.$=e)},CKEDITOR.dom.domObject.prototype=(I=function(t,n){return function(e){"undefined"!=typeof CKEDITOR&&t.fire(n,new CKEDITOR.dom.event(e))}},{getPrivate:function(){var e;return(e=this.getCustomData("_"))||this.setCustomData("_",e={}),e},on:function(e){var t=this.getCustomData("_cke_nativeListeners");return t||(t={},this.setCustomData("_cke_nativeListeners",t)),t[e]||(t=t[e]=I(this,e),this.$.addEventListener?this.$.addEventListener(e,t,!!CKEDITOR.event.useCapture):this.$.attachEvent&&this.$.attachEvent("on"+e,t)),CKEDITOR.event.prototype.on.apply(this,arguments)},removeListener:function(e){if(CKEDITOR.event.prototype.removeListener.apply(this,arguments),!this.hasListeners(e)){var t=this.getCustomData("_cke_nativeListeners"),n=t&&t[e];n&&(this.$.removeEventListener?this.$.removeEventListener(e,n,!1):this.$.detachEvent&&this.$.detachEvent("on"+e,n),delete t[e])}},removeAllListeners:function(){var e,t=this.getCustomData("_cke_nativeListeners");for(e in t){var n=t[e];this.$.detachEvent?this.$.detachEvent("on"+e,n):this.$.removeEventListener&&this.$.removeEventListener(e,n,!1),delete t[e]}CKEDITOR.event.prototype.removeAllListeners.call(this)}}),D=CKEDITOR.dom.domObject.prototype,O={},CKEDITOR.on("reset",function(){O={}}),D.equals=function(e){try{return e&&e.$===this.$}catch(t){return!1}},D.setCustomData=function(e,t){var n=this.getUniqueId();return(O[n]||(O[n]={}))[e]=t,this},D.getCustomData=function(e){var t=this.$["data-cke-expando"];return(t=t&&O[t])&&e in t?t[e]:null},D.removeCustomData=function(e){var t,n,i;return(t=(t=this.$["data-cke-expando"])&&O[t])&&(n=t[e],i=e in t,delete t[e]),i?n:null},D.clearCustomData=function(){this.removeAllListeners();var e=this.$["data-cke-expando"];e&&delete O[e]},D.getUniqueId=function(){return this.$["data-cke-expando"]||(this.$["data-cke-expando"]=CKEDITOR.tools.getNextNumber())},CKEDITOR.event.implementOn(D),CKEDITOR.dom.node=function(e){return e?new CKEDITOR.dom[e.nodeType==CKEDITOR.NODE_DOCUMENT?"document":e.nodeType==CKEDITOR.NODE_ELEMENT?"element":e.nodeType==CKEDITOR.NODE_TEXT?"text":e.nodeType==CKEDITOR.NODE_COMMENT?"comment":e.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT?"documentFragment":"domObject"](e):this},CKEDITOR.dom.node.prototype=new CKEDITOR.dom.domObject,CKEDITOR.NODE_ELEMENT=1,CKEDITOR.NODE_DOCUMENT=9,CKEDITOR.NODE_TEXT=3,CKEDITOR.NODE_COMMENT=8,CKEDITOR.NODE_DOCUMENT_FRAGMENT=11,CKEDITOR.POSITION_IDENTICAL=0,CKEDITOR.POSITION_DISCONNECTED=1,CKEDITOR.POSITION_FOLLOWING=2,CKEDITOR.POSITION_PRECEDING=4,CKEDITOR.POSITION_IS_CONTAINED=8,CKEDITOR.POSITION_CONTAINS=16,CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype,{appendTo:function(e,t){return e.append(this,t),e},clone:function(n,i){function a(e){if(e["data-cke-expando"]&&(e["data-cke-expando"]=!1),(e.nodeType==CKEDITOR.NODE_ELEMENT||e.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&(i||e.nodeType!=CKEDITOR.NODE_ELEMENT||e.removeAttribute("id",!1),n)){e=e.childNodes;for(var t=0;t<e.length;t++)a(e[t])}}function s(e){if(e.type==CKEDITOR.NODE_ELEMENT||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var t=e.getName();":"==t[0]&&e.renameNode(t.substring(1))}if(n)for(t=0;t<e.getChildCount();t++)s(e.getChild(t))}}var e=this.$.cloneNode(n);return a(e),e=new CKEDITOR.dom.node(e),CKEDITOR.env.ie&&CKEDITOR.env.version<9&&(this.type==CKEDITOR.NODE_ELEMENT||this.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&s(e),e},hasPrevious:function(){return!!this.$.previousSibling},hasNext:function(){return!!this.$.nextSibling},insertAfter:function(e){return e.$.parentNode.insertBefore(this.$,e.$.nextSibling),e},insertBefore:function(e){return e.$.parentNode.insertBefore(this.$,e.$),e},insertBeforeMe:function(e){return this.$.parentNode.insertBefore(e.$,this.$),e},getAddress:function(e){for(var t=[],n=this.getDocument().$.documentElement,i=this.$;i&&i!=n;){var a=i.parentNode;a&&t.unshift(this.getIndex.call({$:i},e)),i=a}return t},getDocument:function(){return new CKEDITOR.dom.document(this.$.ownerDocument||this.$.parentNode.ownerDocument)},getIndex:function(e){function i(e,t){var n=t?e.nextSibling:e.previousSibling;return n&&n.nodeType==CKEDITOR.NODE_TEXT?a(n)?i(n,t):n:null}function a(e){return!e.nodeValue||e.nodeValue==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE}var t,n=this.$,s=-1;if(!this.$.parentNode||e&&n.nodeType==CKEDITOR.NODE_TEXT&&a(n)&&!i(n)&&!i(n,!0))return-1;for(;e&&n!=this.$&&n.nodeType==CKEDITOR.NODE_TEXT&&(t||a(n))||(s++,t=n.nodeType==CKEDITOR.NODE_TEXT),n=n.previousSibling;);return s},getNextSourceNode:function(e,t,n){if(n&&!n.call){var i=n;n=function(e){return!e.equals(i)}}var a;if(!(e=!e&&this.getFirst&&this.getFirst())){if(this.type==CKEDITOR.NODE_ELEMENT&&n&&!1===n(this,!0))return null;e=this.getNext()}for(;!e&&(a=(a||this).getParent());){if(n&&!1===n(a,!0))return null;e=a.getNext()}return!e||n&&!1===n(e)?null:t&&t!=e.type?e.getNextSourceNode(!1,t,n):e},getPreviousSourceNode:function(e,t,n){if(n&&!n.call){var i=n;n=function(e){return!e.equals(i)}}var a;if(!(e=!e&&this.getLast&&this.getLast())){if(this.type==CKEDITOR.NODE_ELEMENT&&n&&!1===n(this,!0))return null;e=this.getPrevious()}for(;!e&&(a=(a||this).getParent());){if(n&&!1===n(a,!0))return null;e=a.getPrevious()}return!e||n&&!1===n(e)?null:t&&e.type!=t?e.getPreviousSourceNode(!1,t,n):e},getPrevious:function(e){for(var t,n=this.$;(t=(n=n.previousSibling)&&10!=n.nodeType&&new CKEDITOR.dom.node(n))&&e&&!e(t););return t},getNext:function(e){for(var t,n=this.$;(t=(n=n.nextSibling)&&new CKEDITOR.dom.node(n))&&e&&!e(t););return t},getParent:function(e){var t=this.$.parentNode;return t&&(t.nodeType==CKEDITOR.NODE_ELEMENT||e&&t.nodeType==CKEDITOR.NODE_DOCUMENT_FRAGMENT)?new CKEDITOR.dom.node(t):null},getParents:function(e){for(var t=this,n=[];n[e?"push":"unshift"](t),t=t.getParent(););return n},getCommonAncestor:function(e){if(e.equals(this))return this;if(e.contains&&e.contains(this))return e;var t=this.contains?this:this.getParent();do{if(t.contains(e))return t}while(t=t.getParent());return null},getPosition:function(e){var t=this.$,n=e.$;if(t.compareDocumentPosition)return t.compareDocumentPosition(n);if(t==n)return CKEDITOR.POSITION_IDENTICAL;if(this.type==CKEDITOR.NODE_ELEMENT&&e.type==CKEDITOR.NODE_ELEMENT){if(t.contains){if(t.contains(n))return CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING;if(n.contains(t))return CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING}if("sourceIndex"in t)return t.sourceIndex<0||n.sourceIndex<0?CKEDITOR.POSITION_DISCONNECTED:t.sourceIndex<n.sourceIndex?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING}t=this.getAddress(),e=e.getAddress();n=Math.min(t.length,e.length);for(var i=0;i<n;i++)if(t[i]!=e[i])return t[i]<e[i]?CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_FOLLOWING;return t.length<e.length?CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_PRECEDING:CKEDITOR.POSITION_IS_CONTAINED+CKEDITOR.POSITION_FOLLOWING},getAscendant:function(t,e){var n,i,a=this.$;for(e||(a=a.parentNode),"function"==typeof t?(i=!0,n=t):(i=!1,n=function(e){return e="string"==typeof e.nodeName?e.nodeName.toLowerCase():"","string"==typeof t?e==t:e in t});a;){if(n(i?new CKEDITOR.dom.node(a):a))return new CKEDITOR.dom.node(a);try{a=a.parentNode}catch(s){a=null}}return null},hasAscendant:function(e,t){var n=this.$;for(t||(n=n.parentNode);n;){if(n.nodeName&&n.nodeName.toLowerCase()==e)return!0;n=n.parentNode}return!1},move:function(e,t){e.append(this.remove(),t)},remove:function(e){var t=this.$,n=t.parentNode;if(n){if(e)for(;e=t.firstChild;)n.insertBefore(t.removeChild(e),t);n.removeChild(t)}return this},replace:function(e){this.insertBefore(e),e.remove()},trim:function(){this.ltrim(),this.rtrim()},ltrim:function(){for(var e;this.getFirst&&(e=this.getFirst());){if(e.type==CKEDITOR.NODE_TEXT){var t=CKEDITOR.tools.ltrim(e.getText()),n=e.getLength();if(!t){e.remove();continue}t.length<n&&(e.split(n-t.length),this.$.removeChild(this.$.firstChild))}break}},rtrim:function(){for(var e;this.getLast&&(e=this.getLast());){if(e.type==CKEDITOR.NODE_TEXT){var t=CKEDITOR.tools.rtrim(e.getText()),n=e.getLength();if(!t){e.remove();continue}t.length<n&&(e.split(t.length),this.$.lastChild.parentNode.removeChild(this.$.lastChild))}break}CKEDITOR.env.needsBrFiller&&(e=this.$.lastChild)&&1==e.type&&"br"==e.nodeName.toLowerCase()&&e.parentNode.removeChild(e)},isReadOnly:function(e){var t=this;if(this.type!=CKEDITOR.NODE_ELEMENT&&(t=this.getParent()),CKEDITOR.env.edge&&t&&t.is("textarea","input")&&(e=!0),!e&&t&&"undefined"!=typeof t.$.isContentEditable)return!(t.$.isContentEditable||t.data("cke-editable"));for(;t;){if(t.data("cke-editable"))return!1;if(t.hasAttribute("contenteditable"))return"false"==t.getAttribute("contenteditable");t=t.getParent()}return!0}}),CKEDITOR.dom.window=function(e){CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.window.prototype=new CKEDITOR.dom.domObject,
CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype,{focus:function(){this.$.focus()},getViewPaneSize:function(){var e=this.$.document,t="CSS1Compat"==e.compatMode;return{width:(t?e.documentElement.clientWidth:e.body.clientWidth)||0,height:(t?e.documentElement.clientHeight:e.body.clientHeight)||0}},getScrollPosition:function(){var e=this.$;return"pageXOffset"in e?{x:e.pageXOffset||0,y:e.pageYOffset||0}:{x:(e=e.document).documentElement.scrollLeft||e.body.scrollLeft||0,y:e.documentElement.scrollTop||e.body.scrollTop||0}},getFrame:function(){var e=this.$.frameElement;return e?new CKEDITOR.dom.element.get(e):null}}),CKEDITOR.dom.document=function(e){CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.document.prototype=new CKEDITOR.dom.domObject,CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype,{type:CKEDITOR.NODE_DOCUMENT,appendStyleSheet:function(e){if(this.$.createStyleSheet)this.$.createStyleSheet(e);else{var t=new CKEDITOR.dom.element("link");t.setAttributes({rel:"stylesheet",type:"text/css",href:e}),this.getHead().append(t)}},appendStyleText:function(e){if(this.$.createStyleSheet){var t=this.$.createStyleSheet("");t.cssText=e}else{var n=new CKEDITOR.dom.element("style",this);n.append(new CKEDITOR.dom.text(e,this)),this.getHead().append(n)}return t||n.$.sheet},createElement:function(e,t){var n=new CKEDITOR.dom.element(e,this);return t&&(t.attributes&&n.setAttributes(t.attributes),t.styles&&n.setStyles(t.styles)),n},createText:function(e){return new CKEDITOR.dom.text(e,this)},focus:function(){this.getWindow().focus()},getActive:function(){var e;try{e=this.$.activeElement}catch(t){return null}return new CKEDITOR.dom.element(e)},getById:function(e){return(e=this.$.getElementById(e))?new CKEDITOR.dom.element(e):null},getByAddress:function(e,t){for(var n=this.$.documentElement,i=0;n&&i<e.length;i++){var a=e[i];if(t)for(var s=-1,o=0;o<n.childNodes.length;o++){var r=n.childNodes[o];if((!0!==t||3!=r.nodeType||!r.previousSibling||3!=r.previousSibling.nodeType)&&++s==a){n=r;break}}else n=n.childNodes[a]}return n?new CKEDITOR.dom.node(n):null},getElementsByTag:function(e,t){return CKEDITOR.env.ie&&document.documentMode<=8||!t||(e=t+":"+e),new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(e))},getHead:function(){var e=this.$.getElementsByTagName("head")[0];return e?new CKEDITOR.dom.element(e):this.getDocumentElement().append(new CKEDITOR.dom.element("head"),!0)},getBody:function(){return new CKEDITOR.dom.element(this.$.body)},getDocumentElement:function(){return new CKEDITOR.dom.element(this.$.documentElement)},getWindow:function(){return new CKEDITOR.dom.window(this.$.parentWindow||this.$.defaultView)},write:function(e){this.$.open("text/html","replace"),CKEDITOR.env.ie&&(e=e.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i,'$&\n<script data-cke-temp="1">('+CKEDITOR.tools.fixDomain+")();</script>")),this.$.write(e),this.$.close()},find:function(e){return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(e))},findOne:function(e){return(e=this.$.querySelector(e))?new CKEDITOR.dom.element(e):null},_getHtml5ShivFrag:function(){var e=this.getCustomData("html5ShivFrag");return e||(e=this.$.createDocumentFragment(),CKEDITOR.tools.enableHtml5Elements(e,!0),this.setCustomData("html5ShivFrag",e)),e}}),CKEDITOR.dom.nodeList=function(e){this.$=e},CKEDITOR.dom.nodeList.prototype={count:function(){return this.$.length},getItem:function(e){return e<0||e>=this.$.length?null:(e=this.$[e])?new CKEDITOR.dom.node(e):null}},CKEDITOR.dom.element=function(e,t){"string"==typeof e&&(e=(t?t.$:document).createElement(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.element.get=function(e){return(e="string"==typeof e?document.getElementById(e)||document.getElementsByName(e)[0]:e)&&(e.$?e:new CKEDITOR.dom.element(e))},CKEDITOR.dom.element.prototype=new CKEDITOR.dom.node,CKEDITOR.dom.element.createFromHtml=function(e,t){var n=new CKEDITOR.dom.element("div",t);return n.setHtml(e),n.getFirst().remove()},CKEDITOR.dom.element.setMarker=function(e,t,n,i){var a=t.getCustomData("list_marker_id")||t.setCustomData("list_marker_id",CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),s=t.getCustomData("list_marker_names")||t.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");return e[a]=t,s[n]=1,t.setCustomData(n,i)},CKEDITOR.dom.element.clearAllMarkers=function(e){for(var t in e)CKEDITOR.dom.element.clearMarkers(e,e[t],1)},CKEDITOR.dom.element.clearMarkers=function(e,t,n){var i,a=t.getCustomData("list_marker_names"),s=t.getCustomData("list_marker_id");for(i in a)t.removeCustomData(i);t.removeCustomData("list_marker_names"),n&&(t.removeCustomData("list_marker_id"),delete e[s])},function(){function n(e,t){return-1<(" "+e+" ").replace(c," ").indexOf(" "+t+" ")}function a(e){var t=!0;return e.$.id||(e.$.id="cke_tmp_"+CKEDITOR.tools.getNextNumber(),t=!1),function(){t||e.removeAttribute("id")}}function i(e,t){var n=CKEDITOR.tools.escapeCss(e.$.id);return"#"+n+" "+t.split(/,\s*/).join(", #"+n+" ")}function s(e){for(var t=0,n=0,i=d[e].length;n<i;n++)t+=parseFloat(this.getComputedStyle(d[e][n])||0,10)||0;return t}var e,o,t,r,l=void 0!==(l=document.createElement("_").classList)&&null!==String(l.add).match(/\[Native code\]/gi),c=/[\n\t\r]/g;CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_ELEMENT,addClass:l?function(e){return this.$.classList.add(e),this}:function(e){var t=this.$.className;return t&&(n(t,e)||(t+=" "+e)),this.$.className=t||e,this},removeClass:l?function(e){var t=this.$;return t.classList.remove(e),t.className||t.removeAttribute("class"),this}:function(e){var t=this.getAttribute("class");return t&&n(t,e)&&((t=t.replace(new RegExp("(?:^|\\s+)"+e+"(?=\\s|$)"),"").replace(/^\s+/,""))?this.setAttribute("class",t):this.removeAttribute("class")),this},hasClass:function(e){return n(this.$.className,e)},append:function(e,t){return"string"==typeof e&&(e=this.getDocument().createElement(e)),t?this.$.insertBefore(e.$,this.$.firstChild):this.$.appendChild(e.$),e},appendHtml:function(e){if(this.$.childNodes.length){var t=new CKEDITOR.dom.element("div",this.getDocument());t.setHtml(e),t.moveChildren(this)}else this.setHtml(e)},appendText:function(e){null!=this.$.text&&CKEDITOR.env.ie&&CKEDITOR.env.version<9?this.$.text+=e:this.append(new CKEDITOR.dom.text(e))},appendBogus:function(e){if(e||CKEDITOR.env.needsBrFiller){for(e=this.getLast();e&&e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.rtrim(e.getText());)e=e.getPrevious();e&&e.is&&e.is("br")||(e=this.getDocument().createElement("br"),CKEDITOR.env.gecko&&e.setAttribute("type","_moz"),this.append(e))}},breakParent:function(e,t){var n=new CKEDITOR.dom.range(this.getDocument());n.setStartAfter(this),n.setEndAfter(e);var i,a=n.extractContents(!1,t||!1);if(n.insertNode(this.remove()),CKEDITOR.env.ie&&!CKEDITOR.env.edge){for(n=new CKEDITOR.dom.element("div");i=a.getFirst();)i.$.style.backgroundColor&&(i.$.style.backgroundColor=i.$.style.backgroundColor),n.append(i);n.insertAfter(this),n.remove(!0)}else a.insertAfterNode(this)},contains:document.compareDocumentPosition?function(e){return!!(16&this.$.compareDocumentPosition(e.$))}:function(e){var t=this.$;return e.type!=CKEDITOR.NODE_ELEMENT?t.contains(e.getParent().$):t!=e.$&&t.contains(e.$)},focus:function(){function t(){try{this.$.focus()}catch(i){}}return function(e){e?CKEDITOR.tools.setTimeout(t,100,this):t.call(this)}}(),getHtml:function(){var e=this.$.innerHTML;return CKEDITOR.env.ie?e.replace(/<\?[^>]*>/g,""):e},getOuterHtml:function(){if(this.$.outerHTML)return this.$.outerHTML.replace(/<\?[^>]*>/,"");var e=this.$.ownerDocument.createElement("div");return e.appendChild(this.$.cloneNode(!0)),e.innerHTML},getClientRect:function(){var e=CKEDITOR.tools.extend({},this.$.getBoundingClientRect());return!e.width&&(e.width=e.right-e.left),!e.height&&(e.height=e.bottom-e.top),e},setHtml:CKEDITOR.env.ie&&CKEDITOR.env.version<9?function(e){try{var t=this.$;if(this.getParent())return t.innerHTML=e;var n=this.getDocument()._getHtml5ShivFrag();return n.appendChild(t),t.innerHTML=e,n.removeChild(t),e}catch(i){for(this.$.innerHTML="",(t=new CKEDITOR.dom.element("body",this.getDocument())).$.innerHTML=e,t=t.getChildren();t.count();)this.append(t.getItem(0));return e}}:function(e){return this.$.innerHTML=e},setText:(r=document.createElement("p"),r.innerHTML="x",r=r.textContent,function(e){this.$[r?"textContent":"innerText"]=e}),getAttribute:(t=function(e){return this.$.getAttribute(e,2)},CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(e){switch(e){case"class":e="className";break;case"http-equiv":e="httpEquiv";break;case"name":return this.$.name;case"tabindex":return 0!==(e=this.$.getAttribute(e,2))&&0===this.$.tabIndex&&(e=null),e;case"checked":return((e=this.$.attributes.getNamedItem(e)).specified?e.nodeValue:this.$.checked)?"checked":null;case"hspace":case"value":return this.$[e];case"style":return this.$.style.cssText;case"contenteditable":case"contentEditable":return this.$.attributes.getNamedItem("contentEditable").specified?this.$.getAttribute("contentEditable"):null}return this.$.getAttribute(e,2)}:t),getAttributes:function(e){var t,n={},i=this.$.attributes;for(e=CKEDITOR.tools.isArray(e)?e:[],t=0;t<i.length;t++)-1===CKEDITOR.tools.indexOf(e,i[t].name)&&(n[i[t].name]=i[t].value);return n},getChildren:function(){return new CKEDITOR.dom.nodeList(this.$.childNodes)},getComputedStyle:document.defaultView&&document.defaultView.getComputedStyle?function(e){var t=this.getWindow().$.getComputedStyle(this.$,null);return t?t.getPropertyValue(e):""}:function(e){return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(e)]},getDtd:function(){var e=CKEDITOR.dtd[this.getName()];return this.getDtd=function(){return e},e},getElementsByTag:CKEDITOR.dom.document.prototype.getElementsByTag,getTabIndex:function(){var e=this.$.tabIndex;return 0!==e||CKEDITOR.dtd.$tabIndex[this.getName()]||0===parseInt(this.getAttribute("tabindex"),10)?e:-1},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var e=this.$.nodeName.toLowerCase();if(CKEDITOR.env.ie&&document.documentMode<=8){var t=this.$.scopeName;"HTML"!=t&&(e=t.toLowerCase()+":"+e)}return this.getName=function(){return e},this.getName()},getValue:function(){return this.$.value},getFirst:function(e){var t=this.$.firstChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getNext(e)),t},getLast:function(e){var t=this.$.lastChild;return(t=t&&new CKEDITOR.dom.node(t))&&e&&!e(t)&&(t=t.getPrevious(e)),t},getStyle:function(e){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(e)]},is:function(e){var t=this.getName();if("object"==typeof e)return!!e[t];for(var n=0;n<arguments.length;n++)if(arguments[n]==t)return!0;return!1},isEditable:function(e){var t=this.getName();return!(this.isReadOnly()||"none"==this.getComputedStyle("display")||"hidden"==this.getComputedStyle("visibility")||CKEDITOR.dtd.$nonEditable[t]||CKEDITOR.dtd.$empty[t]||this.is("a")&&(this.data("cke-saved-name")||this.hasAttribute("name"))&&!this.getChildCount())&&(!1===e||!(!(e=CKEDITOR.dtd[t]||CKEDITOR.dtd.span)||!e["#"]))},isIdentical:function(e){var t=this.clone(0,1);if(e=e.clone(0,1),t.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]),e.removeAttributes(["_moz_dirty","data-cke-expando","data-cke-saved-href","data-cke-saved-name"]),t.$.isEqualNode)return t.$.style.cssText=CKEDITOR.tools.normalizeCssText(t.$.style.cssText),e.$.style.cssText=CKEDITOR.tools.normalizeCssText(e.$.style.cssText),t.$.isEqualNode(e.$);if(t=t.getOuterHtml(),e=e.getOuterHtml(),CKEDITOR.env.ie&&CKEDITOR.env.version<9&&this.is("a")){var n=this.getParent();n.type==CKEDITOR.NODE_ELEMENT&&((n=n.clone()).setHtml(t),t=n.getHtml(),n.setHtml(e),e=n.getHtml())}return t==e},isVisible:function(){var e,t,n=(this.$.offsetHeight||this.$.offsetWidth)&&"hidden"!=this.getComputedStyle("visibility");return n&&CKEDITOR.env.webkit&&(!(e=this.getWindow()).equals(CKEDITOR.document.getWindow())&&(t=e.$.frameElement)&&(n=new CKEDITOR.dom.element(t).isVisible())),!!n},isEmptyInlineRemoveable:function(){if(!CKEDITOR.dtd.$removeEmpty[this.getName()])return!1;for(var e=this.getChildren(),t=0,n=e.count();t<n;t++){var i=e.getItem(t);if((i.type!=CKEDITOR.NODE_ELEMENT||!i.data("cke-bookmark"))&&(i.type==CKEDITOR.NODE_ELEMENT&&!i.isEmptyInlineRemoveable()||i.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(i.getText())))return!1}return!0},hasAttributes:CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(){for(var e=this.$.attributes,t=0;t<e.length;t++){var n=e[t];switch(n.nodeName){case"class":if(this.getAttribute("class"))return!0;case"data-cke-expando":continue;default:if(n.specified)return!0}}return!1}:function(){var e=this.$.attributes,t=e.length,n={"data-cke-expando":1,_moz_dirty:1};return 0<t&&(2<t||!n[e[0].nodeName]||2==t&&!n[e[1].nodeName])},hasAttribute:function(){function t(e){var t=this.$.attributes.getNamedItem(e);if("input"==this.getName())switch(e){case"class":return 0<this.$.className.length;case"checked":return!!this.$.checked;case"value":return"checkbox"==(e=this.getAttribute("type"))||"radio"==e?"on"!=this.$.value:!!this.$.value}return!!t&&t.specified}return CKEDITOR.env.ie?CKEDITOR.env.version<8?function(e){return"name"==e?!!this.$.name:t.call(this,e)}:t:function(e){return!!this.$.attributes.getNamedItem(e)}}(),hide:function(){this.setStyle("display","none")},moveChildren:function(e,t){var n,i=this.$;if(i!=(e=e.$))if(t)for(;n=i.lastChild;)e.insertBefore(i.removeChild(n),e.firstChild);else for(;n=i.firstChild;)e.appendChild(i.removeChild(n))},mergeSiblings:function(){function t(e,t,n){if(t&&t.type==CKEDITOR.NODE_ELEMENT){for(var i=[];t.data("cke-bookmark")||t.isEmptyInlineRemoveable();)if(i.push(t),!(t=n?t.getNext():t.getPrevious())||t.type!=CKEDITOR.NODE_ELEMENT)return;if(e.isIdentical(t)){for(var a=n?e.getLast():e.getFirst();i.length;)i.shift().move(e,!n);t.moveChildren(e,!n),t.remove(),a&&a.type==CKEDITOR.NODE_ELEMENT&&a.mergeSiblings()}}}return function(e){(!1===e||CKEDITOR.dtd.$removeEmpty[this.getName()]||this.is("a"))&&(t(this,this.getNext(),!0),t(this,this.getPrevious()))}}(),show:function(){this.setStyles({display:"",visibility:""})},setAttribute:(o=function(e,t){return this.$.setAttribute(e,t),this},CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(e,t){return"class"==e?this.$.className=t:"style"==e?this.$.style.cssText=t:"tabindex"==e?this.$.tabIndex=t:"checked"==e?this.$.checked=t:"contenteditable"==e?o.call(this,"contentEditable",t):o.apply(this,arguments),this}:CKEDITOR.env.ie8Compat&&CKEDITOR.env.secure?function(e,t){if("src"==e&&t.match(/^http:\/\//))try{o.apply(this,arguments)}catch(n){}else o.apply(this,arguments);return this}:o),setAttributes:function(e){for(var t in e)this.setAttribute(t,e[t]);return this},setValue:function(e){return this.$.value=e,this},removeAttribute:(e=function(e){this.$.removeAttribute(e)},CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)?function(e){"class"==e?e="className":"tabindex"==e?e="tabIndex":"contenteditable"==e&&(e="contentEditable"),this.$.removeAttribute(e)}:e),removeAttributes:function(e){if(CKEDITOR.tools.isArray(e))for(var t=0;t<e.length;t++)this.removeAttribute(e[t]);else for(t in e=e||this.getAttributes())e.hasOwnProperty(t)&&this.removeAttribute(t)},removeStyle:function(e){if((i=this.$.style).removeProperty||"border"!=e&&"margin"!=e&&"padding"!=e)i.removeProperty?i.removeProperty(e):i.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(e)),this.$.style.cssText||this.removeAttribute("style");else{var t,n=["top","left","right","bottom"];"border"==e&&(t=["color","style","width"]);for(var i=[],a=0;a<n.length;a++)if(t)for(var s=0;s<t.length;s++)i.push([e,n[a],t[s]].join("-"));else i.push([e,n[a]].join("-"));for(e=0;e<i.length;e++)this.removeStyle(i[e])}},setStyle:function(e,t){return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(e)]=t,this},setStyles:function(e){for(var t in e)this.setStyle(t,e[t]);return this},setOpacity:function(e){CKEDITOR.env.ie&&CKEDITOR.env.version<9?(e=Math.round(100*e),this.setStyle("filter",100<=e?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+e+")")):this.setStyle("opacity",e)},unselectable:function(){if(this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","none")),CKEDITOR.env.ie){this.setAttribute("unselectable","on");for(var e=this.getElementsByTag("*"),t=0,n=e.count();t<n;t++)e.getItem(t).setAttribute("unselectable","on")}},getPositionedAncestor:function(){for(var e=this;"html"!=e.getName();){if("static"!=e.getComputedStyle("position"))return e;e=e.getParent()}return null},getDocumentPosition:function(e){var t=0,n=0,i=this.getDocument(),a=i.getBody(),s="BackCompat"==i.$.compatMode;if(!document.documentElement.getBoundingClientRect||CKEDITOR.env.ie&&8===CKEDITOR.env.version)for(l=this,c=null;l&&"body"!=l.getName()&&"html"!=l.getName();){for(t+=l.$.offsetLeft-l.$.scrollLeft,n+=l.$.offsetTop-l.$.scrollTop,l.equals(this)||(t+=l.$.clientLeft||0,n+=l.$.clientTop||0);c&&!c.equals(l);)t-=c.$.scrollLeft,n-=c.$.scrollTop,c=c.getParent();l=(o=(c=l).$.offsetParent)?new CKEDITOR.dom.element(o):null}else{var o=this.$.getBoundingClientRect(),r=i.$.documentElement,l=r.clientTop||a.$.clientTop||0,c=r.clientLeft||a.$.clientLeft||0,d=!0;CKEDITOR.env.ie&&(d=i.getDocumentElement().contains(this),i=i.getBody().contains(this),d=s&&i||!s&&d),d&&(CKEDITOR.env.webkit||CKEDITOR.env.ie&&12<=CKEDITOR.env.version?(t=a.$.scrollLeft||r.scrollLeft,n=a.$.scrollTop||r.scrollTop):(t=(n=s?a.$:r).scrollLeft,n=n.scrollTop),t=o.left+t-c,n=o.top+n-l)}return e&&(o=this.getWindow(),l=e.getWindow(),!o.equals(l)&&o.$.frameElement&&(t+=(e=new CKEDITOR.dom.element(o.$.frameElement).getDocumentPosition(e)).x,n+=e.y)),document.documentElement.getBoundingClientRect||!CKEDITOR.env.gecko||s||(t+=this.$.clientLeft?1:0,n+=this.$.clientTop?1:0),{x:t,y:n}},scrollIntoView:function(e){var t=this.getParent();if(t)do{if((t.$.clientWidth&&t.$.clientWidth<t.$.scrollWidth||t.$.clientHeight&&t.$.clientHeight<t.$.scrollHeight)&&!t.is("body")&&this.scrollIntoParent(t,e,1),t.is("html")){var n=t.getWindow();try{var i=n.$.frameElement;i&&(t=new CKEDITOR.dom.element(i))}catch(a){}}}while(t=t.getParent())},scrollIntoParent:function(n,e,t){function i(e,t){/body|html/.test(n.getName())?n.getWindow().$.scrollBy(e,t):(n.$.scrollLeft+=e,n.$.scrollTop+=t)}function a(e,t){var n={x:0,y:0};if(!e.is(d?"body":"html")){var i=e.$.getBoundingClientRect();n.x=i.left,n.y=i.top}return(i=e.getWindow()).equals(t)||(i=a(CKEDITOR.dom.element.get(i.$.frameElement),t),n.x+=i.x,n.y+=i.y),n}function s(e,t){return parseInt(e.getComputedStyle("margin-"+t)||0,10)||0}var o,r,l,c;!n&&(n=this.getWindow());var d="BackCompat"==(l=n.getDocument()).$.compatMode;n instanceof CKEDITOR.dom.window&&(n=d?l.getBody():l.getDocumentElement()),CKEDITOR.env.webkit&&(l=this.getEditor(!1))&&(l._.previousScrollTop=null),r=a(this,l=n.getWindow());var u=a(n,l),_=this.$.offsetHeight;o=this.$.offsetWidth;var h=n.$.clientHeight,p=n.$.clientWidth;l=r.x-s(this,"left")-u.x||0,c=r.y-s(this,"top")-u.y||0,o=r.x+o+s(this,"right")-(u.x+p)||0,r=r.y+_+s(this,"bottom")-(u.y+h)||0,(c<0||0<r)&&i(0,!0===e?c:!1===e?r:c<0?c:r),t&&(l<0||0<o)&&i(l<0?l:o,0)},setState:function(e,t,n){switch(t=t||"cke",e){case CKEDITOR.TRISTATE_ON:this.addClass(t+"_on"),this.removeClass(t+"_off"),this.removeClass(t+"_disabled"),n&&this.setAttribute("aria-pressed",!0),n&&this.removeAttribute("aria-disabled");break;case CKEDITOR.TRISTATE_DISABLED:this.addClass(t+"_disabled"),this.removeClass(t+"_off"),this.removeClass(t+"_on"),n&&this.setAttribute("aria-disabled",!0),n&&this.removeAttribute("aria-pressed");break;default:this.addClass(t+"_off"),this.removeClass(t+"_on"),this.removeClass(t+"_disabled"),n&&this.removeAttribute("aria-pressed"),n&&this.removeAttribute("aria-disabled")}},getFrameDocument:function(){var e=this.$;try{e.contentWindow.document}catch(i){e.src=e.src}return e&&new CKEDITOR.dom.document(e.contentWindow.document)},copyAttributes:function(e,t){var n=this.$.attributes;t=t||{};for(var i=0;i<n.length;i++){var a,s=n[i],o=s.nodeName.toLowerCase();o in t||("checked"==o&&(a=this.getAttribute(o))?e.setAttribute(o,a):CKEDITOR.env.ie&&!this.hasAttribute(o)||(null===(a=this.getAttribute(o))&&(a=s.nodeValue),e.setAttribute(o,a)))}""!==this.$.style.cssText&&(e.$.style.cssText=this.$.style.cssText)},renameNode:function(e){if(this.getName()!=e){var t=this.getDocument();e=new CKEDITOR.dom.element(e,t),this.copyAttributes(e),this.moveChildren(e),this.getParent(!0)&&this.$.parentNode.replaceChild(e.$,this.$),e.$["data-cke-expando"]=this.$["data-cke-expando"],this.$=e.$,delete this.getName}},getChild:function(){function n(e,t){var n=e.childNodes;if(0<=t&&t<n.length)return n[t]}return function(e){var t=this.$;if(e.slice)for(e=e.slice();0<e.length&&t;)t=n(t,e.shift());else t=n(t,e);return t?new CKEDITOR.dom.node(t):null}}(),getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){function t(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.hasClass("cke_enable_context_menu")}this.on("contextmenu",function(e){e.data.getTarget().getAscendant(t,!0)||e.data.preventDefault()})},getDirection:function(e){return e?this.getComputedStyle("direction")||this.getDirection()||this.getParent()&&this.getParent().getDirection(1)||this.getDocument().$.dir||"ltr":this.getStyle("direction")||this.getAttribute("dir")},data:function(e,t){return e="data-"+e,void 0===t?this.getAttribute(e):(!1===t?this.removeAttribute(e):this.setAttribute(e,t),null)},getEditor:function(e){var t,n,i,a=CKEDITOR.instances;for(t in e=e||void 0===e,a)if((n=a[t]).element.equals(this)&&n.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||!e&&(i=n.editable())&&(i.equals(this)||i.contains(this)))return n;return null},find:function(e){var t=a(this);return e=new CKEDITOR.dom.nodeList(this.$.querySelectorAll(i(this,e))),t(),e},findOne:function(e){var t=a(this);return e=this.$.querySelector(i(this,e)),t(),e?new CKEDITOR.dom.element(e):null},forEach:function(e,t,n){if(!(n||t&&this.type!=t))var i=e(this);if(!1!==i){n=this.getChildren();for(var a=0;a<n.count();a++)(i=n.getItem(a)).type==CKEDITOR.NODE_ELEMENT?i.forEach(e,t):t&&i.type!=t||e(i)}}});var d={width:["border-left-width","border-right-width","padding-left","padding-right"],height:["border-top-width","border-bottom-width","padding-top","padding-bottom"]};CKEDITOR.dom.element.prototype.setSize=function(e,t,n){"number"==typeof t&&(!n||CKEDITOR.env.ie&&CKEDITOR.env.quirks||(t-=s.call(this,e)),this.setStyle(e,t+"px"))},CKEDITOR.dom.element.prototype.getSize=function(e,t){var n=Math.max(this.$["offset"+CKEDITOR.tools.capitalize(e)],this.$["client"+CKEDITOR.tools.capitalize(e)])||0;return t&&(n-=s.call(this,e)),n}}(),CKEDITOR.dom.documentFragment=function(e){e=e||CKEDITOR.document,this.$=e.type==CKEDITOR.NODE_DOCUMENT?e.$.createDocumentFragment():e},CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype,CKEDITOR.dom.element.prototype,{type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,insertAfterNode:function(e){(e=e.$).parentNode.insertBefore(this.$,e.nextSibling)},getHtml:function(){var e=new CKEDITOR.dom.element("div");return this.clone(1,1).appendTo(e),e.getHtml().replace(/\s*data-cke-expando=".*?"/g,"")}},!0,{append:1,appendBogus:1,clone:1,getFirst:1,getHtml:1,getLast:1,getParent:1,getNext:1,getPrevious:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1}),function(){function i(e,t){var n=this.range;if(this._.end)return null;if(!this._.start){if(this._.start=1,n.collapsed)return this.end(),null;n.optimize()}var i,a=n.startContainer;i=n.endContainer;var s,o=n.startOffset,r=n.endOffset,l=this.guard,c=this.type,d=e?"getPreviousSourceNode":"getNextSourceNode";if(!e&&!this._.guardLTR){var u=i.type==CKEDITOR.NODE_ELEMENT?i:i.getParent(),_=i.type==CKEDITOR.NODE_ELEMENT?i.getChild(r):i.getNext();this._.guardLTR=function(e,t){return!(t&&u.equals(e)||_&&e.equals(_)||e.type==CKEDITOR.NODE_ELEMENT&&t&&e.equals(n.root))}}if(e&&!this._.guardRTL){var h=a.type==CKEDITOR.NODE_ELEMENT?a:a.getParent(),p=a.type==CKEDITOR.NODE_ELEMENT?o?a.getChild(o-1):null:a.getPrevious();this._.guardRTL=function(e,t){return!(t&&h.equals(e)||p&&e.equals(p)||e.type==CKEDITOR.NODE_ELEMENT&&t&&e.equals(n.root))}}var f=e?this._.guardRTL:this._.guardLTR;for(s=l?function(e,t){return!1!==f(e,t)&&l(e,t)}:f,this.current?i=this.current[d](!1,c,s):(e?i.type==CKEDITOR.NODE_ELEMENT&&(i=0<r?i.getChild(r-1):!1===s(i,!0)?null:i.getPreviousSourceNode(!0,c,s)):(i=a).type==CKEDITOR.NODE_ELEMENT&&((i=i.getChild(o))||(i=!1===s(a,!0)?null:a.getNextSourceNode(!0,c,s))),i&&!1===s(i)&&(i=null));i&&!this._.end;){if(this.current=i,this.evaluator&&!1===this.evaluator(i)){if(t&&this.evaluator)return!1}else if(!t)return i;i=i[d](!1,c,s)}return this.end(),this.current=null}function e(e){for(var t,n=null;t=i.call(this,e);)n=t;return n}CKEDITOR.dom.walker=CKEDITOR.tools.createClass({$:function(e){this.range=e,this._={}},proto:{end:function(){this._.end=1},next:function(){return i.call(this)},previous:function(){return i.call(this,1)},checkForward:function(){return!1!==i.call(this,0,1)},checkBackward:function(){return!1!==i.call(this,1,1)},lastForward:function(){return e.call(this)},lastBackward:function(){return e.call(this,1)},reset:function(){delete this.current,this._={}}}});var t={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},n={absolute:1,fixed:1};CKEDITOR.dom.element.prototype.isBlockBoundary=function(e){return!("none"!=this.getComputedStyle("float")||this.getComputedStyle("position")in n||!t[this.getComputedStyle("display")])||!!(this.is(CKEDITOR.dtd.$block)||e&&this.is(e))},CKEDITOR.dom.walker.blockBoundary=function(t){return function(e){return!(e.type==CKEDITOR.NODE_ELEMENT&&e.isBlockBoundary(t))}},CKEDITOR.dom.walker.listItemBoundary=function(){return this.blockBoundary({br:1})},CKEDITOR.dom.walker.bookmark=function(i,a){function s(e){return e&&e.getName&&"span"==e.getName()&&e.data("cke-bookmark")}return function(e){var t,n;return t=e&&e.type!=CKEDITOR.NODE_ELEMENT&&(n=e.getParent())&&s(n),t=i?t:t||s(e),!!(a^t)}},CKEDITOR.dom.walker.whitespaces=function(n){return function(e){var t;return e&&e.type==CKEDITOR.NODE_TEXT&&(t=!CKEDITOR.tools.trim(e.getText())||CKEDITOR.env.webkit&&e.getText()==CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE),!!(n^t)}},CKEDITOR.dom.walker.invisible=function(t){var n=CKEDITOR.dom.walker.whitespaces(),i=CKEDITOR.env.webkit?1:0;return function(e){return n(e)?e=1:(e.type==CKEDITOR.NODE_TEXT&&(e=e.getParent()),e=e.$.offsetWidth<=i),!!(t^e)}},CKEDITOR.dom.walker.nodeType=function(t,n){return function(e){return!!(n^e.type==t)}},CKEDITOR.dom.walker.bogus=function(n){function i(e){return!s(e)&&!o(e)}return function(e){var t=CKEDITOR.env.needsBrFiller?e.is&&e.is("br"):e.getText&&a.test(e.getText());return t&&(t=e.getParent(),e=e.getNext(i),t=t.isBlockBoundary()&&(!e||e.type==CKEDITOR.NODE_ELEMENT&&e.isBlockBoundary())),!!(n^t)}},CKEDITOR.dom.walker.temp=function(t){return function(e){return e.type!=CKEDITOR.NODE_ELEMENT&&(e=e.getParent()),e=e&&e.hasAttribute("data-cke-temp"),!!(t^e)}};var a=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,s=CKEDITOR.dom.walker.whitespaces(),o=CKEDITOR.dom.walker.bookmark(),r=CKEDITOR.dom.walker.temp(),l=function(e){return o(e)||s(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$inline)&&!e.is(CKEDITOR.dtd.$empty)};CKEDITOR.dom.walker.ignored=function(t){return function(e){return e=s(e)||o(e)||r(e),!!(t^e)}};var c=CKEDITOR.dom.walker.ignored();CKEDITOR.dom.walker.empty=function(i){return function(e){for(var t=0,n=e.getChildCount();t<n;++t)if(!c(e.getChild(t)))return!!i;return!i}};var d=CKEDITOR.dom.walker.empty(),u=CKEDITOR.dom.walker.validEmptyBlockContainers=CKEDITOR.tools.extend(function(e){var t,n={};for(t in e)CKEDITOR.dtd[t]["#"]&&(n[t]=1);return n}(CKEDITOR.dtd.$block),{caption:1,td:1,th:1});CKEDITOR.dom.walker.editable=function(t){return function(e){return e=!c(e)&&!!(e.type==CKEDITOR.NODE_TEXT||e.type==CKEDITOR.NODE_ELEMENT&&(e.is(CKEDITOR.dtd.$inline)||e.is("hr")||"false"==e.getAttribute("contenteditable")||!CKEDITOR.env.needsBrFiller&&e.is(u)&&d(e))),!!(t^e)}},CKEDITOR.dom.element.prototype.getBogus=function(){for(var e=this;e=e.getPreviousSourceNode(),l(e););return!(!e||!(CKEDITOR.env.needsBrFiller?e.is&&e.is("br"):e.getText&&a.test(e.getText())))&&e}}(),CKEDITOR.dom.range=function(e){this.endOffset=this.endContainer=this.startOffset=this.startContainer=null,this.collapsed=!0;var t=e instanceof CKEDITOR.dom.document;this.document=t?e:e.getDocument(),this.root=t?e.getBody():e},function(){function n(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer.equals(e.endContainer)&&e.startOffset==e.endOffset}function i(n,e,t,i,s){function a(e,t,n,i){var a=n?e.getPrevious():e.getNext();return i&&l||(d||i?t.append(e.clone(!0,s),n):(e.remove(),c&&t.append(e))),a}function o(){var e,t,n,i=Math.min(k.length,C.length);for(e=0;e<i;e++)if(t=k[e],n=C[e],!t.equals(n))return e;return e-1}function r(){var e=E-1,t=h&&p&&!g.equals(A);e<T-1||e<x-1||t?(t?n.moveToPosition(A,CKEDITOR.POSITION_BEFORE_START):x==e+1&&_?n.moveToPosition(C[e],CKEDITOR.POSITION_BEFORE_END):n.moveToPosition(C[e+1],CKEDITOR.POSITION_BEFORE_START),i&&(e=k[e+1])&&e.type==CKEDITOR.NODE_ELEMENT&&((t=CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>',n.document)).insertAfter(e),e.mergeSiblings(!1),n.moveToBookmark({startNode:t}))):n.collapse(!0)}n.optimizeBookmark();var l=0===e,c=1==e,d=2==e;e=d||c;var u,_,h,p,f,m,g=n.startContainer,A=n.endContainer,v=n.startOffset,b=n.endOffset;if(d&&A.type==CKEDITOR.NODE_TEXT&&g.equals(A))g=n.document.createText(g.substring(v,b)),t.append(g);else{A.type==CKEDITOR.NODE_TEXT?d?m=!0:A=A.split(b):0<A.getChildCount()?b>=A.getChildCount()?(A=A.getChild(b-1),_=!0):A=A.getChild(b):p=_=!0,g.type==CKEDITOR.NODE_TEXT?d?f=!0:g.split(v):0<g.getChildCount()?0===v?(g=g.getChild(v),u=!0):g=g.getChild(v-1):h=u=!0;for(var y,$,w,k=g.getParents(),C=A.getParents(),E=o(),T=k.length-1,x=C.length-1,I=t,D=-1,O=E;O<=T;O++){for(w=($=k[O]).getNext(),O!=T||$.equals(C[O])&&T<x?e&&(y=I.append($.clone(0,s))):u?a($,I,!1,h):f&&I.append(n.document.createText($.substring(v)));w;){if(w.equals(C[O])){D=O;break}w=a(w,I)}I=y}for(I=t,O=E;O<=x;O++)if(w=(t=C[O]).getPrevious(),t.equals(k[O]))e&&(I=I.getChild(0));else{if(O!=x||t.equals(k[O])&&x<T?e&&(y=I.append(t.clone(0,s))):_?a(t,I,!1,p):m&&I.append(n.document.createText(t.substring(0,b))),D<O)for(;w;)w=a(w,I,!0);I=y}d||r()}}function a(){var t=!1,n=CKEDITOR.dom.walker.whitespaces(),i=CKEDITOR.dom.walker.bookmark(!0),a=CKEDITOR.dom.walker.bogus();return function(e){return!(!i(e)&&!n(e))||(a(e)&&!t?t=!0:!(e.type==CKEDITOR.NODE_TEXT&&(e.hasAscendant("pre")||CKEDITOR.tools.trim(e.getText()).length)||e.type==CKEDITOR.NODE_ELEMENT&&!e.is(o)))}}function s(t){var n=CKEDITOR.dom.walker.whitespaces(),i=CKEDITOR.dom.walker.bookmark(1);return function(e){return!(!i(e)&&!n(e))||(!t&&r(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$removeEmpty))}}function e(e){return function(){var t;return this[e?"getPreviousNode":"getNextNode"](function(e){return!t&&d(e)&&(t=e),c(e)&&!(r(e)&&e.equals(t))})}}var o={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},r=CKEDITOR.dom.walker.bogus(),l=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,c=CKEDITOR.dom.walker.editable(),d=CKEDITOR.dom.walker.ignored(!0);CKEDITOR.dom.range.prototype={clone:function(){var e=new CKEDITOR.dom.range(this.root);return e._setStartContainer(this.startContainer),e.startOffset=this.startOffset,e._setEndContainer(this.endContainer),e.endOffset=this.endOffset,e.collapsed=this.collapsed,e},collapse:function(e){e?(this._setEndContainer(this.startContainer),this.endOffset=this.startOffset):(this._setStartContainer(this.endContainer),this.startOffset=this.endOffset),this.collapsed=!0},cloneContents:function(e){var t=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||i(this,2,t,!1,void 0===e||e),t},deleteContents:function(e){this.collapsed||i(this,0,null,e)},extractContents:function(e,t){var n=new CKEDITOR.dom.documentFragment(this.document);return this.collapsed||i(this,1,n,e,void 0===t||t),n},createBookmark:function(e){var t,n,i,a,s=this.collapsed;return(t=this.document.createElement("span")).data("cke-bookmark",1),t.setStyle("display","none"),t.setHtml("&nbsp;"),e&&(
i="cke_bm_"+CKEDITOR.tools.getNextNumber(),t.setAttribute("id",i+(s?"C":"S"))),s||((n=t.clone()).setHtml("&nbsp;"),e&&n.setAttribute("id",i+"E"),(a=this.clone()).collapse(),a.insertNode(n)),(a=this.clone()).collapse(!0),a.insertNode(t),n?(this.setStartAfter(t),this.setEndBefore(n)):this.moveToPosition(t,CKEDITOR.POSITION_AFTER_END),{startNode:e?i+(s?"C":"S"):t,endNode:e?i+"E":n,serializable:e,collapsed:s}},createBookmark2:function(){function a(e){var t,n=e.container,i=e.offset,a=i;if((t=(t=n).type!=CKEDITOR.NODE_ELEMENT||0===a||a==t.getChildCount()?0:t.getChild(a-1).type==CKEDITOR.NODE_TEXT&&t.getChild(a).type==CKEDITOR.NODE_TEXT)&&(i=(n=n.getChild(i-1)).getLength()),n.type==CKEDITOR.NODE_ELEMENT&&0<i){e:{for(t=n;i--;)if(0<=(a=t.getChild(i).getIndex(!0))){i=a;break e}i=-1}i+=1}if(n.type==CKEDITOR.NODE_TEXT){for(t=n,a=0;(t=t.getPrevious())&&t.type==CKEDITOR.NODE_TEXT;)a+=t.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE,"").length;t=a,n.getText()?i+=t:(a=n.getPrevious(o),t?(i=t,n=a?a.getNext():n.getParent().getFirst()):(n=n.getParent(),i=a?a.getIndex(!0)+1:0))}e.container=n,e.offset=i}function s(e,t){var n=t.getCustomData("cke-fillingChar");if(n){var i=e.container;n.equals(i)&&(e.offset-=CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length,e.offset<=0&&(e.offset=i.getIndex(),e.container=i.getParent()))}}var o=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT,!0);return function(e){var t=this.collapsed,n={container:this.startContainer,offset:this.startOffset},i={container:this.endContainer,offset:this.endOffset};return e&&(a(n),s(n,this.root),t||(a(i),s(i,this.root))),{start:n.container.getAddress(e),end:t?null:i.container.getAddress(e),startOffset:n.offset,endOffset:i.offset,normalized:e,collapsed:t,is2:!0}}}(),moveToBookmark:function(e){if(e.is2){var t=this.document.getByAddress(e.start,e.normalized),n=e.startOffset,i=e.end&&this.document.getByAddress(e.end,e.normalized);e=e.endOffset,this.setStart(t,n),i?this.setEnd(i,e):this.collapse(!0)}else t=(n=e.serializable)?this.document.getById(e.startNode):e.startNode,e=n?this.document.getById(e.endNode):e.endNode,this.setStartBefore(t),t.remove(),e?(this.setEndBefore(e),e.remove()):this.collapse(!0)},getBoundaryNodes:function(){var e,t=this.startContainer,n=this.endContainer,i=this.startOffset,a=this.endOffset;if(t.type==CKEDITOR.NODE_ELEMENT)if(i<(e=t.getChildCount()))t=t.getChild(i);else if(e<1)t=t.getPreviousSourceNode();else{for(t=t.$;t.lastChild;)t=t.lastChild;t=(t=new CKEDITOR.dom.node(t)).getNextSourceNode()||t}if(n.type==CKEDITOR.NODE_ELEMENT)if(a<(e=n.getChildCount()))n=n.getChild(a).getPreviousSourceNode(!0);else if(e<1)n=n.getPreviousSourceNode();else{for(n=n.$;n.lastChild;)n=n.lastChild;n=new CKEDITOR.dom.node(n)}return t.getPosition(n)&CKEDITOR.POSITION_FOLLOWING&&(t=n),{startNode:t,endNode:n}},getCommonAncestor:function(e,t){var n=this.startContainer,i=this.endContainer;n=n.equals(i)?e&&n.type==CKEDITOR.NODE_ELEMENT&&this.startOffset==this.endOffset-1?n.getChild(this.startOffset):n:n.getCommonAncestor(i);return t&&!n.is?n.getParent():n},optimize:function(){var e=this.startContainer,t=this.startOffset;e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setStartAfter(e):this.setStartBefore(e)),e=this.endContainer,t=this.endOffset,e.type!=CKEDITOR.NODE_ELEMENT&&(t?t>=e.getLength()&&this.setEndAfter(e):this.setEndBefore(e))},optimizeBookmark:function(){var e=this.startContainer,t=this.endContainer;e.is&&e.is("span")&&e.data("cke-bookmark")&&this.setStartAt(e,CKEDITOR.POSITION_BEFORE_START),t&&t.is&&t.is("span")&&t.data("cke-bookmark")&&this.setEndAt(t,CKEDITOR.POSITION_AFTER_END)},trim:function(e,t){var n=this.startContainer,i=this.startOffset,a=this.collapsed;if((!e||a)&&n&&n.type==CKEDITOR.NODE_TEXT){if(i)if(i>=n.getLength())i=n.getIndex()+1,n=n.getParent();else{var s=n.split(i);i=n.getIndex()+1,n=n.getParent();this.startContainer.equals(this.endContainer)?this.setEnd(s,this.endOffset-this.startOffset):n.equals(this.endContainer)&&(this.endOffset+=1)}else i=n.getIndex(),n=n.getParent();if(this.setStart(n,i),a)return void this.collapse(!0)}n=this.endContainer,i=this.endOffset,t||a||!n||n.type!=CKEDITOR.NODE_TEXT||(i?(i>=n.getLength()||n.split(i),i=n.getIndex()+1):i=n.getIndex(),n=n.getParent(),this.setEnd(n,i))},enlarge:function(e,t){function n(e){return e&&e.type==CKEDITOR.NODE_ELEMENT&&e.hasAttribute("contenteditable")?null:e}var a=new RegExp(/[^\s\ufeff]/);switch(e){case CKEDITOR.ENLARGE_INLINE:var i=1;case CKEDITOR.ENLARGE_ELEMENT:var s=function(e,t){var n,i;for((n=new CKEDITOR.dom.range(p)).setStart(e,t),n.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),(n=new CKEDITOR.dom.walker(n)).guard=function(e){return!(e.type==CKEDITOR.NODE_ELEMENT&&e.isBlockBoundary())};i=n.next();){if(i.type!=CKEDITOR.NODE_TEXT)return!1;if(_=i!=e?i.getText():i.substring(t),a.test(_))return!1}return!0};if(this.collapsed)break;var o,r,l,c,d,u,_,h=this.getCommonAncestor(),p=this.root,f=!1;u=this.startContainer;var m=this.startOffset;for(u.type==CKEDITOR.NODE_TEXT?(m&&(f=!!(u=!CKEDITOR.tools.trim(u.substring(0,m)).length&&u)),u&&((c=u.getPrevious())||(l=u.getParent()))):(m&&(c=u.getChild(m-1)||u.getLast()),c||(l=u)),l=n(l);l||c;){if(l&&!c){if(!d&&l.equals(h)&&(d=!0),i?l.isBlockBoundary():!p.contains(l))break;f&&"inline"==l.getComputedStyle("display")||(f=!1,d?o=l:this.setStartBefore(l)),c=l.getPrevious()}for(;c;)if(u=!1,c.type==CKEDITOR.NODE_COMMENT)c=c.getPrevious();else{if(c.type==CKEDITOR.NODE_TEXT)_=c.getText(),a.test(_)&&(c=null),u=/[\s\ufeff]$/.test(_);else if((c.$.offsetWidth>(CKEDITOR.env.webkit?1:0)||t&&c.is("br"))&&!c.data("cke-bookmark"))if(f&&CKEDITOR.dtd.$removeEmpty[c.getName()]){if(_=c.getText(),a.test(_))c=null;else{m=c.$.getElementsByTagName("*");for(var g,A=0;g=m[A++];)if(!CKEDITOR.dtd.$removeEmpty[g.nodeName.toLowerCase()]){c=null;break}}c&&(u=!!_.length)}else c=null;if(u&&(f?d?o=l:l&&this.setStartBefore(l):f=!0),c){if(u=c.getPrevious(),!l&&!u){l=c,c=null;break}c=u}else l=null}l&&(l=n(l.getParent()))}for(u=this.endContainer,m=this.endOffset,l=c=null,d=f=!1,u.type==CKEDITOR.NODE_TEXT?CKEDITOR.tools.trim(u.substring(m)).length?f=!0:(f=!u.getLength(),m==u.getLength()?(c=u.getNext())||(l=u.getParent()):s(u,m)&&(l=u.getParent())):(c=u.getChild(m))||(l=u);l||c;){if(l&&!c){if(!d&&l.equals(h)&&(d=!0),i?l.isBlockBoundary():!p.contains(l))break;f&&"inline"==l.getComputedStyle("display")||(f=!1,d?r=l:l&&this.setEndAfter(l)),c=l.getNext()}for(;c;){if(u=!1,c.type==CKEDITOR.NODE_TEXT)_=c.getText(),s(c,0)||(c=null),u=/^[\s\ufeff]/.test(_);else if(c.type==CKEDITOR.NODE_ELEMENT){if((0<c.$.offsetWidth||t&&c.is("br"))&&!c.data("cke-bookmark"))if(f&&CKEDITOR.dtd.$removeEmpty[c.getName()]){if(_=c.getText(),a.test(_))c=null;else for(m=c.$.getElementsByTagName("*"),A=0;g=m[A++];)if(!CKEDITOR.dtd.$removeEmpty[g.nodeName.toLowerCase()]){c=null;break}c&&(u=!!_.length)}else c=null}else u=1;if(u&&f&&(d?r=l:this.setEndAfter(l)),c){if(u=c.getNext(),!l&&!u){l=c,c=null;break}c=u}else l=null}l&&(l=n(l.getParent()))}o&&r&&(h=o.contains(r)?r:o,this.setStartBefore(h),this.setEndAfter(h));break;case CKEDITOR.ENLARGE_BLOCK_CONTENTS:case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:l=new CKEDITOR.dom.range(this.root),p=this.root,l.setStartAt(p,CKEDITOR.POSITION_AFTER_START),l.setEnd(this.startContainer,this.startOffset),l=new CKEDITOR.dom.walker(l);var v,b,y=CKEDITOR.dom.walker.blockBoundary(e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?{br:1}:null),$=null,w=function(e){if(e.type==CKEDITOR.NODE_ELEMENT&&"false"==e.getAttribute("contenteditable"))if($){if($.equals(e))return void($=null)}else $=e;else if($)return;var t=y(e);return t||(v=e),t};i=function(e){var t=w(e);return!t&&e.is&&e.is("br")&&(b=e),t};if(l.guard=w,l=l.lastBackward(),v=v||p,this.setStartAt(v,!v.is("br")&&(!l&&this.checkStartOfBlock()||l&&v.contains(l))?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_AFTER_END),e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS){l=this.clone(),l=new CKEDITOR.dom.walker(l);var k=CKEDITOR.dom.walker.whitespaces(),C=CKEDITOR.dom.walker.bookmark();if(l.evaluator=function(e){return!k(e)&&!C(e)},(l=l.previous())&&l.type==CKEDITOR.NODE_ELEMENT&&l.is("br"))break}(l=this.clone()).collapse(),l.setEndAt(p,CKEDITOR.POSITION_BEFORE_END),(l=new CKEDITOR.dom.walker(l)).guard=e==CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS?i:w,v=$=b=null,l=l.lastForward(),v=v||p,this.setEndAt(v,!l&&this.checkEndOfBlock()||l&&v.contains(l)?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_BEFORE_START),b&&this.setEndAfter(b)}},shrink:function(n,e,t){var i="boolean"==typeof t?t:!t||"boolean"!=typeof t.shrinkOnBlockBoundary||t.shrinkOnBlockBoundary,a=t&&t.skipBogus;if(!this.collapsed){n=n||CKEDITOR.SHRINK_TEXT;var s=this.clone(),o=this.startContainer,r=this.endContainer,l=this.startOffset,c=this.endOffset,d=t=1;o&&o.type==CKEDITOR.NODE_TEXT&&(l?l>=o.getLength()?s.setStartAfter(o):(s.setStartBefore(o),t=0):s.setStartBefore(o)),r&&r.type==CKEDITOR.NODE_TEXT&&(c?c>=r.getLength()?s.setEndAfter(r):(s.setEndAfter(r),d=0):s.setEndBefore(r));s=new CKEDITOR.dom.walker(s);var u,_=CKEDITOR.dom.walker.bookmark(),h=CKEDITOR.dom.walker.bogus();return s.evaluator=function(e){return e.type==(n==CKEDITOR.SHRINK_ELEMENT?CKEDITOR.NODE_ELEMENT:CKEDITOR.NODE_TEXT)},s.guard=function(e,t){return!!(a&&h(e)||_(e))||!(n==CKEDITOR.SHRINK_ELEMENT&&e.type==CKEDITOR.NODE_TEXT||t&&e.equals(u)||!1===i&&e.type==CKEDITOR.NODE_ELEMENT&&e.isBlockBoundary()||e.type==CKEDITOR.NODE_ELEMENT&&e.hasAttribute("contenteditable"))&&(t||e.type!=CKEDITOR.NODE_ELEMENT||(u=e),!0)},t&&(o=s[n==CKEDITOR.SHRINK_ELEMENT?"lastForward":"next"]())&&this.setStartAt(o,e?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_START),d&&(s.reset(),(s=s[n==CKEDITOR.SHRINK_ELEMENT?"lastBackward":"previous"]())&&this.setEndAt(s,e?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_END)),!(!t&&!d)}},insertNode:function(e){this.optimizeBookmark(),this.trim(!1,!0);var t=this.startContainer,n=t.getChild(this.startOffset);n?e.insertBefore(n):t.append(e),e.getParent()&&e.getParent().equals(this.endContainer)&&this.endOffset++,this.setStartBefore(e)},moveToPosition:function(e,t){this.setStartAt(e,t),this.collapse(!0)},moveToRange:function(e){this.setStart(e.startContainer,e.startOffset),this.setEnd(e.endContainer,e.endOffset)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e.type==CKEDITOR.NODE_TEXT?e.getLength():e.getChildCount())},setStart:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex(),e=e.getParent()),this._setStartContainer(e),this.startOffset=t,this.endContainer||(this._setEndContainer(e),this.endOffset=t),n(this)},setEnd:function(e,t){e.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$empty[e.getName()]&&(t=e.getIndex()+1,e=e.getParent()),this._setEndContainer(e),this.endOffset=t,this.startContainer||(this._setStartContainer(e),this.startOffset=t),n(this)},setStartAfter:function(e){this.setStart(e.getParent(),e.getIndex()+1)},setStartBefore:function(e){this.setStart(e.getParent(),e.getIndex())},setEndAfter:function(e){this.setEnd(e.getParent(),e.getIndex()+1)},setEndBefore:function(e){this.setEnd(e.getParent(),e.getIndex())},setStartAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setStart(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setStart(e,e.getLength()):this.setStart(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setStartBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setStartAfter(e)}n(this)},setEndAt:function(e,t){switch(t){case CKEDITOR.POSITION_AFTER_START:this.setEnd(e,0);break;case CKEDITOR.POSITION_BEFORE_END:e.type==CKEDITOR.NODE_TEXT?this.setEnd(e,e.getLength()):this.setEnd(e,e.getChildCount());break;case CKEDITOR.POSITION_BEFORE_START:this.setEndBefore(e);break;case CKEDITOR.POSITION_AFTER_END:this.setEndAfter(e)}n(this)},fixBlock:function(e,t){var n=this.createBookmark(),i=this.document.createElement(t);this.collapse(e),this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),this.extractContents().appendTo(i),i.trim(),this.insertNode(i);var a=i.getBogus();return a&&a.remove(),i.appendBogus(),this.moveToBookmark(n),i},splitBlock:function(e,t){var n=new CKEDITOR.dom.elementPath(this.startContainer,this.root),i=new CKEDITOR.dom.elementPath(this.endContainer,this.root),a=n.block,s=i.block,o=null;return n.blockLimit.equals(i.blockLimit)?("br"!=e&&(a||(a=this.fixBlock(!0,e),s=new CKEDITOR.dom.elementPath(this.endContainer,this.root).block),s||(s=this.fixBlock(!1,e))),n=a&&this.checkStartOfBlock(),i=s&&this.checkEndOfBlock(),this.deleteContents(),a&&a.equals(s)&&(i?(o=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(s,CKEDITOR.POSITION_AFTER_END),s=null):n?(o=new CKEDITOR.dom.elementPath(this.startContainer,this.root),this.moveToPosition(a,CKEDITOR.POSITION_BEFORE_START),a=null):(s=this.splitElement(a,t||!1),a.is("ul","ol")||a.appendBogus())),{previousBlock:a,nextBlock:s,wasStartOfBlock:n,wasEndOfBlock:i,elementPath:o}):null},splitElement:function(e,t){if(!this.collapsed)return null;this.setEndAt(e,CKEDITOR.POSITION_BEFORE_END);var n=this.extractContents(!1,t||!1),i=e.clone(!1,t||!1);return n.appendTo(i),i.insertAfter(e),this.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),i},removeEmptyBlocksAtEnd:function(){function s(t){return function(e){return!(n(e)||i(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.isEmptyInlineRemoveable()||t.is("table")&&e.is("caption"))}}var n=CKEDITOR.dom.walker.whitespaces(),i=CKEDITOR.dom.walker.bookmark(!1);return function(e){for(var t,n=this.createBookmark(),i=this[e?"endPath":"startPath"](),a=i.block||i.blockLimit;a&&!a.equals(i.root)&&!a.getFirst(s(a));)t=a.getParent(),this[e?"setEndAt":"setStartAt"](a,CKEDITOR.POSITION_AFTER_END),a.remove(1),a=t;this.moveToBookmark(n)}}(),startPath:function(){return new CKEDITOR.dom.elementPath(this.startContainer,this.root)},endPath:function(){return new CKEDITOR.dom.elementPath(this.endContainer,this.root)},checkBoundaryOfElement:function(e,t){var n=t==CKEDITOR.START,i=this.clone();return i.collapse(n),i[n?"setStartAt":"setEndAt"](e,n?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),(i=new CKEDITOR.dom.walker(i)).evaluator=s(n),i[n?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var e=this.startContainer,t=this.startOffset;return CKEDITOR.env.ie&&t&&e.type==CKEDITOR.NODE_TEXT&&(e=CKEDITOR.tools.ltrim(e.substring(0,t)),l.test(e)&&this.trim(0,1)),this.trim(),e=new CKEDITOR.dom.elementPath(this.startContainer,this.root),(t=this.clone()).collapse(!0),t.setStartAt(e.block||e.blockLimit,CKEDITOR.POSITION_AFTER_START),(e=new CKEDITOR.dom.walker(t)).evaluator=a(),e.checkBackward()},checkEndOfBlock:function(){var e=this.endContainer,t=this.endOffset;return CKEDITOR.env.ie&&e.type==CKEDITOR.NODE_TEXT&&(e=CKEDITOR.tools.rtrim(e.substring(t)),l.test(e)&&this.trim(1,0)),this.trim(),e=new CKEDITOR.dom.elementPath(this.endContainer,this.root),(t=this.clone()).collapse(!1),t.setEndAt(e.block||e.blockLimit,CKEDITOR.POSITION_BEFORE_END),(e=new CKEDITOR.dom.walker(t)).evaluator=a(),e.checkForward()},getPreviousNode:function(e,t,n){var i=this.clone();return i.collapse(1),i.setStartAt(n||this.root,CKEDITOR.POSITION_AFTER_START),(n=new CKEDITOR.dom.walker(i)).evaluator=e,n.guard=t,n.previous()},getNextNode:function(e,t,n){var i=this.clone();return i.collapse(),i.setEndAt(n||this.root,CKEDITOR.POSITION_BEFORE_END),(n=new CKEDITOR.dom.walker(i)).evaluator=e,n.guard=t,n.next()},checkReadOnly:function(){function n(e,t){for(;e;){if(e.type==CKEDITOR.NODE_ELEMENT){if("false"==e.getAttribute("contentEditable")&&!e.data("cke-editable"))return 0;if(e.is("html")||"true"==e.getAttribute("contentEditable")&&(e.contains(t)||e.equals(t)))break}e=e.getParent()}return 1}return function(){var e=this.startContainer,t=this.endContainer;return!(n(e,t)&&n(t,e))}}(),moveToElementEditablePosition:function(e,t){if(e.type==CKEDITOR.NODE_ELEMENT&&!e.isEditable(!1))return this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),!0;for(var n=0;e;){if(e.type==CKEDITOR.NODE_TEXT){t&&this.endContainer&&this.checkEndOfBlock()&&l.test(e.getText())?this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START):this.moveToPosition(e,t?CKEDITOR.POSITION_AFTER_END:CKEDITOR.POSITION_BEFORE_START),n=1;break}if(e.type==CKEDITOR.NODE_ELEMENT)if(e.isEditable())this.moveToPosition(e,t?CKEDITOR.POSITION_BEFORE_END:CKEDITOR.POSITION_AFTER_START),n=1;else if(t&&e.is("br")&&this.endContainer&&this.checkEndOfBlock())this.moveToPosition(e,CKEDITOR.POSITION_BEFORE_START);else if("false"==e.getAttribute("contenteditable")&&e.is(CKEDITOR.dtd.$block))return this.setStartBefore(e),this.setEndAfter(e),!0;var i=e,a=n,s=void 0;i.type==CKEDITOR.NODE_ELEMENT&&i.isEditable(!1)&&(s=i[t?"getLast":"getFirst"](d)),a||s||(s=i[t?"getPrevious":"getNext"](d)),e=s}return!!n},moveToClosestEditablePosition:function(e,t){var n,i,a,s=0,o=[CKEDITOR.POSITION_AFTER_END,CKEDITOR.POSITION_BEFORE_START];return e?(n=new CKEDITOR.dom.range(this.root)).moveToPosition(e,o[t?0:1]):n=this.clone(),e&&!e.is(CKEDITOR.dtd.$block)?s=1:(i=n[t?"getNextEditableNode":"getPreviousEditableNode"]())&&(s=1,(a=i.type==CKEDITOR.NODE_ELEMENT)&&i.is(CKEDITOR.dtd.$block)&&"false"==i.getAttribute("contenteditable")?(n.setStartAt(i,CKEDITOR.POSITION_BEFORE_START),n.setEndAt(i,CKEDITOR.POSITION_AFTER_END)):!CKEDITOR.env.needsBrFiller&&a&&i.is(CKEDITOR.dom.walker.validEmptyBlockContainers)?(n.setEnd(i,0),n.collapse()):n.moveToPosition(i,o[t?1:0])),s&&this.moveToRange(n),!!s},moveToElementEditStart:function(e){return this.moveToElementEditablePosition(e)},moveToElementEditEnd:function(e){return this.moveToElementEditablePosition(e,!0)},getEnclosedNode:function(){if((e=this.clone()).optimize(),e.startContainer.type!=CKEDITOR.NODE_ELEMENT||e.endContainer.type!=CKEDITOR.NODE_ELEMENT)return null;var e=new CKEDITOR.dom.walker(e),t=CKEDITOR.dom.walker.bookmark(!1,!0),n=CKEDITOR.dom.walker.whitespaces(!0);e.evaluator=function(e){return n(e)&&t(e)};var i=e.next();return e.reset(),i&&i.equals(e.previous())?i:null},getTouchedStartNode:function(){var e=this.startContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.startOffset)||e},getTouchedEndNode:function(){var e=this.endContainer;return this.collapsed||e.type!=CKEDITOR.NODE_ELEMENT?e:e.getChild(this.endOffset-1)||e},getNextEditableNode:e(),getPreviousEditableNode:e(1),_getTableElement:function(e){e=e||{td:1,th:1,tr:1,tbody:1,thead:1,tfoot:1,table:1};var t=this.startContainer,n=this.endContainer,i=t.getAscendant("table",!0),a=n.getAscendant("table",!0);return CKEDITOR.env.safari&&i&&n.equals(this.root)?t.getAscendant(e,!0):this.getEnclosedNode()?this.getEnclosedNode().getAscendant(e,!0):i&&a&&(i.equals(a)||i.contains(a)||a.contains(i))?t.getAscendant(e,!0):null},scrollIntoView:function(){var e,t,n,i=new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",this.document),a=this.clone();a.optimize(),(n=a.startContainer.type==CKEDITOR.NODE_TEXT)?(t=a.startContainer.getText(),e=a.startContainer.split(a.startOffset),i.insertAfter(a.startContainer)):a.insertNode(i),i.scrollIntoView(),n&&(a.startContainer.setText(t),e.remove()),i.remove()},_setStartContainer:function(e){this.startContainer=e},_setEndContainer:function(e){this.endContainer=e},_find:function(e,t){var n,i,a,s,o=this.getCommonAncestor(),r=this.getBoundaryNodes(),l=[];if(o&&o.find)for(i=o.find(e),n=0;n<i.count();n++)o=i.getItem(n),(t||!o.isReadOnly())&&(a=o.getPosition(r.startNode)&CKEDITOR.POSITION_FOLLOWING||r.startNode.equals(o),s=o.getPosition(r.endNode)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_IS_CONTAINED||r.endNode.equals(o),a&&s&&l.push(o));return l}},CKEDITOR.dom.range.mergeRanges=function(e){return CKEDITOR.tools.array.reduce(e,function(e,t){var n=e[e.length-1],i=!1;if((t=t.clone()).enlarge(CKEDITOR.ENLARGE_ELEMENT),n){var a=new CKEDITOR.dom.range(t.root),s=(i=new CKEDITOR.dom.walker(a),CKEDITOR.dom.walker.whitespaces());for(a.setStart(n.endContainer,n.endOffset),a.setEnd(t.startContainer,t.startOffset),a=i.next();s(a)||t.endContainer.equals(a);)a=i.next();i=!a}return i?n.setEnd(t.endContainer,t.endOffset):e.push(t),e},[])}}(),CKEDITOR.POSITION_AFTER_START=1,CKEDITOR.POSITION_BEFORE_END=2,CKEDITOR.POSITION_BEFORE_START=3,CKEDITOR.POSITION_AFTER_END=4,CKEDITOR.ENLARGE_ELEMENT=1,CKEDITOR.ENLARGE_BLOCK_CONTENTS=2,CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS=3,CKEDITOR.ENLARGE_INLINE=4,CKEDITOR.START=1,CKEDITOR.END=2,CKEDITOR.SHRINK_ELEMENT=1,CKEDITOR.SHRINK_TEXT=2,function(){function e(e){arguments.length<1||(this.range=e,this.forceBrBreak=0,this.enlargeBr=1,this.enforceRealBlocks=0,this._||(this._={}))}function s(e){var t=[];return e.forEach(function(e){if("true"==e.getAttribute("contenteditable"))return t.push(e),!1},CKEDITOR.NODE_ELEMENT,!0),t}function h(e,t,n,i){e:{null==i&&(i=s(n));for(var a;a=i.shift();)if(a.getDtd().p){i={element:a,remaining:i};break e}i=null}return i?(a=CKEDITOR.filter.instances[i.element.data("cke-filter")])&&!a.check(t)?h(e,t,n,i.remaining):((t=new CKEDITOR.dom.range(i.element)).selectNodeContents(i.element),(t=t.createIterator()).enlargeBr=e.enlargeBr,t.enforceRealBlocks=e.enforceRealBlocks,t.activeFilter=t.filter=a,e._.nestedEditable={element:i.element,container:n,remaining:i.remaining,iterator:t},1):0}function p(e,t,n){return!!t&&((e=e.clone()).collapse(!n),e.checkBoundaryOfElement(t,n?CKEDITOR.START:CKEDITOR.END))}var f=/^[\r\n\t ]+$/,m=CKEDITOR.dom.walker.bookmark(!1,!0),t=CKEDITOR.dom.walker.whitespaces(!0),g=function(e){return m(e)&&t(e)},A={dd:1,dt:1,li:1};e.prototype={getNextParagraph:function(e){var t,n,i,a,s;if(e=e||"p",this._.nestedEditable){if(t=this._.nestedEditable.iterator.getNextParagraph(e))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,t;if(this.activeFilter=this.filter,h(this,e,this._.nestedEditable.container,this._.nestedEditable.remaining))return this.activeFilter=this._.nestedEditable.iterator.activeFilter,this._.nestedEditable.iterator.getNextParagraph(e);this._.nestedEditable=null}if(!this.range.root.getDtd()[e])return null;if(!this._.started){var o=this.range.clone();n=o.startPath();var r=o.endPath(),l=!o.collapsed&&p(o,n.block),c=!o.collapsed&&p(o,r.block,1);o.shrink(CKEDITOR.SHRINK_ELEMENT,!0),l&&o.setStartAt(n.block,CKEDITOR.POSITION_BEFORE_END),c&&o.setEndAt(r.block,CKEDITOR.POSITION_AFTER_START),n=o.endContainer.hasAscendant("pre",!0)||o.startContainer.hasAscendant("pre",!0),o.enlarge(this.forceBrBreak&&!n||!this.enlargeBr?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS),o.collapsed||(n=new CKEDITOR.dom.walker(o.clone()),r=CKEDITOR.dom.walker.bookmark(!0,!0),n.evaluator=r,this._.nextNode=n.next(),(n=new CKEDITOR.dom.walker(o.clone())).evaluator=r,n=n.previous(),this._.lastNode=n.getNextSourceNode(!0,null,o.root),this._.lastNode&&this._.lastNode.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(this._.lastNode.getText())&&this._.lastNode.getParent().isBlockBoundary()&&((r=this.range.clone()).moveToPosition(this._.lastNode,CKEDITOR.POSITION_AFTER_END),r.checkEndOfBlock()&&(r=new CKEDITOR.dom.elementPath(r.endContainer,r.root),this._.lastNode=(r.block||r.blockLimit).getNextSourceNode(!0))),this._.lastNode&&o.root.contains(this._.lastNode)||(this._.lastNode=this._.docEndMarker=o.document.createText(""),this._.lastNode.insertAfter(n)),o=null),this._.started=1,n=o}for(r=this._.nextNode,o=this._.lastNode,this._.nextNode=null;r;){l=0,c=r.hasAscendant("pre");var d=r.type!=CKEDITOR.NODE_ELEMENT,u=0;if(d)r.type==CKEDITOR.NODE_TEXT&&f.test(r.getText())&&(d=0);else{var _=r.getName();if(CKEDITOR.dtd.$block[_]&&"false"==r.getAttribute("contenteditable")){h(this,e,t=r);break}if(r.isBlockBoundary(this.forceBrBreak&&!c&&{br:1})){if("br"==_)d=1;else if(!n&&!r.getChildCount()&&"hr"!=_){i=(t=r).equals(o);break}n&&(n.setEndAt(r,CKEDITOR.POSITION_BEFORE_START),"br"!=_&&(this._.nextNode=r)),l=1}else{if(r.getFirst()){n||(n=this.range.clone()).setStartAt(r,CKEDITOR.POSITION_BEFORE_START),r=r.getFirst();continue}d=1}}if(d&&!n&&(n=this.range.clone()).setStartAt(r,CKEDITOR.POSITION_BEFORE_START),i=(!l||d)&&r.equals(o),n&&!l)for(;!r.getNext(g)&&!i;){if((_=r.getParent()).isBlockBoundary(this.forceBrBreak&&!c&&{br:1})){l=1,d=0,i||_.equals(o),n.setEndAt(_,CKEDITOR.POSITION_BEFORE_END);break}d=1,i=(r=_).equals(o),u=1}if(d&&n.setEndAt(r,CKEDITOR.POSITION_AFTER_END),(i=!(r=this._getNextSourceNode(r,u,o)))||l&&n)break}if(!t){if(!n)return this._.docEndMarker&&this._.docEndMarker.remove(),this._.nextNode=null;r=(t=new CKEDITOR.dom.elementPath(n.startContainer,n.root)).blockLimit,l={div:1,th:1,td:1},!(t=t.block)&&r&&!this.enforceRealBlocks&&l[r.getName()]&&n.checkStartOfBlock()&&n.checkEndOfBlock()&&!r.equals(n.root)?t=r:!t||this.enforceRealBlocks&&t.is(A)?(t=this.range.document.createElement(e),n.extractContents().appendTo(t),t.trim(),n.insertNode(t),a=s=!0):"li"!=t.getName()?n.checkStartOfBlock()&&n.checkEndOfBlock()||(t=t.clone(!1),n.extractContents().appendTo(t),t.trim(),a=!(s=n.splitBlock()).wasStartOfBlock,s=!s.wasEndOfBlock,n.insertNode(t)):i||(this._.nextNode=t.equals(o)?null:this._getNextSourceNode(n.getBoundaryNodes().endNode,1,o))}return a&&(a=t.getPrevious())&&a.type==CKEDITOR.NODE_ELEMENT&&("br"==a.getName()?a.remove():a.getLast()&&"br"==a.getLast().$.nodeName.toLowerCase()&&a.getLast().remove()),s&&(a=t.getLast())&&a.type==CKEDITOR.NODE_ELEMENT&&"br"==a.getName()&&(!CKEDITOR.env.needsBrFiller||a.getPrevious(m)||a.getNext(m))&&a.remove(),this._.nextNode||(this._.nextNode=i||t.equals(o)||!o?null:this._getNextSourceNode(t,1,o)),t},_getNextSourceNode:function(e,t,n){function i(e){return!(e.equals(n)||e.equals(a))}var a=this.range.root;for(e=e.getNextSourceNode(t,null,i);!m(e);)e=e.getNextSourceNode(t,null,i);return e}},CKEDITOR.dom.range.prototype.createIterator=function(){return new e(this)}}(),CKEDITOR.command=function(t,n){var i;this.uiItems=[],this.exec=function(e){return!(this.state==CKEDITOR.TRISTATE_DISABLED||!this.checkAllowed())&&(this.editorFocus&&t.focus(),!1===this.fire("exec")||!1!==n.exec.call(this,t,e))},this.refresh=function(e,t){return!(this.readOnly||!e.readOnly)||(this.context&&!t.isContextFor(this.context)||!this.checkAllowed(!0)?(this.disable(),!0):(this.startDisabled||this.enable(),this.modes&&!this.modes[e.mode]&&this.disable(),!1===this.fire("refresh",{editor:e,path:t})||n.refresh&&!1!==n.refresh.apply(this,arguments)))},this.checkAllowed=function(e){return e||"boolean"!=typeof i?i=t.activeFilter.checkFeature(this):i},CKEDITOR.tools.extend(this,n,{modes:{wysiwyg:1},editorFocus:1,contextSensitive:!!n.context,state:CKEDITOR.TRISTATE_DISABLED}),CKEDITOR.event.call(this)},CKEDITOR.command.prototype={enable:function(){this.state==CKEDITOR.TRISTATE_DISABLED&&this.checkAllowed()&&this.setState(this.preserveState&&"undefined"!=typeof this.previousState?this.previousState:CKEDITOR.TRISTATE_OFF)},disable:function(){this.setState(CKEDITOR.TRISTATE_DISABLED)},setState:function(e){return!(this.state==e||e!=CKEDITOR.TRISTATE_DISABLED&&!this.checkAllowed())&&(this.previousState=this.state,this.state=e,this.fire("state"),!0)},toggleState:function(){this.state==CKEDITOR.TRISTATE_OFF?this.setState(CKEDITOR.TRISTATE_ON):this.state==CKEDITOR.TRISTATE_ON&&this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.event.implementOn(CKEDITOR.command.prototype),CKEDITOR.ENTER_P=1,CKEDITOR.ENTER_BR=2,CKEDITOR.ENTER_DIV=3,CKEDITOR.config={customConfig:"config.js",autoUpdateElement:!0,language:"",defaultLanguage:"en",contentsLangDirection:"",enterMode:CKEDITOR.ENTER_P,forceEnterMode:!1,shiftEnterMode:CKEDITOR.ENTER_BR,docType:"<!DOCTYPE html>",bodyId:"",bodyClass:"",fullPage:!1,height:200,contentsCss:CKEDITOR.getUrl("contents.css"),extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,width:"",baseFloatZIndex:1e4,blockedKeystrokes:[CKEDITOR.CTRL+66,CKEDITOR.CTRL+73,CKEDITOR.CTRL+85]},function(){function s(e,t,n,i,a){var s,o,r;for(s in e=[],t){o="boolean"==typeof(o=t[s])?{}:"function"==typeof o?{match:o}:O(o),"$"!=s.charAt(0)&&(o.elements=s),n&&(o.featureName=n.toLowerCase());var l=o;l.elements=A(l.elements,/\s+/)||null,l.propertiesOnly=l.propertiesOnly||!0===l.elements;var c=/\s*,\s*/,d=void 0;for(d in N){l[d]=A(l[d],c)||null;var u=l,_=F[d],h=A(l[F[d]],c),p=l[d],f=[],m=!0,g=void 0;for(g in h?m=!1:h={},p)"!"==g.charAt(0)&&(g=g.slice(1),f.push(g),m=!(h[g]=!0));for(;g=f.pop();)p[g]=p["!"+g],delete p["!"+g];u[_]=!m&&h||null}l.match=l.match||null,i.push(o),e.push(o)}for(t=a.elements,a=a.generic,n=0,i=e.length;n<i;++n){for(c in o=!0===(s=O(e[n])).classes||!0===s.styles||!0===s.attributes,l=s,d=_=c=void 0,N)l[c]=k(l[c]);for(d in u=!0,F){for(p in h=[],p=void 0,_=l[c=F[d]])-1<p.indexOf("*")?h.push(new RegExp("^"+p.replace(/\*/g,".*")+"$")):h.push(p);(_=h).length&&(l[c]=_,u=!1)}if(l.nothingRequired=u,l.noProperties=!(l.attributes||l.classes||l.styles),!0===s.elements||null===s.elements)a[o?"unshift":"push"](s);else for(r in l=s.elements,delete s.elements,l)t[r]?t[r][o?"unshift":"push"](s):t[r]=[s]}}function v(e,t,n,i){if((!e.match||e.match(t))&&(i||c(e,t))&&(e.propertiesOnly||(n.valid=!0),n.allAttributes||(n.allAttributes=r(e.attributes,t.attributes,n.validAttributes)),n.allStyles||(n.allStyles=r(e.styles,t.styles,n.validStyles)),!n.allClasses)){if(e=e.classes,t=t.classes,i=n.validClasses,e)if(!0===e)e=!0;else{for(var a,s=0,o=t.length;s<o;++s)i[a=t[s]]||(i[a]=e(a));e=!1}else e=!1;n.allClasses=e}}function r(e,t,n){if(!e)return!1;if(!0===e)return!0;for(var i in t)n[i]||(n[i]=e(i));return!1}function b(e,t,n){if(!e.match||e.match(t)){if(e.noProperties)return!1;if(n.hadInvalidAttribute=o(e.attributes,t.attributes)||n.hadInvalidAttribute,n.hadInvalidStyle=o(e.styles,t.styles)||n.hadInvalidStyle,e=e.classes,t=t.classes,e){for(var i=!1,a=!0===e,s=t.length;s--;)(a||e(t[s]))&&(t.splice(s,1),i=!0);e=i}else e=!1;n.hadInvalidClass=e||n.hadInvalidClass}}function o(e,t){if(!e)return!1;var n,i=!1,a=!0===e;for(n in t)(a||e(n))&&(delete t[n],i=!0);return i}function l(e,t,n){return!(e.disabled||e.customConfig&&!n||!t)&&(e._.cachedChecks={},!0)}function A(e,t){if(!e)return!1;if(!0===e)return e;if("string"==typeof e)return"*"==(e=S(e))||CKEDITOR.tools.convertArrayToObject(e.split(t));if(CKEDITOR.tools.isArray(e))return!!e.length&&CKEDITOR.tools.convertArrayToObject(e);var n,i={},a=0;for(n in e)i[n]=e[n],a++;return!!a&&i}function c(e,t){if(e.nothingRequired)return!0;var n,i,a,s;if(a=e.requiredClasses)for(s=t.classes,n=0;n<a.length;++n)if("string"==typeof(i=a[n])){if(-1==CKEDITOR.tools.indexOf(s,i))return!1}else if(!CKEDITOR.tools.checkIfAnyArrayItemMatches(s,i))return!1;return d(t.styles,e.requiredStyles)&&d(t.attributes,e.requiredAttributes)}function d(e,t){if(!t)return!0;for(var n,i=0;i<t.length;++i)if("string"==typeof(n=t[i])){if(!(n in e))return!1}else if(!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(e,n))return!1;return!0}function u(e){if(!e)return{};e=e.split(/\s*,\s*/).sort();for(var t={};e.length;)t[e.shift()]="cke-test";return t}function _(e){var t,n,i,a,s={},o=1;for(e=S(e);t=e.match(K);)(n=t[2])?(i=h(n,"styles"),a=h(n,"attrs"),n=h(n,"classes")):i=a=n=null,s["$"+o++]={elements:t[1],classes:n,styles:i,attributes:a},e=e.slice(t[0].length);return s}function h(e,t){var n=e.match(i[t]);return n?S(n[1]):null}function y(e){var t=e.styleBackup=e.attributes.style,n=e.classBackup=e.attributes["class"];e.styles||(e.styles=CKEDITOR.tools.parseCssText(t||"",1)),e.classes||(e.classes=n?n.split(/\s+/):[])}function p(e,t,n,i){var a,s=0;if(i.toHtml&&(t.name=t.name.replace(M,"$1")),i.doCallbacks&&e.elementCallbacks){e:{for(var o,r=0,l=(a=e.elementCallbacks).length;r<l;++r)if(o=a[r](t)){a=o;break e}a=void 0}if(a)return a}if(i.doTransform&&(a=e._.transformations[t.name])){for(y(t),r=0;r<a.length;++r)C(e,t,a[r]);$(t)}if(i.doFilter){e:{r=t.name,e=(l=e._).allowedRules.elements[r],a=l.allowedRules.generic,r=l.disallowedRules.elements[r],l=l.disallowedRules.generic,o=i.skipRequired;var c,d,u={valid:!1,validAttributes:{},validClasses:{},validStyles:{},allAttributes:!1,allClasses:!1,allStyles:!1,hadInvalidAttribute:!1,hadInvalidClass:!1,hadInvalidStyle:!1};if(e||a){if(y(t),r)for(c=0,d=r.length;c<d;++c)if(!1===b(r[c],t,u)){e=null;break e}if(l)for(c=0,d=l.length;c<d;++c)b(l[c],t,u);if(e)for(c=0,d=e.length;c<d;++c)v(e[c],t,u,o);if(a)for(c=0,d=a.length;c<d;++c)v(a[c],t,u,o);e=u}else e=null}if(!e||!e.valid)return n.push(t),1;d=e.validAttributes;var _=e.validStyles;a=e.validClasses;r=t.attributes;var h=t.styles;l=t.classes;o=t.classBackup;var p,f,m=t.styleBackup,g=[],A=(u=[],/^data-cke-/);if(c=!1,delete r.style,delete r["class"],delete t.classBackup,delete t.styleBackup,!e.allAttributes)for(p in r)d[p]||A.test(p)&&(p==(f=p.replace(/^data-cke-saved-/,""))||d[f])||(delete r[p],c=!0);if(!e.allStyles||e.hadInvalidStyle){for(p in h)e.allStyles||_[p]?g.push(p+":"+h[p]):c=!0;g.length&&(r.style=g.sort().join("; "))}else m&&(r.style=m);if(!e.allClasses||e.hadInvalidClass){for(
p=0;p<l.length;++p)(e.allClasses||a[l[p]])&&u.push(l[p]);u.length&&(r["class"]=u.sort().join(" ")),o&&u.length<o.split(/\s+/).length&&(c=!0)}else o&&(r["class"]=o);if(c&&(s=1),!i.skipFinalValidation&&!w(t))return n.push(t),1}return i.toHtml&&(t.name=t.name.replace(j,"cke:$1")),s}function e(e){var t,n=[];for(t in e)-1<t.indexOf("*")&&n.push(t.replace(/\*/g,".*"));return n.length?new RegExp("^(?:"+n.join("|")+")$"):null}function $(e){var t,n=e.attributes;delete n.style,delete n["class"],(t=CKEDITOR.tools.writeCssText(e.styles,!0))&&(n.style=t),e.classes.length&&(n["class"]=e.classes.sort().join(" "))}function w(e){switch(e.name){case"a":if(!(e.children.length||e.attributes.name||e.attributes.id))return!1;break;case"img":if(!e.attributes.src)return!1}return!0}function k(t){if(!t)return!1;if(!0===t)return!0;var n=e(t);return function(e){return e in t||n&&e.match(n)}}function f(){return new CKEDITOR.htmlParser.element("br")}function m(e){return e.type==CKEDITOR.NODE_ELEMENT&&("br"==e.name||D.$block[e.name])}function g(e,t,n){var i=e.name;if(D.$empty[i]||!e.children.length)"hr"==i&&"br"==t?e.replaceWith(f()):(e.parent&&n.push({check:"it",el:e.parent}),e.remove());else if(D.$block[i]||"tr"==i)if("br"==t)e.previous&&!m(e.previous)&&(t=f()).insertBefore(e),e.next&&!m(e.next)&&(t=f()).insertAfter(e),e.replaceWithChildren();else{var a;i=e.children;e:{a=D[t];for(var s,o=0,r=i.length;o<r;++o)if((s=i[o]).type==CKEDITOR.NODE_ELEMENT&&!a[s.name]){a=!1;break e}a=!0}if(a)e.name=t,e.attributes={},n.push({check:"parent-down",el:e});else{var l,c;for(o=(a=e.parent).type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||"body"==a.name,r=i.length;0<r;)s=i[--r],o&&(s.type==CKEDITOR.NODE_TEXT||s.type==CKEDITOR.NODE_ELEMENT&&D.$inline[s.name])?(l||((l=new CKEDITOR.htmlParser.element(t)).insertAfter(e),n.push({check:"parent-down",el:l})),l.add(s,0)):(l=null,c=D[a.name]||D.span,s.insertAfter(e),a.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||s.type!=CKEDITOR.NODE_ELEMENT||c[s.name]||n.push({check:"el-up",el:s}));e.remove()}}else i in{style:1,script:1}?e.remove():(e.parent&&n.push({check:"it",el:e.parent}),e.replaceWithChildren())}function C(e,t,n){var i,a;for(i=0;i<n.length;++i)if(!((a=n[i]).check&&!e.check(a.check,!1)||a.left&&!a.left(t))){a.right(t,B);break}}function n(e,t){var n,i,a,s,o=t.getDefinition(),r=o.attributes,l=o.styles;if(e.name!=o.element)return!1;for(n in r)if("class"==n){for(o=r[n].split(/\s+/),a=e.classes.join("|");s=o.pop();)if(-1==a.indexOf(s))return!1}else if(e.attributes[n]!=r[n])return!1;for(i in l)if(e.styles[i]!=l[i])return!1;return!0}function E(e,n){var t,i;return"string"==typeof e?t=e:e instanceof CKEDITOR.style?i=e:(t=e[0],i=e[1]),[{element:t,left:i,right:function(e,t){t.transform(e,n)}}]}function T(t){return function(e){return n(e,t)}}function x(n){return function(e,t){t[n](e)}}var a,I,D=CKEDITOR.dtd,O=CKEDITOR.tools.copy,S=CKEDITOR.tools.trim,R=["","p","br","div"];CKEDITOR.FILTER_SKIP_TREE=2,CKEDITOR.filter=function(e){if(this.allowedContent=[],this.disallowedContent=[],this.elementCallbacks=null,this.disabled=!1,this.editor=null,this.id=CKEDITOR.tools.getNextNumber(),this._={allowedRules:{elements:{},generic:[]},disallowedRules:{elements:{},generic:[]},transformations:{},cachedTests:{}},CKEDITOR.filter.instances[this.id]=this,e instanceof CKEDITOR.editor){e=this.editor=e,this.customConfig=!0;var t=e.config.allowedContent;!0===t?this.disabled=!0:(t||(this.customConfig=!1),this.allow(t,"config",1),this.allow(e.config.extraAllowedContent,"extra",1),this.allow(R[e.enterMode]+" "+R[e.shiftEnterMode],"default",1),this.disallow(e.config.disallowedContent))}else this.customConfig=!1,this.allow(e,"default",1)},CKEDITOR.filter.instances={},CKEDITOR.filter.prototype={allow:function(e,t,n){if(!l(this,e,n))return!1;var i,a;if("string"==typeof e)e=_(e);else if(e instanceof CKEDITOR.style){if(e.toAllowedContentRules)return this.allow(e.toAllowedContentRules(this.editor),t,n);i=e.getDefinition(),e={},n=i.attributes,e[i.element]=i={styles:i.styles,requiredStyles:i.styles&&CKEDITOR.tools.objectKeys(i.styles)},n&&(n=O(n),i.classes=n["class"]?n["class"].split(/\s+/):null,i.requiredClasses=i.classes,delete n["class"],i.attributes=n,i.requiredAttributes=n&&CKEDITOR.tools.objectKeys(n))}else if(CKEDITOR.tools.isArray(e)){for(i=0;i<e.length;++i)a=this.allow(e[i],t,n);return a}return s(this,e,t,this.allowedContent,this._.allowedRules),!0},applyTo:function(e,o,t,n){if(this.disabled)return!1;var r,i,a,l=this,c=[],d=this.editor&&this.editor.config.protectedSource,u=!1,_={doFilter:!t,doTransform:!0,doCallbacks:!0,toHtml:o};for(e.forEach(function(e){if(e.type==CKEDITOR.NODE_ELEMENT){if("off"==e.attributes["data-cke-filter"])return!1;if(!o||"span"!=e.name||!~CKEDITOR.tools.objectKeys(e.attributes).join("|").indexOf("data-cke-"))if(1&(r=p(l,e,c,_)))u=!0;else if(2&r)return!1}else if(e.type==CKEDITOR.NODE_COMMENT&&e.value.match(/^\{cke_protected\}(?!\{C\})/)){var t;e:{var n,i,a,s=decodeURIComponent(e.value.replace(/^\{cke_protected\}/,""));if(t=[],d)for(i=0;i<d.length;++i)if((a=s.match(d[i]))&&a[0].length==s.length){t=!0;break e}1==(s=CKEDITOR.htmlParser.fragment.fromHtml(s)).children.length&&(n=s.children[0]).type==CKEDITOR.NODE_ELEMENT&&p(l,n,t,_),t=!t.length}t||c.push(e)}},null,!0),c.length&&(u=!0),e=[],n=R[n||(this.editor?this.editor.enterMode:CKEDITOR.ENTER_P)];t=c.pop();)t.type==CKEDITOR.NODE_ELEMENT?g(t,n,e):t.remove();for(;i=e.pop();)if((t=i.el).parent)switch(a=D[t.parent.name]||D.span,i.check){case"it":D.$removeEmpty[t.name]&&!t.children.length?g(t,n,e):w(t)||g(t,n,e);break;case"el-up":t.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||a[t.name]||g(t,n,e);break;case"parent-down":t.parent.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT||a[t.name]||g(t.parent,n,e)}return u},checkFeature:function(e){return!(!this.disabled&&e)||(e.toFeature&&(e=e.toFeature(this.editor)),!e.requiredContent||this.check(e.requiredContent))},disable:function(){this.disabled=!0},disallow:function(e){return!!l(this,e,!0)&&("string"==typeof e&&(e=_(e)),s(this,e,null,this.disallowedContent,this._.disallowedRules),!0)},addContentForms:function(e){if(!this.disabled&&e){var t,n,i,a=[];for(t=0;t<e.length&&!i;++t)("string"==typeof(n=e[t])||n instanceof CKEDITOR.style)&&this.check(n)&&(i=n);if(i){for(t=0;t<e.length;++t)a.push(E(e[t],i));this.addTransformations(a)}}},addElementCallback:function(e){this.elementCallbacks||(this.elementCallbacks=[]),this.elementCallbacks.push(e)},addFeature:function(e){return!(!this.disabled&&e)||(e.toFeature&&(e=e.toFeature(this.editor)),this.allow(e.allowedContent,e.name),this.addTransformations(e.contentTransformations),this.addContentForms(e.contentForms),!e.requiredContent||!this.customConfig&&!this.disallowedContent.length||this.check(e.requiredContent))},addTransformations:function(e){var t,n;if(!this.disabled&&e){var i,a=this._.transformations;for(i=0;i<e.length;++i){t=e[i];var s=void 0,o=void 0,r=void 0,l=void 0,c=void 0,d=void 0;for(n=[],o=0;o<t.length;++o)"string"==typeof(r=t[o])?(l=(r=r.split(/\s*:\s*/))[0],c=null,d=r[1]):(l=r.check,c=r.left,d=r.right),s||(s=(s=r).element?s.element:l?l.match(/^([a-z0-9]+)/i)[0]:s.left.getDefinition().element),c instanceof CKEDITOR.style&&(c=T(c)),n.push({check:l==s?null:l,left:c,right:"string"==typeof d?x(d):d});a[t=s]||(a[t]=[]),a[t].push(n)}}},check:function(e,t,n){if(this.disabled)return!0;if(CKEDITOR.tools.isArray(e)){for(var i=e.length;i--;)if(this.check(e[i],t,n))return!0;return!1}var a,s;if("string"==typeof e){if((s=e+"<"+(!1===t?"0":"1")+(n?"1":"0")+">")in this._.cachedChecks)return this._.cachedChecks[s];a=(i=_(e).$1).styles;var o=i.classes;i.name=i.elements,i.classes=o=o?o.split(/\s*,\s*/):[],i.styles=u(a),i.attributes=u(i.attributes),i.children=[],o.length&&(i.attributes["class"]=o.join(" ")),a&&(i.attributes.style=CKEDITOR.tools.writeCssText(i.styles)),a=i}else a=(i=e.getDefinition()).styles,o=i.attributes||{},a&&!CKEDITOR.tools.isEmpty(a)?(a=O(a),o.style=CKEDITOR.tools.writeCssText(a,!0)):a={},a={name:i.element,attributes:o,classes:o["class"]?o["class"].split(/\s+/):[],styles:a,children:[]};o=CKEDITOR.tools.clone(a);var r,l=[];if(!1!==t&&(r=this._.transformations[a.name])){for(i=0;i<r.length;++i)C(this,a,r[i]);$(a)}return p(this,o,l,{doFilter:!0,doTransform:!1!==t,skipRequired:!n,skipFinalValidation:!n}),t=!(0<l.length)&&!!CKEDITOR.tools.objectCompare(a.attributes,o.attributes,!0),"string"==typeof e&&(this._.cachedChecks[s]=t),t},getAllowedEnterMode:(a=["p","div","br"],I={p:CKEDITOR.ENTER_P,div:CKEDITOR.ENTER_DIV,br:CKEDITOR.ENTER_BR},function(e,t){var n,i=a.slice();if(this.check(R[e]))return e;for(t||(i=i.reverse());n=i.pop();)if(this.check(n))return I[n];return CKEDITOR.ENTER_BR}),destroy:function(){delete CKEDITOR.filter.instances[this.id],delete this._,delete this.allowedContent,delete this.disallowedContent}};var B,N={styles:1,attributes:1,classes:1},F={styles:"requiredStyles",attributes:"requiredAttributes",classes:"requiredClasses"},K=/^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,i={styles:/{([^}]+)}/,attrs:/\[([^\]]+)\]/,classes:/\(([^\)]+)\)/},M=/^cke:(object|embed|param)$/,j=/^(object|embed|param)$/;B=CKEDITOR.filter.transformationsTools={sizeToStyle:function(e){this.lengthToStyle(e,"width"),this.lengthToStyle(e,"height")},sizeToAttribute:function(e){this.lengthToAttribute(e,"width"),this.lengthToAttribute(e,"height")},lengthToStyle:function(e,t,n){if(!((n=n||t)in e.styles)){var i=e.attributes[t];i&&(/^\d+$/.test(i)&&(i+="px"),e.styles[n]=i)}delete e.attributes[t]},lengthToAttribute:function(e,t,n){if(!((n=n||t)in e.attributes)){var i=e.styles[t],a=i&&i.match(/^(\d+)(?:\.\d*)?px$/);a?e.attributes[n]=a[1]:"cke-test"==i&&(e.attributes[n]="cke-test")}delete e.styles[t]},alignmentToStyle:function(e){if(!("float"in e.styles)){var t=e.attributes.align;"left"!=t&&"right"!=t||(e.styles["float"]=t)}delete e.attributes.align},alignmentToAttribute:function(e){if(!("align"in e.attributes)){var t=e.styles["float"];"left"!=t&&"right"!=t||(e.attributes.align=t)}delete e.styles["float"]},splitBorderShorthand:function(t){function e(e){t.styles["border-top-width"]=n[e[0]],t.styles["border-right-width"]=n[e[1]],t.styles["border-bottom-width"]=n[e[2]],t.styles["border-left-width"]=n[e[3]]}if(t.styles.border){var n=t.styles.border.match(/([\.\d]+\w+)/g)||["0px"];switch(n.length){case 1:t.styles["border-width"]=n[0];break;case 2:e([0,1,0,1]);break;case 3:e([0,1,2,1]);break;case 4:e([0,1,2,3])}t.styles["border-style"]=t.styles["border-style"]||(t.styles.border.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|initial|inherit)/)||[])[0],t.styles["border-style"]||delete t.styles["border-style"],delete t.styles.border}},listTypeToStyle:function(e){if(e.attributes.type)switch(e.attributes.type){case"a":e.styles["list-style-type"]="lower-alpha";break;case"A":e.styles["list-style-type"]="upper-alpha";break;case"i":e.styles["list-style-type"]="lower-roman";break;case"I":e.styles["list-style-type"]="upper-roman";break;case"1":e.styles["list-style-type"]="decimal";break;default:e.styles["list-style-type"]=e.attributes.type}},splitMarginShorthand:function(t){function e(e){t.styles["margin-top"]=n[e[0]],t.styles["margin-right"]=n[e[1]],t.styles["margin-bottom"]=n[e[2]],t.styles["margin-left"]=n[e[3]]}if(t.styles.margin){var n=t.styles.margin.match(/(\-?[\.\d]+\w+)/g)||["0px"];switch(n.length){case 1:e([0,0,0,0]);break;case 2:e([0,1,0,1]);break;case 3:e([0,1,2,1]);break;case 4:e([0,1,2,3])}delete t.styles.margin}},matchesStyle:n,transform:function(e,t){if("string"==typeof t)e.name=t;else{var n,i,a,s,o=t.getDefinition(),r=o.styles,l=o.attributes;for(n in e.name=o.element,l)if("class"==n)for(o=e.classes.join("|"),a=l[n].split(/\s+/);s=a.pop();)-1==o.indexOf(s)&&e.classes.push(s);else e.attributes[n]=l[n];for(i in r)e.styles[i]=r[i]}}}}(),CKEDITOR.focusManager=function(e){return e.focusManager?e.focusManager:(this.hasFocus=!1,this.currentActive=null,this._={editor:e},this)},CKEDITOR.focusManager._={blurDelay:200},CKEDITOR.focusManager.prototype={focus:function(e){this._.timer&&clearTimeout(this._.timer),e&&(this.currentActive=e),this.hasFocus||this._.locked||((e=CKEDITOR.currentInstance)&&e.focusManager.blur(1),this.hasFocus=!0,(e=this._.editor.container)&&e.addClass("cke_focus"),this._.editor.fire("focus"))},lock:function(){this._.locked=1},unlock:function(){delete this._.locked},blur:function(e){function t(){if(this.hasFocus){this.hasFocus=!1;var e=this._.editor.container;e&&e.removeClass("cke_focus"),this._.editor.fire("blur")}}if(!this._.locked){this._.timer&&clearTimeout(this._.timer);var n=CKEDITOR.focusManager._.blurDelay;e||!n?t.call(this):this._.timer=CKEDITOR.tools.setTimeout(function(){delete this._.timer,t.call(this)},n,this)}},add:function(e,t){if(!(n=e.getCustomData("focusmanager"))||n!=this){n&&n.remove(e);var n="focus",i="blur";t&&(CKEDITOR.env.ie?(n="focusin",i="focusout"):CKEDITOR.event.useCapture=1);var a={blur:function(){e.equals(this.currentActive)&&this.blur()},focus:function(){this.focus(e)}};e.on(n,a.focus,this),e.on(i,a.blur,this),t&&(CKEDITOR.event.useCapture=0),e.setCustomData("focusmanager",this),e.setCustomData("focusmanager_handlers",a)}},remove:function(e){e.removeCustomData("focusmanager");var t=e.removeCustomData("focusmanager_handlers");e.removeListener("blur",t.blur),e.removeListener("focus",t.focus)}},CKEDITOR.keystrokeHandler=function(e){return e.keystrokeHandler?e.keystrokeHandler:(this.keystrokes={},this.blockedKeystrokes={},this._={editor:e},this)},R=function(e){var t=(e=e.data).getKeystroke(),n=this.keystrokes[t],i=this._.editor;return(S=!1===i.fire("key",{keyCode:t,domEvent:e}))||(n&&(S=!1!==i.execCommand(n,{from:"keystrokeHandler"})),S||(S=!!this.blockedKeystrokes[t])),S&&e.preventDefault(!0),!S},B=function(e){S&&(S=!1,e.data.preventDefault(!0))},CKEDITOR.keystrokeHandler.prototype={attach:function(e){e.on("keydown",R,this),CKEDITOR.env.gecko&&CKEDITOR.env.mac&&e.on("keypress",B,this)}},CKEDITOR.lang={languages:{af:1,ar:1,az:1,bg:1,bn:1,bs:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,"en-au":1,"en-ca":1,"en-gb":1,en:1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,is:1,it:1,ja:1,ka:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,ms:1,nb:1,nl:1,no:1,oc:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,"zh-cn":1,zh:1},rtl:{ar:1,fa:1,he:1,ku:1,ug:1},load:function(e,t,n){e&&CKEDITOR.lang.languages[e]||(e=this.detect(t,e));var i=this;t=function(){i[e].dir=i.rtl[e]?"rtl":"ltr",n(e,i[e])},this[e]?t():CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/"+e+".js"),t,this)},detect:function(e,t){var n=this.languages,i=(a=(t=t||navigator.userLanguage||navigator.language||e).toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/))[1],a=a[2];return n[i+"-"+a]?i=i+"-"+a:n[i]||(i=null),CKEDITOR.lang.detect=i?function(){return i}:function(e){return e},i||e}},CKEDITOR.scriptLoader=(N={},F={},{load:function(e,i,t,n){var a="string"==typeof e;a&&(e=[e]),t||(t=CKEDITOR);var s=e.length,o=[],r=[],l=function(e){i&&(a?i.call(t,e):i.call(t,o,r))};if(0===s)l(!0);else{var c=function(e,t){(t?o:r).push(e),--s<=0&&(n&&CKEDITOR.document.getDocumentElement().removeStyle("cursor"),l(t))},d=function(e,t){N[e]=1;var n=F[e];delete F[e];for(var i=0;i<n.length;i++)n[i](e,t)},u=function(e){if(N[e])c(e,!0);else{var t=F[e]||(F[e]=[]);if(t.push(c),!(1<t.length)){var n=new CKEDITOR.dom.element("script");n.setAttributes({type:"text/javascript",src:e}),i&&(CKEDITOR.env.ie&&(CKEDITOR.env.version<=8||CKEDITOR.env.ie9Compat)?n.$.onreadystatechange=function(){"loaded"!=n.$.readyState&&"complete"!=n.$.readyState||(n.$.onreadystatechange=null,d(e,!0))}:(n.$.onload=function(){setTimeout(function(){d(e,!0)},0)},n.$.onerror=function(){d(e,!1)})),n.appendTo(CKEDITOR.document.getHead())}}};n&&CKEDITOR.document.getDocumentElement().setStyle("cursor","wait");for(var _=0;_<s;_++)u(e[_])}},queue:function(){function i(){var e;(e=a[0])&&this.load(e.scriptUrl,e.callback,CKEDITOR,0)}var a=[];return function(e,t){var n=this;a.push({scriptUrl:e,callback:function(){t&&t.apply(this,arguments),a.shift(),i.call(n)}}),1==a.length&&i.call(this)}}()}),CKEDITOR.resourceManager=function(e,t){this.basePath=e,this.fileName=t,this.registered={},this.loaded={},this.externals={},this._={waitingList:{}}},CKEDITOR.resourceManager.prototype={add:function(e,t){if(this.registered[e])throw Error('[CKEDITOR.resourceManager.add] The resource name "'+e+'" is already registered.');var n=this.registered[e]=t||{};return n.name=e,n.path=this.getPath(e),CKEDITOR.fire(e+CKEDITOR.tools.capitalize(this.fileName)+"Ready",n),this.get(e)},get:function(e){return this.registered[e]||null},getPath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(t&&t.dir||this.basePath+e+"/")},getFilePath:function(e){var t=this.externals[e];return CKEDITOR.getUrl(this.getPath(e)+(t?t.file:this.fileName+".js"))},addExternal:function(e,t,n){e=e.split(",");for(var i=0;i<e.length;i++){var a=e[i];n||(t=t.replace(/[^\/]+$/,function(e){return n=e,""})),this.externals[a]={dir:t,file:n||this.fileName+".js"}}},load:function(e,o,r){CKEDITOR.tools.isArray(e)||(e=e?[e]:[]);for(var l=this.loaded,t=this.registered,n=[],c={},d={},i=0;i<e.length;i++){var a=e[i];if(a)if(l[a]||t[a])d[a]=this.get(a);else{var s=this.getFilePath(a);n.push(s),s in c||(c[s]=[]),c[s].push(a)}}CKEDITOR.scriptLoader.load(n,function(e,t){if(t.length)throw Error('[CKEDITOR.resourceManager.load] Resource name "'+c[t[0]].join(",")+'" was not found at "'+t[0]+'".');for(var n=0;n<e.length;n++)for(var i=c[e[n]],a=0;a<i.length;a++){var s=i[a];d[s]=this.get(s),l[s]=1}o.call(r,d)},this)}},CKEDITOR.plugins=new CKEDITOR.resourceManager("plugins/","plugin"),CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(t){var u={};return function(e,r,l){var c={},d=function(e){t.call(this,e,function(e){CKEDITOR.tools.extend(c,e);var t,n=[];for(t in e){var i=e[t],a=i&&i.requires;if(!u[t]){if(i.icons)for(var s=i.icons.split(","),o=s.length;o--;)CKEDITOR.skin.addIcon(s[o],i.path+"icons/"+(CKEDITOR.env.hidpi&&i.hidpi?"hidpi/":"")+s[o]+".png");u[t]=1}if(a)for(a.split&&(a=a.split(",")),i=0;i<a.length;i++)c[a[i]]||n.push(a[i])}if(n.length)d.call(this,n);else{for(t in c)(i=c[t]).onLoad&&!i.onLoad._called&&(!1===i.onLoad()&&delete c[t],i.onLoad._called=1);r&&r.call(l||window,c)}},this)};d.call(this,e)}}),CKEDITOR.plugins.setLang=function(e,t,n){var i=this.get(e);e=i.langEntries||(i.langEntries={}),(i=i.lang||(i.lang=[])).split&&(i=i.split(",")),-1==CKEDITOR.tools.indexOf(i,t)&&i.push(t),e[t]=n},CKEDITOR.ui=function(e){return e.ui?e.ui:(this.items={},this.instances={},this.editor=e,this._={handlers:{}},this)},CKEDITOR.ui.prototype={add:function(e,t,n){n.name=e.toLowerCase();var i=this.items[e]={type:t,command:n.command||null,args:Array.prototype.slice.call(arguments,2)};CKEDITOR.tools.extend(i,n)},get:function(e){return this.instances[e]},create:function(e){var t=this.items[e],n=t&&this._.handlers[t.type],i=t&&t.command&&this.editor.getCommand(t.command);n=n&&n.create.apply(this,t.args);return this.instances[e]=n,i&&i.uiItems.push(n),n&&!n.type&&(n.type=t.type),n},addHandler:function(e,t){this._.handlers[e]=t},space:function(e){return CKEDITOR.document.getById(this.spaceId(e))},spaceId:function(e){return this.editor.id+"_"+e}},CKEDITOR.event.implementOn(CKEDITOR.ui),function(){function e(e,t,n){if(CKEDITOR.event.call(this),e=e&&CKEDITOR.tools.clone(e),void 0!==t){if(!(t instanceof CKEDITOR.dom.element))throw Error("Expect element of type CKEDITOR.dom.element.");if(!n)throw Error("One of the element modes must be specified.");if(CKEDITOR.env.ie&&CKEDITOR.env.quirks&&n==CKEDITOR.ELEMENT_MODE_INLINE)throw Error("Inline element mode is not supported on IE quirks.");if(!a(t,n))throw Error('The specified element mode is not supported on element: "'+t.getName()+'".');this.element=t,this.elementMode=n,this.name=this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO&&(t.getId()||t.getNameAtt())}else this.elementMode=CKEDITOR.ELEMENT_MODE_NONE;this._={},this.commands={},this.templates={},this.name=this.name||i(),this.id=CKEDITOR.tools.getNextId(),this.status="unloaded",this.config=CKEDITOR.tools.prototypedCopy(CKEDITOR.config),this.ui=new CKEDITOR.ui(this),this.focusManager=new CKEDITOR.focusManager(this),this.keystrokeHandler=new CKEDITOR.keystrokeHandler(this),this.on("readOnly",s),this.on("selectionChange",function(e){r(this,e.data.path)}),this.on("activeFilterChange",function(){r(this,this.elementPath(),!0)}),this.on("mode",s),this.on("instanceReady",function(){this.config.startupFocus&&this.focus()}),CKEDITOR.fire("instanceCreated",null,this),CKEDITOR.add(this),CKEDITOR.tools.setTimeout(function(){"destroyed"!==this.status?c(this,e):CKEDITOR.warn("editor-incorrect-destroy")},0,this)}function i(){do{var e="editor"+ ++p}while(CKEDITOR.instances[e]);return e}function a(e,t){return t==CKEDITOR.ELEMENT_MODE_INLINE?e.is(CKEDITOR.dtd.$editable)||e.is("textarea"):t==CKEDITOR.ELEMENT_MODE_REPLACE?!e.is(CKEDITOR.dtd.$nonBodyContent):1}function s(){var e,t=this.commands;for(e in t)o(this,t[e])}function o(e,t){t[t.startDisabled?"disable":e.readOnly&&!t.readOnly?"disable":t.modes[e.mode]?"enable":"disable"]()}function r(e,t,n){if(t){var i,a,s=e.commands;for(a in s)i=s[a],(n||i.contextSensitive)&&i.refresh(e,t)}}function l(e){if(!(t=e.config.customConfig))return!1;var t=CKEDITOR.getUrl(t),n=f[t]||(f[t]={});return n.fn?(n.fn.call(e,e.config),CKEDITOR.getUrl(e.config.customConfig)!=t&&l(e)||e.fireOnce("customConfigLoaded")):CKEDITOR.scriptLoader.queue(t,function(){n.fn=CKEDITOR.editorConfig?CKEDITOR.editorConfig:function(){},l(e)}),!0}function c(t,n){t.on("customConfigLoaded",function(){if(n){if(n.on)for(var e in n.on)t.on(e,n.on[e]);CKEDITOR.tools.extend(t.config,n,!0),delete t.config.on}e=t.config,t.readOnly=!!e.readOnly||(t.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?t.element.is("textarea")?t.element.hasAttribute("disabled")||t.element.hasAttribute("readonly"):t.element.isReadOnly():t.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(t.element.hasAttribute("disabled")||t.element.hasAttribute("readonly"))),t.blockless=t.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&!(t.element.is("textarea")||CKEDITOR.dtd[t.element.getName()].p),t.tabIndex=e.tabIndex||t.element&&t.element.getAttribute("tabindex")||0,t.activeEnterMode=t.enterMode=t.blockless?CKEDITOR.ENTER_BR:e.enterMode,t.activeShiftEnterMode=t.shiftEnterMode=t.blockless?CKEDITOR.ENTER_BR:e.shiftEnterMode,e.skin&&(CKEDITOR.skinName=e.skin),t.fireOnce("configLoaded"),t.dataProcessor=new CKEDITOR.htmlDataProcessor(t),t.filter=t.activeFilter=new CKEDITOR.filter(t),d(t)}),n&&null!=n.customConfig&&(t.config.customConfig=n.customConfig),l(t)||t.fireOnce("customConfigLoaded")}function d(e){CKEDITOR.skin.loadPart("editor",function(){t(e)})}function t(i){CKEDITOR.lang.load(i.config.language,i.config.defaultLanguage,function(e,t){var n=i.config.title;i.langCode=e,i.lang=CKEDITOR.tools.prototypedCopy(t),i.title="string"==typeof n||!1===n?n:[i.lang.editor,i.name].join(", "),i.config.contentsLangDirection||(i.config.contentsLangDirection=i.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?i.element.getDirection(1):i.lang.dir),i.fire("langLoaded"),u(i)})}function u(t){t.getStylesSet(function(e){t.once("loaded",function(){t.fire("stylesSet",{styles:e})},null,null,1),n(t)})}function n(d){var u=d.config,e=u.plugins,t=u.extraPlugins,n=u.removePlugins;if(t){var i=new RegExp("(?:^|,)(?:"+t.replace(/\s*,\s*/g,"|")+")(?=,|$)","g");e=(e=e.replace(i,""))+","+t}if(n){var _=new RegExp("(?:^|,)(?:"+n.replace(/\s*,\s*/g,"|")+")(?=,|$)","g");e=e.replace(_,"")}CKEDITOR.env.air&&(e+=",adobeair"),CKEDITOR.plugins.load(e.split(","),function(e){var a=[],s=[],t=[];for(var n in d.plugins=e){var i,o=e[n],r=o.lang,l=null,c=o.requires;if(CKEDITOR.tools.isArray(c)&&(c=c.join(",")),c&&(i=c.match(_)))for(;c=i.pop();)CKEDITOR.error("editor-plugin-required",{plugin:c.replace(",",""),requiredBy:n});r&&!d.lang[n]&&(r.split&&(r=r.split(",")),0<=CKEDITOR.tools.indexOf(r,d.langCode)?l=d.langCode:l=(l=d.langCode.replace(/-.*/,""))!=d.langCode&&0<=CKEDITOR.tools.indexOf(r,l)?l:0<=CKEDITOR.tools.indexOf(r,"en")?"en":r[0],o.langEntries&&o.langEntries[l]?(d.lang[n]=o.langEntries[l],l=null):t.push(CKEDITOR.getUrl(o.path+"lang/"+l+".js"))),s.push(l),a.push(o)}CKEDITOR.scriptLoader.load(t,function(){for(var e=["beforeInit","init","afterInit"],t=0;t<e.length;t++)for(var n=0;n<a.length;n++){var i=a[n];0===t&&s[n]&&i.lang&&i.langEntries&&(d.lang[i.name]=i.langEntries[s[n]]),i[e[t]]&&i[e[t]](d)}for(d.fireOnce("pluginsLoaded"),u.keystrokes&&d.setKeystroke(d.config.keystrokes),n=0;n<d.config.blockedKeystrokes.length;n++)d.keystrokeHandler.blockedKeystrokes[d.config.blockedKeystrokes[n]]=1;d.status="loaded",d.fireOnce("loaded"),CKEDITOR.fire("instanceLoaded",null,d)})})}function _(){var e=this.element;if(e&&this.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO){var t=this.getData();return this.config.htmlEncodeOutput&&(t=CKEDITOR.tools.htmlEncode(t)),e.is("textarea")?e.setValue(t):e.setHtml(t),!0}return!1}function h(e,t){function n(e){var t=e.startContainer,n=e.endContainer;return!(!t.is||!(t.is("tr")||t.is("td")&&t.equals(n)&&e.endOffset===t.getChildCount()))}function i(e){var t=e.startContainer;return t.is("tr")?e.cloneContents():t.clone(!0)}for(var a,s,o,r=new CKEDITOR.dom.documentFragment,l=0;l<e.length;l++){var c=e[l],d=c.startContainer.getAscendant("tr",!0);n(c)?(a||((a=d.getAscendant("table").clone()).append(d.getAscendant({thead:1,tbody:1,tfoot:1}).clone()),r.append(a),a=a.findOne("thead, tbody, tfoot")),s&&s.equals(d)||(o=(s=d).clone(),a.append(o)),o.append(i(c))):r.append(c.cloneContents())}return a?r:t.getHtmlFromRange(e[0])}e.prototype=CKEDITOR.editor.prototype,CKEDITOR.editor=e;var p=0,f={};CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{addCommand:function(e,t){t.name=e.toLowerCase();var n=new CKEDITOR.command(this,t);return this.mode&&o(this,n),this.commands[e]=n},_attachToForm:function(){function t(e){n.updateElement(),n._.required&&!i.getValue()&&!1===n.fire("required")&&e.data.preventDefault()}function e(e){return!!(e&&e.call&&e.apply)}var n=this,i=n.element,a=new CKEDITOR.dom.element(i.$.form);i.is("textarea")&&a&&(a.on("submit",t),e(a.$.submit)&&(a.$.submit=CKEDITOR.tools.override(a.$.submit,function(e){return function(){t(),e.apply?e.apply(this):e()}})),n.on("destroy",function(){a.removeListener("submit",t)}))},destroy:function(e){this.fire("beforeDestroy"),!e&&_.call(this),this.editable(null),this.filter&&(this.filter.destroy(),delete this.filter),delete this.activeFilter,this.status="destroyed",this.fire("destroy"),this.removeAllListeners(),CKEDITOR.remove(this),CKEDITOR.fire("instanceDestroyed",null,this)},elementPath:function(e){if(!e){if(!(e=this.getSelection()))return null;e=e.getStartElement()}return e?new CKEDITOR.dom.elementPath(e,this.editable()):null},createRange:function(){var e=this.editable();return e?new CKEDITOR.dom.range(e):null},execCommand:function(e,t){var n=this.getCommand(e),i={name:e,commandData:t||{},command:n};return!(!n||n.state==CKEDITOR.TRISTATE_DISABLED||!1===this.fire("beforeCommandExec",i)||(i.returnValue=n.exec(i.commandData),n.async||!1===this.fire("afterCommandExec",i)))&&i.returnValue},getCommand:function(e){return this.commands[e]},getData:function(e){!e&&this.fire("beforeGetData");var t=this._.data;return"string"!=typeof t&&(t=(t=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?t.is("textarea")?t.getValue():t.getHtml():""),t={dataValue:t},!e&&this.fire("getData",t),t.dataValue},getSnapshot:function(){var e=this.fire("getSnapshot");return"string"!=typeof e&&(e=(e=this.element)&&this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE?e.is("textarea")?e.getValue():e.getHtml():""),e},loadSnapshot:function(e){this.fire("loadSnapshot",e)},setData:function(e,t,n){var i=!0,a=t;t&&"object"==typeof t&&(n=t.internal,a=t.callback,i=!t.noSnapshot),!n&&i&&this.fire("saveSnapshot"),!a&&n||this.once("dataReady",function(e){!n&&i&&this.fire("saveSnapshot"),a&&a.call(e.editor)}),e={dataValue:e},!n&&this.fire("setData",e),this._.data=e.dataValue,!n&&this.fire("afterSetData",e)},setReadOnly:function(e){e=null==e||e,this.readOnly!=e&&(this.readOnly=e,this.keystrokeHandler.blockedKeystrokes[8]=+e,this.editable().setReadOnly(e),this.fire("readOnly"))},insertHtml:function(e,t,n){this.fire("insertHtml",{dataValue:e,mode:t,range:n})},insertText:function(e){this.fire("insertText",e)},insertElement:function(e){this.fire("insertElement",e)},getSelectedHtml:function(e){var t=this.editable(),n=(n=this.getSelection())&&n.getRanges();return t&&n&&0!==n.length?(t=h(n,t),e?t.getHtml():t):null},extractSelectedHtml:function(e,t){var n,i=this.editable(),a=this.getSelection().getRanges(),s=new CKEDITOR.dom.documentFragment;if(!i||0===a.length)return null;for(n=0;n<a.length;n++)s.append(i.extractHtmlFromRange(a[n],t));return t||this.getSelection().selectRanges([a[0]]),e?s.getHtml():s},focus:function(){this.fire("beforeFocus")},checkDirty:function(){return"ready"==this.status&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){this._.previousValue=this.getSnapshot()},updateElement:function(){return _.call(this)},setKeystroke:function(e){for(var t,n,i=this.keystrokeHandler.keystrokes,a=CKEDITOR.tools.isArray(e)?e:[[].slice.call(arguments,0)],s=a.length;s--;)t=a[s],n=0,CKEDITOR.tools.isArray(t)&&(n=t[1],t=t[0]),n?i[t]=n:delete i[t]},getCommandKeystroke:function(e){if(e="string"==typeof e?this.getCommand(e):e){var t,n=CKEDITOR.tools.object.findKey(this.commands,e),i=this.keystrokeHandler.keystrokes;if(e.fakeKeystroke)return e.fakeKeystroke;for(t in i)if(i.hasOwnProperty(t)&&i[t]==n)return t}return null},addFeature:function(e){return this.filter.addFeature(e)},setActiveFilter:function(e){e||(e=this.filter),this.activeFilter!==e&&(this.activeFilter=e,this.fire("activeFilterChange"),e===this.filter?this.setActiveEnterMode(null,null):this.setActiveEnterMode(e.getAllowedEnterMode(this.enterMode),e.getAllowedEnterMode(this.shiftEnterMode,!0)))},setActiveEnterMode:function(e,t){e=e?this.blockless?CKEDITOR.ENTER_BR:e:this.enterMode,t=t?this.blockless?CKEDITOR.ENTER_BR:t:this.shiftEnterMode,this.activeEnterMode==e&&this.activeShiftEnterMode==t||(this.activeEnterMode=e,this.activeShiftEnterMode=t,this.fire("activeEnterModeChange"))},showNotification:function(e){alert(e)}})}(),CKEDITOR.ELEMENT_MODE_NONE=0,CKEDITOR.ELEMENT_MODE_REPLACE=1,CKEDITOR.ELEMENT_MODE_APPENDTO=2,CKEDITOR.ELEMENT_MODE_INLINE=3,CKEDITOR.htmlParser=function(){this._={htmlPartsRegex:/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g}},K=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,M={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1},CKEDITOR.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(e){for(var t,n,i,a=0;t=this._.htmlPartsRegex.exec(e);)if(a<(n=t.index)&&(a=e.substring(a,n),i?i.push(a):this.onText(a)),a=this._.htmlPartsRegex.lastIndex,!(n=t[1])||(n=n.toLowerCase(),i&&CKEDITOR.dtd.$cdata[n]&&(this.onCDATA(i.join("")),i=null),i))if(i)i.push(t[0]);else if(n=t[3]){if(n=n.toLowerCase(),!/="/.test(n)){var s,o={},r=t[4];if(t=!!t[5],r)for(;s=K.exec(r);){var l=s[1].toLowerCase();s=s[2]||s[3]||s[4]||"",o[l]=!s&&M[l]?l:CKEDITOR.tools.htmlDecodeAttr(s)}this.onTagOpen(n,o,t),!i&&CKEDITOR.dtd.$cdata[n]&&(i=[])}}else(n=t[2])&&this.onComment(n);else this.onTagClose(n);e.length>a&&this.onText(e.substring(a,e.length))}},CKEDITOR.htmlParser.basicWriter=CKEDITOR.tools.createClass({$:function(){this._={output:[]}},proto:{openTag:function(e){this._.output.push("<",e)},openTagClose:function(e,t){t?this._.output.push(" />"):this._.output.push(">")},attribute:function(e,t){"string"==typeof t&&(t=CKEDITOR.tools.htmlEncodeAttr(t)),this._.output.push(" ",e,'="',t,'"')},closeTag:function(e){this._.output.push("</",e,">")},text:function(e){this._.output.push(e)},comment:function(e){this._.output.push("<!--",e,"-->")},write:function(e){this._.output.push(e)},reset:function(){this._.output=[],this._.indent=!1},getHtml:function(e){var t=this._.output.join("");return e&&this.reset(),t}}}),CKEDITOR.htmlParser.node=function(){},CKEDITOR.htmlParser.node.prototype={remove:function(){var e=this.parent.children,t=CKEDITOR.tools.indexOf(e,this),n=this.previous,i=this.next;n&&(n.next=i),i&&(i.previous=n),e.splice(t,1),this.parent=null},replaceWith:function(e){var t=this.parent.children,n=CKEDITOR.tools.indexOf(t,this),i=e.previous=this.previous,a=e.next=this.next;i&&(i.next=e),a&&(a.previous=e),(t[n]=e
).parent=this.parent,this.parent=null},insertAfter:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e),i=e.next;t.splice(n+1,0,this),this.next=e.next,(this.previous=e).next=this,i&&(i.previous=this),this.parent=e.parent},insertBefore:function(e){var t=e.parent.children,n=CKEDITOR.tools.indexOf(t,e);t.splice(n,0,this),this.next=e,(this.previous=e.previous)&&(e.previous.next=this),(e.previous=this).parent=e.parent},getAscendant:function(t){for(var e="function"==typeof t?t:"string"==typeof t?function(e){return e.name==t}:function(e){return e.name in t},n=this.parent;n&&n.type==CKEDITOR.NODE_ELEMENT;){if(e(n))return n;n=n.parent}return null},wrapWith:function(e){return this.replaceWith(e),e.add(this),e},getIndex:function(){return CKEDITOR.tools.indexOf(this.parent.children,this)},getFilterContext:function(e){return e||{}}},CKEDITOR.htmlParser.comment=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.comment.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_COMMENT,filter:function(e,t){var n=this.value;return(n=e.onComment(t,n,this))?"string"!=typeof n?(this.replaceWith(n),!1):(this.value=n,!0):(this.remove(),!1)},writeHtml:function(e,t){t&&this.filter(t),e.comment(this.value)}}),CKEDITOR.htmlParser.text=function(e){this.value=e,this._={isBlockLike:!1}},CKEDITOR.htmlParser.text.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(e,t){if(!(this.value=e.onText(t,this.value,this)))return this.remove(),!1},writeHtml:function(e,t){t&&this.filter(t),e.text(this.value)}}),CKEDITOR.htmlParser.cdata=function(e){this.value=e},CKEDITOR.htmlParser.cdata.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_TEXT,filter:function(){},writeHtml:function(e){e.write(this.value)}}),CKEDITOR.htmlParser.fragment=function(){this.children=[],this.parent=null,this._={isBlockLike:!0,hasInlineStarted:!1}},function(){function A(e){return!e.attributes["data-cke-survive"]&&("a"==e.name&&e.attributes.href||CKEDITOR.dtd.$removeEmpty[e.name])}var v=CKEDITOR.tools.extend({table:1,ul:1,ol:1,dl:1},CKEDITOR.dtd.table,CKEDITOR.dtd.ul,CKEDITOR.dtd.ol,CKEDITOR.dtd.dl),b={ol:1,ul:1},y=CKEDITOR.tools.extend({},{html:1},CKEDITOR.dtd.html,CKEDITOR.dtd.body,CKEDITOR.dtd.head,{style:1,script:1}),i={ul:"li",ol:"li",dl:"dd",table:"tbody",tbody:"tr",thead:"tr",tfoot:"tr",tr:"td"};CKEDITOR.htmlParser.fragment.fromHtml=function(e,t,o){function a(e){var t;if(0<h.length)for(var n=0;n<h.length;n++){var i=h[n],a=i.name,s=CKEDITOR.dtd[a],o=f.name&&CKEDITOR.dtd[f.name];o&&!o[a]||e&&s&&!s[e]&&CKEDITOR.dtd[e]?a==f.name&&(l(f,f.parent,1),n--):(t||(r(),t=1),(i=i.clone()).parent=f,f=i,h.splice(n,1),n--)}}function r(){for(;p.length;)l(p.shift(),f)}function s(e){if(e._.isBlockLike&&"pre"!=e.name&&"textarea"!=e.name){var t,n=e.children.length,i=e.children[n-1];i&&i.type==CKEDITOR.NODE_TEXT&&((t=CKEDITOR.tools.rtrim(i.value))?i.value=t:e.children.length=n-1)}}function l(e,t,n){t=t||f||_;var i=f;void 0===e.previous&&(c(t,e)&&(f=t,u.onTagOpen(o,{}),e.returnPoint=t=f),s(e),A(e)&&!e.children.length||t.add(e),"pre"==e.name&&(g=!1),"textarea"==e.name&&(m=!1)),e.returnPoint?(f=e.returnPoint,delete e.returnPoint):f=n?t:i}function c(e,t){var n,i;if((e==_||"body"==e.name)&&o&&(!e.name||CKEDITOR.dtd[e.name][o]))return(n=t.attributes&&(i=t.attributes["data-cke-real-element-type"])?i:t.name)&&n in CKEDITOR.dtd.$inline&&!(n in CKEDITOR.dtd.head)&&!t.isOrphan||t.type==CKEDITOR.NODE_TEXT}function d(e,t){return(e in CKEDITOR.dtd.$listItem||e in CKEDITOR.dtd.$tableContent)&&(e==t||"dt"==e&&"dd"==t||"dd"==e&&"dt"==t)}var u=new CKEDITOR.htmlParser,_=t instanceof CKEDITOR.htmlParser.element?t:"string"==typeof t?new CKEDITOR.htmlParser.element(t):new CKEDITOR.htmlParser.fragment,h=[],p=[],f=_,m="textarea"==_.name,g="pre"==_.name;for(u.onTagOpen=function(e,t,n,i){if((t=new CKEDITOR.htmlParser.element(e,t)).isUnknown&&n&&(t.isEmpty=!0),t.isOptionalClose=i,A(t))h.push(t);else{if("pre"==e)g=!0;else{if("br"==e&&g)return void f.add(new CKEDITOR.htmlParser.text("\n"));"textarea"==e&&(m=!0)}if("br"==e)p.push(t);else{for(;i=(n=f.name)?CKEDITOR.dtd[n]||(f._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):y,!(t.isUnknown||f.isUnknown||i[e]);)if(f.isOptionalClose)u.onTagClose(n);else if(e in b&&n in b)(n=(n=f.children)[n.length-1])&&"li"==n.name||l(n=new CKEDITOR.htmlParser.element("li"),f),!t.returnPoint&&(t.returnPoint=f),f=n;else if(e in CKEDITOR.dtd.$listItem&&!d(e,n))u.onTagOpen("li"==e?"ul":"dl",{},0,1);else if(n in v&&!d(e,n))!t.returnPoint&&(t.returnPoint=f),f=f.parent;else{if(n in CKEDITOR.dtd.$inline&&h.unshift(f),!f.parent){t.isOrphan=1;break}l(f,f.parent,1)}a(e),r(),t.parent=f,t.isEmpty?l(t):f=t}}},u.onTagClose=function(e){for(var t=h.length-1;0<=t;t--)if(e==h[t].name)return void h.splice(t,1);for(var n=[],i=[],a=f;a!=_&&a.name!=e;)a._.isBlockLike||i.unshift(a),n.push(a),a=a.returnPoint||a.parent;if(a!=_){for(t=0;t<n.length;t++){var s=n[t];l(s,s.parent)}(f=a)._.isBlockLike&&r(),l(a,a.parent),a==f&&(f=f.parent),h=h.concat(i)}"body"==e&&(o=!1)},u.onText=function(e){if(f._.hasInlineStarted&&!p.length||g||m||0!==(e=CKEDITOR.tools.ltrim(e)).length){var t=f.name,n=t?CKEDITOR.dtd[t]||(f._.isBlockLike?CKEDITOR.dtd.div:CKEDITOR.dtd.span):y;!m&&!n["#"]&&t in v?(u.onTagOpen(i[t]||""),u.onText(e)):(r(),a(),g||m||(e=e.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," ")),e=new CKEDITOR.htmlParser.text(e),c(f,e)&&this.onTagOpen(o,{},0,1),f.add(e))}},u.onCDATA=function(e){f.add(new CKEDITOR.htmlParser.cdata(e))},u.onComment=function(e){r(),a(),f.add(new CKEDITOR.htmlParser.comment(e))},u.parse(e),r();f!=_;)l(f,f.parent,1);return s(_),_},CKEDITOR.htmlParser.fragment.prototype={type:CKEDITOR.NODE_DOCUMENT_FRAGMENT,add:function(e,t){isNaN(t)&&(t=this.children.length);var n=0<t?this.children[t-1]:null;if(n){if(e._.isBlockLike&&n.type==CKEDITOR.NODE_TEXT&&(n.value=CKEDITOR.tools.rtrim(n.value),0===n.value.length))return this.children.pop(),void this.add(e);n.next=e}e.previous=n,(e.parent=this).children.splice(t,0,e),this._.hasInlineStarted||(this._.hasInlineStarted=e.type==CKEDITOR.NODE_TEXT||e.type==CKEDITOR.NODE_ELEMENT&&!e._.isBlockLike)},filter:function(e,t){t=this.getFilterContext(t),e.onRoot(t,this),this.filterChildren(e,!1,t)},filterChildren:function(e,t,n){if(this.childrenFilteredBy!=e.id)for(n=this.getFilterContext(n),t&&!this.parent&&e.onRoot(n,this),this.childrenFilteredBy=e.id,t=0;t<this.children.length;t++)!1===this.children[t].filter(e,n)&&t--},writeHtml:function(e,t){t&&this.filter(t),this.writeChildrenHtml(e)},writeChildrenHtml:function(e,t,n){var i=this.getFilterContext();for(n&&!this.parent&&t&&t.onRoot(i,this),t&&this.filterChildren(t,!1,i),t=0,i=(n=this.children).length;t<i;t++)n[t].writeHtml(e)},forEach:function(e,t,n){if(!(n||t&&this.type!=t))var i=e(this);if(!1!==i){n=this.children;for(var a=0;a<n.length;a++)(i=n[a]).type==CKEDITOR.NODE_ELEMENT?i.forEach(e,t):t&&i.type!=t||e(i)}},getFilterContext:function(e){return e||{}}}}(),function(){function o(){this.rules=[]}function i(e,t,n,i){var a,s;for(a in t)(s=e[a])||(s=e[a]=new o),s.add(t[a],n,i)}CKEDITOR.htmlParser.filter=CKEDITOR.tools.createClass({$:function(e){this.id=CKEDITOR.tools.getNextNumber(),this.elementNameRules=new o,this.attributeNameRules=new o,this.elementsRules={},this.attributesRules={},this.textRules=new o,this.commentRules=new o,this.rootRules=new o,e&&this.addRules(e,10)},proto:{addRules:function(e,t){var n;"number"==typeof t?n=t:t&&"priority"in t&&(n=t.priority),"number"!=typeof n&&(n=10),"object"!=typeof t&&(t={}),e.elementNames&&this.elementNameRules.addMany(e.elementNames,n,t),e.attributeNames&&this.attributeNameRules.addMany(e.attributeNames,n,t),e.elements&&i(this.elementsRules,e.elements,n,t),e.attributes&&i(this.attributesRules,e.attributes,n,t),e.text&&this.textRules.add(e.text,n,t),e.comment&&this.commentRules.add(e.comment,n,t),e.root&&this.rootRules.add(e.root,n,t)},applyTo:function(e){e.filter(this)},onElementName:function(e,t){return this.elementNameRules.execOnName(e,t)},onAttributeName:function(e,t){return this.attributeNameRules.execOnName(e,t)},onText:function(e,t,n){return this.textRules.exec(e,t,n)},onComment:function(e,t,n){return this.commentRules.exec(e,t,n)},onRoot:function(e,t){return this.rootRules.exec(e,t)},onElement:function(e,t){for(var n,i=[this.elementsRules["^"],this.elementsRules[t.name],this.elementsRules.$],a=0;a<3;a++)if(n=i[a]){if(!1===(n=n.exec(e,t,this)))return null;if(n&&n!=t)return this.onNode(e,n);if(t.parent&&!t.name)break}return t},onNode:function(e,t){var n=t.type;return n==CKEDITOR.NODE_ELEMENT?this.onElement(e,t):n==CKEDITOR.NODE_TEXT?new CKEDITOR.htmlParser.text(this.onText(e,t.value)):n==CKEDITOR.NODE_COMMENT?new CKEDITOR.htmlParser.comment(this.onComment(e,t.value)):null},onAttribute:function(e,t,n,i){return(n=this.attributesRules[n])?n.exec(e,i,t,this):i}}}),(CKEDITOR.htmlParser.filterRulesGroup=o).prototype={add:function(e,t,n){this.rules.splice(this.findIndex(t),0,{value:e,priority:t,options:n})},addMany:function(e,t,n){for(var i=[this.findIndex(t),0],a=0,s=e.length;a<s;a++)i.push({value:e[a],priority:t,options:n});this.rules.splice.apply(this.rules,i)},findIndex:function(e){for(var t=this.rules,n=t.length-1;0<=n&&e<t[n].priority;)n--;return n+1},exec:function(e,t){var n,i,a,s,o=t instanceof CKEDITOR.htmlParser.node||t instanceof CKEDITOR.htmlParser.fragment,r=Array.prototype.slice.call(arguments,1),l=this.rules,c=l.length;for(s=0;s<c;s++)if(o&&(n=t.type,i=t.name),a=l[s],!(e.nonEditable&&!a.options.applyToAll||e.nestedEditable&&a.options.excludeNestedEditable)){if(!1===(a=a.value.apply(null,r))||o&&a&&(a.name!=i||a.type!=n))return a;null!=a&&(r[0]=t=a)}return t},execOnName:function(e,t){for(var n,i=0,a=this.rules,s=a.length;t&&i<s;i++)n=a[i],e.nonEditable&&!n.options.applyToAll||e.nestedEditable&&n.options.excludeNestedEditable||(t=t.replace(n.value[0],n.value[1]));return t}}}(),function(){function n(e,t){function r(e){return e||CKEDITOR.env.needsNbspFiller?new CKEDITOR.htmlParser.text("\xa0"):new CKEDITOR.htmlParser.element("br",{"data-cke-bogus":1})}function n(s,o){return function(e){if(e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var t,n,i=[],a=d(e);if(a)for(l(a,1)&&i.push(a);a;)h(a)&&(t=u(a))&&l(t)&&((n=u(t))&&!h(n)?i.push(t):(r(c).insertAfter(t),t.remove())),a=a.previous;for(a=0;a<i.length;a++)i[a].remove();(i=!s||!1!==("function"==typeof o?o(e):o))&&((c||CKEDITOR.env.needsBrFiller||e.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT)&&(c||CKEDITOR.env.needsBrFiller||!(7<document.documentMode||e.name in CKEDITOR.dtd.tr||e.name in CKEDITOR.dtd.$listItem))?i=!(i=d(e))||"form"==e.name&&"input"==i.name:i=!1),i&&e.add(r(s))}}}function l(e,t){return!(c&&!CKEDITOR.env.needsBrFiller||e.type!=CKEDITOR.NODE_ELEMENT||"br"!=e.name||e.attributes["data-cke-eol"])||!!(e.type==CKEDITOR.NODE_TEXT&&(n=e.value.match(A))&&(n.index&&(new CKEDITOR.htmlParser.text(e.value.substring(0,n.index)).insertBefore(e),e.value=n[0]),!CKEDITOR.env.needsBrFiller&&c&&(!t||e.parent.name in o)||!c&&((n=e.previous)&&"br"==n.name||!n||h(n))));var n}var i,a,s={elements:{}},c="html"==t,o=CKEDITOR.tools.extend({},y);for(i in o)"#"in b[i]||delete o[i];for(i in o)s.elements[i]=n(c,e.config.fillEmptyBlocks);return s.root=n(c,!1),s.elements.br=(a=c,function(e){if(e.parent.type!=CKEDITOR.NODE_DOCUMENT_FRAGMENT){var t=e.attributes;if("data-cke-bogus"in t||"data-cke-eol"in t)delete t["data-cke-bogus"];else{for(t=e.next;t&&_(t);)t=t.next;var n=u(e);!t&&h(e.parent)?p(e.parent,r(a)):h(t)&&n&&!h(n)&&r(a).insertBefore(t)}}}),s}function s(e,t){return e!=CKEDITOR.ENTER_BR&&!1!==t&&(e==CKEDITOR.ENTER_DIV?"div":"p")}function d(e){for(e=e.children[e.children.length-1];e&&_(e);)e=e.previous;return e}function u(e){for(e=e.previous;e&&_(e);)e=e.previous;return e}function _(e){return e.type==CKEDITOR.NODE_TEXT&&!CKEDITOR.tools.trim(e.value)||e.type==CKEDITOR.NODE_ELEMENT&&e.attributes["data-cke-bookmark"]}function h(e){return e&&(e.type==CKEDITOR.NODE_ELEMENT&&e.name in y||e.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT)}function p(e,t){var n=e.children[e.children.length-1];e.children.push(t),t.parent=e,n&&((n.next=t).previous=n)}function e(e){"false"!=(e=e.attributes).contenteditable&&(e["data-cke-editable"]=e.contenteditable?"true":1),e.contenteditable="false"}function t(e){switch((e=e.attributes)["data-cke-editable"]){case"true":e.contenteditable="true";break;case"1":delete e.contenteditable}}function o(e){return e.replace(i,function(e,t,n){return"<"+t+n.replace(E,function(e,t){return T.test(t)&&-1==n.indexOf("data-cke-saved-"+t)?" data-cke-saved-"+e+" data-cke-"+CKEDITOR.rnd+"-"+e:e})+">"})}function r(e,t){return e.replace(t,function(e,t,n){return 0===e.indexOf("<textarea")&&(e=t+f(n).replace(/</g,"&lt;").replace(/>/g,"&gt;")+"</textarea>"),"<cke:encoded>"+encodeURIComponent(e)+"</cke:encoded>"})}function l(e){return e.replace(D,function(e,t){return decodeURIComponent(t)})}function c(e){return e.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g,function(e){return"<!--"+v+"{C}"+encodeURIComponent(e).replace(/--/g,"%2D%2D")+"-->"})}function f(e){return e.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g,function(e,t){return decodeURIComponent(t)})}function m(e,t){var n=t._.dataStore;return e.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g,function(e,t){return decodeURIComponent(t)}).replace(/\{cke_protected_(\d+)\}/g,function(e,t){return n&&n[t]||""})}function g(e,a){var i=[],t=a.config.protectedSource,n=a._.dataStore||(a._.dataStore={id:1}),s=/<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g;t=[/<script[\s\S]*?(<\/script>|$)/gi,/<noscript[\s\S]*?<\/noscript>/gi,/<meta[\s\S]*?\/?>/gi].concat(t);e=e.replace(/\x3c!--[\s\S]*?--\x3e/g,function(e){return"<!--{cke_tempcomment}"+(i.push(e)-1)+"-->"});for(var o=0;o<t.length;o++)e=e.replace(t[o],function(e){return e=e.replace(s,function(e,t,n){return i[n]}),/cke_temp(comment)?/.test(e)?e:"<!--{cke_temp}"+(i.push(e)-1)+"-->"});return(e=(e=e.replace(s,function(e,t,n){return"<!--"+v+(t?"{C}":"")+encodeURIComponent(i[n]).replace(/--/g,"%2D%2D")+"-->"})).replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g,function(e){return e.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g,function(e,t){return n[n.id]=decodeURIComponent(t),"{cke_protected_"+n.id+++"}"})})).replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g,function(e,t,n,i){return"<"+t+n+">"+m(f(i),a)+"</"+t+">"})}CKEDITOR.htmlDataProcessor=function(a){var e,t,i=this;this.editor=a,this.dataFilter=e=new CKEDITOR.htmlParser.filter,this.htmlFilter=t=new CKEDITOR.htmlParser.filter,this.writer=new CKEDITOR.htmlParser.basicWriter,e.addRules($),e.addRules(w,{applyToAll:!0}),e.addRules(n(a,"data"),{applyToAll:!0}),t.addRules(k),t.addRules(C,{applyToAll:!0}),t.addRules(n(a,"html"),{applyToAll:!0}),a.on("toHtml",function(e){var t,n,i=(i=(i=(i=(i=r(i=o(i=r(i=g(i=(e=e.data).dataValue,a),I)),x)).replace(O,"$1cke:$2")).replace(R,"<cke:$1$2></cke:$1>")).replace(/(<pre\b[^>]*>)(\r\n|\n)/g,"$1$2$2")).replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi,"$1data-cke-"+CKEDITOR.rnd+"-$2");t=e.context||a.editable().getName(),CKEDITOR.env.ie&&CKEDITOR.env.version<9&&"pre"==t&&(t="div",i="<pre>"+i+"</pre>",n=1),(t=a.document.createElement(t)).setHtml("a"+i),i=(i=t.getHtml().substr(1)).replace(new RegExp("data-cke-"+CKEDITOR.rnd+"-","ig"),""),n&&(i=i.replace(/^<pre>|<\/pre>$/gi,"")),i=f(i=l(i=i.replace(S,"$1$2"))),t=!1!==e.fixForBody&&s(e.enterMode,a.config.autoParagraph),i=CKEDITOR.htmlParser.fragment.fromHtml(i,e.context,t),t&&(!(n=i).children.length&&CKEDITOR.dtd[n.name][t]&&(t=new CKEDITOR.htmlParser.element(t),n.add(t))),e.dataValue=i},null,null,5),a.on("toHtml",function(e){e.data.filter.applyTo(e.data.dataValue,!0,e.data.dontFilter,e.data.enterMode)&&a.fire("dataFiltered")},null,null,6),a.on("toHtml",function(e){e.data.dataValue.filterChildren(i.dataFilter,!0)},null,null,10),a.on("toHtml",function(e){var t=(e=e.data).dataValue,n=new CKEDITOR.htmlParser.basicWriter;t.writeChildrenHtml(n),t=n.getHtml(!0),e.dataValue=c(t)},null,null,15),a.on("toDataFormat",function(e){var t=e.data.dataValue;e.data.enterMode!=CKEDITOR.ENTER_BR&&(t=t.replace(/^<br *\/?>/i,"")),e.data.dataValue=CKEDITOR.htmlParser.fragment.fromHtml(t,e.data.context,s(e.data.enterMode,a.config.autoParagraph))},null,null,5),a.on("toDataFormat",function(e){e.data.dataValue.filterChildren(i.htmlFilter,!0)},null,null,10),a.on("toDataFormat",function(e){e.data.filter.applyTo(e.data.dataValue,!1,!0)},null,null,11),a.on("toDataFormat",function(e){var t=e.data.dataValue,n=i.writer;n.reset(),t.writeChildrenHtml(n),t=m(t=f(t=n.getHtml(!0)),a),e.data.dataValue=t},null,null,15)},CKEDITOR.htmlDataProcessor.prototype={toHtml:function(e,t,n,i){var a,s,o,r,l=this.editor;return t&&"object"==typeof t?(a=t.context,n=t.fixForBody,i=t.dontFilter,s=t.filter,o=t.enterMode,r=t.protectedWhitespaces):a=t,a||null===a||(a=l.editable().getName()),l.fire("toHtml",{dataValue:e,context:a,fixForBody:n,dontFilter:i,filter:s||l.filter,enterMode:o||l.enterMode,protectedWhitespaces:r}).dataValue},toDataFormat:function(e,t){var n,i,a;return t&&(n=t.context,i=t.filter,a=t.enterMode),n||null===n||(n=this.editor.editable().getName()),this.editor.fire("toDataFormat",{dataValue:e,filter:i||this.editor.filter,context:n,enterMode:a||this.editor.enterMode}).dataValue}};var A=/(?:&nbsp;|\xa0)$/,v="{cke_protected}",b=CKEDITOR.dtd,a="caption colgroup col thead tfoot tbody".split(" "),y=CKEDITOR.tools.extend({},b.$blockLimit,b.$block),$={elements:{input:e,textarea:e}},w={attributeNames:[[/^on/,"data-cke-pa-on"],[/^srcdoc/,"data-cke-pa-srcdoc"],[/^data-cke-expando$/,""]],elements:{iframe:function(e){if(e.attributes&&e.attributes.src){var t=e.attributes.src.toLowerCase().replace(/[^a-z]/gi,"");0!==t.indexOf("javascript")&&0!==t.indexOf("data")||(e.attributes["data-cke-pa-src"]=e.attributes.src,delete e.attributes.src)}}}},k={elements:{embed:function(e){if((n=e.parent)&&"object"==n.name){var t=n.attributes.width,n=n.attributes.height;t&&(e.attributes.width=t),n&&(e.attributes.height=n)}},a:function(e){var t=e.attributes;if(!(e.children.length||t.name||t.id||e.attributes["data-cke-saved-name"]))return!1}}},C={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^data-cke-(saved|pa)-/,""],[/^data-cke-.*/,""],["hidefocus",""]],elements:{$:function(e){var t=e.attributes;if(t){if(t["data-cke-temp"])return!1;for(var n=["name","href","src"],i=0;i<n.length;i++)"data-cke-saved-"+n[i]in t&&delete t[n[i]]}return e},table:function(e){e.children.slice(0).sort(function(e,t){var n,i;return e.type==CKEDITOR.NODE_ELEMENT&&t.type==e.type&&(n=CKEDITOR.tools.indexOf(a,e.name),i=CKEDITOR.tools.indexOf(a,t.name)),-1<n&&-1<i&&n!=i||(n=e.parent?e.getIndex():-1,i=t.parent?t.getIndex():-1),i<n?1:-1})},param:function(e){return e.children=[],e.isEmpty=!0,e},span:function(e){"Apple-style-span"==e.attributes["class"]&&delete e.name},html:function(e){delete e.attributes.contenteditable,delete e.attributes["class"]},body:function(e){delete e.attributes.spellcheck,delete e.attributes.contenteditable},style:function(e){var t=e.children[0];t&&t.value&&(t.value=CKEDITOR.tools.trim(t.value)),e.attributes.type||(e.attributes.type="text/css")},title:function(e){var t=e.children[0];!t&&p(e,t=new CKEDITOR.htmlParser.text),t.value=e.attributes["data-cke-title"]||""},input:t,textarea:t},attributes:{"class":function(e){return CKEDITOR.tools.ltrim(e.replace(/(?:^|\s+)cke_[^\s]*/g,""))||!1}}};CKEDITOR.env.ie&&(C.attributes.style=function(e){return e.replace(/(^|;)([^\:]+)/g,function(e){return e.toLowerCase()})});var i=/<(a|area|img|input|source)\b([^>]*)>/gi,E=/([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,T=/^(href|src|name)$/i,x=/(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,I=/(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,D=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,O=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,S=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,R=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi}(),CKEDITOR.htmlParser.element=function(e,t){this.name=e,this.attributes=t||{},this.children=[];var n=e||"",i=n.match(/^cke:(.*)/);i&&(n=i[1]),n=!!(CKEDITOR.dtd.$nonBodyContent[n]||CKEDITOR.dtd.$block[n]||CKEDITOR.dtd.$listItem[n]||CKEDITOR.dtd.$tableContent[n]||CKEDITOR.dtd.$nonEditable[n]||"br"==n),this.isEmpty=!!CKEDITOR.dtd.$empty[e],this.isUnknown=!CKEDITOR.dtd[e],this._={isBlockLike:n,hasInlineStarted:this.isEmpty||!n}},CKEDITOR.htmlParser.cssStyle=function(e){var i={};return((e instanceof CKEDITOR.htmlParser.element?e.attributes.style:e)||"").replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(e,t,n){"font-family"==t&&(n=n.replace(/["']/g,"")),i[t.toLowerCase()]=n}),{rules:i,populate:function(e){var t=this.toString();t&&(e instanceof CKEDITOR.dom.element?e.setAttribute("style",t):e instanceof CKEDITOR.htmlParser.element?e.attributes.style=t:e.style=t)},toString:function(){var e,t=[];for(e in i)i[e]&&t.push(e,":",i[e],";");return t.join("")}}},function(){function i(t){return function(e){return e.type==CKEDITOR.NODE_ELEMENT&&("string"==typeof t?e.name==t:e.name in t)}}var r=function(e,t){return(e=e[0])<(t=t[0])?-1:t<e?1:0},e=CKEDITOR.htmlParser.fragment.prototype;CKEDITOR.htmlParser.element.prototype=CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node,{type:CKEDITOR.NODE_ELEMENT,add:e.add,clone:function(){return new CKEDITOR.htmlParser.element(this.name,this.attributes)},filter:function(e,t){var n,i,a,s,o=this;if((t=o.getFilterContext(t)).off)return!0;for(o.parent||e.onRoot(t,o);;){if(n=o.name,!(i=e.onElementName(t,n)))return this.remove(),!1;if(o.name=i,!(o=e.onElement(t,o)))return this.remove(),!1;if(o!==this)return this.replaceWith(o),!1;if(o.name==n)break;if(o.type!=CKEDITOR.NODE_ELEMENT)return this.replaceWith(o),!1;if(!o.name)return this.replaceWithChildren(),!1}for(a in n=o.attributes){for(i=n[a];;){if(!(s=e.onAttributeName(t,a))){delete n[a];break}if(s==a)break;delete n[a],a=s}s&&(!1===(i=e.onAttribute(t,o,s,i))?delete n[s]:n[s]=i)}return o.isEmpty||this.filterChildren(e,!1,t),!0},filterChildren:e.filterChildren,writeHtml:function(e,t){t&&this.filter(t);var n,i,a=this.name,s=[],o=this.attributes;for(n in e.openTag(a,o),o)s.push([n,o[n]]);for(e.sortAttributes&&s.sort(r),n=0,i=s.length;n<i;n++)o=s[n],e.attribute(o[0],o[1]);e.openTagClose(a,this.isEmpty),this.writeChildrenHtml(e),this.isEmpty||e.closeTag(a)},writeChildrenHtml:e.writeChildrenHtml,replaceWithChildren:function(){for(var e=this.children,t=e.length;t;)e[--t].insertAfter(this);this.remove()},forEach:e.forEach,getFirst:function(e){if(!e)return this.children.length?this.children[0]:null;"function"!=typeof e&&(e=i(e));for(var t=0,n=this.children.length;t<n;++t)if(e(this.children[t]))return this.children[t];return null},getHtml:function(){var e=new CKEDITOR.htmlParser.basicWriter;return this.writeChildrenHtml(e),e.getHtml()},setHtml:function(e){for(var t=0,n=(e=this.children=CKEDITOR.htmlParser.fragment.fromHtml(e).children).length;t<n;++t)e[t].parent=this},getOuterHtml:function(){var e=new CKEDITOR.htmlParser.basicWriter;return this.writeHtml(e),e.getHtml()},split:function(e){for(var t=this.children.splice(e,this.children.length-e),n=this.clone(),i=0;i<t.length;++i)t[i].parent=n;return(n.children=t)[0]&&(t[0].previous=null),0<e&&(this.children[e-1].next=null),this.parent.add(n,this.getIndex()+1),n},find:function(e,t){void 0===t&&(t=!1);var n,i=[];for(n=0;n<this.children.length;n++){var a=this.children[n];"function"==typeof e&&e(a)?i.push(a):"string"==typeof e&&a.name===e&&i.push(a),t&&a.find&&(i=i.concat(a.find(e,t)))}return i},addClass:function(e){if(!this.hasClass(e)){var t=this.attributes["class"]||"";this.attributes["class"]=t+(t?" ":"")+e}},removeClass:function(e){var t=this.attributes["class"];t&&((t=CKEDITOR.tools.trim(t.replace(new RegExp("(?:\\s+|^)"+e+"(?:\\s+|$)")," ")))?this.attributes["class"]=t:delete this.attributes["class"])},hasClass:function(e){var t=this.attributes["class"];return!!t&&new RegExp("(?:^|\\s)"+e+"(?=\\s|$)").test(t)},getFilterContext:function(e){var t=[];if(e||(e={off:!1,nonEditable:!1,nestedEditable:!1}),e.off||"off"!=this.attributes["data-cke-processor"]||t.push("off",!0),e.nonEditable||"false"!=this.attributes.contenteditable?e.nonEditable&&!e.nestedEditable&&"true"==this.attributes.contenteditable&&t.push("nestedEditable",!0):t.push("nonEditable",!0),t.length){e=CKEDITOR.tools.copy(e);for(var n=0;n<t.length;n+=2)e[t[n]]=t[n+1]}return e}},!0)}(),j=/{([^}]+)}/g,CKEDITOR.template=function(e){this.source=String(e)},CKEDITOR.template.prototype.output=function(n,e){var t=this.source.replace(j,function(e,t){return void 0!==n[t]?n[t]:e});return e?e.push(t):t},delete CKEDITOR.loadFullCore,CKEDITOR.instances={},CKEDITOR.document=new CKEDITOR.dom.document(document),CKEDITOR.add=function(e){(CKEDITOR.instances[e.name]=e).on("focus",function(){CKEDITOR.currentInstance!=e&&(CKEDITOR.currentInstance=e,CKEDITOR.fire("currentInstance"))}),e.on("blur",function(){CKEDITOR.currentInstance==e&&(CKEDITOR.currentInstance=null,CKEDITOR.fire("currentInstance"))}),CKEDITOR.fire("instance",null,e)},CKEDITOR.remove=function(e){delete CKEDITOR.instances[e.name]},L={},CKEDITOR.addTemplate=function(e,t){var n=L[e];return n||(n={name:e,source:t},CKEDITOR.fire("template",n),L[e]=new CKEDITOR.template(n.source))},CKEDITOR.getTemplate=function(e){return L[e]},P=[],CKEDITOR.addCss=function(e){P.push(e)},CKEDITOR.getCss=function(){return P.join("\n")},CKEDITOR.on("instanceDestroyed",function(){CKEDITOR.tools.isEmpty(this.instances)&&CKEDITOR.fire("reset")}),CKEDITOR.TRISTATE_ON=1,CKEDITOR.TRISTATE_OFF=2,CKEDITOR.TRISTATE_DISABLED=0,CKEDITOR.inline=function(e,t){if(!CKEDITOR.env.isCompatible)return null;if((e=CKEDITOR.dom.element.get(e)).getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var n=new CKEDITOR.editor(t,e,CKEDITOR.ELEMENT_MODE_INLINE),i=e.is("textarea")?e:null;return i?(n.setData(i.getValue(),null,!0),(e=CKEDITOR.dom.element.createFromHtml('<div contenteditable="'+!!n.readOnly+'" class="cke_textarea_inline">'+i.getValue()+"</div>",CKEDITOR.document)).insertAfter(i),i.hide(),i.$.form&&n._attachToForm()):n.setData(e.getHtml(),null,!0),n.on("loaded",function(){n.fire("uiReady"),n.editable(e),n.container=e,n.ui.contentsElement=e,n.setData(n.getData(1)),n.resetDirty(),n.fire("contentDom"),n.mode="wysiwyg",n.fire("mode"),n.status="ready",n.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,n)},null,null,1e4),n.on("destroy",function(){i&&(n.container.clearCustomData(),n.container.remove(),i.show()),n.element.clearCustomData(),delete n.element}),n},CKEDITOR.inlineAll=function(){var e,t,n;for(n in CKEDITOR.dtd.$editable)for(var i=CKEDITOR.document.getElementsByTag(n),a=0,s=i.count();a<s;a++)"true"==(e=i.getItem(a)).getAttribute("contenteditable")&&(!(t={element:e,config:{}})!==CKEDITOR.fire("inline",t)&&CKEDITOR.inline(e,t.config))},CKEDITOR.domReady(function(){!CKEDITOR.disableAutoInline&&CKEDITOR.inlineAll()}),CKEDITOR.replaceClass="ckeditor",function(){function i(e,t,n,i){if(!CKEDITOR.env.isCompatible)return null;if((e=CKEDITOR.dom.element.get(e)).getEditor())throw'The editor instance "'+e.getEditor().name+'" is already attached to the provided element.';var a=new CKEDITOR.editor(t,e,i);return i==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.setStyle("visibility","hidden"),a._.required=e.hasAttribute("required"),e.removeAttribute("required")),n&&a.setData(n,null,!0),a.on("loaded",function(){o(a),i==CKEDITOR.ELEMENT_MODE_REPLACE&&a.config.autoUpdateElement&&e.$.form&&a._attachToForm(),a.setMode(a.config.startupMode,function(){a.resetDirty(),a.status="ready",a.fireOnce("instanceReady"),CKEDITOR.fire("instanceReady",null,a)})}),a.on("destroy",s),a}function s(){var e=this.container,t=this.element;e&&(e.clearCustomData(),e.remove()),t&&(t.clearCustomData(),this.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(t.show(),this._.required&&t.setAttribute("required","required")),delete this.element)}function o(e){var t=e.name,n=e.element,i=e.elementMode,a=e.fire("uiSpace",{space:"top",html:""}).html,s=e.fire("uiSpace",{space:"bottom",html:""}).html,o=new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} '+CKEDITOR.env.cssClass+'"  dir="{langDir}" lang="{langCode}" role="application"'+(e.title?' aria-labelledby="cke_{name}_arialbl"':"")+">"+(e.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':"")+'<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>');t=CKEDITOR.dom.element.createFromHtml(o.output({id:e.id,name:t,langDir:e.lang.dir,langCode:e.langCode,voiceLabel:e.title,topHtml:a?'<span id="'+e.ui.spaceId("top")+'" class="cke_top cke_reset_all" role="presentation" style="height:auto">'+a+"</span>":"",contentId:e.ui.spaceId("contents"),bottomHtml:s?'<span id="'+e.ui.spaceId("bottom")+'" class="cke_bottom cke_reset_all" role="presentation">'+s+"</span>":"",outerEl:CKEDITOR.env.ie?"span":"div"}));i==CKEDITOR.ELEMENT_MODE_REPLACE?(n.hide(),t.insertAfter(n)):n.append(t),e.container=t,e.ui.contentsElement=e.ui.space("contents"),a&&e.ui.space("top").unselectable(),s&&e.ui.space("bottom").unselectable(),n=e.config.width,i=e.config.height,n&&t.setStyle("width",CKEDITOR.tools.cssLength(n)),i&&e.ui.space("contents").setStyle("height",CKEDITOR.tools.cssLength(i)),t.disableContextMenu(),CKEDITOR.env.webkit&&t.on("focus",function(){e.focus()}),e.fireOnce("uiReady")}CKEDITOR.replace=function(e,t){return i(e,t,null,CKEDITOR.ELEMENT_MODE_REPLACE)},CKEDITOR.appendTo=function(e,t,n){return i(e,t,n,CKEDITOR.ELEMENT_MODE_APPENDTO)},CKEDITOR.replaceAll=function(e){for(var t=document.getElementsByTagName("textarea"),n=0;n<t.length;n++){var i=null,a=t[n];if(a.name||a.id){if("string"==typeof e){if(!new RegExp("(?:^|\\s)"+e+"(?:$|\\s)").test(a.className))continue}else if("function"==typeof e&&!(i={})===e(a,i))continue;this.replace(a,i)}}},CKEDITOR.editor.prototype.addMode=function(e,t){(this._.modes||(this._.modes={}))[e]=t},CKEDITOR.editor.prototype.setMode=function(e,t){var n=this,i=this._.modes;if(e!=n.mode&&i&&i[e]){if(n.fire("beforeSetMode",e),n.mode){var a,s=n.checkDirty(),o=(i=n._.previousModeData,0);n.fire("beforeModeUnload"),n.editable(0),n._.previousMode=n.mode,n._.previousModeData=a=n.getData(1),"source"==n.mode&&i==a&&(n.fire("lockSnapshot",{forceUpdate:!0}),o=1),n.ui.space("contents").setHtml(""),n.mode=""}else n._.previousModeData=n.getData(1);this._.modes[e](function(){n.mode=e,void 0!==s&&!s&&n.resetDirty(),o?n.fire("unlockSnapshot"):"wysiwyg"==e&&n.fire("saveSnapshot"),setTimeout(function(){n.fire("mode"),t&&t.call(n)},0)})}},CKEDITOR.editor.prototype.resize=function(e,t,n,i){var a=this.container,s=this.ui.space("contents"),o=CKEDITOR.env.webkit&&this.document&&this.document.getWindow().$.frameElement;(i=i?this.container.getFirst(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.hasClass("cke_inner")}):a).setSize("width",e,!0),o&&(o.style.width="1%");var r=(i.$.offsetHeight||0)-(s.$.clientHeight||0);a=Math.max(t-(n?0:r),0);t=n?t+r:t,s.setStyle("height",a+"px"),o&&(o.style.width="100%"),this.fire("resize",{outerHeight:t,contentsHeight:a,outerWidth:e||i.getSize("width")})},CKEDITOR.editor.prototype.getResizable=function(e){return e?this.ui.space("contents"):this.container},CKEDITOR.domReady(function(){CKEDITOR.replaceClass&&CKEDITOR.replaceAll(CKEDITOR.replaceClass)})}(),CKEDITOR.config.startupMode="wysiwyg",function(){function i(e){var t,n=e.editor,i=e.data.path,a=i.blockLimit,s=e.data.selection,o=s.getRanges()[0];(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller)&&(s=r(s,i))&&(s.appendBogus(),t=CKEDITOR.env.ie),K(n,i.block,a)&&o.collapsed&&!o.getCommonAncestor().isReadOnly()&&((i=o.clone()).enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS),(a=new CKEDITOR.dom.walker(i)).guard=function(e){return!F(e)||e.type==CKEDITOR.NODE_COMMENT||e.isReadOnly()},!a.checkForward()||i.checkStartOfBlock()&&i.checkEndOfBlock())&&(n=o.fixBlock(!0,n.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p"),CKEDITOR.env.needsBrFiller||(n=n.getFirst(F))&&n.type==CKEDITOR.NODE_TEXT&&CKEDITOR.tools.trim(n.getText()).match(/^(?:&nbsp;|\xa0)$/)&&n.remove(),t=1,e.cancel()),t&&o.select()}function r(e,t){if(e.isFake)return 0;var n=t.block||t.blockLimit,i=n&&n.getLast(F);return!n||!n.isBlockBoundary()||i&&i.type==CKEDITOR.NODE_ELEMENT&&i.isBlockBoundary()||n.is("pre")||n.getBogus()?void 0:n}function s(e){var t=e.data.getTarget();t.is("input")&&("submit"!=(t=t.getAttribute("type"))&&"reset"!=t||e.data.preventDefault())}function F(e){return _(e)&&c(e)}
function a(n,i){return function(e){var t=e.data.$.toElement||e.data.$.fromElement||e.data.$.relatedTarget;(t=t&&t.nodeType==CKEDITOR.NODE_ELEMENT?new CKEDITOR.dom.element(t):null)&&(i.equals(t)||i.contains(t))||n.call(this,e)}}function u(e){function t(n){return function(e,t){if(t&&e.type==CKEDITOR.NODE_ELEMENT&&e.is(a)&&(i=e),!(t||!F(e)||n&&d(e)))return!1}}var i,n=e.getRanges()[0];e=e.root;var a={table:1,ul:1,ol:1,dl:1};if(n.startPath().contains(a)){var s=n.clone();if(s.collapse(1),s.setStartAt(e,CKEDITOR.POSITION_AFTER_START),(e=new CKEDITOR.dom.walker(s)).guard=t(),e.checkBackward(),i)return(s=n.clone()).collapse(),s.setEndAt(i,CKEDITOR.POSITION_AFTER_END),(e=new CKEDITOR.dom.walker(s)).guard=t(!0),i=!1,e.checkForward(),i}return null}function K(e,t,n){return!1!==e.config.autoParagraph&&e.activeEnterMode!=CKEDITOR.ENTER_BR&&(e.editable().equals(n)&&!t||t&&"true"==t.getAttribute("contenteditable"))}function M(e){return e.activeEnterMode!=CKEDITOR.ENTER_BR&&!1!==e.config.autoParagraph&&(e.activeEnterMode==CKEDITOR.ENTER_DIV?"div":"p")}function o(e){var t=e.editor;t.getSelection().scrollIntoView(),setTimeout(function(){t.fire("saveSnapshot")},0)}function l(e,t,n){var i=e.getCommonAncestor(t);for(t=e=n?t:e;(e=e.getParent())&&!i.equals(e)&&1==e.getChildCount();)t=e;t.remove()}var _,c,h,d,p,f,m,g,t,A;CKEDITOR.editable=CKEDITOR.tools.createClass({base:CKEDITOR.dom.element,$:function(e,t){this.base(t.$||t),this.editor=e,this.status="unloaded",this.hasFocus=!1,this.setup()},proto:{focus:function(){var e;if(CKEDITOR.env.webkit&&!this.hasFocus&&(e=this.editor._.previousActive||this.getDocument().getActive(),this.contains(e)))e.focus();else{CKEDITOR.env.edge&&14<CKEDITOR.env.version&&!this.hasFocus&&this.getDocument().equals(CKEDITOR.document)&&(this.editor._.previousScrollTop=this.$.scrollTop);try{if(!CKEDITOR.env.ie||CKEDITOR.env.edge&&14<CKEDITOR.env.version||!this.getDocument().equals(CKEDITOR.document))if(CKEDITOR.env.chrome){var t=this.$.scrollTop;this.$.focus(),this.$.scrollTop=t}else this.$.focus();else this.$.setActive()}catch(F){if(!CKEDITOR.env.ie)throw F}CKEDITOR.env.safari&&!this.isInline()&&((e=CKEDITOR.document.getActive()).equals(this.getWindow().getFrame())||this.getWindow().focus())}},on:function(e,t){var n=Array.prototype.slice.call(arguments,0);return CKEDITOR.env.ie&&/^focus|blur$/.exec(e)&&(e="focus"==e?"focusin":"focusout",t=a(t,this),n[0]=e,n[1]=t),CKEDITOR.dom.element.prototype.on.apply(this,n)},attachListener:function(e){!this._.listeners&&(this._.listeners=[]);var t=Array.prototype.slice.call(arguments,1);t=e.on.apply(e,t);return this._.listeners.push(t),t},clearListeners:function(){var e=this._.listeners;try{for(;e.length;)e.pop().removeListener()}catch(s){}},restoreAttrs:function(){var e,t,n=this._.attrChanges;for(t in n)n.hasOwnProperty(t)&&(null!==(e=n[t])?this.setAttribute(t,e):this.removeAttribute(t))},attachClass:function(e){var t=this.getCustomData("classes");this.hasClass(e)||(!t&&(t=[]),t.push(e),this.setCustomData("classes",t),this.addClass(e))},changeAttr:function(e,t){var n=this.getAttribute(e);t!==n&&(!this._.attrChanges&&(this._.attrChanges={}),e in this._.attrChanges||(this._.attrChanges[e]=n),this.setAttribute(e,t))},insertText:function(e){this.editor.focus(),this.insertHtml(this.transformPlainTextToHtml(e),"text")},transformPlainTextToHtml:function(e){var t=this.editor.getSelection().getStartElement().hasAscendant("pre",!0)?CKEDITOR.ENTER_BR:this.editor.activeEnterMode;return CKEDITOR.tools.transformPlainTextToHtml(e,t)},insertHtml:function(e,t,n){var i=this.editor;i.focus(),i.fire("saveSnapshot"),n||(n=i.getSelection().getRanges()[0]),f(this,t||"html",e,n),n.select(),o(this),this.editor.fire("afterInsertHtml",{})},insertHtmlIntoRange:function(e,t,n){f(this,n||"html",e,t),this.editor.fire("afterInsertHtml",{intoRange:t})},insertElement:function(e,t){(i=this.editor).focus(),i.fire("saveSnapshot");var n=i.activeEnterMode,i=i.getSelection(),a=e.getName();a=CKEDITOR.dtd.$block[a];t||(t=i.getRanges()[0]),this.insertElementIntoRange(e,t)&&(t.moveToPosition(e,CKEDITOR.POSITION_AFTER_END),a&&((a=e.getNext(function(e){return F(e)&&!d(e)}))&&a.type==CKEDITOR.NODE_ELEMENT&&a.is(CKEDITOR.dtd.$block)?a.getDtd()["#"]?t.moveToElementEditStart(a):t.moveToElementEditEnd(e):a||n==CKEDITOR.ENTER_BR||(a=t.fixBlock(!0,n==CKEDITOR.ENTER_DIV?"div":"p"),t.moveToElementEditStart(a)))),i.selectRanges([t]),o(this)},insertElementIntoSelection:function(e){this.insertElement(e)},insertElementIntoRange:function(e,t){var n,i,a=this.editor,s=a.config.enterMode,o=e.getName(),r=CKEDITOR.dtd.$block[o];if(t.checkReadOnly())return!1;if(t.deleteContents(1),t.startContainer.type==CKEDITOR.NODE_ELEMENT&&(t.startContainer.is({tr:1,table:1,tbody:1,thead:1,tfoot:1})?m(t):t.startContainer.is(CKEDITOR.dtd.$list)&&g(t)),r)for(;(n=t.getCommonAncestor(0,1))&&(i=CKEDITOR.dtd[n.getName()])&&(!i||!i[o]);)n.getName()in CKEDITOR.dtd.span?t.splitElement(n):t.checkStartOfBlock()&&t.checkEndOfBlock()?(t.setStartBefore(n),t.collapse(!0),n.remove()):t.splitBlock(s==CKEDITOR.ENTER_DIV?"div":"p",a.editable());return t.insertNode(e),!0},setData:function(e,t){t||(e=this.editor.dataProcessor.toHtml(e)),this.setHtml(e),this.fixInitialSelection(),"unloaded"==this.status&&(this.status="ready"),this.editor.fire("dataReady")},getData:function(e){var t=this.getHtml();return e||(t=this.editor.dataProcessor.toDataFormat(t)),t},setReadOnly:function(e){this.setAttribute("contenteditable",!e)},detach:function(){this.removeClass("cke_editable"),this.status="detached";var e=this.editor;this._.detach(),delete e.document,delete e.window},isInline:function(){return this.getDocument().equals(CKEDITOR.document)},fixInitialSelection:function(){function e(){var e,t=i.getDocument().$,n=t.getSelection();e:if(n.anchorNode&&n.anchorNode==i.$)e=!0;else{if(CKEDITOR.env.webkit&&(e=i.getDocument().getActive())&&e.equals(i)&&!n.anchorNode){e=!0;break e}e=void 0}e&&((e=new CKEDITOR.dom.range(i)).moveToElementEditStart(i),(t=t.createRange()).setStart(e.startContainer.$,e.startOffset),t.collapse(!0),n.removeAllRanges(),n.addRange(t))}function t(){var e=i.getDocument().$,t=e.selection,n=i.getDocument().getActive();"None"==t.type&&n.equals(i)&&(t=new CKEDITOR.dom.range(i),e=e.body.createTextRange(),t.moveToElementEditStart(i),(t=t.startContainer).type!=CKEDITOR.NODE_ELEMENT&&(t=t.getParent()),e.moveToElementText(t.$),e.collapse(!0),e.select())}var i=this;CKEDITOR.env.ie&&(CKEDITOR.env.version<9||CKEDITOR.env.quirks)?this.hasFocus&&(this.focus(),t()):this.hasFocus?(this.focus(),e()):this.once("focus",function(){e()},null,null,-999)},getHtmlFromRange:function(e){return e.collapsed?new CKEDITOR.dom.documentFragment(e.document):(e={doc:this.getDocument(),range:e.clone()},t.eol.detect(e,this),t.bogus.exclude(e),t.cell.shrink(e),e.fragment=e.range.cloneContents(),t.tree.rebuild(e,this),t.eol.fix(e,this),new CKEDITOR.dom.documentFragment(e.fragment.$))},extractHtmlFromRange:function(e,t){var n=A,i={range:e,doc:e.document},a=this.getHtmlFromRange(e);if(e.collapsed)return e.optimize(),a;if(e.enlarge(CKEDITOR.ENLARGE_INLINE,1),n.table.detectPurge(i),i.bookmark=e.createBookmark(),delete i.range,(o=this.editor.createRange()).moveToPosition(i.bookmark.startNode,CKEDITOR.POSITION_BEFORE_START),i.targetBookmark=o.createBookmark(),n.list.detectMerge(i,this),n.table.detectRanges(i,this),n.block.detectMerge(i,this),i.tableContentsRanges?(n.table.deleteRanges(i),e.moveToBookmark(i.bookmark),i.range=e):(e.moveToBookmark(i.bookmark),(i.range=e).extractContents(n.detectExtractMerge(i))),e.moveToBookmark(i.targetBookmark),e.optimize(),n.fixUneditableRangePosition(e),n.list.merge(i,this),n.table.purge(i,this),n.block.merge(i,this),t){if(n=e.startPath(),i=e.checkStartOfBlock()&&e.checkEndOfBlock()&&n.block&&!e.root.equals(n.block)){e:{var s,o=0;if(i=n.block.getElementsByTag("span"))for(;s=i.getItem(o++);)if(!c(s)){i=!0;break e}i=!1}i=!i}i&&(e.moveToPosition(n.block,CKEDITOR.POSITION_BEFORE_START),n.block.remove())}else n.autoParagraph(this.editor,e),h(e.startContainer)&&e.startContainer.appendBogus();return e.startContainer.mergeSiblings(),a},setup:function(){var c=this.editor;if(this.attachListener(c,"beforeGetData",function(){var e=this.getData();this.is("textarea")||!1!==c.config.ignoreEmptyParagraph&&(e=e.replace(p,function(e,t){return t})),c.setData(e,null,1)},this),this.attachListener(c,"getSnapshot",function(e){e.data=this.getData(1)},this),this.attachListener(c,"afterSetData",function(){this.setData(c.getData(1))},this),this.attachListener(c,"loadSnapshot",function(e){this.setData(e.data,1)},this),this.attachListener(c,"beforeFocus",function(){var e=c.getSelection();(e=e&&e.getNative())&&"Control"==e.type||this.focus()},this),this.attachListener(c,"insertHtml",function(e){this.insertHtml(e.data.dataValue,e.data.mode,e.data.range)},this),this.attachListener(c,"insertElement",function(e){this.insertElement(e.data)},this),this.attachListener(c,"insertText",function(e){this.insertText(e.data)},this),this.setReadOnly(c.readOnly),this.attachClass("cke_editable"),c.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?this.attachClass("cke_editable_inline"):c.elementMode!=CKEDITOR.ELEMENT_MODE_REPLACE&&c.elementMode!=CKEDITOR.ELEMENT_MODE_APPENDTO||this.attachClass("cke_editable_themed"),this.attachClass("cke_contents_"+c.config.contentsLangDirection),c.keystrokeHandler.blockedKeystrokes[8]=+c.readOnly,c.keystrokeHandler.attach(this),this.on("blur",function(){this.hasFocus=!1},null,null,-1),this.on("focus",function(){this.hasFocus=!0},null,null,-1),CKEDITOR.env.webkit&&this.on("scroll",function(){c._.previousScrollTop=c.editable().$.scrollTop},null,null,-1),CKEDITOR.env.edge&&14<CKEDITOR.env.version){var t=function(){var e=c.editable();null!=c._.previousScrollTop&&e.getDocument().equals(CKEDITOR.document)&&(e.$.scrollTop=c._.previousScrollTop,c._.previousScrollTop=null,this.removeListener("scroll",t))};this.on("scroll",t)}if(c.focusManager.add(this),this.equals(CKEDITOR.document.getActive())&&(this.hasFocus=!0,c.once("contentDom",function(){c.focusManager.focus(this)},this)),this.isInline()&&this.changeAttr("tabindex",c.tabIndex),!this.is("textarea")){c.document=this.getDocument(),c.window=this.getWindow();var e=c.document;this.changeAttr("spellcheck",!c.config.disableNativeSpellChecker);var n=c.config.contentsLangDirection;this.getDirection(1)!=n&&this.changeAttr("dir",n);var i=CKEDITOR.getCss();if(i){var a=(n=e.getHead()).getCustomData("stylesheet");a?i!=a.getText()&&(CKEDITOR.env.ie&&CKEDITOR.env.version<9?a.$.styleSheet.cssText=i:a.setText(i)):(i=e.appendStyleText(i),i=new CKEDITOR.dom.element(i.ownerNode||i.owningElement),n.setCustomData("stylesheet",i),i.data("cke-temp",1))}n=e.getCustomData("stylesheet_ref")||0,e.setCustomData("stylesheet_ref",n+1),this.setCustomData("cke_includeReadonly",!c.config.disableReadonlyStyling),this.attachListener(this,"click",function(e){e=e.data;var t=new CKEDITOR.dom.elementPath(e.getTarget(),this).contains("a");t&&2!=e.$.button&&t.isReadOnly()&&e.preventDefault()});var d={8:1,46:1};this.attachListener(c,"key",function(e){if(c.readOnly)return!0;var t,n=e.data.domEvent.getKey();if(0!==(e=c.getSelection()).getRanges().length){if(n in d){var i,a,s,o,r=e.getRanges()[0],l=r.startPath();n=8==n;CKEDITOR.env.ie&&CKEDITOR.env.version<11&&(i=e.getSelectedElement())||(i=u(e))?(c.fire("saveSnapshot"),r.moveToPosition(i,CKEDITOR.POSITION_BEFORE_START),i.remove(),r.select(),c.fire("saveSnapshot"),t=1):r.collapsed&&((a=l.block)&&(o=a[n?"getPrevious":"getNext"](_))&&o.type==CKEDITOR.NODE_ELEMENT&&o.is("table")&&r[n?"checkStartOfBlock":"checkEndOfBlock"]()?(c.fire("saveSnapshot"),r[n?"checkEndOfBlock":"checkStartOfBlock"]()&&a.remove(),r["moveToElementEdit"+(n?"End":"Start")](o),r.select(),c.fire("saveSnapshot"),t=1):l.blockLimit&&l.blockLimit.is("td")&&(s=l.blockLimit.getAscendant("table"))&&r.checkBoundaryOfElement(s,n?CKEDITOR.START:CKEDITOR.END)&&(o=s[n?"getPrevious":"getNext"](_))?(c.fire("saveSnapshot"),r["moveToElementEdit"+(n?"End":"Start")](o),r.checkStartOfBlock()&&r.checkEndOfBlock()?o.remove():r.select(),c.fire("saveSnapshot"),t=1):(s=l.contains(["td","th","caption"]))&&r.checkBoundaryOfElement(s,n?CKEDITOR.START:CKEDITOR.END)&&(t=1))}return!t}}),c.blockless&&CKEDITOR.env.ie&&CKEDITOR.env.needsBrFiller&&this.attachListener(this,"keyup",function(e){e.data.getKeystroke()in d&&!this.getFirst(F)&&(this.appendBogus(),(e=c.createRange()).moveToPosition(this,CKEDITOR.POSITION_AFTER_START),e.select())}),this.attachListener(this,"dblclick",function(e){if(c.readOnly)return!1;e={element:e.data.getTarget()},c.fire("doubleclick",e)}),CKEDITOR.env.ie&&this.attachListener(this,"click",s),CKEDITOR.env.ie&&!CKEDITOR.env.edge||this.attachListener(this,"mousedown",function(e){var t=e.data.getTarget();t.is("img","hr","input","textarea","select")&&!t.isReadOnly()&&(c.getSelection().selectElement(t),t.is("input","textarea","select")&&e.data.preventDefault())}),CKEDITOR.env.edge&&this.attachListener(this,"mouseup",function(e){(e=e.data.getTarget())&&e.is("img")&&c.getSelection().selectElement(e)}),CKEDITOR.env.gecko&&this.attachListener(this,"mouseup",function(e){if(2==e.data.$.button&&!(e=e.data.getTarget()).getOuterHtml().replace(p,"")){var t=c.createRange();t.moveToElementEditStart(e),t.select(!0)}}),CKEDITOR.env.webkit&&(this.attachListener(this,"click",function(e){e.data.getTarget().is("input","select")&&e.data.preventDefault()}),this.attachListener(this,"mouseup",function(e){e.data.getTarget().is("input","textarea")&&e.data.preventDefault()})),CKEDITOR.env.webkit&&this.attachListener(c,"key",function(e){if(c.readOnly)return!0;if((t=e.data.domEvent.getKey())in d&&0!==(e=c.getSelection()).getRanges().length){var t=8==t,n=e.getRanges()[0];if(e=n.startPath(),n.collapsed)e:{var i=e.block;if(i&&n[t?"checkStartOfBlock":"checkEndOfBlock"]()&&n.moveToClosestEditablePosition(i,!t)&&n.collapsed){if(n.startContainer.type==CKEDITOR.NODE_ELEMENT){var a=n.startContainer.getChild(n.startOffset-(t?1:0));if(a&&a.type==CKEDITOR.NODE_ELEMENT&&a.is("hr")){c.fire("saveSnapshot"),a.remove(),e=!0;break e}}var s;if(!(n=n.startPath().block)||n&&n.contains(i))e=void 0;else c.fire("saveSnapshot"),(s=(t?n:i).getBogus())&&s.remove(),a=(s=c.getSelection()).createBookmarks(),(t?i:n).moveChildren(t?n:i,!1),e.lastElement.mergeSiblings(),l(i,n,!t),s.selectBookmarks(a),e=!0}else e=!1}else t=n,s=e.block,n=t.endPath().block,s&&n&&!s.equals(n)?(c.fire("saveSnapshot"),(i=s.getBogus())&&i.remove(),t.enlarge(CKEDITOR.ENLARGE_INLINE),t.deleteContents(),n.getParent()&&(n.moveChildren(s,!1),e.lastElement.mergeSiblings(),l(s,n,!0)),(t=c.getSelection().getRanges()[0]).collapse(1),t.optimize(),""===t.startContainer.getHtml()&&t.startContainer.appendBogus(),t.select(),e=!0):e=!1;if(!e)return;return c.getSelection().scrollIntoView(),c.fire("saveSnapshot"),!1}},this,null,100)}}},_:{detach:function(){var e;if(this.editor.setData(this.editor.getData(),0,1),this.clearListeners(),this.restoreAttrs(),e=this.removeCustomData("classes"))for(;e.length;)this.removeClass(e.pop());if(!this.is("textarea")){var t=(e=this.getDocument()).getHead();if(t.getCustomData("stylesheet")){var n=e.getCustomData("stylesheet_ref");--n?e.setCustomData("stylesheet_ref",n):(e.removeCustomData("stylesheet_ref"),t.removeCustomData("stylesheet").remove())}}this.editor.fire("contentDomUnload"),delete this.editor}}}),CKEDITOR.editor.prototype.editable=function(e){var t=this._.editable;return t&&e?0:(arguments.length&&(t=this._.editable=e?e instanceof CKEDITOR.editable?e:new CKEDITOR.editable(this,e):(t&&t.detach(),null)),t)},CKEDITOR.on("instanceLoaded",function(e){var n=e.editor;n.on("insertElement",function(e){(e=e.data).type==CKEDITOR.NODE_ELEMENT&&(e.is("input")||e.is("textarea"))&&("false"!=e.getAttribute("contentEditable")&&e.data("cke-editable",e.hasAttribute("contenteditable")?"true":"1"),e.setAttribute("contentEditable",!1))}),n.on("selectionChange",function(e){if(!n.readOnly){var t=n.getSelection();t&&!t.isLocked&&(t=n.checkDirty(),n.fire("lockSnapshot"),i(e),n.fire("unlockSnapshot"),!t&&n.resetDirty())}})}),CKEDITOR.on("instanceCreated",function(e){var a=e.editor;a.on("mode",function(){var e=a.editable();if(e&&e.isInline()){var t=a.title;if(e.changeAttr("role","textbox"),e.changeAttr("aria-label",t),t&&e.changeAttr("title",t),(i=a.fire("ariaEditorHelpLabel",{}).label)&&(t=this.ui.space(this.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?"top":"contents"))){var n=CKEDITOR.tools.getNextId(),i=CKEDITOR.dom.element.createFromHtml('<span id="'+n+'" class="cke_voice_label">'+i+"</span>");t.append(i),e.changeAttr("aria-describedby",n)}}})}),CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}"),_=CKEDITOR.dom.walker.whitespaces(!0),c=CKEDITOR.dom.walker.bookmark(!1,!0),h=CKEDITOR.dom.walker.empty(),d=CKEDITOR.dom.walker.bogus(),p=/(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi,f=function(){function E(e){return e.type==CKEDITOR.NODE_ELEMENT}function T(e,t){var n,i,a,s,o=[],r=t.range.startContainer;n=t.range.startPath();r=R[r.getName()];for(var l=0,c=e.getChildren(),d=c.count(),u=-1,_=-1,h=0,p=n.contains(R.$list);l<d;++l)E(n=c.getItem(l))?(a=n.getName(),p&&a in CKEDITOR.dtd.$list?o=o.concat(T(n,t)):(s=!!r[a],"br"!=a||!n.data("cke-eol")||l&&l!=d-1||(h=(i=l?o[l-1].node:c.getItem(l+1))&&(!E(i)||!i.is("br")),i=i&&E(i)&&R.$block[i.getName()]),-1!=u||s||(u=l),s||(_=l),o.push({isElement:1,isLineBreak:h,isBlock:n.isBlockBoundary(),hasBlockSibling:i,node:n,name:a,allowed:s}),i=h=0)):o.push({isElement:0,node:n,allowed:1});return-1<u&&(o[u].firstNotAllowed=1),-1<_&&(o[_].lastNotAllowed=1),o}function x(e,t){var n,i=[],a=e.getChildren(),s=a.count(),o=0,r=R[t],l=!e.is(R.$inline)||e.is("br");for(l&&i.push(" ");o<s;o++)E(n=a.getItem(o))&&!n.is(r)?i=i.concat(x(n,t)):i.push(n);return l&&i.push(" "),i}function I(e){return E(e.startContainer)&&e.startContainer.getChild(e.startOffset-1)}function D(e){return e&&E(e)&&(e.is(R.$removeEmpty)||e.is("a")&&!e.isBlockBoundary())}function O(e,t,n,i){var a,s,o=e.clone();o.setEndAt(t,CKEDITOR.POSITION_BEFORE_END),(a=new CKEDITOR.dom.walker(o).next())&&E(a)&&r[a.getName()]&&(s=a.getPrevious())&&E(s)&&!s.getParent().equals(e.startContainer)&&n.contains(s)&&i.contains(a)&&a.isIdentical(s)&&(a.moveChildren(s),a.remove(),O(e,t,n,i))}function S(e,t){function n(e,t){if(t.isBlock&&t.isElement&&!t.node.is("br")&&E(e)&&e.is("br"))return e.remove(),1}var i=t.endContainer.getChild(t.endOffset),a=t.endContainer.getChild(t.endOffset-1);i&&n(i,e[e.length-1]),a&&n(a,e[0])&&(t.setEnd(t.endContainer,t.endOffset-1),t.collapse())}var R=CKEDITOR.dtd,r={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,li:1,pre:1,dl:1,blockquote:1},B={p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1},N=CKEDITOR.tools.extend({},R.$inline);return delete N.br,function(e,t,n,i){var a=e.editor,s=!1;if("unfiltered_html"==t&&(t="html",s=!0),!i.checkReadOnly()){var o,r,l;if(t=(e={type:t,dontFilter:s,editable:e,editor:a,range:i,blockLimit:v=new CKEDITOR.dom.elementPath(i.startContainer,i.root).blockLimit||i.root,mergeCandidates:[],zombies:[]}).range,i=e.mergeCandidates,"text"==e.type&&t.shrink(CKEDITOR.SHRINK_ELEMENT,!0,!1)&&(o=CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>",t.document),t.insertNode(o),t.setStartAfter(o)),s=new CKEDITOR.dom.elementPath(t.startContainer),e.endPath=v=new CKEDITOR.dom.elementPath(t.endContainer),!t.collapsed){a=v.block||v.blockLimit;var c=t.getCommonAncestor();a&&!a.equals(c)&&!a.contains(c)&&t.checkEndOfBlock()&&e.zombies.push(a),t.deleteContents()}for(;(r=I(t))&&E(r)&&r.isBlockBoundary()&&s.contains(r);)t.moveToPosition(r,CKEDITOR.POSITION_BEFORE_END);for(O(t,e.blockLimit,s,v),o&&(t.setEndBefore(o),t.collapse(),o.remove()),(a=(o=t.startPath()).contains(D,!1,1))&&(t.splitElement(a),e.inlineStylesRoot=a,e.inlineStylesPeak=o.lastElement),(a=(o=t.createBookmark()).startNode.getPrevious(F))&&E(a)&&D(a)&&i.push(a),(a=o.startNode.getNext(F))&&E(a)&&D(a)&&i.push(a),a=o.startNode;(a=a.getParent())&&D(a);)i.push(a);if(t.moveToBookmark(o),o=n){if(o=e.range,"text"==e.type&&e.inlineStylesRoot){for(t=(r=e.inlineStylesPeak).getDocument().createText("{cke-peak}"),i=e.inlineStylesRoot.getParent();!r.equals(i);)t=t.appendTo(r.clone()),r=r.getParent();n=t.getOuterHtml().split("{cke-peak}").join(n)}if(r=e.blockLimit.getName(),/^\s+|\s+$/.test(n)&&"span"in CKEDITOR.dtd[r])n=(g='<span data-cke-marker="1">&nbsp;</span>')+n+g;if(n=e.editor.dataProcessor.toHtml(n,{context:null,fixForBody:!1,protectedWhitespaces:!!g,dontFilter:e.dontFilter,filter:e.editor.activeFilter,enterMode:e.editor.activeEnterMode}),(r=o.document.createElement("body")).setHtml(n),g&&(r.getFirst().remove(),r.getLast().remove()),(g=o.startPath().block)&&(1!=g.getChildCount()||!g.getBogus()))e:{var d;if(1==r.getChildCount()&&E(d=r.getFirst())&&d.is(B)&&!d.hasAttribute("contenteditable")){for(o=0,i=(g=d.getElementsByTag("*")).count();o<i;o++)if(!(t=g.getItem(o)).is(N))break e;d.moveChildren(d.getParent(1)),d.remove()}}e.dataWrapper=r,o=n}if(o){var u;o=(d=e.range).document,r=e.blockLimit;var _,h,p,f,m,g=[];n=a=i=0,t=d.startContainer;var A,v=(s=e.endPath.elements[0]).getPosition(t);c=!(!s.getCommonAncestor(t)||v==CKEDITOR.POSITION_IDENTICAL||v&CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED);for(S(t=T(e.dataWrapper,e),d);i<t.length;i++){if(u=(v=t[i]).isLineBreak){u=d,f=r;var b=void 0,y=void 0;v.hasBlockSibling?u=1:(b=u.startContainer.getAscendant(R.$block,1))&&b.is({div:1,p:1})?(y=b.getPosition(f))==CKEDITOR.POSITION_IDENTICAL||y==CKEDITOR.POSITION_CONTAINS?u=0:(f=u.splitElement(b),u.moveToPosition(f,CKEDITOR.POSITION_AFTER_START),u=1):u=0}if(u)n=0<i;else{if(u=d.startPath(),!v.isBlock&&K(e.editor,u.block,u.blockLimit)&&(p=M(e.editor))&&((p=o.createElement(p)).appendBogus(),d.insertNode(p),CKEDITOR.env.needsBrFiller&&(_=p.getBogus())&&_.remove(),d.moveToPosition(p,CKEDITOR.POSITION_BEFORE_END)),(u=d.startPath().block)&&!u.equals(h)&&((_=u.getBogus())&&(_.remove(),g.push(u)),h=u),v.firstNotAllowed&&(a=1),a&&v.isElement){for(u=d.startContainer,f=null;u&&!R[u.getName()][v.name];){if(u.equals(r)){u=null;break}u=(f=u).getParent()}if(u)f&&(m=d.splitElement(f),e.zombies.push(m),e.zombies.push(f));else{f=r.getName(),A=!i,u=i==t.length-1;b=[],y=(f=x(v.node,f)).length;for(var $=0,w=void 0,k=0,C=-1;$<y;$++)" "==(w=f[$])?(k||A&&!$||(b.push(new CKEDITOR.dom.text(" ")),C=b.length),k=1):(b.push(w),k=0);u&&C==b.length&&b.pop(),A=b}}if(A){for(;u=A.pop();)d.insertNode(u);A=0}else d.insertNode(v.node);v.lastNotAllowed&&i<t.length-1&&((m=c?s:m)&&d.setEndAt(m,CKEDITOR.POSITION_AFTER_START),a=0),d.collapse()}}1!=t.length?_=!1:_=(_=t[0]).isElement&&"false"==_.node.getAttribute("contenteditable"),_&&(n=!0,u=t[0].node,d.setStartAt(u,CKEDITOR.POSITION_BEFORE_START),d.setEndAt(u,CKEDITOR.POSITION_AFTER_END)),e.dontMoveCaret=n,e.bogusNeededBlocks=g}for(_=e.range,m=e.bogusNeededBlocks,A=_.createBookmark();h=e.zombies.pop();)h.getParent()&&((p=_.clone()).moveToElementEditStart(h),p.removeEmptyBlocksAtEnd());if(m)for(;h=m.pop();)CKEDITOR.env.needsBrFiller?h.appendBogus():h.append(_.document.createText("\xa0"));for(;h=e.mergeCandidates.pop();)h.mergeSiblings();if(_.moveToBookmark(A),!e.dontMoveCaret){for(h=I(_);h&&E(h)&&!h.is(R.$empty);){if(h.isBlockBoundary())_.moveToPosition(h,CKEDITOR.POSITION_BEFORE_END);else{if(D(h)&&h.getHtml().match(/(\s|&nbsp;)$/g)){l=null;break}(l=_.clone()).moveToPosition(h,CKEDITOR.POSITION_BEFORE_END)}h=h.getLast(F)}l&&_.moveToRange(l)}}}}(),m=function(){function a(e){return(e=new CKEDITOR.dom.walker(e)).guard=function(e,t){return!t&&(e.type==CKEDITOR.NODE_ELEMENT?e.is(CKEDITOR.dtd.$tableContent):void 0)},e.evaluator=function(e){return e.type==CKEDITOR.NODE_ELEMENT},e}function s(e,t,n){return t=e.getDocument().createElement(t),e.append(t,n),t}function o(e){for(var t,n=e.count();0<n--;)t=e.getItem(n),CKEDITOR.tools.trim(t.getHtml())||(t.appendBogus(),CKEDITOR.env.ie&&CKEDITOR.env.version<9&&t.getChildCount()&&t.getFirst().remove())}return function(e){var t=e.startContainer,n=t.getAscendant("table",1),i=!1;o(n.getElementsByTag("td")),o(n.getElementsByTag("th")),(n=e.clone()).setStart(t,0),(n=a(n).lastBackward())||((n=e.clone()).setEndAt(t,CKEDITOR.POSITION_BEFORE_END),n=a(n).lastForward(),i=!0),n||(n=t),n.is("table")?(e.setStartAt(n,CKEDITOR.POSITION_BEFORE_START),e.collapse(!0),n.remove()):(n.is({tbody:1,thead:1,tfoot:1})&&(n=s(n,"tr",i)),n.is("tr")&&(n=s(n,n.getParent().is("thead")?"th":"td",i)),(t=n.getBogus())&&t.remove(),e.moveToPosition(n,i?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END))}}(),g=function(){function a(e){return(e=new CKEDITOR.dom.walker(e)).guard=function(e,t){return!t&&(e.type==CKEDITOR.NODE_ELEMENT?e.is(CKEDITOR.dtd.$list)||e.is(CKEDITOR.dtd.$listItem):void 0)},e.evaluator=function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.is(CKEDITOR.dtd.$listItem)},e}return function(e){var t,n=e.startContainer,i=!1;(t=e.clone()).setStart(n,0),(t=a(t).lastBackward())||((t=e.clone()).setEndAt(n,CKEDITOR.POSITION_BEFORE_END),t=a(t).lastForward(),i=!0),t||(t=n),t.is(CKEDITOR.dtd.$list)?(e.setStartAt(t,CKEDITOR.POSITION_BEFORE_START),e.collapse(!0),t.remove()):((n=t.getBogus())&&n.remove(),e.moveToPosition(t,i?CKEDITOR.POSITION_AFTER_START:CKEDITOR.POSITION_BEFORE_END),e.select())}}(),t={eol:{detect:function(e,t){var n=e.range,i=n.clone(),a=n.clone(),s=new CKEDITOR.dom.elementPath(n.startContainer,t),o=new CKEDITOR.dom.elementPath(n.endContainer,t);i.collapse(1),a.collapse(),s.block&&i.checkBoundaryOfElement(s.block,CKEDITOR.END)&&(n.setStartAfter(s.block),e.prependEolBr=1),o.block&&a.checkBoundaryOfElement(o.block,CKEDITOR.START)&&(n.setEndBefore(o.block),e.appendEolBr=1)},fix:function(e,t){var n,i=t.getDocument();e.appendEolBr&&(n=this.createEolBr(i),e.fragment.append(n)),!e.prependEolBr||n&&!n.getPrevious()||e.fragment.append(this.createEolBr(i),1)},createEolBr:function(e){return e.createElement("br",{attributes:{"data-cke-eol":1}})}},bogus:{exclude:function(e){var t,n=(t=e.range.getBoundaryNodes()).startNode;!(t=t.endNode)||!d(t)||n&&n.equals(t)||e.range.setEndBefore(t)}},tree:{rebuild:function(e,t){var n,i=(o=e.range).getCommonAncestor(),a=new CKEDITOR.dom.elementPath(i,t),s=new CKEDITOR.dom.elementPath(o.startContainer,t),o=new CKEDITOR.dom.elementPath(o.endContainer,t);if(i.type==CKEDITOR.NODE_TEXT&&(i=i.getParent()),a.blockLimit.is({tr:1,table:1})){var r=a.contains("table").getParent();n=function(e){return!e.equals(r)}}else if(a.block&&a.block.is(CKEDITOR.dtd.$listItem)&&(s=s.contains(CKEDITOR.dtd.$list),o=o.contains(CKEDITOR.dtd.$list),!s.equals(o))){var l=a.contains(CKEDITOR.dtd.$list).getParent();n=function(e){return!e.equals(l)}}n||(n=function(e){return!e.equals(a.block)&&!e.equals(a.blockLimit)}),this.rebuildFragment(e,t,i,n)},rebuildFragment:function(e,t,n,i){for(var a;n&&!n.equals(t)&&i(n);)a=n.clone(0,1),e.fragment.appendTo(a),e.fragment=a,n=n.getParent()}},cell:{shrink:function(e){var t=(e=e.range).startContainer,n=e.endContainer,i=e.startOffset,a=e.endOffset;t.type==CKEDITOR.NODE_ELEMENT&&t.equals(n)&&t.is("tr")&&++i==a&&e.shrink(CKEDITOR.SHRINK_TEXT)}}},A=function(){function a(e,t){var n=e.getParent();n.is(CKEDITOR.dtd.$inline)&&e[t?"insertBefore":"insertAfter"](n)}function l(e,t,n){a(t),a(n,1);for(var i;i=n.getNext();)i.insertAfter(t),t=i;h(e)&&e.remove()}function u(e,t){var n=new CKEDITOR.dom.range(e);return n.setStartAfter(t.startNode),n.setEndBefore(t.endNode),n}return{list:{detectMerge:function(e,t){var n=u(t,e.bookmark),i=n.startPath(),a=n.endPath(),s=i.contains(CKEDITOR.dtd.$list),o=a.contains(CKEDITOR.dtd.$list);e.mergeList=s&&o&&s.getParent().equals(o.getParent())&&!s.equals(o),e.mergeListItems=i.block&&a.block&&i.block.is(CKEDITOR.dtd.$listItem)&&a.block.is(CKEDITOR.dtd.$listItem),(e.mergeList||e.mergeListItems)&&((n=n.clone()).setStartBefore(e.bookmark.startNode),n.setEndAfter(e.bookmark.endNode),e.mergeListBookmark=n.createBookmark())},merge:function(e,t){if(e.mergeListBookmark){var n=e.mergeListBookmark.startNode,i=e.mergeListBookmark.endNode,a=new CKEDITOR.dom.elementPath(n,t),s=new CKEDITOR.dom.elementPath(i,t);if(e.mergeList){var o=a.contains(CKEDITOR.dtd.$list),r=s.contains(CKEDITOR.dtd.$list);o.equals(r)||(r.moveChildren(o),r.remove())}e.mergeListItems&&(a=a.contains(CKEDITOR.dtd.$listItem),s=s.contains(CKEDITOR.dtd.$listItem),a.equals(s)||l(s,n,i)),n.remove(),i.remove()}}},block:{detectMerge:function(e,t){if(!e.tableContentsRanges&&!e.mergeListBookmark){var n=new CKEDITOR.dom.range(t);n.setStartBefore(e.bookmark.startNode),n.setEndAfter(e.bookmark.endNode),e.mergeBlockBookmark=n.createBookmark()}},merge:function(e,t){if(e.mergeBlockBookmark&&!e.purgeTableBookmark){var n=e.mergeBlockBookmark.startNode,i=e.mergeBlockBookmark.endNode,a=new CKEDITOR.dom.elementPath(n,t),s=new CKEDITOR.dom.elementPath(i,t);a=a.block,s=s.block;a&&s&&!a.equals(s)&&l(s,n,i),n.remove(),i.remove()}}},table:function(){function r(i){var a,s=[],e=new CKEDITOR.dom.walker(i),o=i.startPath().contains(d),r=i.endPath().contains(d),l={};return e.guard=function(e,t){if(e.type==CKEDITOR.NODE_ELEMENT){var n="visited_"+(t?"out":"in");if(e.getCustomData(n))return;CKEDITOR.dom.element.setMarker(l,e,n,1)}t&&o&&e.equals(o)?((a=i.clone()).setEndAt(o,CKEDITOR.POSITION_BEFORE_END),s.push(a)):!t&&r&&e.equals(r)?((a=i.clone()).setStartAt(r,CKEDITOR.POSITION_AFTER_START),s.push(a)):((n=!t)&&(n=e.type==CKEDITOR.NODE_ELEMENT&&e.is(d)&&(!o||c(e,o))&&(!r||c(e,r))),n&&((a=i.clone()).selectNodeContents(e),s.push(a)))},e.lastForward(),CKEDITOR.dom.element.clearAllMarkers(l),s}function c(e,t){var n=CKEDITOR.POSITION_CONTAINS+CKEDITOR.POSITION_IS_CONTAINED,i=e.getPosition(t);return i!==CKEDITOR.POSITION_IDENTICAL&&0==(i&n)}var d={td:1,th:1,caption:1};return{detectPurge:function(e){var t=e.range;(n=t.clone()).enlarge(CKEDITOR.ENLARGE_ELEMENT);var n=new CKEDITOR.dom.walker(n),i=0;if(n.evaluator=function(e){e.type==CKEDITOR.NODE_ELEMENT&&e.is(d)&&++i},n.checkForward(),1<i){n=t.startPath().contains("table");var a=t.endPath().contains("table");n&&a&&t.checkBoundaryOfElement(n,CKEDITOR.START)&&t.checkBoundaryOfElement(a,CKEDITOR.END)&&((t=e.range.clone()).setStartBefore(n),t.setEndAfter(a),e.purgeTableBookmark=t.createBookmark())}},detectRanges:function(e,t){var n,i,a=u(t,e.bookmark),s=a.clone(),o=a.getCommonAncestor();o.is(CKEDITOR.dtd.$tableContent)&&!o.is(d)&&(o=o.getAscendant("table",!0)),i=o,o=new CKEDITOR.dom.elementPath(a.startContainer,i),i=new CKEDITOR.dom.elementPath(a.endContainer,i),o=o.contains("table"),i=i.contains("table"),(o||i)&&(o&&i&&c(o,i)?((e.tableSurroundingRange=s).setStartAt(o,CKEDITOR.POSITION_AFTER_END),s.setEndAt(i,CKEDITOR.POSITION_BEFORE_START),(s=a.clone()).setEndAt(o,CKEDITOR.POSITION_AFTER_END),(n=a.clone()).setStartAt(i,CKEDITOR.POSITION_BEFORE_START),n=r(s).concat(r(n))):o?i||((e.tableSurroundingRange=s).setStartAt(o,CKEDITOR.POSITION_AFTER_END),a.setEndAt(o,CKEDITOR.POSITION_AFTER_END)):((e.tableSurroundingRange=s).setEndAt(i,CKEDITOR.POSITION_BEFORE_START),a.setStartAt(i,CKEDITOR.POSITION_AFTER_START)),e.tableContentsRanges=n||r(a))},deleteRanges:function(e){for(var t;t=e.tableContentsRanges.pop();)t.extractContents(),h(t.startContainer)&&t.startContainer.appendBogus();e.tableSurroundingRange&&e.tableSurroundingRange.extractContents()},purge:function(e){if(e.purgeTableBookmark){var t=e.doc,n=e.range.clone();(t=t.createElement("p")).insertBefore(e.purgeTableBookmark.startNode),n.moveToBookmark(e.purgeTableBookmark),n.deleteContents(),e.range.moveToPosition(t,CKEDITOR.POSITION_AFTER_START)}}}}(),detectExtractMerge:function(e){return!(e.range.startPath().contains(CKEDITOR.dtd.$listItem)&&e.range.endPath().contains(CKEDITOR.dtd.$listItem))},fixUneditableRangePosition:function(e){e.startContainer.getDtd()["#"]||e.moveToClosestEditablePosition(null,!0)},autoParagraph:function(e,t){var n,i=t.startPath();K(e,i.block,i.blockLimit)&&(n=M(e))&&((n=t.document.createElement(n)).appendBogus(),t.insertNode(n),t.moveToPosition(n,CKEDITOR.POSITION_AFTER_START))}}}()}(),function(){function _(e,t){if(0===e.length)return!1;var n,i;if((n=!t&&1===e.length)&&!(n=e[0].collapsed)){var a=e[0];n=a.startContainer.getAscendant({td:1,th:1},!0);var s=a.endContainer.getAscendant({td:1,th:1},!0);i=CKEDITOR.tools.trim,n&&n.equals(s)&&!n.findOne("td, th, tr, tbody, table")?n=!(a=a.cloneContents()).getFirst()||i(a.getFirst().getText())!==i(n.getText()):n=!1}if(n)return!1;for(i=0;i<e.length;i++)if(!(n=e[i]._getTableElement()))return!1;return!0}function s(e){function t(e){e=e.find("td, th");var t,n=[];for(t=0;t<e.count();t++)n.push(e.getItem(t));return n}var n,i,a=[];for(i=0;i<e.length;i++)(n=e[i]._getTableElement()).is&&n.is({td:1,th:1})?a.push(n):a=a.concat(t(n));return a}function i(e){e=s(e);var t,n,i="",a=[]
;for(n=0;n<e.length;n++)t&&!t.equals(e[n].getAscendant("tr"))?(i+=a.join("\t")+"\n",t=e[n].getAscendant("tr"),a=[]):0===n&&(t=e[n].getAscendant("tr")),a.push(e[n].getText());return i+a.join("\t")}function h(e){var t=this.root.editor,n=t.getSelection(1);this.reset(),y=!0,n.root.once("selectionchange",function(e){e.cancel()},null,null,0),n.selectRanges([e[0]]),(n=this._.cache).ranges=new CKEDITOR.dom.rangeList(e),n.type=CKEDITOR.SELECTION_TEXT,n.selectedElement=e[0]._getTableElement(),n.selectedText=i(e),n.nativeSel=null,this.isFake=1,this.rev=k++,t._.fakeSelection=this,y=!1,this.root.fire("selectionchange")}function m(){var e,t=this._.fakeSelection;if(t){var n;if(!(n=!(e=this.getSelection(1)))&&(n=!e.isHidden())){n=t;var i=e.getRanges(),a=n.getRanges(),s=i.length&&i[0]._getTableElement()&&i[0]._getTableElement().getAscendant("table",!0),o=a.length&&a[0]._getTableElement()&&a[0]._getTableElement().getAscendant("table",!0),r=1===i.length&&i[0]._getTableElement()&&i[0]._getTableElement().is("table"),l=1===a.length&&a[0]._getTableElement()&&a[0]._getTableElement().is("table"),c=1===i.length&&i[0].collapsed;a=_(i,!!CKEDITOR.env.webkit)&&_(a);(s=!(!s||!o)&&(s.equals(o)||o.contains(s)))&&(c||a)?(r&&!l&&n.selectRanges(i),n=!0):n=!1,n=!n}n&&(t.reset(),t=0)}(t||(t=e||this.getSelection(1))&&t.getType()!=CKEDITOR.SELECTION_NONE)&&(this.fire("selectionCheck",t),(e=this.elementPath()).compare(this._.selectionPreviousPath)||(n=this._.selectionPreviousPath&&this._.selectionPreviousPath.blockLimit.equals(e.blockLimit),CKEDITOR.env.webkit&&!n&&(this._.previousActive=this.document.getActive()),this._.selectionPreviousPath=e,this.fire("selectionChange",{selection:t,path:e})))}function g(){$=!0,t||(e.call(this),t=CKEDITOR.tools.setTimeout(e,200,this))}function e(){t=null,$&&(CKEDITOR.tools.setTimeout(m,0,this),$=!1)}function o(e){return!(!c(e)&&(e.type!=CKEDITOR.NODE_ELEMENT||e.is(CKEDITOR.dtd.$empty)))}function p(n){function e(e,t){return!(!e||e.type==CKEDITOR.NODE_TEXT)&&n.clone()["moveToElementEdit"+(t?"End":"Start")](e)}if(!(n.root instanceof CKEDITOR.editable))return!1;var t=n.startContainer,i=n.getPreviousNode(o,null,t),a=n.getNextNode(o,null,t);return!(!e(i)&&!e(a,1)&&(i||a||t.type==CKEDITOR.NODE_ELEMENT&&t.isBlockBoundary()&&t.getBogus()))}function f(e){A(e,!1);var t=e.getDocument().createText(l);return e.setCustomData("cke-fillingChar",t),t}function A(e,t){var n=e&&e.removeCustomData("cke-fillingChar");if(n){if(!1!==t){var i=e.getDocument().getSelection().getNative(),a=i&&"None"!=i.type&&i.getRangeAt(0),s=l.length;if(n.getLength()>s&&a&&a.intersectsNode(n.$)){var o=[{node:i.anchorNode,offset:i.anchorOffset},{node:i.focusNode,offset:i.focusOffset}];i.anchorNode==n.$&&i.anchorOffset>s&&(o[0].offset-=s),i.focusNode==n.$&&i.focusOffset>s&&(o[1].offset-=s)}}n.setText(r(n.getText(),1)),o&&(i=(n=e.getDocument().$).getSelection(),(n=n.createRange()).setStart(o[0].node,o[0].offset),n.collapse(!0),i.removeAllRanges(),i.addRange(n),i.extend(o[1].node,o[1].offset))}}function r(e,t){return t?e.replace(n,function(e,t){return t?"\xa0":""}):e.replace(l,"")}function v(e,t){var n=CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="'+(CKEDITOR.env.ie&&CKEDITOR.env.version<14?"display:none":"position:fixed;top:0;left:-1000px")+'">'+(t||"&nbsp;")+"</div>",e.document);e.fire("lockSnapshot"),e.editable().append(n);var i=e.getSelection(1),a=e.createRange(),s=i.root.on("selectionchange",function(e){e.cancel()},null,null,0);a.setStartAt(n,CKEDITOR.POSITION_AFTER_START),a.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),i.selectRanges([a]),s.removeListener(),e.fire("unlockSnapshot"),e._.hiddenSelectionContainer=n}function b(a){var s={37:1,39:1,8:1,46:1};return function(e){var t=e.data.getKeystroke();if(s[t]){var n=a.getSelection().getRanges(),i=n[0];1==n.length&&i.collapsed&&(t=i[t<38?"getPreviousEditableNode":"getNextEditableNode"]())&&t.type==CKEDITOR.NODE_ELEMENT&&"false"==t.getAttribute("contenteditable")&&(a.getSelection().fake(t),e.data.preventDefault(),e.cancel())}}}function a(n){for(var i=0;i<n.length;i++){var a=n[i];if(a.getCommonAncestor().isReadOnly()&&n.splice(i,1),!a.collapsed){if(a.startContainer.isReadOnly())for(var e,t=a.startContainer;t&&!((e=t.type==CKEDITOR.NODE_ELEMENT)&&t.is("body")||!t.isReadOnly());)e&&"false"==t.getAttribute("contentEditable")&&a.setStartAfter(t),t=t.getParent();t=a.startContainer,e=a.endContainer;var s=a.startOffset,o=a.endOffset,r=a.clone();t&&t.type==CKEDITOR.NODE_TEXT&&(s>=t.getLength()?r.setStartAfter(t):r.setStartBefore(t)),e&&e.type==CKEDITOR.NODE_TEXT&&(o?r.setEndAfter(e):r.setEndBefore(e)),(t=new CKEDITOR.dom.walker(r)).evaluator=function(e){if(e.type==CKEDITOR.NODE_ELEMENT&&e.isReadOnly()){var t=a.clone();return a.setEndBefore(e),a.collapsed&&n.splice(i--,1),e.getPosition(r.endContainer)&CKEDITOR.POSITION_CONTAINS||(t.setStartAfter(e),t.collapsed||n.splice(i+1,0,t)),!0}return!1},t.next()}}return n}var y,t,$,w="function"!=typeof window.getSelection,k=1,l=CKEDITOR.tools.repeat("\u200b",7),n=new RegExp(l+"( )?","g"),c=CKEDITOR.dom.walker.invisible(1),d=function(){function e(n){return function(e){var t=e.editor.createRange();return t.moveToClosestEditablePosition(e.selected,n)&&e.editor.getSelection().selectRanges([t]),!1}}function t(a){return function(e){var t,n=e.editor,i=n.createRange();return(t=i.moveToClosestEditablePosition(e.selected,a))||(t=i.moveToClosestEditablePosition(e.selected,!a)),t&&n.getSelection().selectRanges([i]),n.fire("saveSnapshot"),e.selected.remove(),t||(i.moveToElementEditablePosition(n.editable()),n.getSelection().selectRanges([i])),n.fire("saveSnapshot"),!1}}var n=e(),i=e(1);return{37:n,38:n,39:i,40:i,8:t(),46:t(1)}}();CKEDITOR.on("instanceCreated",function(e){function t(){var e=f.getSelection();e&&e.removeAllRanges()}var f=e.editor;f.on("contentDom",function(){function e(){(a=new CKEDITOR.dom.selection(f.getSelection())).lock()}function n(){l.removeListener("mouseup",n),u.removeListener("mouseup",n);var e=CKEDITOR.document.$.selection,t=e.createRange();"None"!=e.type&&t.parentElement().ownerDocument==r.$&&t.select()}function i(e){if(CKEDITOR.env.ie){var t=(e=e.getRanges()[0])?e.startContainer.getAscendant(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&("false"==e.getAttribute("contenteditable")||"true"==e.getAttribute("contenteditable"))},!0):null;return e&&"false"==t.getAttribute("contenteditable")&&t}}var t,a,s,o,r=f.document,l=CKEDITOR.document,c=f.editable(),d=r.getBody(),u=r.getDocumentElement(),_=c.isInline();if((CKEDITOR.env.gecko&&c.attachListener(c,"focus",function(e){e.removeListener(),0!==t&&(e=f.getSelection().getNative())&&e.isCollapsed&&e.anchorNode==c.$&&((e=f.createRange()).moveToElementEditStart(c),e.select())},null,null,-2),c.attachListener(c,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){t&&CKEDITOR.env.webkit&&(t=f._.previousActive&&f._.previousActive.equals(r.getActive()))&&null!=f._.previousScrollTop&&f._.previousScrollTop!=c.$.scrollTop&&(c.$.scrollTop=f._.previousScrollTop),f.unlockSelection(t),t=0},null,null,-1),c.attachListener(c,"mousedown",function(){t=0}),(CKEDITOR.env.ie||_)&&(w?c.attachListener(c,"beforedeactivate",e,null,null,-1):c.attachListener(f,"selectionCheck",e,null,null,-1),c.attachListener(c,CKEDITOR.env.webkit?"DOMFocusOut":"blur",function(){f.lockSelection(a),t=1},null,null,-1),c.attachListener(c,"mousedown",function(){t=0})),CKEDITOR.env.ie&&!_)&&(c.attachListener(c,"mousedown",function(e){2==e.data.$.button&&((e=f.document.getSelection())&&e.getType()!=CKEDITOR.SELECTION_NONE||(s=f.window.getScrollPosition()))}),c.attachListener(c,"mouseup",function(e){2==e.data.$.button&&s&&(f.document.$.documentElement.scrollLeft=s.x,f.document.$.documentElement.scrollTop=s.y),s=null}),"BackCompat"!=r.$.compatMode)){var h,p;if(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)u.on("mousedown",function(e){function t(e){if(e=e.data.$,h){var t=d.$.createTextRange();try{t.moveToPoint(e.clientX,e.clientY)}catch(i){}h.setEndPoint(p.compareEndPoints("StartToStart",t)<0?"EndToEnd":"StartToStart",t),h.select()}}function n(){u.removeListener("mousemove",t),l.removeListener("mouseup",n),u.removeListener("mouseup",n),h.select()}if((e=e.data).getTarget().is("html")&&e.$.y<u.$.clientHeight&&e.$.x<u.$.clientWidth){h=d.$.createTextRange();try{h.moveToPoint(e.$.clientX,e.$.clientY)}catch(i){}p=h.duplicate(),u.on("mousemove",t),l.on("mouseup",n),u.on("mouseup",n)}});7<CKEDITOR.env.version&&CKEDITOR.env.version<11&&u.on("mousedown",function(e){e.data.getTarget().is("html")&&(l.on("mouseup",n),u.on("mouseup",n))})}(c.attachListener(c,"selectionchange",m,f),c.attachListener(c,"keyup",g,f),c.attachListener(c,"keydown",function(e){var t=this.getSelection(1);i(t)&&(t.selectElement(i(t)),e.data.preventDefault())},f),c.attachListener(c,CKEDITOR.env.webkit?"DOMFocusIn":"focus",function(){f.forceNextSelectionCheck(),f.selectionChange(1)}),_&&(CKEDITOR.env.webkit||CKEDITOR.env.gecko))?(c.attachListener(c,"mousedown",function(){o=1}),c.attachListener(r.getDocumentElement(),"mouseup",function(){o&&g.call(f),o=0})):c.attachListener(CKEDITOR.env.ie?c:r.getDocumentElement(),"mouseup",g,f);CKEDITOR.env.webkit&&c.attachListener(r,"keydown",function(e){switch(e.data.getKey()){case 13:case 33:case 34:case 35:case 36:case 37:case 39:case 8:case 45:case 46:c.hasFocus&&A(c)}},null,null,-1),c.attachListener(c,"keydown",b(f),null,null,-1)}),f.on("setData",function(){f.unlockSelection(),CKEDITOR.env.webkit&&t()}),f.on("contentDomUnload",function(){f.unlockSelection()}),CKEDITOR.env.ie9Compat&&f.on("beforeDestroy",t,null,null,9),f.on("dataReady",function(){delete f._.fakeSelection,delete f._.hiddenSelectionContainer,f.selectionChange(1)}),f.on("loadSnapshot",function(){var e=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),t=f.editable().getLast(e);t&&t.hasAttribute("data-cke-hidden-sel")&&(t.remove(),CKEDITOR.env.gecko&&(e=f.editable().getFirst(e))&&e.is("br")&&e.getAttribute("_moz_editor_bogus_node")&&e.remove())},null,null,100),f.on("key",function(e){if("wysiwyg"==f.mode){var t=f.getSelection();if(t.isFake){var n=d[e.data.keyCode];if(n)return n({editor:f,selected:t.getSelectedElement(),selection:t,keyEvent:e})}}})}),CKEDITOR.env.webkit&&CKEDITOR.on("instanceReady",function(e){var n=e.editor;n.on("selectionChange",function(){var e=n.editable(),t=e.getCustomData("cke-fillingChar");t&&(t.getCustomData("ready")?(A(e),e.editor.fire("selectionCheck")):t.setCustomData("ready",1))},null,null,-1),n.on("beforeSetMode",function(){A(n.editable())},null,null,-1),n.on("getSnapshot",function(e){e.data&&(e.data=r(e.data))},n,null,20),n.on("toDataFormat",function(e){e.data.dataValue=r(e.data.dataValue)},null,null,0)}),CKEDITOR.editor.prototype.selectionChange=function(e){(e?m:g).call(this)},CKEDITOR.editor.prototype.getSelection=function(e){return!this._.savedSelection&&!this._.fakeSelection||e?(e=this.editable())&&"wysiwyg"==this.mode?new CKEDITOR.dom.selection(e):null:this._.savedSelection||this._.fakeSelection},CKEDITOR.editor.prototype.lockSelection=function(e){return(e=e||this.getSelection(1)).getType()!=CKEDITOR.SELECTION_NONE&&(!e.isLocked&&e.lock(),this._.savedSelection=e,!0)},CKEDITOR.editor.prototype.unlockSelection=function(e){var t=this._.savedSelection;return!!t&&(t.unlock(e),delete this._.savedSelection,!0)},CKEDITOR.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath},CKEDITOR.dom.document.prototype.getSelection=function(){return new CKEDITOR.dom.selection(this)},CKEDITOR.dom.range.prototype.select=function(){var e=this.root instanceof CKEDITOR.editable?this.root.editor.getSelection():new CKEDITOR.dom.selection(this.root);return e.selectRanges([this]),e},CKEDITOR.SELECTION_NONE=1,CKEDITOR.SELECTION_TEXT=2,CKEDITOR.SELECTION_ELEMENT=3,CKEDITOR.dom.selection=function(e){if(e instanceof CKEDITOR.dom.selection){var t=e;e=e.root}var n,i,a=e instanceof CKEDITOR.dom.element;if(this.rev=t?t.rev:k++,this.document=e instanceof CKEDITOR.dom.document?e:e.getDocument(),this.root=a?e:this.document.getBody(),this.isLocked=0,this._={cache:{}},t)return CKEDITOR.tools.extend(this._.cache,t._.cache),this.isFake=t.isFake,this.isLocked=t.isLocked,this;if(e=this.getNative())if(e.getRangeAt)n=(i=e.rangeCount&&e.getRangeAt(0))&&new CKEDITOR.dom.node(i.commonAncestorContainer);else{try{i=e.createRange()}catch(A){}n=i&&CKEDITOR.dom.element.get(i.item&&i.item(0)||i.parentElement())}return(!n||n.type!=CKEDITOR.NODE_ELEMENT&&n.type!=CKEDITOR.NODE_TEXT||!this.root.equals(n)&&!this.root.contains(n))&&(this._.cache.type=CKEDITOR.SELECTION_NONE,this._.cache.startElement=null,this._.cache.selectedElement=null,this._.cache.selectedText="",this._.cache.ranges=new CKEDITOR.dom.rangeList),this};var u,C={img:1,hr:1,li:1,table:1,tr:1,td:1,th:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,thead:1,tfoot:1};CKEDITOR.tools.extend(CKEDITOR.dom.selection,{_removeFillingCharSequenceString:r,_createFillingCharSequenceNode:f,FILLING_CHAR_SEQUENCE:l}),CKEDITOR.dom.selection.prototype={getNative:function(){return void 0!==this._.cache.nativeSel?this._.cache.nativeSel:this._.cache.nativeSel=w?this.document.$.selection:this.document.getWindow().$.getSelection()},getType:w?function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_NONE;try{var n=this.getNative(),i=n.type;"Text"==i&&(t=CKEDITOR.SELECTION_TEXT),"Control"==i&&(t=CKEDITOR.SELECTION_ELEMENT),n.createRange().parentElement()&&(t=CKEDITOR.SELECTION_TEXT)}catch(m){}return e.type=t}:function(){var e=this._.cache;if(e.type)return e.type;var t=CKEDITOR.SELECTION_TEXT;if((n=this.getNative())&&n.rangeCount){if(1==n.rangeCount){var n,i=(n=n.getRangeAt(0)).startContainer;i==n.endContainer&&1==i.nodeType&&1==n.endOffset-n.startOffset&&C[i.childNodes[n.startOffset].nodeName.toLowerCase()]&&(t=CKEDITOR.SELECTION_ELEMENT)}}else t=CKEDITOR.SELECTION_NONE;return e.type=t},getRanges:(u=w?function(){function _(e){return new CKEDITOR.dom.node(e).getIndex()}var r=function(e,t){(e=e.duplicate()).collapse(t);var n=e.parentElement();if(!n.hasChildNodes())return{container:n,offset:0};for(var i,a,s,o,r=n.children,l=e.duplicate(),c=0,d=r.length-1,u=-1;c<=d;)if(i=r[u=Math.floor((c+d)/2)],l.moveToElementText(i),0<(s=l.compareEndPoints("StartToStart",e)))d=u-1;else{if(!(s<0))return{container:n,offset:_(i)};c=u+1}if(-1==u||u==r.length-1&&s<0){if(l.moveToElementText(n),l.setEndPoint("StartToStart",e),l=l.text.replace(/(\r\n|\r)/g,"\n").length,r=n.childNodes,!l)return(i=r[r.length-1]).nodeType!=CKEDITOR.NODE_TEXT?{container:n,offset:r.length}:{container:i,offset:i.nodeValue.length};for(n=r.length;0<l&&0<n;)(a=r[--n]).nodeType==CKEDITOR.NODE_TEXT&&(l-=(o=a).nodeValue.length);return{container:o,offset:-l}}if(l.collapse(0<s),l.setEndPoint(0<s?"StartToStart":"EndToStart",e),!(l=l.text.replace(/(\r\n|\r)/g,"\n").length))return{container:n,offset:_(i)+(0<s?0:1)};for(;0<l;)try{(a=i[0<s?"previousSibling":"nextSibling"]).nodeType==CKEDITOR.NODE_TEXT&&(l-=a.nodeValue.length,o=a),i=a}catch(k){return{container:n,offset:_(i)}}return{container:o,offset:0<s?-l:o.nodeValue.length+l}};return function(){var e=(o=this.getNative())&&o.createRange(),t=this.getType();if(!o)return[];if(t==CKEDITOR.SELECTION_TEXT)return o=new CKEDITOR.dom.range(this.root),t=r(e,!0),o.setStart(new CKEDITOR.dom.node(t.container),t.offset),t=r(e),o.setEnd(new CKEDITOR.dom.node(t.container),t.offset),o.endContainer.getPosition(o.startContainer)&CKEDITOR.POSITION_PRECEDING&&o.endOffset<=o.startContainer.getIndex()&&o.collapse(),[o];if(t!=CKEDITOR.SELECTION_ELEMENT)return[];t=[];for(var n=0;n<e.length;n++){for(var i=e.item(n),a=i.parentNode,s=0,o=new CKEDITOR.dom.range(this.root);s<a.childNodes.length&&a.childNodes[s]!=i;s++);o.setStart(new CKEDITOR.dom.node(a),s),o.setEnd(new CKEDITOR.dom.node(a),s+1),t.push(o)}return t}}():function(){var e,t=[],n=this.getNative();if(!n)return t;for(var i=0;i<n.rangeCount;i++){var a=n.getRangeAt(i);(e=new CKEDITOR.dom.range(this.root)).setStart(new CKEDITOR.dom.node(a.startContainer),a.startOffset),e.setEnd(new CKEDITOR.dom.node(a.endContainer),a.endOffset),t.push(e)}return t},function(e){var t=this._.cache,n=t.ranges;return n||(t.ranges=n=new CKEDITOR.dom.rangeList(u.call(this))),e?a(new CKEDITOR.dom.rangeList(n.slice())):n}),getStartElement:function(){var e,t=this._.cache;if(void 0!==t.startElement)return t.startElement;switch(this.getType()){case CKEDITOR.SELECTION_ELEMENT:return this.getSelectedElement();case CKEDITOR.SELECTION_TEXT:var n=this.getRanges()[0];if(n){if(n.collapsed)(e=n.startContainer).type!=CKEDITOR.NODE_ELEMENT&&(e=e.getParent());else{for(n.optimize();e=n.startContainer,n.startOffset==(e.getChildCount?e.getChildCount():e.getLength())&&!e.isBlockBoundary();)n.setStartAfter(e);if((e=n.startContainer).type!=CKEDITOR.NODE_ELEMENT)return e.getParent();if((e=e.getChild(n.startOffset))&&e.type==CKEDITOR.NODE_ELEMENT)for(n=e.getFirst();n&&n.type==CKEDITOR.NODE_ELEMENT;)n=(e=n).getFirst();else e=n.startContainer}e=e.$}}return t.startElement=e?new CKEDITOR.dom.element(e):null},getSelectedElement:function(){var e=this._.cache;if(void 0!==e.selectedElement)return e.selectedElement;var a=this,t=CKEDITOR.tools.tryThese(function(){return a.getNative().createRange().item(0)},function(){for(var e,t,n=a.getRanges()[0].clone(),i=2;i&&!((e=n.getEnclosedNode())&&e.type==CKEDITOR.NODE_ELEMENT&&C[e.getName()]&&(t=e));i--)n.shrink(CKEDITOR.SHRINK_ELEMENT);return t&&t.$});return e.selectedElement=t?new CKEDITOR.dom.element(t):null},getSelectedText:function(){var e=this._.cache;if(void 0!==e.selectedText)return e.selectedText;var t=this.getNative();t=w?"Control"==t.type?"":t.createRange().text:t.toString();return e.selectedText=t},lock:function(){this.getRanges(),this.getStartElement(),this.getSelectedElement(),this.getSelectedText(),this._.cache.nativeSel=null,this.isLocked=1},unlock:function(e){if(this.isLocked){if(e)var t=this.getSelectedElement(),n=this.getRanges(),i=this.isFake;this.isLocked=0,this.reset(),e&&(e=t||n[0]&&n[0].getCommonAncestor())&&e.getAscendant("body",1)&&(_(n)?h.call(this,n):i?this.fake(t):t?this.selectElement(t):this.selectRanges(n))}},reset:function(){this._.cache={},this.isFake=0;var e=this.root.editor;if(e&&e._.fakeSelection)if(this.rev==e._.fakeSelection.rev){delete e._.fakeSelection;var t=e._.hiddenSelectionContainer;if(t){var n=e.checkDirty();e.fire("lockSnapshot"),t.remove(),e.fire("unlockSnapshot"),!n&&e.resetDirty()}delete e._.hiddenSelectionContainer}else CKEDITOR.warn("selection-fake-reset");this.rev=k++},selectElement:function(e){var t=new CKEDITOR.dom.range(this.root);t.setStartBefore(e),t.setEndAfter(e),this.selectRanges([t])},selectRanges:function(e){var t=this.root.editor,n=t&&t._.hiddenSelectionContainer;if(this.reset(),n){n=this.root;for(var i,a=0;a<e.length;++a)(i=e[a]).endContainer.equals(n)&&(i.endOffset=Math.min(i.endOffset,n.getChildCount()))}if(e.length)if(this.isLocked){var s=CKEDITOR.document.getActive();this.unlock(),this.selectRanges(e),this.lock(),s&&!s.equals(this.root)&&s.focus()}else{var o,r,l;if(1==e.length&&!(l=e[0]).collapsed&&(o=l.getEnclosedNode())&&o.type==CKEDITOR.NODE_ELEMENT&&((l=l.clone()).shrink(CKEDITOR.SHRINK_ELEMENT,!0),(r=l.getEnclosedNode())&&r.type==CKEDITOR.NODE_ELEMENT&&(o=r),"false"==o.getAttribute("contenteditable"))||(o=void 0),o)this.fake(o);else if(t&&t.plugins.tableselection&&CKEDITOR.plugins.tableselection.isSupportedEnvironment&&_(e)&&!y)h.call(this,e);else{if(w){var c,d,u;if(r=CKEDITOR.dom.walker.whitespaces(!0),o=/\ufeff|\u00a0/,l={table:1,tbody:1,tr:1},1<e.length&&(t=e[e.length-1],e[0].setEnd(t.endContainer,t.endOffset)),e=(t=e[0]).collapsed,(n=t.getEnclosedNode())&&n.type==CKEDITOR.NODE_ELEMENT&&n.getName()in C&&(!n.is("a")||!n.getText()))try{return(u=n.$.createControlRange()).addElement(n.$),void u.select()}catch(v){}(t.startContainer.type==CKEDITOR.NODE_ELEMENT&&t.startContainer.getName()in l||t.endContainer.type==CKEDITOR.NODE_ELEMENT&&t.endContainer.getName()in l)&&(t.shrink(CKEDITOR.NODE_ELEMENT,!0),e=t.collapsed),l=(u=t.createBookmark()).startNode,e||(s=u.endNode),(u=t.document.$.body.createTextRange()).moveToElementText(l.$),u.moveStart("character",1),s?((o=t.document.$.body.createTextRange()).moveToElementText(s.$),u.setEndPoint("EndToEnd",o),u.moveEnd("character",-1)):(c=l.getNext(r),d=l.hasAscendant("pre"),c=!(c&&c.getText&&c.getText().match(o))&&(d||!l.hasPrevious()||l.getPrevious().is&&l.getPrevious().is("br")),(d=t.document.createElement("span")).setHtml("&#65279;"),d.insertBefore(l),c&&t.document.createText("\ufeff").insertBefore(l)),t.setStartBefore(l),l.remove(),e?(c?(u.moveStart("character",-1),u.select(),t.document.$.selection.clear()):u.select(),t.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START),d.remove()):(t.setEndBefore(s),s.remove(),u.select())}else{if(!(s=this.getNative()))return;for(this.removeAllRanges(),u=0;u<e.length;u++)if(u<e.length-1&&(c=e[u],d=e[u+1],(o=c.clone()).setStart(c.endContainer,c.endOffset),o.setEnd(d.startContainer,d.startOffset),!o.collapsed&&(o.shrink(CKEDITOR.NODE_ELEMENT,!0),t=o.getCommonAncestor(),o=o.getEnclosedNode(),t.isReadOnly()||o&&o.isReadOnly())))d.setStart(c.startContainer,c.startOffset),e.splice(u--,1);else{t=e[u],d=this.document.$.createRange(),t.collapsed&&CKEDITOR.env.webkit&&p(t)&&(o=f(this.root),t.insertNode(o),(c=o.getNext())&&!o.getPrevious()&&c.type==CKEDITOR.NODE_ELEMENT&&"br"==c.getName()?(A(this.root),t.moveToPosition(c,CKEDITOR.POSITION_BEFORE_START)):t.moveToPosition(o,CKEDITOR.POSITION_AFTER_END)),d.setStart(t.startContainer.$,t.startOffset);try{d.setEnd(t.endContainer.$,t.endOffset)}catch($){if(!(0<=$.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")))throw $;t.collapse(1),d.setEnd(t.endContainer.$,t.endOffset)}s.addRange(d)}}this.reset(),this.root.fire("selectionchange")}}},fake:function(e,t){var n=this.root.editor;void 0===t&&e.hasAttribute("aria-label")&&(t=e.getAttribute("aria-label")),this.reset(),v(n,t);var i=this._.cache,a=new CKEDITOR.dom.range(this.root);a.setStartBefore(e),a.setEndAfter(e),i.ranges=new CKEDITOR.dom.rangeList(a),i.selectedElement=i.startElement=e,i.type=CKEDITOR.SELECTION_ELEMENT,i.selectedText=i.nativeSel=null,this.isFake=1,this.rev=k++,(n._.fakeSelection=this).root.fire("selectionchange")},isHidden:function(){var e=this.getCommonAncestor();return e&&e.type==CKEDITOR.NODE_TEXT&&(e=e.getParent()),!(!e||!e.data("cke-hidden-sel"))},isInTable:function(){return _(this.getRanges())},createBookmarks:function(e){return e=this.getRanges().createBookmarks(e),this.isFake&&(e.isFake=1),e},createBookmarks2:function(e){return e=this.getRanges().createBookmarks2(e),this.isFake&&(e.isFake=1),e},selectBookmarks:function(e){for(var t,n=[],i=0;i<e.length;i++){var a=new CKEDITOR.dom.range(this.root);a.moveToBookmark(e[i]),n.push(a)}return e.isFake&&((t=_(n)?n[0]._getTableElement():n[0].getEnclosedNode())&&t.type==CKEDITOR.NODE_ELEMENT||(CKEDITOR.warn("selection-not-fake"),e.isFake=0)),e.isFake&&!_(n)?this.fake(t):this.selectRanges(n),this},getCommonAncestor:function(){var e=this.getRanges();return e.length?e[0].startContainer.getCommonAncestor(e[e.length-1].endContainer):null},scrollIntoView:function(){this.type!=CKEDITOR.SELECTION_NONE&&this.getRanges()[0].scrollIntoView()},removeAllRanges:function(){if(this.getType()!=CKEDITOR.SELECTION_NONE){var e=this.getNative();try{e&&e[w?"empty":"removeAllRanges"]()}catch(i){}this.reset()}}}}(),CKEDITOR.STYLE_BLOCK=1,CKEDITOR.STYLE_INLINE=2,CKEDITOR.STYLE_OBJECT=3,function(){function E(e,t){for(var n,i;(e=e.getParent())&&!e.equals(t);)if(e.getAttribute("data-nostyle"))n=e;else if(!i){var a=e.getAttribute("contentEditable");"false"==a?n=e:"true"==a&&(i=1)}return n}function T(e,t,n,i){return(e.getPosition(t)|i)==i&&(!n.childRule||n.childRule(e))}function x(e){var t=e.document;if(e.collapsed)t=O(this,t),e.insertNode(t),e.moveToPosition(t,CKEDITOR.POSITION_BEFORE_END);else{var n,i=this.element,a=this._.definition,s=(_=a.ignoreReadonly)||a.includeReadonly;null==s&&(s=e.root.getCustomData("cke_includeReadonly"));var o=CKEDITOR.dtd[i];o||(n=!0,o=CKEDITOR.dtd.span),e.enlarge(CKEDITOR.ENLARGE_INLINE,1),e.trim();var r,l=e.createBookmark(),c=l.startNode,d=l.endNode,u=c;if(!_){var _=E(c,h=e.getCommonAncestor()),h=E(d,h);_&&(u=_.getNextSourceNode(!0)),h&&(d=h)}for(u.getPosition(d)==CKEDITOR.POSITION_FOLLOWING&&(u=0);u;){if(_=!1,u.equals(d))_=!(u=null);else{h=(b=u.type==CKEDITOR.NODE_ELEMENT?u.getName():null)&&"false"==u.getAttribute("contentEditable");var p=b&&u.getAttribute("data-nostyle");if(b&&u.data("cke-bookmark")){u=u.getNextSourceNode(!0);continue}if(h&&s&&CKEDITOR.dtd.$block[b])for(var f=void 0,m=0,g=(C=(k=I(g=u)).length)&&new CKEDITOR.dom.range(g.getDocument());m<C;++m){f=k[m];var A=CKEDITOR.filter.instances[f.data("cke-filter")];A&&!A.check(this)||(g.selectNodeContents(f),x.call(this,g))}if(k=b?!o[b]||p?0:h&&!s?0:T(u,d,a,R):1){if(k=a,C=i,m=n,!(f=u.getParent())||!(f.getDtd()||CKEDITOR.dtd.span)[C]&&!m||k.parentRule&&!k.parentRule(f))_=!0;else if(r||b&&CKEDITOR.dtd.$removeEmpty[b]&&(u.getPosition(d)|R)!=R||(r=e.clone()).setStartBefore(u),(b=u.type)==CKEDITOR.NODE_TEXT||h||b==CKEDITOR.NODE_ELEMENT&&!u.getChildCount()){for(var v,b=u;(_=!b.getNext(S))&&o[(v=b.getParent()).getName()]&&T(v,c,a,B);)b=v;r.setEndAfter(b)}}else _=!0;u=u.getNextSourceNode(p||h)}if(_&&r&&!r.collapsed){h=(_=O(this,t)).hasAttributes(),p=r.getCommonAncestor(),b={};for(var y,$,w,k={},C=(f={},{});_&&p;){if(p.getName()==i){for(y in a.attributes)!C[y]&&(w=p.getAttribute($))&&(_.getAttribute(y)==w?k[y]=1:C[y]=1);for($ in a.styles)!f[$]&&(w=p.getStyle($))&&(_.getStyle($)==w?b[$]=1:f[$]=1)}p=p.getParent()}for(y in k)_.removeAttribute(y);for($ in b)_.removeStyle($);h&&!_.hasAttributes()&&(_=null),_?(r.extractContents().appendTo(_),r.insertNode(_),D.call(this,_),_.mergeSiblings(),CKEDITOR.env.ie||_.$.normalize()):(_=new CKEDITOR.dom.element("span"),r.extractContents().appendTo(_),r.insertNode(_),D.call(this,_),_.remove(!0)),r=null}}e.moveToBookmark(l),e.shrink(CKEDITOR.SHRINK_TEXT),e.shrink(CKEDITOR.NODE_ELEMENT,!0)}}function t(e){function t(){for(var e=new CKEDITOR.dom.elementPath(o.getParent()),t=new CKEDITOR.dom.elementPath(d.getParent()),n=null,i=null,a=0;a<e.elements.length;a++){var s=e.elements[a];if(s==e.block||s==e.blockLimit)break;u.checkElementRemovable(s,!0)&&(n=s)}for(a=0;a<t.elements.length&&((s=t.elements[a])!=t.block&&s!=t.blockLimit);a++)u.checkElementRemovable(s,!0)&&(i=s);i&&d.breakParent(i),n&&o.breakParent(n)}e.enlarge(CKEDITOR.ENLARGE_INLINE,1);var n=e.createBookmark(),o=n.startNode,i=this._.definition.alwaysRemoveElement;if(e.collapsed){for(var a,s,r=new CKEDITOR.dom.elementPath(o.getParent(),e.root),l=0;l<r.elements.length&&(s=r.elements[l])&&s!=r.block&&s!=r.blockLimit;l++)if(this.checkElementRemovable(s)){var c;!i&&e.collapsed&&(e.checkBoundaryOfElement(s,CKEDITOR.END)||(c=e.checkBoundaryOfElement(s,CKEDITOR.START)))?(a=s).match=c?"start":"end":(s.mergeSiblings(),s.is(this.element)?_.call(this,s):h(s,f(this)[s.getName()]))}if(a){for(i=o,l=0;!(s=r.elements[l]).equals(a);l++)s.match||((s=s.clone()).append(i),i=s);i["start"==a.match?"insertBefore":"insertAfter"](a)}}else{var d=n.endNode,u=this;for(t(),r=o;!r.equals(d);)a=r.getNextSourceNode(),r.type==CKEDITOR.NODE_ELEMENT&&this.checkElementRemovable(r)&&(r.getName()==this.element?_.call(this,r):h(r,f(this)[r.getName()]),a.type==CKEDITOR.NODE_ELEMENT&&a.contains(o)&&(t(),a=o.getNext())),r=a}e.moveToBookmark(n),e.shrink(CKEDITOR.NODE_ELEMENT,!0)}function I(e){var t=[];return e.forEach(function(e){if("true"==e.getAttribute("contenteditable"))return t.push(e),!1},CKEDITOR.NODE_ELEMENT,!0),t}function n(e){var t=e.getEnclosedNode()||e.getCommonAncestor(!1,!0);(e=new CKEDITOR.dom.elementPath(t,e.root).contains(this.element,1))&&!e.isReadOnly()&&r(e,this)}function i(e){var t=e.getCommonAncestor(!0,!0);if(e=new CKEDITOR.dom.elementPath(t,e.root).contains(this.element,1)){var n=(t=this._.definition).attributes;if(n)for(var i in n)e.removeAttribute(i,n[i]);if(t.styles)for(var a in t.styles)t.styles.hasOwnProperty(a)&&e.removeStyle(a)}}function a(e){var t=e.createBookmark(!0),n=e.createIterator();n.enforceRealBlocks=!0,this._.enterMode&&(n.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR);for(var i,a=e.document;i=n.getNextParagraph();)!i.isReadOnly()&&(!n.activeFilter||n.activeFilter.check(this))&&o(i,O(this,a,i));e.moveToBookmark(t)}function s(e){var t,n,i=e.createBookmark(1),a=e.createIterator();for(a.enforceRealBlocks=!0,a.enlargeBr=this._.enterMode!=CKEDITOR.ENTER_BR;t=a.getNextParagraph();)this.checkElementRemovable(t)&&(t.is("pre")?((n=this._.enterMode==CKEDITOR.ENTER_BR?null:e.document.createElement(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))&&t.copyAttributes(n),o(t,n)):_.call(this,t));e.moveToBookmark(i)}function o(e,t){(n=!t)&&(t=e.getDocument().createElement("div"),e.copyAttributes(t));var n,i,a=t&&t.is("pre"),s=e.is("pre"),o=!a&&s;if(a&&!s){if(s=t,(o=e.getBogus())&&o.remove(),o=(o=(o=(o=c(o=e.getHtml(),/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"")).replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1")).replace(/([ \t\n\r]+|&nbsp;)/g," ")).replace(/<br\b[^>]*>/gi,"\n"),CKEDITOR.env.ie){var r=e.getDocument().createElement("div");r.append(s),s.$.outerHTML="<pre>"+o+"</pre>",s.copyAttributes(r.getFirst()),s=r.getFirst().remove()}else s.setHtml(o);t=s}else o?t=d(n?[e.getHtml()]:l(e),t):e.moveChildren(t);(t.replace(e),a)?(i=(n=t).getPrevious(w))&&i.type==CKEDITOR.NODE_ELEMENT&&i.is("pre")&&(a=c(i.getHtml(),/\n$/,"")+"\n\n"+c(n.getHtml(),/^\n/,""),CKEDITOR.env.ie?n.$.outerHTML="<pre>"+a+"</pre>":n.setHtml(a),i.remove()):n&&u(t)}function l(e){var n=[];return c(e.getOuterHtml(),/(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi,function(e,t,n){return t+"</pre>"+n+"<pre>"}).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(e,t){n.push(t)}),n}function c(e,t,n){var i="",a="";return e=e.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,function(e,t,n){return t&&(i=t),n&&(a=n),""}),i+e.replace(t,n)+a}function d(e,t){var n;1<e.length&&(n=new CKEDITOR.dom.documentFragment(t.getDocument()));for(var i=0;i<e.length;i++){var a=(a=(a=c(a=c(a=c(a=(a=e[i]).replace(/(\r\n|\r)/g,"\n"),/^[ \t]*\n/,""),/\n$/,""),/^[ \t]+|[ \t]+$/g,function(e,t){return 1==e.length?"&nbsp;":t?" "+CKEDITOR.tools.repeat("&nbsp;",e.length-1):CKEDITOR.tools.repeat("&nbsp;",e.length-1)+" "})).replace(/\n/g,"<br>")).replace(/[ \t]{2,}/g,function(e){return CKEDITOR.tools.repeat("&nbsp;",e.length-1)+" "});if(n){var s=t.clone();s.setHtml(a),n.append(s)}else t.setHtml(a)}return n||t}function _(e,t){var n,i=(a=this._.definition).attributes,a=a.styles,s=f(this)[e.getName()],o=CKEDITOR.tools.isEmpty(i)&&CKEDITOR.tools.isEmpty(a);for(n in i)("class"!=n&&!this._.definition.fullMatch||e.getAttribute(n)==m(n,i[n]))&&(t&&"data-"==n.slice(0,5)||(o=e.hasAttribute(n),e.removeAttribute(n)));for(var r in a)this._.definition.fullMatch&&e.getStyle(r)!=m(r,a[r],!0)||(o=o||!!e.getStyle(r),e.removeStyle(r));h(e,s,v[e.getName()]),o&&(this._.definition.alwaysRemoveElement?u(e,1):!CKEDITOR.dtd.$block[e.getName()]||this._.enterMode==CKEDITOR.ENTER_BR&&!e.hasAttributes()?u(e):e.renameNode(this._.enterMode==CKEDITOR.ENTER_P?"p":"div"))}function D(e){for(var t,n=f(this),i=e.getElementsByTag(this.element),a=i.count();0<=--a;)(t=i.getItem(a)).isReadOnly()||_.call(this,t,!0);for(var s in n)if(s!=this.element)for(a=(i=e.getElementsByTag(s)).count()-1;0<=a;a--)(t=i.getItem(a)).isReadOnly()||h(t,n[s])}function h(e,t,n){if(t=t&&t.attributes)for(var i=0;i<t.length;i++){var a,s=t[i][0];if(a=e.getAttribute(s)){var o=t[i][1];(null===o||o.test&&o.test(a)||"string"==typeof o&&a==o)&&e.removeAttribute(s)}}n||u(e)}function u(e,t){if(!e.hasAttributes()||t)if(CKEDITOR.dtd.$block[e.getName()]){var n=e.getPrevious(w),i=e.getNext(w);!n||n.type!=CKEDITOR.NODE_TEXT&&n.isBlockBoundary({br:1})||e.append("br",1),!i||i.type!=CKEDITOR.NODE_TEXT&&i.isBlockBoundary({br:1})||e.append("br"),e.remove(!0)}else n=e.getFirst(),i=e.getLast(),e.remove(!0),n&&(n.type==CKEDITOR.NODE_ELEMENT&&n.mergeSiblings(),i&&!n.equals(i)&&i.type==CKEDITOR.NODE_ELEMENT&&i.mergeSiblings())}function O(e,t,n){var i;return"*"==(i=e.element)&&(i="span"),i=new CKEDITOR.dom.element(i,t),n&&n.copyAttributes(i),i=r(i,e),t.getCustomData("doc_processing_style")&&i.hasAttribute("id")?i.removeAttribute("id"):t.setCustomData("doc_processing_style",1),i}function r(e,t){var n=(i=t._.definition).attributes,i=CKEDITOR.style.getStyleText(i);if(n)for(var a in n)e.setAttribute(a,n[a]);return i&&e.setAttribute("style",i),e}function p(e,n){for(var t in e)e[t]=e[t].replace($,function(e,t){return n[t]})}function f(e){if(e._.overrides)return e._.overrides;var t=e._.overrides={},n=e._.definition.overrides;if(n){CKEDITOR.tools.isArray(n)||(n=[n]);for(var i=0;i<n.length;i++){var a,s;if(
"string"==typeof(r=n[i])?a=r.toLowerCase():(a=r.element?r.element.toLowerCase():e.element,s=r.attributes),r=t[a]||(t[a]={}),s){var o,r=r.attributes=r.attributes||[];for(o in s)r.push([o.toLowerCase(),s[o]])}}}return t}function m(e,t,n){var i=new CKEDITOR.dom.element("span");return i[n?"setStyle":"setAttribute"](e,t),i[n?"getStyle":"getAttribute"](e)}function g(e,t){function n(e,t){return"font-family"==t.toLowerCase()?e.replace(/["']/g,""):e}for(var i in"string"==typeof e&&(e=CKEDITOR.tools.parseCssText(e)),"string"==typeof t&&(t=CKEDITOR.tools.parseCssText(t,!0)),e)if(!(i in t)||n(t[i],i)!=n(e[i],i)&&"inherit"!=e[i]&&"inherit"!=t[i])return!1;return!0}function A(e,t,n){var i,a,s=e.document,o=e.getRanges();if(t=t?this.removeFromRange:this.applyToRange,e.isFake&&e.isInTable())for(i=[],a=0;a<o.length;a++)i.push(o[a].clone());for(var r=o.createIterator();a=r.getNextRange();)t.call(this,a,n);e.selectRanges(i||o),s.removeCustomData("doc_processing_style")}var v={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,section:1,header:1,footer:1,nav:1,article:1,aside:1,figure:1,dialog:1,hgroup:1,time:1,meter:1,menu:1,command:1,keygen:1,output:1,progress:1,details:1,datagrid:1,datalist:1},b={a:1,blockquote:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,th:1,ul:1,dl:1,dt:1,dd:1,form:1,audio:1,video:1},y=/\s*(?:;\s*|$)/,$=/#\((.+?)\)/g,S=CKEDITOR.dom.walker.bookmark(0,1),w=CKEDITOR.dom.walker.whitespaces(1);CKEDITOR.style=function(e,t){if("string"==typeof e.type)return new CKEDITOR.style.customHandlers[e.type](e);var n=e.attributes;n&&n.style&&(e.styles=CKEDITOR.tools.extend({},e.styles,CKEDITOR.tools.parseCssText(n.style)),delete n.style),t&&(p((e=CKEDITOR.tools.clone(e)).attributes,t),p(e.styles,t)),n=this.element=e.element?"string"==typeof e.element?e.element.toLowerCase():e.element:"*",this.type=e.type||(v[n]?CKEDITOR.STYLE_BLOCK:b[n]?CKEDITOR.STYLE_OBJECT:CKEDITOR.STYLE_INLINE),"object"==typeof this.element&&(this.type=CKEDITOR.STYLE_OBJECT),this._={definition:e}},CKEDITOR.style.prototype={apply:function(e){if(e instanceof CKEDITOR.dom.document)return A.call(this,e.getSelection());if(this.checkApplicable(e.elementPath(),e)){var t=this._.enterMode;t||(this._.enterMode=e.activeEnterMode),A.call(this,e.getSelection(),0,e),this._.enterMode=t}},remove:function(e){if(e instanceof CKEDITOR.dom.document)return A.call(this,e.getSelection(),1);if(this.checkApplicable(e.elementPath(),e)){var t=this._.enterMode;t||(this._.enterMode=e.activeEnterMode),A.call(this,e.getSelection(),1,e),this._.enterMode=t}},applyToRange:function(e){return this.applyToRange=this.type==CKEDITOR.STYLE_INLINE?x:this.type==CKEDITOR.STYLE_BLOCK?a:this.type==CKEDITOR.STYLE_OBJECT?n:null,this.applyToRange(e)},removeFromRange:function(e){return this.removeFromRange=this.type==CKEDITOR.STYLE_INLINE?t:this.type==CKEDITOR.STYLE_BLOCK?s:this.type==CKEDITOR.STYLE_OBJECT?i:null,this.removeFromRange(e)},applyToObject:function(e){r(e,this)},checkActive:function(e,t){switch(this.type){case CKEDITOR.STYLE_BLOCK:return this.checkElementRemovable(e.block||e.blockLimit,!0,t);case CKEDITOR.STYLE_OBJECT:case CKEDITOR.STYLE_INLINE:for(var n,i=e.elements,a=0;a<i.length;a++)if(n=i[a],this.type!=CKEDITOR.STYLE_INLINE||n!=e.block&&n!=e.blockLimit){if(this.type==CKEDITOR.STYLE_OBJECT){var s=n.getName();if(!("string"==typeof this.element?s==this.element:s in this.element))continue}if(this.checkElementRemovable(n,!0,t))return!0}}return!1},checkApplicable:function(e,t,n){if(t&&t instanceof CKEDITOR.filter&&(n=t),n&&!n.check(this))return!1;switch(this.type){case CKEDITOR.STYLE_OBJECT:return!!e.contains(this.element);case CKEDITOR.STYLE_BLOCK:return!!e.blockLimit.getDtd()[this.element]}return!0},checkElementMatch:function(e,t){var n=this._.definition;if(!e||!n.ignoreReadonly&&e.isReadOnly())return!1;var i=e.getName();if("string"==typeof this.element?i==this.element:i in this.element){if(!t&&!e.hasAttributes())return!0;if(i=n._AC)n=i;else{i={};var a=0,s=n.attributes;if(s)for(var o in s)a++,i[o]=s[o];(o=CKEDITOR.style.getStyleText(n))&&(i.style||a++,i.style=o),i._length=a,n=n._AC=i}if(!n._length)return!0;for(var r in n)if("_length"!=r)if(i=e.getAttribute(r)||"","style"==r?g(n[r],i):n[r]==i){if(!t)return!0}else if(t)return!1;if(t)return!0}return!1},checkElementRemovable:function(e,t,n){if(this.checkElementMatch(e,t,n))return!0;if(t=f(this)[e.getName()]){var i;if(!(t=t.attributes))return!0;for(n=0;n<t.length;n++)if(i=t[n][0],i=e.getAttribute(i)){var a=t[n][1];if(null===a)return!0;if("string"==typeof a){if(i==a)return!0}else if(a.test(i))return!0}}return!1},buildPreview:function(e){var t=this._.definition,n=[],i=t.element;"bdo"==i&&(i="span");n=["<",i];var a=t.attributes;if(a)for(var s in a)n.push(" ",s,'="',a[s],'"');return(a=CKEDITOR.style.getStyleText(t))&&n.push(' style="',a,'"'),n.push(">",e||t.name,"</",i,">"),n.join("")},getDefinition:function(){return this._.definition}},CKEDITOR.style.getStyleText=function(e){if(t=e._ST)return t;var t=e.styles,n=e.attributes&&e.attributes.style||"",i="";for(var a in n.length&&(n=n.replace(y,";")),t){var s=t[a],o=(a+":"+s).replace(y,";");"inherit"==s?i+=o:n+=o}return n.length&&(n=CKEDITOR.tools.normalizeCssText(n,!0)),e._ST=n+i},CKEDITOR.style.customHandlers={},CKEDITOR.style.addCustomHandler=function(e){var t=function(e){this._={definition:e},this.setup&&this.setup(e)};return t.prototype=CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype),{assignedTo:CKEDITOR.STYLE_OBJECT},e,!0),this.customHandlers[e.type]=t};var R=CKEDITOR.POSITION_PRECEDING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED,B=CKEDITOR.POSITION_FOLLOWING|CKEDITOR.POSITION_IDENTICAL|CKEDITOR.POSITION_IS_CONTAINED}(),CKEDITOR.styleCommand=function(e,t){this.requiredContent=this.allowedContent=this.style=e,CKEDITOR.tools.extend(this,t,!0)},CKEDITOR.styleCommand.prototype.exec=function(e){e.focus(),this.state==CKEDITOR.TRISTATE_OFF?e.applyStyle(this.style):this.state==CKEDITOR.TRISTATE_ON&&e.removeStyle(this.style)},CKEDITOR.stylesSet=new CKEDITOR.resourceManager("","stylesSet"),CKEDITOR.addStylesSet=CKEDITOR.tools.bind(CKEDITOR.stylesSet.add,CKEDITOR.stylesSet),CKEDITOR.loadStylesSet=function(e,t,n){CKEDITOR.stylesSet.addExternal(e,t,""),CKEDITOR.stylesSet.load(e,n)},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{attachStyleStateChange:function(e,t){var a=this._.styleStateChangeCallbacks;a||(a=this._.styleStateChangeCallbacks=[],this.on("selectionChange",function(e){for(var t=0;t<a.length;t++){var n=a[t],i=n.style.checkActive(e.data.path,this)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF;n.fn.call(this,i)}})),a.push({style:e,fn:t})},applyStyle:function(e){e.apply(this)},removeStyle:function(e){e.remove(this)},getStylesSet:function(t){if(this._.stylesDefinitions)t(this._.stylesDefinitions);else{var n=this;if(!1===(e=n.config.stylesCombo_stylesSet||n.config.stylesSet))t(null);else if(e instanceof Array)n._.stylesDefinitions=e,t(e);else{e||(e="default");var e,i=(e=e.split(":"))[0];CKEDITOR.stylesSet.addExternal(i,e[1]?e.slice(1).join(":"):CKEDITOR.getUrl("styles.js"),""),CKEDITOR.stylesSet.load(i,function(e){n._.stylesDefinitions=e[i],t(n._.stylesDefinitions)})}}}}),CKEDITOR.dom.comment=function(e,t){"string"==typeof e&&(e=(t?t.$:document).createComment(e)),CKEDITOR.dom.domObject.call(this,e)},CKEDITOR.dom.comment.prototype=new CKEDITOR.dom.node,CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype,{type:CKEDITOR.NODE_COMMENT,getOuterHtml:function(){return"<!--"+this.$.nodeValue+"-->"}}),function(){var e,d={},u={};for(e in CKEDITOR.dtd.$blockLimit)e in CKEDITOR.dtd.$list||(d[e]=1);for(e in CKEDITOR.dtd.$block)e in CKEDITOR.dtd.$blockLimit||e in CKEDITOR.dtd.$empty||(u[e]=1);CKEDITOR.dom.elementPath=function(e,t){var n,i=null,a=null,s=[],o=e;t=t||e.getDocument().getBody(),o||(o=t);do{if(o.type==CKEDITOR.NODE_ELEMENT){if(s.push(o),!this.lastElement&&((this.lastElement=o).is(CKEDITOR.dtd.$object)||"false"==o.getAttribute("contenteditable")))continue;if(o.equals(t))break;if(!a&&(n=o.getName(),"true"==o.getAttribute("contenteditable")?a=o:!i&&u[n]&&(i=o),d[n])){if(n=!i&&"div"==n){e:{for(var r=0,l=(n=o.getChildren()).count();r<l;r++){var c=n.getItem(r);if(c.type==CKEDITOR.NODE_ELEMENT&&CKEDITOR.dtd.$block[c.getName()]){n=!0;break e}}n=!1}n=!n}n?i=o:a=o}}}while(o=o.getParent());a||(a=t),this.block=i,this.blockLimit=a,this.root=t,this.elements=s}}(),CKEDITOR.dom.elementPath.prototype={compare:function(e){var t=this.elements;if(!(e=e&&e.elements)||t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].equals(e[n]))return!1;return!0},contains:function(t,e,n){var i;"string"==typeof t&&(i=function(e){return e.getName()==t}),t instanceof CKEDITOR.dom.element?i=function(e){return e.equals(t)}:CKEDITOR.tools.isArray(t)?i=function(e){return-1<CKEDITOR.tools.indexOf(t,e.getName())}:"function"==typeof t?i=t:"object"==typeof t&&(i=function(e){return e.getName()in t});var a=this.elements,s=a.length;for(e&&s--,n&&(a=Array.prototype.slice.call(a,0)).reverse(),e=0;e<s;e++)if(i(a[e]))return a[e];return null},isContextFor:function(e){return!(e in CKEDITOR.dtd.$block)||!!(this.contains(CKEDITOR.dtd.$intermediate)||this.root.equals(this.block)&&this.block||this.blockLimit).getDtd()[e]},direction:function(){return(this.block||this.blockLimit||this.root).getDirection(1)}},CKEDITOR.dom.text=function(e,t){"string"==typeof e&&(e=(t?t.$:document).createTextNode(e)),this.$=e},CKEDITOR.dom.text.prototype=new CKEDITOR.dom.node,CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype,{type:CKEDITOR.NODE_TEXT,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},setText:function(e){this.$.nodeValue=e},split:function(e){var t=this.$.parentNode,n=t.childNodes.length,i=this.getLength(),a=this.getDocument(),s=new CKEDITOR.dom.text(this.$.splitText(e),a);return t.childNodes.length==n&&(i<=e?(s=a.createText("")).insertAfter(this):((e=a.createText("")).insertAfter(s),e.remove())),s},substring:function(e,t){return"number"!=typeof t?this.$.nodeValue.substr(e):this.$.nodeValue.substring(e,t)}}),function(){function s(e,t,n){var i=e.serializable,a=t[n?"endContainer":"startContainer"],s=n?"endOffset":"startOffset",o=i?t.document.getById(e.startNode):e.startNode;return e=i?t.document.getById(e.endNode):e.endNode,a.equals(o.getPrevious())?(t.startOffset=t.startOffset-a.getLength()-e.getPrevious().getLength(),a=e.getNext()):a.equals(e.getPrevious())&&(t.startOffset-=a.getLength(),a=e.getNext()),a.equals(o.getParent())&&t[s]++,a.equals(e.getParent())&&t[s]++,t[n?"endContainer":"startContainer"]=a,t}CKEDITOR.dom.rangeList=function(e){return e instanceof CKEDITOR.dom.rangeList?e:(e?e instanceof CKEDITOR.dom.range&&(e=[e]):e=[],CKEDITOR.tools.extend(e,t))};var t={createIterator:function(){var s,o=this,r=CKEDITOR.dom.walker.bookmark(),l=[];return{getNextRange:function(e){var t=o[s=void 0===s?0:s+1];if(t&&1<o.length){if(!s)for(var n=o.length-1;0<=n;n--)l.unshift(o[n].createBookmark(!0));if(e)for(var i=0;o[s+i+1];){var a=t.document;for(e=0,n=a.getById(l[i].endNode),a=a.getById(l[i+1].startNode);;){if(n=n.getNextSourceNode(!1),a.equals(n))e=1;else if(r(n)||n.type==CKEDITOR.NODE_ELEMENT&&n.isBlockBoundary())continue;break}if(!e)break;i++}for(t.moveToBookmark(l.shift());i--;)(n=o[++s]).moveToBookmark(l.shift()),t.setEnd(n.endContainer,n.endOffset)}return t}}},createBookmarks:function(e){for(var t,n=[],i=0;i<this.length;i++){n.push(t=this[i].createBookmark(e,!0));for(var a=i+1;a<this.length;a++)this[a]=s(t,this[a]),this[a]=s(t,this[a],!0)}return n},createBookmarks2:function(e){for(var t=[],n=0;n<this.length;n++)t.push(this[n].createBookmark2(e));return t},moveToBookmarks:function(e){for(var t=0;t<this.length;t++)this[t].moveToBookmark(e[t])}}}(),function(){function s(){return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1]||"skins/"+CKEDITOR.skinName.split(",")[0]+"/")}function n(e){var t=CKEDITOR.skin["ua_"+e],n=CKEDITOR.env;if(t){t=t.split(",").sort(function(e,t){return t<e?-1:1});for(var i,a=0;a<t.length;a++)if(i=t[a],n.ie&&(i.replace(/^ie/,"")==n.version||n.quirks&&"iequirks"==i)&&(i="ie"),n[i]){e+="_"+t[a];break}}return CKEDITOR.getUrl(s()+e+".css")}function i(e,t){a[e]||(CKEDITOR.document.appendStyleSheet(n(e)),a[e]=1),t&&t()}function o(e){var t=e.getById(l);return t||((t=e.getHead().append("style")).setAttribute("id",l),t.setAttribute("type","text/css")),t}function r(e,t,n){var i,a,s;if(CKEDITOR.env.webkit)for(t=t.split("}").slice(0,-1),a=0;a<t.length;a++)t[a]=t[a].split("{");for(var o=0;o<e.length;o++)if(CKEDITOR.env.webkit)for(a=0;a<t.length;a++){for(s=t[a][1],i=0;i<n.length;i++)s=s.replace(n[i][0],n[i][1]);e[o].$.sheet.addRule(t[a][0],s)}else{for(s=t,i=0;i<n.length;i++)s=s.replace(n[i][0],n[i][1]);CKEDITOR.env.ie&&CKEDITOR.env.version<11?e[o].$.styleSheet.cssText+=s:e[o].$.innerHTML+=s}}var a={};CKEDITOR.skin={path:s,loadPart:function(e,t){CKEDITOR.skin.name!=CKEDITOR.skinName.split(",")[0]?CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(s()+"skin.js"),function(){i(e,t)}):i(e,t)},getPath:function(e){return CKEDITOR.getUrl(n(e))},icons:{},addIcon:function(e,t,n,i){e=e.toLowerCase(),this.icons[e]||(this.icons[e]={path:t,offset:n||0,bgsize:i||"16px"})},getIconStyle:function(e,t,n,i,a){var s;return e&&(e=e.toLowerCase(),t&&(s=this.icons[e+"-rtl"]),s||(s=this.icons[e])),e=n||s&&s.path||"",i=i||s&&s.offset,a=a||s&&s.bgsize||"16px",e&&(e=e.replace(/'/g,"\\'")),e&&"background-image:url('"+CKEDITOR.getUrl(e)+"');background-position:0 "+i+"px;background-size:"+a+";"}},CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{getUiColor:function(){return this.uiColor},setUiColor:function(e){var a=o(CKEDITOR.document);return(this.setUiColor=function(e){this.uiColor=e;var t=CKEDITOR.skin.chameleon,n="",i="";"function"==typeof t&&(n=t(this,"editor"),i=t(this,"panel")),r([a],n,e=[[d,e]]),r(c,i,e)}).call(this,e)}});var l="cke_ui_color",c=[],d=/\$color/g;CKEDITOR.on("instanceLoaded",function(e){if(!CKEDITOR.env.ie||!CKEDITOR.env.quirks){var n=e.editor;e=function(e){if(!(e=(e.data[0]||e.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument()).getById("cke_ui_color")){e=o(e),c.push(e);var t=n.getUiColor();t&&r([e],CKEDITOR.skin.chameleon(n,"panel"),[[d,t]])}},n.on("panelShow",e),n.on("menuShow",e),n.config.uiColor&&n.setUiColor(n.config.uiColor)}})}(),function(){if(CKEDITOR.env.webkit)CKEDITOR.env.hc=!1;else{var e=CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>',CKEDITOR.document);e.appendTo(CKEDITOR.document.getHead());try{var t=e.getComputedStyle("border-top-color"),n=e.getComputedStyle("border-right-color");CKEDITOR.env.hc=!(!t||t!=n)}catch(i){CKEDITOR.env.hc=!1}e.remove()}if(CKEDITOR.env.hc&&(CKEDITOR.env.cssClass+=" cke_hc"),CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}"),CKEDITOR.status="loaded",CKEDITOR.fireOnce("loaded"),e=CKEDITOR._.pending)for(delete CKEDITOR._.pending,t=0;t<e.length;t++)CKEDITOR.editor.prototype.constructor.apply(e[t][0],e[t][1]),CKEDITOR.add(e[t][0])}(),CKEDITOR.skin.name="moono-lisa",CKEDITOR.skin.ua_editor="ie,iequirks,ie8,gecko",CKEDITOR.skin.ua_dialog="ie,iequirks,ie8",CKEDITOR.skin.chameleon=(U=function(e,t){for(var n=e.match(/[^#]./g),i=0;i<3;i++){var a,s=i;a=parseInt(n[i],16),a=("0"+(t<0?0|a*(1+t):0|a+(255-a)*t).toString(16)).slice(-2),n[s]=a}return"#"+n.join("")},H={editor:new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_bottom [background-color:{defaultBackground};border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [background-color:{defaultBackground};border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [background-color:{defaultBackground};outline-color:{defaultBorder};] {id} .cke_dialog_tab [background-color:{dialogTab};border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [background-color:{lightBackground};] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} a.cke_button_off:hover,{id} a.cke_button_off:focus,{id} a.cke_button_off:active [background-color:{darkBackground};border-color:{toolbarElementsBorder};] {id} .cke_button_on [background-color:{ckeButtonOn};border-color:{toolbarElementsBorder};] {id} .cke_toolbar_separator,{id} .cke_toolgroup a.cke_button:last-child:after,{id} .cke_toolgroup a.cke_button.cke_button_disabled:hover:last-child:after [background-color: {toolbarElementsBorder};border-color: {toolbarElementsBorder};] {id} a.cke_combo_button:hover,{id} a.cke_combo_button:focus,{id} .cke_combo_on a.cke_combo_button [border-color:{toolbarElementsBorder};background-color:{darkBackground};] {id} .cke_combo:after [border-color:{toolbarElementsBorder};] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover,{id} a.cke_path_item:focus,{id} a.cke_path_item:active [background-color:{darkBackground};] {id}.cke_panel [border-color:{defaultBorder};] "),panel:new CKEDITOR.template(".cke_panel_grouptitle [background-color:{lightBackground};border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover,.cke_menubutton:focus,.cke_menubutton:active [background-color:{menubuttonHover};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menubutton_disabled:hover .cke_menubutton_icon,.cke_menubutton_disabled:focus .cke_menubutton_icon,.cke_menubutton_disabled:active .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")},function(e,t){var n=U(e.uiColor,.4);return n={id:"."+e.id,defaultBorder:U(n,-.2),toolbarElementsBorder:U(n,-.25),defaultBackground:n,lightBackground:U(n,.8),darkBackground:U(n,-.15),ckeButtonOn:U(n,.4),ckeResizer:U(n,-.4),ckeColorauto:U(n,.8),dialogBody:U(n,.7),dialogTab:U(n,.65),dialogTabSelected:"#FFF",dialogTabSelectedBorder:"#FFF",elementsPathColor:U(n,-.6),menubuttonHover:U(n,.1),menubuttonIcon:U(n,.5),menubuttonIconHover:U(n,.3)},H[t].output(n).replace(/\[/g,"{").replace(/\]/g,"}")}),CKEDITOR.plugins.add("dialogui",{onLoad:function(){var r,l,c,d=function(e){this._||(this._={}),this._["default"]=this._.initValue=e["default"]||"",this._.required=e.required||!1;for(var t=[this._],n=1;n<arguments.length;n++)t.push(arguments[n]);return t.push(!0),CKEDITOR.tools.extend.apply(CKEDITOR.tools,t),this._},e={build:function(e,t,n){return new CKEDITOR.ui.dialog.textInput(e,t,n)}},t={build:function(e,t,n){return new CKEDITOR.ui.dialog[t.type](e,t,n)}},n={isChanged:function(){return this.getValue()!=this.getInitValue()},reset:function(e){this.setValue(this.getInitValue(),e)},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},i=CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onChange:function(e,t){this._.domOnChangeRegistered||(e.on("load",function(){this.getInputElement().on("change",function(){e.parts.dialog.isVisible()&&this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0),this.on("change",t)}},!0),a=/^on([A-Z]\w+)/,f=function(e){for(var t in e)(a.test(t)||"title"==t||"type"==t)&&delete e[t];return e},u=function(e){(e=e.data.getKeystroke())==CKEDITOR.SHIFT+CKEDITOR.ALT+36?this.setDirectionMarker("ltr"):e==CKEDITOR.SHIFT+CKEDITOR.ALT+35&&this.setDirectionMarker("rtl")};CKEDITOR.tools.extend(CKEDITOR.ui.dialog,{labeledElement:function(n,i,e,a){if(!(arguments.length<4)){var s=d.call(this,i);s.labelId=CKEDITOR.tools.getNextId()+"_label",this._.children=[];var t={role:i.role||"presentation"};i.includeLabel&&(t["aria-labelledby"]=s.labelId),CKEDITOR.ui.dialog.uiElement.call(this,n,i,e,"div",null,t,function(){var e=[],t=i.required?" cke_required":"";return"horizontal"!=i.labelLayout?e.push('<label class="cke_dialog_ui_labeled_label'+t+'" ',' id="'+s.labelId+'"',s.inputId?' for="'+s.inputId+'"':"",(i.labelStyle?' style="'+i.labelStyle+'"':"")+">",i.label,"</label>",'<div class="cke_dialog_ui_labeled_content"',i.controlStyle?' style="'+i.controlStyle+'"':"",' role="presentation">',a.call(this,n,i),"</div>"):(t={type:"hbox",widths:i.widths,padding:0,children:[{type:"html",html:'<label class="cke_dialog_ui_labeled_label'+t+'" id="'+s.labelId+'" for="'+s.inputId+'"'+(i.labelStyle?' style="'+i.labelStyle+'"':"")+">"+CKEDITOR.tools.htmlEncode(i.label)+"</label>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content"'+(i.controlStyle?' style="'+i.controlStyle+'"':"")+">"+a.call(this,n,i)+"</span>"}]},CKEDITOR.dialog._.uiElementBuilders.hbox.build(n,t,e)),e.join("")})}},textInput:function(t,n,e){if(!(arguments.length<3)){d.call(this,n);var i=this._.inputId=CKEDITOR.tools.getNextId()+"_textInput",a={"class":"cke_dialog_ui_input_"+n.type,id:i,type:n.type};n.validate&&(this.validate=n.validate),n.maxLength&&(a.maxlength=n.maxLength),n.size&&(a.size=n.size),n.inputStyle&&(a.style=n.inputStyle);var s=this,o=!1;t.on("load",function(){s.getInputElement().on("keydown",function(e){13==e.data.getKeystroke()&&(o=!0)}),s.getInputElement().on("keyup",function(e){13==e.data.getKeystroke()&&o&&(t.getButton("ok")&&setTimeout(function(){t.getButton("ok").click()},0),o=!1),s.bidi&&u.call(s,e)},null,null,1e3)}),CKEDITOR.ui.dialog.labeledElement.call(this,t,n,e,function(){var e=['<div class="cke_dialog_ui_input_',n.type,'" role="presentation"'];for(var t in n.width&&e.push('style="width:'+n.width+'" '),e.push("><input "),a["aria-labelledby"]=this._.labelId,this._.required&&(a["aria-required"]=this._.required),a)e.push(t+'="'+a[t]+'" ');return e.push(" /></div>"),e.join("")})}},textarea:function(e,t,n){if(!(arguments.length<3)){d.call(this,t);var i=this,a=this._.inputId=CKEDITOR.tools.getNextId()+"_textarea",s={};t.validate&&(this.validate=t.validate),s.rows=t.rows||5,s.cols=t.cols||20,s["class"]="cke_dialog_ui_input_textarea "+(t["class"]||""),"undefined"!=typeof t.inputStyle&&(s.style=t.inputStyle),t.dir&&(s.dir=t.dir),i.bidi&&e.on("load",function(){i.getInputElement().on("keyup",u)},i),CKEDITOR.ui.dialog.labeledElement.call(this,e,t,n,function(){s["aria-labelledby"]=this._.labelId,this._.required&&(s["aria-required"]=this._.required);var e,t=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="',a,'" '];for(e in s)t.push(e+'="'+CKEDITOR.tools.htmlEncode(s[e])+'" ');return t.push(">",CKEDITOR.tools.htmlEncode(i._["default"]),"</textarea></div>"),t.join("")})}},checkbox:function(a,s,e){if(!(arguments.length<3)){var o=d.call(this,s,{"default":!!s["default"]});s.validate&&(this.validate=s.validate),CKEDITOR.ui.dialog.uiElement.call(this,a,s,e,"span",null,null,function(){var e=CKEDITOR.tools.extend({},s,{id:s.id?s.id+"_checkbox":CKEDITOR.tools.getNextId()+"_checkbox"},!0),t=[],n=CKEDITOR.tools.getNextId()+"_label",i={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":n};return f(e),s["default"]&&(i.checked="checked"),"undefined"!=typeof e.inputStyle&&(e.style=e.inputStyle),o.checkbox=new CKEDITOR.ui.dialog.uiElement(a,e,t,"input",null,i),t.push(' <label id="',n,'" for="',i.id,'"'+(s.labelStyle?' style="'+s.labelStyle+'"':"")+">",CKEDITOR.tools.htmlEncode(s.label),"</label>"),t.join("")})}},radio:function(u,_,e){if(!(arguments.length<3)){d.call(this,_),this._["default"]||(this._["default"]=this._.initValue=_.items[0][1]),_.validate&&(this.validate=_.validate);var h=[],p=this;_.role="radiogroup",_.includeLabel=!0,CKEDITOR.ui.dialog.labeledElement.call(this,u,_,e,function(){for(var e=[],t=[],n=(_.id?_.id:CKEDITOR.tools.getNextId())+"_radio",i=0;i<_.items.length;i++){var a=_.items[i],s=void 0!==a[2]?a[2]:a[0],o=void 0!==a[1]?a[1]:a[0],r=(l=CKEDITOR.tools.getNextId()+"_radio_input")+"_label",l=CKEDITOR.tools.extend({},_,{id:l,title:null,type:null},!0),c=(s=CKEDITOR.tools.extend({},l,{title:s},!0),{type:"radio","class":"cke_dialog_ui_radio_input",name:n,value:o,"aria-labelledby":r}),d=[];p._["default"]==o&&(c.checked="checked"),f(l),f(s),"undefined"!=typeof l.inputStyle&&(l.style=l.inputStyle),l.keyboardFocusable=!0,h.push(new CKEDITOR.ui.dialog.uiElement(u,l,d,"input",null,c)),d.push(" "),new CKEDITOR.ui.dialog.uiElement(u,s,d,"label",null,{id:r,"for":c.id},a[0]),e.push(d.join(""))}return new CKEDITOR.ui.dialog.hbox(u,h,e,t),t.join("")}),this._.children=h}},button:function(e,t,n){if(arguments.length){"function"==typeof t&&(t=t(e.getParentEditor())),d.call(this,t,{disabled:t.disabled||!1}),CKEDITOR.event.implementOn(this);var i=this;e.on("load",function(){var e=this.getElement();e.on("click",function(e){i.click(),e.data.preventDefault()}),e.on("keydown",function(e){e.data.getKeystroke()in{32:1}&&(i.click(),e.data.preventDefault())}),e.unselectable()},this);var a=CKEDITOR.tools.extend({},t);delete a.style;var s=CKEDITOR.tools.getNextId()+"_label";CKEDITOR.ui.dialog.uiElement.call(this,e,a,n,"a",null,{style:t.style,href:"javascript:void(0)",title:t.label,hidefocus:"true","class":t["class"],role:"button","aria-labelledby":s},'<span id="'+s+'" class="cke_dialog_ui_button">'+CKEDITOR.tools.htmlEncode(t.label)+"</span>")}},select:function(o,r,e){if(!(arguments.length<3)){var l=d.call(this,r);r.validate&&(this.validate=r.validate),l.inputId=CKEDITOR.tools.getNextId()+"_select",CKEDITOR.ui.dialog.labeledElement.call(this,o,r,e,function(){var e=CKEDITOR.tools.extend({},r,{id:r.id?r.id+"_select":CKEDITOR.tools.getNextId()+"_select"},!0),t=[],n=[],i={id:l.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};t.push('<div class="cke_dialog_ui_input_',r.type,'" role="presentation"'),r.width&&t.push('style="width:'+r.width+'" '),t.push(">"),void 0!==r.size&&(i.size=r.size),void 0!==r.multiple&&(i.multiple=r.multiple),f(e);for(var a,s=0;s<r.items.length&&(a=r.items[s]);s++)n.push('<option value="',CKEDITOR.tools.htmlEncode(void 0!==a[1]?a[1]:a[0]).replace(/"/g,"&quot;"),'" /> ',CKEDITOR.tools.htmlEncode(a[0]));return"undefined"!=typeof e.inputStyle&&(e.style=e.inputStyle),l.select=new CKEDITOR.ui.dialog.uiElement(o,e,t,"select",null,i,n.join("")),t.push("</div>"),t.join("")})}},file:function(e,t,n){if(!(arguments.length<3)){void 0===t["default"]&&(t["default"]="");var i=CKEDITOR.tools.extend(d.call(this,t),{definition:t,buttons:[]});t.validate&&(this.validate=t.validate),e.on("load",function(){CKEDITOR.document.getById(i.frameId).getParent().addClass("cke_dialog_ui_input_file")}),CKEDITOR.ui.dialog.labeledElement.call(this,e,t,n,function(){i.frameId=CKEDITOR.tools.getNextId()+"_fileInput";var e=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="',i.frameId,'" title="',t.label,'" src="javascript:void('];return e.push(CKEDITOR.env.ie?"(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"})()":"0"),e.push(')"></iframe>'),e.join("")})}},fileButton:function(n,i,e){var t=this;if(!(arguments.length<3)){d.call(this,i),i.validate&&(this.validate=i.validate);var a=CKEDITOR.tools.extend({},i),s=a.onClick;a.className=(a.className?a.className+" ":"")+"cke_dialog_ui_button",a.onClick=function(e){var t=i["for"];s&&!1===s.call(this,e)||(n.getContentElement(t[0],t[1]).submit(),this.disable())},n.on("load",function(){n.getContentElement(i["for"][0],i["for"][1])._.buttons.push(t)}),CKEDITOR.ui.dialog.button.call(this,n,a,e)}},html:(r=/^\s*<[\w:]+\s+([^>]*)?>/,l=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,c=/\/$/,function(e,t,n){if(!(arguments.length<3)){var i=[],a=t.html;"<"!=a.charAt(0)&&(a="<span>"+a+"</span>");var s=t.focus;if(s){var o=this.focus;this.focus=function(){("function"==typeof s?s:o).call(this),this.fire("focus")},t.isFocusable&&(this.isFocusable=this.isFocusable),this.keyboardFocusable=!0}CKEDITOR.ui.dialog.uiElement.call(this,e,t,i,"span",null,null,""),i=i.join("").match(r),a=a.match(l)||["","",""],c.test(a[1])&&(a[1]=a[1].slice(0,-1),a[2]="/"+a[2]),n.push([a[1]," ",i[1]||"",a[2]].join(""))}}),fieldset:function(e,t,n,i,a){var s=a.label;this._={children:t},CKEDITOR.ui.dialog.uiElement.call(this,e,a,i,"fieldset",null,null,function(){var e=[];s&&e.push("<legend"+(a.labelStyle?' style="'+a.labelStyle+'"':"")+">"+s+"</legend>");for(var t=0;t<n.length;t++)e.push(n[t]);return e.join("")})}},!0),CKEDITOR.ui.dialog.html.prototype=new CKEDITOR.ui.dialog.uiElement,CKEDITOR.ui.dialog.labeledElement.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{setLabel:function(e){var t=CKEDITOR.document.getById(this._.labelId);return t.getChildCount()<1?new CKEDITOR.dom.text(e,CKEDITOR.document).appendTo(t):t.getChild(0).$.nodeValue=e,this},getLabel:function(){var e=CKEDITOR.document.getById(this._.labelId);return!e||e.getChildCount()<1?"":e.getChild(0).getText()},eventProcessors:i},!0),CKEDITOR.ui.dialog.button.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{click:function(){return!this._.disabled&&this.fire("click",{dialog:this._.dialog})},enable:function(){this._.disabled=!1;var e=this.getElement();e&&e.removeClass("cke_disabled")},disable:function(){this._.disabled=!0,this.getElement().addClass("cke_disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()},isEnabled:function(){return!this._.disabled},eventProcessors:CKEDITOR.tools.extend({},CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,{onClick:function(e,t){this.on("click",function(){t.apply(this,arguments)})}},!0),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:!0},!0),CKEDITOR.ui.dialog.textInput.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return CKEDITOR.document.getById(this._.inputId)},focus:function(){var t=this.selectParentTab();setTimeout(function(){var e=t.getInputElement();e&&e.$.focus()},0)},select:function(){var t=this.selectParentTab();setTimeout(function(){var e=t.getInputElement();e&&(e.$.focus(),e.$.select())},0)},accessKeyUp:function(){this.select()},setValue:function(e){if(this.bidi){var t=e&&e.charAt(0);(t="\u202a"==t?"ltr":"\u202b"==t?"rtl":null)&&(e=e.slice(1)),this.setDirectionMarker(t)}return e||(e=""),CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this,arguments)},getValue:function(){var e=CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);if(this.bidi&&e){var t=this.getDirectionMarker();t&&(e=("ltr"==t?"\u202a":"\u202b")+e)}return e},setDirectionMarker:function(e){var t=this.getInputElement();e?t.setAttributes({dir:e,"data-cke-dir-marker":e}):this.getDirectionMarker()&&t.removeAttributes(["dir","data-cke-dir-marker"])},getDirectionMarker:function(){return this.getInputElement().data("cke-dir-marker")},keyboardFocusable:!0},n,!0),CKEDITOR.ui.dialog.textarea.prototype=new CKEDITOR.ui.dialog.textInput,CKEDITOR.ui.dialog.select.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,{getInputElement:function(){return this._.select.getElement()},add:function(e,t,n){var i=new CKEDITOR.dom.element("option",this.getDialog().getParentEditor().document),a=this.getInputElement().$;return i.$.text=e,i.$.value=null==t?e:t,null==n?CKEDITOR.env.ie?a.add(i.$):a.add(i.$,null):a.add(i.$,n),this},remove:function(e){return this.getInputElement().$.remove(e),this},clear:function(){for(var e=this.getInputElement().$;0<e.length;)e.remove(0);return this},keyboardFocusable:!0},n,!0),CKEDITOR.ui.dialog.checkbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(e,t){this.getInputElement().$.checked=e,!t&&this.fire("change",{value:e})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(e,t){return!CKEDITOR.env.ie||8<CKEDITOR.env.version?i.onChange.apply(this,arguments):(e.on("load",function(){var t=this._.checkbox.getElement();t.on("propertychange",function(e){"checked"==(e=e.data.$).propertyName&&this.fire("change",{value:t.$.checked})},this)},this),this.on("change",t),null)}},keyboardFocusable:!0},n,!0),CKEDITOR.ui.dialog.radio.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{
setValue:function(e,t){for(var n,i=this._.children,a=0;a<i.length&&(n=i[a]);a++)n.getElement().$.checked=n.getValue()==e;!t&&this.fire("change",{value:e})},getValue:function(){for(var e=this._.children,t=0;t<e.length;t++)if(e[t].getElement().$.checked)return e[t].getValue();return null},accessKeyUp:function(){var e,t=this._.children;for(e=0;e<t.length;e++)if(t[e].getElement().$.checked)return void t[e].getElement().focus();t[0].getElement().focus()},eventProcessors:{onChange:function(e,t){return!CKEDITOR.env.ie||8<CKEDITOR.env.version?i.onChange.apply(this,arguments):(e.on("load",function(){for(var e=this._.children,t=this,n=0;n<e.length;n++)e[n].getElement().on("propertychange",function(e){"checked"==(e=e.data.$).propertyName&&this.$.checked&&t.fire("change",{value:this.getAttribute("value")})})},this),this.on("change",t),null)}}},n,!0),CKEDITOR.ui.dialog.file.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement,n,{getInputElement:function(){var e=CKEDITOR.document.getById(this._.frameId).getFrameDocument();return 0<e.$.forms.length?new CKEDITOR.dom.element(e.$.forms[0].elements[0]):this.getElement()},submit:function(){return this.getInputElement().getParent().$.submit(),this},getAction:function(){return this.getInputElement().getParent().$.action},registerEvents:function(e){var t,n,i=/^on([A-Z]\w+)/,a=function(e,t,n,i){e.on("formLoaded",function(){e.getInputElement().on(n,i,e)})};for(n in e)(t=n.match(i))&&(this.eventProcessors[n]?this.eventProcessors[n].call(this,this._.dialog,e[n]):a(this,this._.dialog,t[1].toLowerCase(),e[n]));return this},reset:function(){function e(){i.$.open();var e="";a.size&&(e=a.size-(CKEDITOR.env.ie?7:0));var t=n.frameId+"_input";for(i.$.write(['<html dir="'+l+'" lang="'+c+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+l+'" lang="'+c+'" action="',CKEDITOR.tools.htmlEncode(a.action),'"><label id="',n.labelId,'" for="',t,'" style="display:none">',CKEDITOR.tools.htmlEncode(a.label),'</label><input style="width:100%" id="',t,'" aria-labelledby="',n.labelId,'" type="file" name="',CKEDITOR.tools.htmlEncode(a.id||"cke_upload"),'" size="',CKEDITOR.tools.htmlEncode(0<e?e:""),'" /></form></body></html><script>',CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"","window.parent.CKEDITOR.tools.callFunction("+o+");","window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction("+r+")}","</script>"].join("")),i.$.close(),e=0;e<s.length;e++)s[e].enable()}var n=this._,i=CKEDITOR.document.getById(n.frameId).getFrameDocument(),a=n.definition,s=n.buttons,o=this.formLoadedNumber,r=this.formUnloadNumber,l=n.dialog._.editor.lang.dir,c=n.dialog._.editor.langCode;o||(o=this.formLoadedNumber=CKEDITOR.tools.addFunction(function(){this.fire("formLoaded")},this),r=this.formUnloadNumber=CKEDITOR.tools.addFunction(function(){this.getInputElement().clearCustomData()},this),this.getDialog()._.editor.on("destroy",function(){CKEDITOR.tools.removeFunction(o),CKEDITOR.tools.removeFunction(r)})),CKEDITOR.env.gecko?setTimeout(e,500):e()},getValue:function(){return this.getInputElement().$.value||""},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(e,t){this._.domOnChangeRegistered||(this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this),this._.domOnChangeRegistered=!0),this.on("change",t)}},keyboardFocusable:!0},!0),CKEDITOR.ui.dialog.fileButton.prototype=new CKEDITOR.ui.dialog.button,CKEDITOR.ui.dialog.fieldset.prototype=CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype),CKEDITOR.dialog.addUIElement("text",e),CKEDITOR.dialog.addUIElement("password",e),CKEDITOR.dialog.addUIElement("textarea",t),CKEDITOR.dialog.addUIElement("checkbox",t),CKEDITOR.dialog.addUIElement("radio",t),CKEDITOR.dialog.addUIElement("button",t),CKEDITOR.dialog.addUIElement("select",t),CKEDITOR.dialog.addUIElement("file",t),CKEDITOR.dialog.addUIElement("fileButton",t),CKEDITOR.dialog.addUIElement("html",t),CKEDITOR.dialog.addUIElement("fieldset",{build:function(e,t,n){for(var i,a=t.children,s=[],o=[],r=0;r<a.length&&(i=a[r]);r++){var l=[];s.push(l),o.push(CKEDITOR.dialog._.uiElementBuilders[i.type].build(e,i,l))}return new CKEDITOR.ui.dialog[t.type](e,o,s,n,t)}})}}),CKEDITOR.DIALOG_RESIZE_NONE=0,CKEDITOR.DIALOG_RESIZE_WIDTH=1,CKEDITOR.DIALOG_RESIZE_HEIGHT=2,CKEDITOR.DIALOG_RESIZE_BOTH=3,CKEDITOR.DIALOG_STATE_IDLE=1,CKEDITOR.DIALOG_STATE_BUSY=2,function(){function g(){for(var e=this._.tabIdList.length,t=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId)+e,n=t-1;t-e<n;n--)if(this._.tabs[this._.tabIdList[n%e]][0].$.offsetHeight)return this._.tabIdList[n%e];return null}function A(){for(var e=this._.tabIdList.length,t=CKEDITOR.tools.indexOf(this._.tabIdList,this._.currentTabId),n=t+1;n<t+e;n++)if(this._.tabs[this._.tabIdList[n%e]][0].$.offsetHeight)return this._.tabIdList[n%e];return null}function s(e,t){for(var n=e.$.getElementsByTagName("input"),i=0,a=n.length;i<a;i++){var s=new CKEDITOR.dom.element(n[i]);"text"==s.getAttribute("type").toLowerCase()&&(t?(s.setAttribute("value",s.getCustomData("fake_value")||""),s.removeCustomData("fake_value")):(s.setCustomData("fake_value",s.getAttribute("value")),s.setAttribute("value","")))}}function v(e,t){var n=this.getInputElement();n&&(e?n.removeAttribute("aria-invalid"):n.setAttribute("aria-invalid",!0)),e||(this.select?this.select():this.focus()),t&&alert(t),this.fire("validated",{valid:e,msg:t})}function b(){var e=this.getInputElement();e&&e.removeAttribute("aria-invalid")}function y(e){var t=CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog",_).output({id:CKEDITOR.tools.getNextNumber(),editorId:e.id,langDir:e.lang.dir,langCode:e.langCode,editorDialogClass:"cke_editor_"+e.name.replace(/\./g,"\\.")+"_dialog",closeTitle:e.lang.common.close,hidpi:CKEDITOR.env.hidpi?"cke_hidpi":""})),n=t.getChild([0,0,0,0,0]),i=n.getChild(0),a=n.getChild(1);return e.plugins.clipboard&&CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(n),!CKEDITOR.env.ie||CKEDITOR.env.quirks||CKEDITOR.env.edge||(e="javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())",CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="'+e+'" tabIndex="-1"></iframe>').appendTo(n.getParent())),i.unselectable(),a.unselectable(),{element:t,parts:{dialog:t.getChild(0),title:i,close:a,tabs:n.getChild(2),contents:n.getChild([3,0,0,0]),footer:n.getChild([3,0,1,0])}}}function i(e,t,n){this.element=t,this.focusIndex=n,this.tabIndex=0,this.isFocusable=function(){return!t.getAttribute("disabled")&&t.isVisible()},this.focus=function(){e._.currentFocusIndex=this.focusIndex,this.element.focus()},t.on("keydown",function(e){e.data.getKeystroke()in{32:1,13:1}&&this.fire("click")}),t.on("focus",function(){this.fire("mouseover")}),t.on("blur",function(){this.fire("mouseout")})}function l(e){function t(){e.layout()}var n=CKEDITOR.document.getWindow();n.on("resize",t),e.on("hide",function(){n.removeListener("resize",t)})}function o(e,t){this._={dialog:e},CKEDITOR.tools.extend(this,t)}function $(r){function n(e){var t=r.getSize(),n=CKEDITOR.document.getWindow().getViewPaneSize(),i=e.data.$.screenX,a=e.data.$.screenY,s=i-l.x,o=a-l.y;l={x:i,y:a},c.x+=s,c.y+=o,r.move(c.x+_[3]<u?-_[3]:c.x-_[1]>n.width-t.width-u?n.width-t.width+("rtl"==d.lang.dir?0:_[1]):c.x,c.y+_[0]<u?-_[0]:c.y-_[2]>n.height-t.height-u?n.height-t.height+_[2]:c.y,1),e.data.preventDefault()}function i(){if(CKEDITOR.document.removeListener("mousemove",n),CKEDITOR.document.removeListener("mouseup",i),CKEDITOR.env.ie6Compat){var e=E.getChild(0).getFrameDocument();e.removeListener("mousemove",n),e.removeListener("mouseup",i)}}var l=null,c=null,d=r.getParentEditor(),u=d.config.dialog_magnetDistance,_=CKEDITOR.skin.margins||[0,0,0,0];void 0===u&&(u=20),r.parts.title.on("mousedown",function(e){if(l={x:e.data.$.screenX,y:e.data.$.screenY},CKEDITOR.document.on("mousemove",n),CKEDITOR.document.on("mouseup",i),c=r.getPosition(),CKEDITOR.env.ie6Compat){var t=E.getChild(0).getFrameDocument();t.on("mousemove",n),t.on("mouseup",i)}e.data.preventDefault()},r)}function w(l){function n(e){var t="rtl"==m.lang.dir,n=f.width,i=f.height,a=n+(e.data.$.screenX-p.x)*(t?-1:1)*(l._.moved?1:2),s=i+(e.data.$.screenY-p.y)*(l._.moved?1:2),o=l._.element.getFirst(),r=(o=t&&o.getComputedStyle("right"),l.getPosition());r.y+s>h.height&&(s=h.height-r.y),(t?o:r.x)+a>h.width&&(a=h.width-(t?o:r.x)),d!=CKEDITOR.DIALOG_RESIZE_WIDTH&&d!=CKEDITOR.DIALOG_RESIZE_BOTH||(n=Math.max(c.minWidth||0,a-u)),d!=CKEDITOR.DIALOG_RESIZE_HEIGHT&&d!=CKEDITOR.DIALOG_RESIZE_BOTH||(i=Math.max(c.minHeight||0,s-_)),l.resize(n,i),l._.moved||l.layout(),e.data.preventDefault()}function i(){if(CKEDITOR.document.removeListener("mouseup",i),CKEDITOR.document.removeListener("mousemove",n),a&&(a.remove(),a=null),CKEDITOR.env.ie6Compat){var e=E.getChild(0).getFrameDocument();e.removeListener("mouseup",i),e.removeListener("mousemove",n)}}var c=l.definition,d=c.resizable;if(d!=CKEDITOR.DIALOG_RESIZE_NONE){var u,_,h,p,f,a,m=l.getParentEditor(),t=CKEDITOR.tools.addFunction(function(e){f=l.getSize();var t=l.parts.contents;t.$.getElementsByTagName("iframe").length&&(a=CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>'),t.append(a)),_=f.height-l.parts.contents.getSize("height",!(CKEDITOR.env.gecko||CKEDITOR.env.ie&&CKEDITOR.env.quirks)),u=f.width-l.parts.contents.getSize("width",1),p={x:e.screenX,y:e.screenY},h=CKEDITOR.document.getWindow().getViewPaneSize(),CKEDITOR.document.on("mousemove",n),CKEDITOR.document.on("mouseup",i),CKEDITOR.env.ie6Compat&&((t=E.getChild(0).getFrameDocument()).on("mousemove",n),t.on("mouseup",i)),e.preventDefault&&e.preventDefault()});l.on("load",function(){var e="";d==CKEDITOR.DIALOG_RESIZE_WIDTH?e=" cke_resizer_horizontal":d==CKEDITOR.DIALOG_RESIZE_HEIGHT&&(e=" cke_resizer_vertical"),e=CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer'+e+" cke_resizer_"+m.lang.dir+'" title="'+CKEDITOR.tools.htmlEncode(m.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+t+', event )">'+("ltr"==m.lang.dir?"\u25e2":"\u25e3")+"</div>"),l.parts.footer.append(e,1)}),m.on("destroy",function(){CKEDITOR.tools.removeFunction(t)})}}function c(e){e.data.preventDefault(1)}function d(e){var n=CKEDITOR.document.getWindow(),t=e.config,i=CKEDITOR.skinName||e.config.skin,a=t.dialog_backgroundCoverColor||("moono-lisa"==i?"black":"white"),s=(i=t.dialog_backgroundCoverOpacity,t.baseFloatZIndex),o=(t=CKEDITOR.tools.genKey(a,i,s),R[t]);o?o.show():(s=['<div tabIndex="-1" style="position: ',CKEDITOR.env.ie6Compat?"absolute":"fixed","; z-index: ",s,"; top: 0px; left: 0px; ",CKEDITOR.env.ie6Compat?"":"background-color: "+a,'" class="cke_dialog_background_cover">'],CKEDITOR.env.ie6Compat&&(a="<html><body style=\\'background-color:"+a+";\\'></body></html>",s.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'),s.push("void((function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.write( '"+a+"' );document.close();")+"})())"),s.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')),s.push("</div>"),(o=CKEDITOR.dom.element.createFromHtml(s.join(""))).setOpacity(void 0!==i?i:.5),o.on("keydown",c),o.on("keypress",c),o.on("keyup",c),o.appendTo(CKEDITOR.document.getBody()),R[t]=o),e.focusManager.add(o),E=o;var r=function(){var e=n.getScrollPosition(),t=CKEDITOR.dialog._.currentTop;if(o.setStyles({left:e.x+"px",top:e.y+"px"}),t)for(;e=t.getPosition(),t.move(e.x,e.y),t=t._.parentDialog;);};if(m=e=function(){var e=n.getViewPaneSize();o.setStyles({width:e.width+"px",height:e.height+"px"})},n.on("resize",e),e(),CKEDITOR.env.mac&&CKEDITOR.env.webkit||o.focus(),CKEDITOR.env.ie6Compat){var l=function(){r(),arguments.callee.prevScrollHandler.apply(this,arguments)};n.$.setTimeout(function(){l.prevScrollHandler=window.onscroll||function(){},window.onscroll=l},0),r()}}function a(e){E&&(e.focusManager.remove(E),e=CKEDITOR.document.getWindow(),E.hide(),e.removeListener("resize",m),CKEDITOR.env.ie6Compat&&e.$.setTimeout(function(){window.onscroll=window.onscroll&&window.onscroll.prevScrollHandler||null},0),m=null)}var e,n,r,u=CKEDITOR.tools.cssLength,_='<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog '+CKEDITOR.env.cssClass+' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';CKEDITOR.dialog=function(a,e){function t(){var e=p._.focusList;e.sort(function(e,t){return e.tabIndex!=t.tabIndex?t.tabIndex-e.tabIndex:e.focusIndex-t.focusIndex});for(var t=e.length,n=0;n<t;n++)e[n].focusIndex=n}function s(e){var t=p._.focusList;if(e=e||0,!(t.length<1)){var n=p._.currentFocusIndex;p._.tabBarMode&&e<0&&(n=0);try{t[n].getInputElement().$.blur()}catch(o){}var i=n,a=1<p._.pageCount;do{if(i+=e,a&&!p._.tabBarMode&&(i==t.length||-1==i))return p._.tabBarMode=!0,p._.tabs[p._.currentTabId][0].focus(),void(p._.currentFocusIndex=-1);if((i=(i+t.length)%t.length)==n)break}while(e&&!t[i].isFocusable());t[i].focus(),"text"==t[i].type&&t[i].select()}}function o(e){if(p==CKEDITOR.dialog._.currentTop){var t=e.data.getKeystroke(),n="rtl"==a.lang.dir,i=[37,38,39,40];if(l=c=0,9==t||t==CKEDITOR.SHIFT+9)s(t==CKEDITOR.SHIFT+9?-1:1),l=1;else if(t==CKEDITOR.ALT+121&&!p._.tabBarMode&&1<p.getPageCount())p._.tabBarMode=!0,p._.tabs[p._.currentTabId][0].focus(),p._.currentFocusIndex=-1,l=1;else if(-1!=CKEDITOR.tools.indexOf(i,t)&&p._.tabBarMode)t=-1!=CKEDITOR.tools.indexOf([n?39:37,38],t)?g.call(p):A.call(p),p.selectPage(t),p._.tabs[t][0].focus(),l=1;else if(13!=t&&32!=t||!p._.tabBarMode)if(13==t)(t=e.data.getTarget()).is("a","button","select","textarea")||t.is("input")&&"button"==t.$.type||((t=this.getButton("ok"))&&CKEDITOR.tools.setTimeout(t.click,0,t),l=1),c=1;else{if(27!=t)return;(t=this.getButton("cancel"))?CKEDITOR.tools.setTimeout(t.click,0,t):!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),c=1}else this.selectPage(this._.currentTabId),this._.tabBarMode=!1,this._.currentFocusIndex=-1,s(1),l=1;r(e)}}function r(e){l?e.data.preventDefault(1):c&&e.data.stopPropagation()}var l,c,n=CKEDITOR.dialog._.dialogDefinitions[e],i=CKEDITOR.tools.clone(k),d=a.config.dialog_buttonsOrder||"OS",u=a.lang.dir,_={};if(("OS"==d&&CKEDITOR.env.mac||"rtl"==d&&"ltr"==u||"ltr"==d&&"rtl"==u)&&i.buttons.reverse(),n=CKEDITOR.tools.extend(n(a),i),n=CKEDITOR.tools.clone(n),n=new C(this,n),i=y(a),this._={editor:a,element:i.element,name:e,contentSize:{width:0,height:0},size:{width:0,height:0},contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:!1,focusList:[],currentFocusIndex:0,hasFocus:!1},this.parts=i.parts,CKEDITOR.tools.setTimeout(function(){a.fire("ariaWidget",this.parts.contents)},0,this),(i={position:CKEDITOR.env.ie6Compat?"absolute":"fixed",top:0,visibility:"hidden"})["rtl"==u?"right":"left"]=0,this.parts.dialog.setStyles(i),CKEDITOR.event.call(this),this.definition=n=CKEDITOR.fire("dialogDefinition",{name:e,definition:n},a).definition,!("removeDialogTabs"in a._)&&a.config.removeDialogTabs){for(i=a.config.removeDialogTabs.split(";"),u=0;u<i.length;u++)if(2==(d=i[u].split(":")).length){var h=d[0];_[h]||(_[h]=[]),_[h].push(d[1])}a._.removeDialogTabs=_}if(a._.removeDialogTabs&&(_=a._.removeDialogTabs[e]))for(u=0;u<_.length;u++)n.removeContents(_[u]);n.onLoad&&this.on("load",n.onLoad),n.onShow&&this.on("show",n.onShow),n.onHide&&this.on("hide",n.onHide),n.onOk&&this.on("ok",function(e){a.fire("saveSnapshot"),setTimeout(function(){a.fire("saveSnapshot")},0),!1===n.onOk.call(this,e)&&(e.data.hide=!1)}),this.state=CKEDITOR.DIALOG_STATE_IDLE,n.onCancel&&this.on("cancel",function(e){!1===n.onCancel.call(this,e)&&(e.data.hide=!1)});var p=this,f=function(e){var t,n=p._.contents;for(t in n)for(var i in n[t])if(e.call(this,n[t][i]))return};this.on("ok",function(i){f(function(e){if(e.validate){var t=e.validate(this),n="string"==typeof t||!1===t;return n&&(i.data.hide=!1,i.stop()),v.call(e,!n,"string"==typeof t?t:void 0),n}})},this,null,0),this.on("cancel",function(t){f(function(e){if(e.isChanged())return a.config.dialog_noConfirmCancel||confirm(a.lang.common.confirmCancel)||(t.data.hide=!1),!0})},this,null,0),this.parts.close.on("click",function(e){!1!==this.fire("cancel",{hide:!0}).hide&&this.hide(),e.data.preventDefault()},this),this.changeFocus=s;var m=this._.element;for(a.focusManager.add(m,1),this.on("show",function(){m.on("keydown",o,this),CKEDITOR.env.gecko&&m.on("keypress",r,this)}),this.on("hide",function(){m.removeListener("keydown",o),CKEDITOR.env.gecko&&m.removeListener("keypress",r),f(function(e){b.apply(e)})}),this.on("iframeAdded",function(e){new CKEDITOR.dom.document(e.data.iframe.$.contentWindow.document).on("keydown",o,this,null,0)}),this.on("show",function(){t();var e=1<p._.pageCount;a.config.dialog_startupFocusTab&&e?(p._.tabBarMode=!0,p._.tabs[p._.currentTabId][0].focus(),p._.currentFocusIndex=-1):this._.hasFocus||(this._.currentFocusIndex=e?-1:this._.focusList.length-1,n.onFocus?(e=n.onFocus.call(this))&&e.focus():s(1))},this,null,4294967295),CKEDITOR.env.ie6Compat&&this.on("load",function(){var e=this.getElement(),t=e.getFirst();t.remove(),t.appendTo(e)},this),$(this),w(this),new CKEDITOR.dom.text(n.title,CKEDITOR.document).appendTo(this.parts.title),u=0;u<n.contents.length;u++)(_=n.contents[u])&&this.addPage(_);for(this.parts.tabs.on("click",function(e){var t=e.data.getTarget();t.hasClass("cke_dialog_tab")&&(t=t.$.id,this.selectPage(t.substring(4,t.lastIndexOf("_"))),this._.tabBarMode&&(this._.tabBarMode=!1,this._.currentFocusIndex=-1,s(1)),e.data.preventDefault())},this),u=[],_=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:n.buttons},u).getChild(),this.parts.footer.setHtml(u.join("")),u=0;u<_.length;u++)this._.buttons[_[u].id]=_[u]},CKEDITOR.dialog.prototype={destroy:function(){this.hide(),this._.element.remove()},resize:function(e,t){this._.contentSize&&this._.contentSize.width==e&&this._.contentSize.height==t||(CKEDITOR.dialog.fire("resize",{dialog:this,width:e,height:t},this._.editor),this.fire("resize",{width:e,height:t},this._.editor),this.parts.contents.setStyles({width:e+"px",height:t+"px"}),"rtl"==this._.editor.lang.dir&&this._.position&&(this._.position.x=CKEDITOR.document.getWindow().getViewPaneSize().width-this._.contentSize.width-parseInt(this._.element.getFirst().getStyle("right"),10)),this._.contentSize={width:e,height:t})},getSize:function(){var e=this._.element.getFirst();return{width:e.$.offsetWidth||0,height:e.$.offsetHeight||0}},move:function(e,t,n){var i=this._.element.getFirst(),a="rtl"==this._.editor.lang.dir,s="fixed"==i.getComputedStyle("position");CKEDITOR.env.ie&&i.setStyle("zoom","100%"),s&&this._.position&&this._.position.x==e&&this._.position.y==t||(this._.position={x:e,y:t},s||(e+=(s=CKEDITOR.document.getWindow().getScrollPosition()).x,t+=s.y),a&&(s=this.getSize(),e=CKEDITOR.document.getWindow().getViewPaneSize().width-s.width-e),(t={top:(0<t?t:0)+"px"})[a?"right":"left"]=(0<e?e:0)+"px",i.setStyles(t),n&&(this._.moved=1))},getPosition:function(){return CKEDITOR.tools.extend({},this._.position)},show:function(){var e=this._.element,t=this.definition;for(var n in e.getParent()&&e.getParent().equals(CKEDITOR.document.getBody())?e.setStyle("display","block"):e.appendTo(CKEDITOR.document.getBody()),this.resize(this._.contentSize&&this._.contentSize.width||t.width||t.minWidth,this._.contentSize&&this._.contentSize.height||t.height||t.minHeight),this.reset(),this.selectPage(this.definition.contents[0].id),null===CKEDITOR.dialog._.currentZIndex&&(CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex),this._.element.getFirst().setStyle("z-index",CKEDITOR.dialog._.currentZIndex+=10),null===CKEDITOR.dialog._.currentTop?((CKEDITOR.dialog._.currentTop=this)._.parentDialog=null,d(this._.editor)):(this._.parentDialog=CKEDITOR.dialog._.currentTop,this._.parentDialog.getElement().getFirst().$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2),CKEDITOR.dialog._.currentTop=this),e.on("keydown",N),e.on("keyup",F),this._.hasFocus=!1,t.contents)if(t.contents[n]){e=t.contents[n];var i=this._.tabs[e.id],a=e.requiredContent,s=0;if(i){for(var o in this._.contents[e.id]){var r=this._.contents[e.id][o];"hbox"!=r.type&&"vbox"!=r.type&&r.getInputElement()&&(r.requiredContent&&!this._.editor.activeFilter.check(r.requiredContent)?r.disable():(r.enable(),s++))}!s||a&&!this._.editor.activeFilter.check(a)?i[0].addClass("cke_dialog_tab_disabled"):i[0].removeClass("cke_dialog_tab_disabled")}}CKEDITOR.tools.setTimeout(function(){this.layout(),l(this),this.parts.dialog.setStyle("visibility",""),this.fireOnce("load",{}),CKEDITOR.ui.fire("ready",this),this.fire("show",{}),this._.editor.fire("dialogShow",this),this._.parentDialog||this._.editor.focusManager.lock(),this.foreach(function(e){e.setInitValue&&e.setInitValue()})},100,this)},layout:function(){var e=this.parts.dialog,t=this.getSize(),n=CKEDITOR.document.getWindow().getViewPaneSize(),i=(n.width-t.width)/2,a=(n.height-t.height)/2;CKEDITOR.env.ie6Compat||(t.height+(0<a?a:0)>n.height||t.width+(0<i?i:0)>n.width?e.setStyle("position","absolute"):e.setStyle("position","fixed")),this.move(this._.moved?this._.position.x:i,this._.moved?this._.position.y:a)},foreach:function(e){for(var t in this._.contents)for(var n in this._.contents[t])e.call(this,this._.contents[t][n]);return this},reset:(e=function(e){e.reset&&e.reset(1)},function(){return this.foreach(e),this}),setupContent:function(){var t=arguments;this.foreach(function(e){e.setup&&e.setup.apply(e,t)})},commitContent:function(){var t=arguments;this.foreach(function(e){CKEDITOR.env.ie&&this._.currentFocusIndex==e.focusIndex&&e.getInputElement().$.blur(),e.commit&&e.commit.apply(e,t)})},hide:function(){if(this.parts.dialog.isVisible()){this.fire("hide",{}),this._.editor.fire("dialogHide",this),this.selectPage(this._.tabIdList[0]);var e=this._.element;for(e.setStyle("display","none"),this.parts.dialog.setStyle("visibility","hidden"),M(this);CKEDITOR.dialog._.currentTop!=this;)CKEDITOR.dialog._.currentTop.hide();if(this._.parentDialog){var t=this._.parentDialog.getElement().getFirst();t.setStyle("z-index",parseInt(t.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}else a(this._.editor);if(CKEDITOR.dialog._.currentTop=this._.parentDialog)CKEDITOR.dialog._.currentZIndex-=10;else{CKEDITOR.dialog._.currentZIndex=null,e.removeListener("keydown",N),e.removeListener("keyup",F);var n=this._.editor;n.focus(),setTimeout(function(){n.focusManager.unlock(),CKEDITOR.env.iOS&&n.window.focus()},0)}delete this._.parentDialog,this.foreach(function(e){e.resetInitValue&&e.resetInitValue()}),this.setState(CKEDITOR.DIALOG_STATE_IDLE)}},addPage:function(e){if(!e.requiredContent||this._.editor.filter.check(e.requiredContent)){for(var t=[],n=e.label?' title="'+CKEDITOR.tools.htmlEncode(e.label)+'"':"",i=CKEDITOR.dialog._.uiElementBuilders.vbox.build(this,{type:"vbox",className:"cke_dialog_page_contents",children:e.elements,expand:!!e.expand,padding:e.padding,style:e.style||"width: 100%;"},t),a=this._.contents[e.id]={},s=i.getChild(),o=0;i=s.shift();)i.notAllowed||"hbox"==i.type||"vbox"==i.type||o++,"function"==typeof(a[i.id]=i).getChild&&s.push.apply(s,i.getChild());o||(e.hidden=!0),(t=CKEDITOR.dom.element.createFromHtml(t.join(""))).setAttribute("role","tabpanel"),i=CKEDITOR.env,a="cke_"+e.id+"_"+CKEDITOR.tools.getNextNumber(),n=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',0<this._.pageCount?" cke_last":"cke_first",n,e.hidden?' style="display:none"':"",' id="',a,'"',i.gecko&&!i.hc?"":' href="javascript:void(0)"',' tabIndex="-1" hidefocus="true" role="tab">',e.label,"</a>"].join("")),t.setAttribute("aria-labelledby",a),this._.tabs[e.id]=[n,t],this._.tabIdList.push(e.id),!e.hidden&&this._.pageCount++,this._.lastTab=n,this.updateStyle(),t.setAttribute("name",e.id),t.appendTo(this.parts.contents),n.unselectable(),this.parts.tabs.append(n),e.accessKey&&(K(this,this,"CTRL+"+e.accessKey,L,j),this._.accessKeyMap["CTRL+"+e.accessKey]=e.id)}},selectPage:function(e){if(this._.currentTabId!=e&&!this._.tabs[e][0].hasClass("cke_dialog_tab_disabled")&&!1!==this.fire("selectPage",{page:e,currentPage:this._.currentTabId})){for(var t in this._.tabs){var n=this._.tabs[t][0],i=this._.tabs[t][1];t!=e&&(n.removeClass("cke_dialog_tab_selected"),i.hide()),i.setAttribute("aria-hidden",t!=e)}var a=this._.tabs[e];a[0].addClass("cke_dialog_tab_selected"),CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?(s(a[1]),a[1].show(),setTimeout(function(){s(a[1],1)},0)):a[1].show(),this._.currentTabId=e,this._.currentTabIndex=CKEDITOR.tools.indexOf(this._.tabIdList,e)}},updateStyle:function(){this.parts.dialog[(1===this._.pageCount?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(e){var t=this._.tabs[e]&&this._.tabs[e][0];t&&1!=this._.pageCount&&t.isVisible()&&(e==this._.currentTabId&&this.selectPage(g.call(this)),t.hide(),this._.pageCount--,this.updateStyle())},showPage:function(e){(e=this._.tabs[e]&&this._.tabs[e][0])&&(e.show(),this._.pageCount++,this.updateStyle())},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(e,t){var n=this._.contents[e];return n&&n[t]},getValueOf:function(e,t){return this.getContentElement(e,t).getValue()},setValueOf:function(e,t,n){return this.getContentElement(e,t).setValue(n)},getButton:function(e){return this._.buttons[e]},click:function(e){return this._.buttons[e].click()},disableButton:function(e){return this._.buttons[e].disable()},enableButton:function(e){return this._.buttons[e].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(e,t){if(void 0===t)t=this._.focusList.length,this._.focusList.push(new i(this,e,t));else{this._.focusList.splice(t,0,new i(this,e,t));for(var n=t+1;n<this._.focusList.length;n++)this._.focusList[n].focusIndex++}},setState:function(e){if(this.state!=e){if((this.state=e)==CKEDITOR.DIALOG_STATE_BUSY){if(!this.parts.spinner){var t=this.getParentEditor().lang.dir,n={attributes:{"class":"cke_dialog_spinner"},styles:{"float":"rtl"==t?"right":"left"}};n.styles["margin-"+("rtl"==t?"left":"right")]="8px",this.parts.spinner=CKEDITOR.document.createElement("div",n),this.parts.spinner.setHtml("&#8987;"),this.parts.spinner.appendTo(this.parts.title,1)}this.parts.spinner.show(),this.getButton("ok").disable()}else e==CKEDITOR.DIALOG_STATE_IDLE&&(this.parts.spinner&&this.parts.spinner.hide(),this.getButton("ok").enable());this.fire("state",e)}}},CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(e,t){this._.dialogDefinitions[e]&&"function"!=typeof t||(this._.dialogDefinitions[e]=t)},exists:function(e){return!!this._.dialogDefinitions[e]},getCurrent:function(){return CKEDITOR.dialog._.currentTop},isTabEnabled:function(e,t,n){return!((e=e.config.removeDialogTabs)&&e.match(new RegExp("(?:^|;)"+t+":"+n+"(?:$|;)","i")))},okButton:(r=function(e,t){return t=t||{},CKEDITOR.tools.extend({id:"ok",type:"button",label:e.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(e){!1!==(e=e.data.dialog).fire("ok",{hide:!0}).hide&&e.hide()}},t,!0)},r.type="button",r.override=function(t){return CKEDITOR.tools.extend(function(e){return r(e,t)},{type:"button"},!0)},r),cancelButton:(n=function(e,t){return t=t||{},CKEDITOR.tools.extend({id:"cancel",type:"button",label:e.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(e){!1!==(e=e.data.dialog).fire("cancel",{hide:!0}).hide&&e.hide()}},t,!0)},n.type="button",n.override=function(t){return CKEDITOR.tools.extend(function(e){return n(e,t)},{type:"button"},!0)},n),addUIElement:function(e,t){this._.uiElementBuilders[e]=t}}),CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null},CKEDITOR.event.implementOn(CKEDITOR.dialog),CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);var k={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]},h=function(e,t,n){for(var i,a=0;i=e[a];a++)if(i.id==t||n&&i[n]&&(i=h(i[n],t,n)))return i;return null},p=function(e,t,n,i,a){if(n){for(var s,o=0;s=e[o];o++){if(s.id==n)return e.splice(o,0,t),t;if(i&&s[i]&&(s=p(s[i],t,n,i,!0)))return s}if(a)return null}return e.push(t),t},f=function(e,t,n){for(var i,a=0;i=e[a];a++){if(i.id==t)return e.splice(a,1);if(n&&i[n]&&(i=f(i[n],t,n)))return i}return null},C=function(e,t){this.dialog=e;for(var n,i=t.contents,a=0;n=i[a];a++)i[a]=n&&new o(e,n);CKEDITOR.tools.extend(this,t)};C.prototype={getContents:function(e){return h(this.contents,e)},getButton:function(e){return h(this.buttons,e)},addContents:function(e,t){return p(this.contents,e,t)},addButton:function(e,t){return p(this.buttons,e,t)},removeContents:function(e){f(this.contents,e)},removeButton:function(e){f(this.buttons,e)}},o.prototype={get:function(e){return h(this.elements,e,"children")},add:function(e,t){return p(this.elements,e,t,"children")},remove:function(e){f(this.elements,e,"children")}};var m,E,t,T,x,I,D,O,S,R={},B={},N=function(e){var t=e.data.$.ctrlKey||e.data.$.metaKey,n=e.data.$.altKey,i=e.data.$.shiftKey,a=String.fromCharCode(e.data.$.keyCode);(t=B[(t?"CTRL+":"")+(n?"ALT+":"")+(i?"SHIFT+":"")+a])&&t.length&&((t=t[t.length-1]).keydown&&t.keydown.call(t.uiElement,t.dialog,t.key),e.data.preventDefault())},F=function(e){var t=e.data.$.ctrlKey||e.data.$.metaKey,n=e.data.$.altKey,i=e.data.$.shiftKey,a=String.fromCharCode(e.data.$.keyCode);(t=B[(t?"CTRL+":"")+(n?"ALT+":"")+(i?"SHIFT+":"")+a])&&t.length&&((t=t[t.length-1]).keyup&&(t.keyup.call(t.uiElement,t.dialog,t.key),e.data.preventDefault()))},K=function(e,t,n,i,a){(B[n]||(B[n]=[])).push({uiElement:e,dialog:t,key:n,keyup:a||e.accessKeyUp,keydown:i||e.accessKeyDown})},M=function(e){for(var t in B){for(var n=B[t],i=n.length-1;0<=i;i--)n[i].dialog!=e&&n[i].uiElement!=e||n.splice(i,1);0===n.length&&delete B[t]}},j=function(e,t){e._.accessKeyMap[t]&&e.selectPage(e._.accessKeyMap[t])},L=function(){};CKEDITOR.ui.dialog={uiElement:function(n,i,e,t,a,s,o){if(!(arguments.length<4)){var r=(t.call?t(i):t)||"div",l=["<",r," "],c=(a&&a.call?a(i):a)||{},d=(s&&s.call?s(i):s)||{},u=(o&&o.call?o.call(this,n,i):o)||"",_=this.domId=d.id||CKEDITOR.tools.getNextId()+"_uiElement";i.requiredContent&&!n.getParentEditor().filter.check(i.requiredContent)&&(c.display="none",this.notAllowed=!0),d.id=_;var h={};i.type&&(h["cke_dialog_ui_"+i.type]=1),i.className&&(h[i.className]=1),i.disabled&&(h.cke_disabled=1);var p=d["class"]&&d["class"].split?d["class"].split(" "):[];for(_=0;_<p.length;_++)p[_]&&(h[p[_]]=1);for(_ in p=[],h)p.push(_);for(_ in d["class"]=p.join(" "),i.title&&(d.title=i.title),h=(i.style||"").split(";"),i.align&&(p=i.align,c["margin-left"]="left"==p?0:"auto",c["margin-right"]="right"==p?0:"auto"),c)h.push(_+":"+c[_]);for(i.hidden&&h.push("display:none"),_=h.length-1;0<=_;_--)""===h[_]&&h.splice(_,1);for(_ in 0<h.length&&(d.style=(d.style?d.style+"; ":"")+h.join("; ")),d)l.push(_+'="'+CKEDITOR.tools.htmlEncode(d[_])+'" ');l.push(">",u,"</",r,">"),e.push(l.join("")),(this._||(this._={})).dialog=n,"boolean"==typeof i.isChanged&&(this.isChanged=function(){return i.isChanged}),"function"==typeof i.isChanged&&(this.isChanged=i.isChanged),"function"==typeof i.setValue&&(this.setValue=CKEDITOR.tools.override(this.setValue,function(t){return function(e){t.call(this,i.setValue.call(this,e))}})),"function"==typeof i.getValue&&(
this.getValue=CKEDITOR.tools.override(this.getValue,function(e){return function(){return i.getValue.call(this,e.call(this))}})),CKEDITOR.event.implementOn(this),this.registerEvents(i),this.accessKeyUp&&this.accessKeyDown&&i.accessKey&&K(this,n,"CTRL+"+i.accessKey);var f=this;n.on("load",function(){var e=f.getInputElement();if(e){var t=f.type in{checkbox:1,ratio:1}&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?"cke_dialog_ui_focused":"";e.on("focus",function(){n._.tabBarMode=!1,n._.hasFocus=!0,f.fire("focus"),t&&this.addClass(t)}),e.on("blur",function(){f.fire("blur"),t&&this.removeClass(t)})}}),CKEDITOR.tools.extend(this,i),this.keyboardFocusable&&(this.tabIndex=i.tabIndex||0,this.focusIndex=n._.focusList.push(this)-1,this.on("focus",function(){n._.currentFocusIndex=f.focusIndex}))}},hbox:function(e,t,i,n,a){if(!(arguments.length<4)){this._||(this._={});var s,o=this._.children=t,r=a&&a.widths||null,l=a&&a.height||null,c={role:"presentation"};a&&a.align&&(c.align=a.align),CKEDITOR.ui.dialog.uiElement.call(this,e,a||{type:"hbox"},n,"table",{},c,function(){var e=['<tbody><tr class="cke_dialog_ui_hbox">'];for(s=0;s<i.length;s++){var t="cke_dialog_ui_hbox_child",n=[];0===s&&(t="cke_dialog_ui_hbox_first"),s==i.length-1&&(t="cke_dialog_ui_hbox_last"),e.push('<td class="',t,'" role="presentation" '),r?r[s]&&n.push("width:"+u(r[s])):n.push("width:"+Math.floor(100/i.length)+"%"),l&&n.push("height:"+u(l)),a&&void 0!==a.padding&&n.push("padding:"+u(a.padding)),CKEDITOR.env.ie&&CKEDITOR.env.quirks&&o[s].align&&n.push("text-align:"+o[s].align),0<n.length&&e.push('style="'+n.join("; ")+'" '),e.push(">",i[s],"</td>")}return e.push("</tr></tbody>"),e.join("")})}},vbox:function(i,e,a,t,s){if(!(arguments.length<3)){this._||(this._={});var o=this._.children=e,r=s&&s.width||null,l=s&&s.heights||null;CKEDITOR.ui.dialog.uiElement.call(this,i,s||{type:"vbox"},t,"div",null,{role:"presentation"},function(){var e=['<table role="presentation" cellspacing="0" border="0" '];e.push('style="'),s&&s.expand&&e.push("height:100%;"),e.push("width:"+u(r||"100%"),";"),CKEDITOR.env.webkit&&e.push("float:none;"),e.push('"'),e.push('align="',CKEDITOR.tools.htmlEncode(s&&s.align||("ltr"==i.getParentEditor().lang.dir?"left":"right")),'" '),e.push("><tbody>");for(var t=0;t<a.length;t++){var n=[];e.push('<tr><td role="presentation" '),r&&n.push("width:"+u(r||"100%")),l?n.push("height:"+u(l[t])):s&&s.expand&&n.push("height:"+Math.floor(100/a.length)+"%"),s&&void 0!==s.padding&&n.push("padding:"+u(s.padding)),CKEDITOR.env.ie&&CKEDITOR.env.quirks&&o[t].align&&n.push("text-align:"+o[t].align),0<n.length&&e.push('style="',n.join("; "),'" '),e.push(' class="cke_dialog_ui_vbox_child">',a[t],"</td></tr>")}return e.push("</tbody></table>"),e.join("")})}}},CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(e,t){return this.getInputElement().setValue(e),!t&&this.fire("change",{value:e}),this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return!1},selectParentTab:function(){for(var e=this.getInputElement();(e=e.getParent())&&-1==e.$.className.search("cke_dialog_page_contents"););return e&&(e=e.getAttribute("name"),this._.dialog._.currentTabId!=e&&this._.dialog.selectPage(e)),this},focus:function(){return this.selectParentTab().getInputElement().focus(),this},registerEvents:function(e){var t,n,i=/^on([A-Z]\w+)/,a=function(e,t,n,i){t.on("load",function(){e.getInputElement().on(n,i,e)})};for(n in e)(t=n.match(i))&&(this.eventProcessors[n]?this.eventProcessors[n].call(this,this._.dialog,e[n]):a(this,this._.dialog,t[1].toLowerCase(),e[n]));return this},eventProcessors:{onLoad:function(e,t){e.on("load",t,this)},onShow:function(e,t){e.on("show",t,this)},onHide:function(e,t){e.on("hide",t,this)}},accessKeyDown:function(){this.focus()},accessKeyUp:function(){},disable:function(){var e=this.getElement();this.getInputElement().setAttribute("disabled","true"),e.addClass("cke_disabled")},enable:function(){var e=this.getElement();this.getInputElement().removeAttribute("disabled"),e.removeClass("cke_disabled")},isEnabled:function(){return!this.getElement().hasClass("cke_disabled")},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){return!(!this.isEnabled()||!this.isVisible())}},CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement,{getChild:function(e){return arguments.length<1?this._.children.concat():(e.splice||(e=[e]),e.length<2?this._.children[e[0]]:this._.children[e[0]]&&this._.children[e[0]].getChild?this._.children[e[0]].getChild(e.slice(1,e.length)):null)}},!0),CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox,t={build:function(e,t,n){for(var i,a=t.children,s=[],o=[],r=0;r<a.length&&(i=a[r]);r++){var l=[];s.push(l),o.push(CKEDITOR.dialog._.uiElementBuilders[i.type].build(e,i,l))}return new CKEDITOR.ui.dialog[t.type](e,o,s,n,t)}},CKEDITOR.dialog.addUIElement("hbox",t),CKEDITOR.dialog.addUIElement("vbox",t),CKEDITOR.dialogCommand=function(e,t){this.dialogName=e,CKEDITOR.tools.extend(this,t,!0)},CKEDITOR.dialogCommand.prototype={exec:function(e){e.openDialog(this.dialogName)},canUndo:!1,editorFocus:1},T=/^([a]|[^a])+$/,x=/^\d*$/,I=/^\d*(?:\.\d+)?$/,D=/^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,O=/^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,S=/^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/,CKEDITOR.VALIDATE_OR=1,CKEDITOR.VALIDATE_AND=2,CKEDITOR.dialog.validate={functions:function(){var o=arguments;return function(){var e,t,n=this&&this.getValue?this.getValue():o[0],i=CKEDITOR.VALIDATE_AND,a=[];for(t=0;t<o.length&&"function"==typeof o[t];t++)a.push(o[t]);t<o.length&&"string"==typeof o[t]&&(e=o[t],t++),t<o.length&&"number"==typeof o[t]&&(i=o[t]);var s=i==CKEDITOR.VALIDATE_AND;for(t=0;t<a.length;t++)s=i==CKEDITOR.VALIDATE_AND?s&&a[t](n):s||a[t](n);return!!s||e}},regex:function(t,n){return function(e){return e=this&&this.getValue?this.getValue():e,!!t.test(e)||n}},notEmpty:function(e){return this.regex(T,e)},integer:function(e){return this.regex(x,e)},number:function(e){return this.regex(I,e)},cssLength:function(e){return this.functions(function(e){return O.test(CKEDITOR.tools.trim(e))},e)},htmlLength:function(e){return this.functions(function(e){return D.test(CKEDITOR.tools.trim(e))},e)},inlineStyle:function(e){return this.functions(function(e){return S.test(CKEDITOR.tools.trim(e))},e)},equals:function(t,e){return this.functions(function(e){return e==t},e)},notEqual:function(t,e){return this.functions(function(e){return e!=t},e)}},CKEDITOR.on("instanceDestroyed",function(e){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){for(var t;t=CKEDITOR.dialog._.currentTop;)t.hide();for(var n in R)R[n].remove();R={}}for(var i in e=e.editor._.storedDialogs)e[i].destroy()}),CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(e,t){var n=null,i=CKEDITOR.dialog._.dialogDefinitions[e];if(null===CKEDITOR.dialog._.currentTop&&d(this),"function"==typeof i)n=(n=this._.storedDialogs||(this._.storedDialogs={}))[e]||(n[e]=new CKEDITOR.dialog(this,e)),t&&t.call(n,n),n.show();else{if("failed"==i)throw a(this),Error('[CKEDITOR.dialog.openDialog] Dialog "'+e+'" failed when loading definition.');"string"==typeof i&&CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(i),function(){"function"!=typeof CKEDITOR.dialog._.dialogDefinitions[e]&&(CKEDITOR.dialog._.dialogDefinitions[e]="failed"),this.openDialog(e,t)},this,0,1)}return CKEDITOR.skin.loadPart("dialog"),n}})}(),CKEDITOR.plugins.add("dialog",{requires:"dialogui",init:function(t){t.on("doubleclick",function(e){e.data.dialog&&t.openDialog(e.data.dialog)},null,null,999)}}),CKEDITOR.plugins.add("about",{requires:"dialog",init:function(e){var t=e.addCommand("about",new CKEDITOR.dialogCommand("about"));t.modes={wysiwyg:1,source:1},t.canUndo=!1,t.readOnly=1,e.ui.addButton&&e.ui.addButton("About",{label:e.lang.about.title,command:"about",toolbar:"about"}),CKEDITOR.dialog.add("about",this.path+"dialogs/about.js")}}),CKEDITOR.plugins.add("a11yhelp",{requires:"dialog",availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fo:1,fr:1,"fr-ca":1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,mk:1,mn:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ro:1,ru:1,si:1,sk:1,sl:1,sq:1,sr:1,"sr-latn":1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},init:function(t){var n=this;t.addCommand("a11yHelp",{exec:function(){var e=t.langCode;e=n.availableLangs[e]?e:n.availableLangs[e.replace(/-.*/,"")]?e.replace(/-.*/,""):"en",CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(n.path+"dialogs/lang/"+e+".js"),function(){t.lang.a11yhelp=n.langEntries[e],t.openDialog("a11yHelp")})},modes:{wysiwyg:1,source:1},readOnly:1,canUndo:!1}),t.setKeystroke(CKEDITOR.ALT+48,"a11yHelp"),CKEDITOR.dialog.add("a11yHelp",this.path+"dialogs/a11yhelp.js"),t.on("ariaEditorHelpLabel",function(e){e.data.label=t.lang.common.editorHelp})}}),function(){function o(e){var t=this.att;void 0!==(e=e&&e.hasAttribute(t)&&e.getAttribute(t)||"")&&this.setValue(e)}function r(){for(var e,t=0;t<arguments.length;t++)if(arguments[t]instanceof CKEDITOR.dom.element){e=arguments[t];break}if(e){t=this.att;var n=this.getValue();n?e.setAttribute(t,n):e.removeAttribute(t,n)}}var l={id:1,dir:1,classes:1,styles:1};CKEDITOR.plugins.add("dialogadvtab",{requires:"dialog",allowedContent:function(e){e||(e=l);var t=[];e.id&&t.push("id"),e.dir&&t.push("dir");var n="";return t.length&&(n+="["+t.join(",")+"]"),e.classes&&(n+="(*)"),e.styles&&(n+="{*}"),n},createAdvancedTab:function(a,e,t){e||(e=l);var n=a.lang.common,i={id:"advanced",label:n.advancedTab,title:n.advancedTab,elements:[{type:"vbox",padding:1,children:[]}]},s=[];return(e.id||e.dir)&&(e.id&&s.push({id:"advId",att:"id",type:"text",requiredContent:t?t+"[id]":null,label:n.id,setup:o,commit:r}),e.dir&&s.push({id:"advLangDir",att:"dir",type:"select",requiredContent:t?t+"[dir]":null,label:n.langDir,"default":"",style:"width:100%",items:[[n.notSet,""],[n.langDirLTR,"ltr"],[n.langDirRTL,"rtl"]],setup:o,commit:r}),i.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(s)})),(e.styles||e.classes)&&(s=[],e.styles&&s.push({id:"advStyles",att:"style",type:"text",requiredContent:t?t+"{cke-xyz}":null,label:n.styles,"default":"",validate:CKEDITOR.dialog.validate.inlineStyle(n.invalidInlineStyle),onChange:function(){},getStyle:function(e,t){var n=this.getValue().match(new RegExp("(?:^|;)\\s*"+e+"\\s*:\\s*([^;]*)","i"));return n?n[1]:t},updateStyle:function(e,t){var n=this.getValue(),i=a.document.createElement("span");i.setAttribute("style",n),i.setStyle(e,t),n=CKEDITOR.tools.normalizeCssText(i.getAttribute("style")),this.setValue(n,1)},setup:o,commit:r}),e.classes&&s.push({type:"hbox",widths:["45%","55%"],children:[{id:"advCSSClasses",att:"class",type:"text",requiredContent:t?t+"(cke-xyz)":null,label:n.cssClasses,"default":"",setup:o,commit:r}]}),i.elements[0].children.push({type:"hbox",widths:["50%","50%"],children:[].concat(s)})),i}})}(),CKEDITOR.plugins.add("basicstyles",{init:function(s){var o=0,e=function(e,t,n,i){if(i){i=new CKEDITOR.style(i);var a=r[n];a.unshift(i),s.attachStyleStateChange(i,function(e){!s.readOnly&&s.getCommand(n).setState(e)}),s.addCommand(n,new CKEDITOR.styleCommand(i,{contentForms:a})),s.ui.addButton&&s.ui.addButton(e,{label:t,command:n,toolbar:"basicstyles,"+(o+=10)})}},r={bold:["strong","b",["span",function(e){return"bold"==(e=e.styles["font-weight"])||700<=+e}]],italic:["em","i",["span",function(e){return"italic"==e.styles["font-style"]}]],underline:["u",["span",function(e){return"underline"==e.styles["text-decoration"]}]],strike:["s","strike",["span",function(e){return"line-through"==e.styles["text-decoration"]}]],subscript:["sub"],superscript:["sup"]},t=s.config,n=s.lang.basicstyles;e("Bold",n.bold,"bold",t.coreStyles_bold),e("Italic",n.italic,"italic",t.coreStyles_italic),e("Underline",n.underline,"underline",t.coreStyles_underline),e("Strike",n.strike,"strike",t.coreStyles_strike),e("Subscript",n.subscript,"subscript",t.coreStyles_subscript),e("Superscript",n.superscript,"superscript",t.coreStyles_superscript),s.setKeystroke([[CKEDITOR.CTRL+66,"bold"],[CKEDITOR.CTRL+73,"italic"],[CKEDITOR.CTRL+85,"underline"]])}}),CKEDITOR.config.coreStyles_bold={element:"strong",overrides:"b"},CKEDITOR.config.coreStyles_italic={element:"em",overrides:"i"},CKEDITOR.config.coreStyles_underline={element:"u"},CKEDITOR.config.coreStyles_strike={element:"s",overrides:"strike"},CKEDITOR.config.coreStyles_subscript={element:"sub"},CKEDITOR.config.coreStyles_superscript={element:"sup"},function(){function h(e,t,n,i){if(!e.isReadOnly()&&!e.equals(n.editable())){CKEDITOR.dom.element.setMarker(i,e,"bidi_processed",1),i=e;for(var a=n.editable();(i=i.getParent())&&!i.equals(a);)if(i.getCustomData("bidi_processed"))return e.removeStyle("direction"),void e.removeAttribute("dir");((i="useComputedState"in n.config?n.config.useComputedState:1)?e.getComputedStyle("direction"):e.getStyle("direction")||e.hasAttribute("dir"))!=t&&(e.removeStyle("direction"),i?(e.removeAttribute("dir"),t!=e.getComputedStyle("direction")&&e.setAttribute("dir",t)):e.setAttribute("dir",t),n.forceNextSelectionCheck())}}function p(e,t,n){var i=e.getCommonAncestor(!1,!0);if((e=e.clone()).enlarge(n==CKEDITOR.ENTER_BR?CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:CKEDITOR.ENLARGE_BLOCK_CONTENTS),e.checkBoundaryOfElement(i,CKEDITOR.START)&&e.checkBoundaryOfElement(i,CKEDITOR.END)){for(var a;i&&i.type==CKEDITOR.NODE_ELEMENT&&(a=i.getParent())&&1==a.getChildCount()&&!(i.getName()in t);)i=a;return i.type==CKEDITOR.NODE_ELEMENT&&i.getName()in t&&i}}function n(_){return{context:"p",allowedContent:{"h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td":{propertiesOnly:!0,attributes:"dir"}},requiredContent:"p[dir]",refresh:function(e,t){var n,i;if(!(i=void 0===(i=e.config.useComputedState)||i)){n=t.lastElement;for(var a=e.editable();n&&!(n.getName()in o||n.equals(a));){var s=n.getParent();if(!s)break;n=s}}(n=n||t.block||t.blockLimit).equals(e.editable())&&(a=e.getSelection().getRanges()[0].getEnclosedNode())&&a.type==CKEDITOR.NODE_ELEMENT&&(n=a),n&&(i=i?n.getComputedStyle("direction"):n.getStyle("direction")||n.getAttribute("dir"),e.getCommand("bidirtl").setState("rtl"==i?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),e.getCommand("bidiltr").setState("ltr"==i?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)),(i=(t.block||t.blockLimit||e.editable()).getDirection(1))!=(e._.selDir||e.lang.dir)&&(e._.selDir=i,e.fire("contentDirChanged",i))},exec:function(e){var t=e.getSelection(),i=e.config.enterMode;if((o=t.getRanges())&&o.length){for(var n,a={},s=t.createBookmarks(),o=o.createIterator(),r=0;n=o.getNextRange(1);){var l=n.getEnclosedNode();l&&(!l||l.type==CKEDITOR.NODE_ELEMENT&&l.getName()in m)||(l=p(n,f,i)),l&&h(l,_,e,a);var c=new CKEDITOR.dom.walker(n),d=s[r].startNode,u=s[r++].endNode;for(c.evaluator=function(e){var t,n=i==CKEDITOR.ENTER_P?"p":"div";return(t=!!e&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in f)&&((n=e.is(n))&&(n=!!(n=e.getParent())&&n.type==CKEDITOR.NODE_ELEMENT),t=!(n&&e.getParent().is("blockquote"))),!!(t&&e.getPosition(d)&CKEDITOR.POSITION_FOLLOWING&&(e.getPosition(u)&CKEDITOR.POSITION_PRECEDING+CKEDITOR.POSITION_CONTAINS)==CKEDITOR.POSITION_PRECEDING)};l=c.next();)h(l,_,e,a);for((n=n.createIterator()).enlargeBr=i!=CKEDITOR.ENTER_BR;l=n.getNextParagraph(i==CKEDITOR.ENTER_P?"p":"div");)h(l,_,e,a)}CKEDITOR.dom.element.clearAllMarkers(a),e.forceNextSelectionCheck(),t.selectBookmarks(s),e.focus()}}}}function e(a){var s=a==t.setAttribute,o=a==t.removeAttribute,r=/\bdirection\s*:\s*(.*?)\s*(:?$|;)/;return function(e,t){if(!this.isReadOnly()){var n;if(n=e==(s||o?"dir":"direction")||"style"==e&&(o||r.test(t))){e:{for(var i=(n=this).getDocument().getBody().getParent();n;){if(n.equals(i)){n=!1;break e}n=n.getParent()}n=!0}n=!n}if(n&&(n=this.getDirection(1),i=a.apply(this,arguments),n!=this.getDirection(1)))return this.getDocument().fire("dirChanged",this),i}return a.apply(this,arguments)}}var f={table:1,ul:1,ol:1,blockquote:1,div:1},m={},o={};CKEDITOR.tools.extend(m,f,{tr:1,p:1,div:1,li:1}),CKEDITOR.tools.extend(o,m,{td:1}),CKEDITOR.plugins.add("bidi",{init:function(s){function e(e,t,n,i,a){s.addCommand(n,new CKEDITOR.command(s,i)),s.ui.addButton&&s.ui.addButton(e,{label:t,command:n,toolbar:"bidi,"+a})}if(!s.blockless){var t=s.lang.bidi;e("BidiLtr",t.ltr,"bidiltr",n("ltr"),10),e("BidiRtl",t.rtl,"bidirtl",n("rtl"),20),s.on("contentDom",function(){s.document.on("dirChanged",function(e){s.fire("dirChanged",{node:e.data,dir:e.data.getDirection(1)})})}),s.on("contentDirChanged",function(e){e=(s.lang.dir!=e.data?"add":"remove")+"Class";var t=s.ui.space(s.config.toolbarLocation);t&&t[e]("cke_mixed_dir_content")})}}});for(var t=CKEDITOR.dom.element.prototype,i=["setStyle","removeStyle","setAttribute","removeAttribute"],a=0;a<i.length;a++)t[i[a]]=CKEDITOR.tools.override(t[i[a]],e)}(),Q={exec:function(e){var t=e.getCommand("blockquote").state,n=e.getSelection(),i=n&&n.getRanges()[0];if(i){var a=n.createBookmarks();if(CKEDITOR.env.ie){var s,o=a[0].startNode,r=a[0].endNode;if(o&&"blockquote"==o.getParent().getName())for(s=o;s=s.getNext();)if(s.type==CKEDITOR.NODE_ELEMENT&&s.isBlockBoundary()){o.move(s,!0);break}if(r&&"blockquote"==r.getParent().getName())for(s=r;s=s.getPrevious();)if(s.type==CKEDITOR.NODE_ELEMENT&&s.isBlockBoundary()){r.move(s);break}}if((l=i.createIterator()).enlargeBr=e.config.enterMode!=CKEDITOR.ENTER_BR,t==CKEDITOR.TRISTATE_OFF){for(o=[];t=l.getNextParagraph();)o.push(t);for(o.length<1&&(t=e.document.createElement(e.config.enterMode==CKEDITOR.ENTER_P?"p":"div"),r=a.shift(),i.insertNode(t),t.append(new CKEDITOR.dom.text("\ufeff",e.document)),i.moveToBookmark(r),i.selectNodeContents(t),i.collapse(!0),r=i.createBookmark(),o.push(t),a.unshift(r)),s=o[0].getParent(),i=[],r=0;r<o.length;r++)t=o[r],s=s.getCommonAncestor(t.getParent());for(t={table:1,tbody:1,tr:1,ol:1,ul:1};t[s.getName()];)s=s.getParent();for(r=null;0<o.length;){for(t=o.shift();!t.getParent().equals(s);)t=t.getParent();t.equals(r)||i.push(t),r=t}for(;0<i.length;)if("blockquote"==(t=i.shift()).getName()){for(r=new CKEDITOR.dom.documentFragment(e.document);t.getFirst();)r.append(t.getFirst().remove()),o.push(r.getLast());r.replace(t)}else o.push(t);for((i=e.document.createElement("blockquote")).insertBefore(o[0]);0<o.length;)t=o.shift(),i.append(t)}else if(t==CKEDITOR.TRISTATE_ON){for(r=[],s={};t=l.getNextParagraph();){for(o=i=null;t.getParent();){if("blockquote"==t.getParent().getName()){i=t.getParent(),o=t;break}t=t.getParent()}i&&o&&!o.getCustomData("blockquote_moveout")&&(r.push(o),CKEDITOR.dom.element.setMarker(s,o,"blockquote_moveout",!0))}for(CKEDITOR.dom.element.clearAllMarkers(s),t=[],o=[],s={};0<r.length;)i=(l=r.shift()).getParent(),l.getPrevious()?l.getNext()?(l.breakParent(l.getParent()),o.push(l.getNext())):l.remove().insertAfter(i):l.remove().insertBefore(i),i.getCustomData("blockquote_processed")||(o.push(i),CKEDITOR.dom.element.setMarker(s,i,"blockquote_processed",!0)),t.push(l);for(CKEDITOR.dom.element.clearAllMarkers(s),r=o.length-1;0<=r;r--){e:{for(var l=0,c=(s=i=o[r]).getChildCount(),d=void 0;l<c&&(d=s.getChild(l));l++)if(d.type==CKEDITOR.NODE_ELEMENT&&d.isBlockBoundary()){s=!1;break e}s=!0}s&&i.remove()}if(e.config.enterMode==CKEDITOR.ENTER_BR)for(i=!0;t.length;)if("div"==(l=t.shift()).getName()){for(r=new CKEDITOR.dom.documentFragment(e.document),!i||!l.getPrevious()||l.getPrevious().type==CKEDITOR.NODE_ELEMENT&&l.getPrevious().isBlockBoundary()||r.append(e.document.createElement("br")),i=l.getNext()&&!(l.getNext().type==CKEDITOR.NODE_ELEMENT&&l.getNext().isBlockBoundary());l.getFirst();)l.getFirst().remove().appendTo(r);i&&r.append(e.document.createElement("br")),r.replace(l),i=!1}}n.selectBookmarks(a),e.focus()}},refresh:function(e,t){this.setState(e.elementPath(t.block||t.blockLimit).contains("blockquote",1)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)},context:"blockquote",allowedContent:"blockquote",requiredContent:"blockquote"},CKEDITOR.plugins.add("blockquote",{init:function(e){e.blockless||(e.addCommand("blockquote",Q),e.ui.addButton&&e.ui.addButton("Blockquote",{label:e.lang.blockquote.toolbar,command:"blockquote",toolbar:"blocks,10"}))}}),function(){var e='<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-describedby="{id}_description" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;"');e=(e=e+' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"')+'>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span><span id="{id}_description" class="cke_button_label" aria-hidden="false">{ariaShortcut}</span>{arrowHtml}</a>';var m=CKEDITOR.addTemplate("buttonArrow",'<span class="cke_button_arrow">'+(CKEDITOR.env.hc?"&#9660;":"")+"</span>"),g=CKEDITOR.addTemplate("button",e);CKEDITOR.plugins.add("button",{beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_BUTTON,CKEDITOR.ui.button.handler)}}),CKEDITOR.UI_BUTTON="button",CKEDITOR.ui.button=function(t){CKEDITOR.tools.extend(this,t,{title:t.label,click:t.click||function(e){e.execCommand(t.command)}}),this._={}},CKEDITOR.ui.button.handler={create:function(e){return new CKEDITOR.ui.button(e)}},CKEDITOR.ui.button.prototype={render:function(i,e){function t(){var e=i.mode;e&&(e=this.modes[e]?void 0!==p[e]?p[e]:CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,e=i.readOnly&&!this.readOnly?CKEDITOR.TRISTATE_DISABLED:e,this.setState(e),this.refresh&&this.refresh())}var n,a,s,o=CKEDITOR.env,r=this._.id=CKEDITOR.tools.getNextId(),l="",c=this.command;this._.editor=i;var d={id:r,button:this,editor:i,focus:function(){CKEDITOR.document.getById(r).focus()},execute:function(){this.button.click(i)},attach:function(e){this.button.attach(e)}},u=CKEDITOR.tools.addFunction(function(e){if(d.onkey)return e=new CKEDITOR.dom.event(e),!1!==d.onkey(d,e.getKeystroke())}),_=CKEDITOR.tools.addFunction(function(e){var t;return d.onfocus&&(t=!1!==d.onfocus(d,new CKEDITOR.dom.event(e))),t}),h=0;if(d.clickFn=n=CKEDITOR.tools.addFunction(function(){h&&(i.unlockSelection(1),h=0),d.execute(),o.iOS&&i.focus()}),this.modes){var p={};i.on("beforeModeUnload",function(){i.mode&&this._.state!=CKEDITOR.TRISTATE_DISABLED&&(p[i.mode]=this._.state)},this),i.on("activeFilterChange",t,this),i.on("mode",t,this),!this.readOnly&&i.on("readOnly",t,this)}else c&&(c=i.getCommand(c))&&(c.on("state",function(){this.setState(c.state)},this),l+=c.state==CKEDITOR.TRISTATE_ON?"on":c.state==CKEDITOR.TRISTATE_DISABLED?"disabled":"off");this.directional&&i.on("contentDirChanged",function(e){var t=CKEDITOR.document.getById(this._.id),n=t.getFirst();(e=e.data)!=i.lang.dir?t.addClass("cke_"+e):t.removeClass("cke_ltr").removeClass("cke_rtl"),n.setAttribute("style",CKEDITOR.skin.getIconStyle(f,"rtl"==e,this.icon,this.iconOffset))},this),c?(a=i.getCommandKeystroke(c))&&(s=CKEDITOR.tools.keystrokeToString(i.lang.common.keyboard,a)):l+="off";var f=a=this.name||this.command;return this.icon&&!/\./.test(this.icon)&&(f=this.icon,this.icon=null),l={id:r,name:a,iconName:f,label:this.label,cls:this.className||"",state:l,ariaDisabled:"disabled"==l?"true":"false",title:this.title+(s?" ("+s.display+")":""),ariaShortcut:s?i.lang.common.keyboardShortcut+" "+s.aria:"",titleJs:o.gecko&&!o.hc?"":(this.title||"").replace("'",""),hasArrow:this.hasArrow?"true":"false",keydownFn:u,focusFn:_,clickFn:n,style:CKEDITOR.skin.getIconStyle(f,"rtl"==i.lang.dir,this.icon,this.iconOffset),arrowHtml:this.hasArrow?m.output():""},g.output(l,e),this.onRender&&this.onRender(),d},setState:function(e){if(this._.state==e)return!1;this._.state=e;var t=CKEDITOR.document.getById(this._.id);return!!t&&(t.setState(e,"cke_button"),e==CKEDITOR.TRISTATE_DISABLED?t.setAttribute("aria-disabled",!0):t.removeAttribute("aria-disabled"),this.hasArrow?(e=e==CKEDITOR.TRISTATE_ON?this._.editor.lang.button.selectedLabel.replace(/%1/g,this.label):this.label,CKEDITOR.document.getById(this._.id+"_label").setText(e)):e==CKEDITOR.TRISTATE_ON?t.setAttribute("aria-pressed",!0):t.removeAttribute("aria-pressed"),!0)},getState:function(){return this._.state},toFeature:function(e){if(this._.feature)return this._.feature;var t=this;return this.allowedContent||this.requiredContent||!this.command||(t=e.getCommand(this.command)||t),this._.feature=t}},CKEDITOR.ui.prototype.addButton=function(e,t){this.add(e,CKEDITOR.UI_BUTTON,t)}}(),function(){function w(r){function e(){for(var e=l(),t=CKEDITOR.tools.clone(r.config.toolbarGroups)||d(r),n=0;n<t.length;n++){var i=t[n];if("/"!=i){"string"==typeof i&&(i=t[n]={name:i});var a,s=i.groups;if(s)for(var o=0;o<s.length;o++)(a=e[a=s[o]])&&c(i,a);(a=e[i.name])&&c(i,a)}}return t}function l(){var e,t,n,i={};for(e in r.ui.items)t=(n=(n=(t=r.ui.items[e]).toolbar||"others").split(","))[0],n=parseInt(n[1]||-1,10),i[t]||(i[t]=[]),i[t].push({name:e,order:n});for(t in i)i[t]=i[t].sort(function(e,t){return e.order==t.order?0:t.order<0?-1:e.order<0?1:e.order<t.order?-1:1});return i}function c(e,t){if(t.length){e.items?e.items.push(r.ui.create("-")):e.items=[];for(var n;n=t.shift();)n="string"==typeof n?n:n.name,i&&-1!=CKEDITOR.tools.indexOf(i,n)||(n=r.ui.create(n))&&r.addFeature(n)&&e.items.push(n)}}function t(e){var t,n,i,a=[];for(t=0;t<e.length;++t)i={},"/"==(n=e[t])?a.push(n):CKEDITOR.tools.isArray(n)?(c(i,CKEDITOR.tools.clone(n)),a.push(i)):n.items&&(c(i,CKEDITOR.tools.clone(n.items)),i.name=n.name,a.push(i));return a}var i=(i=r.config.removeButtons)&&i.split(","),n=r.config.toolbar;return"string"==typeof n&&(n=r.config["toolbar_"+n]),r.toolbar=n?t(n):e()}function d(e){return e._.toolbarGroups||(e._.toolbarGroups=[{name:"document",groups:["mode","document","doctools"]},{name:"clipboard",groups:["clipboard","undo"]},{name:"editing",groups:["find","selection","spellchecker"]},{name:"forms"},"/",{name:"basicstyles",groups:["basicstyles","cleanup"]},{name:"paragraph",groups:["list","indent","blocks","align","bidi"]},{name:"links"},{name:"insert"},"/",{name:"styles"},{name:"colors"},{name:"tools"},{name:"others"},{name:"about"}])}var k=function(){this.toolbars=[],this.focusCommandExecuted=!1};k.prototype.focus=function(){for(var e,t=0;e=this.toolbars[t++];)for(var n,i=0;n=e.items[i++];)if(n.focus)return void n.focus()};var e={modes:{wysiwyg:1,source:1},readOnly:1,exec:function(e){e.toolbox&&(e.toolbox.focusCommandExecuted=!0,CKEDITOR.env.ie||CKEDITOR.env.air?setTimeout(function(){e.toolbox.focus()},100):e.toolbox.focus())}};CKEDITOR.plugins.add("toolbar",{requires:"button",init:function(y){var o,$=function(e,t){var n,i=(a="rtl"==y.lang.dir)?37:39,a=a?39:37,s=void 0===(s=y.config.toolbarGroupCycling)||s;switch(t){case 9:case CKEDITOR.SHIFT+9:for(;!n||!n.items.length;)if((n=9==t?(n?n.next:e.toolbar.next)||y.toolbox.toolbars[0]:(n?n.previous:e.toolbar.previous)||y.toolbox.toolbars[y.toolbox.toolbars.length-1]).items.length)for(e=n.items[o?n.items.length-1:0];e&&!e.focus;)(e=o?e.previous:e.next)||(n=0);return e&&e.focus(),!1;case i:for(n=e;!(n=n.next)&&s&&(n=e.toolbar.items[0]),n&&!n.focus;);return n?n.focus():$(e,9),!1;case 40:return e.button&&e.button.hasArrow?e.execute():$(e,40==t?i:a),!1;case a:case 38:for(n=e;!(n=n.previous)&&s&&(n=e.toolbar.items[e.toolbar.items.length-1]),n&&!n.focus;);return n?n.focus():(o=1,$(e,CKEDITOR.SHIFT+9),o=0),!1;case 27:return y.focus(),!1;case 13:case 32:return e.execute(),!1}return!0};y.on("uiSpace",function(e){if(e.data.space==y.config.toolbarLocation){e.removeListener(),y.toolbox=new k;var t,n,i=['<span id="',a=CKEDITOR.tools.getNextId(),'" class="cke_voice_label">',y.lang.toolbar.toolbars,"</span>",'<span id="'+y.ui.spaceId("toolbox")+'" class="cke_toolbox" role="group" aria-labelledby="',a,'" onmousedown="return false;">'],a=!1!==y.config.toolbarStartupExpanded;y.config.toolbarCanCollapse&&y.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&i.push('<span class="cke_toolbox_main"'+(a?">":' style="display:none">'));for(var s=y.toolbox.toolbars,o=w(y),r=o.length,l=0;l<r;l++){var c,d,u,_=0,h=o[l],p="/"!==h&&("/"===o[l+1]||l==r-1);if(h)if(t&&(i.push("</span>"),n=t=0),"/"===h)i.push('<span class="cke_toolbar_break"></span>');else{u=h.items||h;for(var f=0;f<u.length;f++){var m,g=u[f];if(g){var A=function(e){e=e.render(y,i),0<(v=_.items.push(e)-1)&&(e.previous=_.items[v-1],e.previous.next=e),e.toolbar=_,e.onkey=$,e.onfocus=function(){y.toolbox.focusCommandExecuted||y.focus()}};if(g.type==CKEDITOR.UI_SEPARATOR)n=t&&g;else{if(m=!1!==g.canGroup,!_){c=CKEDITOR.tools.getNextId(),_={id:c,items:[]},d=h.name&&(y.lang.toolbar.toolbarGroups[h.name]||h.name),i.push('<span id="',c,'" class="cke_toolbar'+(p?' cke_toolbar_last"':'"'),d?' aria-labelledby="'+c+'_label"':"",' role="toolbar">'),d&&i.push('<span id="',c,'_label" class="cke_voice_label">',d,"</span>"),i.push('<span class="cke_toolbar_start"></span>');var v=s.push(_)-1;0<v&&(_.previous=s[v-1],_.previous.next=_)}m?t||(i.push('<span class="cke_toolgroup" role="presentation">'),t=1):t&&(i.push("</span>"),t=0),n&&(A(n),n=0),A(g)}}}t&&(i.push("</span>"),n=t=0),_&&i.push('<span class="cke_toolbar_end"></span></span>')}}if(y.config.toolbarCanCollapse&&i.push("</span>"),y.config.toolbarCanCollapse&&y.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var b=CKEDITOR.tools.addFunction(function(){y.execCommand("toolbarCollapse")});y.on("destroy",function(){CKEDITOR.tools.removeFunction(b)}),y.addCommand("toolbarCollapse",{readOnly:1,exec:function(e){var t=e.ui.space("toolbar_collapser"),n=t.getPrevious(),i=e.ui.space("contents"),a=n.getParent(),s=parseInt(i.$.style.height,10),o=a.$.offsetHeight,r=t.hasClass("cke_toolbox_collapser_min");r?(n.show(),t.removeClass("cke_toolbox_collapser_min"),t.setAttribute("title",e.lang.toolbar.toolbarCollapse)):(n.hide(),t.addClass("cke_toolbox_collapser_min"),t.setAttribute("title",e.lang.toolbar.toolbarExpand)),t.getFirst().setText(r?"\u25b2":"\u25c0"),i.setStyle("height",s-(a.$.offsetHeight-o)+"px"),e.fire("resize",{outerHeight:e.container.$.offsetHeight,contentsHeight:i.$.offsetHeight,outerWidth:e.container.$.offsetWidth})},modes:{wysiwyg:1,source:1}}),y.setKeystroke(CKEDITOR.ALT+(CKEDITOR.env.ie||CKEDITOR.env.webkit?189:109),"toolbarCollapse"),i.push('<a title="'+(a?y.lang.toolbar.toolbarCollapse:y.lang.toolbar.toolbarExpand)+'" id="'+y.ui.spaceId("toolbar_collapser")+'" tabIndex="-1" class="cke_toolbox_collapser'),a||i.push(" cke_toolbox_collapser_min"),i.push('" onclick="CKEDITOR.tools.callFunction('+b+')">','<span class="cke_arrow">&#9650;</span>',"</a>")}i.push("</span>"),e.data.html+=i.join("")}}),y.on("destroy",function(){if(this.toolbox){var e,t,n,i,a=0;for(e=this.toolbox.toolbars;a<e.length;a++)for(n=e[a].items,t=0;t<n.length;t++)(i=n[t]).clickFn&&CKEDITOR.tools.removeFunction(i.clickFn),i.keyDownFn&&CKEDITOR.tools.removeFunction(i.keyDownFn)}}),y.on("uiReady",function(){var e=y.ui.space("toolbox");e&&y.focusManager.add(e,1)}),y.addCommand("toolbarFocus",e),y.setKeystroke(CKEDITOR.ALT+121,"toolbarFocus"),y.ui.add("-",CKEDITOR.UI_SEPARATOR,{}),y.ui.addHandler(CKEDITOR.UI_SEPARATOR,{create:function(){return{render:function(e,t){return t.push('<span class="cke_toolbar_separator" role="separator"></span>'),{}}}}})}}),CKEDITOR.ui.prototype.addToolbarGroup=function(e,t,n){var i=d(this.editor),a=0===t,s={name:e};if(n){if(n=CKEDITOR.tools.search(i,function(e){return e.name==n}))return!n.groups&&(n.groups=[]),t&&0<=(t=CKEDITOR.tools.indexOf(n.groups,t))?void n.groups.splice(t+1,0,e):void(a?n.groups.splice(0,0,e):n.groups.push(e));t=null}t&&(t=CKEDITOR.tools.indexOf(i,function(e){return e.name==t})),a?i.splice(0,0,e):"number"==typeof t?i.splice(t+1,0,s):i.push(e)}}(),CKEDITOR.UI_SEPARATOR="separator",CKEDITOR.config.toolbarLocation="top",CKEDITOR.plugins.add("notification",{requires:"toolbar",init:function(s){function n(e){var t=new CKEDITOR.dom.element("div");t.setStyles({position:"fixed","margin-left":"-9999px"}),t.setAttributes({"aria-live":"assertive","aria-atomic":"true"}),t.setText(e),CKEDITOR.document.getBody().append(t),setTimeout(function(){t.remove()},100)}
s._.notificationArea=new t(s),s.showNotification=function(e,t,n){var i,a;return"progress"==t?i=n:a=n,(e=new CKEDITOR.plugins.notification(s,{message:e,type:t,progress:i,duration:a})).show(),e},s.on("key",function(e){if(27==e.data.keyCode){var t=s._.notificationArea.notifications;t.length&&(n(s.lang.notification.closed),t[t.length-1].hide(),e.cancel())}})}}),e.prototype={show:function(){!1!==this.editor.fire("notificationShow",{notification:this})&&(this.area.add(this),this._hideAfterTimeout())},update:function(e){var t=!0;!1===this.editor.fire("notificationUpdate",{notification:this,options:e})&&(t=!1);var n=this.element,i=n.findOne(".cke_notification_message"),a=n.findOne(".cke_notification_progress"),s=e.type;n.removeAttribute("role"),e.progress&&"progress"!=this.type&&(s="progress"),s&&(n.removeClass(this._getClass()),n.removeAttribute("aria-label"),this.type=s,n.addClass(this._getClass()),n.setAttribute("aria-label",this.type),"progress"!=this.type||a?"progress"!=this.type&&a&&a.remove():(a=this._createProgressElement()).insertBefore(i)),void 0!==e.message&&(this.message=e.message,i.setHtml(this.message)),void 0!==e.progress&&(this.progress=e.progress,a&&a.setStyle("width",this._getPercentageProgress())),t&&e.important&&(n.setAttribute("role","alert"),this.isVisible()||this.area.add(this)),this.duration=e.duration,this._hideAfterTimeout()},hide:function(){!1!==this.editor.fire("notificationHide",{notification:this})&&this.area.remove(this)},isVisible:function(){return 0<=CKEDITOR.tools.indexOf(this.area.notifications,this)},_createElement:function(){var e,t,n=this,i=this.editor.lang.common.close;return(e=new CKEDITOR.dom.element("div")).addClass("cke_notification"),e.addClass(this._getClass()),e.setAttributes({id:this.id,role:"alert","aria-label":this.type}),"progress"==this.type&&e.append(this._createProgressElement()),(t=new CKEDITOR.dom.element("p")).addClass("cke_notification_message"),t.setHtml(this.message),e.append(t),t=CKEDITOR.dom.element.createFromHtml('<a class="cke_notification_close" href="javascript:void(0)" title="'+i+'" role="button" tabindex="-1"><span class="cke_label">X</span></a>'),e.append(t),t.on("click",function(){n.editor.focus(),n.hide()}),e},_getClass:function(){return"progress"==this.type?"cke_notification_info":"cke_notification_"+this.type},_createProgressElement:function(){var e=new CKEDITOR.dom.element("span");return e.addClass("cke_notification_progress"),e.setStyle("width",this._getPercentageProgress()),e},_getPercentageProgress:function(){return Math.round(100*(this.progress||0))+"%"},_hideAfterTimeout:function(){var e,t=this;this._hideTimeoutId&&clearTimeout(this._hideTimeoutId),"number"==typeof this.duration?e=this.duration:"info"!=this.type&&"success"!=this.type||(e="number"==typeof this.editor.config.notification_duration?this.editor.config.notification_duration:5e3),e&&(t._hideTimeoutId=setTimeout(function(){t.hide()},e))}},t.prototype={add:function(e){this.notifications.push(e),this.element.append(e.element),1==this.element.getChildCount()&&(CKEDITOR.document.getBody().append(this.element),this._attachListeners()),this._layout()},remove:function(e){var t=CKEDITOR.tools.indexOf(this.notifications,e);t<0||(this.notifications.splice(t,1),e.element.remove(),this.element.getChildCount()||(this._removeListeners(),this.element.remove()))},_createElement:function(){var e=this.editor,t=e.config,n=new CKEDITOR.dom.element("div");return n.addClass("cke_notifications_area"),n.setAttribute("id","cke_notifications_area_"+e.name),n.setStyle("z-index",t.baseFloatZIndex-2),n},_attachListeners:function(){var e=CKEDITOR.document.getWindow(),t=this.editor;e.on("scroll",this._uiBuffer.input),e.on("resize",this._uiBuffer.input),t.on("change",this._changeBuffer.input),t.on("floatingSpaceLayout",this._layout,this,null,20),t.on("blur",this._layout,this,null,20)},_removeListeners:function(){var e=CKEDITOR.document.getWindow(),t=this.editor;e.removeListener("scroll",this._uiBuffer.input),e.removeListener("resize",this._uiBuffer.input),t.removeListener("change",this._changeBuffer.input),t.removeListener("floatingSpaceLayout",this._layout),t.removeListener("blur",this._layout)},_layout:function(){function e(){i.setStyle("left",p(f+a.width-l-c))}var t,n,i=this.element,a=(t=this.editor).ui.contentsElement.getClientRect(),s=t.ui.contentsElement.getDocumentPosition(),o=(t=t.ui.space("top")).getClientRect(),r=i.getClientRect(),l=this._notificationWidth,c=this._notificationMargin,d=(n=CKEDITOR.document.getWindow()).getScrollPosition(),u=n.getViewPaneSize(),_=CKEDITOR.document.getBody(),h=_.getDocumentPosition(),p=CKEDITOR.tools.cssLength;l&&c||(n=this.element.getChild(0),l=this._notificationWidth=n.getClientRect().width,c=this._notificationMargin=parseInt(n.getComputedStyle("margin-left"),10)+parseInt(n.getComputedStyle("margin-right"),10)),t.isVisible()&&o.bottom>a.top&&o.bottom<a.bottom-r.height?i.setStyles({position:"fixed",top:p(o.bottom)}):0<a.top?i.setStyles({position:"absolute",top:p(s.y)}):s.y+a.height-r.height>d.y?i.setStyles({position:"fixed",top:0}):i.setStyles({position:"absolute",top:p(s.y+a.height-r.height)});var f="fixed"==i.getStyle("position")?a.left:"static"!=_.getComputedStyle("position")?s.x-h.x:s.x;a.width<l+c?s.x+l+c>d.x+u.width?e():i.setStyle("left",p(f)):s.x+l+c>d.x+u.width?i.setStyle("left",p(f)):s.x+a.width/2+l/2+c>d.x+u.width?i.setStyle("left",p(f-s.x+d.x+u.width-l-c)):a.left+a.width-l-c<0?e():a.left+a.width/2-l/2<0?i.setStyle("left",p(f-s.x+d.x)):i.setStyle("left",p(f+a.width/2-l/2-c/2))}},CKEDITOR.plugins.notification=e,function(){function A(e,t,n){return t.type||(t.type="auto"),!(n&&!1===e.fire("beforePaste",t)||!t.dataValue&&t.dataTransfer.isEmpty())&&(t.dataValue||(t.dataValue=""),CKEDITOR.env.gecko&&"drop"==t.method&&e.toolbox&&e.once("afterPaste",function(){e.toolbox.focus()}),e.fire("paste",t))}function t(_){function e(){var e,t=_.editable();if(CKEDITOR.plugins.clipboard.isCustomCopyCutSupported){var n=function(e){_.readOnly&&"cut"==e.name||p.initPasteDataTransfer(e,_),e.data.preventDefault()};t.on("copy",n),t.on("cut",n),t.on("cut",function(){_.readOnly||_.extractSelectedHtml()},null,null,999)}t.on(p.mainPasteEvent,function(e){"beforepaste"==p.mainPasteEvent&&f||d(e)}),"beforepaste"==p.mainPasteEvent&&(t.on("paste",function(e){m||(i(),e.data.preventDefault(),d(e),s("paste"))}),t.on("contextmenu",a,null,null,0),t.on("beforepaste",function(e){!e.data||e.data.$.ctrlKey||e.data.$.shiftKey||a()},null,null,0)),t.on("beforecut",function(){!f&&o(_)}),t.attachListener(CKEDITOR.env.ie?t:_.document.getDocumentElement(),"mouseup",function(){e=setTimeout(function(){u()},0)}),_.on("destroy",function(){clearTimeout(e)}),t.on("keyup",u)}function t(e){return{type:e,canUndo:"cut"==e,startDisabled:!0,fakeKeystroke:"cut"==e?CKEDITOR.CTRL+88:CKEDITOR.CTRL+67,exec:function(){var e;"cut"==this.type&&o();var t=this.type;if(CKEDITOR.env.ie)e=s(t);else try{e=_.document.$.execCommand(t,!1,null)}catch(n){e=!1}return e||_.showNotification(_.lang.clipboard[this.type+"Error"]),e}}}function n(){return{canUndo:!1,async:!0,fakeKeystroke:CKEDITOR.CTRL+86,exec:function(n,e){function t(e,t){t=void 0===t||t,e?(e.method="paste",e.dataTransfer||(e.dataTransfer=p.initPasteDataTransfer()),A(n,e,t)):a&&n.showNotification(r,"info",n.config.clipboard_notificationDuration),n.fire("afterCommandExec",{name:"paste",command:i,returnValue:!!e})}var i=this,a="undefined"==typeof(e=null!=e?e:{}).notification||e.notification,s=e.type,o=CKEDITOR.tools.keystrokeToString(n.lang.common.keyboard,n.getCommandKeystroke(this)),r="string"==typeof a?a:n.lang.clipboard.pasteNotification.replace(/%1/,'<kbd aria-label="'+o.aria+'">'+o.display+"</kbd>");o="string"==typeof e?e:e.dataValue;s?n._.nextPasteType=s:delete n._.nextPasteType,"string"==typeof o?t({dataValue:o}):n.getClipboardData(t)}}}function i(){m=1,setTimeout(function(){m=0},100)}function a(){f=1,setTimeout(function(){f=0},10)}function s(e){var t=_.document,n=t.getBody(),i=!1,a=function(){i=!0};return n.on(e,a),7<CKEDITOR.env.version?t.$.execCommand(e):t.$.selection.createRange().execCommand(e),n.removeListener(e,a),i}function o(){if(CKEDITOR.env.ie&&!CKEDITOR.env.quirks){var e,t,n,i=_.getSelection();i.getType()==CKEDITOR.SELECTION_ELEMENT&&(e=i.getSelectedElement())&&(t=i.getRanges()[0],(n=_.document.createText("")).insertBefore(e),t.setStartBefore(n),t.setEndAfter(e),i.selectRanges([t]),setTimeout(function(){e.getParent()&&(n.remove(),i.selectElement(e))},0))}}function r(e,t){var n,i=_.document,a=_.editable(),s=function(e){e.cancel()};if(!i.getById("cke_pastebin")){var o=_.getSelection(),r=o.createBookmarks();CKEDITOR.env.ie&&o.root.fire("selectionchange");var l=new CKEDITOR.dom.element(!CKEDITOR.env.webkit&&!a.is("body")||CKEDITOR.env.ie?"div":"body",i);l.setAttributes({id:"cke_pastebin","data-cke-temp":"1"});var c=0;i=i.getWindow();CKEDITOR.env.webkit?(a.append(l),l.addClass("cke_editable"),a.is("body")||(c=(c="static"!=a.getComputedStyle("position")?a:CKEDITOR.dom.element.get(a.$.offsetParent)).getDocumentPosition().y)):a.getAscendant(CKEDITOR.env.ie?"body":"html",1).append(l),l.setStyles({position:"absolute",top:i.getScrollPosition().y-c+10+"px",width:"1px",height:Math.max(1,i.getViewPaneSize().height-20)+"px",overflow:"hidden",margin:0,padding:0}),CKEDITOR.env.safari&&l.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select","text")),(c=l.getParent().isReadOnly())?(l.setOpacity(0),l.setAttribute("contenteditable",!0)):l.setStyle("ltr"==_.config.contentsLangDirection?"left":"right","-10000px"),_.on("selectionChange",s,null,null,0),(CKEDITOR.env.webkit||CKEDITOR.env.gecko)&&(n=a.once("blur",s,null,null,-100)),c&&l.focus(),(c=new CKEDITOR.dom.range(l)).selectNodeContents(l);var d=c.select();CKEDITOR.env.ie&&(n=a.once("blur",function(){_.lockSelection(d)}));var u=CKEDITOR.document.getWindow().getScrollPosition().y;setTimeout(function(){var e;CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=u),n&&n.removeListener(),CKEDITOR.env.ie&&a.focus(),o.selectBookmarks(r),l.remove(),CKEDITOR.env.webkit&&(e=l.getFirst())&&e.is&&e.hasClass("Apple-style-span")&&(l=e),_.removeListener("selectionChange",s),t(l.getHtml())},0)}}function l(){if("paste"==p.mainPasteEvent)return _.fire("beforePaste",{type:"auto",method:"paste"}),!1;_.focus(),i();var e=_.focusManager;return e.lock(),_.editable().fire(p.mainPasteEvent)&&!s("paste")?(e.unlock(),!1):(e.unlock(),!0)}function c(e){if("wysiwyg"==_.mode)switch(e.data.keyCode){case CKEDITOR.CTRL+86:case CKEDITOR.SHIFT+45:e=_.editable(),i(),"paste"==p.mainPasteEvent&&e.fire("beforepaste");break;case CKEDITOR.CTRL+88:case CKEDITOR.SHIFT+46:_.fire("saveSnapshot"),setTimeout(function(){_.fire("saveSnapshot")},50)}}function d(e){var t={type:"auto",method:"paste",dataTransfer:p.initPasteDataTransfer(e)};t.dataTransfer.cacheData();var n=!1!==_.fire("beforePaste",t);n&&p.canClipboardApiBeTrusted(t.dataTransfer,_)?(e.data.preventDefault(),setTimeout(function(){A(_,t)},0)):r(e,function(e){t.dataValue=e.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/gi,""),n&&A(_,t)})}function u(){if("wysiwyg"==_.mode){var e=h("paste");_.getCommand("cut").setState(h("cut")),_.getCommand("copy").setState(h("copy")),_.getCommand("paste").setState(e),_.fire("pasteState",e)}}function h(e){if(g&&e in{paste:1,cut:1})return CKEDITOR.TRISTATE_DISABLED;if("paste"==e)return CKEDITOR.TRISTATE_OFF;var t=(e=_.getSelection()).getRanges();return e.getType()==CKEDITOR.SELECTION_NONE||1==t.length&&t[0].collapsed?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_OFF}var p=CKEDITOR.plugins.clipboard,f=0,m=0,g=0;_.on("key",c),_.on("contentDom",e),_.on("selectionChange",function(e){g=e.data.selection.getRanges()[0].checkReadOnly(),u()}),_.contextMenu&&_.contextMenu.addListener(function(e,t){return g=t.getRanges()[0].checkReadOnly(),{cut:h("cut"),copy:h("copy"),paste:h("paste")}}),function(){function e(e,t,n,i,a){var s=_.lang.clipboard[t];_.addCommand(t,n),_.ui.addButton&&_.ui.addButton(e,{label:s,command:t,toolbar:"clipboard,"+i}),_.addMenuItems&&_.addMenuItem(t,{label:s,command:t,group:"clipboard",order:a})}e("Cut","cut",t("cut"),10,1),e("Copy","copy",t("copy"),20,4),e("Paste","paste",n(),30,8)}(),_.getClipboardData=function(e,t){function n(e){e.removeListener(),e.cancel(),t(e.data)}t||(t=e,e=null),_.on("paste",n,null,null,0),!1===l()&&(_.removeListener("paste",n),t(null))}}function l(e){if(CKEDITOR.env.webkit){if(!e.match(/^[^<]*$/g)&&!e.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi))return"html"}else if(CKEDITOR.env.ie){if(!e.match(/^([^<]|<br( ?\/)?>)*$/gi)&&!e.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi))return"html"}else{if(!CKEDITOR.env.gecko)return"html";if(!e.match(/^([^<]|<br( ?\/)?>)*$/gi))return"html"}return"htmlifiedtext"}function c(e,t){function n(e){return CKEDITOR.tools.repeat("</p><p>",~~(e/2))+(1==e%2?"<br>":"")}return(t=(t=t.replace(/\s+/g," ").replace(/> +</g,"><").replace(/<br ?\/>/gi,"<br>")).replace(/<\/?[A-Z]+>/g,function(e){return e.toLowerCase()})).match(/^[^<]$/)?t:(CKEDITOR.env.webkit&&-1<t.indexOf("<div>")&&((t=t.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g,"<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g,"<div></div>")).match(/<div>(<br>|)<\/div>/)&&(t="<p>"+t.replace(/(<div>(<br>|)<\/div>)+/g,function(e){return n(e.split("</div><div>").length+1)})+"</p>"),t=(t=t.replace(/<\/div><div>/g,"<br>")).replace(/<\/?div>/g,"")),CKEDITOR.env.gecko&&e.enterMode!=CKEDITOR.ENTER_BR&&(CKEDITOR.env.gecko&&(t=t.replace(/^<br><br>$/,"<br>")),-1<t.indexOf("<br><br>")&&(t="<p>"+t.replace(/(<br>){2,}/g,function(e){return n(e.length/4)})+"</p>")),i(e,t))}function n(){function t(){var e,t={};for(e in CKEDITOR.dtd)"$"!=e.charAt(0)&&"div"!=e&&"span"!=e&&(t[e]=1);return t}var n={};return{get:function(e){return"plain-text"==e?n.plainText||(n.plainText=new CKEDITOR.filter("br")):"semantic-content"==e?((e=n.semanticContent)||((e=new CKEDITOR.filter).allow({$1:{elements:t(),attributes:!0,styles:!1,classes:!1}}),e=n.semanticContent=e),e):e?new CKEDITOR.filter(e):null}}}function d(e,t,n){t=CKEDITOR.htmlParser.fragment.fromHtml(t);var i=new CKEDITOR.htmlParser.basicWriter;return n.applyTo(t,!0,!1,e.activeEnterMode),t.writeHtml(i),i.getHtml()}function i(e,t){return e.enterMode==CKEDITOR.ENTER_BR?t=t.replace(/(<\/p><p>)+/g,function(e){return CKEDITOR.tools.repeat("<br>",e.length/7*2)}).replace(/<\/?p>/g,""):e.enterMode==CKEDITOR.ENTER_DIV&&(t=t.replace(/<(\/)?p>/g,"<$1div>")),t}function a(e){e.data.preventDefault(),e.data.$.dataTransfer.dropEffect="none"}function u(l){var c=CKEDITOR.plugins.clipboard;l.on("contentDom",function(){function a(e,t,n){t.select(),A(l,{dataTransfer:n,method:"drop"},1),n.sourceEditor.fire("saveSnapshot"),n.sourceEditor.editable().extractHtmlFromRange(e),n.sourceEditor.getSelection().selectRanges([e]),n.sourceEditor.fire("saveSnapshot")}function s(e,t){e.select(),A(l,{dataTransfer:t,method:"drop"},1),c.resetDragDataTransfer()}function i(e,t,n){var i={$:e.data.$,target:e.data.getTarget()};t&&(i.dragRange=t),n&&(i.dropRange=n),!1===l.fire(e.name,i)&&e.data.preventDefault()}function t(e){return e.type!=CKEDITOR.NODE_ELEMENT&&(e=e.getParent()),e.getChildCount()}var e=l.editable(),n=CKEDITOR.plugins.clipboard.getDropTarget(l),o=l.ui.space("top"),r=l.ui.space("bottom");c.preventDefaultDropOnElement(o),c.preventDefaultDropOnElement(r),e.attachListener(n,"dragstart",i),e.attachListener(l,"dragstart",c.resetDragDataTransfer,c,null,1),e.attachListener(l,"dragstart",function(e){c.initDragDataTransfer(e,l)},null,null,2),e.attachListener(l,"dragstart",function(){var e=c.dragRange=l.getSelection().getRanges()[0];CKEDITOR.env.ie&&CKEDITOR.env.version<10&&(c.dragStartContainerChildCount=e?t(e.startContainer):null,c.dragEndContainerChildCount=e?t(e.endContainer):null)},null,null,100),e.attachListener(n,"dragend",i),e.attachListener(l,"dragend",c.initDragDataTransfer,c,null,1),e.attachListener(l,"dragend",c.resetDragDataTransfer,c,null,100),e.attachListener(n,"dragover",function(e){if(CKEDITOR.env.edge)e.data.preventDefault();else{var t=e.data.getTarget();t&&t.is&&t.is("html")?e.data.preventDefault():CKEDITOR.env.ie&&CKEDITOR.plugins.clipboard.isFileApiSupported&&e.data.$.dataTransfer.types.contains("Files")&&e.data.preventDefault()}}),e.attachListener(n,"drop",function(e){if(!e.data.$.defaultPrevented&&(e.data.preventDefault(),!(t=e.data.getTarget()).isReadOnly()||t.type==CKEDITOR.NODE_ELEMENT&&t.is("html"))){var t=c.getRangeAtDropPosition(e,l),n=c.dragRange;t&&i(e,n,t)}},null,null,9999),e.attachListener(l,"drop",c.initDragDataTransfer,c,null,1),e.attachListener(l,"drop",function(e){if(e=e.data){var t=e.dropRange,n=e.dragRange,i=e.dataTransfer;i.getTransferType(l)==CKEDITOR.DATA_TRANSFER_INTERNAL?setTimeout(function(){c.internalDrop(n,t,i,l)},0):i.getTransferType(l)==CKEDITOR.DATA_TRANSFER_CROSS_EDITORS?a(n,t,i):s(t,i)}},null,null,9999)})}CKEDITOR.plugins.add("clipboard",{requires:"notification",init:function(o){var e,r=n();if(o.config.forcePasteAsPlainText?e="plain-text":o.config.pasteFilter?e=o.config.pasteFilter:!CKEDITOR.env.webkit||"pasteFilter"in o.config||(e="semantic-content"),o.pasteFilter=r.get(e),t(o),u(o),CKEDITOR.env.gecko){var a,s=["image/png","image/jpeg","image/gif"];o.on("paste",function(e){var t=e.data,n=t.dataTransfer;if(!t.dataValue&&"paste"==t.method&&n&&1==n.getFilesCount()&&a!=n.id&&(n=n.getFile(0),-1!=CKEDITOR.tools.indexOf(s,n.type))){var i=new FileReader;i.addEventListener("load",function(){e.data.dataValue='<img src="'+i.result+'" />',o.fire("paste",e.data)},!1),i.addEventListener("abort",function(){o.fire("paste",e.data)},!1),i.addEventListener("error",function(){o.fire("paste",e.data)},!1),i.readAsDataURL(n),a=t.dataTransfer.id,e.stop()}},null,null,1)}o.on("paste",function(e){if(e.data.dataTransfer||(e.data.dataTransfer=new CKEDITOR.plugins.clipboard.dataTransfer),!e.data.dataValue){var t=e.data.dataTransfer,n=t.getData("text/html");n?(e.data.dataValue=n,e.data.type="html"):(n=t.getData("text/plain"))&&(e.data.dataValue=o.editable().transformPlainTextToHtml(n),e.data.type="text")}},null,null,1),o.on("paste",function(n){var e=n.data.dataValue,i=CKEDITOR.dtd.$block;if(-1<e.indexOf("Apple-")&&(e=e.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi," "),"html"!=n.data.type&&(e=e.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi,function(e,t){return t.replace(/\t/g,"&nbsp;&nbsp; &nbsp;")})),-1<e.indexOf('<br class="Apple-interchange-newline">')&&(n.data.startsWithEOL=1,n.data.preSniffing="html",e=e.replace(/<br class="Apple-interchange-newline">/,"")),e=e.replace(/(<[^>]+) class="Apple-[^"]*"/gi,"$1")),e.match(/^<[^<]+cke_(editable|contents)/i)){var t,a,s=new CKEDITOR.dom.element("div");for(s.setHtml(e);1==s.getChildCount()&&(t=s.getFirst())&&t.type==CKEDITOR.NODE_ELEMENT&&(t.hasClass("cke_editable")||t.hasClass("cke_contents"));)s=a=t;a&&(e=a.getHtml().replace(/<br>$/i,""))}CKEDITOR.env.ie?e=e.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g,function(e,t){return t.toLowerCase()in i?(n.data.preSniffing="html","<"+t):e}):CKEDITOR.env.webkit?e=e.replace(/<\/(\w+)><div><br><\/div>$/,function(e,t){return t in i?(n.data.endsWithEOL=1,"</"+t+">"):e}):CKEDITOR.env.gecko&&(e=e.replace(/(\s)<br>$/,"$1")),n.data.dataValue=e},null,null,3),o.on("paste",function(e){e=e.data;var t,n=o._.nextPasteType||e.type,i=e.dataValue,a=o.config.clipboard_defaultContentType||"html",s=e.dataTransfer.getTransferType(o);t="html"==n||"html"==e.preSniffing?"html":l(i),delete o._.nextPasteType,"htmlifiedtext"==t&&(i=c(o.config,i)),"text"==n&&"html"==t?i=d(o,i,r.get("plain-text")):s==CKEDITOR.DATA_TRANSFER_EXTERNAL&&o.pasteFilter&&!e.dontFilter&&(i=d(o,i,o.pasteFilter)),e.startsWithEOL&&(i='<br data-cke-eol="1">'+i),e.endsWithEOL&&(i+='<br data-cke-eol="1">'),"auto"==n&&(n="html"==t||"html"==a?"html":"text"),e.type=n,e.dataValue=i,delete e.preSniffing,delete e.startsWithEOL,delete e.endsWithEOL},null,null,6),o.on("paste",function(e){(e=e.data).dataValue&&(o.insertHtml(e.dataValue,e.type,e.range),setTimeout(function(){o.fire("afterPaste")},0))},null,null,1e3)}}),CKEDITOR.plugins.clipboard={isCustomCopyCutSupported:!CKEDITOR.env.ie&&!CKEDITOR.env.iOS,isCustomDataTypesSupported:!CKEDITOR.env.ie,isFileApiSupported:!CKEDITOR.env.ie||9<CKEDITOR.env.version,mainPasteEvent:CKEDITOR.env.ie&&!CKEDITOR.env.edge?"beforepaste":"paste",canClipboardApiBeTrusted:function(e,t){return!!(e.getTransferType(t)!=CKEDITOR.DATA_TRANSFER_EXTERNAL||CKEDITOR.env.chrome&&!e.isEmpty()||CKEDITOR.env.gecko&&(e.getData("text/html")||e.getFilesCount())||CKEDITOR.env.safari&&603<=CKEDITOR.env.version&&!CKEDITOR.env.iOS)},getDropTarget:function(e){var t=e.editable();return CKEDITOR.env.ie&&CKEDITOR.env.version<9||t.isInline()?t:e.document},fixSplitNodesAfterDrop:function(e,a,t,n){function i(e,t,n){var i=e;if(i.type==CKEDITOR.NODE_TEXT&&(i=e.getParent()),i.equals(t)&&n!=t.getChildCount())return e=a.startContainer.getChild(a.startOffset-1),t=a.startContainer.getChild(a.startOffset),e&&e.type==CKEDITOR.NODE_TEXT&&t&&t.type==CKEDITOR.NODE_TEXT&&(n=e.getLength(),e.setText(e.getText()+t.getText()),t.remove(),a.setStart(e,n),a.collapse(!0)),!0}var s=a.startContainer;"number"==typeof n&&"number"==typeof t&&s.type==CKEDITOR.NODE_ELEMENT&&(i(e.startContainer,s,t)||i(e.endContainer,s,n))},isDropRangeAffectedByDragRange:function(e,t){var n=t.startContainer,i=t.endOffset;return!!(e.endContainer.equals(n)&&e.endOffset<=i||e.startContainer.getParent().equals(n)&&e.startContainer.getIndex()<i||e.endContainer.getParent().equals(n)&&e.endContainer.getIndex()<i)},internalDrop:function(e,t,n,i){var a,s,o=CKEDITOR.plugins.clipboard,r=i.editable();i.fire("saveSnapshot"),i.fire("lockSnapshot",{dontUpdate:1}),CKEDITOR.env.ie&&CKEDITOR.env.version<10&&this.fixSplitNodesAfterDrop(e,t,o.dragStartContainerChildCount,o.dragEndContainerChildCount),(s=this.isDropRangeAffectedByDragRange(e,t))||(a=e.createBookmark(!1)),o=t.clone().createBookmark(!1),s&&(a=e.createBookmark(!1)),e=a.startNode,t=a.endNode,s=o.startNode,t&&e.getPosition(s)&CKEDITOR.POSITION_PRECEDING&&t.getPosition(s)&CKEDITOR.POSITION_FOLLOWING&&s.insertBefore(e),(e=i.createRange()).moveToBookmark(a),r.extractHtmlFromRange(e,1),(t=i.createRange()).moveToBookmark(o),A(i,{dataTransfer:n,method:"drop",range:t},1),i.fire("unlockSnapshot")},getRangeAtDropPosition:function(e,t){var n=e.data.$,i=n.clientX,a=n.clientY,s=t.getSelection(!0).getRanges()[0],o=t.createRange();if(e.data.testRange)return e.data.testRange;if(document.caretRangeFromPoint&&t.document.$.caretRangeFromPoint(i,a))n=t.document.$.caretRangeFromPoint(i,a),o.setStart(CKEDITOR.dom.node(n.startContainer),n.startOffset),o.collapse(!0);else if(n.rangeParent)o.setStart(CKEDITOR.dom.node(n.rangeParent),n.rangeOffset),o.collapse(!0);else{if(CKEDITOR.env.ie&&8<CKEDITOR.env.version&&s&&t.editable().hasFocus)return s;if(!document.body.createTextRange)return null;t.focus(),n=t.document.getBody().$.createTextRange();try{for(var r=!1,l=0;l<20&&!r;l++){if(!r)try{n.moveToPoint(i,a-l),r=!0}catch(f){}if(!r)try{n.moveToPoint(i,a+l),r=!0}catch(h){}}if(r){var c="cke-temp-"+(new Date).getTime();n.pasteHTML('<span id="'+c+'">\u200b</span>');var d=t.document.getById(c);o.moveToPosition(d,CKEDITOR.POSITION_BEFORE_START),d.remove()}else{var u=t.document.$.elementFromPoint(i,a),_=new CKEDITOR.dom.element(u);if(_.equals(t.editable())||"html"==_.getName())return s&&s.startContainer&&!s.startContainer.equals(t.editable())?s:null;i<_.getClientRect().left?o.setStartAt(_,CKEDITOR.POSITION_AFTER_START):o.setStartAt(_,CKEDITOR.POSITION_BEFORE_END),o.collapse(!0)}}catch(p){return null}}return o},initDragDataTransfer:function(e,t){var n=e.data.$?e.data.$.dataTransfer:null,i=new this.dataTransfer(n,t);n?this.dragData&&i.id==this.dragData.id?i=this.dragData:this.dragData=i:this.dragData?i=this.dragData:this.dragData=i,e.data.dataTransfer=i},resetDragDataTransfer:function(){this.dragData=null},initPasteDataTransfer:function(e,t){if(this.isCustomCopyCutSupported){if(e&&e.data&&e.data.$){var n=new this.dataTransfer(e.data.$.clipboardData,t);return this.copyCutData&&n.id==this.copyCutData.id?(n=this.copyCutData).$=e.data.$.clipboardData:this.copyCutData=n,n}return new this.dataTransfer(null,t)}return new this.dataTransfer(CKEDITOR.env.edge&&e&&e.data.$&&e.data.$.clipboardData||null,t)},preventDefaultDropOnElement:function(e){e&&e.on("dragover",a)}};var f=CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?"cke/id":"Text";CKEDITOR.plugins.clipboard.dataTransfer=function(e,t){if(e&&(this.$=e),this._={metaRegExp:/^<meta.*?>/i,bodyRegExp:/<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,fragmentRegExp:/\x3c!--(?:Start|End)Fragment--\x3e/g,data:{},files:[],normalizeType:function(e){return"text"==(e=e.toLowerCase())||"text/plain"==e?"Text":"url"==e?"URL":e}},this.id=this.getData(f),this.id||(this.id="Text"==f?"":"cke-"+CKEDITOR.tools.getUniqueId()),"Text"!=f)try{this.$.setData(f,this.id)}catch(n){}t&&(this.sourceEditor=t,this.setData("text/html",t.getSelectedHtml(1)),"Text"==f||this.getData("text/plain")||this.setData("text/plain",t.getSelection().getSelectedText()))},CKEDITOR.DATA_TRANSFER_INTERNAL=1,CKEDITOR.DATA_TRANSFER_CROSS_EDITORS=2,CKEDITOR.DATA_TRANSFER_EXTERNAL=3,CKEDITOR.plugins.clipboard.dataTransfer.prototype={getData:function(e,t){e=this._.normalizeType(e);var n,i=this._.data[e];if(null==i||""===i)try{i=this.$.getData(e)}catch(a){}return null!=i&&""!==i||(i=""),"text/html"!=e||t?"Text"==e&&CKEDITOR.env.gecko&&this.getFilesCount()&&"file://"==i.substring(0,7)&&(i=""):(i=i.replace(this._.metaRegExp,""),(n=this._.bodyRegExp.exec(i))&&n.length&&(i=(i=n[1]).replace(this._.fragmentRegExp,""))),"string"==typeof i&&(i=-1!==(n=i.indexOf("</html>"))?i.substring(0,n+7):i),i},setData:function(e,t){if(e=this._.normalizeType(e),this._.data[e]=t,CKEDITOR.plugins.clipboard.isCustomDataTypesSupported||"URL"==e||"Text"==e){"Text"==f&&"Text"==e&&(this.id=t);try{this.$.setData(e,t)}catch(n){}}},getTransferType:function(e){return this.sourceEditor?this.sourceEditor==e?CKEDITOR.DATA_TRANSFER_INTERNAL:CKEDITOR.DATA_TRANSFER_CROSS_EDITORS:CKEDITOR.DATA_TRANSFER_EXTERNAL},cacheData:function(){function e(e){e=i._.normalizeType(e);var t=i.getData(e,!0);t&&(i._.data[e]=t)}if(this.$){var t,n,i=this;if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(t=0;t<this.$.types.length;t++)e(this.$.types[t])}else e("Text"),e("URL");if(n=this._getImageFromClipboard(),this.$&&this.$.files||n){if(this._.files=[],this.$.files&&this.$.files.length)for(t=0;t<this.$.files.length;t++)this._.files.push(this.$.files[t]);0===this._.files.length&&n&&this._.files.push(n)}}},getFilesCount:function(){return this._.files.length?this._.files.length:this.$&&this.$.files&&this.$.files.length?this.$.files.length:this._getImageFromClipboard()?1:0},getFile:function(e){return this._.files.length?this._.files[e]:this.$&&this.$.files&&this.$.files.length?this.$.files[e]:0===e?this._getImageFromClipboard():void 0},isEmpty:function(){var e,t={};if(this.getFilesCount())return!1;for(e in this._.data)t[e]=1;if(this.$)if(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported){if(this.$.types)for(var n=0;n<this.$.types.length;n++)t[this.$.types[n]]=1}else t.Text=1,t.URL=1;for(e in"Text"!=f&&(t[f]=0),t)if(t[e]&&""!==this.getData(e))return!1;return!0},_getImageFromClipboard:function(){var e;if(this.$&&this.$.items&&this.$.items[0])try{if((e=this.$.items[0].getAsFile())&&e.type)return e}catch(t){}}}}(),CKEDITOR.config.clipboard_notificationDuration=1e4,CKEDITOR.plugins.add("panelbutton",{requires:"button",onLoad:function(){function n(e){var t=this._;t.state!=CKEDITOR.TRISTATE_DISABLED&&(this.createPanel(e),t.on?t.panel.hide():t.panel.showBlock(this._.id,this.document.getById(this._.id),4))}CKEDITOR.ui.panelButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(e){var t=e.panel||{};delete e.panel,this.base(e),this.document=t.parent&&t.parent.getDocument()||CKEDITOR.document,t.block={attributes:t.attributes},this.hasArrow=t.toolbarRelated=!0,this.click=n,this._={panelDefinition:t}},statics:{handler:{create:function(e){return new CKEDITOR.ui.panelButton(e)}}},proto:{createPanel:function(t){var n=this._;if(!n.panel){var e=this._.panelDefinition,i=this._.panelDefinition.block,a=e.parent||CKEDITOR.document.getBody(),s=this._.panel=new CKEDITOR.ui.floatPanel(t,a,e),o=(e=s.addBlock(n.id,i),this);s.onShow=function(){o.className&&this.element.addClass(o.className+"_panel"),o.setState(CKEDITOR.TRISTATE_ON),n.on=1,o.editorFocus&&t.focus(),o.onOpen&&o.onOpen()},s.onHide=function(e){o.className&&this.element.getFirst().removeClass(o.className+"_panel"),o.setState(o.modes&&o.modes[t.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),n.on=0,!e&&o.onClose&&o.onClose()},s.onEscape=function(){s.hide(1),o.document.getById(n.id).focus()},this.onBlock&&this.onBlock(s,e),e.onHide=function(){n.on=0,o.setState(CKEDITOR.TRISTATE_OFF)}}}}})},beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_PANELBUTTON,CKEDITOR.ui.panelButton.handler)}}),CKEDITOR.UI_PANELBUTTON="panelbutton",function(){CKEDITOR.plugins.add("panel",{beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_PANEL,CKEDITOR.ui.panel.handler)}}),CKEDITOR.UI_PANEL="panel",CKEDITOR.ui.panel=function(e,t){t&&CKEDITOR.tools.extend(this,t),CKEDITOR.tools.extend(this,{className:"",css:[]}),this.id=CKEDITOR.tools.getNextId(),this.document=e,this.isFramed=this.forceIFrame||this.css.length,this._={blocks:{}}},CKEDITOR.ui.panel.handler={create:function(e){return new CKEDITOR.ui.panel(e)}};var a=CKEDITOR.addTemplate("panel",'<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),s=CKEDITOR.addTemplate("panel-frame",'<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),o=CKEDITOR.addTemplate("panel-frame-inner",'<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');CKEDITOR.ui.panel.prototype={render:function(e,t){this.getHolderElement=function(){if(!(t=this._.holder)){if(this.isFramed){var e=(t=this.document.getById(this.id+"_frame")).getParent(),t=t.getFrameDocument();CKEDITOR.env.iOS&&e.setStyles({overflow:"scroll","-webkit-overflow-scrolling":"touch"}),e=CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function(){this.isLoaded=!0,this.onLoad&&this.onLoad()},this)),t.write(o.output(CKEDITOR.tools.extend({css:CKEDITOR.tools.buildStyleHtml(this.css),onload:"window.parent.CKEDITOR.tools.callFunction("+e+");"},n))),t.getWindow().$.CKEDITOR=CKEDITOR,t.on("keydown",function(e){var t=e.data.getKeystroke(),n=this.document.getById(this.id).getAttribute("dir");this._.onKeyDown&&!1===this._.onKeyDown(t)?e.data.preventDefault():(27==t||t==("rtl"==n?39:37))&&this.onEscape&&!1===this.onEscape(t)&&e.data.preventDefault()},this),(t=t.getBody()).unselectable(),CKEDITOR.env.air&&CKEDITOR.tools.callFunction(e)}else t=this.document.getById(this.id);this._.holder=t}return t};var n={editorId:e.id,id:this.id,langCode:e.langCode,dir:e.lang.dir,cls:this.className,frame:"",env:CKEDITOR.env.cssClass,"z-index":e.config.baseFloatZIndex+1};if(this.isFramed){var i=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie?"javascript:void(function(){"+encodeURIComponent("document.open();("+CKEDITOR.tools.fixDomain+")();document.close();")+"}())":"";n.frame=s.output({id:this.id+"_frame",src:i})}return i=a.output(n),t&&t.push(i),i},addBlock:function(e,t){return t=this._.blocks[e]=t instanceof CKEDITOR.ui.panel.block?t:new CKEDITOR.ui.panel.block(this.getHolderElement(),t),this._.currentBlock||this.showBlock(e),t},getBlock:function(e){return this._.blocks[e]},showBlock:function(e){e=this._.blocks[e];var t=this._.currentBlock,n=!this.forceIFrame||CKEDITOR.env.ie?this._.holder:this.document.getById(this.id+"_frame");return t&&t.hide(),this._.currentBlock=e,CKEDITOR.fire("ariaWidget",n),e._.focusIndex=-1,this._.onKeyDown=e.onKeyDown&&CKEDITOR.tools.bind(e.onKeyDown,e),e.show(),e},destroy:function(){this.element&&this.element.remove()}},CKEDITOR.ui.panel.block=CKEDITOR.tools.createClass({$:function(e,t){this.element=e.append(e.getDocument().createElement("div",{attributes:{tabindex:-1,"class":"cke_panel_block"},styles:{display:"none"}})),t&&CKEDITOR.tools.extend(this,t),this.element.setAttributes({role:this.attributes.role||"presentation","aria-label":this.attributes["aria-label"],title:this.attributes.title||this.attributes["aria-label"]}),this.keys={},this._.focusIndex=-1,this.element.disableContextMenu()},_:{markItem:function(e){-1!=e&&(e=this.element.getElementsByTag("a").getItem(this._.focusIndex=e),CKEDITOR.env.webkit&&e.getDocument().getWindow().focus(),e.focus(),this.onMark&&this.onMark(e))},
markFirstDisplayed:function(e){for(var t,n,i=function(e){return e.type==CKEDITOR.NODE_ELEMENT&&"none"==e.getStyle("display")},a=this._.getItems(),s=a.count()-1;0<=s;s--)if((t=a.getItem(s)).getAscendant(i)||(n=t,this._.focusIndex=s),"true"==t.getAttribute("aria-selected")){n=t,this._.focusIndex=s;break}n&&(e&&e(),CKEDITOR.env.webkit&&n.getDocument().getWindow().focus(),n.focus(),this.onMark&&this.onMark(n))},getItems:function(){return this.element.getElementsByTag("a")}},proto:{show:function(){this.element.setStyle("display","")},hide:function(){this.onHide&&!0===this.onHide.call(this)||this.element.setStyle("display","none")},onKeyDown:function(e,t){switch(a=this.keys[e]){case"next":for(var n,i=this._.focusIndex,a=this.element.getElementsByTag("a");n=a.getItem(++i);)if(n.getAttribute("_cke_focus")&&n.$.offsetWidth){this._.focusIndex=i,n.focus();break}return!n&&!t&&(this._.focusIndex=-1,this.onKeyDown(e,1));case"prev":for(i=this._.focusIndex,a=this.element.getElementsByTag("a");0<i&&(n=a.getItem(--i));){if(n.getAttribute("_cke_focus")&&n.$.offsetWidth){this._.focusIndex=i,n.focus();break}n=null}return!n&&!t&&(this._.focusIndex=a.count(),this.onKeyDown(e,1));case"click":case"mouseup":return(n=0<=(i=this._.focusIndex)&&this.element.getElementsByTag("a").getItem(i))&&(n.$[a]?n.$[a]():n.$["on"+a]()),!1}return!0}}})}(),CKEDITOR.plugins.add("floatpanel",{requires:"panel"}),function(){function c(e,t,n,i,a){a=CKEDITOR.tools.genKey(t.getUniqueId(),n.getUniqueId(),e.lang.dir,e.uiColor||"",i.css||"",a||"");var s=o[a];return s||((s=o[a]=new CKEDITOR.ui.panel(t,i)).element=n.append(CKEDITOR.dom.element.createFromHtml(s.render(e),t)),s.element.setStyles({display:"none",position:"absolute"})),s}var o={};CKEDITOR.ui.floatPanel=CKEDITOR.tools.createClass({$:function(e,t,n,i){function a(){l.hide()}n.forceIFrame=1,n.toolbarRelated&&e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(t=CKEDITOR.document.getById("cke_"+e.name));var s=t.getDocument(),o=(i=c(e,s,t,n,i||0)).element,r=o.getFirst(),l=this;o.disableContextMenu(),this.element=o,this._={editor:e,panel:i,parentElement:t,definition:n,document:s,iframe:r,children:[],dir:e.lang.dir,showBlockParams:null},e.on("mode",a),e.on("resize",a),s.getWindow().on("resize",function(){this.reposition()},this)},proto:{addBlock:function(e,t){return this._.panel.addBlock(e,t)},addListBlock:function(e,t){return this._.panel.addListBlock(e,t)},getBlock:function(e){return this._.panel.getBlock(e)},showBlock:function(e,t,n,i,a,r){var l=this._.panel,c=l.showBlock(e);this._.showBlockParams=[].slice.call(arguments),this.allowBlur(!1);var s=this._.editor.editable();this._.returnFocus=s.hasFocus?s:new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement),this._.hideTimeout=0;var d=this.element,o=(s=this._.iframe,s=CKEDITOR.env.ie&&!CKEDITOR.env.edge?s:new CKEDITOR.dom.window(s.$.contentWindow),d.getDocument()),u=this._.parentElement.getPositionedAncestor(),_=t.getDocumentPosition(o),h=(o=u?u.getDocumentPosition(o):{x:0,y:0},"rtl"==this._.dir),p=_.x+(i||0)-o.x,f=_.y+(a||0)-o.y;!h||1!=n&&4!=n?h||2!=n&&3!=n||(p+=t.$.offsetWidth-1):p+=t.$.offsetWidth,3!=n&&4!=n||(f+=t.$.offsetHeight-1),this._.panel._.offsetParentId=t.getId(),d.setStyles({top:f+"px",left:0,display:""}),d.setOpacity(0),d.getFirst().removeStyle("width"),this._.editor.focusManager.add(s),this._.blurSet||(CKEDITOR.event.useCapture=!0,s.on("blur",function(e){function t(){delete this._.returnFocus,this.hide()}this.allowBlur()&&e.data.getPhase()==CKEDITOR.EVENT_PHASE_AT_TARGET&&this.visible&&!this._.activeChild&&(CKEDITOR.env.iOS?this._.hideTimeout||(this._.hideTimeout=CKEDITOR.tools.setTimeout(t,0,this)):t.call(this))},this),s.on("focus",function(){this._.focused=!0,this.hideChild(),this.allowBlur(!0)},this),CKEDITOR.env.iOS&&(s.on("touchstart",function(){clearTimeout(this._.hideTimeout)},this),s.on("touchend",function(){this._.hideTimeout=0,this.focus()},this)),CKEDITOR.event.useCapture=!1,this._.blurSet=1),l.onEscape=CKEDITOR.tools.bind(function(e){if(this.onEscape&&!1===this.onEscape(e))return!1},this),CKEDITOR.tools.setTimeout(function(){var e=CKEDITOR.tools.bind(function(){if((n=d).removeStyle("width"),c.autoSize){var e=c.element.getDocument();e=(CKEDITOR.env.webkit||CKEDITOR.env.edge?c.element:e.getBody()).$.scrollWidth;CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<e&&(e+=(n.$.offsetWidth||0)-(n.$.clientWidth||0)+3),n.setStyle("width",e+10+"px"),e=c.element.$.scrollHeight,CKEDITOR.env.ie&&CKEDITOR.env.quirks&&0<e&&(e+=(n.$.offsetHeight||0)-(n.$.clientHeight||0)+3),n.setStyle("height",e+"px"),l._.currentBlock.element.setStyle("display","none").removeStyle("display")}else n.removeStyle("height");h&&(p-=d.$.offsetWidth),d.setStyle("left",p+"px");e=l.element.getWindow();var t,n=d.$.getBoundingClientRect(),i=(e=e.getViewPaneSize(),n.width||n.right-n.left),a=n.height||n.bottom-n.top,s=h?n.right:e.width-n.left,o=h?e.width-n.right:n.left;h?s<i&&(p=i<o?p+i:e.width>i?p-n.left:p-n.right+e.width):s<i&&(p=i<o?p-i:e.width>i?p-n.right+e.width:p-n.left),i=n.top,e.height-n.top<a&&(f=a<i?f-a:e.height>a?f-n.bottom+e.height:f-n.top),CKEDITOR.env.ie&&("html"==(e=n=new CKEDITOR.dom.element(d.$.offsetParent)).getName()&&(e=e.getDocument().getBody()),"rtl"==e.getComputedStyle("direction")&&(p=CKEDITOR.env.ie8Compat?p-2*d.getDocument().getDocumentElement().$.scrollLeft:p-(n.$.scrollWidth-n.$.clientWidth))),(t=(n=d.getFirst()).getCustomData("activePanel"))&&t.onHide&&t.onHide.call(this,1),n.setCustomData("activePanel",this),d.setStyles({top:f+"px",left:p+"px"}),d.setOpacity(1),r&&r()},this);l.isLoaded?e():l.onLoad=e,CKEDITOR.tools.setTimeout(function(){var e=CKEDITOR.env.webkit&&CKEDITOR.document.getWindow().getScrollPosition().y;this.focus(),c.element.focus(),CKEDITOR.env.webkit&&(CKEDITOR.document.getBody().$.scrollTop=e),this.allowBlur(!0),CKEDITOR.env.ie?CKEDITOR.tools.setTimeout(function(){c.markFirstDisplayed?c.markFirstDisplayed():c._.markFirstDisplayed()},0):c.markFirstDisplayed?c.markFirstDisplayed():c._.markFirstDisplayed(),this._.editor.fire("panelShow",this)},0,this)},CKEDITOR.env.air?200:0,this),this.visible=1,this.onShow&&this.onShow.call(this)},reposition:function(){var e=this._.showBlockParams;this.visible&&this._.showBlockParams&&(this.hide(),this.showBlock.apply(this,e))},focus:function(){if(CKEDITOR.env.webkit){var e=CKEDITOR.document.getActive();e&&!e.equals(this._.iframe)&&e.$.blur()}(this._.lastFocused||this._.iframe.getFrameDocument().getWindow()).focus()},blur:function(){var e=this._.iframe.getFrameDocument().getActive();e&&e.is("a")&&(this._.lastFocused=e)},hide:function(e){!this.visible||this.onHide&&!0===this.onHide.call(this)||(this.hideChild(),CKEDITOR.env.gecko&&this._.iframe.getFrameDocument().$.activeElement.blur(),this.element.setStyle("display","none"),this.visible=0,this.element.getFirst().removeCustomData("activePanel"),(e=e&&this._.returnFocus)&&(CKEDITOR.env.webkit&&e.type&&e.getWindow().$.focus(),e.focus()),delete this._.lastFocused,this._.showBlockParams=null,this._.editor.fire("panelHide",this))},allowBlur:function(e){var t=this._.panel;return void 0!==e&&(t.allowBlur=e),t.allowBlur},showAsChild:function(e,t,n,i,a,s){this._.activeChild==e&&e._.panel._.offsetParentId==n.getId()||(this.hideChild(),e.onHide=CKEDITOR.tools.bind(function(){CKEDITOR.tools.setTimeout(function(){this._.focused||this.hide()},0,this)},this),this._.activeChild=e,this._.focused=!1,e.showBlock(t,n,i,a,s),this.blur(),(CKEDITOR.env.ie7Compat||CKEDITOR.env.ie6Compat)&&setTimeout(function(){e.element.getChild(0).$.style.cssText+=""},100))},hideChild:function(e){var t=this._.activeChild;t&&(delete t.onHide,delete this._.activeChild,t.hide(),e&&this.focus())}}}),CKEDITOR.on("instanceDestroyed",function(){var e,t=CKEDITOR.tools.isEmpty(CKEDITOR.instances);for(e in o){var n=o[e];t?n.destroy():n.element.hide()}t&&(o={})})}(),CKEDITOR.plugins.add("colorbutton",{requires:"panelbutton,floatpanel",init:function(h){function e(e,s,t,n,i){var o,a=new CKEDITOR.style(f["colorButton_"+s+"Style"]),r=CKEDITOR.tools.getNextId()+"_colorBox";i=i||{},h.ui.add(e,CKEDITOR.UI_PANELBUTTON,{label:t,title:t,modes:{wysiwyg:1},editorFocus:0,toolbar:"colors,"+n,allowedContent:a,requiredContent:a,contentTransformations:i.contentTransformations,panel:{css:CKEDITOR.skin.getPath("editor"),attributes:{role:"listbox","aria-label":m.panelTitle}},onBlock:function(e,t){(o=t).autoSize=!0,t.element.addClass("cke_colorblock"),t.element.setHtml(l(e,s,r)),t.element.getDocument().getBody().setStyle("overflow","hidden"),CKEDITOR.ui.fire("ready",this);var n=t.keys,i="rtl"==h.lang.dir;n[i?37:39]="next",n[40]="next",n[9]="next",n[i?39:37]="prev",n[38]="prev",n[CKEDITOR.SHIFT+9]="prev",n[32]="click"},refresh:function(){h.activeFilter.check(a)||this.setState(CKEDITOR.TRISTATE_DISABLED)},onOpen:function(){var e=(n=h.getSelection())&&n.getStartElement(),t=h.elementPath(e);if(t){for(e=t.block||t.blockLimit||h.document.getBody();t=e&&e.getComputedStyle("back"==s?"background-color":"color")||"transparent","back"==s&&"transparent"==t&&e&&(e=e.getParent()););if(t&&"transparent"!=t||(t="#ffffff"),!1!==f.colorButton_enableAutomatic&&this._.panel._.iframe.getFrameDocument().getById(r).setStyle("background-color",t),e=n&&n.getRanges()[0]){var n=new CKEDITOR.dom.walker(e),i=e.collapsed?e.startContainer:n.next();for(e="";i;){if(i.type===CKEDITOR.NODE_TEXT&&(i=i.getParent()),i=c(i.getComputedStyle("back"==s?"background-color":"color")),(e=e||i)!==i){e="";break}i=n.next()}for(n=e,e=o._.getItems(),i=0;i<e.count();i++){var a=e.getItem(i);a.removeAttribute("aria-selected"),n&&n==c(a.getAttribute("data-value"))&&a.setAttribute("aria-selected",!0)}}return t}}})}function l(a,e,t){var n=[],i=f.colorButton_colors.split(","),s=f.colorButton_colorsPerRow||6,o=h.plugins.colordialog&&!1!==f.colorButton_enableMore,r=i.length+(o?2:1),l=CKEDITOR.tools.addFunction(function _(e,t){function n(e){this.removeListener("ok",n),this.removeListener("cancel",n),"ok"==e.name&&_(this.getContentElement("picker","selectedColor").getValue(),t)}if("?"==e)h.openDialog("colordialog",function(){this.on("ok",n),this.on("cancel",n)});else{if(h.focus(),a.hide(),h.fire("saveSnapshot"),h.removeStyle(new CKEDITOR.style(f["colorButton_"+t+"Style"],{color:"inherit"})),e){var i=f["colorButton_"+t+"Style"];i.childRule="back"==t?function(e){return p(e)}:function(e){return!(e.is("a")||e.getElementsByTag("a").count())||p(e)},h.applyStyle(new CKEDITOR.style(i,{color:e}))}h.fire("saveSnapshot")}});for(!1!==f.colorButton_enableAutomatic&&n.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',m.auto,'" onclick="CKEDITOR.tools.callFunction(',l,",null,'",e,"');return false;\" href=\"javascript:void('",m.auto,'\')" role="option" aria-posinset="1" aria-setsize="',r,'"><table role="presentation" cellspacing=0 cellpadding=0 width="100%"><tr><td colspan="'+s+'" align="center"><span class="cke_colorbox" id="',t,'"></span>',m.auto,"</td></tr></table></a>"),n.push('<table role="presentation" cellspacing=0 cellpadding=0 width="100%">'),t=0;t<i.length;t++){0==t%s&&n.push("</tr><tr>");var c=i[t].split("/"),d=c[0],u=c[1]||d;c[1]||(d="#"+d.replace(/^(.)(.)(.)$/,"$1$1$2$2$3$3")),c=h.lang.colorbutton.colors[u]||u,n.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',c,'" onclick="CKEDITOR.tools.callFunction(',l,",'",d,"','",e,"'); return false;\" href=\"javascript:void('",c,'\')" data-value="'+u+'" role="option" aria-posinset="',t+2,'" aria-setsize="',r,'"><span class="cke_colorbox" style="background-color:#',u,'"></span></a></td>')}return o&&n.push('</tr><tr><td colspan="'+s+'" align="center"><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',m.more,'" onclick="CKEDITOR.tools.callFunction(',l,",'?','",e,"');return false;\" href=\"javascript:void('",m.more,"')\"",' role="option" aria-posinset="',r,'" aria-setsize="',r,'">',m.more,"</a></td>"),n.push("</tr></table>"),n.join("")}function p(e){return"false"==e.getAttribute("contentEditable")||e.getAttribute("data-nostyle")}function c(e){return CKEDITOR.tools.convertRgbToHex(e||"").replace(/#/,"").toLowerCase()}var f=h.config,m=h.lang.colorbutton;if(!CKEDITOR.env.hc){e("TextColor","fore",m.textColorTitle,10,{contentTransformations:[[{element:"font",check:"span{color}",left:function(e){return!!e.attributes.color},right:function(e){e.name="span",e.attributes.color&&(e.styles.color=e.attributes.color),delete e.attributes.color}}]]});var t={},n=h.config.colorButton_normalizeBackground;(void 0===n||n)&&(t.contentTransformations=[[{element:"span",left:function(e){var t=CKEDITOR.tools;return!("span"!=e.name||!e.styles||!e.styles.background)&&((e=t.style.parse.background(e.styles.background)).color&&1===t.objectKeys(e).length)},right:function(e){var t=new CKEDITOR.style(h.config.colorButton_backStyle,{color:e.styles.background}).getDefinition();return e.name=t.element,e.styles=t.styles,e.attributes=t.attributes||{},e}}]]),e("BGColor","back",m.bgColorTitle,20,t)}}}),CKEDITOR.config.colorButton_colors="1ABC9C,2ECC71,3498DB,9B59B6,4E5F70,F1C40F,16A085,27AE60,2980B9,8E44AD,2C3E50,F39C12,E67E22,E74C3C,ECF0F1,95A5A6,DDD,FFF,D35400,C0392B,BDC3C7,7F8C8D,999,000",CKEDITOR.config.colorButton_foreStyle={element:"span",styles:{color:"#(color)"},overrides:[{element:"font",attributes:{color:null}}]},CKEDITOR.config.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}},CKEDITOR.plugins.colordialog={requires:"dialog",init:function(e){var t=new CKEDITOR.dialogCommand("colordialog");t.editorFocus=!1,e.addCommand("colordialog",t),CKEDITOR.dialog.add("colordialog",this.path+"dialogs/colordialog.js"),e.getColorFromDialog=function(t,n){var i=function(e){this.removeListener("ok",i),this.removeListener("cancel",i),e="ok"==e.name?this.getValueOf("picker","selectedColor"):null,t.call(n,e)},a=function(e){e.on("ok",i),e.on("cancel",i)};e.execCommand("colordialog"),e._.storedDialogs&&e._.storedDialogs.colordialog?a(e._.storedDialogs.colordialog):CKEDITOR.on("dialogDefinition",function(e){if("colordialog"==e.data.name){var t=e.data.definition;e.removeListener(),t.onLoad=CKEDITOR.tools.override(t.onLoad,function(e){return function(){a(this),"function"==typeof(t.onLoad=e)&&e.call(this)}})}})}}},CKEDITOR.plugins.add("colordialog",CKEDITOR.plugins.colordialog),function(){CKEDITOR.plugins.add("templates",{requires:"dialog",init:function(e){CKEDITOR.dialog.add("templates",CKEDITOR.getUrl(this.path+"dialogs/templates.js")),e.addCommand("templates",new CKEDITOR.dialogCommand("templates")),e.ui.addButton&&e.ui.addButton("Templates",{label:e.lang.templates.button,command:"templates",toolbar:"doctools,10"})}});var n={},s={};CKEDITOR.addTemplates=function(e,t){n[e]=t},CKEDITOR.getTemplates=function(e){return n[e]},CKEDITOR.loadTemplates=function(e,t){for(var n=[],i=0,a=e.length;i<a;i++)s[e[i]]||(n.push(e[i]),s[e[i]]=1);n.length?CKEDITOR.scriptLoader.load(n,t):setTimeout(t,0)}}(),CKEDITOR.config.templates_files=[CKEDITOR.getUrl("plugins/templates/templates/default.js")],CKEDITOR.config.templates_replaceContent=!0,CKEDITOR.plugins.add("menu",{requires:"floatpanel",beforeInit:function(e){for(var t=e.config.menu_groups.split(","),n=e._.menuGroups={},i=e._.menuItems={},a=0;a<t.length;a++)n[t[a]]=a+1;e.addMenuGroup=function(e,t){n[e]=t||100},e.addMenuItem=function(e,t){n[t.group]&&(i[e]=new CKEDITOR.menuItem(this,e,t))},e.addMenuItems=function(e){for(var t in e)this.addMenuItem(t,e[t])},e.getMenuItem=function(e){return i[e]},e.removeMenuItem=function(e){delete i[e]}}}),function(){function h(e){e.sort(function(e,t){return e.group<t.group?-1:e.group>t.group?1:e.order<t.order?-1:e.order>t.order?1:0})}var e='<span class="cke_menuitem"><a id="{id}" class="cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href="{href}" title="{title}" tabindex="-1" _cke_focus=1 hidefocus="true" role="{role}" aria-label="{label}" aria-describedby="{id}_description" aria-haspopup="{hasPopup}" aria-disabled="{disabled}" {ariaChecked} draggable="false"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;" ondragstart="return false;"');e=e+' onmouseover="CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout="CKEDITOR.tools.callFunction({moveOutFn},{index});" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},{index}); return false;">';var p=CKEDITOR.addTemplate("menuItem",e+'<span class="cke_menubutton_inner"><span class="cke_menubutton_icon"><span class="cke_button_icon cke_button__{iconName}_icon" style="{iconStyle}"></span></span><span class="cke_menubutton_label">{label}</span>{shortcutHtml}{arrowHtml}</span></a><span id="{id}_description" class="cke_voice_label" aria-hidden="false">{ariaShortcut}</span></span>'),f=CKEDITOR.addTemplate("menuArrow",'<span class="cke_menuarrow"><span>{label}</span></span>'),m=CKEDITOR.addTemplate("menuShortcut",'<span class="cke_menubutton_label cke_menubutton_shortcut">{shortcut}</span>');CKEDITOR.menu=CKEDITOR.tools.createClass({$:function(e,t){t=this._.definition=t||{},this.id=CKEDITOR.tools.getNextId(),this.editor=e,this.items=[],this._.listeners=[],this._.level=t.level||1;var n=CKEDITOR.tools.extend({},t.panel,{css:[CKEDITOR.skin.getPath("editor")],level:this._.level-1,block:{}}),i=n.block.attributes=n.attributes||{};!i.role&&(i.role="menu"),this._.panelDefinition=n},_:{onShow:function(){var e=this.editor.getSelection(),t=e&&e.getStartElement(),n=this.editor.elementPath(),i=this._.listeners;this.removeAll();for(var a=0;a<i.length;a++){var s=i[a](t,e,n);if(s)for(var o in s){var r=this.editor.getMenuItem(o);!r||r.command&&!this.editor.getCommand(r.command).state||(r.state=s[o],this.add(r))}}},onClick:function(e){this.hide(),e.onClick?e.onClick():e.command&&this.editor.execCommand(e.command)},onEscape:function(e){var t=this.parent;return t?t._.panel.hideChild(1):27==e&&this.hide(1),!1},onHide:function(){this.onHide&&this.onHide()},showSubMenu:function(e){var t=this._.subMenu,n=this.items[e];if(n=n.getItems&&n.getItems()){for(var i in t?t.removeAll():((t=this._.subMenu=new CKEDITOR.menu(this.editor,CKEDITOR.tools.extend({},this._.definition,{level:this._.level+1},!0))).parent=this,t._.onClick=CKEDITOR.tools.bind(this._.onClick,this)),n){var a=this.editor.getMenuItem(i);a&&(a.state=n[i],t.add(a))}var s=this._.panel.getBlock(this.id).element.getDocument().getById(this.id+String(e));setTimeout(function(){t.show(s,2)},0)}else this._.panel.hideChild(1)}},proto:{add:function(e){e.order||(e.order=this.items.length),this.items.push(e)},removeAll:function(){this.items=[]},show:function(e,t,n,i){if(this.parent||(this._.onShow(),this.items.length)){t=t||("rtl"==this.editor.lang.dir?2:1);var a=this.items,s=this.editor,o=this._.panel,r=this._.element;if(!o)(o=this._.panel=new CKEDITOR.ui.floatPanel(this.editor,CKEDITOR.document.getBody(),this._.panelDefinition,this._.level)).onEscape=CKEDITOR.tools.bind(function(e){if(!1===this._.onEscape(e))return!1},this),o.onShow=function(){o._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")},o.onHide=CKEDITOR.tools.bind(function(){this._.onHide&&this._.onHide()},this),(r=o.addBlock(this.id,this._.panelDefinition.block)).autoSize=!0,(l=r.keys)[40]="next",l[9]="next",l[38]="prev",l[CKEDITOR.SHIFT+9]="prev",l["rtl"==s.lang.dir?37:39]=CKEDITOR.env.ie?"mouseup":"click",l[32]=CKEDITOR.env.ie?"mouseup":"click",CKEDITOR.env.ie&&(l[13]="mouseup"),(l=(r=this._.element=r.element).getDocument()).getBody().setStyle("overflow","hidden"),l.getElementsByTag("html").getItem(0).setStyle("overflow","hidden"),this._.itemOverFn=CKEDITOR.tools.addFunction(function(e){clearTimeout(this._.showSubTimeout),this._.showSubTimeout=CKEDITOR.tools.setTimeout(this._.showSubMenu,s.config.menu_subMenuDelay||400,this,[e])},this),this._.itemOutFn=CKEDITOR.tools.addFunction(function(){clearTimeout(this._.showSubTimeout)},this),this._.itemClickFn=CKEDITOR.tools.addFunction(function(e){var t=this.items[e];t.state==CKEDITOR.TRISTATE_DISABLED?this.hide(1):t.getItems?this._.showSubMenu(e):this._.onClick(t)},this);h(a);for(var l=['<div class="cke_menu'+((l=s.elementPath())&&l.direction()!=s.lang.dir?" cke_mixed_dir_content":"")+'" role="presentation">'],c=a.length,d=c&&a[0].group,u=0;u<c;u++){var _=a[u];d!=_.group&&(l.push('<div class="cke_menuseparator" role="separator"></div>'),d=_.group),_.render(this,u,l)}l.push("</div>"),r.setHtml(l.join("")),CKEDITOR.ui.fire("ready",this),this.parent?this.parent._.panel.showAsChild(o,this.id,e,t,n,i):o.showBlock(this.id,e,t,n,i),s.fire("menuShow",[o])}},addListener:function(e){this._.listeners.push(e)},hide:function(e){this._.onHide&&this._.onHide(),this._.panel&&this._.panel.hide(e)}}}),CKEDITOR.menuItem=CKEDITOR.tools.createClass({$:function(e,t,n){CKEDITOR.tools.extend(this,n,{order:0,className:"cke_menubutton__"+t}),this.group=e._.menuGroups[this.group],this.editor=e,this.name=t},proto:{render:function(e,t,n){var i,a,s=e.id+String(t),o="undefined"==typeof this.state?CKEDITOR.TRISTATE_OFF:this.state,r="",l=this.editor,c=o==CKEDITOR.TRISTATE_ON?"on":o==CKEDITOR.TRISTATE_DISABLED?"disabled":"off";this.role in{menuitemcheckbox:1,menuitemradio:1}&&(r=' aria-checked="'+(o==CKEDITOR.TRISTATE_ON?"true":"false")+'"');var d=this.getItems,u="&#"+("rtl"==this.editor.lang.dir?"9668":"9658")+";",_=this.name;this.icon&&!/\./.test(this.icon)&&(_=this.icon),this.command&&(i=l.getCommand(this.command),(i=l.getCommandKeystroke(i))&&(a=CKEDITOR.tools.keystrokeToString(l.lang.common.keyboard,i))),e={id:s,name:this.name,iconName:_,label:this.label,cls:this.className||"",state:c,hasPopup:d?"true":"false",disabled:o==CKEDITOR.TRISTATE_DISABLED,title:this.label+(a?" ("+a.display+")":""),ariaShortcut:a?l.lang.common.keyboardShortcut+" "+a.aria:"",href:"javascript:void('"+(this.label||"").replace("'")+"')",hoverFn:e._.itemOverFn,moveOutFn:e._.itemOutFn,clickFn:e._.itemClickFn,index:t,iconStyle:CKEDITOR.skin.getIconStyle(_,"rtl"==this.editor.lang.dir,_==this.icon?null:this.icon,this.iconOffset),shortcutHtml:a?m.output({shortcut:a.display}):"",arrowHtml:d?f.output({label:u}):"",role:this.role?this.role:"menuitem",ariaChecked:r},p.output(e,n)}}})}(),CKEDITOR.config.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div",CKEDITOR.plugins.add("contextmenu",{requires:"menu",onLoad:function(){CKEDITOR.plugins.contextMenu=CKEDITOR.tools.createClass({base:CKEDITOR.menu,$:function(e){this.base.call(this,e,{panel:{className:"cke_menu_panel",attributes:{"aria-label":e.lang.contextmenu.options}}})},proto:{addTarget:function(e,o){if(e.on("contextmenu",function(e){e=e.data;var t=CKEDITOR.env.webkit?r:CKEDITOR.env.mac?e.$.metaKey:e.$.ctrlKey;if(!o||!t){if(e.preventDefault(),CKEDITOR.env.mac&&CKEDITOR.env.webkit){t=this.editor;(n=new CKEDITOR.dom.elementPath(e.getTarget(),t.editable()).contains(function(e){return e.hasAttribute("contenteditable")},!0))&&"false"==n.getAttribute("contenteditable")&&t.getSelection().fake(n)}var n=e.getTarget().getDocument(),i=e.getTarget().getDocument().getDocumentElement(),a=(t=!n.equals(CKEDITOR.document),n=n.getWindow().getScrollPosition(),t?e.$.clientX:e.$.pageX||n.x+e.$.clientX),s=t?e.$.clientY:e.$.pageY||n.y+e.$.clientY;CKEDITOR.tools.setTimeout(function(){this.open(i,null,a,s)},CKEDITOR.env.ie?200:0,this)}},this),CKEDITOR.env.webkit){var r,t=function(){r=0};e.on("keydown",function(e){r=CKEDITOR.env.mac?e.data.$.metaKey:e.data.$.ctrlKey}),e.on("keyup",t),e.on("contextmenu",t)}},open:function(e,t,n,i){!1!==this.editor.config.enableContextMenu&&(this.editor.focus(),e=e||CKEDITOR.document.getDocumentElement(),this.editor.selectionChange(1),this.show(e,t,n,i))}}})},beforeInit:function(e){var t=e.contextMenu=new CKEDITOR.plugins.contextMenu(e);e.on("contentDom",function(){t.addTarget(e.editable(),!1!==e.config.browserContextMenuOnCtrl)}),e.addCommand("contextMenu",{exec:function(){e.contextMenu.open(e.document.getBody())}}),e.setKeystroke(CKEDITOR.SHIFT+121,"contextMenu"),e.setKeystroke(CKEDITOR.CTRL+CKEDITOR.SHIFT+121,"contextMenu")}}),function(){function i(e){var t=(e=e.data)&&e.$;return!(!e||!t)&&(CKEDITOR.env.ie&&CKEDITOR.env.version<9?1===t.button:0===t.button)}function r(e,t,n,i){var a=new CKEDITOR.dom.walker(e);if(!(e=e.startContainer.getAscendant(t,!0)||e.endContainer.getAscendant(t,!0))||(n(e),!i))for(;(e=a.next())&&(!(e=e.getAscendant(t,!0))||(n(e),!i)););}function l(t,e){var n={ul:"ol",ol:"ul"};return-1!==_(e,function(e){return e.element===t||e.element===n[t]})}function e(e){this.styles=null,this.sticky=!1,this.editor=e,this.filter=new CKEDITOR.filter(e.config.copyFormatting_allowRules),!0===e.config.copyFormatting_allowRules&&(this.filter.disabled=!0),e.config.copyFormatting_disallowRules&&this.filter.disallow(e.config.copyFormatting_disallowRules)}var _=CKEDITOR.tools.indexOf,t=!1;CKEDITOR.plugins.add("copyformatting",{lang:"az,de,en,it,ja,nb,nl,oc,pl,pt-br,ru,sv,tr,zh,zh-cn",icons:"copyformatting",hidpi:!0,init:function(o){var r=CKEDITOR.plugins.copyformatting;r._addScreenReaderContainer(),t||(CKEDITOR.document.appendStyleSheet(this.path+"styles/copyformatting.css"),t=!0),o.addContentsCss&&o.addContentsCss(this.path+"styles/copyformatting.css"),o.copyFormatting=new r.state(o),o.addCommand("copyFormatting",r.commands.copyFormatting),o.addCommand("applyFormatting",r.commands.applyFormatting),o.ui.addButton("CopyFormatting",{label:o.lang.copyformatting.label,command:"copyFormatting",toolbar:"cleanup,0"}),o.on("contentDom",function(){var n=o.editable(),e=n.isInline()?n:o.document,t=o.ui.get("CopyFormatting");n.attachListener(e,"mouseup",function(e){i(e)&&o.execCommand("applyFormatting")}),n.attachListener(CKEDITOR.document,"mouseup",function(e){var t=o.getCommand("copyFormatting");i(e)&&t.state===CKEDITOR.TRISTATE_ON&&!n.contains(e.data.getTarget())&&o.execCommand("copyFormatting")}),t&&(e=CKEDITOR.document.getById(t._.id),n.attachListener(e,"dblclick",function(){o.execCommand("copyFormatting",{sticky:!0})}),n.attachListener(e,"mouseup",function(e){e.data.stopPropagation()}))}),o.config.copyFormatting_keystrokeCopy&&o.setKeystroke(o.config.copyFormatting_keystrokeCopy,"copyFormatting"),o.on("key",function(e){var t=o.getCommand("copyFormatting");(e=e.data.domEvent).getKeystroke&&27===e.getKeystroke()&&t.state===CKEDITOR.TRISTATE_ON&&o.execCommand("copyFormatting")}),o.copyFormatting.on("extractFormatting",function(e){var t=e.data.element;return t.contains(o.editable())||t.equals(o.editable())?e.cancel():(t=r._convertElementToStyleDef(t),o.copyFormatting.filter.check(new CKEDITOR.style(t),!0,!0)?void(e.data.styleDef=t):e.cancel())}),o.copyFormatting.on("applyFormatting",function(e){if(!e.data.preventFormatStripping){var t,n,i=e.data.range,a=r._extractStylesFromRange(o,i),s=r._determineContext(i);if(o.copyFormatting._isContextAllowed(s))for(n=0;n<a.length;n++)s=a[n],t=i.createBookmark(),-1===_(r.preservedElements,s.element)?CKEDITOR.env.webkit&&!CKEDITOR.env.chrome?a[n].removeFromRange(e.data.range,e.editor):a[n].remove(e.editor):l(s.element,e.data.styles)&&r._removeStylesFromElementInRange(i,s.element),i.moveToBookmark(t)}}),o.copyFormatting.on("applyFormatting",function(e){var t=CKEDITOR.plugins.copyformatting,n=t._determineContext(e.data.range);"list"===n&&o.copyFormatting._isContextAllowed("list")?t._applyStylesToListContext(e.editor,e.data.range,e.data.styles):"table"===n&&o.copyFormatting._isContextAllowed("table")?t._applyStylesToTableContext(e.editor,e.data.range,e.data.styles):o.copyFormatting._isContextAllowed("text")&&t._applyStylesToTextContext(e.editor,e.data.range,e.data.styles)},null,null,999)}}),e.prototype._isContextAllowed=function(e){var t=this.editor.config.copyFormatting_allowedContexts;return!0===t||-1!==_(t,e)},CKEDITOR.event.implementOn(e.prototype),CKEDITOR.plugins.copyformatting={state:e,inlineBoundary:"h1 h2 h3 h4 h5 h6 p div".split(" "),excludedAttributes:["id","style","href","data-cke-saved-href","dir"],elementsForInlineTransform:["li"],excludedElementsFromInlineTransform:["table","thead","tbody","ul","ol"],excludedAttributesFromInlineTransform:["value","type"],preservedElements:"ul ol li td th tr thead tbody table".split(" "),breakOnElements:["ul","ol","table"],_initialKeystrokePasteCommand:null,commands:{copyFormatting:{exec:function(e,t){var n=CKEDITOR.plugins.copyformatting,i=e.copyFormatting,a=!!t&&"keystrokeHandler"==t.from,s=!!t&&(t.sticky||a),o=n._getCursorContainer(e),r=CKEDITOR.document.getDocumentElement();if(this.state===CKEDITOR.TRISTATE_ON)return i.styles=null,i.sticky=!1,o.removeClass("cke_copyformatting_active"),r.removeClass("cke_copyformatting_disabled"),r.removeClass("cke_copyformatting_tableresize_cursor"),n._putScreenReaderMessage(e,"canceled"),n._detachPasteKeystrokeHandler(e),this.setState(CKEDITOR.TRISTATE_OFF);i.styles=n._extractStylesFromElement(e,e.elementPath().lastElement),this.setState(CKEDITOR.TRISTATE_ON),a||(o.addClass("cke_copyformatting_active"),r.addClass("cke_copyformatting_tableresize_cursor"),e.config.copyFormatting_outerCursor&&r.addClass("cke_copyformatting_disabled")),i.sticky=s,n._putScreenReaderMessage(e,"copied"),n._attachPasteKeystrokeHandler(e)}},applyFormatting:{editorFocus:!1,exec:function(e,t){var n=e.getCommand("copyFormatting"),i=!!t&&"keystrokeHandler"==t.from,a=CKEDITOR.plugins.copyformatting,s=e.copyFormatting,o=a._getCursorContainer(e),r=CKEDITOR.document.getDocumentElement();if(i||n.state===CKEDITOR.TRISTATE_ON){if(i&&!s.styles)return a._putScreenReaderMessage(e,"failed"),a._detachPasteKeystrokeHandler(e),!1;i=a._applyFormat(e,s.styles),s.sticky||(s.styles=null,o.removeClass("cke_copyformatting_active"),r.removeClass("cke_copyformatting_disabled"),r.removeClass("cke_copyformatting_tableresize_cursor"),n.setState(CKEDITOR.TRISTATE_OFF),a._detachPasteKeystrokeHandler(e)),a._putScreenReaderMessage(e,i?"applied":"canceled")}}}},_getCursorContainer:function(e){return e.elementMode===CKEDITOR.ELEMENT_MODE_INLINE?e.editable():e.editable().getParent()},_convertElementToStyleDef:function(e){var t=CKEDITOR.tools,n=e.getAttributes(CKEDITOR.plugins.copyformatting.excludedAttributes);t=t.parseCssText(e.getAttribute("style"),!0,!0);return{element:e.getName(),type:CKEDITOR.STYLE_INLINE,attributes:n,styles:t}},_extractStylesFromElement:function(e,t){var n={},i=[];do{if(t.type===CKEDITOR.NODE_ELEMENT&&!t.hasAttribute("data-cke-bookmark")&&(n.element=t,e.copyFormatting.fire("extractFormatting",n,e)&&n.styleDef&&i.push(new CKEDITOR.style(n.styleDef)),t.getName&&-1!==_(CKEDITOR.plugins.copyformatting.breakOnElements,t.getName())))break}while((t=t.getParent())&&t.type===CKEDITOR.NODE_ELEMENT);return i},_extractStylesFromRange:function(e,t){for(var n,i=[],a=new CKEDITOR.dom.walker(t);n=a.next();)i=i.concat(CKEDITOR.plugins.copyformatting._extractStylesFromElement(e,n));return i},_removeStylesFromElementInRange:function(e,t){for(var n,i=-1!==_(["ol","ul","table"],t),a=new CKEDITOR.dom.walker(e);(n=a.next())&&(!(n=n.getAscendant(t,!0))||(n.removeAttributes(n.getAttributes()),!i)););},_getSelectedWordOffset:function(e){function c(e,t){return e[t?"getPrevious":"getNext"](function(e){return e.type!==CKEDITOR.NODE_COMMENT})}function d(e){return e.type==CKEDITOR.NODE_ELEMENT?(e=e.getHtml().replace(/<span.*?>&nbsp;<\/span>/g,"")).replace(/<.*?>/g,""):e.getText()}function u(e,t){var n,i,a=e,s=/\s/g,o="p br ol ul li td th div caption body".split(" "),r=!1,l=!1;do{for(n=c(a,t);!n&&a.getParent();){if(a=a.getParent(),-1!==_(o,a.getName())){l=r=!0;break}n=c(a,t)}if(n&&n.getName&&-1!==_(o,n.getName())){r=!0;break}a=n}while(a&&a.getStyle&&("none"==a.getStyle("display")||!a.getText()));for(a||(a=e);a.type!==CKEDITOR.NODE_TEXT;)a=!r||t||l?a.getChild(0):a.getChild(a.getChildCount()-1);for(o=d(a);null!=(l=s.exec(o))&&(i=l.index,t););if("number"!=typeof i&&!r)return u(a,t);if(r)t?i=0:i=(l=(s=/([\.\b]*$)/).exec(o))?l.index:o.length;else if(t&&(i+=1)>o.length)return u(a);return{node:a,offset:i}}var t,n,i,a,s,o=/\b\w+\b/gi;for(t=d(i=a=s=e.startContainer);null!=(n=o.exec(t));)if(n.index+n[0].length>=e.startOffset)return e=n.index,o=n.index+n[0].length,0===n.index&&(a=(n=u(i,!0)).node,e=n.offset),o>=t.length&&(s=(t=u(i)).node,o=t.offset),{startNode:a,startOffset:e,endNode:s,endOffset:o};return null},_filterStyles:function(e){var t,n,i=CKEDITOR.tools.isEmpty,a=[];for(n=0;n<e.length;n++)t=e[n]._.definition,-1!==CKEDITOR.tools.indexOf(CKEDITOR.plugins.copyformatting.inlineBoundary,t.element)&&(t.element=e[n].element="span"),"span"===t.element&&i(t.attributes)&&i(t.styles)||a.push(e[n]);return a},_determineContext:function(i){function e(e){var t,n=new CKEDITOR.dom.walker(i);if(i.startContainer.getAscendant(e,!0)||i.endContainer.getAscendant(e,!0))return!0;for(
;t=n.next();)if(t.getAscendant(e,!0))return!0}return e({ul:1,ol:1})?"list":e("table")?"table":"text"},_applyStylesToTextContext:function(e,t,n){var i,a,s=CKEDITOR.plugins.copyformatting,o=s.excludedAttributesFromInlineTransform;for(CKEDITOR.env.webkit&&!CKEDITOR.env.chrome&&e.getSelection().selectRanges([t]),i=0;i<n.length;i++)if(t=n[i],-1===_(s.excludedElementsFromInlineTransform,t.element)){if(-1!==_(s.elementsForInlineTransform,t.element))for(t.element=t._.definition.element="span",a=0;a<o.length;a++)t._.definition.attributes[o[a]]&&delete t._.definition.attributes[o[a]];t.apply(e)}},_applyStylesToListContext:function(e,t,n){var i,a,s;for(s=0;s<n.length;s++)i=n[s],a=t.createBookmark(),"ol"===i.element||"ul"===i.element?r(t,{ul:1,ol:1},function(e){var t=i;e.getName()!==t.element&&e.renameNode(t.element),t.applyToObject(e)},!0):"li"===i.element?r(t,"li",function(e){i.applyToObject(e)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,t,[i]),t.moveToBookmark(a)},_applyStylesToTableContext:function(e,t,n){function i(e,t){e.getName()!==t.element&&((t=t.getDefinition()).element=e.getName(),t=new CKEDITOR.style(t)),t.applyToObject(e)}var a,s,o;for(o=0;o<n.length;o++)a=n[o],s=t.createBookmark(),-1!==_(["table","tr"],a.element)?r(t,a.element,function(e){a.applyToObject(e)}):-1!==_(["td","th"],a.element)?r(t,{td:1,th:1},function(e){i(e,a)}):-1!==_(["thead","tbody"],a.element)?r(t,{thead:1,tbody:1},function(e){i(e,a)}):CKEDITOR.plugins.copyformatting._applyStylesToTextContext(e,t,[a]),t.moveToBookmark(s)},_applyFormat:function(e,t){var n,i,a=e.getSelection().getRanges()[0],s=CKEDITOR.plugins.copyformatting;if(!a)return!1;if(a.collapsed){if(i=e.getSelection().createBookmarks(),!(n=s._getSelectedWordOffset(a)))return;(a=e.createRange()).setStart(n.startNode,n.startOffset),a.setEnd(n.endNode,n.endOffset),a.select()}return t=s._filterStyles(t),!!e.copyFormatting.fire("applyFormatting",{styles:t,range:a,preventFormatStripping:!1},e)&&(i&&e.getSelection().selectBookmarks(i),!0)},_putScreenReaderMessage:function(e,t){var n=this._getScreenReaderContainer();n&&n.setText(e.lang.copyformatting.notification[t])},_addScreenReaderContainer:function(){return this._getScreenReaderContainer()?this._getScreenReaderContainer():CKEDITOR.env.ie6Compat||CKEDITOR.env.ie7Compat?void 0:CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml('<div class="cke_screen_reader_only cke_copyformatting_notification"><div aria-live="polite"></div></div>')).getChild(0)},_getScreenReaderContainer:function(){if(!CKEDITOR.env.ie6Compat&&!CKEDITOR.env.ie7Compat)return CKEDITOR.document.getBody().findOne(".cke_copyformatting_notification div[aria-live]")},_attachPasteKeystrokeHandler:function(e){var t=e.config.copyFormatting_keystrokePaste;t&&(this._initialKeystrokePasteCommand=e.keystrokeHandler.keystrokes[t],e.setKeystroke(t,"applyFormatting"))},_detachPasteKeystrokeHandler:function(e){var t=e.config.copyFormatting_keystrokePaste;t&&e.setKeystroke(t,this._initialKeystrokePasteCommand||!1)}},CKEDITOR.config.copyFormatting_outerCursor=!0,CKEDITOR.config.copyFormatting_allowRules="b s u i em strong span p div td th ol ul li(*)[*]{*}",CKEDITOR.config.copyFormatting_disallowRules="*[data-cke-widget*,data-widget*,data-cke-realelement](cke_widget*)",CKEDITOR.config.copyFormatting_allowedContexts=!0,CKEDITOR.config.copyFormatting_keystrokeCopy=CKEDITOR.CTRL+CKEDITOR.SHIFT+67,CKEDITOR.config.copyFormatting_keystrokePaste=CKEDITOR.CTRL+CKEDITOR.SHIFT+86}(),CKEDITOR.plugins.add("div",{requires:"dialog",init:function(t){if(!t.blockless){var e=t.lang.div,n="div(*)";CKEDITOR.dialog.isTabEnabled(t,"editdiv","advanced")&&(n+=";div[dir,id,lang,title]{*}"),t.addCommand("creatediv",new CKEDITOR.dialogCommand("creatediv",{allowedContent:n,requiredContent:"div",contextSensitive:!0,contentTransformations:[["div: alignmentToStyle"]],refresh:function(e,t){this.setState("div"in(e.config.div_wrapTable?t.root:t.blockLimit).getDtd()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})),t.addCommand("editdiv",new CKEDITOR.dialogCommand("editdiv",{requiredContent:"div"})),t.addCommand("removediv",{requiredContent:"div",exec:function(t){function e(e){(e=CKEDITOR.plugins.div.getSurroundDiv(t,e))&&!e.data("cke-div-added")&&(o.push(e),e.data("cke-div-added"))}for(var n,i=t.getSelection(),a=i&&i.getRanges(),s=i.createBookmarks(),o=[],r=0;r<a.length;r++)(n=a[r]).collapsed?e(i.getStartElement()):((n=new CKEDITOR.dom.walker(n)).evaluator=e,n.lastForward());for(r=0;r<o.length;r++)o[r].remove(!0);i.selectBookmarks(s)}}),t.ui.addButton&&t.ui.addButton("CreateDiv",{label:e.toolbar,command:"creatediv",toolbar:"blocks,50"}),t.addMenuItems&&(t.addMenuItems({editdiv:{label:e.edit,command:"editdiv",group:"div",order:1},removediv:{label:e.remove,command:"removediv",group:"div",order:5}}),t.contextMenu&&t.contextMenu.addListener(function(e){return!e||e.isReadOnly()?null:CKEDITOR.plugins.div.getSurroundDiv(t)?{editdiv:CKEDITOR.TRISTATE_OFF,removediv:CKEDITOR.TRISTATE_OFF}:null})),CKEDITOR.dialog.add("creatediv",this.path+"dialogs/div.js"),CKEDITOR.dialog.add("editdiv",this.path+"dialogs/div.js")}}}),CKEDITOR.plugins.div={getSurroundDiv:function(e,t){var n=e.elementPath(t);return e.elementPath(n.blockLimit).contains(function(e){return e.is("div")&&!e.isReadOnly()},1)}},CKEDITOR.plugins.add("resize",{init:function(a){function t(e){var t=l.width,n=l.height,i=t+(e.data.$.screenX-r.x)*("rtl"==o?-1:1);e=n+(e.data.$.screenY-r.y),d&&(t=Math.max(s.resize_minWidth,Math.min(i,s.resize_maxWidth))),u&&(n=Math.max(s.resize_minHeight,Math.min(e,s.resize_maxHeight))),a.resize(d?t:null,n)}function n(){CKEDITOR.document.removeListener("mousemove",t),CKEDITOR.document.removeListener("mouseup",n),a.document&&(a.document.removeListener("mousemove",t),a.document.removeListener("mouseup",n))}var s=a.config,i=a.ui.spaceId("resizer"),o=a.element?a.element.getDirection(1):"ltr";if(!s.resize_dir&&(s.resize_dir="vertical"),void 0===s.resize_maxWidth&&(s.resize_maxWidth=3e3),void 0===s.resize_maxHeight&&(s.resize_maxHeight=3e3),void 0===s.resize_minWidth&&(s.resize_minWidth=750),void 0===s.resize_minHeight&&(s.resize_minHeight=250),!1!==s.resize_enabled){var r,l,c=null,d=("both"==s.resize_dir||"horizontal"==s.resize_dir)&&s.resize_minWidth!=s.resize_maxWidth,u=("both"==s.resize_dir||"vertical"==s.resize_dir)&&s.resize_minHeight!=s.resize_maxHeight,_=CKEDITOR.tools.addFunction(function(e){c||(c=a.getResizable()),l={width:c.$.offsetWidth||0,height:c.$.offsetHeight||0},r={x:e.screenX,y:e.screenY},s.resize_minWidth>l.width&&(s.resize_minWidth=l.width),s.resize_minHeight>l.height&&(s.resize_minHeight=l.height),CKEDITOR.document.on("mousemove",t),CKEDITOR.document.on("mouseup",n),a.document&&(a.document.on("mousemove",t),a.document.on("mouseup",n)),e.preventDefault&&e.preventDefault()});a.on("destroy",function(){CKEDITOR.tools.removeFunction(_)}),a.on("uiSpace",function(e){if("bottom"==e.data.space){var t="";d&&!u&&(t=" cke_resizer_horizontal"),!d&&u&&(t=" cke_resizer_vertical");var n='<span id="'+i+'" class="cke_resizer'+t+" cke_resizer_"+o+'" title="'+CKEDITOR.tools.htmlEncode(a.lang.common.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+_+', event)">'+("ltr"==o?"\u25e2":"\u25e3")+"</span>";"ltr"==o&&"ltr"==t?e.data.html+=n:e.data.html=n+e.data.html}},a,null,100),a.on("maximize",function(e){a.ui.space("resizer")[e.data==CKEDITOR.TRISTATE_ON?"hide":"show"]()})}}}),function(){function n(_,e){function a(e){var t;(e=f.list[e]).equals(_.editable())||"true"==e.getAttribute("contenteditable")?((t=_.createRange()).selectNodeContents(e),t=t.select()):(t=_.getSelection()).selectElement(e),CKEDITOR.env.ie&&_.fire("selectionChange",{selection:t,path:new CKEDITOR.dom.elementPath(e)}),_.focus()}function t(){h&&h.setHtml('<span class="cke_path_empty">&nbsp;</span>'),delete f.list}var h,p=_.ui.spaceId("path"),f=_._.elementsPath,m=f.idBase;e.html+='<span id="'+p+'_label" class="cke_voice_label">'+_.lang.elementspath.eleLabel+'</span><span id="'+p+'" class="cke_path" role="group" aria-labelledby="'+p+'_label"><span class="cke_path_empty">&nbsp;</span></span>',_.on("uiReady",function(){var e=_.ui.space("path");e&&_.focusManager.add(e,1)}),f.onClick=a;var g=CKEDITOR.tools.addFunction(a),A=CKEDITOR.tools.addFunction(function(e,t){var n,i=f.idBase;switch(t=new CKEDITOR.dom.event(t),n="rtl"==_.lang.dir,t.getKeystroke()){case n?39:37:case 9:return(n=CKEDITOR.document.getById(i+(e+1)))||(n=CKEDITOR.document.getById(i+"0")),n.focus(),!1;case n?37:39:case CKEDITOR.SHIFT+9:return(n=CKEDITOR.document.getById(i+(e-1)))||(n=CKEDITOR.document.getById(i+(f.list.length-1))),n.focus(),!1;case 27:return _.focus(),!1;case 13:case 32:return a(e),!1}return!0});_.on("selectionChange",function(){for(var e,t=[],n=f.list=[],i=[],a=f.filters,s=!0,o=_.elementPath().elements,r=o.length;r--;){var l=o[r],c=0;e=l.data("cke-display-name")?l.data("cke-display-name"):l.data("cke-real-element-type")?l.data("cke-real-element-type"):l.getName(),(s=l.hasAttribute("contenteditable")?"true"==l.getAttribute("contenteditable"):s)||l.hasAttribute("contenteditable")||(c=1);for(var d=0;d<a.length;d++){var u=a[d](l,e);if(!1===u){c=1;break}e=u||e}c||(n.unshift(l),i.unshift(e))}for(n=n.length,a=0;a<n;a++)e=i[a],s=_.lang.elementspath.eleTitle.replace(/%1/,e),e=v.output({id:m+a,label:s,text:e,jsTitle:"javascript:void('"+e+"')",index:a,keyDownFn:A,clickFn:g}),t.unshift(e);h||(h=CKEDITOR.document.getById(p)),(i=h).setHtml(t.join("")+'<span class="cke_path_empty">&nbsp;</span>'),_.fire("elementsPathUpdate",{space:i})}),_.on("readOnly",t),_.on("contentDomUnload",t),_.addCommand("elementsPathFocus",i.toolbarFocus),_.setKeystroke(CKEDITOR.ALT+122,"elementsPathFocus")}var i={toolbarFocus:{editorFocus:!1,readOnly:1,exec:function(e){(e=CKEDITOR.document.getById(e._.elementsPath.idBase+"0"))&&e.focus(CKEDITOR.env.ie||CKEDITOR.env.air)}}},e="";CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;"');var v=CKEDITOR.addTemplate("pathItem",'<a id="{id}" href="{jsTitle}" tabindex="-1" class="cke_path_item" title="{label}"'+e+' hidefocus="true"  onkeydown="return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick="CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role="button" aria-label="{label}">{text}</a>');CKEDITOR.plugins.add("elementspath",{init:function(t){t._.elementsPath={idBase:"cke_elementspath_"+CKEDITOR.tools.getNextNumber()+"_",filters:[]},t.on("uiSpace",function(e){"bottom"==e.data.space&&n(t,e.data)})}})}(),function(){function t(e,t,n){if(n=e.config.forceEnterMode||n,"wysiwyg"==e.mode){t||(t=e.activeEnterMode);var i=e.elementPath();i&&!i.isContextFor("p")&&(t=CKEDITOR.ENTER_BR,n=1),e.fire("saveSnapshot"),t==CKEDITOR.ENTER_BR?v(e,t,null,n):c(e,t,null,n),e.fire("saveSnapshot")}}function f(e){for(var t=(e=e.getSelection().getRanges(!0)).length-1;0<t;t--)e[t].deleteContents();return e[0]}function m(e){var t=e.startContainer.getAscendant(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&"true"==e.getAttribute("contenteditable")},!0);return e.root.equals(t)?e:((t=new CKEDITOR.dom.range(t)).moveToRange(e),t)}CKEDITOR.plugins.add("enterkey",{init:function(e){e.addCommand("enter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(e){t(e)}}),e.addCommand("shiftEnter",{modes:{wysiwyg:1},editorFocus:!1,exec:function(e){t(e,e.activeShiftEnterMode,1)}}),e.setKeystroke([[13,"enter"],[CKEDITOR.SHIFT+13,"shiftEnter"]])}});var g=CKEDITOR.dom.walker.whitespaces(),A=CKEDITOR.dom.walker.bookmark();CKEDITOR.plugins.enterkey={enterBlock:function(e,t,n,i){if(n=n||f(e)){var a,s=(n=m(n)).document,o=n.checkStartOfBlock(),r=n.checkEndOfBlock(),l=e.elementPath(n.startContainer),c=l.block,d=t==CKEDITOR.ENTER_DIV?"div":"p";if(o&&r){if(c&&(c.is("li")||c.getParent().is("li"))){c.is("li")||(c=c.getParent()),a=(n=c.getParent()).getParent(),i=!c.hasPrevious();var u=!c.hasNext(),_=(d=e.getSelection()).createBookmarks(),h=(o=c.getDirection(1),r=c.getAttribute("class"),c.getAttribute("style")),p=a.getDirection(1)!=o;if(e=e.enterMode!=CKEDITOR.ENTER_BR||p||h||r,a.is("li"))i||u?(i&&u&&n.remove(),c[u?"insertAfter":"insertBefore"](a)):c.breakParent(a);else{if(e)l.block.is("li")?(a=s.createElement(t==CKEDITOR.ENTER_P?"p":"div"),p&&a.setAttribute("dir",o),h&&a.setAttribute("style",h),r&&a.setAttribute("class",r),c.moveChildren(a)):a=l.block,i||u?a[i?"insertBefore":"insertAfter"](n):(c.breakParent(n),a.insertAfter(n));else if(c.appendBogus(!0),i||u)for(;s=c[i?"getFirst":"getLast"]();)s[i?"insertBefore":"insertAfter"](n);else for(c.breakParent(n);s=c.getLast();)s.insertAfter(n);c.remove()}return void d.selectBookmarks(_)}if(c&&c.getParent().is("blockquote"))return c.breakParent(c.getParent()),c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1))||c.getPrevious().remove(),c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1))||c.getNext().remove(),n.moveToElementEditStart(c),void n.select()}else if(c&&c.is("pre")&&!r)return void v(e,t,n,i);if(o=n.splitBlock(d)){if(t=o.previousBlock,c=o.nextBlock,l=o.wasStartOfBlock,e=o.wasEndOfBlock,c?(_=c.getParent()).is("li")&&(c.breakParent(_),c.move(c.getNext(),1)):t&&(_=t.getParent())&&_.is("li")&&(t.breakParent(_),_=t.getNext(),n.moveToElementEditStart(_),t.move(t.getPrevious())),l||e){if(t?(t.is("li")||!b.test(t.getName())&&!t.is("pre"))&&(a=t.clone()):c&&(a=c.clone()),a?i&&!a.is("li")&&a.renameNode(d):_&&_.is("li")?a=_:(a=s.createElement(d),t&&(u=t.getDirection())&&a.setAttribute("dir",u)),s=o.elementPath)for(i=0,d=s.elements.length;i<d&&(!(_=s.elements[i]).equals(s.block)&&!_.equals(s.blockLimit));i++)CKEDITOR.dtd.$removeEmpty[_.getName()]&&(_=_.clone(),a.moveChildren(_),a.append(_));a.appendBogus(),a.getParent()||n.insertNode(a),a.is("li")&&a.removeAttribute("value"),!CKEDITOR.env.ie||!l||e&&t.getChildCount()||(n.moveToElementEditStart(e?t:a),n.select()),n.moveToElementEditStart(l&&!e?c:a)}else c.is("li")&&((a=n.clone()).selectNodeContents(c),(a=new CKEDITOR.dom.walker(a)).evaluator=function(e){return!(A(e)||g(e)||e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in CKEDITOR.dtd.$inline&&!(e.getName()in CKEDITOR.dtd.$empty))},(_=a.next())&&_.type==CKEDITOR.NODE_ELEMENT&&_.is("ul","ol")&&(CKEDITOR.env.needsBrFiller?s.createElement("br"):s.createText("\xa0")).insertBefore(_)),c&&n.moveToElementEditStart(c);n.select(),n.scrollIntoView()}}},enterBr:function(e,t,n,i){if(n=n||f(e)){var a=n.document,s=n.checkEndOfBlock(),o=new CKEDITOR.dom.elementPath(e.getSelection().getStartElement()),r=o.block,l=r&&o.block.getName();i||"li"!=l?(!i&&s&&b.test(l)?(s=r.getDirection())?((a=a.createElement("div")).setAttribute("dir",s),a.insertAfter(r),n.setStart(a,0)):(a.createElement("br").insertAfter(r),CKEDITOR.env.gecko&&a.createText("").insertAfter(r),n.setStartAt(r.getNext(),CKEDITOR.env.ie?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_START)):(e="pre"==l&&CKEDITOR.env.ie&&CKEDITOR.env.version<8?a.createText("\r"):a.createElement("br"),n.deleteContents(),n.insertNode(e),CKEDITOR.env.needsBrFiller?(a.createText("\ufeff").insertAfter(e),s&&(r||o.blockLimit).appendBogus(),e.getNext().$.nodeValue="",n.setStartAt(e.getNext(),CKEDITOR.POSITION_AFTER_START)):n.setStartAt(e,CKEDITOR.POSITION_AFTER_END)),n.collapse(!0),n.select(),n.scrollIntoView()):c(e,t,n,i)}}};var e=CKEDITOR.plugins.enterkey,v=e.enterBr,c=e.enterBlock,b=/^h[1-6]$/}(),function(){function c(e,i){var a={},s=[],o={nbsp:"\xa0",shy:"\xad",gt:">",lt:"<",amp:"&",apos:"'",quot:'"'};if(e=e.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g,function(e,t){var n=i?"&"+t+";":o[t];return a[n]=i?o[t]:"&"+t+";",s.push(n),""}),!i&&e){e=e.split(",");var t,n=document.createElement("div");for(n.innerHTML="&"+e.join(";&")+";",t=n.innerHTML,n=null,n=0;n<t.length;n++){var r=t.charAt(n);a[r]="&"+e[n]+";",s.push(r)}}return a.regex=s.join(i?"|":""),a}CKEDITOR.plugins.add("entities",{afterInit:function(e){function t(e){return r[e]}function n(e){return"force"!=i.entities_processNumerical&&s[e]?s[e]:"&#"+e.charCodeAt(0)+";"}var i=e.config;if(e=(e=e.dataProcessor)&&e.htmlFilter){var a=[];!1!==i.basicEntities&&a.push("nbsp,gt,lt,amp"),i.entities&&(a.length&&a.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"),i.entities_latin&&a.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"),i.entities_greek&&a.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"),i.entities_additional&&a.push(i.entities_additional));var s=c(a.join(",")),o=s.regex?"["+s.regex+"]":"a^";delete s.regex,i.entities&&i.entities_processNumerical&&(o="[^ -~]|"+o);o=new RegExp(o,"g");var r=c("nbsp,gt,lt,amp,shy",!0),l=new RegExp(r.regex,"g");e.addRules({text:function(e){return e.replace(l,t).replace(o,n)}},{applyToAll:!0,excludeNestedEditable:!0})}}})}(),CKEDITOR.config.basicEntities=!0,CKEDITOR.config.entities=!0,CKEDITOR.config.entities_latin=!0,CKEDITOR.config.entities_greek=!0,CKEDITOR.config.entities_additional="#39",CKEDITOR.plugins.add("popup"),CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{popup:function(e,t,n,i){n=n||"70%","string"==typeof(t=t||"80%")&&1<t.length&&"%"==t.substr(t.length-1,1)&&(t=parseInt(window.screen.width*parseInt(t,10)/100,10)),"string"==typeof n&&1<n.length&&"%"==n.substr(n.length-1,1)&&(n=parseInt(window.screen.height*parseInt(n,10)/100,10)),t<640&&(t=640),n<420&&(n=420);var a=parseInt((window.screen.height-n)/2,10),s=parseInt((window.screen.width-t)/2,10);i=(i||"location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes")+",width="+t+",height="+n+",top="+a+",left="+s;var o=window.open("",null,i,!0);if(!o)return!1;try{-1==navigator.userAgent.toLowerCase().indexOf(" chrome/")&&(o.moveTo(s,a),o.resizeTo(t,n)),o.focus(),o.location.href=e}catch(r){window.open(e,null,i,!0)}return!0}}),function(){function a(e,t){var n=[];if(!t)return e;for(var i in t)n.push(i+"="+encodeURIComponent(t[i]));return e+(-1!=e.indexOf("?")?"&":"?")+n.join("&")}function l(e){return(e+="").charAt(0).toUpperCase()+e.substr(1)}function c(){var e=(n=this.getDialog()).getParentEditor();e._.filebrowserSe=this;var t=e.config["filebrowser"+l(n.getName())+"WindowWidth"]||e.config.filebrowserWindowWidth||"80%",n=e.config["filebrowser"+l(n.getName())+"WindowHeight"]||e.config.filebrowserWindowHeight||"70%",i=this.filebrowser.params||{};i.CKEditor=e.name,i.CKEditorFuncNum=e._.filebrowserFn,i.langCode||(i.langCode=e.langCode),i=a(this.filebrowser.url,i),e.popup(i,t,n,e.config.filebrowserWindowFeatures||e.config.fileBrowserWindowFeatures)}function d(){var e=this.getDialog();return e.getParentEditor()._.filebrowserSe=this,!(!e.getContentElement(this["for"][0],this["for"][1]).getInputElement().$.value||!e.getContentElement(this["for"][0],this["for"][1]).getAction())}function u(e,t,n){var i=n.params||{};i.CKEditor=e.name,i.CKEditorFuncNum=e._.filebrowserFn,i.langCode||(i.langCode=e.langCode),t.action=a(n.url,i),t.filebrowser=n}function _(e,t,n,i){if(i&&i.length)for(var a,s=i.length;s--;)if("hbox"!=(a=i[s]).type&&"vbox"!=a.type&&"fieldset"!=a.type||_(e,t,n,a.children),a.filebrowser)if("string"==typeof a.filebrowser&&(a.filebrowser={action:"fileButton"==a.type?"QuickUpload":"Browse",target:a.filebrowser}),"Browse"==a.filebrowser.action){var o=a.filebrowser.url;void 0===o&&(void 0===(o=e.config["filebrowser"+l(t)+"BrowseUrl"])&&(o=e.config.filebrowserBrowseUrl)),o&&(a.onClick=c,a.filebrowser.url=o,a.hidden=!1)}else if("QuickUpload"==a.filebrowser.action&&a["for"]&&(void 0===(o=a.filebrowser.url)&&(void 0===(o=e.config["filebrowser"+l(t)+"UploadUrl"])&&(o=e.config.filebrowserUploadUrl)),o)){var r=a.onClick;a.onClick=function(e){var t=e.sender;return(!r||!1!==r.call(t,e))&&(!!d.call(t,e)&&(e=t.getDialog().getContentElement(this["for"][0],this["for"][1]).getInputElement(),(t=new CKEDITOR.dom.element(e.$.form))&&((e=t.$.elements.ckCsrfToken)?e=new CKEDITOR.dom.element(e):((e=new CKEDITOR.dom.element("input")).setAttributes({name:"ckCsrfToken",type:"hidden"}),t.append(e)),e.setAttribute("value",CKEDITOR.tools.getCsrfToken())),!0))},a.filebrowser.url=o,a.hidden=!1,u(e,n.getContents(a["for"][0]).get(a["for"][1]),a.filebrowser)}}function s(e,t,n){if(-1===n.indexOf(";"))return(e=e.getContents(t).get(n).filebrowser)&&e.url;n=n.split(";");for(var i=0;i<n.length;i++)if(s(e,t,n[i]))return!0;return!1}function t(e,t){var n=this._.filebrowserSe.getDialog(),i=this._.filebrowserSe["for"],a=this._.filebrowserSe.filebrowser.onSelect;i&&n.getContentElement(i[0],i[1]).reset(),"function"==typeof t&&!1===t.call(this._.filebrowserSe)||a&&!1===a.call(this._.filebrowserSe,e,t)||("string"==typeof t&&t&&alert(t),e&&(n=(i=this._.filebrowserSe).getDialog(),i=i.filebrowser.target||null)&&(i=i.split(":"),(a=n.getContentElement(i[0],i[1]))&&(a.setValue(e),n.selectPage(i[0]))))}CKEDITOR.plugins.add("filebrowser",{requires:"popup",init:function(e){e._.filebrowserFn=CKEDITOR.tools.addFunction(t,e),e.on("destroy",function(){CKEDITOR.tools.removeFunction(this._.filebrowserFn)})}}),CKEDITOR.on("dialogDefinition",function(e){if(e.editor.plugins.filebrowser)for(var t,n=e.data.definition,i=0;i<n.contents.length;++i)(t=n.contents[i])&&(_(e.editor,e.data.name,n,t.elements),t.hidden&&t.filebrowser&&(t.hidden=!s(n,t.id,t.filebrowser)))})}(),CKEDITOR.plugins.add("find",{requires:"dialog",init:function(e){var t=e.addCommand("find",new CKEDITOR.dialogCommand("find"));t.canUndo=!1,t.readOnly=1,e.addCommand("replace",new CKEDITOR.dialogCommand("replace")).canUndo=!1,e.ui.addButton&&(e.ui.addButton("Find",{label:e.lang.find.find,command:"find",toolbar:"find,10"}),e.ui.addButton("Replace",{label:e.lang.find.replace,command:"replace",toolbar:"find,20"})),CKEDITOR.dialog.add("find",this.path+"dialogs/find.js"),CKEDITOR.dialog.add("replace",this.path+"dialogs/find.js")}}),CKEDITOR.config.find_highlight={element:"span",styles:{"background-color":"#004",color:"#fff"}},function(){function a(e,t){var n=s.exec(e),i=s.exec(t);if(n){if(!n[2]&&"px"==i[2])return i[1];if("px"==n[2]&&!i[2])return i[1]+"px"}return t}var o=CKEDITOR.htmlParser.cssStyle,r=CKEDITOR.tools.cssLength,s=/^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,t={elements:{$:function(e){var t=e.attributes;if((t=(t=(t=t&&t["data-cke-realelement"])&&new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(t)))&&t.children[0])&&e.attributes["data-cke-resizable"]){var n=new o(e).rules;e=t.attributes;var i=n.width;n=n.height;i&&(e.width=a(e.width,i)),n&&(e.height=a(e.height,n))}return t}}};CKEDITOR.plugins.add("fakeobjects",{init:function(e){e.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}","fakeobjects")},afterInit:function(e){(e=(e=e.dataProcessor)&&e.htmlFilter)&&e.addRules(t,{applyToAll:!0})}}),CKEDITOR.editor.prototype.createFakeElement=function(e,t,n,i){var a=(a=this.lang.fakeobjects)[n]||a.unknown;return t={"class":t,"data-cke-realelement":encodeURIComponent(e.getOuterHtml()),"data-cke-real-node-type":e.type,alt:a,title:a,align:e.getAttribute("align")||""},CKEDITOR.env.hc||(t.src=CKEDITOR.tools.transparentImageData),n&&(t["data-cke-real-element-type"]=n),i&&(t["data-cke-resizable"]=i,n=new o,i=e.getAttribute("width"),e=e.getAttribute("height"),i&&(n.rules.width=r(i)),e&&(n.rules.height=r(e)),n.populate(t)),this.document.createElement("img",{attributes:t})},CKEDITOR.editor.prototype.createFakeParserElement=function(e,t,n,i){var a,s=(s=this.lang.fakeobjects)[n]||s.unknown;return a=new CKEDITOR.htmlParser.basicWriter,e.writeHtml(a),a=a.getHtml(),t={"class":t,"data-cke-realelement":encodeURIComponent(a),"data-cke-real-node-type":e.type,alt:s,title:s,align:e.attributes.align||""},CKEDITOR.env.hc||(t.src=CKEDITOR.tools.transparentImageData),n&&(t["data-cke-real-element-type"]=n),i&&(t["data-cke-resizable"]=i,i=e.attributes,e=new o,n=i.width,i=i.height,void 0!==n&&(e.rules.width=r(n)),void 0!==i&&(e.rules.height=r(i)),e.populate(t)),new CKEDITOR.htmlParser.element("img",t)},CKEDITOR.editor.prototype.restoreRealElement=function(e){if(e.data("cke-real-node-type")!=CKEDITOR.NODE_ELEMENT)return null;var t=CKEDITOR.dom.element.createFromHtml(decodeURIComponent(e.data("cke-realelement")),this.document);if(e.data("cke-resizable")){var n=e.getStyle("width");e=e.getStyle("height"),n&&t.setAttribute("width",a(t.getAttribute("width"),n)),e&&t.setAttribute("height",a(t.getAttribute("height"),e))}return t}}(),function(){function i(e){return"application/x-shockwave-flash"==(e=e.attributes).type||t.test(e.src||"")}function a(e,t){return e.createFakeParserElement(t,"cke_flash","flash",!0)}var t=/\.swf(?:$|\?)/i;CKEDITOR.plugins.add("flash",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss("img.cke_flash{background-image: url("+CKEDITOR.getUrl(this.path+"images/placeholder.png")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")},init:function(e){var t="object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]";CKEDITOR.dialog.isTabEnabled(e,"flash","properties")&&(t+=";object[align]; embed[allowscriptaccess,quality,scale,wmode]"),CKEDITOR.dialog.isTabEnabled(e,"flash","advanced")&&(t+=";object[id]{*}; embed[bgcolor]{*}(*)"),e.addCommand("flash",new CKEDITOR.dialogCommand("flash",{allowedContent:t,requiredContent:"embed"})),e.ui.addButton&&e.ui.addButton("Flash",{label:e.lang.common.flash,command:"flash",toolbar:"insert,20"}),CKEDITOR.dialog.add("flash",this.path+"dialogs/flash.js"),e.addMenuItems&&e.addMenuItems({flash:{label:e.lang.flash.properties,command:"flash",group:"flash"}}),e.on("doubleclick",function(e){var t=e.data.element;t.is("img")&&"flash"==t.data("cke-real-element-type")&&(e.data.dialog="flash")}),e.contextMenu&&e.contextMenu.addListener(function(e){if(e&&e.is("img")&&!e.isReadOnly()&&"flash"==e.data("cke-real-element-type"))return{flash:CKEDITOR.TRISTATE_OFF}})},afterInit:function(n){var e=n.dataProcessor;(e=e&&e.dataFilter)&&e.addRules({elements:{"cke:object":function(e){var t=e.attributes;if(t.classid&&String(t.classid).toLowerCase()||i(e))return a(n,e);for(t=0;t<e.children.length;t++)if("cke:embed"==e.children[t].name){if(!i(e.children[t]))break;return a(n,e)}return null},"cke:embed":function(e){return i(e)?a(n,e):null}}},5)}})}(),CKEDITOR.tools.extend(CKEDITOR.config,{flashEmbedTagOnly:!1,flashAddEmbedTag:!0,flashConvertOnEdit:!1}),function(){function t(f){var m=f.config,e=f.fire("uiSpace",{space:"top",html:""}).html,g=function(){function n(e,t,n){A.setStyle(t,b(n)),A.setStyle("position",e)}function i(e){var t=s.getDocumentPosition();switch(e){case"top":n("absolute","top",t.y-c-_);break;case"pin":n("fixed","top",p);break;case"bottom":n("absolute","top",t.y+(r.height||r.bottom-r.top)+_)}a=e}var a,s,o,r,l,c,d,u=m.floatSpaceDockedOffsetX||0,_=m.floatSpaceDockedOffsetY||0,h=m.floatSpacePinnedOffsetX||0,p=m.floatSpacePinnedOffsetY||0;return function(e){if(s=f.editable()){var t=e&&"focus"==e.name;t&&A.show(),f.fire("floatingSpaceLayout",{show:t}),A.removeStyle("left"),A.removeStyle("right"),o=A.getClientRect(),r=s.getClientRect(),l=v.getViewPaneSize(),c=o.height,d="pageXOffset"in v.$?v.$.pageXOffset:CKEDITOR.document.$.documentElement.scrollLeft,a?(c+_<=r.top?i("top"):c+_>l.height-r.bottom?i("pin"):i("bottom"),e=l.width/2,e=m.floatSpacePreferRight?"right":0<r.left&&r.right<l.width&&r.width>o.width?"rtl"==m.contentsLangDirection?"right":"left":e-r.left>r.right-e?"left":"right",o.width>l.width?(e="left",t=0):(t="left"==e?0<r.left?r.left:0:r.right<l.width?l.width-r.right:0)+o.width>l.width&&(e="left"==e?"right":"left",t=0),A.setStyle(e,b(("pin"==a?h:u)+t+("pin"==a?0:"left"==e?d:-d)))):(i(a="pin"),g(e))}}}();if(e){var t=new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} '+CKEDITOR.env.cssClass+'" dir="{langDir}" title="'+(CKEDITOR.env.gecko?" ":"")+'" lang="{langCode}" role="application" style="{style}"'+(f.title?' aria-labelledby="cke_{name}_arialbl"':" ")+">"+(f.title?'<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>':" ")+'<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),A=CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(t.output({content:e,id:f.id,langDir:f.lang.dir,langCode:f.langCode,name:f.name,style:"display:none;z-index:"+(m.baseFloatZIndex-1),topId:f.ui.spaceId("top"),voiceLabel:f.title}))),n=CKEDITOR.tools.eventsBuffer(500,g),i=CKEDITOR.tools.eventsBuffer(100,g);A.unselectable(),A.on("mousedown",function(e){(e=e.data).getTarget().hasAscendant("a",1)||e.preventDefault()}),f.on("focus",function(e){g(e),f.on("change",n.input),v.on("scroll",i.input),v.on("resize",i.input)}),f.on("blur",function(){A.hide(),f.removeListener("change",n.input),v.removeListener("scroll",i.input),v.removeListener("resize",i.input)}),f.on("destroy",function(){v.removeListener("scroll",i.input),v.removeListener("resize",i.input),A.clearCustomData(),A.remove()}),f.focusManager.hasFocus&&A.show(),f.focusManager.add(A,1)}}var v=CKEDITOR.document.getWindow(),b=CKEDITOR.tools.cssLength;CKEDITOR.plugins.add("floatingspace",{init:function(e){e.on("loaded",function(){t(this)},null,null,20)}})}(),CKEDITOR.plugins.add("listblock",{requires:"panel",onLoad:function(){var t=CKEDITOR.addTemplate("panel-list",'<ul role="presentation" class="cke_panel_list">{items}</ul>'),a=CKEDITOR.addTemplate("panel-list-item",'<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')"  {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),n=CKEDITOR.addTemplate("panel-list-group",'<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),s=/\'/g;CKEDITOR.ui.panel.prototype.addListBlock=function(e,t){return this.addBlock(e,new CKEDITOR.ui.listBlock(this.getHolderElement(),t))},CKEDITOR.ui.listBlock=CKEDITOR.tools.createClass({base:CKEDITOR.ui.panel.block,$:function(e,t){var n=(t=t||{}).attributes||(t.attributes={});(this.multiSelect=!!t.multiSelect)&&(n["aria-multiselectable"]=!0),!n.role&&(n.role="listbox"),this.base.apply(this,arguments),this.element.setAttribute("role",n.role),(n=this.keys)[40]="next",n[9]="next",n[38]="prev",n[CKEDITOR.SHIFT+9]="prev",n[32]=CKEDITOR.env.ie?"mouseup":"click",CKEDITOR.env.ie&&(n[13]="mouseup"),this._.pendingHtml=[],this._.pendingList=[],this._.items={},this._.groups={}},_:{close:function(){if(this._.started){var e=t.output({items:this._.pendingList.join("")});this._.pendingList=[],this._.pendingHtml.push(e),delete this._.started}},getClick:function(){return this._.click||(this._.click=CKEDITOR.tools.addFunction(function(e){var t=this.toggle(e);this.onClick&&this.onClick(e,t)},this)),this._.click}},proto:{add:function(e,t,n){var i=CKEDITOR.tools.getNextId();this._.started||(this._.started=1,this._.size=this._.size||0),e={id:this._.items[e]=i,val:CKEDITOR.tools.htmlEncodeAttr(e).replace(s,"\\'"),onclick:CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick",clickFn:this._.getClick(),title:CKEDITOR.tools.htmlEncodeAttr(n||e),text:t||e},this._.pendingList.push(a.output(e))},startGroup:function(e){this._.close();var t=CKEDITOR.tools.getNextId();this._.groups[e]=t,this._.pendingHtml.push(n.output({id:t,label:e}))},commit:function(){this._.close(),this.element.appendHtml(this._.pendingHtml.join("")),delete this._.size,this._.pendingHtml=[]},toggle:function(e){var t=this.isMarked(e);return t?this.unmark(e):this.mark(e),!t},
hideGroup:function(e){var t=(e=this.element.getDocument().getById(this._.groups[e]))&&e.getNext();e&&(e.setStyle("display","none"),t&&"ul"==t.getName()&&t.setStyle("display","none"))},hideItem:function(e){this.element.getDocument().getById(this._.items[e]).setStyle("display","none")},showAll:function(){var e,t=this._.items,n=this._.groups,i=this.element.getDocument();for(e in t)i.getById(t[e]).setStyle("display","");for(var a in n)e=(t=i.getById(n[a])).getNext(),t.setStyle("display",""),e&&"ul"==e.getName()&&e.setStyle("display","")},mark:function(e){this.multiSelect||this.unmarkAll(),e=this._.items[e];var t=this.element.getDocument().getById(e);t.addClass("cke_selected"),this.element.getDocument().getById(e+"_option").setAttribute("aria-selected",!0),this.onMark&&this.onMark(t)},markFirstDisplayed:function(){var e=this;this._.markFirstDisplayed(function(){e.multiSelect||e.unmarkAll()})},unmark:function(e){var t=this.element.getDocument();e=this._.items[e];var n=t.getById(e);n.removeClass("cke_selected"),t.getById(e+"_option").removeAttribute("aria-selected"),this.onUnmark&&this.onUnmark(n)},unmarkAll:function(){var e,t=this._.items,n=this.element.getDocument();for(e in t){var i=t[e];n.getById(i).removeClass("cke_selected"),n.getById(i+"_option").removeAttribute("aria-selected")}this.onUnmark&&this.onUnmark()},isMarked:function(e){return this.element.getDocument().getById(this._.items[e]).hasClass("cke_selected")},focus:function(e){this._.focusIndex=-1;var t,n=this.element.getElementsByTag("a"),i=-1;if(e){for(t=this.element.getDocument().getById(this._.items[e]).getFirst();e=n.getItem(++i);)if(e.equals(t)){this._.focusIndex=i;break}}else this.element.focus();t&&setTimeout(function(){t.focus()},0)}}})}}),CKEDITOR.plugins.add("richcombo",{requires:"floatpanel,listblock,button",beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_RICHCOMBO,CKEDITOR.ui.richCombo.handler)}}),function(){var e='<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" title="{title}" tabindex="-1"'+(CKEDITOR.env.gecko&&!CKEDITOR.env.hc?"":" href=\"javascript:void('{titleJs}')\"")+' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';CKEDITOR.env.gecko&&CKEDITOR.env.mac&&(e+=' onkeypress="return false;"'),CKEDITOR.env.gecko&&(e+=' onblur="this.style.cssText = this.style.cssText;"');e=e+' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" '+(CKEDITOR.env.ie?'onclick="return false;" onmouseup':"onclick")+'="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">'+(CKEDITOR.env.hc?"&#9660;":CKEDITOR.env.air?"&nbsp;":"")+"</span></span></a></span>";var u=CKEDITOR.addTemplate("combo",e);CKEDITOR.UI_RICHCOMBO="richcombo",CKEDITOR.ui.richCombo=CKEDITOR.tools.createClass({$:function(e){CKEDITOR.tools.extend(this,e,{canGroup:!1,title:e.label,modes:{wysiwyg:1},editorFocus:1}),e=this.panel||{},delete this.panel,this.id=CKEDITOR.tools.getNextNumber(),this.document=e.parent&&e.parent.getDocument()||CKEDITOR.document,e.className="cke_combopanel",e.block={multiSelect:e.multiSelect,attributes:e.attributes},e.toolbarRelated=!0,this._={panelDefinition:e,items:{}}},proto:{renderHtml:function(e){var t=[];return this.render(e,t),t.join("")},render:function(i,e){function t(){if(this.getState()!=CKEDITOR.TRISTATE_ON){var e=this.modes[i.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED;i.readOnly&&!this.readOnly&&(e=CKEDITOR.TRISTATE_DISABLED),this.setState(e),this.setValue(""),e!=CKEDITOR.TRISTATE_DISABLED&&this.refresh&&this.refresh()}}var n=CKEDITOR.env,a="cke_"+this.id,s=CKEDITOR.tools.addFunction(function(e){d&&(i.unlockSelection(1),d=0),r.execute(e)},this),o=this,r={id:a,combo:this,focus:function(){CKEDITOR.document.getById(a).getChild(1).focus()},execute:function(e){var t=o._;if(t.state!=CKEDITOR.TRISTATE_DISABLED)if(o.createPanel(i),t.on)t.panel.hide();else{o.commit();var n=o.getValue();n?t.list.mark(n):t.list.unmarkAll(),t.panel.showBlock(o.id,new CKEDITOR.dom.element(e),4)}},clickFn:s};i.on("activeFilterChange",t,this),i.on("mode",t,this),i.on("selectionChange",t,this),!this.readOnly&&i.on("readOnly",t,this);var l=CKEDITOR.tools.addFunction(function(e,t){var n=(e=new CKEDITOR.dom.event(e)).getKeystroke();switch(n){case 13:case 32:case 40:CKEDITOR.tools.callFunction(s,t);break;default:r.onkey(r,n)}e.preventDefault()}),c=CKEDITOR.tools.addFunction(function(){r.onfocus&&r.onfocus()}),d=0;return r.keyDownFn=l,n={id:a,name:this.name||this.command,label:this.label,title:this.title,cls:this.className||"",titleJs:n.gecko&&!n.hc?"":(this.title||"").replace("'",""),keydownFn:l,focusFn:c,clickFn:s},u.output(n,e),this.onRender&&this.onRender(),r},createPanel:function(t){if(!this._.panel){var e=this._.panelDefinition,n=this._.panelDefinition.block,i=e.parent||CKEDITOR.document.getBody(),a="cke_combopanel__"+this.name,s=new CKEDITOR.ui.floatPanel(t,i,e),o=(e=s.addListBlock(this.id,n),this);s.onShow=function(){this.element.addClass(a),o.setState(CKEDITOR.TRISTATE_ON),o._.on=1,o.editorFocus&&!t.focusManager.hasFocus&&t.focus(),o.onOpen&&o.onOpen()},s.onHide=function(e){this.element.removeClass(a),o.setState(o.modes&&o.modes[t.mode]?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),o._.on=0,!e&&o.onClose&&o.onClose()},s.onEscape=function(){s.hide(1)},e.onClick=function(e,t){o.onClick&&o.onClick.call(o,e,t),s.hide()},this._.panel=s,this._.list=e,s.getBlock(this.id).onHide=function(){o._.on=0,o.setState(CKEDITOR.TRISTATE_OFF)},this.init&&this.init()}},setValue:function(e,t){this._.value=e;var n=this.document.getById("cke_"+this.id+"_text");n&&(e||t?n.removeClass("cke_combo_inlinelabel"):(t=this.label,n.addClass("cke_combo_inlinelabel")),n.setText(void 0!==t?t:e))},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(e){this._.list.mark(e)},hideItem:function(e){this._.list.hideItem(e)},hideGroup:function(e){this._.list.hideGroup(e)},showAll:function(){this._.list.showAll()},add:function(e,t,n){this._.items[e]=n||e,this._.list.add(e,t,n)},startGroup:function(e){this._.list.startGroup(e)},commit:function(){this._.committed||(this._.list.commit(),this._.committed=1,CKEDITOR.ui.fire("ready",this)),this._.committed=1},setState:function(e){if(this._.state!=e){var t=this.document.getById("cke_"+this.id);t.setState(e,"cke_combo"),e==CKEDITOR.TRISTATE_DISABLED?t.setAttribute("aria-disabled",!0):t.removeAttribute("aria-disabled"),this._.state=e}},getState:function(){return this._.state},enable:function(){this._.state==CKEDITOR.TRISTATE_DISABLED&&this.setState(this._.lastState)},disable:function(){this._.state!=CKEDITOR.TRISTATE_DISABLED&&(this._.lastState=this._.state,this.setState(CKEDITOR.TRISTATE_DISABLED))}},statics:{handler:{create:function(e){return new CKEDITOR.ui.richCombo(e)}}}}),CKEDITOR.ui.prototype.addRichCombo=function(e,t){this.add(e,CKEDITOR.UI_RICHCOMBO,t)}}(),function(){function n(c,e,t,n,i,s,a,o){var r=c.config,l=new CKEDITOR.style(a),d=i.split(";");i=[];for(var u={},_=0;_<d.length;_++){if(h=d[_]){var h=h.split("/"),p={},f=d[_]=h[0];p[t]=i[_]=h[1]||f,u[f]=new CKEDITOR.style(a,p),u[f]._.definition.name=f}else d.splice(_--,1)}c.ui.addRichCombo(e,{label:n.label,title:n.panelTitle,toolbar:"styles,"+o,allowedContent:l,requiredContent:l,contentTransformations:[[{element:"font",check:"span",left:function(e){return!!e.attributes.size||!!e.attributes.align||!!e.attributes.face},right:function(e){var t=" x-small small medium large x-large xx-large 48px".split(" ");e.name="span",e.attributes.size&&(e.styles["font-size"]=t[e.attributes.size],delete e.attributes.size),e.attributes.align&&(e.styles["text-align"]=e.attributes.align,delete e.attributes.align),e.attributes.face&&(e.styles["font-family"]=e.attributes.face,delete e.attributes.face)}}]],panel:{css:[CKEDITOR.skin.getPath("editor")].concat(r.contentsCss),multiSelect:!1,attributes:{"aria-label":n.panelTitle}},init:function(){this.startGroup(n.panelTitle);for(var e=0;e<d.length;e++){var t=d[e];this.add(t,u[t].buildPreview(),t)}},onClick:function(e){c.focus(),c.fire("saveSnapshot");var t=this.getValue(),n=u[e];if(t&&e!=t){var i=u[t],a=c.getSelection().getRanges()[0];if(a.collapsed){var s=c.elementPath(),o=s.contains(function(e){return i.checkElementRemovable(e)});if(o){var r=a.checkBoundaryOfElement(o,CKEDITOR.START),l=a.checkBoundaryOfElement(o,CKEDITOR.END);if(r&&l){for(r=a.createBookmark();s=o.getFirst();)s.insertBefore(o);o.remove(),a.moveToBookmark(r)}else r||l?a.moveToPosition(o,r?CKEDITOR.POSITION_BEFORE_START:CKEDITOR.POSITION_AFTER_END):(a.splitElement(o),a.moveToPosition(o,CKEDITOR.POSITION_AFTER_END)),m(a,s.elements.slice(),o);c.getSelection().selectRanges([a])}}else c.removeStyle(i)}c[t==e?"removeStyle":"applyStyle"](n),c.fire("saveSnapshot")},onRender:function(){c.on("selectionChange",function(e){var t=this.getValue();e=e.data.path.elements;for(var n,i=0;i<e.length;i++)for(var a in n=e[i],u)if(u[a].checkElementMatch(n,!0,c))return void(a!=t&&this.setValue(a));this.setValue("",s)},this)},refresh:function(){c.activeFilter.check(l)||this.setState(CKEDITOR.TRISTATE_DISABLED)}})}function m(e,t,n){var i=t.pop();if(i){if(n)return m(e,t,i.equals(n)?null:n);n=i.clone(),e.insertNode(n),e.moveToPosition(n,CKEDITOR.POSITION_AFTER_START),m(e,t)}}CKEDITOR.plugins.add("font",{requires:"richcombo",init:function(e){var t=e.config;n(e,"Font","family",e.lang.font,t.font_names,t.font_defaultLabel,t.font_style,30),n(e,"FontSize","size",e.lang.font.fontSize,t.fontSize_sizes,t.fontSize_defaultLabel,t.fontSize_style,40)}})}(),CKEDITOR.config.font_names="Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif",CKEDITOR.config.font_defaultLabel="",CKEDITOR.config.font_style={element:"span",styles:{"font-family":"#(family)"},overrides:[{element:"font",attributes:{face:null}}]},CKEDITOR.config.fontSize_sizes="8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px",CKEDITOR.config.fontSize_defaultLabel="",CKEDITOR.config.fontSize_style={element:"span",styles:{"font-size":"#(size)"},overrides:[{element:"font",attributes:{size:null}}]},CKEDITOR.plugins.add("forms",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n"),CKEDITOR.addCss("img.cke_hidden{background-image: url("+CKEDITOR.getUrl(this.path+"images/hiddenfield.gif")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}")},init:function(a){var s=a.lang,o=0,i={email:1,password:1,search:1,tel:1,text:1,url:1},r={checkbox:"input[type,name,checked,required]",radio:"input[type,name,checked,required]",textfield:"input[type,name,value,size,maxlength,required]",textarea:"textarea[cols,rows,name,required]",select:"select[name,size,multiple,required]; option[value,selected]",button:"input[type,name,value]",form:"form[action,name,id,enctype,target,method]",hiddenfield:"input[type,name,value]",imagebutton:"input[type,alt,src]{width,height,border,border-width,border-style,margin,float}"},l={checkbox:"input",radio:"input",textfield:"input",textarea:"textarea",select:"select",button:"input",form:"form",hiddenfield:"input",imagebutton:"input"},e=function(e,t,n){var i={allowedContent:r[t],requiredContent:l[t]};"form"==t&&(i.context="form"),a.addCommand(t,new CKEDITOR.dialogCommand(t,i)),a.ui.addButton&&a.ui.addButton(e,{label:s.common[e.charAt(0).toLowerCase()+e.slice(1)],command:t,toolbar:"forms,"+(o+=10)}),CKEDITOR.dialog.add(t,n)},t=this.path+"dialogs/";!a.blockless&&e("Form","form",t+"form.js"),e("Checkbox","checkbox",t+"checkbox.js"),e("Radio","radio",t+"radio.js"),e("TextField","textfield",t+"textfield.js"),e("Textarea","textarea",t+"textarea.js"),e("Select","select",t+"select.js"),e("Button","button",t+"button.js");var c=a.plugins.image;c&&!a.plugins.image2&&e("ImageButton","imagebutton",CKEDITOR.plugins.getPath("image")+"dialogs/image.js"),e("HiddenField","hiddenfield",t+"hiddenfield.js"),a.addMenuItems&&(e={checkbox:{label:s.forms.checkboxAndRadio.checkboxTitle,command:"checkbox",group:"checkbox"},radio:{label:s.forms.checkboxAndRadio.radioTitle,command:"radio",group:"radio"},textfield:{label:s.forms.textfield.title,command:"textfield",group:"textfield"},hiddenfield:{label:s.forms.hidden.title,command:"hiddenfield",group:"hiddenfield"},button:{label:s.forms.button.title,command:"button",group:"button"},select:{label:s.forms.select.title,command:"select",group:"select"},textarea:{label:s.forms.textarea.title,command:"textarea",group:"textarea"}},c&&(e.imagebutton={label:s.image.titleButton,command:"imagebutton",group:"imagebutton"}),!a.blockless&&(e.form={label:s.forms.form.menu,command:"form",group:"form"}),a.addMenuItems(e)),a.contextMenu&&(!a.blockless&&a.contextMenu.addListener(function(e,t,n){if((e=n.contains("form",1))&&!e.isReadOnly())return{form:CKEDITOR.TRISTATE_OFF}}),a.contextMenu.addListener(function(e){if(e&&!e.isReadOnly()){var t=e.getName();if("select"==t)return{select:CKEDITOR.TRISTATE_OFF};if("textarea"==t)return{textarea:CKEDITOR.TRISTATE_OFF};if("input"==t){var n=e.getAttribute("type")||"text";switch(n){case"button":case"submit":case"reset":return{button:CKEDITOR.TRISTATE_OFF};case"checkbox":return{checkbox:CKEDITOR.TRISTATE_OFF};case"radio":return{radio:CKEDITOR.TRISTATE_OFF};case"image":return c?{imagebutton:CKEDITOR.TRISTATE_OFF}:null}if(i[n])return{textfield:CKEDITOR.TRISTATE_OFF}}if("img"==t&&"hiddenfield"==e.data("cke-real-element-type"))return{hiddenfield:CKEDITOR.TRISTATE_OFF}}})),a.on("doubleclick",function(e){var t=e.data.element;if(!a.blockless&&t.is("form"))e.data.dialog="form";else if(t.is("select"))e.data.dialog="select";else if(t.is("textarea"))e.data.dialog="textarea";else if(t.is("img")&&"hiddenfield"==t.data("cke-real-element-type"))e.data.dialog="hiddenfield";else if(t.is("input")){switch(t=t.getAttribute("type")||"text"){case"button":case"submit":case"reset":e.data.dialog="button";break;case"checkbox":e.data.dialog="checkbox";break;case"radio":e.data.dialog="radio";break;case"image":e.data.dialog="imagebutton"}i[t]&&(e.data.dialog="textfield")}})},afterInit:function(t){var e=(n=t.dataProcessor)&&n.htmlFilter,n=n&&n.dataFilter;CKEDITOR.env.ie&&e&&e.addRules({elements:{input:function(e){var t=(e=e.attributes).type;t||(e.type="text"),"checkbox"!=t&&"radio"!=t||"on"!=e.value||delete e.value}}},{applyToAll:!0}),n&&n.addRules({elements:{input:function(e){if("hidden"==e.attributes.type)return t.createFakeParserElement(e,"cke_hidden","hiddenfield")}}},{applyToAll:!0})}}),CKEDITOR.plugins.add("format",{requires:"richcombo",init:function(i){if(!i.blockless){for(var e=i.config,n=i.lang.format,t=e.format_tags.split(";"),a={},s=0,o=[],r=0;r<t.length;r++){var l=t[r],c=new CKEDITOR.style(e["format_"+l]);i.filter.customConfig&&!i.filter.check(c)||(s++,a[l]=c,a[l]._.enterMode=i.config.enterMode,o.push(c))}0!==s&&i.ui.addRichCombo("Format",{label:n.label,title:n.panelTitle,toolbar:"styles,20",allowedContent:o,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(e.contentsCss),multiSelect:!1,attributes:{"aria-label":n.panelTitle}},init:function(){for(var e in this.startGroup(n.panelTitle),a){var t=n["tag_"+e];this.add(e,a[e].buildPreview(t),t)}},onClick:function(e){i.focus(),i.fire("saveSnapshot"),e=a[e];var t=i.elementPath();i[e.checkActive(t,i)?"removeStyle":"applyStyle"](e),setTimeout(function(){i.fire("saveSnapshot")},0)},onRender:function(){i.on("selectionChange",function(e){var t=this.getValue();for(var n in e=e.data.path,this.refresh(),a)if(a[n].checkActive(e,i))return void(n!=t&&this.setValue(n,i.lang.format["tag_"+n]));this.setValue("")},this)},onOpen:function(){for(var e in this.showAll(),a)i.activeFilter.check(a[e])||this.hideItem(e)},refresh:function(){var e=i.elementPath();if(e){if(e.isContextFor("p"))for(var t in a)if(i.activeFilter.check(a[t]))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}}})}}}),CKEDITOR.config.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div",CKEDITOR.config.format_p={element:"p"},CKEDITOR.config.format_div={element:"div"},CKEDITOR.config.format_pre={element:"pre"},CKEDITOR.config.format_address={element:"address"},CKEDITOR.config.format_h1={element:"h1"},CKEDITOR.config.format_h2={element:"h2"},CKEDITOR.config.format_h3={element:"h3"},CKEDITOR.config.format_h4={element:"h4"},CKEDITOR.config.format_h5={element:"h5"},CKEDITOR.config.format_h6={element:"h6"},z={canUndo:!1,exec:function(e){var t=e.document.createElement("hr");e.insertElement(t)},allowedContent:"hr",requiredContent:"hr"},CKEDITOR.plugins.add("horizontalrule",{init:function(e){e.blockless||(e.addCommand("horizontalrule",z),e.ui.addButton&&e.ui.addButton("HorizontalRule",{label:e.lang.horizontalrule.toolbar,command:"horizontalrule",toolbar:"insert,40"}))}}),CKEDITOR.plugins.add("htmlwriter",{init:function(e){var t=new CKEDITOR.htmlWriter;t.forceSimpleAmpersand=e.config.forceSimpleAmpersand,t.indentationChars=e.config.dataIndentationChars||"\t",e.dataProcessor.writer=t}}),CKEDITOR.htmlWriter=CKEDITOR.tools.createClass({base:CKEDITOR.htmlParser.basicWriter,$:function(){this.base(),this.indentationChars="\t",this.selfClosingEnd=" />",this.lineBreakChars="\n",this.sortAttributes=1,this._.indent=0,this._.indentation="",this._.inPre=0,this._.rules={};var e,t=CKEDITOR.dtd;for(e in CKEDITOR.tools.extend({},t.$nonBodyContent,t.$block,t.$listItem,t.$tableContent))this.setRules(e,{indent:!t[e]["#"],breakBeforeOpen:1,breakBeforeClose:!t[e]["#"],breakAfterClose:1,needsSpace:e in t.$block&&!(e in{li:1,dt:1,dd:1})});this.setRules("br",{breakAfterOpen:1}),this.setRules("title",{indent:0,breakAfterOpen:0}),this.setRules("style",{indent:0,breakBeforeClose:1}),this.setRules("pre",{breakAfterOpen:1,indent:0})},proto:{openTag:function(e){var t=this._.rules[e];this._.afterCloser&&t&&t.needsSpace&&this._.needsSpace&&this._.output.push("\n"),this._.indent?this.indentation():t&&t.breakBeforeOpen&&(this.lineBreak(),this.indentation()),this._.output.push("<",e),this._.afterCloser=0},openTagClose:function(e,t){var n=this._.rules[e];t?(this._.output.push(this.selfClosingEnd),n&&n.breakAfterClose&&(this._.needsSpace=n.needsSpace)):(this._.output.push(">"),n&&n.indent&&(this._.indentation+=this.indentationChars)),n&&n.breakAfterOpen&&this.lineBreak(),"pre"==e&&(this._.inPre=1)},attribute:function(e,t){"string"==typeof t&&(this.forceSimpleAmpersand&&(t=t.replace(/&amp;/g,"&")),t=CKEDITOR.tools.htmlEncodeAttr(t)),this._.output.push(" ",e,'="',t,'"')},closeTag:function(e){var t=this._.rules[e];t&&t.indent&&(this._.indentation=this._.indentation.substr(this.indentationChars.length)),this._.indent?this.indentation():t&&t.breakBeforeClose&&(this.lineBreak(),this.indentation()),this._.output.push("</",e,">"),"pre"==e&&(this._.inPre=0),t&&t.breakAfterClose&&(this.lineBreak(),this._.needsSpace=t.needsSpace),this._.afterCloser=1},text:function(e){this._.indent&&(this.indentation(),!this._.inPre&&(e=CKEDITOR.tools.ltrim(e))),this._.output.push(e)},comment:function(e){this._.indent&&this.indentation(),this._.output.push("<!--",e,"-->")},lineBreak:function(){!this._.inPre&&0<this._.output.length&&this._.output.push(this.lineBreakChars),this._.indent=1},indentation:function(){!this._.inPre&&this._.indentation&&this._.output.push(this._.indentation),this._.indent=0},reset:function(){this._.output=[],this._.indent=0,this._.indentation="",this._.afterCloser=0,this._.inPre=0,this._.needsSpace=0},setRules:function(e,t){var n=this._.rules[e];n?CKEDITOR.tools.extend(n,t,!0):this._.rules[e]=t}}}),CKEDITOR.plugins.add("iframe",{requires:"dialog,fakeobjects",onLoad:function(){CKEDITOR.addCss("img.cke_iframe{background-image: url("+CKEDITOR.getUrl(this.path+"images/placeholder.png")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")},init:function(e){var t=e.lang.iframe,n="iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]";e.plugins.dialogadvtab&&(n+=";iframe"+e.plugins.dialogadvtab.allowedContent({id:1,classes:1,styles:1})),CKEDITOR.dialog.add("iframe",this.path+"dialogs/iframe.js"),e.addCommand("iframe",new CKEDITOR.dialogCommand("iframe",{allowedContent:n,requiredContent:"iframe"})),e.ui.addButton&&e.ui.addButton("Iframe",{label:t.toolbar,command:"iframe",toolbar:"insert,80"}),e.on("doubleclick",function(e){var t=e.data.element;t.is("img")&&"iframe"==t.data("cke-real-element-type")&&(e.data.dialog="iframe")}),e.addMenuItems&&e.addMenuItems({iframe:{label:t.title,command:"iframe",group:"image"}}),e.contextMenu&&e.contextMenu.addListener(function(e){if(e&&e.is("img")&&"iframe"==e.data("cke-real-element-type"))return{iframe:CKEDITOR.TRISTATE_OFF}})},afterInit:function(t){var e=t.dataProcessor;(e=e&&e.dataFilter)&&e.addRules({elements:{iframe:function(e){return t.createFakeParserElement(e,"cke_iframe","iframe",!0)}}})}}),function(){function t(e){function t(n){var i=!1;o.attachListener(o,"keydown",function(){var e=a.getBody().getElementsByTag(n);if(!i){for(var t=0;t<e.count();t++)e.getItem(t).setCustomData("retain",!0);i=!0}},null,null,1),o.attachListener(o,"keyup",function(){var e=a.getElementsByTag(n);i&&(1!=e.count()||e.getItem(0).getCustomData("retain")||e.getItem(0).hasAttribute("data-cke-temp")||e.getItem(0).remove(1),i=!1)})}var i=this.editor,a=e.document,n=a.body,s=a.getElementById("cke_actscrpt");s&&s.parentNode.removeChild(s),(s=a.getElementById("cke_shimscrpt"))&&s.parentNode.removeChild(s),(s=a.getElementById("cke_basetagscrpt"))&&s.parentNode.removeChild(s),n.contentEditable=!0,CKEDITOR.env.ie&&(n.hideFocus=!0,n.disabled=!0,n.removeAttribute("disabled")),delete this._.isLoadingData,this.$=n,a=new CKEDITOR.dom.document(a),this.setup(),this.fixInitialSelection();var o=this;CKEDITOR.env.ie&&!CKEDITOR.env.edge&&a.getDocumentElement().addClass(a.$.compatMode),CKEDITOR.env.ie&&!CKEDITOR.env.edge&&i.enterMode!=CKEDITOR.ENTER_P?t("p"):CKEDITOR.env.edge&&i.enterMode!=CKEDITOR.ENTER_DIV&&t("div"),(CKEDITOR.env.webkit||CKEDITOR.env.ie&&10<CKEDITOR.env.version)&&a.getDocumentElement().on("mousedown",function(e){e.data.getTarget().is("html")&&setTimeout(function(){i.editable().focus()})}),l(i);try{i.document.$.execCommand("2D-position",!1,!0)}catch(r){}(CKEDITOR.env.gecko||CKEDITOR.env.ie&&"CSS1Compat"==i.document.$.compatMode)&&this.attachListener(this,"keydown",function(e){var t=e.data.getKeystroke();if(33==t||34==t)if(CKEDITOR.env.ie)setTimeout(function(){i.getSelection().scrollIntoView()},0);else if(i.window.$.innerHeight>this.$.offsetHeight){var n=i.createRange();n[33==t?"moveToElementEditStart":"moveToElementEditEnd"](this),n.select(),e.data.preventDefault()}}),CKEDITOR.env.ie&&this.attachListener(a,"blur",function(){try{a.$.selection.empty()}catch(e){}}),CKEDITOR.env.iOS&&this.attachListener(a,"touchend",function(){e.focus()}),(n=i.document.getElementsByTag("title").getItem(0)).data("cke-title",n.getText()),CKEDITOR.env.ie&&(i.document.$.title=this._.docTitle),CKEDITOR.tools.setTimeout(function(){"unloaded"==this.status&&(this.status="ready"),i.fire("contentDom"),this._.isPendingFocus&&(i.focus(),this._.isPendingFocus=!1),setTimeout(function(){i.fire("dataReady")},0)},0,this)}function l(n){function e(){var t;n.editable().attachListener(n,"selectionChange",function(){var e=n.getSelection().getSelectedElement();e&&(t&&(t.detachEvent("onresizestart",i),t=null),e.$.attachEvent("onresizestart",i),t=e.$)})}function i(e){e.returnValue=!1}if(CKEDITOR.env.gecko)try{var t=n.document.$;t.execCommand("enableObjectResizing",!1,!n.config.disableObjectResizing),t.execCommand("enableInlineTableEditing",!1,!n.config.disableNativeTableHandles)}catch(a){}else CKEDITOR.env.ie&&CKEDITOR.env.version<11&&n.config.disableObjectResizing&&e(n)}function c(){var e=[];if(8<=CKEDITOR.document.$.documentMode){e.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");var t,n=[];for(t in CKEDITOR.dtd.$removeEmpty)n.push("html.CSS1Compat "+t+"[contenteditable=false]");e.push(n.join(",")+"{display:inline-block}")}else CKEDITOR.env.gecko&&(e.push("html{height:100% !important}"),e.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));return e.push("html{cursor:text;*cursor:auto}"),e.push("img,input,textarea{cursor:default}"),e.join("\n")}var d;CKEDITOR.plugins.add("wysiwygarea",{init:function(l){l.config.fullPage&&l.addFeature({allowedContent:"html head title; style [media,type]; body (*)[id]; meta link [*]",requiredContent:"body"}),l.addMode("wysiwyg",function(t){function e(e){e&&e.removeListener(),l.editable(new d(l,i.$.contentWindow.document.body)),l.setData(l.getData(1),t)}var n="document.open();"+(CKEDITOR.env.ie?"("+CKEDITOR.tools.fixDomain+")();":"")+"document.close();",i=(n=CKEDITOR.env.air?"javascript:void(0)":CKEDITOR.env.ie&&!CKEDITOR.env.edge?"javascript:void(function(){"+encodeURIComponent(n)+"}())":"",CKEDITOR.dom.element.createFromHtml('<iframe src="'+n+'" frameBorder="0"></iframe>'));i.setStyles({width:"100%",height:"100%"}),i.addClass("cke_wysiwyg_frame").addClass("cke_reset"),(n=l.ui.space("contents")).append(i);var a=CKEDITOR.env.ie&&!CKEDITOR.env.edge||CKEDITOR.env.gecko;a&&i.on("load",e);var s=l.title,o=l.fire("ariaEditorHelpLabel",{}).label;if(s&&(CKEDITOR.env.ie&&o&&(s+=", "+o),i.setAttribute("title",s)),o){s=CKEDITOR.tools.getNextId();var r=CKEDITOR.dom.element.createFromHtml('<span id="'+s+'" class="cke_voice_label">'+o+"</span>");n.append(r,1),i.setAttribute("aria-describedby",s)}l.on("beforeModeUnload",function(e){e.removeListener(),r&&r.remove()}),i.setAttributes({tabIndex:l.tabIndex,allowTransparency:"true"}),!a&&e(),l.fire("ariaWidget",i)})}}),CKEDITOR.editor.prototype.addContentsCss=function(e){var t=this.config,n=t.contentsCss;CKEDITOR.tools.isArray(n)||(t.contentsCss=n?[n]:[]),t.contentsCss.push(e)},d=CKEDITOR.tools.createClass({$:function(){this.base.apply(this,arguments),this._.frameLoadedHandler=CKEDITOR.tools.addFunction(function(e){CKEDITOR.tools.setTimeout(t,0,this,e)},this),this._.docTitle=this.getWindow().getFrame().getAttribute("title")},base:CKEDITOR.editable,proto:{setData:function(e,t){var n=this.editor;if(t)this.setHtml(e),this.fixInitialSelection(),n.fire("dataReady");else{this._.isLoadingData=!0,n._.dataStore={id:1};var i=n.config,a=i.fullPage,s=i.docType,o=CKEDITOR.tools.buildStyleHtml(c()).replace(/<style>/,'<style data-cke-temp="1">');a||(o+=CKEDITOR.tools.buildStyleHtml(n.config.contentsCss));var r=i.baseHref?'<base href="'+i.baseHref+'" data-cke-temp="1" />':"";a&&(e=e.replace(/<!DOCTYPE[^>]*>/i,function(e){return n.docType=s=e,""}).replace(/<\?xml\s[^\?]*\?>/i,function(e){return n.xmlDeclaration=e,""})),e=n.dataProcessor.toHtml(e),a?(/<body[\s|>]/.test(e)||(e="<body>"+e),/<html[\s|>]/.test(e)||(e="<html>"+e+"</html>"),/<head[\s|>]/.test(e)?/<title[\s|>]/.test(e)||(e=e.replace(/<head[^>]*>/,"$&<title></title>")):e=e.replace(/<html[^>]*>/,"$&<head><title></title></head>"),r&&(e=e.replace(/<head[^>]*?>/,"$&"+r)),e=e.replace(/<\/head\s*>/,o+"$&"),e=s+e):e=i.docType+'<html dir="'+i.contentsLangDirection+'" lang="'+(i.contentsLanguage||n.langCode)+'"><head><title>'+this._.docTitle+"</title>"+r+o+"</head><body"+(i.bodyId?' id="'+i.bodyId+'"':"")+(i.bodyClass?' class="'+i.bodyClass+'"':"")+">"+e+"</body></html>",CKEDITOR.env.gecko&&(e=e.replace(/<body/,'<body contenteditable="true" '),CKEDITOR.env.version<2e4&&(e=e.replace(/<body[^>]*>/,"$&<!-- cke-content-start -->"))),i='<script id="cke_actscrpt" type="text/javascript"'+(CKEDITOR.env.ie?' defer="defer" ':"")+">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction("+this._.frameLoadedHandler+",window);wasLoaded=1;}"+(CKEDITOR.env.ie?"onload();":'document.addEventListener("DOMContentLoaded", onload, false );')+"</script>",CKEDITOR.env.ie&&CKEDITOR.env.version<9&&(i+='<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)</script>'),r&&CKEDITOR.env.ie&&CKEDITOR.env.version<10&&(i+='<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;</script>'),e=e.replace(/(?=\s*<\/(:?head)>)/,i),this.clearCustomData(),this.clearListeners(),n.fire("contentDomUnload");var l=this.getDocument();try{l.write(e)}catch(d){setTimeout(function(){l.write(e)},0)}}},getData:function(e){if(e)return this.getHtml();var t=(e=this.editor).config,n=(s=t.fullPage)&&e.docType,i=s&&e.xmlDeclaration,a=this.getDocument(),s=s?a.getDocumentElement().getOuterHtml():a.getBody().getHtml();return CKEDITOR.env.gecko&&t.enterMode!=CKEDITOR.ENTER_BR&&(s=s.replace(/<br>(?=\s*(:?$|<\/body>))/,"")),s=e.dataProcessor.toDataFormat(s),i&&(s=i+"\n"+s),n&&(s=n+"\n"+s),s},focus:function(){this._.isLoadingData?this._.isPendingFocus=!0:d.baseProto.focus.call(this)},detach:function(){var e,t=this.editor,n=t.document;try{e=t.window.getFrame()}catch(i){}d.baseProto.detach.call(this),this.clearCustomData(),n.getDocumentElement().clearCustomData(),CKEDITOR.tools.removeFunction(this._.frameLoadedHandler),e&&e.getParent()?(e.clearCustomData(),(t=e.removeCustomData("onResize"))&&t.removeListener(),e.remove()):CKEDITOR.warn("editor-destroy-iframe")}}})}(),CKEDITOR.config.disableObjectResizing=!1,CKEDITOR.config.disableNativeTableHandles=!0,CKEDITOR.config.disableNativeSpellChecker=!0,function(){function a(e,t){if(t||(t=e.getSelection().getSelectedElement()),t&&t.is("img")&&!t.data("cke-realelement")&&!t.isReadOnly())return t}function s(e){var t=e.getStyle("float");return"inherit"!=t&&"none"!=t||(t=0),t||(t=e.getAttribute("align")),t}CKEDITOR.plugins.add("image",{requires:"dialog",init:function(t){if(!t.plugins.image2){CKEDITOR.dialog.add("image",this.path+"dialogs/image.js");var e="img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";CKEDITOR.dialog.isTabEnabled(t,"image","advanced")&&(e="img[alt,dir,id,lang,longdesc,!src,title]{*}(*)"),t.addCommand("image",new CKEDITOR.dialogCommand("image",{allowedContent:e,requiredContent:"img[alt,src]",contentTransformations:[["img{width}: sizeToStyle","img[width]: sizeToAttribute"],["img{float}: alignmentToStyle","img[align]: alignmentToAttribute"]]})),t.ui.addButton&&t.ui.addButton("Image",{label:t.lang.common.image,command:"image",toolbar:"insert,10"}),t.on("doubleclick",function(e){var t=e.data.element;!t.is("img")||t.data("cke-realelement")||t.isReadOnly()||(e.data.dialog="image")}),t.addMenuItems&&t.addMenuItems({image:{label:t.lang.image.menu,command:"image",group:"image"}}),t.contextMenu&&t.contextMenu.addListener(function(e){if(a(t,e))return{image:CKEDITOR.TRISTATE_OFF}})}},afterInit:function(i){function e(n){var e=i.getCommand("justify"+n);e&&("left"!=n&&"right"!=n||e.on("exec",function(e){var t=a(i);t&&(s(t)==n?(t.removeStyle("float"),n==s(t)&&t.removeAttribute("align")):t.setStyle("float",n),e.cancel())}),e.on("refresh",function(e){var t=a(i);t&&(t=s(t),this.setState(t==n?CKEDITOR.TRISTATE_ON:"right"==n||"left"==n?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),e.cancel())}))}i.plugins.image2||(e("left"),e("right"),e("center"),e("block"))}})}(),CKEDITOR.config.image_removeLinkByEmptyURL=!0,function(){function t(t,e){var n,i;e.on("refresh",function(e){var t,n=[a];for(t in e.data.states)n.push(e.data.states[t]);this.setState(CKEDITOR.tools.search(n,s)?s:a)},e,null,100),e.on("exec",function(e){n=t.getSelection(),i=n.createBookmarks(1),e.data||(e.data={}),e.data.done=!1},e,null,0),e.on("exec",function(){t.forceNextSelectionCheck(),n.selectBookmarks(i)},e,null,100)}var a=CKEDITOR.TRISTATE_DISABLED,s=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indent",{init:function(l){var e=CKEDITOR.plugins.indent.genericDefinition;t(l,l.addCommand("indent",new e(!0))),t(l,l.addCommand("outdent",new e)),l.ui.addButton&&(l.ui.addButton("Indent",{label:l.lang.indent.indent,command:"indent",directional:!0,toolbar:"indent,20"}),l.ui.addButton("Outdent",{label:l.lang.indent.outdent,command:"outdent",directional:!0,toolbar:"indent,10"})),l.on("dirChanged",function(e){var t=l.createRange(),n=e.data.node;t.setStartBefore(n),t.setEndAfter(n);for(var i,a=new CKEDITOR.dom.walker(t);i=a.next();)if(i.type==CKEDITOR.NODE_ELEMENT)if(!i.equals(n)&&i.getDirection()
)t.setStartAfter(i),a=new CKEDITOR.dom.walker(t);else{var s=l.config.indentClasses;if(s)for(var o="ltr"==e.data.dir?["_rtl",""]:["","_rtl"],r=0;r<s.length;r++)i.hasClass(s[r]+o[0])&&(i.removeClass(s[r]+o[0]),i.addClass(s[r]+o[1]));s=i.getStyle("margin-right"),o=i.getStyle("margin-left"),s?i.setStyle("margin-left",s):i.removeStyle("margin-left"),o?i.setStyle("margin-right",o):i.removeStyle("margin-right")}})}}),CKEDITOR.plugins.indent={genericDefinition:function(e){this.isIndent=!!e,this.startDisabled=!this.isIndent},specificDefinition:function(e,t,n){this.name=t,this.editor=e,this.jobs={},this.enterBr=e.config.enterMode==CKEDITOR.ENTER_BR,this.isIndent=!!n,this.relatedGlobal=n?"indent":"outdent",this.indentKey=n?9:CKEDITOR.SHIFT+9,this.database={}},registerCommands:function(e,t){e.on("pluginsLoaded",function(){for(var e in t)!function(t,n){var i,e=t.getCommand(n.relatedGlobal);for(i in n.jobs)e.on("exec",function(e){e.data.done||(t.fire("lockSnapshot"),n.execJob(t,i)&&(e.data.done=!0),t.fire("unlockSnapshot"),CKEDITOR.dom.element.clearAllMarkers(n.database))},this,null,i),e.on("refresh",function(e){e.data.states||(e.data.states={}),e.data.states[n.name+"@"+i]=n.refreshJob(t,i,e.data.path)},this,null,i);t.addFeature(n)}(this,t[e])})}},CKEDITOR.plugins.indent.genericDefinition.prototype={context:"p",exec:function(){}},CKEDITOR.plugins.indent.specificDefinition.prototype={execJob:function(e,t){var n=this.jobs[t];if(n.state!=a)return n.exec.call(this,e)},refreshJob:function(e,t,n){return t=this.jobs[t],e.activeFilter.checkFeature(this)?t.state=t.refresh.call(this,e,n):t.state=a,t.state},getContext:function(e){return e.contains(this.context)}}}(),function(){function i(e,t,n){if(!e.getCustomData("indent_processed")){var i=this.editor,a=this.isIndent;if(t){if(n=0,(i=e.$.className.match(this.classNameRegex))&&(i=i[1],n=CKEDITOR.tools.indexOf(t,i)+1),(n+=a?1:-1)<0)return;n=Math.min(n,t.length),n=Math.max(n,0),e.$.className=CKEDITOR.tools.ltrim(e.$.className.replace(this.classNameRegex,"")),0<n&&e.addClass(t[n-1])}else{t=o(e,n),n=parseInt(e.getStyle(t),10);var s=i.config.indentOffset||40;if(isNaN(n)&&(n=0),(n+=(a?1:-1)*s)<0)return;n=Math.max(n,0),n=Math.ceil(n/s)*s,e.setStyle(t,n?n+(i.config.indentUnit||"px"):""),""===e.getAttribute("style")&&e.removeAttribute("style")}CKEDITOR.dom.element.setMarker(this.database,e,"indent_processed",1)}}function o(e,t){return"ltr"==(t||e.getComputedStyle("direction"))?"margin-left":"margin-right"}var r=CKEDITOR.dtd.$listItem,a=CKEDITOR.dtd.$list,l=CKEDITOR.TRISTATE_DISABLED,c=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentblock",{requires:"indent",init:function(e){function t(){n.specificDefinition.apply(this,arguments),this.allowedContent={"div h1 h2 h3 h4 h5 h6 ol p pre ul":{propertiesOnly:!0,styles:s?null:"margin-left,margin-right",classes:s||null}},this.contentTransformations=[["div: splitMarginShorthand"],["h1: splitMarginShorthand"],["h2: splitMarginShorthand"],["h3: splitMarginShorthand"],["h4: splitMarginShorthand"],["h5: splitMarginShorthand"],["h6: splitMarginShorthand"],["ol: splitMarginShorthand"],["p: splitMarginShorthand"],["pre: splitMarginShorthand"],["ul: splitMarginShorthand"]],this.enterBr&&(this.allowedContent.div=!0),this.requiredContent=(this.enterBr?"div":"p")+(s?"("+s.join(",")+")":"{margin-left}"),this.jobs={20:{refresh:function(e,t){if(!(n=t.block||t.blockLimit).is(r))var n=(i=n.getAscendant(r))&&t.contains(i)||n;if(n.is(r)&&(n=n.getParent()),this.enterBr||this.getContext(t)){if(s){var i=s,a=(n=n.$.className.match(this.classNameRegex),this.isIndent);return(i=n?!a||n[1]!=i.slice(-1):a)?c:l}return this.isIndent?c:n?CKEDITOR[(parseInt(n.getStyle(o(n)),10)||0)<=0?"TRISTATE_DISABLED":"TRISTATE_OFF"]:l}return l},exec:function(e){var t,n=(n=e.getSelection())&&n.getRanges()[0];if(t=e.elementPath().contains(a))i.call(this,t,s);else for(n=n.createIterator(),e=e.config.enterMode,n.enforceRealBlocks=!0,n.enlargeBr=e!=CKEDITOR.ENTER_BR;t=n.getNextParagraph(e==CKEDITOR.ENTER_P?"p":"div");)t.isReadOnly()||i.call(this,t,s);return!0}}}}var n=CKEDITOR.plugins.indent,s=e.config.indentClasses;n.registerCommands(e,{indentblock:new t(e,"indentblock",!0),outdentblock:new t(e,"outdentblock")}),CKEDITOR.tools.extend(t.prototype,n.specificDefinition.prototype,{context:{div:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,ul:1,ol:1,p:1,pre:1,table:1},classNameRegex:s?new RegExp("(?:^|\\s+)("+s.join("|")+")(?=$|\\s)"):null})}})}(),function(){function a(d){function e(e){for(var t=u.startContainer,n=u.endContainer;t&&!t.getParent().equals(e);)t=t.getParent();for(;n&&!n.getParent().equals(e);)n=n.getParent();if(!t||!n)return!1;for(var i=t,a=(t=[],!1);!a;)i.equals(n)&&(a=!0),t.push(i),i=i.getNext();if(t.length<1)return!1;for(i=e.getParents(!0),n=0;n<i.length;n++)if(i[n].getName&&p[i[n].getName()]){e=i[n];break}i=_.isIndent?1:-1,n=t[0],t=t[t.length-1];var s=(a=CKEDITOR.plugins.list.listToArray(e,h))[t.getCustomData("listarray_index")].indent;for(n=n.getCustomData("listarray_index");n<=t.getCustomData("listarray_index");n++)if(a[n].indent+=i,0<i){var o=a[n].parent;a[n].parent=new CKEDITOR.dom.element(o.getName(),o.getDocument())}for(n=t.getCustomData("listarray_index")+1;n<a.length&&a[n].indent>s;n++)a[n].indent+=i;var r;if((t=CKEDITOR.plugins.list.arrayToList(a,h,null,d.config.enterMode,e.getDirection()),!_.isIndent)&&((r=e.getParent())&&r.is("li"))){var l,c=[];for(n=(i=t.listNode.getChildren()).count()-1;0<=n;n--)(l=i.getItem(n))&&l.is&&l.is("li")&&c.push(l)}if(t&&t.listNode.replace(e),c&&c.length)for(n=0;n<c.length;n++){for(l=e=c[n];(l=l.getNext())&&l.is&&l.getName()in p;)CKEDITOR.env.needsNbspFiller&&!e.getFirst(f)&&e.append(u.document.createText("\xa0")),e.append(l);e.insertAfter(r)}return t&&d.fire("contentDomInvalidated"),!0}for(var u,_=this,h=this.database,p=this.context,t=((t=d.getSelection())&&t.getRanges()).createIterator();u=t.getNextRange();){for(var n=u.getCommonAncestor();n&&(n.type!=CKEDITOR.NODE_ELEMENT||!p[n.getName()]);){if(d.editable().equals(n)){n=!1;break}n=n.getParent()}if(n||(n=u.startPath().contains(p))&&u.setEndAt(n,CKEDITOR.POSITION_BEFORE_END),!n){var i=u.getEnclosedNode();i&&i.type==CKEDITOR.NODE_ELEMENT&&i.getName()in p&&(u.setStartAt(i,CKEDITOR.POSITION_AFTER_START),u.setEndAt(i,CKEDITOR.POSITION_BEFORE_END),n=i)}if(n&&u.startContainer.type==CKEDITOR.NODE_ELEMENT&&u.startContainer.getName()in p&&((i=new CKEDITOR.dom.walker(u)).evaluator=s,u.startContainer=i.next()),n&&u.endContainer.type==CKEDITOR.NODE_ELEMENT&&u.endContainer.getName()in p&&((i=new CKEDITOR.dom.walker(u)).evaluator=s,u.endContainer=i.previous()),n)return e(n)}return 0}function s(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.is("li")}function f(e){return t(e)&&n(e)}var t=CKEDITOR.dom.walker.whitespaces(!0),n=CKEDITOR.dom.walker.bookmark(!1,!0),o=CKEDITOR.TRISTATE_DISABLED,r=CKEDITOR.TRISTATE_OFF;CKEDITOR.plugins.add("indentlist",{requires:"indent",init:function(e){function t(i){n.specificDefinition.apply(this,arguments),this.requiredContent=["ul","ol"],i.on("key",function(e){var t=i.elementPath();if("wysiwyg"==i.mode&&e.data.keyCode==this.indentKey&&t){var n=this.getContext(t);!n||this.isIndent&&CKEDITOR.plugins.indentList.firstItemInPath(this.context,t,n)||(i.execCommand(this.relatedGlobal),e.cancel())}},this),this.jobs[this.isIndent?10:30]={refresh:this.isIndent?function(e,t){var n=this.getContext(t),i=CKEDITOR.plugins.indentList.firstItemInPath(this.context,t,n);return n&&this.isIndent&&!i?r:o}:function(e,t){return!this.getContext(t)||this.isIndent?o:r},exec:CKEDITOR.tools.bind(a,this)}}var n=CKEDITOR.plugins.indent;n.registerCommands(e,{indentlist:new t(e,"indentlist",!0),outdentlist:new t(e,"outdentlist")}),CKEDITOR.tools.extend(t.prototype,n.specificDefinition.prototype,{context:{ol:1,ul:1}})}}),CKEDITOR.plugins.indentList={},CKEDITOR.plugins.indentList.firstItemInPath=function(e,t,n){var i=t.contains(s);return n||(n=t.contains(e)),n&&i&&i.equals(n.getFirst(s))}}(),CKEDITOR.plugins.add("smiley",{requires:"dialog",init:function(e){e.config.smiley_path=e.config.smiley_path||this.path+"images/",e.addCommand("smiley",new CKEDITOR.dialogCommand("smiley",{allowedContent:"img[alt,height,!src,title,width]",requiredContent:"img"})),e.ui.addButton&&e.ui.addButton("Smiley",{label:e.lang.smiley.toolbar,command:"smiley",toolbar:"insert,50"}),CKEDITOR.dialog.add("smiley",this.path+"dialogs/smiley.js")}}),CKEDITOR.config.smiley_images="regular_smile.png sad_smile.png wink_smile.png teeth_smile.png confused_smile.png tongue_smile.png embarrassed_smile.png omg_smile.png whatchutalkingabout_smile.png angry_smile.png angel_smile.png shades_smile.png devil_smile.png cry_smile.png lightbulb.png thumbs_down.png thumbs_up.png heart.png broken_heart.png kiss.png envelope.png".split(" "),CKEDITOR.config.smiley_descriptions="smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail".split(";"),function(){function _(e,t){var n;if(t=void 0===t||t)n=e.getComputedStyle("text-align");else{for(;(!e.hasAttribute||!e.hasAttribute("align")&&!e.getStyle("text-align"))&&(n=e.getParent());)e=n;n=e.getStyle("text-align")||e.getAttribute("align")||""}return n&&(n=n.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i,"")),!n&&t&&(n="rtl"==e.getComputedStyle("direction")?"right":"left"),n}function s(e,t,n){this.editor=e,this.name=t,this.value=n,this.context="p",t=e.config.justifyClasses;var i=e.config.enterMode==CKEDITOR.ENTER_P?"p":"div";if(t){switch(n){case"left":this.cssClassName=t[0];break;case"center":this.cssClassName=t[1];break;case"right":this.cssClassName=t[2];break;case"justify":this.cssClassName=t[3]}this.cssClassRegex=new RegExp("(?:^|\\s+)(?:"+t.join("|")+")(?=$|\\s)"),this.requiredContent=i+"("+this.cssClassName+")"}else this.requiredContent=i+"{text-align}";this.allowedContent={"caption div h1 h2 h3 h4 h5 h6 p pre td th li":{propertiesOnly:!0,styles:this.cssClassName?null:"text-align",classes:this.cssClassName||null}},e.config.enterMode==CKEDITOR.ENTER_BR&&(this.allowedContent.div=!0)}function o(e){var t=e.editor,n=t.createRange();n.setStartBefore(e.data.node),n.setEndAfter(e.data.node);for(var i,a=new CKEDITOR.dom.walker(n);i=a.next();)if(i.type==CKEDITOR.NODE_ELEMENT)if(!i.equals(e.data.node)&&i.getDirection())n.setStartAfter(i),a=new CKEDITOR.dom.walker(n);else{var s=t.config.justifyClasses;s&&(i.hasClass(s[0])?(i.removeClass(s[0]),i.addClass(s[2])):i.hasClass(s[2])&&(i.removeClass(s[2]),i.addClass(s[0]))),"left"==(s=i.getStyle("text-align"))?i.setStyle("text-align","right"):"right"==s&&i.setStyle("text-align","left")}}s.prototype={exec:function(e){var t=e.getSelection(),n=e.config.enterMode;if(t){for(var i,a,s=t.createBookmarks(),o=t.getRanges(),r=this.cssClassName,l=void 0===(l=e.config.useComputedState)||l,c=o.length-1;0<=c;c--)for((i=o[c].createIterator()).enlargeBr=n!=CKEDITOR.ENTER_BR;a=i.getNextParagraph(n==CKEDITOR.ENTER_P?"p":"div");)if(!a.isReadOnly()){a.removeAttribute("align"),a.removeStyle("text-align");var d=r&&(a.$.className=CKEDITOR.tools.ltrim(a.$.className.replace(this.cssClassRegex,""))),u=this.state==CKEDITOR.TRISTATE_OFF&&(!l||_(a,!0)!=this.value);r?u?a.addClass(r):d||a.removeAttribute("class"):u&&a.setStyle("text-align",this.value)}e.focus(),e.forceNextSelectionCheck(),t.selectBookmarks(s)}},refresh:function(e,t){var n=t.block||t.blockLimit;this.setState("body"!=n.getName()&&_(n,this.editor.config.useComputedState)==this.value?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}},CKEDITOR.plugins.add("justify",{init:function(e){if(!e.blockless){var t=new s(e,"justifyleft","left"),n=new s(e,"justifycenter","center"),i=new s(e,"justifyright","right"),a=new s(e,"justifyblock","justify");e.addCommand("justifyleft",t),e.addCommand("justifycenter",n),e.addCommand("justifyright",i),e.addCommand("justifyblock",a),e.ui.addButton&&(e.ui.addButton("JustifyLeft",{label:e.lang.justify.left,command:"justifyleft",toolbar:"align,10"}),e.ui.addButton("JustifyCenter",{label:e.lang.justify.center,command:"justifycenter",toolbar:"align,20"}),e.ui.addButton("JustifyRight",{label:e.lang.justify.right,command:"justifyright",toolbar:"align,30"}),e.ui.addButton("JustifyBlock",{label:e.lang.justify.block,command:"justifyblock",toolbar:"align,40"})),e.on("dirChanged",o)}}})}(),CKEDITOR.plugins.add("menubutton",{requires:"button,menu",onLoad:function(){var t=function(t){var n=this._,e=n.menu;n.state!==CKEDITOR.TRISTATE_DISABLED&&(n.on&&e?e.hide():(n.previousState=n.state,e||((e=n.menu=new CKEDITOR.menu(t,{panel:{className:"cke_menu_panel",attributes:{"aria-label":t.lang.common.options}}})).onHide=CKEDITOR.tools.bind(function(){var e=this.command?t.getCommand(this.command).modes:this.modes;this.setState(!e||e[t.mode]?n.previousState:CKEDITOR.TRISTATE_DISABLED),n.on=0},this),this.onMenu&&e.addListener(this.onMenu)),this.setState(CKEDITOR.TRISTATE_ON),n.on=1,setTimeout(function(){e.show(CKEDITOR.document.getById(n.id),4)},0)))};CKEDITOR.ui.menuButton=CKEDITOR.tools.createClass({base:CKEDITOR.ui.button,$:function(e){delete e.panel,this.base(e),this.hasArrow=!0,this.click=t},statics:{handler:{create:function(e){return new CKEDITOR.ui.menuButton(e)}}}})},beforeInit:function(e){e.ui.addHandler(CKEDITOR.UI_MENUBUTTON,CKEDITOR.ui.menuButton.handler)}}),CKEDITOR.UI_MENUBUTTON="menubutton",CKEDITOR.plugins.add("language",{requires:"menubutton",init:function(i){var e,t,n,a,s=i.config.language_list||["ar:Arabic:rtl","fr:French","es:Spanish"],o=this,r=i.lang.language,l={};for(i.addCommand("language",{allowedContent:"span[!lang,!dir]",requiredContent:"span[lang,dir]",contextSensitive:!0,exec:function(e,t){var n=l["language_"+t];n&&e[n.style.checkActive(e.elementPath(),e)?"removeStyle":"applyStyle"](n.style)},refresh:function(e){this.setState(o.getCurrentLangElement(e)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)}}),a=0;a<s.length;a++)t=(e=s[a].split(":"))[0],l[n="language_"+t]={label:e[1],langId:t,group:"language",order:a,ltr:"rtl"!=(""+e[2]).toLowerCase(),onClick:function(){i.execCommand("language",this.langId)},role:"menuitemcheckbox"},l[n].style=new CKEDITOR.style({element:"span",attributes:{lang:t,dir:l[n].ltr?"ltr":"rtl"}});l.language_remove={label:r.remove,group:"language_remove",state:CKEDITOR.TRISTATE_DISABLED,order:l.length,onClick:function(){var e=o.getCurrentLangElement(i);e&&i.execCommand("language",e.getAttribute("lang"))}},i.addMenuGroup("language",1),i.addMenuGroup("language_remove"),i.addMenuItems(l),i.ui.add("Language",CKEDITOR.UI_MENUBUTTON,{label:r.button,allowedContent:"span[!lang,!dir]",requiredContent:"span[lang,dir]",toolbar:"bidi,30",command:"language",onMenu:function(){var e,t={},n=o.getCurrentLangElement(i);for(e in l)t[e]=CKEDITOR.TRISTATE_OFF;return t.language_remove=n?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,n&&(t["language_"+n.getAttribute("lang")]=CKEDITOR.TRISTATE_ON),t}})},getCurrentLangElement:function(e){var t,n=e.elementPath();if(e=n&&n.elements,n)for(var i=0;i<e.length;i++)n=e[i],!t&&"span"==n.getName()&&n.hasAttribute("dir")&&n.hasAttribute("lang")&&(t=n);return t}}),function(){function u(e){return e.replace(/'/g,"\\$&")}function _(e){for(var t,n=e.length,i=[],a=0;a<n;a++)t=e.charCodeAt(a),i.push(t);return"String.fromCharCode("+i.join(",")+")"}function h(e,t){var n,i,a=e.plugins.link,s=a.compiledProtectionFunction.params;i=[a.compiledProtectionFunction.name,"("];for(var o=0;o<s.length;o++)n=t[a=s[o].toLowerCase()],0<o&&i.push(","),i.push("'",n?u(encodeURIComponent(t[a])):"","'");return i.push(")"),i.join("")}function t(e){var i;return(e=e.config.emailProtection||"")&&"encode"!=e&&(i={},e.replace(/^([^(]+)\(([^)]+)\)$/,function(e,t,n){i.name=t,i.params=[],n.replace(/[^,\s]+/g,function(e){i.params.push(e)})})),i}CKEDITOR.plugins.add("link",{requires:"dialog,fakeobjects",onLoad:function(){function e(e){return n.replace(/%1/g,"rtl"==e?"right":"left").replace(/%2/g,"cke_contents_"+e)}var t="background:url("+CKEDITOR.getUrl(this.path+"images"+(CKEDITOR.env.hidpi?"/hidpi":"")+"/anchor.png")+") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",n=".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{"+t+"padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{"+t+"width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";CKEDITOR.addCss(e("ltr")+e("rtl"))},init:function(n){var e="a[!href]";CKEDITOR.dialog.isTabEnabled(n,"link","advanced")&&(e=e.replace("]",",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type,download]{*}(*)")),CKEDITOR.dialog.isTabEnabled(n,"link","target")&&(e=e.replace("]",",target,onclick]")),n.addCommand("link",new CKEDITOR.dialogCommand("link",{allowedContent:e,requiredContent:"a[href]"})),n.addCommand("anchor",new CKEDITOR.dialogCommand("anchor",{allowedContent:"a[!name,id]",requiredContent:"a[name]"})),n.addCommand("unlink",new CKEDITOR.unlinkCommand),n.addCommand("removeAnchor",new CKEDITOR.removeAnchorCommand),n.setKeystroke(CKEDITOR.CTRL+76,"link"),n.ui.addButton&&(n.ui.addButton("Link",{label:n.lang.link.toolbar,command:"link",toolbar:"links,10"}),n.ui.addButton("Unlink",{label:n.lang.link.unlink,command:"unlink",toolbar:"links,20"}),n.ui.addButton("Anchor",{label:n.lang.link.anchor.toolbar,command:"anchor",toolbar:"links,30"})),CKEDITOR.dialog.add("link",this.path+"dialogs/link.js"),CKEDITOR.dialog.add("anchor",this.path+"dialogs/anchor.js"),n.on("doubleclick",function(e){var t=CKEDITOR.plugins.link.getSelectedLink(n)||e.data.element.getAscendant("a",1);t&&!t.isReadOnly()&&(t.is("a")?(e.data.dialog=!t.getAttribute("name")||t.getAttribute("href")&&t.getChildCount()?"link":"anchor",e.data.link=t):CKEDITOR.plugins.link.tryRestoreFakeAnchor(n,t)&&(e.data.dialog="anchor"))},null,null,0),n.on("doubleclick",function(e){e.data.dialog in{link:1,anchor:1}&&e.data.link&&n.getSelection().selectElement(e.data.link)},null,null,20),n.addMenuItems&&n.addMenuItems({anchor:{label:n.lang.link.anchor.menu,command:"anchor",group:"anchor",order:1},removeAnchor:{label:n.lang.link.anchor.remove,command:"removeAnchor",group:"anchor",order:5},link:{label:n.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:n.lang.link.unlink,command:"unlink",group:"link",order:5}}),n.contextMenu&&n.contextMenu.addListener(function(e){if(!e||e.isReadOnly())return null;if(!(e=CKEDITOR.plugins.link.tryRestoreFakeAnchor(n,e))&&!(e=CKEDITOR.plugins.link.getSelectedLink(n)))return null;var t={};return e.getAttribute("href")&&e.getChildCount()&&(t={link:CKEDITOR.TRISTATE_OFF,unlink:CKEDITOR.TRISTATE_OFF}),e&&e.hasAttribute("name")&&(t.anchor=t.removeAnchor=CKEDITOR.TRISTATE_OFF),t}),this.compiledProtectionFunction=t(n)},afterInit:function(n){n.dataProcessor.dataFilter.addRules({elements:{a:function(e){return e.attributes.name?e.children.length?null:n.createFakeParserElement(e,"cke_anchor","anchor"):null}}});var e=n._.elementsPath&&n._.elementsPath.filters;e&&e.push(function(e,t){if("a"==t&&(CKEDITOR.plugins.link.tryRestoreFakeAnchor(n,e)||e.getAttribute("name")&&(!e.getAttribute("href")||!e.getChildCount())))return"anchor"})}});var c=/^javascript:/,d=/^mailto:([^?]+)(?:\?(.+))?$/,p=/subject=([^;?:@&=$,\/]*)/i,f=/body=([^;?:@&=$,\/]*)/i,m=/^#(.*)$/,g=/^((?:http|https|ftp|news):\/\/)?(.*)$/,A=/^(_(?:self|top|parent|blank))$/,v=/^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,b=/^javascript:([^(]+)\(([^)]+)\)$/,y=/\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,$=/(?:^|,)([^=]+)=(\d+|yes|no)/gi,w={id:"advId",dir:"advLangDir",accessKey:"advAccessKey",name:"advName",lang:"advLangCode",tabindex:"advTabIndex",title:"advTitle",type:"advContentType","class":"advCSSClasses",charset:"advCharset",style:"advStyles",rel:"advRel"};CKEDITOR.plugins.link={getSelectedLink:function(e,t){var n,i=e.getSelection(),a=i.getSelectedElement(),s=i.getRanges(),o=[];if(!t&&a&&a.is("a"))return a;for(a=0;a<s.length;a++)if((n=i.getRanges()[a]).shrink(CKEDITOR.SHRINK_TEXT,!1,{skipBogus:!0}),(n=e.elementPath(n.getCommonAncestor()).contains("a",1))&&t)o.push(n);else if(n)return n;return t?o:null},getEditorAnchors:function(e){for(var t,n=(i=(n=e.editable()).isInline()&&!e.plugins.divarea?e.document:n).getElementsByTag("a"),i=i.getElementsByTag("img"),a=[],s=0;t=n.getItem(s++);)(t.data("cke-saved-name")||t.hasAttribute("name"))&&a.push({name:t.data("cke-saved-name")||t.getAttribute("name"),id:t.getAttribute("id")});for(s=0;t=i.getItem(s++);)(t=this.tryRestoreFakeAnchor(e,t))&&a.push({name:t.getAttribute("name"),id:t.getAttribute("id")});return a},fakeAnchor:!0,tryRestoreFakeAnchor:function(e,t){if(t&&t.data("cke-real-element-type")&&"anchor"==t.data("cke-real-element-type")){var n=e.restoreRealElement(t);if(n.data("cke-saved-name"))return n}},parseLinkAttributes:function(e,t){var n,i=t&&(t.data("cke-saved-href")||t.getAttribute("href"))||"",o=e.plugins.link.compiledProtectionFunction,a=e.config.emailProtection,r={};if(i.match(c)&&("encode"==a?i=i.replace(v,function(e,t,n){return n=n||"","mailto:"+String.fromCharCode.apply(String,t.split(","))+n.replace(/\\'/g,"'")}):a&&i.replace(b,function(e,t,n){if(t==o.name){r.type="email",e=r.email={},t=/(^')|('$)/g;for(var i,a=(n=n.match(/[^,\s]+/g)).length,s=0;s<a;s++)i=decodeURIComponent(i=n[s].replace(t,"").replace(/\\'/g,"'")),e[o.params[s].toLowerCase()]=i;e.address=[e.name,e.domain].join("@")}})),!r.type)if(a=i.match(m))r.type="anchor",r.anchor={},r.anchor.name=r.anchor.id=a[1];else if(a=i.match(d)){n=i.match(p),i=i.match(f),r.type="email";var s=r.email={};s.address=a[1],n&&(s.subject=decodeURIComponent(n[1])),i&&(s.body=decodeURIComponent(i[1]))}else i&&(n=i.match(g))&&(r.type="url",r.url={},r.url.protocol=n[1],r.url.url=n[2]);if(t){if(i=t.getAttribute("target"))r.target={type:i.match(A)?i:"frame",name:i};else if(i=(i=t.data("cke-pa-onclick")||t.getAttribute("onclick"))&&i.match(y))for(r.target={type:"popup",name:i[1]};a=$.exec(i[2]);)"yes"!=a[2]&&"1"!=a[2]||a[1]in{height:1,width:1,top:1,left:1}?isFinite(a[2])&&(r.target[a[1]]=a[2]):r.target[a[1]]=!0;null!==t.getAttribute("download")&&(r.download=!0);var l;i={};for(l in w)(a=t.getAttribute(l))&&(i[w[l]]=a);(l=t.data("cke-saved-name")||i.advName)&&(i.advName=l),CKEDITOR.tools.isEmpty(i)||(r.advanced=i)}return r},getLinkAttributes:function(e,t){var n=e.config.emailProtection||"",i={};switch(t.type){case"url":n=t.url&&void 0!==t.url.protocol?t.url.protocol:"http://";var a=t.url&&CKEDITOR.tools.trim(t.url.url)||"";i["data-cke-saved-href"]=0===a.indexOf("/")?a:n+a;break;case"anchor":n=t.anchor&&t.anchor.id,i["data-cke-saved-href"]="#"+(t.anchor&&t.anchor.name||n||"");break;case"email":a=(r=t.email).address;switch(n){case"":case"encode":var s=encodeURIComponent(r.subject||""),o=encodeURIComponent(r.body||""),r=[];s&&r.push("subject="+s),o&&r.push("body="+o),r=r.length?"?"+r.join("&"):"","encode"==n?(n=["javascript:void(location.href='mailto:'+",_(a)],r&&n.push("+'",u(r),"'"),n.push(")")):n=["mailto:",a,r];break;default:n=a.split("@",2),r.name=n[0],r.domain=n[1],n=["javascript:",h(e,r)]}i["data-cke-saved-href"]=n.join("")}if(t.target)if("popup"==t.target.type){n=["window.open(this.href, '",t.target.name||"","', '"];var l="resizable status location toolbar menubar fullscreen scrollbars dependent".split(" ");for(a=l.length,s=function(e){t.target[e]&&l.push(e+"="+t.target[e])},r=0;r<a;r++)l[r]+=t.target[l[r]]?"=yes":"=no";s("width"),s("left"),s("height"),s("top"),n.push(l.join(","),"'); return false;"),i["data-cke-pa-onclick"]=n.join("")}else"notSet"!=t.target.type&&t.target.name&&(i.target=t.target.name);if(t.download&&(i.download=""),t.advanced){for(var c in w)(n=t.advanced[w[c]])&&(i[c]=n);i.name&&(i["data-cke-saved-name"]=i.name)}for(var d in i["data-cke-saved-href"]&&(i.href=i["data-cke-saved-href"]),c={target:1,onclick:1,"data-cke-pa-onclick":1,"data-cke-saved-name":1,download:1},t.advanced&&CKEDITOR.tools.extend(c,w),i)delete c[d];return{set:i,removed:CKEDITOR.tools.objectKeys(c)}},showDisplayTextForElement:function(e,t){var n={img:1,table:1,tbody:1,thead:1,tfoot:1,input:1,select:1,textarea:1},i=t.getSelection();return!(t.widgets&&t.widgets.focused||i&&1<i.getRanges().length)&&(!e||!e.getName||!e.is(n))}},CKEDITOR.unlinkCommand=function(){},CKEDITOR.unlinkCommand.prototype={exec:function(e){if(CKEDITOR.env.ie){var t,n=e.getSelection().getRanges()[0],i=n.getPreviousEditableNode()&&n.getPreviousEditableNode().getAscendant("a",!0)||n.getNextEditableNode()&&n.getNextEditableNode().getAscendant("a",!0);n.collapsed&&i&&(t=n.createBookmark(),n.selectNodeContents(i),n.select())}i=new CKEDITOR.style({element:"a",type:CKEDITOR.STYLE_INLINE,alwaysRemoveElement:1}),e.removeStyle(i),t&&(n.moveToBookmark(t),n.select())},refresh:function(e,t){var n=t.lastElement&&t.lastElement.getAscendant("a",!0);n&&"a"==n.getName()&&n.getAttribute("href")&&n.getChildCount()?this.setState(CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_DISABLED)},contextSensitive:1,startDisabled:1,requiredContent:"a[href]",editorFocus:1},CKEDITOR.removeAnchorCommand=function(){},CKEDITOR.removeAnchorCommand.prototype={exec:function(e){var t,n=e.getSelection(),i=n.createBookmarks();n&&(t=n.getSelectedElement())&&(t.getChildCount()?t.is("a"):CKEDITOR.plugins.link.tryRestoreFakeAnchor(e,t))?t.remove(1):(t=CKEDITOR.plugins.link.getSelectedLink(e))&&(t.hasAttribute("href")?(t.removeAttributes({name:1,"data-cke-saved-name":1}),t.removeClass("cke_anchor")):t.remove(1)),n.selectBookmarks(i)},requiredContent:"a[name]"},CKEDITOR.tools.extend(CKEDITOR.config,{linkShowAdvancedTab:!0,linkShowTargetTab:!0})}(),function(){function g(t,n,e){function i(e){!(l=d[e?"getFirst":"getLast"]())||l.is&&l.isBlockBoundary()||!(c=n.root[e?"getPrevious":"getNext"](CKEDITOR.dom.walker.invisible(!0)))||c.is&&c.isBlockBoundary({br:1})||t.document.createElement("br")[e?"insertBefore":"insertAfter"](l)}for(var a=CKEDITOR.plugins.list.listToArray(n.root,e),s=[],o=0;o<n.contents.length;o++){var r=n.contents[o];(r=r.getAscendant("li",!0))&&!r.getCustomData("list_item_processed")&&(s.push(r),CKEDITOR.dom.element.setMarker(e,r,"list_item_processed",!0))}for(r=null,o=0;o<s.length;o++)a[r=s[o].getCustomData("listarray_index")].indent=-1;for(o=r+1;o<a.length;o++)if(a[o].indent>a[o-1].indent+1){for(s=a[o-1].indent+1-a[o].indent,r=a[o].indent;a[o]&&a[o].indent>=r;)a[o].indent+=s,o++;o--}var l,c,d=CKEDITOR.plugins.list.arrayToList(a,e,null,t.config.enterMode,n.root.getAttribute("dir")).listNode;i(!0),i(),d.replace(n.root),t.fire("contentDomInvalidated")}function e(e,t){this.name=e,this.context=this.type=t,this.allowedContent=t+" li",this.requiredContent=t}function c(e,t,n,i){for(var a,s;a=e[i?"getLast":"getFirst"](o);)(s=a.getDirection(1))!==t.getDirection(1)&&a.setAttribute("dir",s),a.remove(),n?a[i?"insertBefore":"insertAfter"](n):t.append(a,i)}function A(n){function e(e){var t=n[e?"getPrevious":"getNext"](E);t&&t.type==CKEDITOR.NODE_ELEMENT&&t.is(n.getName())&&(c(n,t,null,!e),n.remove(),n=t)}e(),e(1)}function u(e){return e.type==CKEDITOR.NODE_ELEMENT&&(e.getName()in CKEDITOR.dtd.$block||e.getName()in CKEDITOR.dtd.$listItem)&&CKEDITOR.dtd[e.getName()]["#"]}function _(e,t,n){e.fire("saveSnapshot"),n.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);var i=n.extractContents();t.trim(!1,!0);var a=t.createBookmark(),s=(o=new CKEDITOR.dom.elementPath(t.startContainer)).block,o=o.lastElement.getAscendant("li",1)||s,r=(l=new CKEDITOR.dom.elementPath(n.startContainer)).contains(CKEDITOR.dtd.$listItem),l=l.contains(CKEDITOR.dtd.$list);for(s?(s=s.getBogus())&&s.remove():l&&(s=l.getPrevious(E))&&p(s)&&s.remove(),(s=i.getLast())&&s.type==CKEDITOR.NODE_ELEMENT&&s.is("br")&&s.remove(),(s=t.startContainer.getChild(t.startOffset))?i.insertBefore(s):t.startContainer.append(i),r&&(i=h(r))&&(o.contains(r)?(c(i,r.getParent(),r),i.remove()):o.append(i));n.checkStartOfBlock()&&n.checkEndOfBlock()&&(i=(l=n.startPath()).block);)i.is("li")&&(o=i.getParent(),i.equals(o.getLast(E))&&i.equals(o.getFirst(E))&&(i=o)),n.moveToPosition(i,CKEDITOR.POSITION_BEFORE_START),i.remove();n=n.clone(),i=e.editable(),n.setEndAt(i,CKEDITOR.POSITION_BEFORE_END),(n=new CKEDITOR.dom.walker(n)).evaluator=function(e){return E(e)&&!p(e)},(n=n.next())&&n.type==CKEDITOR.NODE_ELEMENT&&n.getName()in CKEDITOR.dtd.$list&&A(n),t.moveToBookmark(a),t.select(),e.fire("saveSnapshot")}function h(e){return(e=e.getLast(E))&&e.type==CKEDITOR.NODE_ELEMENT&&e.getName()in k?e:null}var k={ol:1,ul:1},t=CKEDITOR.dom.walker.whitespaces(),C=CKEDITOR.dom.walker.bookmark(),E=function(e){return!(t(e)||C(e))},p=CKEDITOR.dom.walker.bogus();CKEDITOR.plugins.list={listToArray:function(e,t,n,i,a){if(!k[e.getName()])return[];i||(i=0),n||(n=[]);for(var s=0,o=e.getChildCount();s<o;s++){var r=e.getChild(s);if(r.type==CKEDITOR.NODE_ELEMENT&&r.getName()in CKEDITOR.dtd.$list&&CKEDITOR.plugins.list.listToArray(r,t,n,i+1),"li"==r.$.nodeName.toLowerCase()){var l={parent:e,indent:i,element:r,contents:[]};a?l.grandparent=a:(l.grandparent=e.getParent(),l.grandparent&&"li"==l.grandparent.$.nodeName.toLowerCase()&&(l.grandparent=l.grandparent.getParent())),t&&CKEDITOR.dom.element.setMarker(t,r,"listarray_index",n.length),n.push(l);for(var c,d=0,u=r.getChildCount();d<u;d++)(c=r.getChild(d)).type==CKEDITOR.NODE_ELEMENT&&k[c.getName()]?CKEDITOR.plugins.list.listToArray(c,t,n,i+1,l.grandparent):l.contents.push(c)}}return n},arrayToList:function(e,t,n,i,a){if(n||(n=0),!e||e.length<n+1)return null;for(var s,o,r,l=e[n].parent.getDocument(),c=new CKEDITOR.dom.documentFragment(l),d=null,u=n,_=Math.max(e[n].indent,0),h=null,p=i==CKEDITOR.ENTER_P?"p":"div";;){var f=e[u];if(s=f.grandparent,o=f.element.getDirection(1),f.indent==_){for(d&&e[u].parent.getName()==d.getName()||(d=e[u].parent.clone(!1,1),a&&d.setAttribute("dir",a),c.append(d)),h=d.append(f.element.clone(0,1)),o!=d.getDirection(1)&&h.setAttribute("dir",o),s=0;s<f.contents.length;s++)h.append(f.contents[s].clone(1,1));u++}else if(f.indent==Math.max(_,0)+1)f=e[u-1].element.getDirection(1),u=CKEDITOR.plugins.list.arrayToList(e,null,u,i,f!=o?o:null),!h.getChildCount()&&CKEDITOR.env.needsNbspFiller&&l.$.documentMode<=7&&h.append(l.createText("\xa0")),h.append(u.listNode),u=u.nextIndex;else{if(-1!=f.indent||n||!s)return null;k[s.getName()]?(h=f.element.clone(!1,!0),o!=s.getDirection(1)&&h.setAttribute("dir",o)):h=new CKEDITOR.dom.documentFragment(l);d=s.getDirection(1)!=o;var m,g,A=f.element,v=A.getAttribute("class"),b=A.getAttribute("style"),y=h.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&(i!=CKEDITOR.ENTER_BR||d||b||v),$=f.contents.length;for(s=0;s<$;s++)if(m=f.contents[s],C(m)&&1<$)y?g=m.clone(1,1):h.append(m.clone(1,1));else if(m.type==CKEDITOR.NODE_ELEMENT&&m.isBlockBoundary()){d&&!m.getDirection()&&m.setAttribute("dir",o),r=m;var w=A.getAttribute("style");w&&r.setAttribute("style",w.replace(/([^;])$/,"$1;")+(r.getAttribute("style")||"")),v&&m.addClass(v),r=null,g&&(h.append(g),g=null),h.append(m.clone(1,1))}else y?(r||(r=l.createElement(p),h.append(r),d&&r.setAttribute("dir",o)),b&&r.setAttribute("style",b),v&&r.setAttribute("class",v),g&&(r.append(g),g=null),r.append(m.clone(1,1))):h.append(m.clone(1,1));g&&((r||h).append(g),g=null),h.type==CKEDITOR.NODE_DOCUMENT_FRAGMENT&&u!=e.length-1&&(CKEDITOR.env.needsBrFiller&&(o=h.getLast())&&o.type==CKEDITOR.NODE_ELEMENT&&o.is("br")&&o.remove(),(o=h.getLast(E))&&o.type==CKEDITOR.NODE_ELEMENT&&o.is(CKEDITOR.dtd.$block)||h.append(l.createElement("br"))),"div"!=(o=h.$.nodeName.toLowerCase())&&"p"!=o||h.appendBogus(),c.append(h),d=null,u++}if(r=null,e.length<=u||Math.max(e[u].indent,0)<_)break}if(t)for(e=c.getFirst();e;){if(e.type==CKEDITOR.NODE_ELEMENT&&(CKEDITOR.dom.element.clearMarkers(t,e),e.getName()in CKEDITOR.dtd.$listItem&&(l=a=i=void 0,i=(n=e).getDirection()))){for(a=n.getParent();a&&!(l=a.getDirection());)a=a.getParent();i==l&&n.removeAttribute("dir")}e=e.getNextSourceNode()}return{listNode:c,nextIndex:u}}};var v=/^h[1-6]$/,o=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);e.prototype={exec:function(e){this.refresh(e,e.elementPath());var t=e.config,n=e.getSelection(),i=n&&n.getRanges();if(this.state==CKEDITOR.TRISTATE_OFF)if((s=e.editable()).getFirst(E)){var a=1==i.length&&i[0];(t=a&&a.getEnclosedNode())&&t.is&&this.type==t.getName()&&this.setState(CKEDITOR.TRISTATE_ON)}else t.enterMode==CKEDITOR.ENTER_BR?s.appendBogus():i[0].fixBlock(1,t.enterMode==CKEDITOR.ENTER_P?"p":"div"),n.selectRanges(i);t=n.createBookmarks(!0);for(var s=[],o={},r=(i=i.createIterator(),0);(a=i.getNextRange())&&++r;){var l=(f=a.getBoundaryNodes()).startNode,c=f.endNode;for(l.type==CKEDITOR.NODE_ELEMENT&&"td"==l.getName()&&a.setStartAt(f.startNode,CKEDITOR.POSITION_AFTER_START),c.type==CKEDITOR.NODE_ELEMENT&&"td"==c.getName()&&a.setEndAt(f.endNode,CKEDITOR.POSITION_BEFORE_END),(a=a.createIterator()
).forceBrBreak=this.state==CKEDITOR.TRISTATE_OFF;f=a.getNextParagraph();)if(!f.getCustomData("list_block")){CKEDITOR.dom.element.setMarker(o,f,"list_block",1);l=(u=e.elementPath(f)).elements,c=0;for(var d,u=u.blockLimit,_=l.length-1;0<=_&&(d=l[_]);_--)if(k[d.getName()]&&u.contains(d)){u.removeCustomData("list_group_object_"+r),(l=d.getCustomData("list_group_object"))?l.contents.push(f):(l={root:d,contents:[f]},s.push(l),CKEDITOR.dom.element.setMarker(o,d,"list_group_object",l)),c=1;break}c||((c=u).getCustomData("list_group_object_"+r)?c.getCustomData("list_group_object_"+r).contents.push(f):(l={root:c,contents:[f]},CKEDITOR.dom.element.setMarker(o,c,"list_group_object_"+r,l),s.push(l)))}}for(d=[];0<s.length;)if(l=s.shift(),this.state==CKEDITOR.TRISTATE_OFF)if(k[l.root.getName()]){for(i=e,r=l,l=o,a=d,c=CKEDITOR.plugins.list.listToArray(r.root,l),u=[],f=0;f<r.contents.length;f++)(_=(_=r.contents[f]).getAscendant("li",!0))&&!_.getCustomData("list_item_processed")&&(u.push(_),CKEDITOR.dom.element.setMarker(l,_,"list_item_processed",!0));_=r.root.getDocument();for(var h=void 0,p=void 0,f=0;f<u.length;f++){var m=u[f].getCustomData("listarray_index");(h=c[m].parent).is(this.type)||(p=_.createElement(this.type),h.copyAttributes(p,{start:1,type:1}),p.removeStyle("list-style-type"),c[m].parent=p)}for(l=CKEDITOR.plugins.list.arrayToList(c,l,null,i.config.enterMode),c=void 0,u=l.listNode.getChildCount(),f=0;f<u&&(c=l.listNode.getChild(f));f++)c.getName()==this.type&&a.push(c);l.listNode.replace(r.root),i.fire("contentDomInvalidated")}else{for(c=e,f=d,u=(a=l).contents,i=a.root.getDocument(),r=[],1==u.length&&u[0].equals(a.root)&&(l=i.createElement("div"),u[0].moveChildren&&u[0].moveChildren(l),u[0].append(l),u[0]=l),a=a.contents[0].getParent(),_=0;_<u.length;_++)a=a.getCommonAncestor(u[_].getParent());for(h=c.config.useComputedState,c=l=void 0,h=void 0===h||h,_=0;_<u.length;_++)for(p=u[_];m=p.getParent();){if(m.equals(a)){r.push(p),!c&&p.getDirection()&&(c=1),p=p.getDirection(h),null!==l&&(l=l&&l!=p?null:p);break}p=m}if(!(r.length<1)){for(u=r[r.length-1].getNext(),_=i.createElement(this.type),f.push(_),h=f=void 0;r.length;)f=r.shift(),h=i.createElement("li"),(p=f).is("pre")||v.test(p.getName())||"false"==p.getAttribute("contenteditable")?f.appendTo(h):(f.copyAttributes(h),l&&f.getDirection()&&(h.removeStyle("direction"),h.removeAttribute("dir")),f.moveChildren(h),f.remove()),h.appendTo(_);l&&c&&_.setAttribute("dir",l),u?_.insertBefore(u):_.appendTo(a)}}else this.state==CKEDITOR.TRISTATE_ON&&k[l.root.getName()]&&g.call(this,e,l,o);for(_=0;_<d.length;_++)A(d[_]);CKEDITOR.dom.element.clearAllMarkers(o),n.selectBookmarks(t),e.focus()},refresh:function(e,t){var n=t.contains(k,1),i=t.blockLimit||t.root;n&&i.contains(n)?this.setState(n.is(this.type)?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF):this.setState(CKEDITOR.TRISTATE_OFF)}},CKEDITOR.plugins.add("list",{requires:"indentlist",init:function(d){d.blockless||(d.addCommand("numberedlist",new e("numberedlist","ol")),d.addCommand("bulletedlist",new e("bulletedlist","ul")),d.ui.addButton&&(d.ui.addButton("NumberedList",{label:d.lang.list.numberedlist,command:"numberedlist",directional:!0,toolbar:"list,10"}),d.ui.addButton("BulletedList",{label:d.lang.list.bulletedlist,command:"bulletedlist",directional:!0,toolbar:"list,20"})),d.on("key",function(e){var t,n=e.data.domEvent.getKey();if("wysiwyg"==d.mode&&n in{8:1,46:1}){var i=d.getSelection().getRanges()[0],a=i&&i.startPath();if(i&&i.collapsed){var s,o=8==n,r=d.editable(),l=new CKEDITOR.dom.walker(i.clone());if(l.evaluator=function(e){return E(e)&&!p(e)},l.guard=function(e,t){return!(t&&e.type==CKEDITOR.NODE_ELEMENT&&e.is("table"))},n=i.clone(),o)if((s=a.contains(k))&&i.checkBoundaryOfElement(s,CKEDITOR.START)&&(s=s.getParent())&&s.is("li")&&(s=h(s))?(s=(t=s).getPrevious(E),n.moveToPosition(s&&p(s)?s:t,CKEDITOR.POSITION_BEFORE_START)):(l.range.setStartAt(r,CKEDITOR.POSITION_AFTER_START),l.range.setEnd(i.startContainer,i.startOffset),(s=l.previous())&&s.type==CKEDITOR.NODE_ELEMENT&&(s.getName()in k||s.is("li"))&&(s.is("li")||(l.range.selectNodeContents(s),l.reset(),l.evaluator=u,s=l.previous()),t=s,n.moveToElementEditEnd(t),n.moveToPosition(n.endPath().block,CKEDITOR.POSITION_BEFORE_END))),t)_(d,n,i),e.cancel();else{var c=a.contains(k);c&&i.checkBoundaryOfElement(c,CKEDITOR.START)&&(t=c.getFirst(E),i.checkBoundaryOfElement(t,CKEDITOR.START)&&(s=c.getPrevious(E),h(t)?s&&(i.moveToElementEditEnd(s),i.select()):d.execCommand("outdent"),e.cancel()))}else if(t=a.contains("li")){if(l.range.setEndAt(r,CKEDITOR.POSITION_BEFORE_END),o=(r=t.getLast(E))&&u(r)?r:t,a=0,(s=l.next())&&s.type==CKEDITOR.NODE_ELEMENT&&s.getName()in k&&s.equals(r)?(a=1,s=l.next()):i.checkBoundaryOfElement(o,CKEDITOR.END)&&(a=2),a&&s){if((i=i.clone()).moveToElementEditStart(s),1==a&&(n.optimize(),!n.startContainer.equals(t))){for(t=n.startContainer;t.is(CKEDITOR.dtd.$inline);)t=(c=t).getParent();c&&n.moveToPosition(c,CKEDITOR.POSITION_AFTER_END)}2==a&&(n.moveToPosition(n.endPath().block,CKEDITOR.POSITION_BEFORE_END),i.endPath().block&&i.moveToPosition(i.endPath().block,CKEDITOR.POSITION_AFTER_START)),_(d,n,i),e.cancel()}}else l.range.setEndAt(r,CKEDITOR.POSITION_BEFORE_END),(s=l.next())&&s.type==CKEDITOR.NODE_ELEMENT&&s.is(k)&&(s=s.getFirst(E),a.block&&i.checkStartOfBlock()&&i.checkEndOfBlock()?(a.block.remove(),i.moveToElementEditStart(s),i.select()):h(s)?(i.moveToElementEditStart(s),i.select()):((i=i.clone()).moveToElementEditStart(s),_(d,n,i)),e.cancel());setTimeout(function(){d.selectionChange(1)})}}}))}})}(),CKEDITOR.plugins.liststyle={requires:"dialog,contextmenu",init:function(e){var t;e.blockless||(t=new CKEDITOR.dialogCommand("numberedListStyle",{requiredContent:"ol",allowedContent:"ol{list-style-type}[start]; li{list-style-type}[value]",contentTransformations:[["ol: listTypeToStyle"]]}),t=e.addCommand("numberedListStyle",t),e.addFeature(t),CKEDITOR.dialog.add("numberedListStyle",this.path+"dialogs/liststyle.js"),t=new CKEDITOR.dialogCommand("bulletedListStyle",{requiredContent:"ul",allowedContent:"ul{list-style-type}",contentTransformations:[["ul: listTypeToStyle"]]}),t=e.addCommand("bulletedListStyle",t),e.addFeature(t),CKEDITOR.dialog.add("bulletedListStyle",this.path+"dialogs/liststyle.js"),e.addMenuGroup("list",108),e.addMenuItems({numberedlist:{label:e.lang.liststyle.numberedTitle,group:"list",command:"numberedListStyle"},bulletedlist:{label:e.lang.liststyle.bulletedTitle,group:"list",command:"bulletedListStyle"}}),e.contextMenu.addListener(function(e){if(!e||e.isReadOnly())return null;for(;e;){var t=e.getName();if("ol"==t)return{numberedlist:CKEDITOR.TRISTATE_OFF};if("ul"==t)return{bulletedlist:CKEDITOR.TRISTATE_OFF};e=e.getParent()}return null}))}},CKEDITOR.plugins.add("liststyle",CKEDITOR.plugins.liststyle),function(){function d(e,t,n){return v(t)&&v(n)&&n.equals(t.getNext(function(e){return!(X(e)||J(e)||b(e))}))}function u(e){this.upper=e[0],this.lower=e[1],this.set.apply(this,e.slice(2))}function c(e){var t=e.element;if(t&&v(t)&&(t=t.getAscendant(e.triggers,!0))&&e.editable.contains(t)){var n=o(t);if("true"==n.getAttribute("contenteditable"))return t;if(n.is(e.triggers))return n}return null}function _(e,t,n){return x(e,t),x(e,n),e=t.size.bottom,n=n.size.top,e&&n?0|(e+n)/2:e||n}function h(t,e,n){return e[n?"getPrevious":"getNext"](function(e){return e&&e.type==CKEDITOR.NODE_TEXT&&!X(e)||v(e)&&!b(e)&&!A(t,e)})}function p(e,t,n){return t<e&&e<n}function o(e,t){if(e.data("cke-editable"))return null;for(t||(e=e.getParent());e&&!e.data("cke-editable");){if(e.hasAttribute("contenteditable"))return e;e=e.getParent()}return null}function f(c){var e=c.doc,t=i('<span contenteditable="false" style="'+W+"position:absolute;border-top:1px dashed "+c.boxColor+'"></span>',e),n=CKEDITOR.getUrl(this.path+"images/"+(R.hidpi?"hidpi/":"")+"icon"+(c.rtl?"-rtl":"")+".png");for(S(t,{attach:function(){return this.wrap.getParent()||this.wrap.appendTo(c.editable,!0),this},lineChildren:[S(i('<span title="'+c.editor.lang.magicline.title+'" contenteditable="false">&#8629;</span>',e),{base:W+"height:17px;width:17px;"+(c.rtl?"left":"right")+":17px;background:url("+n+") center no-repeat "+c.boxColor+";cursor:pointer;"+(R.hc?"font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;":"")+(R.hidpi?"background-size: 9px 10px;":""),looks:["top:-8px; border-radius: 2px;","top:-17px; border-radius: 2px 2px 0px 0px;","top:-1px; border-radius: 0px 0px 2px 2px;"]}),S(i(V,e),{base:Y+"left:0px;border-left-color:"+c.boxColor+";",looks:["border-width:8px 0 8px 8px;top:-8px","border-width:8px 0 0 8px;top:-8px","border-width:0 0 8px 8px;top:0px"]}),S(i(V,e),{base:Y+"right:0px;border-right-color:"+c.boxColor+";",looks:["border-width:8px 8px 8px 0;top:-8px","border-width:8px 8px 0 0;top:-8px","border-width:0 8px 8px 0;top:0px"]})],detach:function(){return this.wrap.getParent()&&this.wrap.remove(),this},mouseNear:function(){x(c,this);var e=c.holdDistance,t=this.size;return!!(t&&p(c.mouse.y,t.top-e,t.bottom+e)&&p(c.mouse.x,t.left-e,t.right+e))},place:function(){var e=c.view,t=c.editable,n=c.trigger,i=n.upper,a=n.lower,s=i||a,o=s.getParent(),r={};for(var l in this.trigger=n,i&&x(c,i,!0),a&&x(c,a,!0),x(c,o,!0),c.inInlineMode&&I(c,!0),o.equals(t)?(r.left=e.scroll.x,r.right=-e.scroll.x,r.width=""):(r.left=s.size.left-s.size.margin.left+e.scroll.x-(c.inInlineMode?e.editable.left+e.editable.border.left:0),r.width=s.size.outerWidth+s.size.margin.left+s.size.margin.right+e.scroll.x,r.right=""),i&&a?r.top=i.size.margin.bottom===a.size.margin.top?0|i.size.bottom+i.size.margin.bottom/2:i.size.margin.bottom<a.size.margin.top?i.size.bottom+i.size.margin.bottom:i.size.bottom+i.size.margin.bottom-a.size.margin.top:i?a||(r.top=i.size.bottom+i.size.margin.bottom):r.top=a.size.top-a.size.margin.top,n.is(L)||p(r.top,e.scroll.y-15,e.scroll.y+5)?(r.top=c.inInlineMode?0:e.scroll.y,this.look(L)):n.is(P)||p(r.top,e.pane.bottom-5,e.pane.bottom+15)?(r.top=c.inInlineMode?e.editable.height+e.editable.padding.top+e.editable.padding.bottom:e.pane.bottom-1,this.look(P)):(c.inInlineMode&&(r.top-=e.editable.top+e.editable.border.top),this.look(U)),c.inInlineMode&&(r.top--,r.top+=e.editable.scroll.top,r.left+=e.editable.scroll.left),r)r[l]=CKEDITOR.tools.cssLength(r[l]);this.setStyles(r)},look:function(e){if(this.oldLook!=e){for(var t,n=this.lineChildren.length;n--;)(t=this.lineChildren[n]).setAttribute("style",t.base+t.looks[0|e/2]);this.oldLook=e}},wrap:new r("span",c.doc)}),e=t.lineChildren.length;e--;)t.lineChildren[e].appendTo(t);t.look(U),t.appendTo(t.wrap),t.unselectable(),t.lineChildren[0].on("mouseup",function(e){t.detach(),m(c,function(e){var t=c.line.trigger;e[t.is(F)?"insertBefore":"insertAfter"](t.is(F)?t.lower:t.upper)},!0),c.editor.focus(),R.ie||c.enterMode==CKEDITOR.ENTER_BR||c.hotNode.scrollIntoView(),e.data.preventDefault(!0)}),t.on("mousedown",function(e){e.data.preventDefault(!0)}),c.line=t}function m(e,t,n){var i,a=new CKEDITOR.dom.range(e.doc),s=e.editor;R.ie&&e.enterMode==CKEDITOR.ENTER_BR?i=e.doc.createText(H):(i=(i=o(e.element,!0))&&i.data("cke-enter-mode")||e.enterMode,(i=new r(l[i],e.doc)).is("br")||e.doc.createText(H).appendTo(i)),n&&s.fire("saveSnapshot"),t(i),a.moveToPosition(i,CKEDITOR.POSITION_AFTER_START),s.getSelection().selectRanges([a]),e.hotNode=i,n&&s.fire("saveSnapshot")}function g(a,s){return{canUndo:!0,modes:{wysiwyg:1},exec:function(){function i(t){var e=R.ie&&R.version<9?" ":H,n=a.hotNode&&a.hotNode.getText()==e&&a.element.equals(a.hotNode)&&a.lastCmdDirection===!!s;m(a,function(e){n&&a.hotNode&&a.hotNode.remove(),e[s?"insertAfter":"insertBefore"](t),e.setAttributes({"data-cke-magicline-hot":1,"data-cke-magicline-dir":!!s}),a.lastCmdDirection=!!s}),R.ie||a.enterMode==CKEDITOR.ENTER_BR||a.hotNode.scrollIntoView(),a.line.detach()}return function(e){var t,n;(e=(e=e.getSelection().getStartElement()).getAscendant(q,1),w(a,e)||!e||e.equals(a.editable)||e.contains(a.editable))||((t=o(e))&&"false"==t.getAttribute("contenteditable")&&(e=t),a.element=e,v(t=h(a,e,!s))&&t.is(a.triggers)&&t.is(z)&&(!h(a,t,!s)||(n=h(a,t,!s))&&v(n)&&n.is(a.triggers))?i(t):v(n=c(a,e))&&(h(a,n,!s)?(e=h(a,n,!s))&&v(e)&&e.is(a.triggers)&&i(n):i(n)))}}()}}function A(e,t){if(!t||t.type!=CKEDITOR.NODE_ELEMENT||!t.$)return!1;var n=e.line;return n.wrap.equals(t)||n.wrap.contains(t)}function v(e){return e&&e.type==CKEDITOR.NODE_ELEMENT&&e.$}function b(e){return!!v(e)&&((t=y(e))||(v(e)?t=!(!(t={left:1,right:1,center:1})[e.getComputedStyle("float")]&&!t[e.getAttribute("align")]):t=!1),t);var t}function y(e){return!!{absolute:1,fixed:1}[e.getComputedStyle("position")]}function $(e,t){return v(t)?t.is(e.triggers):null}function w(e,t){if(!t)return!1;for(var n=t.getParents(1),i=n.length;i--;)for(var a=e.tabuList.length;a--;)if(n[i].hasAttribute(e.tabuList[a]))return!0;return!1}function k(t,e,n){return!!(e=e[n?"getLast":"getFirst"](function(e){return t.isRelevant(e)&&!e.is(a)}))&&(x(t,e),n?e.size.top>t.mouse.y:e.size.bottom<t.mouse.y)}function C(e){var t=e.editable,n=e.mouse,i=e.view,a=e.triggerOffset;I(e);var s=n.y>(e.inInlineMode?i.editable.top+i.editable.height/2:Math.min(i.editable.height,i.pane.height)/2);return(t=t[s?"getLast":"getFirst"](function(e){return!(X(e)||J(e))}))?(A(e,t)&&(t=e.line.wrap[s?"getPrevious":"getNext"](function(e){return!(X(e)||J(e))})),v(t)&&!b(t)&&$(e,t)?(x(e,t),!s&&0<=t.size.top&&p(n.y,0,t.size.top+a)?(e=e.inInlineMode||0===i.scroll.y?L:U,new u([null,t,F,j,e])):s&&t.size.bottom<=i.pane.height&&p(n.y,t.size.bottom-a,i.pane.height)?(e=e.inInlineMode||p(t.size.bottom,i.pane.height-a,i.pane.height)?P:U,new u([t,null,K,j,e])):null):null):null}function E(e){var t=e.mouse,n=e.view,i=e.triggerOffset,a=c(e);if(!a)return null;x(e,a);i=Math.min(i,0|a.size.outerHeight/2);var s,o,r=[];if(p(t.y,a.size.top-1,a.size.top+i))o=!1;else{if(!p(t.y,a.size.bottom-i,a.size.bottom+1))return null;o=!0}if(b(a)||k(e,a,o)||a.getParent().is(Q))return null;var l=h(e,a,!o);if(l){if(l&&l.type==CKEDITOR.NODE_TEXT)return null;if(v(l)){if(b(l)||!$(e,l)||l.getParent().is(Q))return null;r=[l,a][o?"reverse":"concat"]().concat([M,j])}}else a.equals(e.editable[o?"getLast":"getFirst"](e.isRelevant))?(I(e),o&&p(t.y,a.size.bottom-i,n.pane.height)&&p(a.size.bottom,n.pane.height-i,n.pane.height)?s=P:p(t.y,0,a.size.top+i)&&(s=L)):s=U,r=[null,a][o?"reverse":"concat"]().concat([o?K:F,j,s,a.equals(e.editable[o?"getLast":"getFirst"](e.isRelevant))?o?P:L:U]);return 0 in r?new u(r):null}function T(e,t,n,i){for(var a=t.getDocumentPosition(),s={},o={},r={},l={},c=ee.length;c--;)s[ee[c]]=parseInt(t.getComputedStyle.call(t,"border-"+ee[c]+"-width"),10)||0,r[ee[c]]=parseInt(t.getComputedStyle.call(t,"padding-"+ee[c]),10)||0,o[ee[c]]=parseInt(t.getComputedStyle.call(t,"margin-"+ee[c]),10)||0;return n&&!i||D(e,i),l.top=a.y-(n?0:e.view.scroll.y),l.left=a.x-(n?0:e.view.scroll.x),l.outerWidth=t.$.offsetWidth,l.outerHeight=t.$.offsetHeight,l.height=l.outerHeight-(r.top+r.bottom+s.top+s.bottom),l.width=l.outerWidth-(r.left+r.right+s.left+s.right),l.bottom=l.top+l.outerHeight,l.right=l.left+l.outerWidth,e.inInlineMode&&(l.scroll={top:t.$.scrollTop,left:t.$.scrollLeft}),S({border:s,padding:r,margin:o,ignoreScroll:n},l,!0)}function x(e,t,n){if(!v(t))return t.size=null;if(t.size){if(t.size.ignoreScroll==n&&t.size.date>new Date-s)return null}else t.size={};return S(t.size,T(e,t,n),{date:+new Date},!0)}function I(e,t){e.view.editable=T(e,e.editable,t,!0)}function D(e,t){e.view||(e.view={});var n=e.view;if(!(!t&&n&&n.date>new Date-s)){n=(i=e.win).getScrollPosition();var i=i.getViewPaneSize();S(e.view,{scroll:{x:n.x,y:n.y,width:e.doc.$.documentElement.scrollWidth-i.width,height:e.doc.$.documentElement.scrollHeight-i.height},pane:{width:i.width,height:i.height,bottom:i.height+n.y},date:+new Date},!0)}}function O(e,t,n,i){for(var a=i,s=i,o=0,r=!1,l=!1,c=e.view.pane.height,d=e.mouse;d.y+o<c&&0<d.y-o&&(r||(r=t(a,i)),l||(l=t(s,i)),!r&&0<d.y-o&&(a=n(e,{x:d.x,y:d.y-o})),!l&&d.y+o<c&&(s=n(e,{x:d.x,y:d.y+o})),!r||!l);)o+=2;return new u([a,s,null,null])}CKEDITOR.plugins.add("magicline",{init:function(a){var i,s,o,r=a.config,e=r.magicline_triggerOffset||30,l={editor:a,enterMode:r.enterMode,triggerOffset:e,holdDistance:0|e*(r.magicline_holdDistance||.5),boxColor:r.magicline_color||"#ff0000",rtl:"rtl"==r.contentsLangDirection,tabuList:["data-cke-hidden-sel"].concat(r.magicline_tabuList||[]),triggers:r.magicline_everywhere?q:{table:1,hr:1,div:1,ul:1,ol:1,dl:1,form:1,blockquote:1}};l.isRelevant=function(e){return v(e)&&!A(l,e)&&!b(e)},a.on("contentDom",function(){var e=a.editable(),t=a.document,n=a.window;S(l,{editable:e,inInlineMode:e.isInline(),doc:t,win:n,hotNode:null},!0),l.boundary=l.inInlineMode?l.editable:l.doc.getDocumentElement(),e.is(N.$inline)||(l.inInlineMode&&!y(e)&&e.setStyles({position:"relative",top:null,left:null}),f.call(this,l),D(l),e.attachListener(a,"beforeUndoImage",function(){l.line.detach()}),e.attachListener(a,"beforeGetData",function(){l.line.wrap.getParent()&&(l.line.detach(),a.once("getData",function(){l.line.attach()},null,null,1e3))},null,null,0),e.attachListener(l.inInlineMode?t:t.getWindow().getFrame(),"mouseout",function(e){if("wysiwyg"==a.mode)if(l.inInlineMode){var t=e.data.$.clientX;e=e.data.$.clientY,D(l),I(l,!0);var n=l.view.editable,i=l.view.scroll;t>n.left-i.x&&t<n.right-i.x&&e>n.top-i.y&&e<n.bottom-i.y||(clearTimeout(o),o=null,l.line.detach())}else clearTimeout(o),o=null,l.line.detach()}),e.attachListener(e,"keyup",function(){l.hiddenMode=0}),e.attachListener(e,"keydown",function(e){if("wysiwyg"==a.mode)switch(e.data.getKeystroke()){case 2228240:case 16:l.hiddenMode=1,l.line.detach()}}),e.attachListener(l.inInlineMode?e:t,"mousemove",function(e){if(s=!0,"wysiwyg"==a.mode&&!a.readOnly&&!o){var t={x:e.data.$.clientX,y:e.data.$.clientY};o=setTimeout(function(){l.mouse=t,o=l.trigger=null,D(l),s&&!l.hiddenMode&&a.focusManager.hasFocus&&!l.line.mouseNear()&&(l.element=G(l,!0))&&((l.trigger=C(l)||E(l)||Z(l))&&!w(l,l.trigger.upper||l.trigger.lower)?l.line.attach().place():(l.trigger=null,l.line.detach()),s=!1)},30)}}),e.attachListener(n,"scroll",function(){"wysiwyg"==a.mode&&(l.line.detach(),R.webkit&&(l.hiddenMode=1,clearTimeout(i),i=setTimeout(function(){l.mouseDown||(l.hiddenMode=0)},50)))}),e.attachListener(B?t:n,"mousedown",function(){"wysiwyg"==a.mode&&(l.line.detach(),l.hiddenMode=1,l.mouseDown=1)}),e.attachListener(B?t:n,"mouseup",function(){l.hiddenMode=0,l.mouseDown=0}),a.addCommand("accessPreviousSpace",g(l)),a.addCommand("accessNextSpace",g(l,!0)),a.setKeystroke([[r.magicline_keystrokePrevious,"accessPreviousSpace"],[r.magicline_keystrokeNext,"accessNextSpace"]]),a.on("loadSnapshot",function(){var e,t,n,i;for(i in{p:1,br:1,div:1})for(n=(e=a.document.getElementsByTag(i)).count();n--;)if((t=e.getItem(n)).data("cke-magicline-hot"))return l.hotNode=t,void(l.lastCmdDirection="true"===t.data("cke-magicline-dir"))}),this.backdoor={accessFocusSpace:m,boxTrigger:u,isLine:A,getAscendantTrigger:c,getNonEmptyNeighbour:h,getSize:T,that:l,triggerEdge:E,triggerEditable:C,triggerExpand:Z})},this)}});var S=CKEDITOR.tools.extend,r=CKEDITOR.dom.element,i=r.createFromHtml,R=CKEDITOR.env,B=CKEDITOR.env.ie&&CKEDITOR.env.version<9,N=CKEDITOR.dtd,l={},F=128,K=64,M=32,j=16,L=4,P=2,U=1,H="\xa0",Q=N.$listItem,a=N.$tableContent,z=S({},N.$nonEditable,N.$empty),q=N.$block,s=100,W="width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",Y=W+"border-color:transparent;display:block;border-style:solid;",V="<span>"+H+"</span>";l[CKEDITOR.ENTER_BR]="br",l[CKEDITOR.ENTER_P]="p",l[CKEDITOR.ENTER_DIV]="div",u.prototype={set:function(e,t,n){return this.properties=e+t+(n||U),this},is:function(e){return(this.properties&e)==e}};var G=function(){function o(e,t){var n=e.$.elementFromPoint(t.x,t.y);return n&&n.nodeType?new CKEDITOR.dom.element(n):null}return function(e,t,n){if(!e.mouse)return null;var i=e.doc,a=e.line.wrap,s=o(i,n=n||e.mouse);return t&&A(e,s)&&(a.hide(),s=o(i,n),a.show()),!s||s.type!=CKEDITOR.NODE_ELEMENT||!s.$||R.ie&&R.version<9&&!e.boundary.equals(s)&&!e.boundary.contains(s)?null:s}}(),X=CKEDITOR.dom.walker.whitespaces(),J=CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),Z=function(){function a(t){var e,n,i;if(!v(l=t.element)||l.contains(t.editable)||l.isReadOnly())return null;if(e=(i=O(t,function(e,t){return!t.equals(e)},function(e,t){return G(e,!0,t)},l)).upper,n=i.lower,d(t,e,n))return i.set(M,8);if(e&&l.contains(e))for(;!e.getParent().equals(l);)e=e.getParent();else e=l.getFirst(function(e){return c(t,e)});if(n&&l.contains(n))for(;!n.getParent().equals(l);)n=n.getParent();else n=l.getLast(function(e){return c(t,e)});if(!e||!n)return null;if(x(t,e),x(t,n),!p(t.mouse.y,e.size.top,n.size.bottom))return null;for(var a,s,o,r,l=Number.MAX_VALUE;n&&!n.equals(e)&&(s=e.getNext(t.isRelevant));)(a=Math.abs(_(t,e,s)-t.mouse.y))<l&&(l=a,o=e,r=s),x(t,e=s);return o&&r&&p(t.mouse.y,o.size.top,r.size.bottom)?(i.upper=o,i.lower=r,i.set(M,8)):null}function c(e,t){return!(t&&t.type==CKEDITOR.NODE_TEXT||J(t)||b(t)||A(e,t)||t.type==CKEDITOR.NODE_ELEMENT&&t.$&&t.is("br"))}return function(e){var t,n=a(e);if(t=n){t=n.upper;var i=n.lower;t=!(!t||!i||b(i)||b(t)||i.equals(t)||t.equals(i)||i.contains(t)||t.contains(i))&&!!($(e,t)&&$(e,i)&&d(e,t,i))}return t?n:null}}(),ee=["top","left","right","bottom"]}(),CKEDITOR.config.magicline_keystrokePrevious=CKEDITOR.CTRL+CKEDITOR.SHIFT+51,CKEDITOR.config.magicline_keystrokeNext=CKEDITOR.CTRL+CKEDITOR.SHIFT+52,function(){function s(e){if(!e||e.type!=CKEDITOR.NODE_ELEMENT||"form"!=e.getName())return[];for(var t=[],n=["style","className"],i=0;i<n.length;i++){var a=e.$.elements.namedItem(n[i]);a&&(a=new CKEDITOR.dom.element(a),t.push([a,a.nextSibling]),a.remove())}return t}function o(e,t){if(e&&e.type==CKEDITOR.NODE_ELEMENT&&"form"==e.getName()&&0<t.length)for(var n=t.length-1;0<=n;n--){var i=t[n][0],a=t[n][1];a?i.insertBefore(a):i.appendTo(e)}}function p(e,t){var n=s(e),i={},a=e.$;return t||(i["class"]=a.className||"",a.className=""),i.inline=a.style.cssText||"",t||(a.style.cssText="position: static; overflow: visible"),o(n),i}function f(e,t){var n=s(e),i=e.$;"class"in t&&(i.className=t["class"]),"inline"in t&&(i.style.cssText=t.inline),o(n)}function m(e){if(!e.editable().isInline()){var t,n=CKEDITOR.instances;for(t in n){var i=n[t];"wysiwyg"!=i.mode||i.readOnly||((i=i.document.getBody()).setAttribute("contentEditable",!1),i.setAttribute("contentEditable",!0))}e.editable().hasFocus&&(e.toolbox.focus(),e.focus())}}CKEDITOR.plugins.add("maximize",{init:function(s){function o(){var e=_.getViewPaneSize();s.resize(e.width,e.height,null,!0)}if(s.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var r,l,c,d=s.lang,u=CKEDITOR.document,_=u.getWindow(),h=CKEDITOR.TRISTATE_OFF;s.addCommand("maximize",{modes:{wysiwyg:!CKEDITOR.env.iOS,source:!CKEDITOR.env.iOS},readOnly:1,editorFocus:!1,exec:function(){var e=s.container.getFirst(function(e){return e.type==CKEDITOR.NODE_ELEMENT&&e.hasClass("cke_inner")}),t=s.ui.space("contents");if("wysiwyg"==s.mode){var n=s.getSelection();r=n&&n.getRanges(),l=_.getScrollPosition()}else{var i=s.editable().$;r=!CKEDITOR.env.ie&&[i.selectionStart,i.selectionEnd],l=[i.scrollLeft,i.scrollTop]}if(this.state==CKEDITOR.TRISTATE_OFF){for(_.on("resize",o),c=_.getScrollPosition(),n=s.container;n=n.getParent();)n.setCustomData("maximize_saved_styles",p(n)),n.setStyle("z-index",s.config.baseFloatZIndex-5);t.setCustomData("maximize_saved_styles",p(t,!0)),e.setCustomData("maximize_saved_styles",p(e,!0)),t={overflow:CKEDITOR.env.webkit?"":"hidden",width:0,height:0},u.getDocumentElement().setStyles(t),!CKEDITOR.env.gecko&&u.getDocumentElement().setStyle("position","fixed"),CKEDITOR.env.gecko&&CKEDITOR.env.quirks||u.getBody().setStyles(t),CKEDITOR.env.ie?setTimeout(function(){_.$.scrollTo(0,0)},0):_.$.scrollTo(0,0),e.setStyle("position",CKEDITOR.env.gecko&&CKEDITOR.env.quirks?"fixed":"absolute"),e.$.offsetLeft,e.setStyles({"z-index":s.config.baseFloatZIndex-5,left:"0px",top:"0px"}),e.addClass("cke_maximized"),o(),t=e.getDocumentPosition(),e.setStyles({left:-1*t.x+"px",top:-1*t.y+"px"}),CKEDITOR.env.gecko&&m(s)}else if(this.state==CKEDITOR.TRISTATE_ON){_.removeListener("resize",o);n=[t,e];for(var a=0;a<n.length;a++)f(n[a],n[a].getCustomData("maximize_saved_styles")),n[a].removeCustomData("maximize_saved_styles");for(n=s.container;n=n.getParent();)f(n,n.getCustomData("maximize_saved_styles")),n.removeCustomData("maximize_saved_styles");CKEDITOR.env.ie?setTimeout(function(){_.$.scrollTo(c.x,c.y)},0):_.$.scrollTo(c.x,c.y),e.removeClass("cke_maximized"),CKEDITOR.env.webkit&&(e.setStyle("display","inline"),setTimeout(function(){e.setStyle("display","block")},0)),s.fire("resize",{outerHeight:s.container.$.offsetHeight,contentsHeight:t.$.offsetHeight,outerWidth:s.container.$.offsetWidth})}this.toggleState(),(n=this.uiItems[0])&&(t=this.state==CKEDITOR.TRISTATE_OFF?d.maximize.maximize:d.maximize.minimize,(n=CKEDITOR.document.getById(n._.id)).getChild(1).setHtml(t),n.setAttribute("title",t),n.setAttribute("href",'javascript:void("'+t+'");')),"wysiwyg"==s.mode?r?(CKEDITOR.env.gecko&&m(s),s.getSelection().selectRanges(r),(i=s.getSelection().getStartElement())&&i.scrollIntoView(!0)):_.$.scrollTo(l.x,l.y):(r&&(i.selectionStart=r[0],i.selectionEnd=r[1]),i.scrollLeft=l[0],i.scrollTop=l[1]),r=l=null,h=this.state,s.fire("maximize",this.state)},canUndo:!1}),s.ui.addButton&&s.ui.addButton("Maximize",{label:d.maximize.maximize,command:"maximize",toolbar:"tools,10"}),s.on("mode",function(){var e=s.getCommand("maximize");e.setState(e.state==CKEDITOR.TRISTATE_DISABLED?CKEDITOR.TRISTATE_DISABLED:h)},null,null,100)}}})}(),CKEDITOR.plugins.add("newpage",{init:function(e){e.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(e){var t=this;e.setData(e.config.newpage_html||"",function(){e.focus(),setTimeout(function(){e.fire("afterCommandExec",{name:"newpage",command:t}),e.selectionChange()},200)})},async:!0}),e.ui.addButton&&e.ui.addButton("NewPage",{label:e.lang.newpage.toolbar,command:"newpage",toolbar:"document,20"})}}),function(){function o(e){return{"aria-label":e,"class":"cke_pagebreak",contenteditable:"false","data-cke-display-name":"pagebreak","data-cke-pagebreak":1,style:"page-break-after: always",title:e}}CKEDITOR.plugins.add("pagebreak",{requires:"fakeobjects",onLoad:function(){var e=("background:url("+CKEDITOR.getUrl(this.path+"images/pagebreak.gif")+") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:7px;cursor:default;").replace(/;/g," !important;");CKEDITOR.addCss("div.cke_pagebreak{"+e+"}")},init:function(t){t.blockless||(t.addCommand("pagebreak",CKEDITOR.plugins.pagebreakCmd),t.ui.addButton&&t.ui.addButton("PageBreak",{label:t.lang.pagebreak.toolbar,command:"pagebreak",toolbar:"insert,70"}),CKEDITOR.env.webkit&&t.on("contentDom",function(){t.document.on("click",function(e){(e=e.data.getTarget()).is("div")&&e.hasClass("cke_pagebreak")&&t.getSelection().selectElement(e)})}))},afterInit:function(t){function n(e){CKEDITOR.tools.extend(e.attributes,o(t.lang.pagebreak.alt),!0),e.children.length=0}var e=(i=t.dataProcessor)&&i.dataFilter,i=i&&i.htmlFilter,a=/page-break-after\s*:\s*always/i,s=/display\s*:\s*none/i;i&&i.addRules({attributes:{"class":function(e,t){var n=e.replace("cke_pagebreak","");if(n!=e){var i=CKEDITOR.htmlParser.fragment.fromHtml('<span style="display: none;">&nbsp;</span>').children[0];t.children.length=0,t.add(i),delete(i=t.attributes)["aria-label"],delete i.contenteditable,delete i.title}return n}}},{applyToAll:!0,priority:5}),e&&e.addRules({elements:{div:function(e){if(e.attributes["data-cke-pagebreak"])n(e);else if(a.test(e.attributes.style)){var t=e.children[0];t&&"span"==t.name&&s.test(t.attributes.style)&&n(e)}}}})}}),CKEDITOR.plugins.pagebreakCmd={exec:function(e){var t=e.document.createElement("div",{attributes:o(e.lang.pagebreak.alt)});e.insertElement(t)},context:"div",allowedContent:{div:{styles:"!page-break-after"},span:{match:function(e){return(e=e.parent)&&"div"==e.name&&e.styles&&e.styles["page-break-after"]},styles:"display"}},requiredContent:"div{page-break-after}"}}(),q={canUndo:!1,async:!0,exec:function(e,t){var n=e.lang,i=CKEDITOR.tools.keystrokeToString(n.common.keyboard,e.getCommandKeystroke(CKEDITOR.env.ie?e.commands.paste:this)),a=t&&"undefined"!=typeof t.notification?t.notification:!t||!t.from||"keystrokeHandler"===t.from&&CKEDITOR.env.ie;n=a&&"string"==typeof a?a:n.pastetext.pasteNotification.replace(/%1/,'<kbd aria-label="'+i.aria+'">'+i.display+"</kbd>");e.execCommand("paste",{type:"text",notification:!!a&&n})}},CKEDITOR.plugins.add("pastetext",{requires:"clipboard",init:function(t){var e=CKEDITOR.env.safari?CKEDITOR.CTRL+CKEDITOR.ALT+CKEDITOR.SHIFT+86:CKEDITOR.CTRL+CKEDITOR.SHIFT+86;t.addCommand("pastetext",q),t.setKeystroke(e,"pastetext"),t.ui.addButton&&t.ui.addButton("PasteText",{label:t.lang.pastetext.button,command:"pastetext",toolbar:"clipboard,40"}),t.config.forcePasteAsPlainText&&t.on("beforePaste",function(e){"html"!=e.data.type&&(e.data.type="text")}),t.on("pasteState",function(e){t.getCommand("pastetext").setState(e.data)})}}),function(){function c(e,t,n){var i=CKEDITOR.cleanWord;return i?n():(e=CKEDITOR.getUrl(e.config.pasteFromWordCleanupFile||t+"filter/default.js"),CKEDITOR.scriptLoader.load(e,n,null,!0)),!i}CKEDITOR.plugins.add("pastefromword",{requires:"clipboard",init:function(o){var r=0,l=this.path;o.addCommand("pastefromword",{canUndo:!1,async:!0,exec:function(e,t){r=1,e.execCommand("paste",{type:"html",notification:!t||"undefined"==typeof t.notification||t.notification})}}),o.ui.addButton&&o.ui.addButton("PasteFromWord",{label:o.lang.pastefromword.toolbar,command:"pastefromword",toolbar:"clipboard,50"}),o.on("paste",function(e){var t=e.data,n=(CKEDITOR.plugins.clipboard.isCustomDataTypesSupported?t.dataTransfer.getData("text/html",!0):null)||t.dataValue,i={dataValue:n},a=/(class=\"?Mso|style=(?:\"|\')[^\"]*?\bmso\-|w:WordDocument|<o:\w+>|<\/font>)/;a=/<meta\s*name=(?:\"|\')?generator(?:\"|\')?\s*content=(?:\"|\')?microsoft/gi.test(n)||a.test(n);if(n&&(r||a)&&(!1!==o.fire("pasteFromWord",i)||r)){t.dontFilter=!0;var s=c(o,l,function(){s?o.fire("paste",t):(!o.config.pasteFromWordPromptCleanup||r||confirm(o.lang.pastefromword.confirmCleanup))&&(i.dataValue=CKEDITOR.cleanWord(i.dataValue,o),o.fire("afterPasteFromWord",i),t.dataValue=i.dataValue),r=0});s&&e.cancel()}},null,null,3)}})}(),Y={modes:{wysiwyg:1,source:1},canUndo:!1,readOnly:1,exec:function(e){var t,n=(i=e.config).baseHref?'<base href="'+i.baseHref+'"/>':"";if(i.fullPage)t=e.getData().replace(/<head>/,"$&"+n).replace(/[^>]*(?=<\/title>)/,"$& &mdash; "+e.lang.preview.preview);else{var i="<body ";(s=e.document&&e.document.getBody())&&(s.getAttribute("id")&&(i+='id="'+s.getAttribute("id")+'" '),s.getAttribute("class")&&(i+='class="'+s.getAttribute("class")+'" ')),i+=">",t=e.config.docType+'<html dir="'+e.config.contentsLangDirection+'"><head>'+n+"<title>"+e.lang.preview.preview+"</title>"+CKEDITOR.tools.buildStyleHtml(e.config.contentsCss)+"</head>"+i+e.getData()+"</body></html>"}n=640,i=420,s=80;try{var a=window.screen,s=(n=Math.round(.8*a.width),i=Math.round(.7*a.height),Math.round(.1*a.width))}catch(Y){}if(!1===e.fire("contentPreview",e={dataValue:t}))return!1;var o;a="";return CKEDITOR.env.ie&&(window._cke_htmlToLoad=e.dataValue,o="javascript:void( (function(){document.open();"+("("+CKEDITOR.tools.fixDomain+")();").replace(/\/\/.*?\n/g,"").replace(/parent\./g,"window.opener.")+"document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad = null;})() )",a=""),CKEDITOR.env.gecko&&(window._cke_htmlToLoad=e.dataValue,a=CKEDITOR.getUrl(W+"preview.html")),a=window.open(a,null,"toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+n+",height="+i+",left="+s),CKEDITOR.env.ie&&a&&(a.location=o),CKEDITOR.env.ie||CKEDITOR.env.gecko||((o=a.document).open(),o.write(e.dataValue),o.close()),!0}},CKEDITOR.plugins.add("preview",{init:function(e){e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&(W=this.path,e.addCommand("preview",Y),e.ui.addButton&&e.ui.addButton("Preview",{label:e.lang.preview.preview,command:"preview",toolbar:"document,40"}))}}),CKEDITOR.plugins.add("print",{init:function(e){e.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE&&(e.addCommand("print",CKEDITOR.plugins.print),e.ui.addButton&&e.ui.addButton("Print",{label:e.lang.print.toolbar,command:"print",toolbar:"document,50"}))}}),CKEDITOR.plugins.print={exec:function(e){CKEDITOR.env.gecko?e.window.$.print():e.document.$.execCommand("Print")},canUndo:!1,readOnly:1,modes:{wysiwyg:1}},CKEDITOR.plugins.add("removeformat",{init:function(e){e.addCommand("removeFormat",CKEDITOR.plugins.removeformat.commands.removeformat
),e.ui.addButton&&e.ui.addButton("RemoveFormat",{label:e.lang.removeformat.toolbar,command:"removeFormat",toolbar:"cleanup,10"})}}),CKEDITOR.plugins.removeformat={commands:{removeformat:{exec:function(s){for(var e,o=s._.removeFormatRegex||(s._.removeFormatRegex=new RegExp("^(?:"+s.config.removeFormatTags.replace(/,/g,"|")+")$","i")),t=s._.removeAttributes||(s._.removeAttributes=s.config.removeFormatAttributes.split(",")),r=CKEDITOR.plugins.removeformat.filter,n=s.getSelection().getRanges(),i=n.createIterator(),a=function(e){return e.type==CKEDITOR.NODE_ELEMENT};e=i.getNextRange();){e.collapsed||e.enlarge(CKEDITOR.ENLARGE_ELEMENT);var l=e.createBookmark(),c=l.startNode,d=l.endNode,u=function(e){for(var t,n=s.elementPath(e),i=n.elements,a=1;(t=i[a])&&!t.equals(n.block)&&!t.equals(n.blockLimit);a++)o.test(t.getName())&&r(s,t)&&e.breakParent(t)};if(u(c),d)for(u(d),c=c.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT);c&&!c.equals(d);)if(c.isReadOnly()){if(c.getPosition(d)&CKEDITOR.POSITION_CONTAINS)break;c=c.getNext(a)}else u=c.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT),"img"==c.getName()&&c.data("cke-realelement")||!r(s,c)||(o.test(c.getName())?c.remove(1):(c.removeAttributes(t),s.fire("removeFormatCleanup",c))),c=u;e.moveToBookmark(l)}s.forceNextSelectionCheck(),s.getSelection().selectRanges(n)}}},filter:function(e,t){for(var n=e._.removeFormatFilters||[],i=0;i<n.length;i++)if(!1===n[i](t))return!1;return!0}},CKEDITOR.editor.prototype.addRemoveFormatFilter=function(e){this._.removeFormatFilters||(this._.removeFormatFilters=[]),this._.removeFormatFilters.push(e)},CKEDITOR.config.removeFormatTags="b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var",CKEDITOR.config.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign",V={readOnly:1,exec:function(e){if(e.fire("save")&&(e=e.element.$.form))try{e.submit()}catch(V){e.submit.click&&e.submit.click()}}},CKEDITOR.plugins.add("save",{init:function(e){e.elementMode==CKEDITOR.ELEMENT_MODE_REPLACE&&(e.addCommand("save",V).modes={wysiwyg:!!e.element.$.form},e.ui.addButton&&e.ui.addButton("Save",{label:e.lang.save.toolbar,command:"save",toolbar:"document,10"}))}}),CKEDITOR.plugins.add("selectall",{init:function(e){e.addCommand("selectAll",{modes:{wysiwyg:1,source:1},exec:function(e){var t=e.editable();if(t.is("textarea"))e=t.$,CKEDITOR.env.ie?e.createTextRange().execCommand("SelectAll"):(e.selectionStart=0,e.selectionEnd=e.value.length),e.focus();else{if(t.is("body"))e.document.$.execCommand("SelectAll",!1,null);else{var n=e.createRange();n.selectNodeContents(t),n.select()}e.forceNextSelectionCheck(),e.selectionChange()}},canUndo:!1}),e.ui.addButton&&e.ui.addButton("SelectAll",{label:e.lang.selectall.toolbar,command:"selectAll",toolbar:"selection,10"})}}),G={readOnly:1,preserveState:!0,editorFocus:!1,exec:function(e){this.toggleState(),this.refresh(e)},refresh:function(e){if(e.document){var t=this.state!=CKEDITOR.TRISTATE_ON||e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&!e.focusManager.hasFocus?"removeClass":"attachClass";e.editable()[t]("cke_show_blocks")}}},CKEDITOR.plugins.add("showblocks",{onLoad:function(){var e,t,n,i,a,s,o="p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "),r=CKEDITOR.getUrl(this.path),l=!(CKEDITOR.env.ie&&CKEDITOR.env.version<9),c=l?":not([contenteditable=false]):not(.cke_show_blocks_off)":"";for(e=t=n=i="";a=o.pop();)e+=".cke_show_blocks "+a+c+(s=o.length?",":""),n+=".cke_show_blocks.cke_contents_ltr "+a+c+s,i+=".cke_show_blocks.cke_contents_rtl "+a+c+s,t+=".cke_show_blocks "+a+c+"{background-image:url("+CKEDITOR.getUrl(r+"images/block_"+a+".png")+")}";CKEDITOR.addCss((e+"{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(t,n+"{background-position:top left;padding-left:8px}",i+"{background-position:top right;padding-right:8px}")),l||CKEDITOR.addCss(".cke_show_blocks [contenteditable=false],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable=false],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable=false],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")},init:function(e){function t(){n.refresh(e)}if(!e.blockless){var n=e.addCommand("showblocks",G);n.canUndo=!1,e.config.startupOutlineBlocks&&n.setState(CKEDITOR.TRISTATE_ON),e.ui.addButton&&e.ui.addButton("ShowBlocks",{label:e.lang.showblocks.toolbar,command:"showblocks",toolbar:"tools,20"}),e.on("mode",function(){n.state!=CKEDITOR.TRISTATE_DISABLED&&n.refresh(e)}),e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE&&(e.on("focus",t),e.on("blur",t)),e.on("contentDom",function(){n.state!=CKEDITOR.TRISTATE_DISABLED&&n.refresh(e)})}}}),X={preserveState:!0,editorFocus:!1,readOnly:1,exec:function(e){this.toggleState(),this.refresh(e)},refresh:function(e){if(e.document){var t=this.state==CKEDITOR.TRISTATE_ON?"attachClass":"removeClass";e.editable()[t]("cke_show_borders")}}},CKEDITOR.plugins.add("showborders",{modes:{wysiwyg:1},onLoad:function(){var e;e=(CKEDITOR.env.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th","{","border : #d3d3d3 1px dotted","}"]:".%1 table.%2,;.%1 table.%2 > tr > td, .%1 table.%2 > tr > th,;.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,;.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,;.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g,"cke_show_border").replace(/%1/g,"cke_show_borders "),CKEDITOR.addCss(e)},init:function(t){var e=t.addCommand("showborders",X);(e.canUndo=!1)!==t.config.startupShowBorders&&e.setState(CKEDITOR.TRISTATE_ON),t.on("mode",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(t)},null,null,100),t.on("contentDom",function(){e.state!=CKEDITOR.TRISTATE_DISABLED&&e.refresh(t)}),t.on("removeFormatCleanup",function(e){e=e.data,t.getCommand("showborders").state==CKEDITOR.TRISTATE_ON&&e.is("table")&&(!e.hasAttribute("border")||parseInt(e.getAttribute("border"),10)<=0)&&e.addClass("cke_show_border")})},afterInit:function(e){var t=e.dataProcessor;e=t&&t.dataFilter,t=t&&t.htmlFilter,e&&e.addRules({elements:{table:function(e){var t=(e=e.attributes)["class"],n=parseInt(e.border,10);n&&!(n<=0)||t&&-1!=t.indexOf("cke_show_border")||(e["class"]=(t||"")+" cke_show_border")}}}),t&&t.addRules({elements:{table:function(e){var t=(e=e.attributes)["class"];t&&(e["class"]=t.replace("cke_show_border","").replace(/\s{2}/," ").replace(/^\s+|\s+$/,""))}}})}}),CKEDITOR.on("dialogDefinition",function(e){var t=e.data.name;"table"!=t&&"tableProperties"!=t||((t=(e=e.data.definition).getContents("info").get("txtBorder")).commit=CKEDITOR.tools.override(t.commit,function(i){return function(e,t){i.apply(this,arguments);var n=parseInt(this.getValue(),10);t[!n||n<=0?"addClass":"removeClass"]("cke_show_border")}}),(e=(e=e.getContents("advanced"))&&e.get("advCSSClasses"))&&(e.setup=CKEDITOR.tools.override(e.setup,function(e){return function(){e.apply(this,arguments),this.setValue(this.getValue().replace(/cke_show_border/,""))}}),e.commit=CKEDITOR.tools.override(e.commit,function(n){return function(e,t){n.apply(this,arguments),parseInt(t.getAttribute("border"),10)||t.addClass("cke_show_border")}})))}),function(){CKEDITOR.plugins.add("sourcearea",{init:function(n){function i(){var e=t&&this.equals(CKEDITOR.document.getActive());this.hide(),this.setStyle("height",this.getParent().$.clientHeight+"px"),this.setStyle("width",this.getParent().$.clientWidth+"px"),this.show(),e&&this.focus()}if(n.elementMode!=CKEDITOR.ELEMENT_MODE_INLINE){var e=CKEDITOR.plugins.sourcearea;n.addMode("source",function(e){var t=n.ui.space("contents").getDocument().createElement("textarea");t.setStyles(CKEDITOR.tools.extend({width:CKEDITOR.env.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"},CKEDITOR.tools.cssVendorPrefix("tab-size",n.config.sourceAreaTabSize||4))),t.setAttribute("dir","ltr"),t.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu"),n.ui.space("contents").append(t),(t=n.editable(new a(n,t))).setData(n.getData(1)),CKEDITOR.env.ie&&(t.attachListener(n,"resize",i,t),t.attachListener(CKEDITOR.document.getWindow(),"resize",i,t),CKEDITOR.tools.setTimeout(i,0,t)),n.fire("ariaWidget",this),e()}),n.addCommand("source",e.commands.source),n.ui.addButton&&n.ui.addButton("Source",{label:n.lang.sourcearea.toolbar,command:"source",toolbar:"mode,10"}),n.on("mode",function(){n.getCommand("source").setState("source"==n.mode?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF)});var t=CKEDITOR.env.ie&&9==CKEDITOR.env.version}}});var a=CKEDITOR.tools.createClass({base:CKEDITOR.editable,proto:{setData:function(e){this.setValue(e),this.status="ready",this.editor.fire("dataReady")},getData:function(){return this.getValue()},insertHtml:function(){},insertElement:function(){},insertText:function(){},setReadOnly:function(e){this[(e?"set":"remove")+"Attribute"]("readOnly","readonly")},detach:function(){a.baseProto.detach.call(this),this.clearCustomData(),this.remove()}}})}(),CKEDITOR.plugins.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},editorFocus:!1,readOnly:1,exec:function(e){"wysiwyg"==e.mode&&e.fire("saveSnapshot"),e.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED),e.setMode("source"==e.mode?"wysiwyg":"source")},canUndo:!1}}},CKEDITOR.plugins.add("specialchar",{availableLangs:{af:1,ar:1,az:1,bg:1,ca:1,cs:1,cy:1,da:1,de:1,"de-ch":1,el:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,es:1,"es-mx":1,et:1,eu:1,fa:1,fi:1,fr:1,"fr-ca":1,gl:1,he:1,hr:1,hu:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lt:1,lv:1,nb:1,nl:1,no:1,oc:1,pl:1,pt:1,"pt-br":1,ru:1,si:1,sk:1,sl:1,sq:1,sv:1,th:1,tr:1,tt:1,ug:1,uk:1,vi:1,zh:1,"zh-cn":1},requires:"dialog",init:function(t){var n=this;CKEDITOR.dialog.add("specialchar",this.path+"dialogs/specialchar.js"),t.addCommand("specialchar",{exec:function(){var e=t.langCode;e=n.availableLangs[e]?e:n.availableLangs[e.replace(/-.*/,"")]?e.replace(/-.*/,""):"en";CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(n.path+"dialogs/lang/"+e+".js"),function(){CKEDITOR.tools.extend(t.lang.specialchar,n.langEntries[e]),t.openDialog("specialchar")})},modes:{wysiwyg:1},canUndo:!1}),t.ui.addButton&&t.ui.addButton("SpecialChar",{label:t.lang.specialchar.toolbar,command:"specialchar",toolbar:"insert,50"})}}),CKEDITOR.config.specialChars="! &quot; # $ % &amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ &euro; &lsquo; &rsquo; &ldquo; &rdquo; &ndash; &mdash; &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml; &copy; &ordf; &laquo; &not; &reg; &macr; &deg; &sup2; &sup3; &acute; &micro; &para; &middot; &cedil; &sup1; &ordm; &raquo; &frac14; &frac12; &frac34; &iquest; &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &times; &Oslash; &Ugrave; &Uacute; &Ucirc; &Uuml; &Yacute; &THORN; &szlig; &agrave; &aacute; &acirc; &atilde; &auml; &aring; &aelig; &ccedil; &egrave; &eacute; &ecirc; &euml; &igrave; &iacute; &icirc; &iuml; &eth; &ntilde; &ograve; &oacute; &ocirc; &otilde; &ouml; &divide; &oslash; &ugrave; &uacute; &ucirc; &uuml; &yacute; &thorn; &yuml; &OElig; &oelig; &#372; &#374 &#373 &#375; &sbquo; &#8219; &bdquo; &hellip; &trade; &#9658; &bull; &rarr; &rArr; &hArr; &diams; &asymp;".split(" "),CKEDITOR.plugins.add("scayt",{requires:"menubutton,dialog",tabToOpen:null,dialogName:"scaytDialog",onLoad:function(e){CKEDITOR.plugins.scayt.onLoadTimestamp=(new Date).getTime(),"moono-lisa"==(CKEDITOR.skinName||e.config.skin)&&CKEDITOR.document.appendStyleSheet(this.path+"skins/"+CKEDITOR.skin.name+"/scayt.css"),CKEDITOR.document.appendStyleSheet(this.path+"dialogs/dialog.css")},init:function(i){var a=this,n=CKEDITOR.plugins.scayt;this.bindEvents(i),this.parseConfig(i),this.addRule(i),CKEDITOR.dialog.add(this.dialogName,CKEDITOR.getUrl(this.path+"dialogs/options.js")),this.addMenuItems(i);var e=i.lang.scayt,t=CKEDITOR.env;i.ui.add("Scayt",CKEDITOR.UI_MENUBUTTON,{label:e.text_title,title:i.plugins.wsc?i.lang.wsc.title:e.text_title,modes:{wysiwyg:!(t.ie&&(t.version<8||t.quirks))},toolbar:"spellchecker,20",refresh:function(){var e=i.ui.instances.Scayt.getState();i.scayt&&(e=n.state.scayt[i.name]?CKEDITOR.TRISTATE_ON:CKEDITOR.TRISTATE_OFF),i.fire("scaytButtonState",e)},onRender:function(){var t=this;i.on("scaytButtonState",function(e){void 0!==typeof e.data&&t.setState(e.data)})},onMenu:function(){var e=i.scayt;i.getMenuItem("scaytToggle").label=i.lang.scayt[e&&n.state.scayt[i.name]?"btn_disable":"btn_enable"];var t={scaytToggle:CKEDITOR.TRISTATE_OFF,scaytOptions:e?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytLangs:e?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytDict:e?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,scaytAbout:e?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,WSC:i.plugins.wsc?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED};return i.config.scayt_uiTabs[0]||delete t.scaytOptions,i.config.scayt_uiTabs[1]||delete t.scaytLangs,i.config.scayt_uiTabs[2]||delete t.scaytDict,e&&!CKEDITOR.plugins.scayt.isNewUdSupported(e)&&(delete t.scaytDict,i.config.scayt_uiTabs[2]=0,CKEDITOR.plugins.scayt.alarmCompatibilityMessage()),t}}),i.contextMenu&&i.addMenuItems&&(i.contextMenu.addListener(function(){var e,t,n=i.scayt;return n&&(t=n.getSelectionNode())&&(e=a.menuGenerator(i,t),n.showBanner("."+i.contextMenu._.definition.panel.className.split(" ").join(" ."))),e}),i.contextMenu._.onHide=CKEDITOR.tools.override(i.contextMenu._.onHide,function(t){return function(){var e=i.scayt;return e&&e.hideBanner(),t.apply(this)}}))},addMenuItems:function(i){var t=this,n=CKEDITOR.plugins.scayt;i.addMenuGroup("scaytButton");for(var e=i.config.scayt_contextMenuItemsOrder.split("|"),a=0;a<e.length;a++)e[a]="scayt_"+e[a];if((e=["grayt_description","grayt_suggest","grayt_control"].concat(e))&&e.length)for(a=0;a<e.length;a++)i.addMenuGroup(e[a],a-10);i.addCommand("scaytToggle",{exec:function(e){var t=e.scayt;n.state.scayt[e.name]=!n.state.scayt[e.name],!0===n.state.scayt[e.name]?t||n.createScayt(e):t&&n.destroy(e)}}),i.addCommand("scaytAbout",{exec:function(e){e.scayt.tabToOpen="about",e.lockSelection(),e.openDialog(t.dialogName)}}),i.addCommand("scaytOptions",{exec:function(e){e.scayt.tabToOpen="options",e.lockSelection(),e.openDialog(t.dialogName)}}),i.addCommand("scaytLangs",{exec:function(e){e.scayt.tabToOpen="langs",e.lockSelection(),e.openDialog(t.dialogName)}}),i.addCommand("scaytDict",{exec:function(e){e.scayt.tabToOpen="dictionaries",e.lockSelection(),e.openDialog(t.dialogName)}}),e={scaytToggle:{label:i.lang.scayt.btn_enable,group:"scaytButton",command:"scaytToggle"},scaytAbout:{label:i.lang.scayt.btn_about,group:"scaytButton",command:"scaytAbout"},scaytOptions:{label:i.lang.scayt.btn_options,group:"scaytButton",command:"scaytOptions"},scaytLangs:{label:i.lang.scayt.btn_langs,group:"scaytButton",command:"scaytLangs"},scaytDict:{label:i.lang.scayt.btn_dictionaries,group:"scaytButton",command:"scaytDict"}},i.plugins.wsc&&(e.WSC={label:i.lang.wsc.toolbar,group:"scaytButton",onClick:function(){var e=CKEDITOR.plugins.scayt,t=i.scayt,n=i.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?i.container.getText():i.document.getBody().getText();(n=n.replace(/\s/g,""))?(t&&e.state.scayt[i.name]&&t.setMarkupPaused&&t.setMarkupPaused(!0),i.lockSelection(),i.execCommand("checkspell")):alert("Nothing to check!")}}),i.addMenuItems(e)},bindEvents:function(s){var o=CKEDITOR.plugins.scayt,a=s.elementMode==CKEDITOR.ELEMENT_MODE_INLINE,t=function(){o.destroy(s)},r=function(){!o.state.scayt[s.name]||s.readOnly||s.scayt||o.createScayt(s)},n=function(){var e=s.editable();e.attachListener(e,"focus",function(e){var t,n;if(CKEDITOR.plugins.scayt&&!s.scayt&&setTimeout(r,0),e=CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[s.name]&&s.scayt,(a||e)&&s._.savedSelection){e=!(e=s._.savedSelection.getSelectedElement())&&s._.savedSelection.getRanges();for(var i=0;i<e.length;i++)"string"==typeof(n=e[i]).startContainer.$.nodeValue&&(((t=n.startContainer.getText().length)<n.startOffset||t<n.endOffset)&&s.unlockSelection(!1))}},this,null,-10)},e=function(){a?s.config.scayt_inlineModeImmediateMarkup?r():(s.on("blur",function(){setTimeout(t,0)}),s.on("focus",r),s.focusManager.hasFocus&&r()):r(),n();var e=s.editable();e.attachListener(e,"mousedown",function(e){e=e.data.getTarget();var t=s.widgets&&s.widgets.getByElement(e);t&&(t.wrapper=e.getAscendant(function(e){return e.hasAttribute("data-cke-widget-wrapper")},!0))},this,null,-10)};s.on("contentDom",e),s.on("beforeCommandExec",function(e){var t=s.scayt,n=!1,i=!1,a=!0;e.data.name in o.options.disablingCommandExec&&"wysiwyg"==s.mode?t&&(o.destroy(s),s.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED)):"bold"!==e.data.name&&"italic"!==e.data.name&&"underline"!==e.data.name&&"strike"!==e.data.name&&"subscript"!==e.data.name&&"superscript"!==e.data.name&&"enter"!==e.data.name&&"cut"!==e.data.name&&"language"!==e.data.name||!t||("cut"===e.data.name&&(i=!(a=!1)),"language"===e.data.name&&(i=n=!0),s.fire("reloadMarkupScayt",{removeOptions:{removeInside:a,forceBookmark:i,language:n},timeout:0}))}),s.on("beforeSetMode",function(e){"source"==e.data&&((e=s.scayt)&&(o.destroy(s),s.fire("scaytButtonState",CKEDITOR.TRISTATE_DISABLED)),s.document&&s.document.getBody().removeAttribute("_jquid"))}),s.on("afterCommandExec",function(e){"wysiwyg"!=s.mode||"undo"!=e.data.name&&"redo"!=e.data.name||setTimeout(function(){o.reloadMarkup(s.scayt)},250)}),s.on("readOnly",function(e){var t;e&&(t=s.scayt,!0===e.editor.readOnly?t&&t.fire("removeMarkupInDocument",{}):t?o.reloadMarkup(t):"wysiwyg"==e.editor.mode&&!0===o.state.scayt[e.editor.name]&&(o.createScayt(s),e.editor.fire("scaytButtonState",CKEDITOR.TRISTATE_ON)))}),s.on("beforeDestroy",t),s.on("setData",function(){t(),(s.elementMode==CKEDITOR.ELEMENT_MODE_INLINE||s.plugins.divarea)&&e()},this,null,50),s.on("reloadMarkupScayt",function(e){var t=e.data&&e.data.removeOptions,n=e.data&&e.data.timeout,i=e.data&&e.data.language,a=s.scayt;a&&setTimeout(function(){i&&(t.selectionNode=s.plugins.language.getCurrentLangElement(s),t.selectionNode=t.selectionNode&&t.selectionNode.$||null),a.removeMarkupInSelectionNode(t),o.reloadMarkup(a)},n||0)}),s.on("insertElement",function(){s.fire("reloadMarkupScayt",{removeOptions:{forceBookmark:!0}})},this,null,50),s.on("insertHtml",function(){s.scayt&&s.scayt.setFocused&&s.scayt.setFocused(!0),s.fire("reloadMarkupScayt")},this,null,50),s.on("insertText",function(){s.scayt&&s.scayt.setFocused&&s.scayt.setFocused(!0),s.fire("reloadMarkupScayt")},this,null,50),s.on("scaytDialogShown",function(e){e.data.selectPage(s.scayt.tabToOpen)})},parseConfig:function(e){if((i=CKEDITOR.plugins.scayt).replaceOldOptionsNames(e.config),"boolean"!=typeof e.config.scayt_autoStartup&&(e.config.scayt_autoStartup=!1),i.state.scayt[e.name]=e.config.scayt_autoStartup,"boolean"!=typeof e.config.grayt_autoStartup&&(e.config.grayt_autoStartup=!1),"boolean"!=typeof e.config.scayt_inlineModeImmediateMarkup&&(e.config.scayt_inlineModeImmediateMarkup=!1),i.state.grayt[e.name]=e.config.grayt_autoStartup,e.config.scayt_contextCommands||(e.config.scayt_contextCommands="ignore|ignoreall|add"),e.config.scayt_contextMenuItemsOrder||(e.config.scayt_contextMenuItemsOrder="suggest|moresuggest|control"),e.config.scayt_sLang||(e.config.scayt_sLang="en_US"),(void 0===e.config.scayt_maxSuggestions||"number"!=typeof e.config.scayt_maxSuggestions||e.config.scayt_maxSuggestions<0)&&(e.config.scayt_maxSuggestions=5),(void 0===e.config.scayt_minWordLength||"number"!=typeof e.config.scayt_minWordLength||e.config.scayt_minWordLength<1)&&(e.config.scayt_minWordLength=4),void 0!==e.config.scayt_customDictionaryIds&&"string"==typeof e.config.scayt_customDictionaryIds||(e.config.scayt_customDictionaryIds=""),void 0!==e.config.scayt_userDictionaryName&&"string"==typeof e.config.scayt_userDictionaryName||(e.config.scayt_userDictionaryName=null),"string"==typeof e.config.scayt_uiTabs&&3===e.config.scayt_uiTabs.split(",").length){var t=[],n=[];e.config.scayt_uiTabs=e.config.scayt_uiTabs.split(","),CKEDITOR.tools.search(e.config.scayt_uiTabs,function(e){1===Number(e)||0===Number(e)?(n.push(!0),t.push(Number(e))):n.push(!1)}),null===CKEDITOR.tools.search(n,!1)?e.config.scayt_uiTabs=t:e.config.scayt_uiTabs=[1,1,1]}else e.config.scayt_uiTabs=[1,1,1];if("string"!=typeof e.config.scayt_serviceProtocol&&(e.config.scayt_serviceProtocol=null),"string"!=typeof e.config.scayt_serviceHost&&(e.config.scayt_serviceHost=null),"string"!=typeof e.config.scayt_servicePort&&(e.config.scayt_servicePort=null),"string"!=typeof e.config.scayt_servicePath&&(e.config.scayt_servicePath=null),e.config.scayt_moreSuggestions||(e.config.scayt_moreSuggestions="on"),"string"!=typeof e.config.scayt_customerId&&(e.config.scayt_customerId="1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2"),"string"!=typeof e.config.scayt_customPunctuation&&(e.config.scayt_customPunctuation="-"),"string"!=typeof e.config.scayt_srcUrl&&(i=-1!=(i=document.location.protocol).search(/https?:/)?i:"http:",e.config.scayt_srcUrl=i+"//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js"),"boolean"!=typeof CKEDITOR.config.scayt_handleCheckDirty&&(CKEDITOR.config.scayt_handleCheckDirty=!0),"boolean"!=typeof CKEDITOR.config.scayt_handleUndoRedo&&(CKEDITOR.config.scayt_handleUndoRedo=!0),CKEDITOR.config.scayt_handleUndoRedo=!!CKEDITOR.plugins.undo&&CKEDITOR.config.scayt_handleUndoRedo,"boolean"!=typeof e.config.scayt_multiLanguageMode&&(e.config.scayt_multiLanguageMode=!1),"object"!=typeof e.config.scayt_multiLanguageStyles&&(e.config.scayt_multiLanguageStyles={}),e.config.scayt_ignoreAllCapsWords&&"boolean"!=typeof e.config.scayt_ignoreAllCapsWords&&(e.config.scayt_ignoreAllCapsWords=!1),e.config.scayt_ignoreDomainNames&&"boolean"!=typeof e.config.scayt_ignoreDomainNames&&(e.config.scayt_ignoreDomainNames=!1),e.config.scayt_ignoreWordsWithMixedCases&&"boolean"!=typeof e.config.scayt_ignoreWordsWithMixedCases&&(e.config.scayt_ignoreWordsWithMixedCases=!1),e.config.scayt_ignoreWordsWithNumbers&&"boolean"!=typeof e.config.scayt_ignoreWordsWithNumbers&&(e.config.scayt_ignoreWordsWithNumbers=!1),e.config.scayt_disableOptionsStorage){var i=CKEDITOR.tools.isArray(e.config.scayt_disableOptionsStorage)?e.config.scayt_disableOptionsStorage:"string"==typeof e.config.scayt_disableOptionsStorage?[e.config.scayt_disableOptionsStorage]:void 0,s="all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),o=["lang","ignore-all-caps-words","ignore-domain-names","ignore-words-with-mixed-cases","ignore-words-with-numbers"],r=CKEDITOR.tools.search,l=CKEDITOR.tools.indexOf;e.config.scayt_disableOptionsStorage=function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n],a=!!r(e,"options");if(!r(s,i)||a&&r(o,function(e){if("lang"===e)return!1}))return;if(r(o,i)&&o.splice(l(o,i),1),"all"===i||a&&r(e,"lang"))return[];"options"===i&&(o=["lang"])}return t.concat(o)}(i)}},addRule:function(n){var i=CKEDITOR.plugins.scayt,e=(a=n.dataProcessor)&&a.htmlFilter,t=n._.elementsPath&&n._.elementsPath.filters,a=a&&a.dataFilter,s=n.addRemoveFormatFilter,o=function(e){if(n.scayt&&(e.hasAttribute(i.options.data_attribute_name)||e.hasAttribute(i.options.problem_grammar_data_attribute)))return!1},r=function(e){var t=!0;return n.scayt&&(e.hasAttribute(i.options.data_attribute_name)||e.hasAttribute(i.options.problem_grammar_data_attribute))&&(t=!1),t};t&&t.push(o),a&&a.addRules({elements:{span:function(e){var t=e.hasClass(i.options.misspelled_word_class)&&e.attributes[i.options.data_attribute_name],n=e.hasClass(i.options.problem_grammar_class)&&e.attributes[i.options.problem_grammar_data_attribute];return i&&(t||n)&&delete e.name,e}}}),e&&e.addRules({elements:{span:function(e){var t=e.hasClass(i.options.misspelled_word_class)&&e.attributes[i.options.data_attribute_name],n=e.hasClass(i.options.problem_grammar_class)&&e.attributes[i.options.problem_grammar_data_attribute];return i&&(t||n)&&delete e.name,e}}}),s&&s.call(n,r)},scaytMenuDefinition:function(e){var t=this;return{scayt:{scayt_ignore:{label:(e=e.scayt).getLocal("btn_ignore"),group:"scayt_control",order:1,exec:function(e){e.scayt.ignoreWord()}},scayt_ignoreall:{label:e.getLocal("btn_ignoreAll"),group:"scayt_control",order:2,exec:function(e){e.scayt.ignoreAllWords()}},scayt_add:{label:e.getLocal("btn_addWord"),group:"scayt_control",order:3,exec:function(e){var t=e.scayt;setTimeout(function(){t.addWordToUserDictionary()},10)}},scayt_option:{label:e.getLocal("btn_options"),group:"scayt_control",order:4,exec:function(e){e.scayt.tabToOpen="options",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return 1==e.config.scayt_uiTabs[0]}},scayt_language:{label:e.getLocal("btn_langs"),group:"scayt_control",order:5,exec:function(e){e.scayt.tabToOpen="langs",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return 1==e.config.scayt_uiTabs[1]}},scayt_dictionary:{label:e.getLocal("btn_dictionaries"),group:"scayt_control",order:6,exec:function(e){e.scayt.tabToOpen="dictionaries",e.lockSelection(),e.openDialog(t.dialogName)},verification:function(e){return 1==e.config.scayt_uiTabs[2]}},scayt_about:{label:e.getLocal("btn_about"),group:"scayt_control",order:7,exec:function(e){e.scayt.tabToOpen="about",e.lockSelection(),e.openDialog(t.dialogName)}}},grayt:{grayt_problemdescription:{label:"Grammar problem description",group:"grayt_description",order:1,state:CKEDITOR.TRISTATE_DISABLED,exec:function(){}},grayt_ignore:{label:e.getLocal("btn_ignore"),group:"grayt_control",order:2,exec:function(e){e.scayt.ignorePhrase()}}}}},buildSuggestionMenuItems:function(e,t,n){var i={},a={},s=n?"word":"phrase",o=n?"startGrammarCheck":"startSpellCheck",r=e.scayt;if(0<t.length&&"no_any_suggestions"!==t[0])if(n)for(n=0;n<t.length;n++){var l="scayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[n].replace(" ","_");e.addCommand(l,this.createCommand(CKEDITOR.plugins.scayt.suggestions[n],s,o)),n<e.config.scayt_maxSuggestions?(e.addMenuItem(l,{label:t[n],command:l,group:"scayt_suggest",order:n+1}),i[l]=CKEDITOR.TRISTATE_OFF):(e.addMenuItem(l,{label:t[n],command:l,group:"scayt_moresuggest",order:n+1}),a[l]=CKEDITOR.TRISTATE_OFF,"on"===e.config.scayt_moreSuggestions&&(e.addMenuItem("scayt_moresuggest",{label:r.getLocal("btn_moreSuggestions"),group:"scayt_moresuggest",order:10,getItems:function(){return a}}),i.scayt_moresuggest=CKEDITOR.TRISTATE_OFF))}else for(n=0;n<t.length;n++)l="grayt_suggest_"+CKEDITOR.plugins.scayt.suggestions[n].replace(" ","_"),e.addCommand(l,this.createCommand(CKEDITOR.plugins.scayt.suggestions[n],s,o)),e.addMenuItem(l,{label:t[n],command:l,group:"grayt_suggest",order:n+1}),i[l]=CKEDITOR.TRISTATE_OFF;else i.no_scayt_suggest=CKEDITOR.TRISTATE_DISABLED,e.addCommand("no_scayt_suggest",{exec:function(){}}),e.addMenuItem("no_scayt_suggest",{label:r.getLocal("btn_noSuggestions")||"no_scayt_suggest",command:"no_scayt_suggest",group:"scayt_suggest",order:0});return i},menuGenerator:function(e,t){var n,i,a=e.scayt,s=this.scaytMenuDefinition(e),o={},r=e.config.scayt_contextCommands.split("|"),l=t.getAttribute(a.getLangAttribute())||a.getLang();if(n=a.isScaytNode(t),i=a.isGraytNode(t),n?(s=s.scayt,o=t.getAttribute(a.getScaytNodeAttributeName()),a.fire("getSuggestionsList",{lang:l,word:o}),o=this.buildSuggestionMenuItems(e,CKEDITOR.plugins.scayt.suggestions,n)):i&&(s=s.grayt,o=t.getAttribute(a.getGraytNodeAttributeName()),i=a.getProblemDescriptionText(o,l),s.grayt_problemdescription&&i&&(s.grayt_problemdescription.label=i),a.fire("getGrammarSuggestionsList",{lang:l,phrase:o}),o=this.buildSuggestionMenuItems(e,CKEDITOR.plugins.scayt.suggestions,n)),n&&"off"==e.config.scayt_contextCommands)return o;for(var c in s)n&&-1==CKEDITOR.tools.indexOf(r,c.replace("scayt_",""))&&"all"!=e.config.scayt_contextCommands||(o[c]="undefined"!=typeof s[c].state?s[c].state:CKEDITOR.TRISTATE_OFF,"function"!=typeof s[c].verification||s[c].verification(e)||delete o[c],e.addCommand(c,{exec:s[c].exec}),e.addMenuItem(c,{label:e.lang.scayt[s[c].label]||s[c].label,command:c,group:s[c].group,order:s[c].order}));return o},createCommand:function(n,i,a){return{exec:function(e){e=e.scayt;var t={};t[i]=n,e.replaceSelectionNode(t),"startGrammarCheck"===a&&e.removeMarkupInSelectionNode({grammarOnly:!0}),e.fire(a)}}}}),CKEDITOR.plugins.scayt={charsToObserve:[{charName:"cke-fillingChar",charCode:function(){var e;if(n=(n=CKEDITOR.version.match(/^\d(\.\d*)*/))&&n[0]){e="4.5.7";var t,n=n.replace(/\./g,"");e=e.replace(/\./g,""),t=0<=(t=n.length-e.length)?t:0,e=parseInt(n)>=parseInt(e)*Math.pow(10,t)}return e?Array(7).join(String.fromCharCode(8203)):String.fromCharCode(8203)}()}],onLoadTimestamp:"",state:{scayt:{},grayt:{}},warningCounter:0,suggestions:[],options:{disablingCommandExec:{source:!0,newpage:!0,templates:!0},data_attribute_name:"data-scayt-word",misspelled_word_class:"scayt-misspell-word",problem_grammar_data_attribute:"data-grayt-phrase",problem_grammar_class:"gramm-problem"},backCompatibilityMap:{scayt_service_protocol:"scayt_serviceProtocol",scayt_service_host:"scayt_serviceHost",scayt_service_port:"scayt_servicePort",scayt_service_path:"scayt_servicePath",scayt_customerid:"scayt_customerId"},alarmCompatibilityMessage:function(){this.warningCounter<5&&(console.warn("You are using the latest version of SCAYT plugin for CKEditor with the old application version. In order to have access to the newest features, it is recommended to upgrade the application version to latest one as well. Contact us for more details at support@webspellchecker.net."),this.warningCounter+=1)},isNewUdSupported:function(e){return!!e.getUserDictionary},reloadMarkup:function(e){var t;e&&(t=e.getScaytLangList(),e.reloadMarkup?e.reloadMarkup():(this.alarmCompatibilityMessage(),t&&t.ltr&&t.rtl&&e.fire("startSpellCheck, startGrammarCheck")))},replaceOldOptionsNames:function(e){for(var t in e)t in this.backCompatibilityMap&&(e[this.backCompatibilityMap[t]]=e[t],delete e[t])},createScayt:function(e){var s=this,o=CKEDITOR.plugins.scayt;this.loadScaytLibrary(e,function(i){function e(e){return new SCAYT.CKSCAYT(e,function(){},function(){})}var t=i.window&&i.window.getFrame()||i.editable();if(t){var n;t={lang:i.config.scayt_sLang,container:t.$,customDictionary:i.config.scayt_customDictionaryIds,userDictionaryName:i.config.scayt_userDictionaryName,localization:i.langCode,customer_id:i.config.scayt_customerId,customPunctuation:i.config.scayt_customPunctuation,debug:i.config.scayt_debug,data_attribute_name:s.options.data_attribute_name,misspelled_word_class:s.options.misspelled_word_class,problem_grammar_data_attribute:s.options.problem_grammar_data_attribute,problem_grammar_class:s.options.problem_grammar_class,"options-to-restore":i.config.scayt_disableOptionsStorage,focused:i.editable().hasFocus,ignoreElementsRegex:i.config.scayt_elementsToIgnore,ignoreGraytElementsRegex:i.config.grayt_elementsToIgnore,minWordLength:i.config.scayt_minWordLength,multiLanguageMode:i.config.scayt_multiLanguageMode,multiLanguageStyles:i.config.scayt_multiLanguageStyles,graytAutoStartup:o.state.grayt[i.name],charsToObserve:o.charsToObserve},i.config.scayt_serviceProtocol&&(t.service_protocol=i.config.scayt_serviceProtocol),i.config.scayt_serviceHost&&(t.service_host=i.config.scayt_serviceHost),i.config.scayt_servicePort&&(t.service_port=i.config.scayt_servicePort),i.config.scayt_servicePath&&(t.service_path=i.config.scayt_servicePath),"boolean"==typeof i.config.scayt_ignoreAllCapsWords&&(t["ignore-all-caps-words"]=i.config.scayt_ignoreAllCapsWords),"boolean"==typeof i.config.scayt_ignoreDomainNames&&(t["ignore-domain-names"]=i.config.scayt_ignoreDomainNames),"boolean"==typeof i.config.scayt_ignoreWordsWithMixedCases&&(t["ignore-words-with-mixed-cases"]=i.config.scayt_ignoreWordsWithMixedCases),"boolean"==typeof i.config.scayt_ignoreWordsWithNumbers&&(t["ignore-words-with-numbers"]=i.config.scayt_ignoreWordsWithNumbers);try{n=e(t)}catch(a){s.alarmCompatibilityMessage(),delete t.charsToObserve,n=e(t)}n.subscribe("suggestionListSend",function(e){for(var t={},n=[],i=0;i<e.suggestionList.length;i++)t["word_"+e.suggestionList[i]]||(t["word_"+e.suggestionList[i]]=e.suggestionList[i],n.push(e.suggestionList[i]));CKEDITOR.plugins.scayt.suggestions=n}),n.subscribe("selectionIsChanged",function(){i.getSelection().isLocked&&i.lockSelection()}),n.subscribe("graytStateChanged",function(e){
o.state.grayt[i.name]=e.state}),n.addMarkupHandler&&n.addMarkupHandler(function(e){var t=i.editable(),n=t.getCustomData(e.charName);n&&(n.$=e.node,t.setCustomData(e.charName,n))}),i.scayt=n,i.fire("scaytButtonState",i.readOnly?CKEDITOR.TRISTATE_DISABLED:CKEDITOR.TRISTATE_ON)}else o.state.scayt[i.name]=!1})},destroy:function(e){e.scayt&&e.scayt.destroy(),delete e.scayt,e.fire("scaytButtonState",CKEDITOR.TRISTATE_OFF)},loadScaytLibrary:function(e,t){var n,i=function(){CKEDITOR.fireOnce("scaytReady"),e.scayt||"function"==typeof t&&t(e)};"undefined"==typeof window.SCAYT||"function"!=typeof window.SCAYT.CKSCAYT?(n=e.config.scayt_srcUrl+"?"+this.onLoadTimestamp,CKEDITOR.scriptLoader.load(n,function(e){e&&i()})):window.SCAYT&&"function"==typeof window.SCAYT.CKSCAYT&&i()}},CKEDITOR.on("dialogDefinition",function(e){var t=e.data.name;e=e.data.definition.dialog,"scaytDialog"===t&&e.on("cancel",function(){return!1},this,null,-1),"checkspell"===t&&e.on("cancel",function(e){e=e.sender&&e.sender.getParentEditor();var t=CKEDITOR.plugins.scayt,n=e.scayt;n&&t.state.scayt[e.name]&&n.setMarkupPaused&&n.setMarkupPaused(!1),e.unlockSelection()},this,null,-2),"link"===t&&e.on("ok",function(e){var t=e.sender&&e.sender.getParentEditor();t&&setTimeout(function(){t.fire("reloadMarkupScayt",{removeOptions:{removeInside:!0,forceBookmark:!0},timeout:0})},0)})}),CKEDITOR.on("scaytReady",function(){!0===CKEDITOR.config.scayt_handleCheckDirty&&((e=CKEDITOR.editor.prototype).checkDirty=CKEDITOR.tools.override(e.checkDirty,function(i){return function(){var e=null,t=this.scayt;if(CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[this.name]&&this.scayt){if(e="ready"==this.status){var n=t.removeMarkupFromString(this.getSnapshot());t=t.removeMarkupFromString(this._.previousValue),e=e&&t!==n}}else e=i.call(this);return e}}),e.resetDirty=CKEDITOR.tools.override(e.resetDirty,function(t){return function(){var e=this.scayt;CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[this.name]&&this.scayt?this._.previousValue=e.removeMarkupFromString(this.getSnapshot()):t.call(this)}}));if(!0===CKEDITOR.config.scayt_handleUndoRedo){var e,t="function"==typeof(e=CKEDITOR.plugins.undo.Image.prototype).equalsContent?"equalsContent":"equals";e[t]=CKEDITOR.tools.override(e[t],function(s){return function(e){var t=e.editor.scayt,n=this.contents,i=e.contents,a=null;return CKEDITOR.plugins.scayt&&CKEDITOR.plugins.scayt.state.scayt[e.editor.name]&&e.editor.scayt&&(this.contents=t.removeMarkupFromString(n)||"",e.contents=t.removeMarkupFromString(i)||""),a=s.apply(this,arguments),this.contents=n,e.contents=i,a}})}}),CKEDITOR.plugins.add("stylescombo",{requires:"richcombo",init:function(o){var r=o.config,l=o.lang.stylescombo,c={},d=[],u=[];o.on("stylesSet",function(e){if(e=e.data.styles){for(var t,n,i,a=0,s=e.length;a<s;a++)t=e[a],o.blockless&&t.element in CKEDITOR.dtd.$block||"string"==typeof t.type&&!CKEDITOR.style.customHandlers[t.type]||(n=t.name,t=new CKEDITOR.style(t),o.filter.customConfig&&!o.filter.check(t))||(t._name=n,t._.enterMode=r.enterMode,t._.type=i=t.assignedTo||t.type,t._.weight=a+1e3*(i==CKEDITOR.STYLE_OBJECT?1:i==CKEDITOR.STYLE_BLOCK?2:3),c[n]=t,d.push(t),u.push(t));d.sort(function(e,t){return e._.weight-t._.weight})}}),o.ui.addRichCombo("Styles",{label:l.label,title:l.panelTitle,toolbar:"styles,10",allowedContent:u,panel:{css:[CKEDITOR.skin.getPath("editor")].concat(r.contentsCss),multiSelect:!0,attributes:{"aria-label":l.panelTitle}},init:function(){var e,t,n,i,a,s;for(a=0,s=d.length;a<s;a++)t=(e=d[a])._name,(i=e._.type)!=n&&(this.startGroup(l["panelTitle"+String(i)]),n=i),this.add(t,e.type==CKEDITOR.STYLE_OBJECT?t:e.buildPreview(),t);this.commit()},onClick:function(e){o.focus(),o.fire("saveSnapshot"),e=c[e];var t=o.elementPath();e.group&&e.removeStylesFromSameGroup(o)?o.applyStyle(e):o[e.checkActive(t,o)?"removeStyle":"applyStyle"](e),o.fire("saveSnapshot")},onRender:function(){o.on("selectionChange",function(e){for(var t,n=this.getValue(),i=0,a=(e=e.data.path.elements).length;i<a;i++)for(var s in t=e[i],c)if(c[s].checkElementRemovable(t,!0,o))return void(s!=n&&this.setValue(s));this.setValue("")},this)},onOpen:function(){var e=o.getSelection().getSelectedElement(),t=(e=o.elementPath(e),[0,0,0,0]);for(var n in this.showAll(),this.unmarkAll(),c){var i=c[n],a=i._.type;i.checkApplicable(e,o,o.activeFilter)?t[a]++:this.hideItem(n),i.checkActive(e,o)&&this.mark(n)}t[CKEDITOR.STYLE_BLOCK]||this.hideGroup(l["panelTitle"+String(CKEDITOR.STYLE_BLOCK)]),t[CKEDITOR.STYLE_INLINE]||this.hideGroup(l["panelTitle"+String(CKEDITOR.STYLE_INLINE)]),t[CKEDITOR.STYLE_OBJECT]||this.hideGroup(l["panelTitle"+String(CKEDITOR.STYLE_OBJECT)])},refresh:function(){var e=o.elementPath();if(e){for(var t in c)if(c[t].checkApplicable(e,o,o.activeFilter))return;this.setState(CKEDITOR.TRISTATE_DISABLED)}},reset:function(){c={},d=[]}})}}),function(){function a(r){return{editorFocus:!1,canUndo:!1,modes:{wysiwyg:1},exec:function(e){if(e.editable().hasFocus){var t,n=e.getSelection();if(t=new CKEDITOR.dom.elementPath(n.getCommonAncestor(),n.root).contains({td:1,th:1},1)){n=e.createRange();if((a=CKEDITOR.tools.tryThese(function(){var e=t.getParent().$.cells[t.$.cellIndex+(r?-1:1)];return e.parentNode.parentNode,e},function(){var e;return(e=(e=t.getParent()).getAscendant("table").$.rows[e.$.rowIndex+(r?-1:1)]).cells[r?e.cells.length-1:0]}))||r){if(!a)return!0;a=new CKEDITOR.dom.element(a),n.moveToElementEditStart(a),n.checkStartOfBlock()&&n.checkEndOfBlock()||n.selectNodeContents(a)}else{for(var i=t.getAscendant("table").$,a=t.getParent().$.cells,s=(i=new CKEDITOR.dom.element(i.insertRow(-1),e.document),0),o=a.length;s<o;s++)i.append(new CKEDITOR.dom.element(a[s],e.document).clone(!1,!1)).appendBogus();n.moveToElementEditStart(i)}return n.select(!0),!0}}return!1}}}var s={editorFocus:!1,modes:{wysiwyg:1,source:1}},o={exec:function(e){e.container.focusNext(!0,e.tabIndex)}},r={exec:function(e){e.container.focusPrevious(!0,e.tabIndex)}};CKEDITOR.plugins.add("tab",{init:function(t){for(var e=!1!==t.config.enableTabKeyTools,n=t.config.tabSpaces||0,i="";n--;)i+="\xa0";i&&t.on("key",function(e){9==e.data.keyCode&&(t.insertText(i),e.cancel())}),e&&t.on("key",function(e){(9==e.data.keyCode&&t.execCommand("selectNextCell")||e.data.keyCode==CKEDITOR.SHIFT+9&&t.execCommand("selectPreviousCell"))&&e.cancel()}),t.addCommand("blur",CKEDITOR.tools.extend(o,s)),t.addCommand("blurBack",CKEDITOR.tools.extend(r,s)),t.addCommand("selectNextCell",a()),t.addCommand("selectPreviousCell",a(!0))}})}(),CKEDITOR.dom.element.prototype.focusNext=function(e,t){var n,i,a,s,o,r,l=void 0===t?this.getTabIndex():t;if(l<=0)for(o=this.getNextSourceNode(e,CKEDITOR.NODE_ELEMENT);o;){if(o.isVisible()&&0===o.getTabIndex()){a=o;break}o=o.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT)}else for(o=this.getDocument().getBody().getFirst();o=o.getNextSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!n)if(!i&&o.equals(this)){if(i=!0,e){if(!(o=o.getNextSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;n=1}}else i&&!this.contains(o)&&(n=1);if(o.isVisible()&&!((r=o.getTabIndex())<0)){if(n&&r==l){a=o;break}l<r&&(!a||!s||r<s)?(a=o,s=r):a||0!==r||(a=o,s=r)}}a&&a.focus()},CKEDITOR.dom.element.prototype.focusPrevious=function(e,t){for(var n,i,a,s,o=void 0===t?this.getTabIndex():t,r=0,l=this.getDocument().getBody().getLast();l=l.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT);){if(!n)if(!i&&l.equals(this)){if(i=!0,e){if(!(l=l.getPreviousSourceNode(!0,CKEDITOR.NODE_ELEMENT)))break;n=1}}else i&&!this.contains(l)&&(n=1);if(l.isVisible()&&!((s=l.getTabIndex())<0))if(o<=0){if(n&&0===s){a=l;break}r<s&&(a=l,r=s)}else{if(n&&s==o){a=l;break}s<o&&(!a||r<s)&&(a=l,r=s)}}a&&a.focus()},CKEDITOR.plugins.add("table",{requires:"dialog",init:function(e){function t(e){return CKEDITOR.tools.extend(e||{},{contextSensitive:1,refresh:function(e,t){this.setState(t.contains("table",1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}if(!e.blockless){var n=e.lang.table;e.addCommand("table",new CKEDITOR.dialogCommand("table",{context:"table",allowedContent:"table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];"+(e.plugins.dialogadvtab?"table"+e.plugins.dialogadvtab.allowedContent():""),requiredContent:"table",contentTransformations:[["table{width}: sizeToStyle","table[width]: sizeToAttribute"],["td: splitBorderShorthand"],[{element:"table",right:function(e){e.styles&&(e.styles.border&&e.styles.border.match(/solid/)&&(e.attributes.border=1),"collapse"==e.styles["border-collapse"]&&(e.attributes.cellspacing=0))}}]]})),e.addCommand("tableProperties",new CKEDITOR.dialogCommand("tableProperties",t())),e.addCommand("tableDelete",t({exec:function(e){var t=e.elementPath().contains("table",1);if(t){var n=t.getParent(),i=e.editable();1!=n.getChildCount()||n.is("td","th")||n.equals(i)||(t=n),(e=e.createRange()).moveToPosition(t,CKEDITOR.POSITION_BEFORE_START),t.remove(),e.select()}}})),e.ui.addButton&&e.ui.addButton("Table",{label:n.toolbar,command:"table",toolbar:"insert,30"}),CKEDITOR.dialog.add("table",this.path+"dialogs/table.js"),CKEDITOR.dialog.add("tableProperties",this.path+"dialogs/table.js"),e.addMenuItems&&e.addMenuItems({table:{label:n.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:n.deleteTable,command:"tableDelete",group:"table",order:1}}),e.on("doubleclick",function(e){e.data.element.is("table")&&(e.data.dialog="tableProperties")}),e.contextMenu&&e.contextMenu.addListener(function(){return{tabledelete:CKEDITOR.TRISTATE_OFF,table:CKEDITOR.TRISTATE_OFF}})}}}),function(){function y(e,t){function n(e){return!t||t.contains(e)&&e.getAscendant("table",!0).equals(t)}function i(e){0<s.length||e.type!=CKEDITOR.NODE_ELEMENT||!f.test(e.getName())||e.getCustomData("selected_cell")||(CKEDITOR.dom.element.setMarker(o,e,"selected_cell",!0),s.push(e))}if(e){for(var a=e.getRanges(),s=[],o={},r=0;r<a.length;r++){var l,c;if((l=a[r]).collapsed)(l=l.getCommonAncestor().getAscendant({td:1,th:1},!0))&&n(l)&&s.push(l);else for((l=new CKEDITOR.dom.walker(l)).guard=i;c=l.next();)c.type==CKEDITOR.NODE_ELEMENT&&c.is(CKEDITOR.dtd.table)||(c=c.getAscendant({td:1,th:1},!0))&&!c.getCustomData("selected_cell")&&n(c)&&(CKEDITOR.dom.element.setMarker(o,c,"selected_cell",!0),s.push(c))}return CKEDITOR.dom.element.clearAllMarkers(o),s}}function s(e,t){var n=(i=(o=m(e)?e:y(e))[0]).getAscendant("table"),i=i.getDocument(),a=(r=o[0].getParent()).$.rowIndex,s=(o=o[o.length-1]).getParent().$.rowIndex+o.$.rowSpan-1,o=new CKEDITOR.dom.element(n.$.rows[s]),r=(a=t?a:s,t?r:o);for(n=(o=CKEDITOR.tools.buildTableMap(n))[a],a=t?o[a-1]:o[a+1],o=o[0].length,i=i.createElement("tr"),s=0;n[s]&&s<o;s++){var l;1<n[s].rowSpan&&a&&n[s]==a[s]?(l=n[s]).rowSpan+=1:((l=new CKEDITOR.dom.element(n[s]).clone()).removeAttribute("rowSpan"),l.appendBogus(),i.append(l),l=l.$),s+=l.colSpan-1}t?i.insertBefore(r):i.insertAfter(r)}function _(e){if(e instanceof CKEDITOR.dom.selection){var t=e.getRanges(),n=(o=y(e))[0].getAscendant("table"),i=CKEDITOR.tools.buildTableMap(n),a=o[0].getParent().$.rowIndex,s=(o=o[o.length-1]).getParent().$.rowIndex+o.$.rowSpan-1,o=[];for(e.reset(),e=a;e<=s;e++){for(var r=i[e],l=new CKEDITOR.dom.element(n.$.rows[e]),c=0;c<r.length;c++){var d=new CKEDITOR.dom.element(r[c]),u=d.getParent().$.rowIndex;1==d.$.rowSpan?d.remove():(--d.$.rowSpan,u==e&&((u=i[e+1])[c-1]?d.insertAfter(new CKEDITOR.dom.element(u[c-1])):new CKEDITOR.dom.element(n.$.rows[e+1]).append(d,1))),c+=d.$.colSpan-1}o.push(l)}for(i=n.$.rows,t[0].moveToPosition(n,CKEDITOR.POSITION_BEFORE_START),a=new CKEDITOR.dom.element(i[s+1]||(0<a?i[a-1]:null)||n.$.parentNode),e=o.length;0<=e;e--)_(o[e]);return n.$.parentNode?a:(t[0].select(),null)}return e instanceof CKEDITOR.dom.element&&(1==(n=e.getAscendant("table")).$.rows.length?n.remove():e.remove()),null}function o(e,t){for(var n=e.getParent().$.cells,i=0,a=0;a<n.length;a++){var s=n[a];i=i+(t?1:s.colSpan);if(s==e.$)break}return i-1}function l(e,t){for(var n=t?Infinity:0,i=0;i<e.length;i++){var a=o(e[i],t);(t?a<n:n<a)&&(n=a)}return n}function r(e,t){for(var n=(a=m(e)?e:y(e))[0].getAscendant("table"),i=l(a,1),a=l(a),s=t?i:a,o=CKEDITOR.tools.buildTableMap(n),r=(n=[],i=[],a=o.length,0);r<a;r++)n.push(o[r][s]),i.push(t?o[r][s-1]:o[r][s+1]);for(r=0;r<a;r++)n[r]&&(1<n[r].colSpan&&i[r]==n[r]?(o=n[r]).colSpan+=1:((o=(s=new CKEDITOR.dom.element(n[r])).clone()).removeAttribute("colSpan"),o.appendBogus(),o[t?"insertBefore":"insertAfter"].call(o,s),o=o.$),r+=o.rowSpan-1)}function c(e,t){var n=e.getStartElement().getAscendant({td:1,th:1},!0);if(n){var i=n.clone();i.appendBogus(),t?i.insertBefore(n):i.insertAfter(n)}}function d(e){if(e instanceof CKEDITOR.dom.selection){var t,n=e.getRanges(),i=y(e),a=i[0]&&i[0].getAscendant("table");e:{var s=0;t=i.length-1;for(var o,r,l={};o=i[s++];)CKEDITOR.dom.element.setMarker(l,o,"delete_cell",!0);for(s=0;o=i[s++];)if((r=o.getPrevious())&&!r.getCustomData("delete_cell")||(r=o.getNext())&&!r.getCustomData("delete_cell")){CKEDITOR.dom.element.clearAllMarkers(l),t=r;break e}CKEDITOR.dom.element.clearAllMarkers(l),(s=(s=i[0].getParent()).getPrevious())?t=s.getLast():t=(s=(s=i[t].getParent()).getNext())?s.getChild(0):null}for(e.reset(),e=i.length-1;0<=e;e--)d(i[e]);t?$(t,!0):a&&(n[0].moveToPosition(a,CKEDITOR.POSITION_BEFORE_START),n[0].select(),a.remove())}else e instanceof CKEDITOR.dom.element&&(1==(n=e.getParent()).getChildCount()?n.remove():e.remove())}function $(e,t){var n=e.getDocument(),i=CKEDITOR.document;CKEDITOR.env.ie&&10==CKEDITOR.env.version&&(i.focus(),n.focus()),(n=new CKEDITOR.dom.range(n))["moveToElementEdit"+(t?"End":"Start")](e)||(n.selectNodeContents(e),n.collapse(!t)),n.select(!0)}function w(e,t,n){if(e=e[t],void 0===n)return e;for(t=0;e&&t<e.length;t++){if(n.is&&e[t]==n.$)return t;if(t==n)return new CKEDITOR.dom.element(e[t])}return n.is?-1:null}function u(e,t,n){var i,a,s=y(e);if((t?1!=s.length:s.length<2)||(i=e.getCommonAncestor())&&i.type==CKEDITOR.NODE_ELEMENT&&i.is("table"))return!1;i=(e=s[0]).getAscendant("table");var o=CKEDITOR.tools.buildTableMap(i),r=o.length,l=o[0].length,c=e.getParent().$.rowIndex,d=w(o,c,e);if(t){var u;try{var _=parseInt(e.getAttribute("rowspan"),10)||1;a=parseInt(e.getAttribute("colspan"),10)||1,u=o["up"==t?c-_:"down"==t?c+_:c]["left"==t?d-a:"right"==t?d+a:d]}catch($){return!1}if(!u||e.$==u)return!1;s["up"==t||"left"==t?"unshift":"push"](new CKEDITOR.dom.element(u))}t=e.getDocument();var h=c,p=(_=u=0,!n&&new CKEDITOR.dom.documentFragment(t)),f=0;for(t=0;t<s.length;t++){var m=(a=s[t]).getParent(),g=a.getFirst(),A=a.$.colSpan,v=a.$.rowSpan,b=w(o,m=m.$.rowIndex,a);f=f+A*v,_=Math.max(_,b-d+A);u=Math.max(u,m-c+v),n||((v=(A=a).getBogus())&&v.remove(),A.trim(),a.getChildren().count()&&(m==h||!g||g.isBlockBoundary&&g.isBlockBoundary({br:1})||(!(h=p.getLast(CKEDITOR.dom.walker.whitespaces(!0)))||h.is&&h.is("br")||p.append("br")),a.moveChildren(p)),t?a.remove():a.setHtml("")),h=m}if(n)return u*_==f;for(p.moveChildren(e),e.appendBogus(),l<=_?e.removeAttribute("rowSpan"):e.$.rowSpan=u,r<=u?e.removeAttribute("colSpan"):e.$.colSpan=_,t=(s=(n=new CKEDITOR.dom.nodeList(i.$.rows)).count())-1;0<=t;t--)(i=n.getItem(t)).$.cells.length||(i.remove(),s++);return e}function h(e,t){if(1<(n=y(e)).length)return!1;if(t)return!0;var n,i,a=(l=(n=n[0]).getParent()).getAscendant("table"),s=w(c=CKEDITOR.tools.buildTableMap(a),d=l.$.rowIndex,n);if(1<(r=n.$.rowSpan)){i=Math.ceil(r/2);for(var o,r=Math.floor(r/2),l=d+i,c=(a=new CKEDITOR.dom.element(a.$.rows[l]),w(c,l)),d=(l=n.clone(),0);d<c.length;d++){if((o=c[d]).parentNode==a.$&&s<d){l.insertBefore(new CKEDITOR.dom.element(o));break}o=null}o||a.append(l)}else for(r=i=1,(a=l.clone()).insertAfter(l),a.append(l=n.clone()),o=w(c,d),s=0;s<o.length;s++)o[s].rowSpan++;return l.appendBogus(),n.$.rowSpan=i,l.$.rowSpan=r,1==i&&n.removeAttribute("rowSpan"),1==r&&l.removeAttribute("rowSpan"),l}function p(e,t){if(1<(n=y(e)).length)return!1;if(t)return!0;var n,i=(n=n[0]).getParent(),a=i.getAscendant("table"),s=w(a=CKEDITOR.tools.buildTableMap(a),i.$.rowIndex,n);if(1<(o=n.$.colSpan))i=Math.ceil(o/2),o=Math.floor(o/2);else{for(var o=i=1,r=[],l=0;l<a.length;l++){var c=a[l];r.push(c[s]),1<c[s].rowSpan&&(l+=c[s].rowSpan-1)}for(a=0;a<r.length;a++)r[a].colSpan++}return(a=n.clone()).insertAfter(n),a.appendBogus(),n.$.colSpan=i,a.$.colSpan=o,1==i&&n.removeAttribute("colSpan"),1==o&&a.removeAttribute("colSpan"),a}var f=/^(?:td|th)$/,m=CKEDITOR.tools.isArray;CKEDITOR.plugins.tabletools={requires:"table,dialog,contextmenu",init:function(i){function e(e){return CKEDITOR.tools.extend(e||{},{contextSensitive:1,refresh:function(e,t){this.setState(t.contains({td:1,th:1},1)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)}})}function t(e,t){var n=i.addCommand(e,t);i.addFeature(n)}var n=i.lang.table,a=CKEDITOR.tools.style.parse;t("cellProperties",new CKEDITOR.dialogCommand("cellProperties",e({allowedContent:"td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",requiredContent:"table",contentTransformations:[[{element:"td",left:function(e){return e.styles.background&&a.background(e.styles.background).color},right:function(e){e.styles["background-color"]=a.background(e.styles.background).color}},{element:"td",check:"td{vertical-align}",left:function(e){return e.attributes&&e.attributes.valign},right:function(e){e.styles["vertical-align"]=e.attributes.valign,delete e.attributes.valign}}],[{element:"tr",check:"td{height}",left:function(e){return e.styles&&e.styles.height},right:function(t){CKEDITOR.tools.array.forEach(t.children,function(e){e.name in{td:1,th:1}&&(e.attributes["cke-row-height"]=t.styles.height)}),delete t.styles.height}}],[{element:"td",check:"td{height}",left:function(e){return(e=e.attributes)&&e["cke-row-height"]},right:function(e){e.styles.height=e.attributes["cke-row-height"],delete e.attributes["cke-row-height"]}}]]}))),CKEDITOR.dialog.add("cellProperties",this.path+"dialogs/tableCell.js"),t("rowDelete",e({requiredContent:"table",exec:function(e){(e=_(e=e.getSelection()))&&$(e)}})),t("rowInsertBefore",e({requiredContent:"table",exec:function(e){s(e=y(e=e.getSelection()),!0)}})),t("rowInsertAfter",e({requiredContent:"table",exec:function(e){s(e=y(e=e.getSelection()))}})),t("columnDelete",e({requiredContent:"table",exec:function(e){e=(c=e.getSelection()).getRanges();var t,n,i=(s=y(c))[0],a=s[s.length-1],s=i.getAscendant("table"),o=CKEDITOR.tools.buildTableMap(s),r=[];c.reset();for(var l=0,c=o.length;l<c;l++)for(var d=0,u=o[l].length;d<u;d++)o[l][d]==i.$&&(t=d),o[l][d]==a.$&&(n=d);for(l=t;l<=n;l++)for(d=0;d<o.length;d++)a=o[d],i=new CKEDITOR.dom.element(s.$.rows[d]),(a=new CKEDITOR.dom.element(a[l])).$&&(1==a.$.colSpan?a.remove():--a.$.colSpan,d+=a.$.rowSpan-1,i.$.cells.length||r.push(i));n=s.$.rows[0]&&s.$.rows[0].cells,t=new CKEDITOR.dom.element(n[t]||(t?n[t-1]:s.$.parentNode)),r.length==c&&(e[0].moveToPosition(s,CKEDITOR.POSITION_AFTER_END),e[0].select(),s.remove()),t&&$(t,!0)}})),t("columnInsertBefore",e({requiredContent:"table",exec:function(e){r(e=y(e=e.getSelection()),!0)}})),t("columnInsertAfter",e({requiredContent:"table",exec:function(e){r(e=y(e=e.getSelection()))}})),t("cellDelete",e({requiredContent:"table",exec:function(e){d(e=e.getSelection())}})),t("cellMerge",e({allowedContent:"td[colspan,rowspan]",requiredContent:"td[colspan,rowspan]",exec:function(e,t){t.cell=u(e.getSelection()),$(t.cell,!0)}})),t("cellMergeRight",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(e,t){t.cell=u(e.getSelection(),"right"),$(t.cell,!0)}})),t("cellMergeDown",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(e,t){t.cell=u(e.getSelection(),"down"),$(t.cell,!0)}})),t("cellVerticalSplit",e({allowedContent:"td[rowspan]",requiredContent:"td[rowspan]",exec:function(e){$(p(e.getSelection()))}})),t("cellHorizontalSplit",e({allowedContent:"td[colspan]",requiredContent:"td[colspan]",exec:function(e){$(h(e.getSelection()))}})),t("cellInsertBefore",e({requiredContent:"table",exec:function(e){c(e=e.getSelection(),!0)}})),t("cellInsertAfter",e({requiredContent:"table",exec:function(e){c(e=e.getSelection())}})),i.addMenuItems&&i.addMenuItems({tablecell:{label:n.cell.menu,group:"tablecell",order:1,getItems:function(){var e=i.getSelection(),t=y(e);return{tablecell_insertBefore:CKEDITOR.TRISTATE_OFF,tablecell_insertAfter:CKEDITOR.TRISTATE_OFF,tablecell_delete:CKEDITOR.TRISTATE_OFF,tablecell_merge:u(e,null,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_right:u(e,"right",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_merge_down:u(e,"down",!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_vertical:p(e,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_split_horizontal:h(e,!0)?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED,tablecell_properties:0<t.length?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED}}},tablecell_insertBefore:{label:n.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:n.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:n.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:n.cell.merge,group:"tablecell",command:"cellMerge",order:16},tablecell_merge_right:{label:n.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:n.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:n.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:n.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:n.cell.title,group:"tablecellproperties",command:"cellProperties",order:21},tablerow:{label:n.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:CKEDITOR.TRISTATE_OFF,tablerow_insertAfter:CKEDITOR.TRISTATE_OFF,tablerow_delete:CKEDITOR.TRISTATE_OFF}}},tablerow_insertBefore:{label:n.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:n.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:n.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},tablecolumn:{label:n.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:CKEDITOR.TRISTATE_OFF,tablecolumn_insertAfter:CKEDITOR.TRISTATE_OFF,tablecolumn_delete:CKEDITOR.TRISTATE_OFF}}},tablecolumn_insertBefore:{label:n.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:n.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:n.column.deleteColumn,group:"tablecolumn",command:"columnDelete",order:15}}),i.contextMenu&&i.contextMenu.addListener(function(e,t,n){return(e=n.contains({td:1,th:1},1))&&!e.isReadOnly()?{tablecell:CKEDITOR.TRISTATE_OFF,tablerow:CKEDITOR.TRISTATE_OFF,tablecolumn:CKEDITOR.TRISTATE_OFF}:null})},getCellColIndex:o,insertRow:s,insertColumn:r,getSelectedCells:y},CKEDITOR.plugins.add("tabletools",CKEDITOR.plugins.tabletools)}(),CKEDITOR.tools.buildTableMap=function(e,t,n,i,a){e=e.$.rows,n=n||0,i="number"==typeof i?i:e.length-1,a="number"==typeof a?a:-1;var s=-1,o=[];for(t=t||0;t<=i;t++){!o[++s]&&(o[s]=[]);for(var r=-1,l=n;l<=(-1===a?e[t].cells.length-1:a);l++){if(!(d=e[t].cells[l]))break;for(r++;o[s][r];)r++;for(var c=isNaN(d.colSpan)?1:d.colSpan,d=isNaN(d.rowSpan)?1:d.rowSpan,u=0;u<d&&!(i<t+u);u++){o[s+u]||(o[s+u]=[]);for(var _=0;_<c;_++)o[s+u][r+_]=e[t].cells[l]}if(r+=c-1,-1!==a&&a<=r)break}}return o},function(){function v(e,t){var n,i,a=e.getAscendant("table"),s=t.getAscendant("table"),o=CKEDITOR.tools.buildTableMap(a),r=e.getAscendant("tr",!0).$.rowIndex,l=t.getAscendant("tr",!0).$.rowIndex,c=[],d={};for(a.contains(s)&&(l=(t=t.getAscendant({td:1,th:1})).getAscendant("tr",!0).$.rowIndex),l<r&&(a=r,r=l,l=a,a=e,e=t,t=a),a=0;a<o[r].length;a++)if(e.$===o[r][a]){n=a;break}for(a=0;a<o[l].length;a++)if(t.$===o[l][a]){i=a;break}for(i<n&&(a=n,n=i,i=a),a=r;a<=l;a++)for(r=n;r<=i;r++)(s=new CKEDITOR.dom.element(o[a][r])).$&&!s.getCustomData("selected_cell")&&(c.push(s),CKEDITOR.dom.element.setMarker(d,s,"selected_cell",!0));return CKEDITOR.dom.element.clearAllMarkers(d),c}function d(e){return e=e.data.$,CKEDITOR.env.ie&&CKEDITOR.env.version<9?1===e.button:0===e.button}function u(e){return(e=e.editable().findOne(".cke_table-faked-selection"))&&e.getAscendant("table")}function _(e,t){var n,i=e.editable().find(".cke_table-faked-selection");for(e.fire("lockSnapshot"),e.editable().removeClass("cke_table-faked-selection-editor"),n=0;n<i.count();n++)i.getItem(n).removeClass("cke_table-faked-selection");0<i.count()&&i.getItem(0).getAscendant("table").removeClass("cke_table-faked-selection-table"),e.fire("unlockSnapshot"),t&&(m={active:!1},e.getSelection().isInTable()&&e.getSelection().reset())}function b(e,t){var n,i,a=[];for(i=0;i<t.length;i++)(n=e.createRange()).setStartBefore(t[i]),n.setEndAfter(t[i]),a.push(n);e.getSelection().selectRanges(a)}function h(e){var t=e.editable().find(".cke_table-faked-selection");t.count()<1||b(e,t=v(t.getItem(0),t.getItem(t.count()-1)))}function p(e,t,n){var i,a=y(e.getSelection(!0));if(t=t.is("table")?null:t,(i=m.active&&!m.first)&&!(i=t)&&(i=e.getSelection().getRanges(),i=!!(1<a.length||i[0]&&!i[0].collapsed)),i)m.first=t||a[0],m.dirty=!t&&1!==a.length;else if(m.active&&t&&m.first.getAscendant("table").equals(t.getAscendant("table"))){if(a=v(m.first,t),!m.dirty&&1===a.length)return _(e,"mouseup"===n.name);m.dirty=!0,m.last=t,b(e,a)}}function a(e){var t,n=(e=e.editor||e.sender.editor)&&e.getSelection(),i=n&&n.getRanges()||[];if(n&&(_(e),n.isInTable()&&n.isFake)){for(1===i.length&&i[0]._getTableElement()&&i[0]._getTableElement().is("table")&&(t=i[0]._getTableElement()),t=y(n,t),e.fire("lockSnapshot"),n=0;n<t.length;n++)t[n].addClass("cke_table-faked-selection");0<t.length&&(e.editable().addClass("cke_table-faked-selection-editor"),t[0].getAscendant("table").addClass("cke_table-faked-selection-table")),e.fire("unlockSnapshot")}}function f(e){function a(e,t){return!(!e||!t)&&(e.equals(t)||e.contains(t)||t.contains(e)||e.getCommonAncestor(t).is(c))}function s(e){return!e.getAscendant("table",!0)&&e.getDocument().equals(n.document)}function t(e,t,n,i){return!(("mousedown"!==e.name||!d(e)&&i)&&("mouseup"!==e.name||s(e.data.getTarget())||a(n,i)))}if(e.data.getTarget().getName){var n=e.editor||e.listenerData.editor,i=n.getSelection(1),o=u(n),r=(l=e.data.getTarget())&&l.getAscendant({td:1,th:1},!0),l=l&&l.getAscendant("table",!0),c={table:1,thead:1,tbody:1,tfoot:1,tr:1,td:1,th:1};t(e,i,o,l)&&_(n,!0),!m.active&&"mousedown"===e.name&&d(e)&&l&&(m={active:!0},CKEDITOR.document.on("mouseup",f,null,{editor:n})),(r||l)&&p(n,r||l,e),"mouseup"===e.name&&(d(e)&&(s(e.data.getTarget())||a(o,l))&&h(n),m={active:!1},CKEDITOR.document.removeListener("mouseup",f))}}function s(e){var t=e.data.getTarget().getAscendant({td:1,th:1},!0);t&&!t.hasClass("cke_table-faked-selection")&&(e.cancel(),e.data.preventDefault())}function n(e,t){function n(e){e.cancel()}var i,a,s,o,r=e.getSelection(),l=r.createBookmarks(),c=e.document,d=e.createRange(),u=c.getDocumentElement().$,_=CKEDITOR.env.ie&&CKEDITOR.env.version<9,h=e.blockless||CKEDITOR.env.ie?"span":"div";c.getById("cke_table_copybin")||(i=c.createElement(h),(a=c.createElement(h)).setAttributes({id:"cke_table_copybin","data-cke-temp":"1"}),i.setStyles({position:"absolute",width:"1px",height:"1px",overflow:"hidden"}),i.setStyle("ltr"==e.config.contentsLangDirection?"left":"right","-5000px"),i.setHtml(e.getSelectedHtml(!0)),e.fire("lockSnapshot"),a.append(i),e.editable().append(a),o=e.on("selectionChange",n,null,null,0),_&&(s=u.scrollTop),d.selectNodeContents(i),d.select(),_&&(u.scrollTop=s),setTimeout(function(){a.remove(),r.selectBookmarks(l),o.removeListener(),e.fire("unlockSnapshot"),t&&(e.extractSelectedHtml(),e.fire("saveSnapshot"))},100))}function o(e){var t=e.editor||e.sender.editor;t.getSelection().isInTable()&&n(t,"cut"===e.name)}function e(e){function t(e){var t=(e=e.getRanges()[0]).endContainer.getAscendant("tr",!0);if(t&&e.collapsed){if(e.checkBoundaryOfElement(t,CKEDITOR.START))return 1;if(e.checkBoundaryOfElement(t,CKEDITOR.END))return 2}return 0}function n(e){var t,n=0;for(t=0;t<e.length;t++)e[t].length>n&&(n=e[t].length);return n}function i(e){var t,n=e.getAscendant("table"),i=e.getParent().$.rowIndex;n=CKEDITOR.tools.buildTableMap(n);for(t=0;t<n[i].length;t++)if(new CKEDITOR.dom.element(n[i][t]).equals(e))return t}var a,s,o,r,l,c,d=e.editor,u=d.dataProcessor,_=d.getSelection(),h=new CKEDITOR.dom.element("body"),p=0,f=0,m=0,g=0,A={};if(u||(u=new CKEDITOR.htmlDataProcessor(d)),h.setHtml(u.toHtml(e.data.dataValue),{fixForBody:!1}),g=h.findOne("table"),_.getRanges().length&&(_.isInTable()||(a=t(_)))&&(s=y(_)).length){if(e.stop(),e=s[0].getAscendant("table"),m=(o=(s=y(_,e))[0]).getParent(),l=(r=s[s.length-1]).getParent(),!a)for(u=0;u<s.length;u++)s[u].setHtml("");if(1<h.getChildCount()||!g)s[0].setHtml(h.getHtml()),d.fire("saveSnapshot");else{if(a){for(s=m.getChildCount(),(m=l=new CKEDITOR.dom.element("tr"))["insert"+(1===a?"Before":"After")](o.getParent()),u=0;u<s;u++)(o=new CKEDITOR.dom.element("td")).appendTo(m);o=m.getFirst(),r=m.getLast(),_.selectElement(m),s=y(_)}if(a=CKEDITOR.tools.buildTableMap(e,m.$.rowIndex,$(o,!0),l.$.rowIndex,i(r)),m=n(_=CKEDITOR.tools.buildTableMap(g)),g=n(a),_.length>a.length)for(p=_.length-a.length,u=0;u<p;u++)w(s);if(g<m)for(f=m-g,u=0;u<f;u++)k(s);for(m=(o=s[0]).getParent(),r=s[s.length-1],r=(l=new CKEDITOR.dom.element(e.$.rows[r.getParent().$.rowIndex+p])).getChild(r.$.cellIndex+f),p=$(s[0],!0),s=i(r),a=CKEDITOR.tools.buildTableMap(e,m.$.rowIndex,p,l.$.rowIndex,s),u=0;u<_.length;u++)for(f=new CKEDITOR.dom.element(e.$.rows[m.$.rowIndex+u]),s=0;s<_[u].length;s++)c=new CKEDITOR.dom.element(_[u][s]),h=a[u]&&a[u][s]?new CKEDITOR.dom.element(a[u][s]):null,c&&!c.getCustomData("processed")?(h&&h.getParent()?c.replace(h):(0===s||_[u][s-1])&&((h=0!==s?new CKEDITOR.dom.element(_[u][s-1]):null)&&f.equals(h.getParent())?c.insertAfter(h):0<p?c.insertAfter(new CKEDITOR.dom.element(f.$.cells[p])):f.append(c,!0)),CKEDITOR.dom.element.setMarker(A,c,"processed",!0)):c.getCustomData("processed")&&h&&h.remove();CKEDITOR.dom.element.clearAllMarkers(A),b(d,v(new CKEDITOR.dom.element(_[0][0]),c)),d.fire("saveSnapshot"),setTimeout(function(){d.fire("afterPaste")},0)}}}function t(t,n,i){t.on("beforeCommandExec",function(e){-1!==CKEDITOR.tools.array.indexOf(n,e.data.name)&&(e.data.selectedCells=y(t.getSelection()))}),t.on("afterCommandExec",function(e){-1!==CKEDITOR.tools.array.indexOf(n,e.data.name)&&i(t,e.data)})}var i,y,$,w,k,m={active:!1};CKEDITOR.plugins.tableselection={getCellsBetween:v,keyboardIntegration:function(a){function c(e){e.getEnclosedNode()?e.getEnclosedNode().setText(""):e.deleteContents(),CKEDITOR.tools.array.forEach(e._find("td"),function(e){e.appendBogus()})}var e=a.editable();e.attachListener(e,"keydown",function(d){function r(e,t){if(!t.length)return null;var n=d.createRange(),i=CKEDITOR.dom.range.mergeRanges(t);CKEDITOR.tools.array.forEach(i,function(e){e.enlarge(CKEDITOR.ENLARGE_ELEMENT)});var a=(s=i[0].getBoundaryNodes()).startNode,s=s.endNode;if(a&&a.is&&a.is(u)){for(var o=a.getAscendant("table",!0),r=a.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,o),l=!1,c=function(e){return!a.contains(e)&&e.is&&e.is("td","th")};r&&!c(r);)r=r.getPreviousSourceNode(!1,CKEDITOR.NODE_ELEMENT,o);return!r&&s&&s.is&&!s.is("table")&&s.getNext()&&(r=s.getNext().findOne("td, th"),l=!0),r?n["moveToElementEdit"+(l?"Start":"End")](r):(n.setStartBefore(a.getAscendant("table",!0)),n.collapse(!0)),i[0].deleteContents(),[n]}return a?(n.moveToElementEditablePosition(a),[n]):void 0}var l={37:1,38:1,39:1,40:1,8:1,46:1},u=CKEDITOR.tools.extend({table:1},CKEDITOR.dtd.$tableContent);return delete u.td,delete u.th,function(e){var t,n,i,a,s=e.data.getKey(),o=37===s||38==s;if(l[s]&&(t=d.getSelection())&&t.isInTable()&&t.isFake)if(i=(n=t.getRanges())[0]._getTableElement(),a=n[n.length-1]._getTableElement(),e.data.preventDefault(),e.cancel(),8<s&&s<46)n[0].moveToElementEditablePosition(o?i:a,!o),t.selectRanges([n[0]]);else{for(e=0;e<n.length;e++)c(n[e]);(e=r(i,n))?n=e:n[0].moveToElementEditablePosition(i),t.selectRanges(n),d.fire("saveSnapshot")}}}(a),null,null,-1),e.attachListener(e,"keypress",function(e){var t,n=a.getSelection(),i=e.data.$.charCode||13===e.data.getKey();if(n&&n.isInTable()&&n.isFake&&i&&!(e.data.getKeystroke()&CKEDITOR.CTRL)){for(i=(e=n.getRanges())[0].getEnclosedNode().getAscendant({td:1,th:1},!0),t=0;t<e.length;t++)c(e[t])
;e[0].moveToElementEditablePosition(i),n.selectRanges([e[0]])}},null,null,-1)},isSupportedEnvironment:!(CKEDITOR.env.ie&&CKEDITOR.env.version<11)},CKEDITOR.plugins.add("tableselection",{requires:"clipboard,tabletools",onLoad:function(){i=CKEDITOR.plugins.tabletools,y=i.getSelectedCells,$=i.getCellColIndex,w=i.insertRow,k=i.insertColumn,CKEDITOR.document.appendStyleSheet(this.path+"/styles/tableselection.css")},init:function(i){CKEDITOR.plugins.tableselection.isSupportedEnvironment&&(i.addContentsCss&&i.addContentsCss(this.path+"/styles/tableselection.css"),i.on("contentDom",function(){var e=i.editable(),t=e.isInline()?e:i.document,n={editor:i};e.attachListener(t,"mousedown",f,null,n),e.attachListener(t,"mousemove",f,null,n),e.attachListener(t,"mouseup",f,null,n),e.attachListener(e,"dragstart",s),e.attachListener(i,"selectionCheck",a),CKEDITOR.plugins.tableselection.keyboardIntegration(i),CKEDITOR.plugins.clipboard&&!CKEDITOR.plugins.clipboard.isCustomCopyCutSupported&&(e.attachListener(e,"cut",o),e.attachListener(e,"copy",o))}),i.on("paste",e),t(i,"rowInsertBefore rowInsertAfter columnInsertBefore columnInsertAfter cellInsertBefore cellInsertAfter".split(" "),function(e,t){b(e,t.selectedCells)}),t(i,["cellMerge","cellMergeRight","cellMergeDown"],function(e,t){b(e,[t.commandData.cell])}),t(i,["cellDelete"],function(e){_(e,!0)}))}})}(),function(){var r=[CKEDITOR.CTRL+90,CKEDITOR.CTRL+89,CKEDITOR.CTRL+CKEDITOR.SHIFT+90],n={8:1,46:1};CKEDITOR.plugins.add("undo",{init:function(e){function t(e){i.enabled&&!1!==e.data.command.canUndo&&i.save()}function n(){i.enabled=!e.readOnly&&"wysiwyg"==e.mode,i.onChange()}var i=e.undoManager=new l(e),a=i.editingHandler=new c(i),s=e.addCommand("undo",{exec:function(){i.undo()&&(e.selectionChange(),this.fire("afterUndo"))},startDisabled:!0,canUndo:!1}),o=e.addCommand("redo",{exec:function(){i.redo()&&(e.selectionChange(),this.fire("afterRedo"))},startDisabled:!0,canUndo:!1});e.setKeystroke([[r[0],"undo"],[r[1],"redo"],[r[2],"redo"]]),i.onChange=function(){s.setState(i.undoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED),o.setState(i.redoable()?CKEDITOR.TRISTATE_OFF:CKEDITOR.TRISTATE_DISABLED)},e.on("beforeCommandExec",t),e.on("afterCommandExec",t),e.on("saveSnapshot",function(e){i.save(e.data&&e.data.contentOnly)}),e.on("contentDom",a.attachListeners,a),e.on("instanceReady",function(){e.fire("saveSnapshot")}),e.on("beforeModeUnload",function(){"wysiwyg"==e.mode&&i.save(!0)}),e.on("mode",n),e.on("readOnly",n),e.ui.addButton&&(e.ui.addButton("Undo",{label:e.lang.undo.undo,command:"undo",toolbar:"undo,10"}),e.ui.addButton("Redo",{label:e.lang.undo.redo,command:"redo",toolbar:"undo,20"})),e.resetUndo=function(){i.reset(),e.fire("saveSnapshot")},e.on("updateSnapshot",function(){i.currentImage&&i.update()}),e.on("lockSnapshot",function(e){e=e.data,i.lock(e&&e.dontUpdate,e&&e.forceUpdate)}),e.on("unlockSnapshot",i.unlock,i)}}),CKEDITOR.plugins.undo={};var l=CKEDITOR.plugins.undo.UndoManager=function(e){this.strokesRecorded=[0,0],this.locked=null,this.previousKeyGroup=-1,this.limit=e.config.undoStackSize||20,this.strokesLimit=25,this.editor=e,this.reset()};l.prototype={type:function(e,t){var n=l.getKeyGroup(e),i=this.strokesRecorded[n]+1;t=t||i>=this.strokesLimit,this.typing||(this.hasUndo=this.typing=!0,this.hasRedo=!1,this.onChange()),t?(i=0,this.editor.fire("saveSnapshot")):this.editor.fire("change"),this.strokesRecorded[n]=i,this.previousKeyGroup=n},keyGroupChanged:function(e){return l.getKeyGroup(e)!=this.previousKeyGroup},reset:function(){this.snapshots=[],this.index=-1,this.currentImage=null,this.hasRedo=this.hasUndo=!1,this.locked=null,this.resetType()},resetType:function(){this.strokesRecorded=[0,0],this.typing=!1,this.previousKeyGroup=-1},refreshState:function(){this.hasUndo=!!this.getNextImage(!0),this.hasRedo=!!this.getNextImage(!1),this.resetType(),this.onChange()},save:function(e,t,n){var i=this.editor;if(this.locked||"ready"!=i.status||"wysiwyg"!=i.mode)return!1;var a=i.editable();if(!a||"ready"!=a.status)return!1;if(a=this.snapshots,t||(t=new s(i)),!1===t.contents)return!1;if(this.currentImage)if(t.equalsContent(this.currentImage)){if(e||t.equalsSelection(this.currentImage))return!1}else!1!==n&&i.fire("change");return a.splice(this.index+1,a.length-this.index-1),a.length==this.limit&&a.shift(),this.index=a.push(t)-1,this.currentImage=t,!1!==n&&this.refreshState(),!0},restoreImage:function(e){var t,n=this.editor;e.bookmarks&&(n.focus(),t=n.getSelection()),this.locked={level:999},this.editor.loadSnapshot(e.contents),e.bookmarks?t.selectBookmarks(e.bookmarks):CKEDITOR.env.ie&&((t=this.editor.document.getBody().$.createTextRange()).collapse(!0),t.select()),this.locked=null,this.index=e.index,this.currentImage=this.snapshots[this.index],this.update(),this.refreshState(),n.fire("change")},getNextImage:function(e){var t,n=this.snapshots,i=this.currentImage;if(i)if(e){for(t=this.index-1;0<=t;t--)if(e=n[t],!i.equalsContent(e))return e.index=t,e}else for(t=this.index+1;t<n.length;t++)if(e=n[t],!i.equalsContent(e))return e.index=t,e;return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){if(this.undoable()){this.save(!0);var e=this.getNextImage(!0);if(e)return this.restoreImage(e),!0}return!1},redo:function(){if(this.redoable()&&(this.save(!0),this.redoable())){var e=this.getNextImage(!1);if(e)return this.restoreImage(e),!0}return!1},update:function(e){if(!this.locked){e||(e=new s(this.editor));for(var t=this.index,n=this.snapshots;0<t&&this.currentImage.equalsContent(n[t-1]);)--t;n.splice(t,this.index-t+1,e),this.index=t,this.currentImage=e}},updateSelection:function(e){if(!this.snapshots.length)return!1;var t=this.snapshots,n=t[t.length-1];return!(!n.equalsContent(e)||n.equalsSelection(e))&&(this.currentImage=t[t.length-1]=e,!0)},lock:function(e,t){if(this.locked)this.locked.level++;else if(e)this.locked={level:1};else{var n=null;if(t)n=!0;else{var i=new s(this.editor,!0);this.currentImage&&this.currentImage.equalsContent(i)&&(n=i)}this.locked={update:n,level:1}}},unlock:function(){if(this.locked&&!--this.locked.level){var e=this.locked.update;if(!(this.locked=null)===e)this.update();else if(e){var t=new s(this.editor,!0);e.equalsContent(t)||this.update()}}}},l.navigationKeyCodes={37:1,38:1,39:1,40:1,36:1,35:1,33:1,34:1},l.keyGroups={PRINTABLE:0,FUNCTIONAL:1},l.isNavigationKey=function(e){return!!l.navigationKeyCodes[e]},l.getKeyGroup=function(e){var t=l.keyGroups;return n[e]?t.FUNCTIONAL:t.PRINTABLE},l.getOppositeKeyGroup=function(e){var t=l.keyGroups;return e==t.FUNCTIONAL?t.PRINTABLE:t.FUNCTIONAL},l.ieFunctionalKeysBug=function(e){return CKEDITOR.env.ie&&l.getKeyGroup(e)==l.keyGroups.FUNCTIONAL};var s=CKEDITOR.plugins.undo.Image=function(e,t){(this.editor=e).fire("beforeUndoImage");var n=e.getSnapshot();CKEDITOR.env.ie&&n&&(n=n.replace(/\s+data-cke-expando=".*?"/g,"")),this.contents=n,t||(this.bookmarks=(n=n&&e.getSelection())&&n.createBookmarks2(!0)),e.fire("afterUndoImage")},i=/\b(?:href|src|name)="[^"]*?"/gi;s.prototype={equalsContent:function(e){var t=this.contents;return e=e.contents,CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks)&&(t=t.replace(i,""),e=e.replace(i,"")),t==e},equalsSelection:function(e){var t=this.bookmarks;if(e=e.bookmarks,t||e){if(!t||!e||t.length!=e.length)return!1;for(var n=0;n<t.length;n++){var i=t[n],a=e[n];if(i.startOffset!=a.startOffset||i.endOffset!=a.endOffset||!CKEDITOR.tools.arrayCompare(i.start,a.start)||!CKEDITOR.tools.arrayCompare(i.end,a.end))return!1}}return!0}};var c=CKEDITOR.plugins.undo.NativeEditingHandler=function(e){this.undoManager=e,this.ignoreInputEvent=!1,this.keyEventsStack=new t,this.lastKeydownImage=null};c.prototype={onKeydown:function(e){var t=e.data.getKey();229!==t&&(-1<CKEDITOR.tools.indexOf(r,e.data.getKeystroke())?e.data.preventDefault():(this.keyEventsStack.cleanUp(e),e=this.undoManager,this.keyEventsStack.getLast(t)||this.keyEventsStack.push(t),this.lastKeydownImage=new s(e.editor),(l.isNavigationKey(t)||this.undoManager.keyGroupChanged(t))&&(e.strokesRecorded[0]||e.strokesRecorded[1])&&(e.save(!1,this.lastKeydownImage,!1),e.resetType())))},onInput:function(){if(this.ignoreInputEvent)this.ignoreInputEvent=!1;else{var e=this.keyEventsStack.getLast();e||(e=this.keyEventsStack.push(0)),this.keyEventsStack.increment(e.keyCode),this.keyEventsStack.getTotalInputs()>=this.undoManager.strokesLimit&&(this.undoManager.type(e.keyCode,!0),this.keyEventsStack.resetInputs())}},onKeyup:function(e){var t=this.undoManager;e=e.data.getKey();var n=this.keyEventsStack.getTotalInputs();this.keyEventsStack.remove(e),l.ieFunctionalKeysBug(e)&&this.lastKeydownImage&&this.lastKeydownImage.equalsContent(new s(t.editor,!0))||(0<n?t.type(e):l.isNavigationKey(e)&&this.onNavigationKey(!0))},onNavigationKey:function(e){var t=this.undoManager;!e&&t.save(!0,null,!1)||t.updateSelection(new s(t.editor)),t.resetType()},ignoreInputEventListener:function(){this.ignoreInputEvent=!0},attachListeners:function(){var e=this.undoManager.editor,t=e.editable(),n=this;t.attachListener(t,"keydown",function(e){n.onKeydown(e),l.ieFunctionalKeysBug(e.data.getKey())&&n.onInput()},null,null,999),t.attachListener(t,CKEDITOR.env.ie?"keypress":"input",n.onInput,n,null,999),t.attachListener(t,"keyup",n.onKeyup,n,null,999),t.attachListener(t,"paste",n.ignoreInputEventListener,n,null,999),t.attachListener(t,"drop",n.ignoreInputEventListener,n,null,999),t.attachListener(t.isInline()?t:e.document.getDocumentElement(),"click",function(){n.onNavigationKey()},null,null,999),t.attachListener(this.undoManager.editor,"blur",function(){n.keyEventsStack.remove(9)},null,null,999)}};var t=CKEDITOR.plugins.undo.KeyEventsStack=function(){this.stack=[]};t.prototype={push:function(e){return e=this.stack.push({keyCode:e,inputs:0}),this.stack[e-1]},getLastIndex:function(e){if("number"!=typeof e)return this.stack.length-1;for(var t=this.stack.length;t--;)if(this.stack[t].keyCode==e)return t;return-1},getLast:function(e){return-1!=(e=this.getLastIndex(e))?this.stack[e]:null},increment:function(e){this.getLast(e).inputs++},remove:function(e){-1!=(e=this.getLastIndex(e))&&this.stack.splice(e,1)},resetInputs:function(e){if("number"==typeof e)this.getLast(e).inputs=0;else for(e=this.stack.length;e--;)this.stack[e].inputs=0},getTotalInputs:function(){for(var e=this.stack.length,t=0;e--;)t+=this.stack[e].inputs;return t},cleanUp:function(e){(e=e.data.$).ctrlKey||e.metaKey||this.remove(17),e.shiftKey||this.remove(16),e.altKey||this.remove(18)}}}(),CKEDITOR.plugins.add("wsc",{requires:"dialog",parseApi:function(e){e.config.wsc_onFinish="function"==typeof e.config.wsc_onFinish?e.config.wsc_onFinish:function(){},e.config.wsc_onClose="function"==typeof e.config.wsc_onClose?e.config.wsc_onClose:function(){}},parseConfig:function(e){e.config.wsc_customerId=e.config.wsc_customerId||CKEDITOR.config.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk",e.config.wsc_customDictionaryIds=e.config.wsc_customDictionaryIds||CKEDITOR.config.wsc_customDictionaryIds||"",e.config.wsc_userDictionaryName=e.config.wsc_userDictionaryName||CKEDITOR.config.wsc_userDictionaryName||"",e.config.wsc_customLoaderScript=e.config.wsc_customLoaderScript||CKEDITOR.config.wsc_customLoaderScript,e.config.wsc_interfaceLang=e.config.wsc_interfaceLang,CKEDITOR.config.wsc_cmd=e.config.wsc_cmd||CKEDITOR.config.wsc_cmd||"spell",CKEDITOR.config.wsc_version="v4.3.0-master-d769233",CKEDITOR.config.wsc_removeGlobalVariable=!0},onLoad:function(e){"moono-lisa"==(CKEDITOR.skinName||e.config.skin)&&CKEDITOR.document.appendStyleSheet(this.path+"skins/"+CKEDITOR.skin.name+"/wsc.css")},init:function(e){var t=CKEDITOR.env;this.parseConfig(e),this.parseApi(e),e.addCommand("checkspell",new CKEDITOR.dialogCommand("checkspell")).modes={wysiwyg:!(CKEDITOR.env.opera||CKEDITOR.env.air||document.domain!=window.location.hostname||t.ie&&(t.version<8||t.quirks))},"undefined"==typeof e.plugins.scayt&&e.ui.addButton&&e.ui.addButton("SpellChecker",{label:e.lang.wsc.toolbar,click:function(e){var t=e.elementMode==CKEDITOR.ELEMENT_MODE_INLINE?e.container.getText():e.document.getBody().getText();(t=t.replace(/\s/g,""))?e.execCommand("checkspell"):alert("Nothing to check!")},toolbar:"spellchecker,10"}),CKEDITOR.dialog.add("checkspell",this.path+(CKEDITOR.env.ie&&CKEDITOR.env.version<=7?"dialogs/wsc_ie.js":window.postMessage?"dialogs/wsc.js":"dialogs/wsc_ie.js"))}}),CKEDITOR.config.plugins="dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,button,toolbar,notification,clipboard,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,copyformatting,div,resize,elementspath,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,horizontalrule,htmlwriter,iframe,wysiwygarea,image,indent,indentblock,indentlist,smiley,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,scayt,stylescombo,tab,table,tabletools,tableselection,undo,wsc",CKEDITOR.config.skin="moono-lisa",J=function(e,t){var n=CKEDITOR.getUrl("plugins/"+t);e=e.split(",");for(var i=0;i<e.length;i++)CKEDITOR.skin.icons[e[i]]={path:n,offset:-e[++i],bgsize:e[++i]}},CKEDITOR.env.hidpi?J("about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,bgcolor,384,,textcolor,408,,templates-rtl,432,,templates,456,,copyformatting,480,,creatediv,504,,find-rtl,528,,find,552,,replace,576,,flash,600,,button,624,,checkbox,648,,form,672,,hiddenfield,696,,imagebutton,720,,radio,744,,select-rtl,768,,select,792,,textarea-rtl,816,,textarea,840,,textfield-rtl,864,,textfield,888,,horizontalrule,912,,iframe,936,,image,960,,indent-rtl,984,,indent,1008,,outdent-rtl,1032,,outdent,1056,,smiley,1080,,justifyblock,1104,,justifycenter,1128,,justifyleft,1152,,justifyright,1176,,language,1200,,anchor-rtl,1224,,anchor,1248,,link,1272,,unlink,1296,,bulletedlist-rtl,1320,,bulletedlist,1344,,numberedlist-rtl,1368,,numberedlist,1392,,maximize,1416,,newpage-rtl,1440,,newpage,1464,,pagebreak-rtl,1488,,pagebreak,1512,,pastetext-rtl,1536,,pastetext,1560,,pastefromword-rtl,1584,,pastefromword,1608,,preview-rtl,1632,,preview,1656,,print,1680,,removeformat,1704,,save,1728,,selectall,1752,,showblocks-rtl,1776,,showblocks,1800,,source-rtl,1824,,source,1848,,specialchar,1872,,scayt,1896,,table,1920,,redo-rtl,1944,,redo,1968,,undo-rtl,1992,,undo,2016,,spellchecker,2040,","icons_hidpi.png"):J("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,bgcolor,384,auto,textcolor,408,auto,templates-rtl,432,auto,templates,456,auto,copyformatting,480,auto,creatediv,504,auto,find-rtl,528,auto,find,552,auto,replace,576,auto,flash,600,auto,button,624,auto,checkbox,648,auto,form,672,auto,hiddenfield,696,auto,imagebutton,720,auto,radio,744,auto,select-rtl,768,auto,select,792,auto,textarea-rtl,816,auto,textarea,840,auto,textfield-rtl,864,auto,textfield,888,auto,horizontalrule,912,auto,iframe,936,auto,image,960,auto,indent-rtl,984,auto,indent,1008,auto,outdent-rtl,1032,auto,outdent,1056,auto,smiley,1080,auto,justifyblock,1104,auto,justifycenter,1128,auto,justifyleft,1152,auto,justifyright,1176,auto,language,1200,auto,anchor-rtl,1224,auto,anchor,1248,auto,link,1272,auto,unlink,1296,auto,bulletedlist-rtl,1320,auto,bulletedlist,1344,auto,numberedlist-rtl,1368,auto,numberedlist,1392,auto,maximize,1416,auto,newpage-rtl,1440,auto,newpage,1464,auto,pagebreak-rtl,1488,auto,pagebreak,1512,auto,pastetext-rtl,1536,auto,pastetext,1560,auto,pastefromword-rtl,1584,auto,pastefromword,1608,auto,preview-rtl,1632,auto,preview,1656,auto,print,1680,auto,removeformat,1704,auto,save,1728,auto,selectall,1752,auto,showblocks-rtl,1776,auto,showblocks,1800,auto,source-rtl,1824,auto,source,1848,auto,specialchar,1872,auto,scayt,1896,auto,table,1920,auto,redo-rtl,1944,auto,redo,1968,auto,undo-rtl,1992,auto,undo,2016,auto,spellchecker,2040,auto","icons.png"),CKEDITOR.lang.languages={af:1,sq:1,ar:1,az:1,eu:1,bn:1,bs:1,bg:1,ca:1,"zh-cn":1,zh:1,hr:1,cs:1,da:1,nl:1,en:1,"en-au":1,"en-ca":1,"en-gb":1,eo:1,et:1,fo:1,fi:1,fr:1,"fr-ca":1,gl:1,ka:1,de:1,"de-ch":1,el:1,gu:1,he:1,hi:1,hu:1,is:1,id:1,it:1,ja:1,km:1,ko:1,ku:1,lv:1,lt:1,mk:1,ms:1,mn:1,no:1,nb:1,oc:1,fa:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,sr:1,"sr-latn":1,si:1,sk:1,sl:1,es:1,"es-mx":1,sv:1,tt:1,th:1,tr:1,ug:1,uk:1,vi:1,cy:1})}(),function(e,t){"function"==typeof define&&define.amd?define("i18n",function(){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(e):e.I18n=t(e)}(this,function(e){"use strict";var g=e&&e.I18n||{},a=Array.prototype.slice,A=function(e){return("0"+e.toString()).substr(-2)},c=function(e,t){return i("round",e,-t).toFixed(t)},l=function(e){var t=typeof e;return"function"===t||"object"===t},n=function(e){return"function"===typeof e},d=function(e){return null!=e},o=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)},s=function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},r=function(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)},u=function(e){return!0===e||!1===e},_=function(e){return null===e},i=function(e,t,n){return void 0===n||0==+n?Math[e](t):(t=+t,n=+n,isNaN(t)||"number"!=typeof n||n%1!=0?NaN:(t=t.toString().split("e"),+((t=(t=Math[e](+(t[0]+"e"+(t[1]?+t[1]-n:-n)))).toString().split("e"))[0]+"e"+(t[1]?+t[1]+n:n))))},h=function(e,t){return n(e)?e(t):e},p=function(e,t){var n,i;for(n in t)t.hasOwnProperty(n)&&(i=t[n],s(i)||r(i)||u(i)||o(i)||_(i)?e[n]=i:(null==e[n]&&(e[n]={}),p(e[n],i)));return e},v={day_names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr_day_names:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],month_names:[null,"January","February","March","April","May","June","July","August","September","October","November","December"],abbr_month_names:[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridian:["AM","PM"]},f={precision:3,separator:".",delimiter:",",strip_insignificant_zeros:!1},m={unit:"$",precision:2,format:"%u%n",sign_first:!0,delimiter:",",separator:"."},b={unit:"%",precision:3,format:"%n%u",separator:".",delimiter:""},y=[null,"kb","mb","gb","tb"],t={defaultLocale:"en",locale:"en",defaultSeparator:".",placeholder:/(?:\{\{|%\{)(.*?)(?:\}\}?)/gm,fallbacks:!1,translations:{},missingBehaviour:"message",missingTranslationPrefix:""};return g.reset=function(){var e;for(e in t)this[e]=t[e]},g.initializeOptions=function(){var e;for(e in t)d(this[e])||(this[e]=t[e])},g.initializeOptions(),g.locales={},g.locales.get=function(e){var t=this[e]||this[g.locale]||this["default"];return n(t)&&(t=t(e)),!1===o(t)&&(t=[t]),t},g.locales["default"]=function(e){var t=[],a=[];return e&&t.push(e),!e&&g.locale&&t.push(g.locale),g.fallbacks&&g.defaultLocale&&t.push(g.defaultLocale),t.forEach(function(t){var e=t.split("-"),n=null,i=null;3===e.length?(n=[e[0],e[1]].join("-"),i=e[0]):2===e.length&&(n=e[0]),-1===a.indexOf(t)&&a.push(t),g.fallbacks&&[n,i].forEach(function(e){null!=e&&e!==t&&-1===a.indexOf(e)&&a.push(e)})}),t.length||t.push("en"),a},g.pluralization={},g.pluralization.get=function(e){return this[e]||this[g.locale]||this["default"]},g.pluralization["default"]=function(e){switch(e){case 0:return["zero","other"];case 1:return["one"];default:return["other"]}},g.currentLocale=function(){return this.locale||this.defaultLocale},g.isSet=d,g.lookup=function(e,t){t=t||{};var n,i,a,s,o=this.locales.get(t.locale).slice();for(a=this.getFullScope(e,t);o.length;)if(n=o.shift(),i=a.split(this.defaultSeparator),s=this.translations[n]){for(;i.length&&(s=s[i.shift()])!==undefined&&null!==s;);if(s!==undefined&&null!==s)return s}if(d(t.defaultValue))return h(t.defaultValue,e)},g.pluralizationLookupWithoutFallback=function(e,t,n){var i,a,s=this.pluralization.get(t)(e);if(l(n))for(;s.length;)if(i=s.shift(),d(n[i])){a=n[i];break}return a},g.pluralizationLookup=function(e,t,n){n=n||{};var i,a,s,o,r=this.locales.get(n.locale).slice();for(t=this.getFullScope(t,n);r.length;)if(i=r.shift(),a=t.split(this.defaultSeparator),s=this.translations[i]){for(;a.length&&(s=s[a.shift()],l(s));)0===a.length&&(o=this.pluralizationLookupWithoutFallback(e,i,s));if(null!=o)break}return null==o&&d(n.defaultValue)&&(o=l(n.defaultValue)?this.pluralizationLookupWithoutFallback(e,n.locale,n.defaultValue):n.defaultValue,s=n.defaultValue),{message:o,translations:s}},g.meridian=function(){var e=this.lookup("time"),t=this.lookup("date");return e&&e.am&&e.pm?[e.am,e.pm]:t&&t.meridian?t.meridian:v.meridian},g.prepareOptions=function(){for(var e,t=a.call(arguments),n={};t.length;)if("object"==typeof(e=t.shift()))for(var i in e)e.hasOwnProperty(i)&&(d(n[i])||(n[i]=e[i]));return n},g.createTranslationOptions=function(e,t){var n=[{scope:e}];return d(t.defaults)&&(n=n.concat(t.defaults)),d(t.defaultValue)&&n.push({message:t.defaultValue}),n},g.translate=function(t,n){n=n||{};var i,e=this.createTranslationOptions(t,n),a=t,s=this.prepareOptions(n);return delete s.defaultValue,e.some(function(e){if(d(e.scope)?(a=e.scope,i=this.lookup(a,s)):d(e.message)&&(i=h(e.message,t)),i!==undefined&&null!==i)return!0},this)?("string"==typeof i?i=this.interpolate(i,n):o(i)?i=i.map(function(e){return"string"==typeof e?this.interpolate(e,n):e},this):l(i)&&d(n.count)&&(i=this.pluralize(n.count,a,n)),i):this.missingTranslation(t,n)},g.interpolate=function(e,t){if(null==e)return e;t=t||{};var n,i,a,s,o=e.match(this.placeholder);if(!o)return e;for(;o.length;)a=(n=o.shift()).replace(this.placeholder,"$1"),i=d(t[a])?t[a].toString().replace(/\$/gm,"_#$#_"):a in t?this.nullPlaceholder(n,e,t):this.missingPlaceholder(n,e,t),s=new RegExp(n.replace(/{/gm,"\\{").replace(/}/gm,"\\}")),e=e.replace(s,i);return e.replace(/_#\$#_/g,"$")},g.pluralize=function(e,t,n){var i,a;return n=this.prepareOptions({count:String(e)},n),"undefined"==typeof(a=this.pluralizationLookup(e,t,n)).translations||null==a.translations?this.missingTranslation(t,n):"undefined"!=typeof a.message&&null!=a.message?this.interpolate(a.message,n):(i=this.pluralization.get(n.locale),this.missingTranslation(t+"."+i(e)[0],n))},g.missingTranslation=function(e,t){if("guess"!==this.missingBehaviour)return'[missing "'+[null!=t&&null!=t.locale?t.locale:this.currentLocale(),this.getFullScope(e,t)].join(this.defaultSeparator)+'" translation]';var n=e.split(".").slice(-1)[0];return(0<this.missingTranslationPrefix.length?this.missingTranslationPrefix:"")+n.replace("_"," ").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+" "+n.toLowerCase()})},g.missingPlaceholder=function(e){return"[missing "+e+" value]"},g.nullPlaceholder=function(){return g.missingPlaceholder.apply(g,arguments)},g.toNumber=function(e,t){t=this.prepareOptions(t,this.lookup("number.format"),f);var n,i,a=e<0,s=c(Math.abs(e),t.precision).toString().split("."),o=[],r=t.format||"%n",l=a?"-":"";for(e=s[0],n=s[1];0<e.length;)o.unshift(e.substr(Math.max(0,e.length-3),3)),e=e.substr(0,e.length-3);return i=o.join(t.delimiter),t.strip_insignificant_zeros&&n&&(n=n.replace(/0+$/,"")),0<t.precision&&n&&(i+=t.separator+n),i=(r=t.sign_first?"%s"+r:r.replace("%n","%s%n")).replace("%u",t.unit).replace("%n",i).replace("%s",l)},g.toCurrency=function(e,t){return t=this.prepareOptions(t,this.lookup("number.currency.format"),this.lookup("number.format"),m),this.toNumber(e,t)},g.localize=function(e,t,n){switch(n||(n={}),e){case"currency":return this.toCurrency(t);case"number":return e=this.lookup("number.format"),this.toNumber(t,e);case"percentage":return this.toPercentage(t);default:var i;return i=e.match(/^(date|time)/)?this.toTime(e,t):t.toString(),this.interpolate(i,n)}},g.parseDate=function(e){var t,n,i;if(null==e)return e;if("object"==typeof e)return e;if(t=e.toString().match(/(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}):(\d{2})([\.,]\d{1,3})?)?(Z|\+00:?00)?/)){for(var a=1;a<=6;a++)t[a]=parseInt(t[a],10)||0;t[2]-=1,i=t[7]?1e3*("0"+t[7]):null,n=t[8]?new Date(Date.UTC(t[1],t[2],t[3],t[4],t[5],t[6],i)):new Date(t[1],t[2],t[3],t[4],t[5],t[6],i)}else"number"==typeof e?(n=new Date).setTime(e):e.match(/([A-Z][a-z]{2}) ([A-Z][a-z]{2}) (\d+) (\d+:\d+:\d+) ([+-]\d+) (\d+)/)?(n=new Date).setTime(Date.parse([RegExp.$1,RegExp.$2,RegExp.$3,RegExp.$6,RegExp.$4,RegExp.$5].join(" "))):(e.match(/\d+ \d+:\d+:\d+ [+-]\d+ \d+/),(n=new Date).setTime(Date.parse(e)));return n},g.strftime=function(e,t){var n=this.lookup("date"),i=g.meridian();if(n||(n={}),n=this.prepareOptions(n,v),isNaN(e.getTime()))throw new Error("I18n.strftime() requires a valid date object, but received an invalid date.");var a=e.getDay(),s=e.getDate(),o=e.getFullYear(),r=e.getMonth()+1,l=e.getHours(),c=l,d=11<l?1:0,u=e.getSeconds(),_=e.getMinutes(),h=e.getTimezoneOffset(),p=Math.floor(Math.abs(h/60)),f=Math.abs(h)-60*p,m=(0<h?"-":"+")+(p.toString().length<2?"0"+p:p)+(f.toString().length<2?"0"+f:f);return 12<c?c-=12:0===c&&(c=12),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%a",n.abbr_day_names[a])).replace("%A",n.day_names[a])).replace("%b",n.abbr_month_names[r])).replace("%B",n.month_names[r])).replace("%d",A(s))).replace("%e",s)).replace("%-d",s)).replace("%H",A(l))).replace("%-H",l)).replace("%I",A(c))).replace("%-I",c)).replace("%l",c)).replace("%m",A(r))).replace("%-m",r)).replace("%M",A(_))).replace("%-M",_)).replace("%p",i[d])).replace("%P",i[d].toLowerCase())).replace("%S",A(u))).replace("%-S",u)).replace("%w",a)).replace("%y",A(o))).replace("%-y",A(o).replace(/^0+/,""))).replace("%Y",o)).replace("%z",m)).replace("%Z",m)},g.toTime=function(e,t){var n=this.parseDate(t),i=this.lookup(e);if(null==n)return n;var a=n.toString();return a.match(/invalid/i)?a:i?this.strftime(n,i):a},g.toPercentage=function(e,t){return t=this.prepareOptions(t,this.lookup("number.percentage.format"),this.lookup("number.format"),b),this.toNumber(e,t)},g.toHumanSize=function(e,t){for(var n,i,a=1024,s=e,o=0;a<=s&&o<4;)s/=a,o+=1;return 0===o?(n=this.t("number.human.storage_units.units.byte",{count:s}),i=0):(n=this.t("number.human.storage_units.units."+y[o]),i=s-Math.floor(s)==0?0:1),t=this.prepareOptions(t,{unit:n,precision:i,format:"%n%u",delimiter:""}),this.toNumber(s,t)},g.getFullScope=function(e,t){return t=t||{},o(e)&&(e=e.join(this.defaultSeparator)),t.scope&&(e=[t.scope,e].join(this.defaultSeparator)),e},g.extend=function(e,t){return void 0===e&&void 0===t?{}:p(e,t)},g.t=g.translate,g.l=g.localize,g.p=g.pluralize,g}),I18n.translations||(I18n.translations={}),I18n.translations.en=I18n.extend(I18n.translations.en||{},{js:{application:{click_here:"Click here",confirm_backup:"Your previous entries have been backed up automatically. \nRestore?",confirm_backup_include_file:"Your previous entries have been backed up automatically. \nRestore? \n*Please select the file attachment again.",error_message:"An error has occurred. Please change the condition and search again.",load_error:"An error has occurred while acquiring data.<br>Please reload the screen.",stop_delivery:"If you wish to cancel delivery",timeout_message:"Time out has occurred. Please change the condition and search again.",undefined_item:"The selected item has been deleted or you do not have permission.",unsubscribe_url:"If you wish to cancel delivery,\nplease access the URL below."},business_activities_leads:{without_redirect:{create:"Create Approach List"}},business_cards:{no_address_company:"No address information"},campaigns:{add_tag_confirm:"Add tag shown below. Continue?",lead_condition:"HOT lead condition",lead_delete:"Are you sure to delete the HOT lead condition? \n*HOT lead detection date will be initialized. ",lead_registered:"The HOT lead condition has already been registered. \nDo you want to overwrite the setting? \n*HOT lead detection date will be initialized. ",lead_set:"The HOT lead condition has not been set yet. \nPlease set the HOT lead condition.",target_count:"persons",target_not_set:"Specify leads"},client_ranks:{delete_confirm:"Is it okay to delete the selected items?"},clients:{admin_agency:"Independent Administrative Corporation",administration_corp:"Administration Corporation",administrative_scrivener_corporation:"Administrative Clerk",affil_comp:"General Partnership",agricultural_group_corp:"Legal Person of Agricultural Group",agricultural_prod_corp:"Agricultural Production Corporation",authorized_nonprofit_org:"Authorized Nonprofit Organization",authorized_nonprofit_org_fp:"Authorized Nonprofit Organization",cancel_merge:"Are you sure to finish the process without merging the accounts?",co_ltd:"Joint Stock Corporation",confirm_merge:"\uff08\u82f1\uff09\u4e0b\u8a18\u9805\u76ee\u306b\u3064\u3044\u3066\u306f\u4f01\u696d\u30c7\u30fc\u30bf\u8cfc\u5165\u3067\u3054\u8cfc\u5165\u3044\u305f\u3060\u3044\u305f\u4f1a\u793e(\u4f01\u696d\u30c7\u30fc\u30bf\u8cfc\u5165 : \u25cb)\u306e\u30c7\u30fc\u30bf\u3067\u66f4\u65b0\u3055\u308c\u307e\u3059\u304c\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f\r\n\u30fb\u4f1a\u793e\u540d\r\n\u30fb\u90f5\u4fbf\u756a\u53f7\r\n\u30fb\u90fd\u9053\u5e9c\u770c\r\n\u30fb\u4f4f\u6240",confirm_overwrite:"If there is data using the integration source account, it will be overwritten to the integration destination account.<br/>This action cannot be undone. Are you sure to execute the action?",contactless_officers:"Contactless Keyman",corporation:"Incorporated Association",correctional_corp:"Correction of Protection Corporation",foundation:"Incorporated Foundation",gen_corp:"General Incorporated Association",gen_found_corp:"General Incorporated Foundation",general_agric_corp:"General Agricultural Corporation",joint_comp:"Limited Liability Company",joint_stock:"Limited Partnership ",judicial_clerks:"Judicial Clerks",juridical_person:"Juridical Person",keyword_default_message:"\uff1cChoose as a search keyword\uff1e",labor_and_social_insurance_corp:"Labor and Social Insurance Corporation",lawyer_corp:"Lawyer Corporation",limited_comp:"Limited Private Company",limited_liability:"Limited Liability",limited_liability_intermediate_corp:"Limited Liability Intermediate Corporation",management_group_corp:"Management Group Corporation",med_corp:"Medical Corporation",medical_corp_association:"Medical Corporation",medical_corp_foundation:"Medical Corporation Foundation",merge_suppress_client:"Accounts that have been confirmed on the merge duplicate accounts screen are included. \nDo you want to display the account integrate screen and continue processing?",mid_term_target_management_corp:"Mid-term Target Management Corporation",mutual_comp:"Mutual Company",national_research_and_development_corp:"National Research and Development Corporation",national_university_corp:"National University Corporation",non_profit_type:"Non-profit-making",nonprofit_org:"Not-for-Profit Organization",nonprofit_org_fp:"Not-for-Profit Organization",public_found_corp:"Public Interest Incorporated Foundation",public_group:"Public Interest Incorporated Association",public_university_corp:"Public University Corporation",regional_independent_admin:"Local Incorporated Administrative Agency",relig_corp:"Religious Corporation",revitalization_corp:"Revitalization of the Company",school_corp:"School Corporation",semicommercial_corp:"Semicommercial Corporation",soc_med_corp:"Social Medical Corporation",soc_welfare_corp:"Social Welfare Service Corporation",spec_med_corp:"Specified Medical Corporation",spec_nonprofit:"Specified Non-Profit",spec_nonprofit_corp:"Specified Nonprofit Corporation",tax_accountant_corp:"Tax Accountant Corporation",unlimited_liability:"Unlimited Liability",unlimited_liability_intermediate_corp:"Unlimited Liability Intermediate Corporation"},common:{add:"Add",address_error:"Address error",alert_found_leads_select:"Please select  found lead.",alert_save_print_mode_failed:"Failed to save print mode. Please check/uncheck again.",caluc_item_max_exceeded:"The maximum number of custom items (calculated items) that can be displayed is 10.",caluc_item_required:"Calculation items cannot be set as required.",can_not_add_private_item:"It cannot be added because it includes a lead the name or account name of which is set to private.",cancel:"Cancel",close:"Close",communication_failed:"Communication failed. Please reload the page.",competitor:"Competitor",
confirm_business_cards_correct:"The target of the transmission includes those that are in the process of requesting correction of business card errors.\nThese may have incorrect information such as department name, title, name, and e-mail address.\nTherefore, please check the information of the recipient and consider the following if there is a problem.\n\u30fbManually correct the business card and lead to the correct information and send it.\n\u30fbWait for the error to be corrected.",confirm_business_cards_correct_hotprofile_mail:"The target of the transmission includes those that are in the process of requesting correction of business card errors.\nThese may have incorrect information such as department name, title, name, or e-mail address.\nTherefore, please check the recipients whose Business Card Error Status is Requesting Correction in the Send Target tab and consider the following if there is a problem.\n\u30fbManually correct the lead to the correct information and send it.\n\u30fbCheck the Excluded from sending checkbox to remove the lead from the list.\n\u30fbWait for the correction of the incorrect information to be completed.",confirm_business_cards_correct_hotprofile_mail_standard:"The target of the transmission includes those that are in the process of requesting correction of business card errors.\nThese may have incorrect information such as department name, title, name, or e-mail address.\n\n%{leads} \n\nPlease delete the above address or consider the following.\n\u30fbManually correct the lead to the correct information and send it.\n\u30fbWait for the correction of the incorrect information to be completed.\nIf you want to save/send the draft as is, click OK.",confirm_delete:"Are you sure to delete the %{name}?",confirm_save:"Are you sure to save the current contents?",date:"MMMM,YYYY","delete":"Delete",duplicate_error:"An error occurred during communication. Please reload the screen and try again.",edit:"Edit",end_user:"End user",fax_error:"Fax number error",important_customer:"Important customer",lead_source:"Lead source",lead_status:"Lead status",mail_error:"Mail error",max_exceeded:"The maximum number is exceeded.",not_dm:"Rejection of DM delivery service",not_fax:"Rejection of FAX delivery service ",not_mail:"Rejection of mail delivery service",not_tel:"Rejection of telephone call service",occurred_error:"An error has occurred. Please reload it.",please_select:"Please select.",please_select_lead:"Select imported leads.",save:"Save",screen_failed:"Failed to acquire the screen.",select_import_target:"Please select the import target.",select_item:"Please select displayed items.",serch_result_lead_none:"Found lead does not exist.",serch_result_none:"The search result does not exist.",status:"Status",store:"Dealer",tel_error:"Office phone error",timeout_error:"Timeout occurred.",unchanged_items:"The display order of multiple items cannot be changed."},content_activity_list:{notice_import_failed:"The file format must be entered correctly.",notice_import_include_old_client:"%{old_clients_count} The old company of the case has been excluded. ",notice_import_succeed:"Import process accepted."},daily_reports:{reply_to:" to reply",session_error:"The session is invalid. Please reload the screen."},deals:{add_items:"Add check items",add_rows_exceeds:"The number of lines that can be added is exceeded.",amount_summary:"\uff1cSummary of Listed Amounts\uff1e",comment_destroy:"Are you sure you want to delete \u300c%{title}\u300d?",confirm_delete_item:"Are you sure to delete the selected item?",copied:"Copied",copy_clipboard:"Copy to clipboard </br>\nPlease use EXCEL.\n",copy_rows_exceeds:"The number of lines that can be copied at one time is exceeded.",delete_rows_exceeds:"The number of lines that can be deleted at one time is exceeded.",monthly:"(By Month)",no_summary_category:"Summary of Listed Amounts: Please select an aggregation category.",no_summary_column:"Summary of Listed Amounts: Please select an Aggregate Value.",orders_date_on:"Scheduled order date",reply_to:" to reply",search_criteria:"\uff1cSearch criteria\uff1e",show_less:"Show less",show_more:"Show more",total_category_level:"Total category level"},deals_sheets:{delete_report:"Are you sure to delete the Report?",delete_task:"Are you sure to delete the Task?"},department_roles:{access_department:"Department to be accessed",confirm_discard_content:"The contents being entered will be discarded. Are you sure?",confirm_register_content:"Are you sure you want to register using the current contents?",do_same:"     under --- will be made the same",error:"Error"},departments:{cant_add_dep:"3001 or more departments cannot be added.",cant_add_hierarchy:"Departments of the 6th or higher hierarchy cannot be added.",confirm_delete:"Are you sure to delete ---?",confirm_save:"Are you sure to save the current contents?",dep_in_operation:"Another department is in operation.",no_person:"(zero)",not_deleted:"It cannot be deleted because there is a department at the lower level, there is a user linked with the department, or it is being used in the transfer tool setting.",num_people:" num people",user_link:"User linkage"},detail_masters:{sure_delete:"Are you sure want to delete all items?"},devise:{sessions:{label_company_code_input_button:"Show customer ID.",label_company_code_input_button_hide:"Hide customer ID."}},dialog_confirm:{no_button:"no",yse_button:"yes"},display_templates:{client_branches_category:"Client branch category",company_category:"Account category",master_item_can_not_blank:"Please set at least one display item",not_hidden_item:"Necessary display items cannot be hidden.",prompt_items_select:"-- title --",select_process:"Please select the opportunity process."},hot_approach_scenario:{create:{saved:"Saved."},now_searching:"Now Searching",registration_condition_memo:"For those that meet all conditions."},inside_sales:{activity_link:"Activity linkage",drop_file:"Please drag and drop the file.",file_size_below:"Talk script can be attached up to file size 30 MB or less.",item_set:"Up to 10 items can be set.",load_error:"An error has occurred while acquiring data.<br>Please reload the screen.",max_hierarchy:"The maximum hierarchy of the activity type setting is 5 levels.",no_activity_type:"There is no activity type.",sort_limited:"Up to 5 sort orders can be set."},items:{"error-length-label":"Calculation error (item contains characters)",error_calculate:"The calculation formula is invalid.",error_char_calculate:"Calculation error (item contains characters)",error_length_calculate:"Too many characters.",error_please_select:"Please select.",select_exceeds_100:"Up to 100 custom items can be updated at once."},kintone_integrate_base_setting:{api_token:"Api token",app_id:"App ID",blank_value:"--Unselected--",error_change_kintone_app:"%{app_id},%{api_token} changed in %{list_tab}. Please press the load button.",prompt_select:"Please select","tab-company":"Tab Company","tab-department":"Tab Department","tab-lead":"Tab Lead"},lead_filters:{communication_failed:"Communication failed",load_error:"An error has occurred.",select_lead:"Please select the additional candidate lead.",timeout:"Time out has occurred. "},lead_stages:{delete_confirm:"Is it okay to delete the selected items?"},leads:{cancel_lead_merge:"Are you sure to finish the process without merging the leads?",confirm_lead_merge:"When the lead with a different account name is merged, the Account Name entered in related data will also be changed.\nThis action cannot be undone. Are you sure to execute the action?",merge_suppress_lead:"Contains the leads that have been confirmed on the merge duplicate leads screen. \nDo you want to display the lead integrate screen and continue processing?"},life_cycle_funnel:{all_client_ranks:"All account rank",month:"Month",please_select:"Please select.",year:"Year"},mail:{alert_destination_not_set:"Sending targets are not set.",confirm_clear_destination:"All the sending targets are cleared. Are you sure?"},mail_histories:{clicked:"Click",count:"Item",mail_opened:"Open",mail_sent:"Distributed",mail_unopened:"Not open",mail_unsent:"Undistributed",sent_error_num:"Number of times of sending failure",unclicked:"Not clicked",unsubscribe_num:"Number of times of suspended distribution",url_clicked:"URL click"},mail_templates:{confirm_delete_attach_file:"Are you sure you want to delete the selected files?",mail_category:"Mail category",mail_make_client:"Specify sales representative for client",mail_make_lead:"Specify sales representative for lead",mail_template_type:"Template type",not_attach_file:"No file choosen."},mails:{alert_message_file_name_longest:"Enter a file name (including extension) within 255 characters.",alert_message_file_name_shortest:"Please enter at least 1 character for the file name.",confirm_delete_attach_file:"Are you sure you want to delete the selected files?",delete_meeting_report_tags:"The minutes tag is not available in this email, so I deleted it. ",delete_tags:"The insert tag in the email text was deleted because the lead is not set or multiple names are set in To.",delete_web_tracking_tags:"The Web tracking URL was deleted, because Insert tag of indivisual email disable.",destination_not_enough:"Addresses must be three or more.",destination_not_set:"Add an addressee.",err_file_not_found:"No file",immediate_delivery:"Immediate distribution",invalid_special_character:"Please enter a name that does not contain the following characters.\n&quot; * : < > ? / \\ |",mail_template:"-- Template --",no_content:"No settings",not_attach_file:"No file choosen.",not_decimal:"Please Enter an integer for the test period.",not_set_reservation_at:"Please enter the reservation time.",pattern_a:"Email Preparation: Pattern A",pattern_b:"Email Preparation: Pattern B",period_lower_limit:"The test period must be %{num} or more.",period_not_set:"Enter the test period.",period_upper_limit:"The test period must be %{num} or less.",preview_from_client:"Sales representative for client",preview_from_lead:"Sales representative for lead",reservation_flg_not_set:"Select a distribution method.",scheduled_delivery:"Reserved distribution",send:"Send"},maps:{add_route:"Add to visit route",address:"Address",all_routes:"See the whole section route.",cant_add_route:"No further route can be added to the visit route.",delete_route:"Delete from visit route",mobile_tel:"Mobile phone",no_value:"No value",route:"Visit route",save_more:"It is necessary to register two or more visit routes.",section_route:"Section route",sent:"Sent",tel:"Telephone"},operation_histories:{"function":"Function ",processing:"Processing"},risk_clients:{alert_exclusive_control:"Trade evaluation has been updated by other user. Are you sure you want to overwrite it?"},sale_approaches:{activity_link:"Activity linkage",drop_file:"Please drag and drop the file.",file_size_below:"Talk script can be attached up to file size 30 MB or less.",item_set:"Up to 10 items can be set.",load_error:"An error has occurred while acquiring data.<br>Please reload the screen.",max_hierarchy:"The maximum hierarchy of the activity type setting is 5 levels.",no_activity_type:"There is no activity type.",sort_limited:"Up to 5 sort orders can be set."},search_visible_fields:{advanced_search:"Advanced search item settings"},select_parent_tag_id:{without_owner:"(No owner)"},seminars:{access_denied:"No access Zoom.",add_tag_confirm:"Add tag shown below. Continue?",client_modal_title:"Search Accounts",copied:"Copied",copy_clipboard:"Copy to clipboard",copy_invitation_link:"Copy Invitation Link",country:"Country",country_uncheck:"Select country at least one.",delete_message:"Are you sure you want to remove webinar relation?\nIf you delete then webinar operations become not available like [Start this webinar], [Reflect results of webinar].",dial:"Dial from :",initialize_country:"Japan",lead_modal_title:"Search leads",other:" and other ",search_country:"No countries match this search.</br>Type the first few letters of the country name.</br>For example, type 'Uni to search for 'United States'.",tag_not_set:"Not select tags",target_not_set:"Specify leads"},settings:{today_and_before_date_msg:"Today or a past date has been entered."},sort_settings:{title:"Initial sort settings"},stories:{action:{action_colon:"Action:",mail:{add_mail:"Add email",after_before_process:"After accept previous action",after_day_in:"days after,",confirmed:"Confirmed the email",detail:"Details",mail:"Mail",no_title:"(No subject)",please_select_mail:"Select the email",please_select_target:"Set target leads",send_delay_at:"will be began delivery",send_mail:"Email delivery",target_colon:"Targets : ",unconfirmed:"Unconfirm email"},mail_action:"Deliver email",not_set:"Not set Action",score:{please_input_score:"Enter score",point:"Points",score:"Score"},score_action:"Scoring",score_mail_action:"Scoring and Send email",seminar:{auto_add_campaign:"Add the seminar applicants to the campaign automatically.",auto_add_campaign_flg_colon:"Add applicant to the Seminar automatically to the Campaign : ",end_seminar:"\u203bThe action ends when the Seminar ends.",open_date:"Hold the Seminar",please_select_seminar:"Select a Seminar",seminar_open:"Hold the Seminar"},seminar_action:"Seminar",target:"Target",trigger_mail:{count:"persons",not_set:"Not set",reserve_send_at:"Start delivery",target_setting:"Set target leads"},trigger_mail_action:"Email",webform:{auto_add_campaign:"Automatically append leads of inquiy of Web form",auto_add_campaign_flg_colon:"Automatically add responsed lead to the campaign : ",please_select_webform:"Specify Web form"},webform_action:"Web form"},draft_mail_info:"<div class='text-left'>Copy the draft email selected.<br>You can delete the draft email selected if you do not need.</div>",draft_register_successful:"Saved as draft",mail_target_info:"<div class='text-left'>The recipient set in the email is not used.<br>Set the conditions for the lead to be sent.</div>",mail_target_not_use:"The recipient set in the email is not used.\\nThe recipient is determined by the scenario settings.",please_select:"Please select",reaction:{add_reaction:"Append reaction",confirm_delete:"It will be deleted all reaction after this. Continue?"},reaction_disp:{absence:"Status of applicant : Absent",attend:"Status of applicant : Attend",no_reaction:"Status of applicant : No response",open_mail:"Open",un_open_mail:"Not open",url_click:"URL click",with_access:"Access",with_reply:"Response",without_access:"Non-access"},register_successful:"Saved",remind:{timeout:"29 minutes have passed. Plase save now."},scenario:{add_scenario:"Add Senario",confirm_delete:"Delete selected scenarios",description:"Description of senario",disable:"Disable",enable:"Enable",name:"Senario name",none:"Please create Senario.",period:"Period",start:"Start",status:"Status"},set_ab_test_mail_notice_message:"AB test mail has been set.\\nMake sure that the subject and body of the AB test email are set correctly.\\nHowever, keep in mind that the reservation date and time reflects the content set in the story.",story_template_confirmation:"If change the Story template, this story will overwrite by the Story template selected.\r\nContinue?",update_successful:"Updated story"},target_lists:{destination_not_set:"No addressee has been set.",failed:"Failed to acquire the screen.",not_hidden_item:"Necessary items cannot be hidden.",select_process:"Are you sure to clear all currently selected leads?",target_not_set:"Target is not set."},temporary_business_card:{invalid_term:"The start date must be set before the last date."},transfer_tools:{communication_failed:"Communication failed. Please reload the page."},users:{default_request_lead_source_create:"Please select a lead source.",disabled_user:"Invalid users",select_dashboard:"Please select the dashboard."},visible_fields:{set_search:"Search result display setting"},webinar_polls:{no_complete:"Incomplete",please_input_question:"Input question"}}}),I18n.translations.ja=I18n.extend(I18n.translations.ja||{},{js:{application:{click_here:"\u3053\u3061\u3089\u3092\u30af\u30ea\u30c3\u30af",confirm_backup:"\u4ee5\u524d\u306e\u5165\u529b\u5185\u5bb9\u304c\u81ea\u52d5\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\u5fa9\u5143\u3057\u307e\u3059\u304b\uff1f",confirm_backup_include_file:"\u4ee5\u524d\u306e\u5165\u529b\u5185\u5bb9\u304c\u81ea\u52d5\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3055\u308c\u3066\u3044\u307e\u3059\u3002\n\u5fa9\u5143\u3057\u307e\u3059\u304b\uff1f\n\u203b\u30d5\u30a1\u30a4\u30eb\u6dfb\u4ed8\u306f\u518d\u5ea6\u9078\u629e\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002",error_message:"\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u6761\u4ef6\u3092\u5909\u66f4\u3057\u518d\u5ea6\u691c\u7d22\u3057\u3066\u304f\u3060\u3055\u3044",load_error:"\u30c7\u30fc\u30bf\u53d6\u5f97\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002<br>\u753b\u9762\u518d\u8aad\u307f\u8fbc\u307f\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002",stop_delivery:"\u914d\u4fe1\u505c\u6b62\u3092\u3054\u5e0c\u671b\u306e\u5834\u5408",timeout_message:"\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u307e\u3057\u305f\u3002\u6761\u4ef6\u3092\u5909\u66f4\u3057\u518d\u5ea6\u691c\u7d22\u3057\u3066\u304f\u3060\u3055\u3044",undefined_item:"\u9078\u629e\u3057\u305f\u9805\u76ee\u306f\u524a\u9664\u3055\u308c\u305f\u304b\u6a29\u9650\u304c\u3042\u308a\u307e\u305b\u3093\u3002",unsubscribe_url:"\u914d\u4fe1\u505c\u6b62\u3092\u3054\u5e0c\u671b\u306e\u5834\u5408\u3001\n\u4ee5\u4e0b\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002"},business_activities_leads:{without_redirect:{create:"\u55b6\u696d\u30a2\u30d7\u30ed\u30fc\u30c1\u30ea\u30b9\u30c8\u3092\u767b\u9332\u3057\u307e\u3057\u305f\u3002"}},business_cards:{no_address_company:"\u4f4f\u6240\u60c5\u5831\u306a\u3057"},campaigns:{add_tag_confirm:"\u4ee5\u4e0b\u306e\u30bf\u30b0\u3092\u767b\u9332\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",lead_condition:"HOT\u30ea\u30fc\u30c9\u6761\u4ef6",lead_delete:"HOT\u30ea\u30fc\u30c9\u6761\u4ef6\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\u3002\n\uff0a\u300cHOT\u30ea\u30fc\u30c9\u691c\u51fa\u65e5\u300d\u306f\u521d\u671f\u5316\u3055\u308c\u307e\u3059\u3002",lead_registered:"HOT\u30ea\u30fc\u30c9\u6761\u4ef6\u304c\u767b\u9332\u6e08\u307f\u3067\u3059\u3002\n\u8a2d\u5b9a\u3092\u4e0a\u66f8\u304d\u3057\u307e\u3059\u304b\u3002\n\uff0a\u300cHOT\u30ea\u30fc\u30c9\u691c\u51fa\u65e5\u300d\u306f\u521d\u671f\u5316\u3055\u308c\u307e\u3059\u3002",lead_set:"HOT\u30ea\u30fc\u30c9\u6761\u4ef6\u304c\u672a\u8a2d\u5b9a\u3067\u3059\u3002\n\u300cHOT\u30ea\u30fc\u30c9\u6761\u4ef6\u300d\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002",target_count:"\u4eba",target_not_set:"\u30ea\u30fc\u30c9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"},client_ranks:{delete_confirm:"\u9078\u629e\u3057\u305f\u9805\u76ee\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f"},clients:{admin_agency:"\u72ec\u7acb\u884c\u653f\u6cd5\u4eba",administration_corp:"\u884c\u653f\u57f7\u884c\u6cd5\u4eba",administrative_scrivener_corporation:"\u884c\u653f\u66f8\u58eb\u6cd5\u4eba",affil_comp:"\u5408\u540d\u4f1a\u793e",agricultural_group_corp:"\u8fb2\u4e8b\u7d44\u5408\u6cd5\u4eba",agricultural_prod_corp:"\u8fb2\u696d\u751f\u7523\u6cd5\u4eba",authorized_nonprofit_org:"\u8a8d\u5b9aNPO\u6cd5\u4eba",authorized_nonprofit_org_fp:"\u8a8d\u5b9a\uff2e\uff30\uff2f\u6cd5\u4eba",cancel_merge:"\u4f1a\u793e\u3092\u30de\u30fc\u30b8\u305b\u305a\u306b\u51e6\u7406\u3092\u7d42\u4e86\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",co_ltd:"\u682a\u5f0f\u4f1a\u793e",confirm_merge:"\u4e0b\u8a18\u9805\u76ee\u306b\u3064\u3044\u3066\u306f\u4f01\u696d\u30c7\u30fc\u30bf\u8cfc\u5165\u3067\u3054\u8cfc\u5165\u3044\u305f\u3060\u3044\u305f\u4f1a\u793e(\u4f01\u696d\u30c7\u30fc\u30bf\u8cfc\u5165 : \u25cb)\u306e\u30c7\u30fc\u30bf\u3067\u66f4\u65b0\u3055\u308c\u307e\u3059\u304c\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f\r\n\u30fb\u4f1a\u793e\u540d\r\n\u30fb\u90f5\u4fbf\u756a\u53f7\r\n\u30fb\u90fd\u9053\u5e9c\u770c\r\n\u30fb\u4f4f\u6240",confirm_overwrite:"\u7d71\u5408\u5143\u306e\u4f1a\u793e\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u7d71\u5408\u5148\u306e\u4f1a\u793e\u306b\u4e0a\u66f8\u304d\u3055\u308c\u307e\u3059\u3002<br/>\u3053\u306e\u64cd\u4f5c\u306f\u5143\u306b\u623b\u305b\u307e\u305b\u3093\u3001\u672c\u5f53\u306b\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",contactless_officers:"\u672a\u63a5\u89e6\u306e\u30ad\u30fc\u30de\u30f3",corporation:"\u793e\u56e3\u6cd5\u4eba",correctional_corp:"\u66f4\u6b63\u4fdd\u8b77\u6cd5\u4eba",foundation:"\u8ca1\u56e3\u6cd5\u4eba",gen_corp:"\u4e00\u822c\u793e\u56e3\u6cd5\u4eba",gen_found_corp:"\u4e00\u822c\u8ca1\u56e3\u6cd5\u4eba",general_agric_corp:"\u4e00\u822c\u8fb2\u696d\u6cd5\u4eba",joint_comp:"\u5408\u540c\u4f1a\u793e",joint_stock:"\u5408\u8cc7\u4f1a\u793e",judicial_clerks:"\u53f8\u6cd5\u66f8\u58eb\u6cd5\u4eba",juridical_person:"\u6d3b\u52d5\u6cd5\u4eba",keyword_default_message:"\uff1c\u691c\u7d22\u30ad\u30fc\u30ef\u30fc\u30c9\u3068\u3057\u3066\u9078\u629e\uff1e",labor_and_social_insurance_corp:"\u793e\u4f1a\u4fdd\u967a\u52b4\u52d9\u58eb\u6cd5\u4eba",lawyer_corp:"\u5f01\u8b77\u58eb\u6cd5\u4eba",limited_comp:"\u6709\u9650\u4f1a\u793e",limited_liability:"\u6709\u9650\u8cac\u4efb",limited_liability_intermediate_corp:"\u6709\u9650\u8cac\u4efb\u4e2d\u9593\u6cd5\u4eba",management_group_corp:"\u7ba1\u7406\u7d44\u5408\u6cd5\u4eba",med_corp:"\u533b\u7642\u6cd5\u4eba",medical_corp_association:"\u533b\u7642\u6cd5\u4eba\u793e\u56e3",medical_corp_foundation:"\u533b\u7642\u6cd5\u4eba\u8ca1\u56e3",merge_suppress_client:"\u4f1a\u793e\u91cd\u8907\u30de\u30fc\u30b8\u753b\u9762\u3067\u78ba\u8a8d\u6e08\u307f\u3068\u3057\u305f\u4f1a\u793e\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\n\u4f1a\u793e\u7d71\u5408\u753b\u9762\u3092\u8868\u793a\u3057\u3066\u51e6\u7406\u3092\u7d9a\u884c\u3057\u307e\u3059\u304b\uff1f",mid_term_target_management_corp:"\u4e2d\u671f\u76ee\u6a19\u7ba1\u7406\u6cd5\u4eba",mutual_comp:"\u76f8\u4e92\u4f1a\u793e",national_research_and_development_corp:"\u56fd\u7acb\u7814\u7a76\u958b\u767a\u6cd5\u4eba",national_university_corp:"\u56fd\u7acb\u5927\u5b66\u6cd5\u4eba",non_profit_type:"\u975e\u55b6\u5229\u578b",nonprofit_org:"NPO\u6cd5\u4eba",nonprofit_org_fp:"\uff2e\uff30\uff2f\u6cd5\u4eba",public_found_corp:"\u516c\u76ca\u8ca1\u56e3\u6cd5\u4eba",public_group:"\u516c\u76ca\u793e\u56e3\u6cd5\u4eba",public_university_corp:"\u516c\u7acb\u5927\u5b66\u6cd5\u4eba",regional_independent_admin:"\u5730\u65b9\u72ec\u7acb\u884c\u653f\u6cd5\u4eba",relig_corp:"\u5b97\u6559\u6cd5\u4eba",revitalization_corp:"\u66f4\u751f\u4fdd\u8b77\u6cd5\u4eba",school_corp:"\u5b66\u6821\u6cd5\u4eba",semicommercial_corp:"\u4e2d\u9593\u6cd5\u4eba",soc_med_corp:"\u793e\u4f1a\u533b\u7642\u6cd5\u4eba",soc_welfare_corp:"\u793e\u4f1a\u798f\u7949\u6cd5\u4eba",spec_med_corp:"\u7279\u5b9a\u533b\u7642\u6cd5\u4eba",spec_nonprofit:"\u7279\u5b9a\u975e\u55b6\u5229",spec_nonprofit_corp:"\u7279\u5b9a\u975e\u55b6\u5229\u6d3b\u52d5\u6cd5\u4eba",tax_accountant_corp:"\u7a0e\u7406\u58eb\u6cd5\u4eba",unlimited_liability:"\u7121\u9650\u8cac\u4efb",unlimited_liability_intermediate_corp:"\u7121\u9650\u8cac\u4efb\u4e2d\u9593\u6cd5\u4eba"},common:{add:"\u8ffd\u52a0",address_error:"\u4f4f\u6240\u30a8\u30e9\u30fc",alert_found_leads_select:"\u5224\u660e\u30ea\u30fc\u30c9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",alert_save_print_mode_failed:"\u5370\u5237\u30e2\u30fc\u30c9\u306e\u4fdd\u5b58\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u518d\u5ea6\u30c1\u30a7\u30c3\u30af\u306e\u4ed8\u3051\uff0f\u5916\u3057\u3092\u2f8f\u3063\u3066\u304f\u3060\u3055\u3044\u3002",caluc_item_max_exceeded:"\u8868\u793a\u3067\u304d\u308b\u300c\u30ab\u30b9\u30bf\u30e0\u9805\u76ee\uff08\u8a08\u7b97\u9805\u76ee\uff09\u300d\u306e\u6700\u5927\u6570\u306f10\u4ef6\u3067\u3059\u3002",caluc_item_required:"\u8a08\u7b97\u9805\u76ee\u306f\u5fc5\u9808\u306b\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002",can_not_add_private_item:"\u6c0f\u540d\u307e\u305f\u306f\u4f1a\u793e\u540d\u304c\u975e\u516c\u958b\u3067\u3042\u308b\u30ea\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u70ba\u3001\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3002",cancel:"\u30ad\u30e3\u30f3\u30bb\u30eb",close:"\u9589\u3058\u308b",communication_failed:"\u901a\u4fe1\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30da\u30fc\u30b8\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3057\u3066\u4e0b\u3055\u3044\u3002",competitor:"\u7af6\u5408\u4f01\u696d",confirm_business_cards_correct:"\u9001\u4fe1\u5bfe\u8c61\u306b\u3001\u540d\u523a\u306e\u8aa4\u5165\u529b\u306e\u4fee\u6b63\u4f9d\u983c\u4e2d\u306e\u3082\u306e\u304c\u542b\u307e\u308c\u307e\u3059\u3002\n\u3053\u308c\u3089\u306f\u90e8\u7f72\u540d\u3001\u5f79\u8077\u3001\u6c0f\u540d\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306a\u3069\u306e\u60c5\u5831\u306b\u8aa4\u308a\u304c\u3042\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\n\n\u305d\u306e\u305f\u3081\u5b9b\u5148\u306e\u60c5\u5831\u3092\u3054\u78ba\u8a8d\u3044\u305f\u3060\u304d\u3001\u554f\u984c\u304c\u3042\u308b\u5834\u5408\u306b\u4e0b\u8a18\u3092\u3054\u691c\u8a0e\u304f\u3060\u3055\u3044\u3002\n\u30fb\u624b\u52d5\u3067\u540d\u523a\u3001\u30ea\u30fc\u30c9\u3092\u6b63\u3057\u3044\u60c5\u5831\u306b\u4fee\u6b63\u3057\u3066\u9001\u4fe1\n\u30fb\u8aa4\u5165\u529b\u306e\u4fee\u6b63\u304c\u5b8c\u4e86\u3059\u308b\u306e\u3092\u304a\u5f85\u3061\u3044\u305f\u3060\u304f",confirm_business_cards_correct_hotprofile_mail:"\u9001\u4fe1\u5bfe\u8c61\u306b\u3001\u540d\u523a\u306e\u8aa4\u5165\u529b\u306e\u4fee\u6b63\u4f9d\u983c\u4e2d\u306e\u3082\u306e\u304c\u542b\u307e\u308c\u307e\u3059\u3002\n\u3053\u308c\u3089\u306f\u90e8\u7f72\u540d\u3001\u5f79\u8077\u3001\u6c0f\u540d\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306a\u3069\u306e\u60c5\u5831\u306b\u8aa4\u308a\u304c\u3042\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\n\n\u305d\u306e\u305f\u3081\u30bf\u30d6\u300c\u9001\u4fe1\u5bfe\u8c61\u300d\u306b\u3066\u300c\u540d\u523a\u8aa4\u5165\u529b\u30b9\u30c6\u30fc\u30bf\u30b9\u300d\u304c\u300c\u4fee\u6b63\u4f9d\u983c\u4e2d\u300d\u306e\u5b9b\u5148\u3092\u3054\u78ba\u8a8d\u3044\u305f\u3060\u304d\u3001\u554f\u984c\u304c\u3042\u308b\u5834\u5408\u306b\u4e0b\u8a18\u3092\u3054\u691c\u8a0e\u304f\u3060\u3055\u3044\u3002\n\u30fb\u624b\u52d5\u3067\u30ea\u30fc\u30c9\u3092\u6b63\u3057\u3044\u60c5\u5831\u306b\u4fee\u6b63\u3057\u3066\u9001\u4fe1\n\u30fb\u9001\u4fe1\u5bfe\u8c61\u5916\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3001\u30e1\u30fc\u30eb\u306e\u9001\u4fe1\u5bfe\u8c61\u304b\u3089\u5916\u3059\n\u30fb\u8aa4\u5165\u529b\u306e\u4fee\u6b63\u304c\u5b8c\u4e86\u3059\u308b\u306e\u3092\u304a\u5f85\u3061\u3044\u305f\u3060\u304f",confirm_business_cards_correct_hotprofile_mail_standard:"\u9001\u4fe1\u5bfe\u8c61\u306b\u3001\u540d\u523a\u306e\u8aa4\u5165\u529b\u306e\u4fee\u6b63\u4f9d\u983c\u4e2d\u306e\u3082\u306e\u304c\u542b\u307e\u308c\u307e\u3059\u3002\n\u3053\u308c\u3089\u306f\u90e8\u7f72\u540d\u3001\u5f79\u8077\u3001\u6c0f\u540d\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306a\u3069\u306e\u60c5\u5831\u306b\u8aa4\u308a\u304c\u3042\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\n\n%{leads} \n\n\u4e0a\u8a18\u306e\u5b9b\u5148\u3092\u524a\u9664\u3059\u308b\u304b\u3001\u4ee5\u4e0b\u3092\u3054\u691c\u8a0e\u304f\u3060\u3055\u3044\u3002\n\u30fb\u624b\u52d5\u3067\u30ea\u30fc\u30c9\u3092\u6b63\u3057\u3044\u60c5\u5831\u306b\u4fee\u6b63\u3057\u3066\u9001\u4fe1\n\u30fb\u8aa4\u5165\u529b\u306e\u4fee\u6b63\u304c\u5b8c\u4e86\u3059\u308b\u306e\u3092\u304a\u5f85\u3061\u3044\u305f\u3060\u304f\n\u3053\u306e\u307e\u307e\u4e0b\u66f8\u304d\u4fdd\u5b58/\u9001\u4fe1\u3059\u308b\u5834\u5408\u306fOK\u3092\u62bc\u4e0b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",confirm_delete:"%{name}\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",confirm_save:"\u73fe\u5728\u306e\u5185\u5bb9\u3067\u767b\u9332\u3057\u3066\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",date:"YYYY\u5e74MMMM","delete":"\u524a\u9664",duplicate_error:"\u901a\u4fe1\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u753b\u9762\u3092\u30ea\u30ed\u30fc\u30c9\u3057\u3066\u518d\u5ea6\u64cd\u4f5c\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002",edit:"\u7de8\u96c6",end_user:"\u30a8\u30f3\u30c9\u30e6\u30fc\u30b6\u30fc",fax_error:"FAX\u756a\u53f7\u30a8\u30e9\u30fc",important_customer:"\u91cd\u8981\u9867\u5ba2",lead_source:"\u30ea\u30fc\u30c9\u30bd\u30fc\u30b9",lead_status:"\u30ea\u30fc\u30c9\u30b9\u30c6\u30fc\u30bf\u30b9",mail_error:"\u30e1\u30fc\u30eb\u30a8\u30e9\u30fc",max_exceeded:"\u6700\u5927\u6570\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002",not_dm:"DM\u914d\u4fe1\u62d2\u5426",not_fax:"FAX\u914d\u4fe1\u62d2\u5426",not_mail:"\u30e1\u30fc\u30eb\u62d2\u5426",not_tel:"\u67b6\u96fb\u62d2\u5426",occurred_error:"\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u518d\u8aad\u307f\u8fbc\u307f\u3057\u3066\u304f\u3060\u3055\u3044",please_select:"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",please_select_lead:"\u30ea\u30fc\u30c9\u53d6\u308a\u8fbc\u307f\u6e08\u307f\u306e\u5bfe\u8c61\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002",save:"\u767b\u9332",screen_failed:"\u753b\u9762\u306e\u53d6\u5f97\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002",select_import_target:"\u30a4\u30f3\u30dd\u30fc\u30c8\u5bfe\u8c61\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002",select_item:"\u8868\u793a\u9805\u76ee\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",serch_result_lead_none:"\u5224\u660e\u30ea\u30fc\u30c9\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002",serch_result_none:"\u691c\u7d22\u7d50\u679c\u304c\u5b58\u5728\u3057\u307e\u305b\u3093\u3002",status:"\u30b9\u30c6\u30fc\u30bf\u30b9",store:"\u8ca9\u58f2\u5e97",tel_error:"\u96fb\u8a71\u756a\u53f7\u30a8\u30e9\u30fc",timeout_error:"\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u307e\u3057\u305f\u3002",unchanged_items:"\u8907\u6570\u9805\u76ee\u306e\u8868\u793a\u9806\u306e\u5909\u66f4\u306f\u3067\u304d\u307e\u305b\u3093\u3002"},content_activity_list:{notice_import_failed:"\u30d5\u30a1\u30a4\u30eb\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",notice_import_include_old_client:"%{old_clients_count}\u4ef6\u306e\u53e4\u3044\u4f1a\u793e\u304c\u9664\u5916\u3055\u308c\u307e\u3057\u305f\u3002",notice_import_succeed:"\u30a4\u30f3\u30dd\u30fc\u30c8\u51e6\u7406\u3092\u53d7\u3051\u4ed8\u3051\u307e\u3057\u305f"},daily_reports:{reply_to:"\u3078\u306e\u8fd4\u4fe1",session_error:"\u30bb\u30c3\u30b7\u30e7\u30f3\u304c\u7121\u52b9\u3067\u3059\u3002\u753b\u9762\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3057\u3066\u304f\u3060\u3055\u3044"},deals:{add_items:"\u30c1\u30a7\u30c3\u30af\u9805\u76ee\u3092\u8ffd\u52a0\u3059\u308b",add_rows_exceeds:"\u8ffd\u52a0\u3067\u304d\u308b\u884c\u6570\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002",amount_summary:"\uff1c\u4e00\u89a7\u91d1\u984d\u30b5\u30de\u30ea\u30fc\uff1e",comment_destroy:"\u300c%{title}\u300d\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",confirm_delete_item:"\u9078\u629e\u3057\u305f\u9805\u76ee\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?",copied:"\u30b3\u30d4\u30fc\u3057\u307e\u3057\u305f",copy_clipboard:"\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc </br>\nEXCEL\u7b49\u3067\u3054\u5229\u7528\u4e0b\u3055\u3044\u3002\n",copy_rows_exceeds:"\u4e00\u5ea6\u306b\u30b3\u30d4\u30fc\u3067\u304d\u308b\u884c\u6570\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002",delete_rows_exceeds:"\u4e00\u5ea6\u306b\u524a\u9664\u3067\u304d\u308b\u884c\u6570\u3092\u8d85\u3048\u3066\u3044\u307e\u3059\u3002",monthly:"(\u6708\u5225)",no_summary_category:"\u4e00\u89a7\u91d1\u984d\u30b5\u30de\u30ea\u30fc\uff1a\u96c6\u8a08\u30ab\u30c6\u30b4\u30ea\u30fc\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",no_summary_column:"\u4e00\u89a7\u91d1\u984d\u30b5\u30de\u30ea\u30fc\uff1a\u96c6\u8a08\u5024\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",orders_date_on:"\u53d7\u6ce8\u4e88\u5b9a\u65e5",reply_to:"\u3078\u306e\u8fd4\u4fe1",search_criteria:"\uff1c\u691c\u7d22\u6761\u4ef6\uff1e",show_less:"\u8868\u793a\u3092\u6e1b\u3089\u3059",show_more:"\u3055\u3089\u306b\u8868\u793a",total_category_level:"\u96c6\u8a08\u30ab\u30c6\u30b4\u30ea\u30fc\u30ec\u30d9\u30eb"},deals_sheets:{
delete_report:"\u5831\u544a\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",delete_task:"\u30bf\u30b9\u30af\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f"},department_roles:{access_department:"\u30a2\u30af\u30bb\u30b9\u3055\u308c\u308b\u90e8\u7f72",confirm_discard_content:"\u5165\u529b\u4e2d\u306e\u5185\u5bb9\u304c\u7834\u68c4\u3055\u308c\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",confirm_register_content:"\u73fe\u5728\u306e\u5185\u5bb9\u3067\u767b\u9332\u3057\u3066\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",do_same:"\u306e\u914d\u4e0b\u3092\u540c\u3058\u306b\u3057\u307e\u3059\u3002",error:"\u30a8\u30e9\u30fc"},departments:{cant_add_dep:"3001\u4ef6\u4ee5\u4e0a\u90e8\u7f72\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",cant_add_hierarchy:"\u7b2c6\u968e\u5c64\u4ee5\u4e0a\u306e\u90e8\u7f72\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002",confirm_delete:"\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",confirm_save:"\u73fe\u5728\u306e\u5185\u5bb9\u3067\u767b\u9332\u3057\u3066\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",dep_in_operation:"\u5225\u306e\u90e8\u7f72\u3092\u64cd\u4f5c\u4e2d\u3067\u3059\u3002",no_person:"\uff080\u540d\uff09",not_deleted:"\u4e0b\u4f4d\u306b\u90e8\u7f72\u304c\u5b58\u5728\u3059\u308b\u3001\u307e\u305f\u306f\u90e8\u7f72\u306b\u7d10\u3065\u3044\u305f\u30e6\u30fc\u30b6\u30fc\u304c\u5b58\u5728\u3059\u308b\u3001\u307e\u305f\u306f\u8ee2\u9001\u30c4\u30fc\u30eb\u8a2d\u5b9a\u3067\u5229\u7528\u3057\u3066\u3044\u308b\u305f\u3081\u524a\u9664\u3067\u304d\u307e\u305b\u3093\u3002",num_people:"\u540d",user_link:"\u30e6\u30fc\u30b6\u30fc\u7d10\u3065\u3051"},detail_masters:{sure_delete:"\u5168\u4ef6\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f"},devise:{sessions:{label_company_code_input_button:"\u9867\u5ba2ID\u3092\u8868\u793a\u3059\u308b",label_company_code_input_button_hide:"\u9867\u5ba2ID\u3092\u975e\u8868\u793a\u306b\u3059\u308b"}},dialog_confirm:{no_button:"\u3044\u3044\u3048",yse_button:"\u306f\u3044"},display_templates:{client_branches_category:"\u62e0\u70b9\u30ab\u30c6\u30b4\u30ea",company_category:"\u4f1a\u793e\u30ab\u30c6\u30b4\u30ea",master_item_can_not_blank:"\u8868\u793a\u9805\u76ee\u306b\u6700\u4f4e\u4e00\u3064\u306f\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002",not_hidden_item:"\u5fc5\u9808\u8868\u793a\u9805\u76ee\u306f\u975e\u8868\u793a\u306b\u3067\u304d\u307e\u305b\u3093\u3002",prompt_items_select:"-- \u9805\u76ee\u540d --",select_process:"\u5546\u8ac7\u30d7\u30ed\u30bb\u30b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"},hot_approach_scenario:{create:{saved:"\u767b\u9332\u3057\u307e\u3057\u305f\u3002"},now_searching:"\u691c\u7d22\u4e2d",registration_condition_memo:"\u3059\u3079\u3066\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3057\u3066\u3044\u308b\u3082\u306e\u304c\u5bfe\u8c61\u3067\u3059\u3002"},inside_sales:{activity_link:"\u6d3b\u52d5\u7d10\u3065\u3051",drop_file:"\u30d5\u30a1\u30a4\u30eb\u3092\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044",file_size_below:"\u30c8\u30fc\u30af\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u306f30MB\u4ee5\u4e0b\u3067\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002",item_set:"\u8a2d\u5b9a\u53ef\u80fd\u306a\u9805\u76ee\u306f10\u307e\u3067\u3067\u3059\u3002",load_error:"\u30c7\u30fc\u30bf\u53d6\u5f97\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002<br>\u753b\u9762\u518d\u8aad\u307f\u8fbc\u307f\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002",max_hierarchy:"\u6d3b\u52d5\u7a2e\u5225\u8a2d\u5b9a\u306e\u6700\u5927\u968e\u5c64\u306f\uff15\u968e\u5c64\u3067\u3059",no_activity_type:"\u6d3b\u52d5\u7a2e\u5225\u304c\u3042\u308a\u307e\u305b\u3093\u3002",sort_limited:"\u30bd\u30fc\u30c8\u9806\u306e\u8a2d\u5b9a\u306f5\u3064\u307e\u3067\u3067\u3059\u3002"},items:{"error-length-label":"\u8ffd\u52a0\u53ef\u80fd\u306a\u9805\u76ee\u306f10\u500b\u307e\u3067\u3067\u3059",error_calculate:"\u8a08\u7b97\u30a8\u30e9\u30fc\uff08\u8a08\u7b97\u5f0f\u304c\u4e0d\u6b63\u3067\u3059\uff09",error_char_calculate:"\u8a08\u7b97\u30a8\u30e9\u30fc(\u9805\u76ee\u306b\u6587\u5b57\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059)",error_length_calculate:"\u6587\u5b57\u6570\u304c\u591a\u3059\u304e\u307e\u3059\u3002",error_please_select:"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",select_exceeds_100:"\u4e00\u5ea6\u306b\u66f4\u65b0\u51fa\u6765\u308b\u30ab\u30b9\u30bf\u30e0\u9805\u76ee\u306f100\u4ef6\u307e\u3067\u3067\u3059\u3002"},kintone_integrate_base_setting:{api_token:"API\u30c8\u30fc\u30af\u30f3",app_id:"\u30a2\u30d7\u30eaID",blank_value:"--\u672a\u9078\u629e--",error_change_kintone_app:"%{list_tab}\u306b%{app_id},%{api_token}\u304c\u5909\u66f4\u3057\u307e\u3057\u305f\u3002\u8aad\u307f\u8fbc\u307f\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002",prompt_select:"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044","tab-company":"\u30bf\u30d6\u4f1a\u793e","tab-department":"\u30bf\u30d6\u90e8\u7f72","tab-lead":"\u30bf\u30d6\u30ea\u30fc\u30c9"},lead_filters:{communication_failed:"\u901a\u4fe1\u306b\u5931\u6557",load_error:"\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002",select_lead:"\u8ffd\u52a0\u5019\u88dc\u30ea\u30fc\u30c9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",timeout:"\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3057\u307e\u3057\u305f\u3002"},lead_stages:{delete_confirm:"\u9078\u629e\u3057\u305f\u9805\u76ee\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f"},leads:{cancel_lead_merge:"\u30ea\u30fc\u30c9\u3092\u30de\u30fc\u30b8\u305b\u305a\u306b\u51e6\u7406\u3092\u7d42\u4e86\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",confirm_lead_merge:"\u4f1a\u793e\u540d\u304c\u7570\u306a\u308b\u30ea\u30fc\u30c9\u3092\u30de\u30fc\u30b8\u3059\u308b\u3068\u30ea\u30fc\u30c9\u306b\u7d10\u3065\u304f\u30c7\u30fc\u30bf\u306e\u300c\u4f1a\u793e\u540d\u300d\u3082\u5909\u66f4\u3057\u307e\u3059\u3002\n\u3053\u306e\u64cd\u4f5c\u306f\u5143\u306b\u623b\u305b\u307e\u305b\u3093\u3001\u672c\u5f53\u306b\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",merge_suppress_lead:"\u30ea\u30fc\u30c9\u91cd\u8907\u30de\u30fc\u30b8\u753b\u9762\u3067\u78ba\u8a8d\u6e08\u307f\u3068\u3057\u305f\u30ea\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\n\u30ea\u30fc\u30c9\u7d71\u5408\u753b\u9762\u3092\u8868\u793a\u3057\u3066\u51e6\u7406\u3092\u7d9a\u884c\u3057\u307e\u3059\u304b\uff1f"},life_cycle_funnel:{all_client_ranks:"\u5168\u3066\u306e\u9867\u5ba2\u30e9\u30f3\u30af",month:"\u6708",please_select:"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044",year:"\u5e74"},mail:{alert_destination_not_set:"\u9001\u4fe1\u5bfe\u8c61\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",confirm_clear_destination:"\u9001\u4fe1\u5bfe\u8c61\u3092\u5168\u3066\u30af\u30ea\u30a2\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f"},mail_histories:{clicked:"\u30af\u30ea\u30c3\u30af",count:"\u4ef6",mail_opened:"\u958b\u5c01",mail_sent:"\u914d\u4fe1\u6e08\u307f",mail_unopened:"\u672a\u958b\u5c01",mail_unsent:"\u672a\u914d\u4fe1",sent_error_num:"\u9001\u4fe1\u5931\u6557\u6570",unclicked:"\u672a\u30af\u30ea\u30c3\u30af",unsubscribe_num:"\u914d\u4fe1\u505c\u6b62\u6570",url_clicked:"URL\u30af\u30ea\u30c3\u30af"},mail_templates:{confirm_delete_attach_file:"\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?",mail_category:"\u30e1\u30fc\u30eb\u30ab\u30c6\u30b4\u30ea",mail_make_client:"\u4f1a\u793e\u306e\u55b6\u696d\u62c5\u5f53\u8005\u306b\u3059\u308b",mail_make_lead:"\u30ea\u30fc\u30c9\u306e\u55b6\u696d\u62c5\u5f53\u8005\u306b\u3059\u308b",mail_template_type:"\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u7a2e\u5225",not_attach_file:"\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"},mails:{alert_message_file_name_longest:"\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u62e1\u5f35\u5b50\u542b\u3080\uff09\u306f255\u6587\u5b57\u4ee5\u5185\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",alert_message_file_name_shortest:"\u30d5\u30a1\u30a4\u30eb\u540d\u306f1\u6587\u5b57\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",confirm_delete_attach_file:"\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?",delete_meeting_report_tags:"\u672c\u30e1\u30fc\u30eb\u3067\u306f\u3001\u8b70\u4e8b\u9332\u30bf\u30b0\u3092\u4f7f\u7528\u3067\u304d\u306a\u3044\u305f\u3081\u524a\u9664\u3057\u307e\u3057\u305f\u3002",delete_tags:"To\u306b\u30ea\u30fc\u30c9\u304c\u672a\u8a2d\u5b9a\u3001\u307e\u305f\u306f\u8907\u6570\u540d\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30e1\u30fc\u30eb\u672c\u6587\u306e\u5dee\u3057\u8fbc\u307f\u30bf\u30b0\u3092\u524a\u9664\u3057\u307e\u3057\u305f\u3002",delete_web_tracking_tags:"\u500b\u5225\u30e1\u30fc\u30eb\u3067\u306f\u5dee\u3057\u8fbc\u307f\u6587\u66f8\u304c\u7121\u52b9\u306e\u5834\u5408\u3001Web\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0URL\u306f\u4f7f\u7528\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002",destination_not_enough:"\u5b9b\u5148\u306f3\u4ef6\u4ee5\u4e0a\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",destination_not_set:"\u5b9b\u5148\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002",err_file_not_found:"\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u307e\u305b\u3093",immediate_delivery:"\u5373\u6642\u914d\u4fe1",invalid_special_character:"\u6b21\u306e\u6587\u5b57\u3092\u542b\u307e\u306a\u3044\u540d\u524d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002\n&quot; * : < > ? / \\ |",mail_template:"-- \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 --",no_content:"\u8a2d\u5b9a\u306a\u3057",not_attach_file:"\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",not_decimal:"\u30c6\u30b9\u30c8\u671f\u9593\u306b\u306f\u6574\u6570\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",not_set_reservation_at:"\u4e88\u7d04\u6642\u9593\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",pattern_a:"\u30e1\u30fc\u30eb\u4f5c\u6210\u3000\u30d1\u30bf\u30fc\u30f3A",pattern_b:"\u30e1\u30fc\u30eb\u4f5c\u6210\u3000\u30d1\u30bf\u30fc\u30f3B",period_lower_limit:"\u30c6\u30b9\u30c8\u671f\u9593\u306f%{num}\u4ee5\u4e0a\u306e\u5024\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",period_not_set:"\u30c6\u30b9\u30c8\u671f\u9593\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",period_upper_limit:"\u30c6\u30b9\u30c8\u671f\u9593\u306f%{num}\u4ee5\u4e0b\u306e\u5024\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",preview_from_client:"\u4f1a\u793e\u306e\u55b6\u696d\u62c5\u5f53\u8005",preview_from_lead:"\u30ea\u30fc\u30c9\u306e\u55b6\u696d\u62c5\u5f53\u8005",reservation_flg_not_set:"\u914d\u4fe1\u65b9\u6cd5\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",scheduled_delivery:"\u4e88\u7d04\u914d\u4fe1",send:"\u9001\u4fe1"},maps:{add_route:"\u8a2a\u554f\u30eb\u30fc\u30c8\u306b\u8ffd\u52a0",address:"\u4f4f\u6240",all_routes:"\u5168\u533a\u9593\u30eb\u30fc\u30c8\u3092\u898b\u308b\u3002",cant_add_route:"\u8a2a\u554f\u30eb\u30fc\u30c8\u306b\u306f\u3053\u308c\u4ee5\u4e0a\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3002",delete_route:"\u8a2a\u554f\u30eb\u30fc\u30c8\u304b\u3089\u524a\u9664",mobile_tel:"\u643a\u5e2f\u96fb\u8a71",no_value:"\u5024\u306a\u3057",route:"\u8a2a\u554f\u30eb\u30fc\u30c8",save_more:"2\u4ef6\u4ee5\u4e0a\u306e\u8a2a\u554f\u30eb\u30fc\u30c8\u306e\u767b\u9332\u304c\u5fc5\u8981\u3067\u3059\u3002",section_route:"\u533a\u9593\u30eb\u30fc\u30c8",sent:"\u9001\u4fe1\u3057\u307e\u3057\u305f\u3002",tel:"\u96fb\u8a71"},operation_histories:{"function":"\u6a5f\u80fd",processing:"\u51e6\u7406"},risk_clients:{alert_exclusive_control:"\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u3088\u308a\u53d6\u5f15\u8a55\u4fa1\u304c\u66f4\u65b0\u3055\u308c\u3066\u3044\u307e\u3059\u3002 \u4e0a\u66f8\u304d\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f"},sale_approaches:{activity_link:"\u6d3b\u52d5\u7d10\u3065\u3051",drop_file:"\u30d5\u30a1\u30a4\u30eb\u3092\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044",file_size_below:"\u30c8\u30fc\u30af\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u306f30MB\u4ee5\u4e0b\u3067\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002",item_set:"\u8a2d\u5b9a\u53ef\u80fd\u306a\u9805\u76ee\u306f10\u307e\u3067\u3067\u3059\u3002",load_error:"\u30c7\u30fc\u30bf\u53d6\u5f97\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002<br>\u753b\u9762\u518d\u8aad\u307f\u8fbc\u307f\u3092\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002",max_hierarchy:"\u6d3b\u52d5\u7a2e\u5225\u8a2d\u5b9a\u306e\u6700\u5927\u968e\u5c64\u306f\uff15\u968e\u5c64\u3067\u3059",no_activity_type:"\u6d3b\u52d5\u7a2e\u5225\u304c\u3042\u308a\u307e\u305b\u3093\u3002",sort_limited:"\u30bd\u30fc\u30c8\u9806\u306e\u8a2d\u5b9a\u306f5\u3064\u307e\u3067\u3067\u3059\u3002"},search_visible_fields:{advanced_search:"\u691c\u7d22\u9805\u76ee\u3092\u5909\u66f4\u3059\u308b"},select_parent_tag_id:{without_owner:"\uff08\u6240\u6709\u8005\u306a\u3057\uff09"},seminars:{access_denied:"Zoom\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002",add_tag_confirm:"\u4ee5\u4e0b\u306e\u30bf\u30b0\u3092\u767b\u9332\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",client_modal_title:"\u4f1a\u793e\u306e\u691c\u7d22",copied:"\u30b3\u30d4\u30fc\u3057\u307e\u3057\u305f",copy_clipboard:"\u30af\u30ea\u30c3\u30d7\u30dc\u30fc\u30c9\u306b\u30b3\u30d4\u30fc",copy_invitation_link:"\u62db\u5f85\u30ea\u30f3\u30af\u3092\u30b3\u30d4\u30fc",country:"\u56fd",country_uncheck:"\u56fd\u3092\u9078\u629e\u3057\u3066\u3044\u307e\u305b\u3093\u3002\u56fd\u3092\u5c11\u306a\u304f\u3068\u30821\u3064\u9078\u629e\u3057\u3066 \u304b\u3089\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002",delete_message:"\u30a6\u30a7\u30d3\u30ca\u30fc\u306e\u95a2\u9023\u3092\u89e3\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f\n\u203b\u95a2\u9023\u4ed8\u3051\u89e3\u9664\u3092\u884c\u3046\u3068\u30a6\u30a7\u30d3\u30ca\u30fc\u306e\u958b\u50ac\u3001\u7d50\u679c\u306e\u66f4\u65b0\u306a\u3069\u304c\u3001HotProfile\u304b\u3089\u884c\u3048\u306a\u304f\u306a\u308a\u307e\u3059\u3002",dial:"\u30c0\u30a4\u30e4\u30eb\u767a\u4fe1\u5143\uff1a",initialize_country:"\u65e5\u672c",lead_modal_title:"\u30ea\u30fc\u30c9\u306e\u691c\u7d22",other:"\u304a\u3088\u3073\u305d\u306e\u4ed6",search_country:"\u4eca\u56de\u306e\u691c\u7d22\u3067\u30de\u30c3\u30c1\u3057\u305f\u56fd\u306f\u3042\u308a</br>\u307e\u305b\u3093.\u305d\u306e\u56fd\u540d\u306e\u6700\u521d\u306e\u6570\u6587\u5b57\u3092</br>\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044.\u4f8b\u3048\u3070</br>\u300cUnited States\u300d\uff08\u7c73\u56fd\uff09\u3092</br>\u691c\u7d22\u3059\u308b\u5834\u5408\u306f\u300cUni\u300d\u3068\u5165\u529b\u3057\u307e\u3059\u3002",tag_not_set:"\u30bf\u30b0\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093",target_not_set:"\u30ea\u30fc\u30c9\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"},settings:{today_and_before_date_msg:"\u5f53\u65e5\u3001\u904e\u53bb\u65e5\u304c\u5165\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002"},sort_settings:{title:"\u521d\u671f\u30bd\u30fc\u30c8\u8a2d\u5b9a"},stories:{action:{action_colon:"\u30a2\u30af\u30b7\u30e7\u30f3:",mail:{add_mail:"\u30e1\u30fc\u30eb\u3092\u8ffd\u52a0\u3059\u308b",after_before_process:"\u524d\u5de5\u7a0b\u306e\u30a2\u30af\u30b7\u30e7\u30f3\u7d42\u4e86\u5f8c",after_day_in:"\u65e5\u5f8c\u306e",confirmed:"\u30e1\u30fc\u30eb\u78ba\u8a8d\u6e08\u307f",detail:"\u8a73\u7d30",mail:"\u30e1\u30fc\u30eb",no_title:"\uff08\u4ef6\u540d\u306a\u3057\uff09",please_select_mail:"\u30e1\u30fc\u30eb\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",please_select_target:"\u5bfe\u8c61\u8005\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044",send_delay_at:"\u306b\u914d\u4fe1\u958b\u59cb\u3059\u308b",send_mail:"\u30e1\u30fc\u30eb\u914d\u4fe1",target_colon:"\u5bfe\u8c61\u8005 :",unconfirmed:"\u30e1\u30fc\u30eb\u672a\u78ba\u8a8d"},mail_action:"\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b",not_set:"\u30a2\u30af\u30b7\u30e7\u30f3\u672a\u8a2d\u5b9a",score:{please_input_score:"\u30b9\u30b3\u30a2\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",point:"\u70b9",score:"\u30b9\u30b3\u30a2"},score_action:"\u30b9\u30b3\u30a2\u3092\u3064\u3051\u308b",score_mail_action:"\u30b9\u30b3\u30a2\u3092\u3064\u3051\u3066\u30e1\u30fc\u30eb\u3092\u9001\u4fe1\u3059\u308b",seminar:{auto_add_campaign:"\u30bb\u30df\u30ca\u30fc\u306e\u5bfe\u8c61\u8005\u3092\u81ea\u52d5\u7684\u306b\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u306b\u8ffd\u52a0\u3059\u308b",auto_add_campaign_flg_colon:"\u30bb\u30df\u30ca\u30fc\u5bfe\u8c61\u8005\u306e\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u3078\u306e\u81ea\u52d5\u8ffd\u52a0\uff1a",end_seminar:"\u203b\u30bb\u30df\u30ca\u30fc\u304c\u7d42\u4e86\u3059\u308b\u3053\u3068\u3067\u30a2\u30af\u30b7\u30e7\u30f3\u7d42\u4e86\u3068\u306a\u308a\u307e\u3059",open_date:"\u958b\u50ac",please_select_seminar:"\u30bb\u30df\u30ca\u30fc\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",seminar_open:"\u30bb\u30df\u30ca\u30fc\u958b\u50ac"},seminar_action:"\u30bb\u30df\u30ca\u30fc",target:"\u5bfe\u8c61",trigger_mail:{count:"\u4eba",not_set:"\u672a\u8a2d\u5b9a",reserve_send_at:"\u914d\u4fe1\u958b\u59cb",target_setting:"\u5bfe\u8c61\u8005\u8a2d\u5b9a"},trigger_mail_action:"\u30e1\u30fc\u30eb",webform:{auto_add_campaign:"Web\u30d5\u30a9\u30fc\u30e0\u306e\u56de\u7b54\u8005\u3092\u81ea\u52d5\u7684\u306b\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u306b\u8ffd\u52a0\u3059\u308b",auto_add_campaign_flg_colon:"\u56de\u7b54\u8005\u306e\u30ad\u30e3\u30f3\u30da\u30fc\u30f3\u3078\u306e\u81ea\u52d5\u8ffd\u52a0\uff1a",please_select_webform:"Web\u30d5\u30a9\u30fc\u30e0\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"},webform_action:"Web\u30d5\u30a9\u30fc\u30e0"},draft_mail_info:"<div class='text-left'>\u4e0b\u66f8\u304d\u30e1\u30fc\u30eb\u3092\u9078\u629e\u3057\u305f\u5834\u5408\u3001\u9078\u629e\u3055\u308c\u305f\u4e0b\u66f8\u304d\u30e1\u30fc\u30eb\u306f\u30b3\u30d4\u30fc\u3057\u3066\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002<br>\u9078\u629e\u3057\u305f\u4e0b\u66f8\u304d\u30e1\u30fc\u30eb\u306f\u4e0b\u66f8\u304d\u72b6\u614b\u3067\u6b8b\u308b\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002</div>",draft_register_successful:"\u4e0b\u66f8\u304d\u767b\u9332\u3057\u307e\u3057\u305f\u3002",mail_target_info:"<div class='text-left'>\u30e1\u30fc\u30eb\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u9001\u4fe1\u5bfe\u8c61\u8005\u306f\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002<br>\u9001\u4fe1\u5bfe\u8c61\u3068\u306a\u308b\u30ea\u30fc\u30c9\u306e\u6761\u4ef6\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002</div>",mail_target_not_use:"\u30e1\u30fc\u30eb\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u9001\u4fe1\u5bfe\u8c61\u8005\u306f\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002\n\u30b7\u30ca\u30ea\u30aa\u306e\u8a2d\u5b9a\u306b\u5f93\u3044\u9001\u4fe1\u5bfe\u8c61\u8005\u3092\u6c7a\u5b9a\u3057\u307e\u3059\u3002",please_select:"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044",reaction:{add_reaction:"\u30ea\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3059\u308b",confirm_delete:"\u4ee5\u964d\u306e\u30ea\u30a2\u30af\u30b7\u30e7\u30f3\u7dda\u3068\u30a2\u30af\u30b7\u30e7\u30f3\u306e\u60c5\u5831\u304c\u3059\u3079\u3066\u524a\u9664\u3055\u308c\u307e\u3059\u3002\n\u672c\u5f53\u306b\u524a\u9664\u3057\u307e\u3059\u304b\uff1f"},reaction_disp:{absence:"\u7533\u3057\u8fbc\u307f\u72b6\u6cc1\uff1a\u6b20\u5e2d",attend:"\u7533\u3057\u8fbc\u307f\u72b6\u6cc1\uff1a\u51fa\u5e2d",no_reaction:"\u7533\u3057\u8fbc\u307f\u72b6\u6cc1\uff1a\u56de\u7b54\u306a\u3057",open_mail:"\u958b\u5c01",un_open_mail:"\u672a\u958b\u5c01",url_click:"URL\u30af\u30ea\u30c3\u30af",with_access:"\u30a2\u30af\u30bb\u30b9\u3042\u308a",with_reply:"\u56de\u7b54\u3042\u308a",without_access:"\u30a2\u30af\u30bb\u30b9\u306a\u3057"},register_successful:"\u767b\u9332\u3057\u307e\u3057\u305f\u3002",remind:{timeout:"\u7de8\u96c6\u958b\u59cb\u304b\u308929\u5206\u304c\u7d4c\u904e\u3057\u307e\u3057\u305f\u3002\u4e00\u5ea6\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002"},scenario:{add_scenario:"\u30b7\u30ca\u30ea\u30aa\u3092\u8ffd\u52a0\u3059\u308b",confirm_delete:"\u9078\u629e\u3057\u305f\u30b7\u30ca\u30ea\u30aa\u3092\u524a\u9664\u3057\u307e\u3059\u304b\uff1f",description:"\u30b7\u30ca\u30ea\u30aa\u8aac\u660e",disable:"\u7121\u52b9",enable:"\u6709\u52b9",name:"\u30b7\u30ca\u30ea\u30aa\u540d",none:"\u30b7\u30ca\u30ea\u30aa\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",period:"\u5b9f\u65bd\u671f\u9593",start:"\u30b9\u30bf\u30fc\u30c8",status:"\u30b9\u30c6\u30fc\u30bf\u30b9"},set_ab_test_mail_notice_message:"AB\u30c6\u30b9\u30c8\u30e1\u30fc\u30eb\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\nAB\u30c6\u30b9\u30c8\u30e1\u30fc\u30eb\u306e\u4ef6\u540d\u3068\u672c\u6587\u304c\u6b63\u3057\u304f\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u304b\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002\n\u307e\u305f\u3001\u4e88\u7d04\u65e5\u6642\u306f\u30b9\u30c8\u30fc\u30ea\u30fc\u3067\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5185\u5bb9\u304c\u53cd\u6620\u3055\u308c\u307e\u3059\u3002\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002",story_template_confirmation:"\u30b9\u30c8\u30fc\u30ea\u30fc\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u53cd\u6620\u3059\u308b\u3068\u3001\u30b9\u30c8\u30fc\u30ea\u30fc\u5185\u5bb9\u7de8\u96c6\u30a8\u30ea\u30a2\u5185\u306b\u5165\u529b\u3055\u308c\u305f\u3059\u3079\u3066\u306e\u5185\u5bb9\u304c\u4e0a\u66f8\u304d\u3055\u308c\u307e\u3059\u3002\r\n\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",update_successful:"\u66f4\u65b0\u3057\u307e\u3057\u305f\u3002"},target_lists:{destination_not_set:"\u5b9b\u5148\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",failed:"\u5931\u6557\u3057\u307e\u3057\u305f\u3002",not_hidden_item:"\u5fc5\u9808\u9805\u76ee\u306f\u975e\u8868\u793a\u306b\u3067\u304d\u307e\u305b\u3093\u3002",select_process:"\u73fe\u5728\u9078\u629e\u4e2d\u306e\u30ea\u30fc\u30c9\u3092\u5168\u3066\u30af\u30ea\u30a2\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f",target_not_set:"\u30bf\u30fc\u30b2\u30c3\u30c8\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"},temporary_business_card:{invalid_term:"\u958b\u59cb\u65e5\u306f\u7d42\u4e86\u65e5\u3088\u308a\u524d\u306e\u65e5\u4ed8\u3067\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002"},transfer_tools:{communication_failed:"\u901a\u4fe1\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30da\u30fc\u30b8\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3057\u3066\u304f\u3060\u3055\u3044\u3002"},users:{default_request_lead_source_create:"\u30ea\u30fc\u30c9\u30bd\u30fc\u30b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",disabled_user:"\u7121\u52b9\u306a\u30e6\u30fc\u30b6\u30fc",select_dashboard:"\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\u3002"},visible_fields:{set_search:"\u691c\u7d22\u7d50\u679c\u8868\u793a\u8a2d\u5b9a"},webinar_polls:{no_complete:"\u672a\u5b8c\u4e86",please_input_question:"\u8cea\u554f\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002"}}});var App=function(){};App.concerns={disable_buttons_submit_custom:function(t,n){$(document).on("click",t,function(){$(t).prop("disabled",!0);var e=$(this).data("btn-type");"submit"==e?$(this).closest("form").submit():"clear"==e&&document.getElementById(n.replace("#","")).click()})},disable_duplicate_request_clear_form:function(t){$(document).on("click",".search-form-clear",function(e){e.preventDefault(),$(this).prop("disabled",!0),window.location="/"+t+"/?commit="+$(this).attr("value")})},disable_duplicate_request_search_form:function(e,a){$(document).on("keydown",e,function(e){if(13===e.keyCode){var t=$(this),n=["csv_dl_submit","csv_old_and_new_dl_submit","csv_all_dl_url_datails_submit"],i=$(document.activeElement).attr("id");if(n.includes(i)||$(a).prop("disabled",!0),t.data("processing"))return void e.preventDefault();["simple_search_multiple","simple_search_name_and_client_id","simple_search_simple_name"].includes(i)&&($("#portlet_id").val(""),$("#chart_segment_type").val(""),$("#chart_segment_ids").val(""),$("#is_others").val(""),$("#is_nil_segment_value_included").val(""),$("#from_orders_date_on_txt").val(""),$("#to_orders_date_on_txt").val("")),t.data("processing",!0),t.submit()}}),$(e).on("ajax:success",function(){$(this).data("processing",!1),$(a).prop("disabled",!1)})},disabled_with_link_clear:function(e,t,n){$(document).on("click",e,function(e){e.preventDefault(),$(this).prop("disabled",!0),$(t).prop("disabled",!0),document.getElementById(n).click()})},disabled_btn:function(e){$(e).prop("disabled",!0)},remove_disabled_btn:function(e){$(e).prop("disabled",!1)},change_display_number:function(e){$("#change_display_number").on("change",function(){$("#display_number").val($("#change_display_number").val()),$("#"+e).submit()}),$("#change_display_number_on_modal").on("change",function(){$("#display_number_on_modal").val($("#change_display_number_on_modal").val()),$("#"+e).submit()})},change_display_number_on_modal:function(e,t){$(e).off("change"),$(e).on("change",function(){$(this).parents(".modal-search-area").find("#display_number_on_modal").val($(this).val()),$("#"+t).submit()})},change_display_number_on_modal_with_tab:function(e){$("#change_display_number_on_modal_sub_tab").on("change",function(){$("#display_number_on_modal_sub_tab").val($("#change_display_number_on_modal_sub_tab").val()),$("#"+e).submit()})},change_display_number_on_modal_with_sub_tab:function(e){$("#change_display_number_on_modal_sub_sub_tab").on("change",function(){$("#display_number_on_modal_sub_sub_tab").val($("#change_display_number_on_modal_sub_sub_tab").val()),$("#"+e).submit()})},change_display_number_for_notification_from_admin:function(e){$("#change_display_number_for_notification_from_admin").on("change",function(){$("#display_number_for_notification_from_admin").val($("#change_display_number_for_notification_from_admin").val()),$("#"+e).submit()})},change_order:function(i){$(".order_head").on("click",function(){if(!$(this).data("order-summary")){var e=$("#"+i);if($("#order_key").val($(this).data("order-key")),$("#order_type").val($(this).data("order-type")),$("#order_flg").val(1),$('input[name="order_key"]').val($(this).data("order-key")),$('input[name="order_type"]').val($(this).data("order-type")),$('input[name="order_flg"]').val(1),$("#keyword").val($("#result_search_selected_id").val()),$("#search_data_type").val("sort_data_by_key"),0<$("#clear_merge_resources_session").length&&$("#clear_merge_resources_session").val(!1),"form_search_detail_masters"===i&&$("#page").remove(),0<$(".duplicate-resources-row .check-items").length){var n="ids[]";e.hasClass("duplicate-clients-search")&&(n="merge_client_ids[]"),e.find('[name="'+n+'"]').remove(),$(".duplicate-resources-row .check-items:checked").each(function(e,t){$("<input>").attr({type:"hidden",name:n,value:$(t).val()}).appendTo("#"+i)})}e.submit()}})},change_order_on_modal_with_tab:function(e){$(".order_head_with_tab").on("click",function(){$("#order_key").val($(this).data("order-key")),$("#order_type").val($(this).data("order-type")),$("#order_flg").val(1),$('input[name="order_key"]').val($(this).data("order-key")),$('input[name="order_type"]').val($(this).data("order-type")),$('input[name="order_flg"]').val(1),$("#"+e).submit()})},change_order_for_duplicate:function(i){$(document).on("click",".order_head_for_duplicate",function(){var e=$("#"+i);if($("#order_key").val($(this).data("order-key")),$("#order_type").val($(this).data("order-type")),$("#order_flg").val(1),$('input[name="order_key"]').val($(this).data("order-key")),$('input[name="order_type"]').val($(this).data("order-type")),$('input[name="order_flg"]').val(1),$("#keyword").val($("#result_search_selected_id").val()),$("#search_data_type").val("sort_data_by_key"),0<$("#clear_merge_resources_session").length&&$("#clear_merge_resources_session").val(!1),0<$(".duplicate-resources-row .check-items").length){var n="ids[]";e.hasClass("duplicate-clients-search")&&(n="merge_client_ids[]"),e.find('[name="'+n+'"]').remove(),$(".duplicate-resources-row .check-items:checked").each(function(e,t){$("<input>").attr({type:"hidden",name:n,value:$(t).val()}).appendTo("#"+i)})}e.submit()})},change_order_leads:function(n,i){$(document).off("click.transmitters"),$(document).on("click.transmitters",".lead_order_head",function(){var e=$("#"+n),t=$(this);$("#lead_order_key").val(t.data("order-key")),$("#lead_order_type").val(t.data("order-type")),i&&e.attr("action",i),e.submit(),$(".js_disabled_submit").prop("disabled",!1)})},change_order_for_target_tab:function(n,e){$(document).off("click.transmitters"),$(document).on("click.transmitters",e,function(){var e=$(n),t=$(this);$(n+" #order_key_for_target_tab").val(t.data("order-key")),$(n+" #order_type_for_target_tab").val(t.data("order-type")),e.submit(),$(".js_disabled_submit").prop("disabled",!1)})},change_order_for_abmail:function(e,t){$("#"+t+" .order_head").on("click",function(){$("#order_key").val($(this).data("order-key")),$("#order_type").val($(this).data("order-type")),$("#order_flg").val(1),$('input[name="order_key"]').val($(this).data("order-key")),$('input[name="order_type"]').val($(this).data("order-type")),$('input[name="order_flg"]').val(1),$("#"+e).submit()})},search_index_default:function(t){$(".search_index").on("click",function(e){e.preventDefault(),form=$("#"+t),$(form).attr("action",$(this).data("action")),$(form).submit()})},search_zip_code:function(){$("#search_zip_code").on("click",function(){$(this).prop("disabled",!0);var e=$("input.zip").val();$("input#zip").val(e),$("#form_search_xhr_zip_code").submit()}),$("#search_zip_code_client_branch").on("click",function(){$(this).prop("disabled",!0);var e=$("input.zip_client_branch").val();$("input#zip_client_branch").val(e),$("#form_search_xhr_zip_code_client_branch").submit()})},search_zip_code_2:function(t){$("#search_zip_code_"+t).on("click",function(){$(this).prop("disabled",!0);var e=$("input.zip_"+t).val();$("input#zip_"+t).val(e),$("#form_search_xhr_zip_code_"+t).submit()})},select_search_disable_user:function(a,s){var o=$("#"+a);"hidden"!==o.attr("type")&&o.select2({width:o.data("width"),minimumInputLength:o.data("minlen"),placeholder:o.data("prompt"),multiple:o.data("multiple"),allowClear:!0,formatResult:function(e){return e.enable_flg?e.text:$('<div><i class = "fa fa-user-times" style="color:#bf0000"/> <span style="color:#bf0000">'+e.text+" \uff08"+I18n.t("js.users.disabled_user")+"\uff09</span></div>")},formatSelection:function(e){return e.enable_flg?e.text:'<i class = "fa fa-user-times" style="color:#bf0000"/> <span style="color:#bf0000">'+e.text+" \uff08"+I18n.t("js.users.disabled_user")+"\uff09</span>"},ajax:{url:o.data("action"),type:"post",dataType:"json",data:function(e){return{search:e,authenticity_token:o.data("token"),client_id:$("#"+a).data("clientId"),client_name:$("#"+a).data("clientName"),controller_name:$("#"+a).data("controllerName"),daily_report_flg:$("#"+a).data("dailyReportFlg"),task_flg:$("#"+a).data("taskFlg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),selected_department_ids:$("#"+a).data("selected-department-ids"),search_type:$("#"+a).data("search-type"),self_id:$("#"+a).data("self-id"),search_disabled_flg:!0}},results:function(e){return{results:e.results}}},initSelection:function(e,t){var n=$(e).val();if(null!=n){var i={};$(".department-checked").each(function(){i[$(this).val()]=$(this).prop("checked")}),$.ajax({type:"post",url:o.data("action"),data:{id:n,client_id:o.data("clientId"),client_name:o.data("clientName"),controller_name:o.data("controllerName"),authenticity_token:o.data("token"),user_position_flg:$("#"+a).data("user-position-flg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),search_type:$("#"+a).data("search-type"),selected_departments:i,search_disabled_flg:!0},success:function(e){0===e.results.length?(o.val(""),t("")):1<e.results.length?t(e.results):t(e.results[0]),s&&$("#"+s).prop("disabled",!1),$("#modalselectParentTagId").modal("show")},error:function(){s&&$("#"+s).prop("disabled",!1)}})}}})},select_search:function(a,s,o){var r=$(
"#"+a);"hidden"!==r.attr("type")&&(r.select2({width:r.data("width"),minimumInputLength:r.data("minlen"),placeholder:r.data("prompt"),multiple:r.data("multiple"),allowClear:!0,formatResult:function(e){return e.text},formatSelection:function(e){return e.hasOwnProperty("enable_flg")&&!0!==e.enable_flg?'<i class = "fa fa-user-times" style="color:#bf0000"/> <span style="color:#bf0000">'+e.text+" \uff08"+I18n.t("js.users.disabled_user")+"\uff09</span>":e.text},ajax:{url:r.data("action"),type:"post",dataType:"json",data:function(e){return{search:e,authenticity_token:r.data("token"),client_id:$("#"+a).data("clientId"),client_name:$("#"+a).data("clientName"),controller_name:$("#"+a).data("controllerName"),daily_report_flg:$("#"+a).data("dailyReportFlg"),task_flg:$("#"+a).data("taskFlg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),selected_department_ids:$("#"+a).data("selected-department-ids"),search_type:$("#"+a).data("search-type"),self_id:$("#"+a).data("self-id"),another_object_id:$("#"+a).data("another_object_id"),item_flg:$("#"+a).data("item-flg"),from_kintone_setting:o||""}},results:function(e){return{results:e.results}}},initSelection:function(e,t){var n=$(e).val();if(null!=n){var i={};$(".department-checked").each(function(){i[$(this).val()]=$(this).prop("checked")}),$.ajax({type:"post",url:r.data("action"),data:{id:n,client_id:r.data("clientId"),client_name:r.data("clientName"),controller_name:r.data("controllerName"),authenticity_token:r.data("token"),user_position_flg:$("#"+a).data("user-position-flg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),search_type:$("#"+a).data("search-type"),selected_departments:i,another_object_id:$("#"+a).data("another_object_id"),destination:$("#"+a).data("destination"),item_flg:$("#"+a).data("item-flg"),from_kintone_setting:o||""},success:function(e){0===e.results.length?(r.val(""),t("")):1<e.results.length?t(e.results):t(e.results[0]),s&&$("#"+s).prop("disabled",!1),$("#modalselectParentTagId").modal("show")},error:function(){s&&$("#"+s).prop("disabled",!1)}})}}}),"confirmation_user_ids"===a&&$("#hidden_"+a).css("display","none"))},select_search_lead:function(a,s){var o=$("#"+a);"hidden"!==o.attr("type")&&o.select2({width:o.data("width"),minimumInputLength:o.data("minlen"),placeholder:o.data("prompt"),multiple:o.data("multiple"),allowClear:!0,formatResult:function(e){var t=e.text.split("\n");return t[1]?t[1]+'<br><span style="padding-left: 10px">'+t[0]+"</span>":t[0]},formatSelection:function(e){return e.hasOwnProperty("enable_flg")&&!0!==e.enable_flg?'<i class = "fa fa-user-times" style="color:#bf0000"/> <span style="color:#bf0000">'+e.text+" \uff08"+I18n.t("js.users.disabled_user")+"\uff09</span>":e.text},ajax:{url:o.data("action"),type:"post",dataType:"json",data:function(e){return{search:e,authenticity_token:o.data("token"),client_id:$("#"+a).data("clientId"),client_name:$("#"+a).data("clientName"),controller_name:$("#"+a).data("controllerName"),daily_report_flg:$("#"+a).data("dailyReportFlg"),task_flg:$("#"+a).data("taskFlg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),selected_department_ids:$("#"+a).data("selected-department-ids"),search_type:$("#"+a).data("search-type"),self_id:$("#"+a).data("self-id"),another_object_id:$("#"+a).data("another_object_id"),item_flg:$("#"+a).data("item-flg")}},results:function(e){return{results:e.results}}},initSelection:function(e,t){var n=$(e).val();if(null!=n){var i={};$(".department-checked").each(function(){i[$(this).val()]=$(this).prop("checked")}),$.ajax({type:"post",url:o.data("action"),data:{id:n,client_id:o.data("clientId"),client_name:o.data("clientName"),controller_name:o.data("controllerName"),authenticity_token:o.data("token"),user_position_flg:$("#"+a).data("user-position-flg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),search_type:$("#"+a).data("search-type"),selected_departments:i,another_object_id:$("#"+a).data("another_object_id"),destination:$("#"+a).data("destination"),item_flg:$("#"+a).data("item-flg")},success:function(e){0===e.results.length?(o.val(""),t("")):1<e.results.length?t(e.results):t(e.results[0]),s&&$("#"+s).prop("disabled",!1),$("#modalselectParentTagId").modal("show")},error:function(){s&&$("#"+s).prop("disabled",!1)}})}}})},select_search_name:function(u,a){var s=$("#"+u);"hidden"!==s.attr("type")&&s.select2({width:s.data("width"),minimumInputLength:s.data("minlen"),placeholder:s.data("prompt"),multiple:s.data("multiple"),allowClear:!0,formatResult:function(e){if(0==e.id)return e.message.replaceAll("<","&lt;").replaceAll(">","&gt;");var t='<div style="display: flex;"><div style="width:90%; display: inline-block;">'+e.text_name+"</div>",n=e.text_address,i=I18n.t("js.business_cards.no_address_company"),a='<i style="padding-left: 10px; color: #778899; font-style: normal;">',s=18,o="color:##282828; float:right;",r=e.url_link;if($("#simplyFormModalContainer").hasClass("in")&&(s=34),"favorite_client_ids"==u&&(s=79),""!=n)if(n.length>s){if(i=$("#simplyFormModalContainer").hasClass("in")?n.replace(/(.{28})..+/,"$1 ..."):"favorite_client_ids"==u?n.replace(/(.{76})..+/,"$1 ..."):n.replace(/(.{15})..+/,"$1 ..."),n.length>2*s){var l=n.length,c=Math.round(l/2),d=n.indexOf(" ",c);n=-1!==d&&0!==d&&d!==l-1?n.substring(0,d)+"<br/>"+n.substring(d+1):n.substring(0,c)+"<br/>"+n.substring(c)}a='<i title="'+n+'"class="hp-tooltip" data-html="true" style="padding-left: 10px; font-style: normal;">'}else i=n,a='<i style="padding-left: 10px; font-style: normal;">';return""==r&&(r="https://www.google.com/search?q="+e.text_name,""!=e.text_address&&(r=r+"+"+e.text_address)),show_address='<div style="display: inline-block; width: 10%"><i class = "fa fa-external-link icon-address-company-url" data-url="'+r+'" style="'+o+'"/></div> </div>'+a+i+"</i>",client_info_results=t+show_address,client_info_results},formatSelection:function(e){if("0"===e.id)return e.text_name;return e.hasOwnProperty("enable_flg")&&!0!==e.enable_flg?'<i class = "fa fa-user-times" style="color:#bf0000"/> <span style="color:#bf0000">'+e.text_name+" \uff08"+I18n.t("js.users.disabled_user")+"\uff09</span>":e.text_name},ajax:{url:s.data("action"),type:"post",dataType:"json",data:function(e){return{search:e,authenticity_token:s.data("token"),client_id:$("#"+u).data("clientId"),client_name:$("#"+u).data("clientName"),controller_name:$("#"+u).data("controllerName"),daily_report_flg:$("#"+u).data("dailyReportFlg"),task_flg:$("#"+u).data("taskFlg"),open_status:$("#"+u).data("open-status"),user_id:$("#"+u).data("user-id"),selected_role_ids:$("#"+u).data("selected-role-ids"),selected_department_ids:$("#"+u).data("selected-department-ids"),search_type:$("#"+u).data("search-type"),self_id:$("#"+u).data("self-id"),another_object_id:$("#"+u).data("another_object_id"),type:s.data("type")}},results:function(e){return{results:e.results}}},initSelection:function(e,t){var n=$(e).val();if(null!=n){var i={};$(".department-checked").each(function(){i[$(this).val()]=$(this).prop("checked")}),$.ajax({type:"post",url:s.data("action"),data:{id:n,client_id:s.data("clientId"),client_name:s.data("clientName"),controller_name:s.data("controllerName"),authenticity_token:s.data("token"),user_position_flg:$("#"+u).data("user-position-flg"),open_status:$("#"+u).data("open-status"),user_id:$("#"+u).data("user-id"),selected_role_ids:$("#"+u).data("selected-role-ids"),search_type:$("#"+u).data("search-type"),selected_departments:i,another_object_id:$("#"+u).data("another_object_id"),type:s.data("type")},success:function(e){0===e.results.length?(s.val(""),t("")):1<e.results.length?t(e.results):t(e.results[0]),a&&$("#"+a).prop("disabled",!1),$("#modalselectParentTagId").modal("show")},error:function(){a&&$("#"+a).prop("disabled",!1)}})}}})},set_organization_form:function(e){$("#client_id").val($("#"+e).val()),$("#form_search_xhr_organizations_select_options").submit()},set_client_branch_form:function(e){$("#client_id").val($("#"+e).val()),$("#form_search_xhr_client_branches_select_options").submit()},all_checked_items:function(){$("#all-check").click(function(){$(this).is(":checked")?$(".check-items").prop("checked",!0):$(".check-items").prop("checked",!1)})},all_checked_summary_items:function(){$(".all-check").click(function(){$(this).is(":checked")?$(".summary-check-items,.all-check").prop("checked",!0).trigger("change"):$(".summary-check-items,.all-check").prop("checked",!1).trigger("change"),$("[data-selected-number]").text("\uff08"+$(".summary-check-items.summary-checkbox:checkbox:checked").size()+"\uff09")})},checkbox_togglable:function(n,e){$(n).click(function(){$(e).each(function(e,t){$(t).prop("disabled")||$(t).prop("checked",$(n).is(":checked"))})})},set_item_id:function(){$(document).on("change",".select_item",function(){text_field=$(this).next(),text_field.attr("name","search[items][]["+$(this).val()+"]")})},set_item_id_for_ransack:function(){$(document).on("change",".select_item",function(){text_field=$(this).next(),text_field.attr("name","q[search_items][]["+$(this).val()+"]")})},submit_when_changed_element:function(e,t,n){$(document).off("change","."+t),$(document).on("change","."+t,function(){action_path=$(this).data("action"),remote_flg=$(this).data(n),form=App.concerns.set_form_action(e,action_path,remote_flg),form.submit()})},set_form_action:function(e,t,n){return form=$("#"+e),$(form).attr("action",t),$("#js_set_method").val("post"),n?$(form).attr("data-remote","true"):($(form).removeAttr("data-remote"),$(form).removeData("remote")),form},set_form_action_to_submit:function(i,a,s,o){$(document).on("click",a,function(e){e.preventDefault(),$(".btn-group.open").removeClass("open");var t=$(this);if(!t.data("message")||confirm(t.data("message"))){var n=$(i);t.data("action")&&n.attr("action",t.data("action")),t.data("remote")?n.attr("data-remote","true"):(n.removeAttr("data-remote"),n.removeData("remote")),s&&(n.submit(),o&&$(a).prop("disabled",!0))}})},get_modal_to_search_save:function(t){$(document).on("click","#search_save",function(){if("disabled"==$("#search_save").attr("disabled"))return!1;$("#search_save").attr("disabled",!0);var e=$(t).attr("action");$(t).attr("action",$(this).data("action")),$(t).attr("data-remote","true"),$(t).submit(),$(t).attr("action",e),$(t).removeAttr("data-remote"),$(t).removeData("remote")})},get_modal_to_search_call:function(t){$(document).on("click",".search_call",function(){if("disabled"==$(".search_call").attr("disabled"))return!1;$(".search_call").attr("disabled",!0);var e=$(t).attr("action");$(t).attr("action",$(this).data("action")),$(t).attr("data-remote","true"),$(t).submit(),$(t).attr("action",e),$(t).removeAttr("data-remote"),$(t).removeData("remote")})},get_modal_to_lead_search_save:function(t){$(document).off("click","#lead_search_save"),$(document).on("click","#lead_search_save",function(){$("#lead_search_save").attr("disabled",!0);var e=$(t).attr("action");$(t).attr("action",$(this).data("action")),$(t).attr("data-remote","true"),$(t).submit(),$(t).attr("action",e),$(t).removeAttr("data-remote"),$(t).removeData("remote")})},get_modal_to_lead_search_call:function(t){$(document).off("click",".lead_search_call"),$(document).on("click",".lead_search_call",function(){$(".lead_search_call").attr("disabled",!0);var e=$(t).attr("action");$(t).attr("action",$(this).data("action")+"?form_id="+t.replace("#","")),$(t).attr("data-remote","true"),$(t).submit(),$(t).attr("action",e),$(t).removeAttr("data-remote"),$(t).removeData("remote")})},refresh_office365_icon:function(e){$("#js_refresh_office365_icon").data("office365_refresh_icon_flg")&&setTimeout(function(){action_path=$("#js_refresh_office365_icon").data("action"),remote_flg=$("#js_refresh_office365_icon").data("remote"),App.concerns.set_form_action(e,action_path,remote_flg),$("#"+e).submit()},3e4)},insert_tag:function(e,t,n){if("html"===n)CKEDITOR.instances[e].insertHtml(t);else{var i=$("#"+e);if(i.focus(),navigator.userAgent.match(/MSIE/)){var a=document.selection.createRange();a.text=t,a.select()}else{var s=i.val(),o=i.get(0).selectionStart,r=o+t.length;i.val(s.substr(0,o)+t+s.substr(o)),i.get(0).setSelectionRange(r,r)}}},set_mail_tag:function(){($("#mail_body_another").length?$("#mailBodyA .set_mail_tags_to_body"):$(".set_mail_tags_to_body")).on("click",function(){var e=$(this).data("tag"),t=$("#html-body").hasClass("active")?"html":"text",n="html"===t?"mail_body":"mail_text_body";switch(e){case"__unsubscribe__":e=App.concerns.get_unsubscribe_text(t);break;case"__tracking_url__":var i=$("html"===t?"#js_html_tag_tracking_insert_url":"#js_text_tag_tracking_insert_url").val(),a=i,s=i.match(/\#.*/);s&&(s=s[0],a=i.replace(s,"")),1<i.split("?").length?a+="&site=hl__tracking_id__":a+="?site=hl__tracking_id__",e="html"===t?s?"<a href=${href}>${url}</a>".replace("${href}",a+s).replace("${url}",i):"<a href=${href}>${url}</a>".replace("${href}",a).replace("${url}",i):s?a+s:a}App.concerns.insert_tag(n,e,t)})},set_another_mail_tag:function(){$("#mailBodyB .set_mail_tags_to_body").on("click",function(){var e=$(this).data("tag"),t=$("#html-body-another").hasClass("active")?"html":"text",n="html"===t?"mail_body_another":"mail_text_body_another";switch(e){case"__unsubscribe__":e=App.concerns.get_unsubscribe_text(t);break;case"__tracking_url__":var i=$("html"===t?"#mailBodyB #js_html_tag_tracking_insert_url":"#mailBodyB #js_text_tag_tracking_insert_url").val(),a=i;1<i.split("?").length?a+="&site=hl__tracking_id__":a+="?site=hl__tracking_id__",e="html"===t?"<a href=${href}>${url}</a>".replace("${href}",a).replace("${url}",i):a}App.concerns.insert_tag(n,e,t)})},get_unsubscribe_text:function(e){return"html"===e?"<p>"+I18n.t("js.application.stop_delivery")+'<br /><a href="__unsubscribe__">'+I18n.t("js.application.click_here")+"</a></p>":I18n.t("js.application.stop_delivery")+"\n__unsubscribe__"},hide_file_name:function(e){$(document).on("change",e,function(){$("#js_insert_file_name").children().hide(),$("#delete_file_flg").prop("checked",!1)})},hide_another_file_name:function(e){$(document).on("change",e,function(){$("#js_insert_file_name_another").children().hide(),$("#another_delete_file_flg").prop("checked",!1)})},show_file_name:function(){$("#js_insert_file_name").children().show()},show_another_file_name:function(){$("#js_insert_file_name_another").children().show()},change_search_type:function(e,t,n,i){var a=e===undefined?"#search_search_type_1":e,s=t===undefined?"#search_search_type_2":t,o=n===undefined?"#search_search_type_3":n,r=i===undefined?"#search_search_type_4":i;$("#search_show").children().each(function(){var e=$(this).children(),t=e.filter(function(){return"none"===this.style.display}).length;e.length===t&&(this.style.display="none")}),$(document).on("change",".search_type",function(){$(a).is(":checked")?($("#search_multiple").show(),$("#search_show").hide(),$("#search_submit").hide(),$(".show_list_fields").hide(),$("#search_save").hide(),$(".search_call").show(),$(".detail-search").hide(),$("#search_share").hide(),$("#search_user").hide(),$(".checkbox-search").show(),$("#checkbox-search_private").show(),$("#checkbox-search_active").hide(),$("#search_multiple_abms").show(),$("#abm_search").show()):$(s).is(":checked")?($("#search_multiple").hide(),$("#search_show").show(),$("#search_submit").show(),$(".show_list_fields").show(),$("#search_save").show(),$(".search_call").show(),$(".detail-search").show(),$("#search_share").hide(),$("#search_user").hide(),$(".checkbox-search").show(),$("#checkbox-search_private").show(),$("#checkbox-search_active").show(),$("#search_multiple_abms").show(),$("#abm_search").show()):$(o).is(":checked")?($("#search_multiple").hide(),$("#search_show").hide(),$("#search_submit").hide(),$(".show_list_fields").hide(),$("#search_save").hide(),$(".search_call").hide(),$(".detail-search").hide(),$("#search_share").show(),$("#search_user").hide(),$(".checkbox-search").hide(),$("#checkbox-search_private").hide(),$("#checkbox-search_active").hide(),$("#search_multiple_abms").hide(),$("#abm_search").hide()):$(r).is(":checked")&&($("#search_multiple").hide(),$("#search_show").hide(),$("#search_submit").hide(),$(".show_list_fields").hide(),$("#search_save").hide(),$(".search_call").hide(),$(".detail-search").hide(),$("#search_share").hide(),$("#search_user").show(),$(".checkbox-search").hide(),$("#checkbox-search_private").hide(),$("#checkbox-search_active").hide(),$("#search_multiple_abms").hide(),$("#abm_search").hide()),$(document).trigger("floatTableUpdate")})},change_mail_history_tab_type:function(e,t){var n=e===undefined?"#mail_history_tab_type_1":e,i=t===undefined?"#mail_history_tab_type_2":t;$(document).on("change",".mail_history_tab_type",function(){$(n).is(":checked")?($("#summary_chart").show(),$("#summary_chart_ab").show(),$("#mail_queue_information_table").show(),$("#mail_queue_summaries").show(),$("#win_mail_queue_summaries").show(),$("#target_table").hide()):$(i).is(":checked")&&($("#summary_chart").hide(),$("#summary_chart_ab").hide(),$("#mail_queue_information_table").hide(),$("#mail_queue_summaries").hide(),$("#win_mail_queue_summaries").hide(),$("#target_table").show()),$(document).trigger("floatTableUpdate")})},change_hot_recommends_tab_type:function(e,t,n){var i=e===undefined?"#search_search_type_1":e,a=t===undefined?"#search_search_type_2":t,s=n===undefined?"#search_search_type_3":n;$(document).on("change",".hot_recommend",function(){$(i).is(":checked")?($("#recommend_lead").show(),$("#recommend_company").hide(),$("#scenario_management").hide()):$(a).is(":checked")?($("#recommend_lead").hide(),$("#recommend_company").show(),$("#scenario_management").hide()):$(s).is(":checked")&&($("#recommend_lead").hide(),$("#recommend_company").hide(),$("#scenario_management").show()),$(document).trigger("floatTableUpdate")})},prevent_submit_pressing_enter:function(){$(document).on("keypress",".deny_submit_pressing_enter",function(e){return 13!==e.which})},datepicker:function(e,t){e=e===undefined?".datepicker":e,t=t===undefined?{}:e;var n={format:"YYYY-MM-DD hh:mm"};$(function(){$(e).attr(n),$(e).datepicker(Object.assign({orientation:"bottom"},t))})},datetimepicker:function(e){$(e).datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5})},timepicker:function(e){$(e).datetimepicker({format:"HH:mm",stepping:15})},set_value:function(e,t,n,i){$(document).on(e,t,function(){var e=$(this).data(i);$(n).val(e)})},change_display_template:function(){$(document).off("change.display_template","#js_select_change_display_template"),$(document).on("change.display_template","#js_select_change_display_template",function(){var e=$("#js_form_change_display_template");if(1<$(document).find("[id='js_form_change_display_template']").length&&e.attr("action").match(/xhr\/.+\/new_modal/)&&(e.append($("#another_controller_type")),e.append($("#another_object_id"))),e.length&&(this.value.includes("deals/new_from_another_controller")||this.value.includes("daily_reports/new_from_another_controller"))){var t=this.value.split(/[?&]/).find(function(e){return e.includes("display_template_id")}).split("=").slice(-1)[0];e.find('[name="display_template_id"]').val(t),e.submit()}else if(e.length)$("#js_page_header_display_template_id").val(this.value),$("#js_page_header_search_call_flg").val(0),$("#js_page_header_search_id").val(""),""===e.attr("action")&&e.attr("action",$(this).val()),e.submit();else{var n=$(this).val();window.location=n}})},hide_item_file_options:function(){$(document).on("change",".js_item_file_field",function(){$(this).prev(".js_item_file_options").hide(),$(this).prev(".js_item_file_options").find(".js_item_delete_file_flg").prop("checked",!1)})},open_mailer:function(){$(document).on("click",".mailto",function(e){e.preventDefault(),e.stopImmediatePropagation();var t=$(this).prev(':hidden[name="mailer_url"]').val(),n=t.replace("mailer","mailer_check_incorrect_input");$.ajax({url:n,method:"GET",dataType:"json"}).done(function(e){if(e.exist_incorrect_input_flg&&!confirm(I18n.t("js.common.confirm_business_cards_correct")))return!1;window.open(t,"mailerOpen","width=1000, height=700")})})},request_search_call:function(){"1"==$("#js_page_header_search_call_flg").val()&&$.ajax({type:"get",url:$("#js_page_header_search_id").data("action")})},scroll_to_target:function(e){if((e=$(e))[0]){var t=400,n=e.offset().top-80;return $("body,html").animate({scrollTop:n},t,"swing"),!1}},switch_search_form:function(e){function t(e){var t=e.closest("form"),n=t.find("[data-hp-target='simple-form']"),i=t.find("[data-hp-target='advanced-form']");return function(){"a"===e.filter(":checked").val()?(n.addClass("hide"),n.find(":input").prop("disabled",!0),i.find(":input").prop("disabled",!1),i.removeClass("hide")):(i.addClass("hide"),i.find(":input").prop("disabled",!0),n.find(":input").prop("disabled",!1),n.removeClass("hide")),$(document).trigger("floatTableUpdate")}}var n=t(e);e.change(n),n()},attach_select_search_handlers:function(e){e.find("[data-hp-role='select-search']").each(function(){var e=$(this).attr("id");if(void 0===e)throw"element id must be required";App.concerns.select_search(e)})},attach_select_search_handlers_once:function(e){e.find("[data-hp-role='select-search']").each(function(){var e=$(this),t=e.attr("id");if(void 0===t)throw"element id must be required";e.data("select2")!==undefined&&null!==e.data("select2")||App.concerns.select_search(t)})},attach_date_picker_handlers:function(e){var t=e.find("[data-hp-role='datepicker']");t.attr({format:"YYYY-MM-DD hh:mm"}),t.datepicker({format:"yyyy/mm/dd",language:I18n.locale})},attach_date_time_picker_handlers:function(e){e.find("[data-hp-role='datetimepicker']").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5,locale:I18n.locale})},loading_indicator:function(e,t){var n={timeout_message:I18n.t("js.application.timeout_message"),error_message:I18n.t("js.application.error_message"),failure_area:"leads-search-fail",failure_message_area:"leads-search-fail-message",spin_area:"leads-search-spin"},i=this;this.options=$.extend(n,t),this.failArea=e.find("[data-hp-target='"+i.options.failure_area+"']"),this.failMsgArea=e.find("[data-hp-target='"+i.options.failure_message_area+"']"),this.spinArea=e.find("[data-hp-target='"+i.options.spin_area+"']"),this.timeout_message=function(){return i.options.timeout_message},this.error_message=function(){return i.options.error_message},this.begin=function(){i.spinArea.removeClass("hidden"),i.failArea.addClass("hidden")},this.timeout=function(){i.failMsgArea.text(this.timeout_message),i.failArea.hide().removeClass("hidden").fadeIn(250,function(){})},this.error=function(){i.failMsgArea.text(this.error_message),i.failArea.hide().removeClass("hidden").fadeIn(250,function(){})},this.finish=function(){i.spinArea.addClass("hidden")},this.ajax=function(e,n){var i=this;i.begin(),$.ajax(e).done(function(e,t){n.done&&n.done(e,t,i)}).fail(function(e,t){n.fail&&n.fail(e,t,i),"timeout"==t?i.timeout():i.error()}).always(function(e){n.always&&n.always(e,status,i),i.finish()})}},generate_tooptip:function(e){e.each(function(){$this=$(this);var e,t=$this.attr("title");t=null==t?"":t.trimLeft().trimRight(),""!=(e=$this.hasClass("hp-tooltip-br")?0!=t.length?t:$this.html().replace("<br>","&#10;").trimLeft().trimRight().replace("&#10;","<br>"):0!=t.length?t:$this.text().trimLeft().trimRight())&&$this.attr("title",e),$this.tooltip({container:"body",template:'<div class="tooltip tooltip-text" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div</div>',trigger:"hover"})})},set_export_ids:function(e,t){$('input:checked[name="'+t+'"]').each(function(){$("<input>").attr({type:"hidden",name:"export_ids[]",value:$(this).val()}).appendTo(e)})},set_page_parameter:function(e){$("<input>").attr({type:"hidden",name:"page",id:"page_for_export",value:$.url().param("page")}).appendTo(e)},set_page_parameter_custom_value:function(e,t){$("<input>").attr({type:"hidden",name:"page",id:"page_for_export",value:t}).appendTo(e)},remove_export_ids:function(){$('input[name="export_ids[]"]').remove()},enable_csv_export_event:function(e,t){$("#csv_dl_submit").on("click",function(){return App.concerns.set_export_ids(e,t),App.concerns.set_page_parameter(e),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_all_dl_flg").val(1),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),$("#csv_all_dl_flg").val(0),!1}),$("#csv_old_and_new_dl_submit").on("click",function(){return $("#csv_old_and_new_flg").val(1),App.concerns.set_export_ids(e,t),App.concerns.set_page_parameter(e),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#page_for_export").remove(),$("#csv_old_and_new_flg").val(0),!1}),$("#csv_old_and_new_all_dl_submit").on("click",function(){return $("#csv_all_dl_flg").val(1),$("#csv_old_and_new_flg").val(1),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),$("#csv_all_dl_flg").val(0),$("#csv_old_and_new_flg").val(0),!1}),$("#mail_dl_send").on("click",function(){return App.concerns.set_export_ids(e,t),App.concerns.set_page_parameter(e),action=$(e).attr("action"),$(e).attr("action","/users/send_dl_mail/"),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#mail_dl_send").attr("disabled",!0),!1})},fix_background:function(){var e=document.body.dataset.fix_count;e&&0!=parseInt(e)?e=parseInt(e)+1:(document.body.style.top="-"+window.pageYOffset+"px",document.body.style.position="fixed",e=1),document.body.dataset.fix_count=e},unfix_background:function(){var e=document.body.dataset.fix_count;if(0==(e=e&&0!=parseInt(e)?parseInt(e)-1:0)){$("body").removeClass("modal-open");var t=document.body.style.top;document.body.style.position="",window.scrollTo(0,-1*parseInt(t||"0"))}document.body.dataset.fix_count=e},set_associate_entity_to_s2:function(t,e,n,i){void 0===i&&(i=I18n.t("js.application.undefined_item")),$(document).on("click",e,function(){if("#search_client_id_on_search_association_modal"!==t){var e="#task_client_id"===t||"#task_daily_report_id"===t||"#task_deal_id"===t||"#client_temporary_business_card_id"===t||"#daily_report_client_id"===t||"#deal_client_id"===t||"#lead_client_id"===t||"#business_card_client_id"===t||"#client_branch_client_id"===t;(localStorage.getItem("client_onclick")===t||e)&&(result=$.ajax({url:"/xhr/"+n+"/existence/",type:"POST",dataType:"json",data:{ids:[$(this).data("hp-entity-id")]},context:$(this)}).done(function(e){if(!e.existence)return alert(i),!1;$(t).val($(this).data("hp-entity-id")).trigger("change"),$(this).closest(".modal").modal("hide")}))}else"#search_client_id_on_search_association_modal"===t&&(result=$.ajax({url:"/xhr/"+n+"/existence/",type:"POST",dataType:"json",data:{ids:[$(this).data("hp-entity-id")]},context:$(this)}).done(function(e){if(!e.existence)return alert(i),!1;$(t).val($(this).data("hp-entity-id")).trigger("change"),$(this).closest(".modal").modal("hide")}))})},set_associate_entities_to_s2:function(e,t,i,a,s){$(document).off("click",e),$(document).on("click",e,function(){$(this).prop("disabled",!0);var n=jQuery.map($(i+":checked"),function(e){return s?$(e).val().replace("lead_","").replace("temporary_business_card_",""):$(e).val()});return 0==n.length?(alert(I18n.t("js.common.please_select")),$(this).prop("disabled",!1),!1):jQuery.map($(i+":checked"),function(e){return $(e).data("check-permission")}).some(function(e){return e})?(alert(I18n.t("js.common.can_not_add_private_item")),!1):(n.unshift.apply(n,jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value})),void $.ajax({url:"/xhr/"+a+"/existence/",type:"POST",dataType:"json",data:{ids:n},context:$(this)}).done(function(e){e.does_not_exist_ids.length&&jQuery.each(e.does_not_exist_ids,function(e,t){n=jQuery.grep(n,function(e){return e!=t})}),$(t).val(n).trigger("change"),$(t).select2("open"),$(t).select2("close"),$(this).closest(".modal").modal("hide")}))})},enable_associattion_search_modal:function(e,a,s,o,r,l,c,d,u){$(document).off("click",e).on("click",e,function(){var e,t,n,i="";c=c||"",e=$(r).val()?$(r).val():"",n=$(d).val()?$(d).val():"","object"!=typeof(t=$(s).val())&&(t=t.split(",")),t&&jQuery.each(t,function(){i+="&exclude_ids[]="+this}),u||(u=""),$.ajax({url:a,data:"utf8=\u2713&client_id="+e+i+"&select_type="+o+"&unlink_clients_flg="+l+"&destination="+c+"&modal_client_branch_id="+n+"&old_and_new_flg="+u})})},enable_associattion_search_modal_with_another_object:function(e,s,o,r,l,c,d){$(document).off("click",e).on("click",e,function(){var e,t,n,i,a="";e=$(l).val()?$(l).val():"","object"!=typeof(t=$(o).val())&&(t=t.split(",")),d&&$(d).val()&&(t||(t=[]),t.push($(d).val())),t&&jQuery.each(t,function(){a+="&exclude_ids[]="+this}),n=$("#another_controller_type").val(),i=$("#another_object_id").val(),$.ajax({url:s,data:"utf8=\u2713&client_id="+e+a+"&select_type="+r+"&unlink_clients_flg="+c+"&another_controller_type="+n+"&another_object_id="+i})})},enable_associattion_search_tab_modal:function(e,r,l,c,d,u,_,h,p,f){$(document).off("click",e),$(document).on("click",e,function(){var e=$(this);if("1"!==e.attr("data-executing-eastm")){e.attr("data-executing-eastm","1");var t,n,i,a,s="",o="";t=$(u).val()?$(u).val():"","object"!=typeof(n=$(l).val())&&(n=n.split(",")),n&&jQuery.each(n,function(){s+="&exclude_ids[]="+this}),f&&(a="&destination="+f),sub_selected_ids=$(c).val(),"object"!=typeof sub_selected_ids&&(sub_selected_ids=sub_selected_ids.split(",")),sub_selected_ids&&jQuery.each(sub_selected_ids,function(){o+="&sub_exclude_ids[]="+this}),i=$("#mail_queue_mail_type").val()?$("#mail_queue_mail_type").val():"",$.ajax({url:r,method:void 0===p?"get":p,data:"utf8=\u2713&client_id="+t+s+o+"&select_type="+d+"&tab_show_flg="+_+"&unlink_clients_flg="+h+"&mail_type="+i+a}).always(function(){e.removeAttr("data-executing-eastm")})}})},departments_modal:function(t,n,i){$(document).off("click",t),$(document).on("click",t,function(){var e;e=$(i).val().split(","),$.ajax({url:n,data:{selected_ids:e,trigger_selector:t}})})},departments_modal_selection:function(e,i,a){$(document).off("click",e),$(document).on("click",e,function(){var e={},n=[];if(""!=$(i).val()&&(n=$(i).val().split(",")),$(".department-checked").each(function(){var t=$(this).val();e[t]=$(this).prop("checked"),1==$(this).prop("checked")?n.push(t):n=n.filter(function(e){return e!==t})}),n=n.filter(function(e,t,n){return n.indexOf(e)===t}),a!=undefined&&n.length>a)return alert($(this).data("overflow")),void $("#loading-list").hide();var t=[];$.ajax({type:"POST",url:"/xhr/departments_search/existence/",dataType:"json",data:{selected_departments:e,input_departments:$.map($("#departments").select2("data"),function(e){return e.id})},context:$(this)}).done(function(e){e.existence&&(t=e.department_ids),$(i).val(t).trigger("change"),$(i).select2("open"),$(i).select2("close"),$(this).closest(".modal").modal("hide")}).always(function(){$("#loading-list").remove()}).fail(function(e){console.log("fail",e.status)})})},lead_tags_modal:function(t,n,i,a,s,o){$(t).off("click"),$(t).on("click",function(){var e=$(n).val().split(",");$.ajax({type:"POST",url:i,data:{selected_ids:e,input_button_id:a,search_tags:$(t).hasClass("search_tags"),display_tags:$("#display_tags").val(),force_common_tag_limitation:s,use_in_modal:o}})})},lead_tags_modal_selection:function(a,s,o){$(document).off("click",a),$(document).on("click",a,function(){if($(a).prop("disabled",!0),""==$(o).val())var i=[];else i=$(o).val().split(",");var e=$("#selected_ids").val().split(",");$.ajax({type:"POST",url:"/xhr/business_card_lead_tags_search/existence/",dataType:"json",data:{selected_ids:e,selected_lead_tags:i},context:$(this)}).done(function(t){$.each(t.add_lead_tags,function(e,t){var n=t["private"]?'<i class="fa fa-lock"></i>':"";$(s).find(".select2-search-field").before('<li class="select2-search-choice" data-tag-id='+t.id+"><div>"+$("<div/>").text(t.text).html()+n+'</div><a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>'),i.push(t.id),$.unique(i)}),$.each(t.delete_tags_id,function(e,t){$(s+" .select2-search-choice").filter("[data-tag-id="+t+"]").remove()}),i=i.map(Number
).filter(function(e){return!t.delete_tags_id.includes(e)}),$(o).val(i),$(s).find("span").addClass("place-holder-hide");var n=[],e=$("#myModal").find(":input").serializeArray().every(function(e){return n.includes(e.name)&&"0"===e.value||""===e.value});$("#bulk_update").prop("disabled",e),$(this).closest(".modal").modal("hide"),$(a).prop("disabled",!1)}).fail(function(e){console.log("fail",e.status)})})},bulk_delete_lead_tags_modal:function(e,t){$(e).off("click"),$(e).on("click",function(){var e=[];$("#s2id_tags_modal ul.select2-choices").find("li.select2-search-choice").each(function(){e.push($(this).attr("data-tag-id"))}),$.ajax({type:"POST",url:t,data:{selected_ids:e.join().split(","),bulk_delete:!0,input_button_id:"lead_tag_selection_bulk_delete"}})})},bulk_delete_lead_tags_modal_selection:function(e){$(document).off("click",e),$(document).on("click",e,function(){var e=[];$("#s2id_tags_modal ul.select2-choices").find("li.select2-search-choice").each(function(){e.push($(this).attr("data-tag-id"))});var t=$("#selected_ids").val().split(",");$.ajax({type:"POST",url:"/xhr/business_card_lead_tags_search/bulk_delete_existence/",dataType:"json",data:{selected_ids:t,selected_lead_tag_ids:e.join().split(",")},context:$(this)}).done(function(e){$.each(e.add_lead_tags,function(e,t){var n=t["private"]?'<i class="fa fa-lock"></i>':"";$("#s2id_tags_modal .select2-search-field").before('<li class="select2-search-choice" data-tag-id='+t.id+"><div>"+$("<div/>").text(t.text).html()+n+'</div><a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>')}),0<$("#s2id_tags_modal .select2-choices").find("li.select2-search-choice").length?$(".modal-delete-tags").removeClass("disabled"):$(".modal-delete-tags").addClass("disabled"),$(this).closest(".modal").modal("hide")}).fail(function(e){console.log("fail",e.status)})})},xss_step:function(e){return e=(e=(e=(e=(e=e.replace(/&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/"/g,"&quot;")).replace(/'/g,"&#39;")},show_editor_tab:function(){var e=$("#text-body-tab"),t=$("#html-body-tab");e.show(),t.show();var n=$("#mail_queue_content_type").val()||"3";"1"===n?(e.tab("show"),t.hide()):"2"===n?(t.tab("show"),e.hide()):"3"===n&&t.tab("show")},show_editor_another_tab:function(){var e=$("#text-body-tab-another"),t=$("#html-body-tab-another");e.show(),t.show();var n=$("#mail_queue_content_type_another").val()||"3";"1"===n?(e.tab("show"),t.hide()):"2"===n?(t.tab("show"),e.hide()):"3"===n&&t.tab("show")},mail_editor_init:function(e){CKEDITOR.replace(e,{toolbar:[{name:"document",groups:["mode"],items:["Source"]},{name:"clipboard",groups:["undo"],items:["Undo","Redo"]},{name:"editing",items:["Find","Replace"]},{name:"basicstyles",items:["Bold","Underline","-","RemoveFormat"]},{name:"paragraph",items:["NumberedList","BulletedList","-","JustifyLeft","JustifyCenter","JustifyRight"]},{name:"links",items:["Link","Unlink"]},{name:"insert",items:["Image","Table","HorizontalRule"]},{name:"styles",items:["Format","FontSize"]},{name:"colors",items:["TextColor","BGColor"]}],enterMode:CKEDITOR.ENTER_BR,shiftEnterMode:CKEDITOR.ENTER_P,allowedContent:!0,removePlugins:"elementspath",filebrowserBrowseUrl:"",removeDialogTabs:"link:target;link:upload;link:advanced;image:Upload;image:advanced",image_previewText:" ",height:344,language:I18n.locale}),this.show_editor_tab(),this.show_editor_another_tab(),$("#mail_queue_content_type").on("change",this.show_editor_tab),$("#mail_queue_content_type_another").on("change",this.show_editor_another_tab),$("#form_send_mail").on("ajax:before.modal",function(){for(var e in CKEDITOR.instances)CKEDITOR.instances[e].updateElement()}),$("#modalSendMail").on("hidden.bs.modal",function(){$("#form_checked_leads,#js_form_change_action_mail_histories").off("ajax:before.modal"),$(".tooltip").tooltip("hide")})},mail_editor_read_only_mode_init:function(e){CKEDITOR.replace(e,{toolbar:[{name:"document",groups:["mode"],items:["Source"]}],enterMode:CKEDITOR.ENTER_BR,readOnly:!0,removePlugins:"elementspath",height:350,language:I18n.locale}),this.show_editor_tab()},number_with_delimiter:function(e){return e.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")},check_form_input:function(e,t,n,i){n=Array.isArray(n)?n:[];var a=$(e),s=$(t),o="change keyup";i&&(o="change"),a.on(o,function(){var e=a.find(":input").serializeArray().every(function(e){return n.includes(e.name)&&"0"===e.value||""===e.value.trim()});s.prop("disabled",e)})},tree_control_enable:function(e,t){void 0===t&&(t="#organizations_tree"),$(e+" .expand-tree").on("click",function(){return $(t).treeview("expandAll"),!1}),$(e+" .collapse-tree").on("click",function(){return $(t).treeview("expandAll",{levels:1}),!1}),$(document).on("click",".hp-tooltip.unassined-explain",function(){$(".tooltip").tooltip("hide")})},old_tree_control_enable:function(e,t){if(void 0===e)return!1;var n=t?"_in_customer_sheet":"";$("#old_org_tree_controls_old_org"+n+" .expand-tree").on("click",function(){return e.reduce(function(e,t){return e.then(function(){return $("#old_organization_tree"+n+"_"+t).treeview("expandAll")})},$.Deferred().resolve()),!1}),$("#old_org_tree_controls_old_org"+n+" .collapse-tree").on("click",function(){return $.each(e,function(e,t){$("#old_organization_tree"+n+"_"+t).treeview("collapseAll")}),!1})},tree_control_show_more:function(e){$(document).on("click",e+" .show-more",function(){$(e).find(".hidden-items").removeClass("hidden"),$(e).find(".show-less").removeClass("hidden"),$(e).find(".show-more").addClass("hidden"),$(e).treeview("showMore")}),$(document).on("click",e+" .show-less",function(){$(e).find(".hidden-items").addClass("hidden"),$(e).find(".show-less").addClass("hidden"),$(e).find(".show-more").removeClass("hidden"),$(e).treeview("showLess")})},set_float_table_header:function(e){if(!e)return{floatTheadOn:$.noop,floatTheadOff:$.noop};var t,n;t=$("div.navbar.navbar-fixed-top").outerHeight(),n=$(e);var i={floatTheadOn:function(){n.off("floatThead"),n.on("floatThead",function(e,t,n){t?n.addClass("floated"):n.removeClass("floated")}),n.floatThead({position:"absolute",top:t,zIndex:function(){return 999},responsiveContainer:function(e){return e.closest(".table-responsive")}})},floatTheadOff:function(){n.floatThead("destroy")}};return $("html,body").scrollLeft(0),i.floatTheadOn(),$(document).on("floatTableUpdate",function(){n.floatThead("reflow")}),i},attach_radio_toggle_handlers:function(e){var t=$(e),n=function(){var e=$(this);$(e.data("target")).show(),t.find("input[name='"+e.attr("name")+"']:radio").each(function(){$(this).attr("value")!=e.attr("value")&&$($(this).data("target")).hide()})};t.find("input[data-toggle='radio']:radio:checked").each(n),t.find("input[data-toggle='radio']:radio").change(n)},init_side_by_side_select_fields:function(e){var t=function n(){this.$context=$(e).find(".side-by-side-select-fields"),this.$selectedField=this.$context.find("[data-hp-role='selected']"),this.$unSelectedField=this.$context.find("[data-hp-role='un_selected']"),this.comboMove("right_btn",this.$selectedField,this.$unSelectedField),this.comboMove("left_btn",this.$unSelectedField,this.$selectedField)};return t.prototype={roleSelector:function(e){return"[data-hp-role='"+e+"']"},comboMove:function(t,n,i){this.$context.find(this.roleSelector(t)).on("click",function(){if("left_btn"==t){var e=i.data("maximum");if(null==e==0&&i.children().size()+n.find("option:selected").size()>e)return alert(I18n.t("js.common.max_exceeded")),!1}"left_btn"==t&&n.find("option:selected").each(function(){$(this).data("required-flg")===undefined?i.append($(this)):(html=$(this).html(),$(this).data("manual-required-flg")===undefined&&(html=html.replace(/$/," \uff0a")),i.append($(this).html(html))),"received_client_branch"===this.getAttribute("id")?(client_html=$("option#received_client").html(),$("option#received_client").data("manual-required-flg")===undefined&&-1==client_html.indexOf("\uff0a")&&(client_html=client_html.replace(/$/," \uff0a")),i.append($("option#received_client").html(client_html))):"failed_client_branch"===this.getAttribute("id")&&(client_html=$("option#failed_client").html(),$("option#failed_client").data("manual-required-flg")===undefined&&-1==client_html.indexOf("\uff0a")&&(client_html=client_html.replace(/$/," \uff0a")),i.append($("option#failed_client").html(client_html)))}),"right_btn"==t&&n.find("option:selected").each(function(){$(this).data("required-flg")===undefined?i.append($(this)):($(this).data("manual-required-flg")!==undefined&&$(this).data("manual-required-flg",!1),html=$(this).html().replace(" \uff0a",""),i.append($(this).html(html))),"received_client"===this.getAttribute("id")?(client_branch_html=$("option#received_client_branch").html(),client_branch_html=client_branch_html.replace(" \uff0a",""),i.append($("option#received_client_branch").html(client_branch_html))):"failed_client"===this.getAttribute("id")&&(client_branch_html=$("option#failed_client_branch").html(),client_branch_html=client_branch_html.replace(" \uff0a",""),i.append($("option#failed_client_branch").html(client_branch_html)))})})},comboMoveOne:function(e,n){var i=this.$selectedField;this.$context.find(this.roleSelector(e)).on("click",function(e){e.preventDefault();var t=i.find("option:selected");1<t.size()?alert(I18n.t("js.common.unchanged_items")):n(t)})},callSideBySideButton:function(){this.comboMoveOne("top_btn",function(e){e.prevAll().last().before(e)}),this.comboMoveOne("bottom_btn",function(e){e.nextAll().last().after(e)}),this.comboMoveOne("up_btn",function(e){e.prevAll().first().before(e)}),this.comboMoveOne("down_btn",function(e){e.nextAll().first().after(e)})},removeDuplicateValue:function(){var e=this;$.each(e.$selectedField.find("option"),function(){e.$unSelectedField.find("[value='"+$(this).val()+"']").remove()})},setOptions:function(n,e){n.empty(),$.each(e,function(e,t){jQuery("<option>",{value:t.id,text:t.text}).appendTo(n)}),this.removeDuplicateValue()},setSelectedValue:function(e){this.setOptions(this.$selectedField,e)},setUnSelectedValue:function(e){this.setOptions(this.$unSelectedField,e)},getSelectedValue:function(){return $.map(this.$selectedField.find("option"),function(e){var t=$(e);return{id:t.val(),text:t.text()}})}},new t(e)},search_area_with_tab:function(){$(".js-tab-search-type").off("click"),$(".js-tab-search-type").on("click",function(){if(!$(this).hasClass("active")){$(".js-tab-search-type").removeClass("active"),$(this).addClass("active"),$(".modal-search-area").css("display","none");var e=$(this).data("search-type");$("#"+e).css("display","block")}}),$(".modal-search-area").css("display","none");var e=$(".js-tab-search-type.active").data("search-type");$("#"+e).css("display","block")},set_tooltip:function(){$(".hp-tooltip").tooltip({container:"body",trigger:"hover"})},set_tooltip_route_link:function(){$(".hp-tooltip-route-link").tooltip({trigger:"hover"})},focus_to_first_element:function(){$(".js_focus_area").find('input[type=text]:visible:not(".datetimepicker"), input[type=number]:visible').eq(0).focus()},fetch_remote_list:function(e,t,n,i,a){var s=$(e),o=$(t);s.on({"ajax:beforeSend":function(){n&&n.abort(),a&&$(a).attr("disabled",!0),$(this).data("loading")&&o.html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:send":function(e,t){n=t},"ajax:error":function(){$(this).data("loading")&&o.html($('<div class="loadError"><span>'+I18n.t("js.application.load_error")+"</span></div>")),a&&$(a).attr("disabled",!1)},"ajax:complete":function(){$(this).data("loading")&&o.find(".loading").remove(),a&&$(a).attr("disabled",!1)}}),i&&s.trigger("submit.rails")},fetch_table_list:function(t,n,e){$(document).on("reload",t,function(){n&&n.abort();var e=$(t);n=$.ajax({type:"GET",url:e.data("remote-url"),dataType:"script",beforeSend:function(){e.html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))}}).fail(function(){e.html($('<div class="loadError"><span>'+I18n.t("js.application.load_error")+"</span></div>"))}).always(function(){e.find(".loading").remove()})}),e&&$(t).trigger("reload")},fetch_and_duplication_abort:function(e,n){$(document).on({"ajax:beforeSend":function(){n&&n.abort()},"ajax:send":function(e,t){n=t}},e)},ajax_post_once:function(e,n){$(document).on({"ajax:beforeSend":function(){return null==n||4===n.readyState},"ajax:send":function(e,t){n=t}},e)},ajax_error_message:function(){$(document).on("ajax:error",function(){$(".notifications").remove(),$("body").prepend('        <div class="notifications error">          <div class="notifications_icon">            <i class="fa fa-exclamation-triangle"></i>          </div>          <div class="notifications_comment">            '+I18n.t("js.common.communication_failed")+'          </div>          <div class="notifications_close">            <i class="fa fa-times close-btn"></i>          </div>        </div>');var e=($(window).width()-$(".notifications").width())/2;$(".notifications").animate({right:e},0),$(".notifications").animate({top:100,opacity:1},500),$(".close-btn").on("click",function(){$(this).parents(".notifications").remove()})})},load_objects:function(t){var e=$(".onload-disables");e.prop("disabled",!0),e.addClass("disabled"),e.css("pointer-events","none"),$(".all-check-loading").parent().prepend($("<div></div>",{id:"objects-loading","class":"contents-loading-head"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-lg loading"}))),rows=$("#loading-list-table").find($("table tbody tr")),rows.find("td").prepend($("<div></div>",{id:"objects-loading","class":"contents-loading"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-lg loading"}))),rowIndex=-1;var n=[];for(i=1;i<=parseInt($("#load_request_num").val())&&!(rows.length-1<i);i++){var a=function(){var e=new $.Deferred;return setTimeout(function(){t.load_split_index(e)},100*i),e.promise()}();n.push(a)}$.when.apply($,n).done(function(){e.prop("disabled",!1),e.removeClass("disabled"),e.css("pointer-events",""),$("div.contents-loading-head").remove(),rows.last().remove(),$(".hp-tooltip").not(".department-span").tooltip({container:"body",trigger:"hover",html:"true"}),$(".hp-tooltip.department-span").tooltip({container:"body",trigger:"hover"}),App.concerns.add_class_name_to_tooltip($(".department-span"),"department-tooltip")})},load_pictures:function(t,n){Index=-1,Pictures=$(".load_picture");var e=[];for(i=1;i<=parseInt($("#load_request_num").val())&&!(Pictures.length<i);i++){var a=function(){var e=new $.Deferred;return setTimeout(function(){t.load_split_show_picture(e,n)},100*i),e.promise()}();e.push(a)}$.when.apply($,e).done(function(){$(".js-lead-temp-picture-delete").off("click"),$(".js-lead-temp-picture-delete").on("click",function(){var e=$(this).data("entity"),t=$(this).parent().parent().parent().parent().attr("id").split("_")[0];if("select"==t)var n=$("#lead_temporary_business_card_id");else n=$("#"+t+"_temporary_business_card_id");var i=n.val();if(i){for(var a=i.split(","),s=a.length-1;0<=s;s--)a[s]==e&&a.splice(s,1);n.val(a.join(",")).trigger("change")}})})},create_mail_history_charts:function(e){this.create_sent_pie_chart(e),"true"==$("#sendgrid_open_tracking_flg").val()&&this.create_opened_pie_chart(e),"true"==$("#sendgrid_url_click_flg").val()&&this.create_url_clicked_pie_chart(e),this.set_pie_chart_details(),this.create_sent_error_bar_chart(e),this.create_unsubscribe_bar_chart(e)},create_sent_pie_chart:function(e){var t="sent-pie-chart-"+e,n="link-mail-sent-num-"+e,i="link-mail-unsent-num-"+e,a="text-mail-sent-num-"+e,s="text-mail-unsent-num-"+e,o=I18n.t("js.mail_histories.mail_sent"),r=Number($("#total-mail-sent-num-"+e).val()),l=Number($("#mail-sent-num-"+e).val()),c=r-l,d=o,u=I18n.t("js.mail_histories.mail_unsent");this.create_mail_history_pie_chart(t,o,r,l,c,d,u),this.set_pie_chart_links(n,a,l,d),this.set_pie_chart_links(i,s,c,u)},create_opened_pie_chart:function(e){var t="opened-pie-chart-"+e,n="link-mail-opened-num-"+e,i="link-mail-unopened-num-"+e,a="text-mail-opened-num-"+e,s="text-mail-unopened-num-"+e,o=I18n.t("js.mail_histories.mail_opened"),r=Number($("#mail-sent-num-"+e).val()),l=Number($("#mail-open-num-"+e).val()),c=r-l,d=o,u=I18n.t("js.mail_histories.mail_unopened");this.create_mail_history_pie_chart(t,o,r,l,c,d,u),this.set_pie_chart_links(n,a,l,d),this.set_pie_chart_links(i,s,c,u)},create_url_clicked_pie_chart:function(e){var t="url-clicked-pie-chart-"+e,n="link-mail-url-clicked-num-"+e,i="link-mail-url-unclicked-num-"+e,a="text-mail-url-clicked-num-"+e,s="text-mail-url-unclicked-num-"+e,o=I18n.t("js.mail_histories.url_clicked"),r=Number($("#mail-url-sent-num-"+e).val()),l=Number($("#mail-url-click-num-"+e).val()),c=r-l,d=I18n.t("js.mail_histories.clicked"),u=I18n.t("js.mail_histories.unclicked");this.create_mail_history_pie_chart(t,o,r,l,c,d,u),this.set_pie_chart_links(n,a,l,d),this.set_pie_chart_links(i,s,c,u)},create_sent_error_bar_chart:function(e){var t="sent-error-bar-chart-"+e,n="sent-error-percent-"+e,i="link-sent-error-num-"+e,a="title-sent-error-bar-chart-"+e,s=I18n.t("js.mail_histories.sent_error_num"),o=Number($("#total-mail-sent-num-"+e).val()),r=Number($("#mail-sent-error-num-"+e).val()),l=o-r;this.create_mail_history_bar_chart(t,r,l),this.set_bar_chart_links(a,s,i,n,o,r)},create_unsubscribe_bar_chart:function(e){var t="unsubscribe-bar-chart-"+e,n="unsubscribe-percent-"+e,i="link-unsubscribe-num-"+e,a="title-unsubscribe-bar-chart-"+e,s=I18n.t("js.mail_histories.unsubscribe_num"),o=Number($("#total-mail-sent-num-"+e).val()),r=Number($("#mail-unsubscribe-num-"+e).val()),l=o-r;this.create_mail_history_bar_chart(t,r,l),this.set_bar_chart_links(a,s,i,n,o,r)},create_mail_history_pie_chart:function(e,t,n,i,a,s,o){var r=0===n?0:Number((i/n*100).toFixed(1)),l=0===n?0:Number((100-r).toFixed(1));Highcharts.setOptions({colors:["#cc0000","#808080"]}),Highcharts.chart(e,{chart:{type:"pie",backgroundColor:"none",height:250},title:{text:t,y:30},subtitle:{text:r+"%<br>"+i+"/"+n+I18n.t("js.mail_histories.count"),verticalAlign:"middle",y:20,style:{fontSize:"35px"}},plotOptions:{pie:{size:"100%",innerSize:"78%",dataLabels:!1}},credits:{enabled:!1},series:[{data:[{name:s,title:t,body:"\u25cf ",y:r},{name:o,title:t,body:"\u25cf ",y:l}]}],tooltip:{formatter:function(){return this.point.name==s?"<b>"+this.point.title+'</b><br><span style="color:#cc0000;">'+this.point.body+"</span>"+this.point.name+"\uff1a"+Highcharts.numberFormat(this.y,1,".",","):"<b>"+this.point.title+'</b><br><span style="color:#808080;">'+this.point.body+"</span>"+this.point.name+"\uff1a"+Highcharts.numberFormat(this.y,1,".",",")}}})},create_mail_history_bar_chart:function(e,t,n){Highcharts.setOptions({colors:["#808080","#cc0000"]}),Highcharts.chart(e,{chart:{type:"bar",backgroundColor:"none",height:40},title:{style:{display:"none"}},plotOptions:{series:{stacking:"normal",pointWidth:10}},xAxis:{visible:!1},yAxis:{visible:!1},legend:{enabled:!1},credits:{enabled:!1},tooltip:{enabled:!1},series:[{data:[n]},{data:[t]}]})},set_pie_chart_links:function(e,t,n,i){$("#"+e).find("a").text(n),$("#"+t).text(i)},set_pie_chart_details:function(){$(".highcharts-subtitle").find('tspan:contains("/")').attr("dy","25")},set_bar_chart_links:function(e,t,n,i,a,s){$("#"+e).text(t),$("#"+n).find("a").text(s);var o=0===a?0:Number((s/a*100).toFixed(1));$("#"+i).text("("+String(o)+"%)")},set_mail_lead_link:function(){$(document).on("click",".mail_lead_link",function(e){e.preventDefault(),$("#target").val($(this).data("target")),$("#link_mail_queue_id").val($(this).data("mail-queue-id")),$("#form_mail_lead_link").submit(),$("#target").val(""),$("#link_mail_queue_id").val("")})},show_correspondence_history:function(){$(document).on("click","a.js_remote_history_btn",function(){$.ajax({url:$(this).data("href"),type:"GET"})})},create_mail_history_charts_record:function(e){this.create_sent_pie_chart_record(e),this.create_opened_pie_chart_record(e),this.create_url_clicked_pie_chart_record(e),this.set_pie_chart_details(e),this.create_sent_error_bar_chart_record(e),this.create_unsubscribe_bar_chart_record(e)},create_sent_pie_chart_record:function(e){var t="sent-pie-chart-"+e,n="link-mail-sent-num-"+e,i="link-mail-unsent-num-"+e,a="text-mail-sent-num-"+e,s="text-mail-unsent-num-"+e,o=I18n.t("js.mail_histories.mail_sent"),r=Number($("#total-mail-sent-num-"+e).val()),l=Number($("#mail-sent-num-"+e).val()),c=r-l,d=o,u=I18n.t("js.mail_histories.mail_unsent");this.create_mail_history_pie_chart(t,o,r,l,c,d,u),this.set_pie_chart_links(n,a,l,d),this.set_pie_chart_links(i,s,c,u)},create_opened_pie_chart_record:function(e){var t="opened-pie-chart-"+e,n="link-mail-opened-num-"+e,i="link-mail-unopened-num-"+e,a="text-mail-opened-num-"+e,s="text-mail-unopened-num-"+e,o=I18n.t("js.mail_histories.mail_opened"),r=Number($("#mail-sent-num-"+e).val()),l=Number($("#mail-open-num-"+e).val()),c=r-l,d=o,u=I18n.t("js.mail_histories.mail_unopened");this.create_mail_history_pie_chart(t,o,r,l,c,d,u),this.set_pie_chart_links(n,a,l,d),this.set_pie_chart_links(i,s,c,u)},create_url_clicked_pie_chart_record:function(e){var t="url-clicked-pie-chart-"+e,n="link-mail-url-clicked-num-"+e,i="link-mail-url-unclicked-num-"+e,a="text-mail-url-clicked-num-"+e,s="text-mail-url-unclicked-num-"+e,o=I18n.t("js.mail_histories.url_clicked"),r=Number($("#mail-sent-num-"+e).val()),l=Number($("#mail-url-click-num-"+e).val()),c=r-l,d=I18n.t("js.mail_histories.clicked"),u=I18n.t("js.mail_histories.unclicked");this.create_mail_history_pie_chart(t,o,r,l,c,d,u),this.set_pie_chart_links(n,a,l,d),this.set_pie_chart_links(i,s,c,u)},create_sent_error_bar_chart_record:function(e){var t="sent-error-bar-chart-"+e,n="sent-error-percent-"+e,i="link-sent-error-num-"+e,a="title-sent-error-bar-chart-"+e,s=I18n.t("js.mail_histories.sent_error_num"),o=Number($("#total-mail-sent-num-"+e).val()),r=Number($("#mail-sent-error-num-"+e).val()),l=o-r;this.create_mail_history_bar_chart(t,r,l),this.set_bar_chart_links(a,s,i,n,o,r)},create_unsubscribe_bar_chart_record:function(e){var t="unsubscribe-bar-chart-"+e,n="unsubscribe-percent-"+e,i="link-unsubscribe-num-"+e,a="title-unsubscribe-bar-chart-"+e,s=I18n.t("js.mail_histories.unsubscribe_num"),o=Number($("#total-mail-sent-num-"+e).val()),r=Number($("#mail-unsubscribe-num-"+e).val()),l=o-r;this.create_mail_history_bar_chart(t,r,l),this.set_bar_chart_links(a,s,i,n,o,r)},create_automatically_save:function(u,_,h,p,f,m){function e(){try{if(null==window.localStorage||"undefined"==typeof window.localStorage)return}catch(d){return}var e=$(m);if(e.length){var t=e.serializeArray(),n=JSON.stringify(t),i=btoa(encodeURIComponent(n)),a=[];localStorage.getItem(u)&&(a=JSON.parse(localStorage.getItem(u)));var s={timestamp:$.now(),user_id:_,edit_id:h,business_activity_id:p,business_activities_lead_id:f,data:i},o=!1,r=!1;if(u.match(/edit/)){for(var l=0;l<a.length;l++)if(_==a[l].user_id&&h==a[l].edit_id&&null==f||_==a[l].user_id&&p==a[l].business_activity_id&&f==a[l].business_activities_lead_id&&null==h){if(null==(c=a[l].data)||i!=c){a[l]=s,o=!(r=!0);break}o=!1}else l<5&&(o=!0);!o&&a.length||(o&&5<=a.length&&a.shift(),a.push(s),r=!0)}else{if(a[0])var c=a[0].data;null!=c&&i==c||((a=[]).push(s),r=!0)}if(r)try{localStorage.setItem(u,JSON.stringify(a))}catch(d){"QuotaExceededError"!==d.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==d.name||(localStorage.removeItem("auto_saved_daily_reports_new"),localStorage.removeItem("auto_saved_daily_reports_edit"),localStorage.removeItem("auto_saved_deals_new"),localStorage.removeItem("auto_saved_deals_edit"),localStorage.removeItem("auto_saved_inside_sales_new"),localStorage.removeItem("auto_saved_inside_sales_edit"))}}}var t=null;clearInterval($("#interval_id").val()),t=setInterval(e,3e4),$("#interval_id").val(t)},restore_automatically_save:function(e,t,n,i,a,s){if(!$(s).data("auto_save_set_flg")){$(s).data("auto_save_set_flg",!0);try{if(null==window.localStorage||"undefined"==typeof window.localStorage)return}catch(O){return}var o=[],r=[],l=[];localStorage.getItem(e)&&(o=JSON.parse(localStorage.getItem(e)));var c=!1;if($("body").find(".js_item_file_field").length)var d=I18n.t("js.application.confirm_backup_include_file");else d=I18n.t("js.application.confirm_backup");for(var u=0;u<o.length;u++)if(t==o[u].user_id&&n==o[u].edit_id&&null==a||t==o[u].user_id&&i==o[u].business_activity_id&&a==o[u].business_activities_lead_id&&null==n){if(o[u].timestamp>$.now()-1728e5){var _=decodeURIComponent(atob(o[u].data)),h=JSON.parse(_);(c=confirm(d))||l.push(u);break}l.push(u)}for(var p=0;p<o.length;p++)-1!=l.indexOf(p)&&1!=c||r.push(o[p]);if(0==c)return localStorage.setItem(e,JSON.stringify(r)),!1;$(s+" input:checkbox").not("[id^=deal_deals_details_attributes]").not("[id^=deals_details_box_]").not("#all-check").prop("checked",!1),$('input[type="radio"]').filter("[id^=item_values_]").prop("checked",!1);var f=0,m=0,g=0,A=0,v=0,b=[],y=[],w=[],k=$("#lead_select_item_ids").val()||[];k.length&&(k=k.split(" "));for(var C=0;C<h.length;C++){var E=h[C],T=E.name,x=E.value;if("utf8"!==T&&"authenticity_token"!==T&&"display_template_id"!==T&&"deals_details_box[]"!==T&&"all-check"!==T&&!T.match(/deal\[deals_details_attributes\]/)){var I=$('[name="'+T+'"]').not("#client_sale_approach_id");for(u=0;u<document.getElementsByName(T).length;u++)if("radio"===document.getElementsByName(T)[u].type||"checkbox"===document.getElementsByName(T)[u].type){if("daily_report[superior_confirmation_flg]"==T||"daily_report[next_accompany_flg]"==T||"deal[send_email_on_update_flg]"==T)continue;$(I[u]).val()===x&&$(I[u]).prop("checked",!0)}else I.val(x).trigger("change").blur();"temporary_business_card_for_client_id"===T&&($("#client_temporary_business_card_id").val(x),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit()),"temporary_business_card_for_lead_ids"===T&&($("#lead_temporary_business_card_id").val(x),$("#temporary_business_card_item_id").val(""),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit()),k.length&&$.each(k,function(e,t){T==="item_values[temporary_business_card_for_"+t+"]"&&($("#"+t+"_temporary_business_card_id").val(x),$("#temporary_business_card_item_id").val(t),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit())}),"edit_deal_flg"===T&&$("#check_edit_deal_flg").prop("checked","1"===x),"daily_report[next_accompany_flg]"===T&&2==++f&&$("#daily_report_next_accompany_flg").prop("checked","1"===x),"daily_report[superior_confirmation_flg]"===T&&2==++m&&$("#daily_report_superior_confirmation_flg").prop("checked","1"===x),"deal[send_email_on_update_flg]"===T&&2==++g&&$("#deal_send_email_on_update_flg").prop("checked",!0),"daily_report[deal_amount_flg]"===T&&(A++,$("#daily_report_deal_amount_flg").prop("checked",2==A)),"next_action_kbn_ids[]"===T&&b.push(x),"next_support_kbn_ids[]"===T&&y.push(x),"confirmation_role_ids[]"===T&&w.push(x),"daily_report[client_branch_id]"!==T&&"deal[client_branch_id]"!==T||(v=x,$("#form_search_xhr_client_branches_select_options > #client_branch_id").val(x),$("#js_form_client_branches_custom > #client_branch_id").val(x),$("#form_search_xhr_client_branches_select_options").submit(),$("#client_branch_block").trigger("change")),"daily_report[client_id]"!==T&&"deal[client_id]"!==T||0!=v&&($("#form_search_xhr_client_branches_select_options > #client_branch_id").val(v),$("#js_form_client_branches_custom > #client_branch_id").val(v),$("#form_search_xhr_client_branches_select_options").submit(),$("#client_branch_block").trigger("change"))}}$("#next_action_kbn_ids").val(b),$("#next_action_kbn_ids").select2({width:"100%"}),$("#next_support_kbn_ids").val(y),$("#next_support_kbn_ids").select2({width:"100%"}),$("#confirmation_role_ids").val(w),$("#confirmation_role_ids").select2({width:"100%"});for(u=0;u<$(s+' input[data-multiple="true"]').length;u++){var D=$("#"+$('input[data-multiple="true"]')[u].id);D.select2("val",D.val().split()).trigger("change")}}},destroy_automatically_save:function(e,t,n,i,a){try{if(null==window.localStorage||"undefined"==typeof window.localStorage)return}catch(l){return}var s=[],o=[];localStorage.getItem(e)&&(s=JSON.parse(localStorage.getItem(e)));for(var r=0;r<s.length;r++)t==s[r].user_id&&n==s[r].edit_id&&null==a||t==s[r].user_id&&i==s[r].business_activity_id&&a==s[r].business_activities_lead_id&&null==n||o.push(s[r]);localStorage.setItem(e,JSON.stringify(o))},formatDate:function(e,t,n){return t=(t=(t=(t=(t=(t=(t=(t=t.replace(/yyyy/g,e.getFullYear())).replace(/MM/g,("0"+(e.getMonth()+1)).slice(-2))).replace(/dd/g,("0"+e.getDate()).slice(-2))).replace(/HH/g,("0"+e.getHours()).slice(-2))).replace(/mm/g,("0"+e.getMinutes()).slice(-2))).replace(/ss/g,("0"+e.getSeconds()).slice(-2))).replace(/SSS/g,("00"+e.getMilliseconds()).slice(-3))).replace(/\(aaa\)/g,"("+n[e.getDay()]+")")},mail_type_select_modal_submit:function(t){$("#mass-mail-all-link, #ab-mail-all-link, #each-mail-all-link").on("click",function(){if($(this).hasClass("submited"))return!1;$(".btn-group.open").removeClass("open"),$(".modal-caller, .seminar_tab_label, #edit_menu").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none");var e=App.concerns.set_form_action(t,$(this).data("action"),$(this).data("remote"));return e.attr("method",$(this).data("method")),$("#all_lead_ids").prop("disabled",!1),e.size()?(e.hasClass("do_not_submit")||(e.submit(),$("#mass-mail-all-link, #ab-mail-all-link, #each-mail-all-link").addClass("submited")),!1):void 0}),$("#mass-mail-select-link, #ab-mail-select-link, #each-mail-select-link").on("click",function(){if($(this).hasClass("submited"))return!1;$(".btn-group.open").removeClass("open"),$(".modal-caller, .seminar_tab_label, #edit_menu").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none");var e=App.concerns.set_form_action(t,$(this).data("action"),$(this).data("remote"));return e.attr("method",$(this).data("method")),$("#all_lead_ids").prop("disabled",!0),e.size()?(e.hasClass("do_not_submit")||(e.submit(),$("#mass-mail-select-link, #ab-mail-select-link, #each-mail-select-link").addClass("submited")),!1):void 0}),$("#mail-types-all-leads-modal, #mail-types-checked-leads-modal").on("hidden.bs.modal",function(){$("#mass-mail-select-link, #ab-mail-select-link, #each-mail-select-link").removeClass("submited"),$("#mass-mail-all-link, #ab-mail-all-link, #each-mail-all-link").removeClass("submited")})},change_action_checked_mass_mail:function(e){$("#mass-mail-select-link").data($(e).data("massMailAction"))},change_action_checked_all_mass_mail:function(e){$("#mass-mail-all-link").data($(e).data("massMailAction"))},adjustment_modal_z_index:function(t){var n=1;$(document).on("show.bs.modal",t,function(e){"bs.modal"==e.namespace&&(modals_z_index=$.map($(".modal"),function(e){return"block"==$(e).css("display")?Number($(e).css("z-index")):null}),modals_z_index.length&&(max_z_index=Math.max.apply(null,modals_z_index),$(t).css("z-index",max_z_index+n+1),setTimeout(function(){$(".modal-backdrop").last().css("z-index",max_z_index+n)},0)))})},buildNoticeHtml:function(e,t){var n="";return e.forEach(function(e){n+='<li style="word-wrap: break-word;">'+e+"</li>"}),'<div class="row">  <div class="col-xs-12">    <div class="alert alert-'+t+' alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">&times;</span>      </button>      <ul>'+n+"      </ul>    </div>  </div></div>"},set_associate_decision_for_another_controller:function(n,i,a){"single"==$("#select_type").val()&&$("button.decision").on("click",function(){var e=[];e.push($(this).data().hpEntityId);var t={another_controller_type:$("#another_controller_type").val(),another_object_id:$("#another_object_id").val(),another_children_ids:$("#another_children_ids").val()};t[n]=e,$.ajax({url:i,type:"POST",dataType:"json",data:t,context:$(this)}).done(function(e){if(e.error_flg)return alert(e.error_message),!1;$("div#js_error_message").html(""),e.success&&e.success.length&&App.concerns.display_notice_message(e.success,!1),e.failed&&e.failed.length&&App.concerns.display_notice_message(e.failed,!0),a&&a(),$(this).closest(".modal").modal("hide"),location.reload()})})},display_notice_message:function(e,t,n){var i="";$.each(e,function(e,t){i+='<li style="word-wrap: break-word;">'+t+"</li>"});var a=t?"danger":"success";n&&$("div#js_error_message").html(""),$("div#js_error_message").append(
'      <div class="row">        <div class="col-xs-12">          <div class="alert alert-'+a+' alert-error alert-dismissible" role="alert">            <button type="button" class="close" data-dismiss="alert" aria-label="Close">              <span aria-hidden="true">&times;</span>            </button>            <ul>'+i+"</ul>          </div>        </div>      </div>")},clipboard_copy:function(n){$(n).on("click",function(){var e=$(n).data("value"),t=$("<textarea></textarea>");t.text(e),$(n).append(t),t.select(),document.execCommand("copy"),t.remove()})},merge_resources:function(n,e){function i(){$(n).find('[name="ids[]"]').remove(),$(".form-checked-resources .check-items:checked").each(function(e,t){$("<input>").attr({type:"hidden",name:"ids[]",value:$(t).val()}).appendTo(n)})}function a(){return"lead"===e}function s(){return"client"===e}$(".js_alternative_attr_merge_resources_button").on("click",function(e){var t;return e.preventDefault(),$(".js_alternative_attr_merge_resources_button").addClass("disabled"),$(".js_alternative_attr_merge_resources_button").tooltip("hide"),i(),a()?t="/leads/alternative_attr/":s()&&(t="/clients/alternative_attr/"),$(n).attr("method","GET"),$(n).data("remote","true"),$(n).attr("action",t).submit(),setTimeout(function(){$(".js_alternative_attr_merge_resources_button").removeClass("disabled")},2e3),!1})},add_class_for_table_bottom_text:function(){text=$(".table-bottom-text"),text.length&&$(".table").addClass("bottom-text")},set_tooltip_to_select_search_client:function(a){var e=$("#"+a);e.on("select2-loaded",function(){$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"}),$(".icon-address-company-url").hover(function(){var e=$(this).offset().top;""!=document.body.style.top&&(e=$(this).offset().top-parseInt(document.body.style.top));var t=$("#global_notification").height();1<t&&(e-=t),181<$(".gloval-menu.navbar.navbar-inverse.navbar-fixed-top").height()&&(e-=116);var n=e-85,i=$(this).offset().left-65;("business_card_client_id"==a&&0==$("#simplyFormModalContainer").hasClass("in")||($("#form_company_address_url").hasClass("form")||$("#form_client_branch_company_address_url").hasClass("form"))&&("lead_client_id"==a||"client_branch_client_id"==a||"task_client_id"==a))&&(n=e-145),!$("#form_company_address_url").hasClass("form")||"daily_report_client_id"!=a&&"deal_client_id"!=a||"index"==$("body").data("action_name")||(n=e-193),"search_client_ids"==a&&$("#search_client_ids").hasClass("seminars_leads")&&(n=e-745),($("#form_company_address_url").hasClass("form")||$("#form_client_branch_company_address_url").hasClass("form"))&&"client_branch_client_id"==a&&("front/business_cards"!=$("body").data("controller_name")&&"front/leads"!=$("body").data("controller_name")||(n=e-145,"index"==$("body").data("action_name")&&(n=e-85)),"front/daily_reports"!=$("body").data("controller_name")&&"front/deals"!=$("body").data("controller_name")||(n=e-193,"show"==$("body").data("action_name")&&(n=e-85)),"front/clients"==$("body").data("controller_name")&&(n=e-85)),"favorite_client_ids"==a&&(n=e-145,i=$("#form_company_address_url").hasClass("mypage-favorite-client-ids")?$(this).offset().left-$("#favorite_client_ids").offset().left-300:$(this).offset().left-105),$("#form_company_address_url").hasClass("form")&&"search_client_id_on_search_association_modal"==a&&(n=e+105),1==$("#search-associated-resources-modal").hasClass("in")&&$("#form_company_address_url").hasClass("form")&&"task_client_id"==a&&(n=e+20),1!=$("#search-associated-resources-modal").hasClass("in")||!$("#form_company_address_url").hasClass("form")||"front/daily_reports"!=$("body").data("controller_name")&&"front/deals"!=$("body").data("controller_name")||"search_client_id_on_search_association_modal"!=a&&"client_branch_client_id"!=a||"new"!=$("body").data("action_name")&&"edit"!=$("body").data("action_name")||(n=e-190),1!=$("#search-associated-resources-modal").hasClass("in")||!$("#form_company_address_url").hasClass("form")||"front/tasks"!=$("body").data("controller_name")||"search_client_id_on_search_association_modal"!=a||"new"!=$("body").data("action_name")&&"edit"!=$("body").data("action_name")||(n=e-145),1!=$("#search-associated-resources-modal").hasClass("in")||!$("#form_company_address_url").hasClass("form")||"front/deals"!=$("body").data("controller_name")||"search_client_id_on_search_association_modal"!=a||"new"!=$("body").data("action_name")&&"edit"!=$("body").data("action_name")||(n=e-185),"en"==$("body").data("language")&&(i=$(this).offset().left-85,"favorite_client_ids"==a&&(n=e-145,i=$("#form_company_address_url").hasClass("mypage-favorite-client-ids")?$(this).offset().left-405:$(this).offset().left-140)),"front/client_branches"==$("body").data("controller_name")&&"index"!=$("body").data("action_name")?($(".client-branch-company-address-url").show(),$(".client-branch-company-address-url").css({top:n,left:i,"z-index":999999}),$("#client_branch_company_address_url_link").attr("href",$(this).attr("data-url")),$(".client-branch-company-address-url").mouseleave(function(){$(".client-branch-company-address-url").hide()})):($(".company-address-url").show(),$(".company-address-url").css({top:n,left:i,"z-index":999999}),$("#company_address_url_link").attr("href",$(this).attr("data-url")),$(".company-address-url").mouseleave(function(){$(".company-address-url").hide()}))})}),1<$(".company-address-url").length&&$("#form_company_address_url").remove(),1<$(".client-branch-company-address-url").length&&$("#form_client_branch_company_address_url").remove(),e.on("select2-selecting",function(){$(".tooltip").tooltip("hide")}),$(".select2-input").on("keyup",function(){$(".company-address-url").hide()}),$(".select2-input").on("keyup",function(){$(".client-branch-company-address-url").hide()}),$(".select2-input").on("keydown",function(){$(".company-address-url").hide()}),$(".select2-input").on("keydown",function(){$(".client-branch-company-address-url").hide()})},set_tooltip_to_select_search_client_branch:function(a){var e=$("#"+a);e.on("select2-loaded",function(){$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"}),$(".icon-address-branch-url").hover(function(){var e=$(this).offset().top;""!=document.body.style.top&&(e=$(this).offset().top-parseInt(document.body.style.top));var t=$("#global_notification").height();1<t&&(e-=t),181<$(".gloval-menu.navbar.navbar-inverse.navbar-fixed-top").height()&&(e-=116);var n=e-85,i=$(this).offset().left-65;("business_card_client_branch_id"==a&&0==$("#simplyFormModalContainer").hasClass("in")||$("#form_company_address_url").hasClass("form")&&("lead_client_branch_id"==a||"task_client_id"==a))&&(n=e-145),$("#form_company_address_url").hasClass("form")&&"modal_client_branch_id"==a&&(n=e-195),!$("#form_company_address_url").hasClass("form")||"daily_report_client_branch_id"!=a&&"deal_client_branch_id"!=a||(n=e-193),$("#form_company_address_url").hasClass("form")&&"search_client_id_on_search_association_modal"==a&&(n=e+105),1==$("#search-associated-resources-modal").hasClass("in")&&$("#form_company_address_url").hasClass("form")&&"task_client_id"==a&&(n=e+20),1!=$("#search-associated-resources-modal").hasClass("in")||!$("#form_company_address_url").hasClass("form")||"front/daily_reports"!=$("body").data("controller_name")&&"front/deals"!=$("body").data("controller_name")||"search_client_id_on_search_association_modal"!=a||"new"!=$("body").data("action_name")&&"edit"!=$("body").data("action_name")||(n=e-190),1!=$("#search-associated-resources-modal").hasClass("in")||!$("#form_company_address_url").hasClass("form")||"front/tasks"!=$("body").data("controller_name")||"search_client_id_on_search_association_modal"!=a||"new"!=$("body").data("action_name")&&"edit"!=$("body").data("action_name")||(n=e-145),1!=$("#search-associated-resources-modal").hasClass("in")||!$("#form_company_address_url").hasClass("form")||"front/deals"!=$("body").data("controller_name")||"search_client_id_on_search_association_modal"!=a||"new"!=$("body").data("action_name")&&"edit"!=$("body").data("action_name")||(n=e-185),"en"==$("body").data("language")&&(i=$(this).offset().left-85,"favorite_client_ids"==a&&(n=e-145,i=$("#form_company_address_url").hasClass("mypage-favorite-client-ids")?$(this).offset().left-405:$(this).offset().left-140)),$(".company-address-url").show(),$(".company-address-url").css({top:n,left:i,"z-index":999999}),$("#company_address_url_link").attr("href",$(this).attr("data-url")),$(".company-address-url").mouseleave(function(){$(".company-address-url").hide()})})}),1<$(".company-address-url").length&&$("#form_company_address_url").remove(),e.on("select2-selecting",function(){$(".tooltip").tooltip("hide")}),$(".select2-input").on("keyup",function(){$(".company-address-url").hide()}),$(".select2-input").on("keydown",function(){$(".company-address-url").hide()})},add_class_name_to_tooltip:function(e,n){e.tooltip().each(function(e,t){$(t).data("bs.tooltip").tip().addClass(n)})},select_search_product_items:function(){var e=$("#js_display_detail_master_params").find("option"),_=[{id:"",text:I18n.t("js.display_templates.prompt_items_select")}];e.toArray().forEach(function(e){_.push({id:e.value,text:e.text.replace("\uff0a","")})});var a=_.map(function(e){return e.id});$.each(["detail_master_filter_1","detail_master_filter_2","detail_master_filter_3","detail_master_item_sort"],function(e,t){var n="#"+t,i=Array.from(_);"#detail_master_item_sort"==n&&(i=i.filter(function(e){return!/\d/.test(e.id)})),$(n).select2({data:i,placeholder:$(n).data("prompt")}),$("#s2id_"+t).children().find("span")[0]==undefined||a.includes($(n).val())||($("#s2id_"+t).children().find("span")[0].innerHTML=I18n.t("js.display_templates.prompt_items_select"),$("#input-"+t).html(""),$(n).val(""))}),$("#detail_master_filter_1, #detail_master_filter_2, #detail_master_filter_3").on("change",function(){$("#detail_master_filter_1, #detail_master_filter_2, #detail_master_filter_3").trigger("select2:select")}),$("#detail_master_filter_1, #detail_master_filter_2, #detail_master_filter_3").on("select2:select",function(){var e=Array.from(_),t=Array.from(_),n=Array.from(_),i=$("#detail_master_filter_1").val(),a=$("#detail_master_filter_2").val(),s=$("#detail_master_filter_3").val(),o=e.findIndex(function(e){return e.id==a});0!=o&&e.splice(o,1);var r=e.findIndex(function(e){return e.id==s});0!=r&&e.splice(r,1);var l=t.findIndex(function(e){return e.id==i});0!=l&&t.splice(l,1);var c=t.findIndex(function(e){return e.id==s});0!=c&&t.splice(c,1);var d=n.findIndex(function(e){return e.id==i});0!=d&&n.splice(d,1);var u=n.findIndex(function(e){return e.id==a});0!=u&&n.splice(u,1),$("#detail_master_filter_1").select2({data:e}),$("#detail_master_filter_2").select2({data:t}),$("#detail_master_filter_3").select2({data:n})})},show_modal_simple_business_card:function(e,t,n){var i="#"+e;$(document).off("click",i),$(document).on("click",i,function(e){e.preventDefault(),$(i).css("pointer-events","none"),$(this).one("load_modal",function(){var e=$("#new_business_card");input_lead_object=$("#"+t),App.front_business_cards.attach_simply_business_card_form_button_event(e,input_lead_object,n),App.concerns.search_zip_code(),App.concerns.set_client_value_from_form_to_modal_business_card(n),App.concerns.select_search_name("business_card_client_id"),App.front_business_card_lead_tags.init_suggest("s2id_tags-on-modal","my-tag-dropdown-on-modal"),App.concerns.set_tooltip_to_select_search_client("business_card_client_id"),$("#form_search_xhr_organizations_select_options").submit(),App.front_business_cards.change_client(),App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("#new_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-on-modal","#business_card_tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection","",!0),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags-on-modal","#business_card_tags"),App.concerns.set_tooltip()}),App.front_business_cards.modal_open($(this),$("#simplyFormModalContainer"),!0,i)})},set_client_value_from_form_to_modal_business_card:function(e){if(e){var t=$("#"+e).val();t&&$("#business_card_client_id").val(t).trigger("change")}},toggle_print_target:function(){$("#print_mode_input").change(function(){App.concerns.save_print_mode(this.checked),App.concerns.toggle_show_hide_print_mode(this.checked)})},toggle_show_hide_print_mode:function(e){e?$(".print-target-element").addClass("display-none-print"):$(".print-target-element").removeClass("display-none-print")},save_print_mode:function(n){$.ajax({type:"post",url:"/xhr/print_mode/save",data:{enable_print_mode:n},success:function(){},error:function(e){var t=[I18n.t("js.common.alert_save_print_mode_failed")];App.concerns.display_notice_message(t,!0,!0),$("#print_mode_input").prop("checked",!n),App.concerns.toggle_show_hide_print_mode(!n),console.error(e)}})},show_print_mode:function(){$.ajax({type:"get",url:"/xhr/print_mode/show",success:function(e){console.log(e)},error:function(e){console.error(e)}})}},App.front_abms={index:function(){form_id="form_search_abms",App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_abms",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("abms"),App.concerns.get_modal_to_search_save("#"+form_id),App.concerns.get_modal_to_search_call("#"+form_id),App.concerns.change_search_type(),App.concerns.prevent_submit_pressing_enter(),App.concerns.change_display_number(form_id),App.concerns.change_order(form_id),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search("search_target_list_ids"),App.concerns.set_associate_entities_to_s2("#target_lists_multiple_decision","#search_target_list_ids",'input[name="associate_target_lists[]"]',"target_lists"),App.concerns.enable_associattion_search_modal("#open_target_list","/xhr/target_lists/search_as_association_modal","#search_target_list_ids","multiple"),App.concerns.select_search_disable_user("search_lead_owner_user_ids"),$("#open_lead_owner_user_ids").on("click",function(){App.front_users.get_modal_to_search_users($(this).data("css-selector"),$(this).data("search-type"),!0,!0)}),App.concerns.select_search_disable_user("search_client_owner_user_ids"),$("#open_client_owner_user_ids").on("click",function(){App.front_users.get_modal_to_search_users($(this).data("css-selector"),$(this).data("search-type"),!0,!0)}),$("#search_business_category_kbn").select2(),$("#search_industry_kbn").select2(),$("#search_worker_number_kbn").select2(),$("#search_capital_kbn").select2(),$("#search_ipo_kbn").select2(),$("#search_middle_business_categories").select2(),App.front_clients.init_middle_business_category("search_middle_business_categories"),App.concerns.select_search("search_client_id"),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids",null,null,null,!0),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),App.concerns.all_checked_items(),App.concerns.enable_csv_export_event("#"+form_id,"checked[client_ids][]"),App.concerns.set_form_action_to_submit("#form_checked_abms","#link_exclure_ip_creates",!0),App.searches.callForSearchCondition.init(),App.concerns.set_form_action_to_submit("#form_checked_abms",".checked_submit",!0),App.tooltip.display_tooltip(),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")}},App.front_analyses={index:function(){this.set_data_setting_modal_event(),$("#js_data_setting").on("click",function(){$(this).prop("disabled",!0);var n=[];$('.report_items:visible input[name="check_items[]"]:checked').each(function(e,t){return n.push(t.id)});var e={name:$('input[name="analysis[name]"]').val(),selected_object:$('input[name="analysis[selected_object]"]:checked').val(),date_type:$('[name="analysis[select_date_type]"]').val(),start_date:$('input[name="analysis[start_date]"]').val(),end_date:$('input[name="analysis[end_date]"]').val(),check_items:n.join()};$.ajax({url:"/analyses/data_setting",type:"POST",dataType:"json",data:{analysis:e}}).success(function(){var n=[];$('.report_items:visible input[name="check_items[]"]:checked').each(function(e,t){return n.push(t.id)}),window.location.href="/analyses/new?name="+e.name+"&analysis_selected_object="+e.selected_object+"&analysis_date_type="+e.date_type+"&analysis_start_date="+e.start_date+"&analysis_end_date="+e.end_date+"&check_items="+n}).error(function(e){$("#form_data_setting").find("#modal_message").html(App.concerns.buildNoticeHtml(e.responseJSON.messages,"danger"))})}),App.concerns.disable_buttons_submit_custom(".js-disable-btn","#btn-clear-form"),App.concerns.disable_duplicate_request_search_form("#search_front_analyses",".js-disable-btn"),$(".report_items").on("change",function(){App.front_analyses.limit_check_items()})},"new":function(){this.load_grid_table(),this.set_graph_button(),$(".report_items").on("change",function(){App.front_analyses.limit_check_items()})},edit:function(){this.load_grid_table(),this.set_graph_button(),$(".report_items").on("change",function(){App.front_analyses.limit_check_items()})},update:function(){this.load_grid_table(),this.set_graph_button(),$(".report_items").on("change",function(){App.front_analyses.limit_check_items()})},create:function(){this.load_grid_table(),this.set_graph_button(),$(".report_items").on("change",function(){App.front_analyses.limit_check_items()})},show:function(){this.load_grid_table(!0)},set_graph_button:function(){$(".show_graph").off(),$(".show_graph").on("click",function(){$("#myChart").show(),$(".show_graph").hide(),$(".hidden_graph").show(),$(".analysis-table").height("108vh"),$(".analysis-table").css("min-height","525px"),$("#analysis_show_graph_flg").val(!0)}),$(".create_graph").tooltip("enable"),$(".hidden_graph").off(),$(".hidden_graph").on("click",function(){$("#myChart").hide(),$(".hidden_graph").hide(),$(".show_graph").show(),$(".analysis-table").height("72vh"),$(".analysis-table").css("min-height","350px"),$("#analysis_show_graph_flg").val(!1)}),"true"==$("#analysis_show_graph_flg").val()&&($("#myChart").show(),$(".show_graph").hide(),$(".hidden_graph").show(),$(".analysis-table").height("144vh"),$("#analysis_show_graph_flg").val(!0))},show_graph:function(){"true"==$("#analysis_show_graph_flg").val()&&($("#myChart").show(),$(".analysis-show-table").height("123vh"),$(".analysis-show-table").css("min-height","525px"))},load_grid_table:function(e){var t=this.show_grid_table();t.showLoadingOverlay(),$("#gridTableArea").show(),this.select_data_source(),$("#analysis_selected_object").val()&&$.ajax({url:"/analyses/get_table_data",type:"POST",dataType:"script",data:{analysis_selected_object:$("#analysis_selected_object").val(),analysis_date_type:$("#analysis_date_type").val(),analysis_start_date:$("#analysis_start_date").val(),analysis_end_date:$("#analysis_end_date").val(),analysis_check_items:$("#analysis_check_items").val()}}).done(function(){t=App.front_analyses.show_grid_table(!0),App.front_analyses.restore_state_grid_table(t,""),e&&(t.closeToolPanel(),$(document).on("click","#export_analysis_as_excel",function(){t.exportDataAsExcel({fileName:"analyses",sheetName:"analyses"})}),App.front_analyses.show_graph())}),this.set_data_setting_modal_event(),$(document).on("click",".ag-menu-option-part.ag-menu-option-text",function(){$(".ag-panel.ag-default-panel.ag-dialog.ag-ltr.ag-popup-child.ag-focus-managed")&&$(".ag-panel-title-bar-title.ag-default-panel-title-bar-title").text("\u5217\u306e\u9078\u629e")})},submit_new:function(t){$(".new_analysis").keypress(function(e){13===e.keyCode&&App.front_analyses.save_state_grid_table(t)}),$("#new_submit").off(),$("#new_submit").on("click",function(){App.front_analyses.save_state_grid_table(t),$(this).attr("disabled",!0),$("form.new_analysis").submit()})},submit_edit:function(t){$(".edit_analysis").keypress(function(e){13===e.keyCode&&App.front_analyses.save_state_grid_table(t)}),$("#edit_submit").off(),$("#edit_submit").on("click",function(){App.front_analyses.save_state_grid_table(t),$("form.edit_analysis").submit()})},show_grid_table:function(e,t){function n(){var e=i.getToolPanelInstance("columns");e&&e.setPivotModeSectionVisible(!1),$(".ag-column-select-header").hide(),$(".ag-filter-toolpanel-search").hide()}if(t||(t=""),document.getElementById("table_data"+t).value){var i,a=JSON.parse(document.getElementById("table_data"+t).value);switch(e||($(".hidden_graph").trigger("click"),$("#myChart").empty()),agGrid.LicenseManager.setLicenseKey("Using_this_{AG_Charts_and_AG_Grid}_Enterprise_key_{AG-059797}_in_excess_of_the_licence_granted_is_not_permitted___Please_report_misuse_to_legal@ag-grid.com___For_help_with_changing_this_key_please_contact_info@ag-grid.com___{Hammock_Corporation}_is_granted_a_{Single_Application}_Developer_License_for_the_application_{HotProflie}_only_for_{1}_Front-End_JavaScript_developer___All_Front-End_JavaScript_developers_working_on_{HotProflie}_need_to_be_licensed___{HotProflie}_has_been_granted_a_Deployment_License_Add-on_for_{1}_Production_Environment___This_key_works_with_{AG_Charts_and_AG_Grid}_Enterprise_versions_released_before_{9_June_2025}____[v3]_[0102]_MTc0OTQyMzYwMDAwMA==604a6fbe54c13688213970c7d30ae936"),document.getElementById("analysis_selected_object"+t).value){case"1":i=this.display_grid_deals(a,t);break;case"2":i=this.display_grid_deal_details(a);break;case"3":i=this.display_grid_objectives(a);break;case"4":i=this.display_grid_business_cards(a);break;case"5":i=this.display_grid_leads(a);break;case"6":i=this.display_grid_clients(a);break;case"7":i=this.display_grid_client_branches(a);break;case"8":i=this.display_grid_daily_reports(a,t);break;case"9":i=this.display_grid_tasks(a);break;case"10":i=this.display_grid_users(a);break;default:i=[]}var s=$(".ag-column-select-list").not(".data-type-icon")[0],o=new MutationObserver(function(){App.front_analyses.add_icon()});s&&o.observe(s,{childList:!0,subtree:!0}),$(document).on("click",".ag-select-agg-func-item",function(){App.front_analyses.add_icon()})}return n(),t?App.front_analyses.restore_state_grid_table(i,t):(App.front_analyses.submit_new(i),App.front_analyses.submit_edit(i)),App.front_analyses.data_setting(i),i},save_state_grid_table:function(e){$("#analysis_saved_state").val(JSON.stringify(e.getColumnState())),$("#analysis_saved_filter").val(JSON.stringify(e.getFilterModel()));var t=e.getRowGroupColumns(),n=e.getValueColumns(),i=e.getChartModels(),a=[];n.forEach(function(e){a.push(e.colId)}),$("#analysis_sort_aggregation").val(JSON.stringify(a)),0<i.length&&i[0].cellRange.columns&&0<t.length&&0<n.length&&(i[0].cellRange.columns=[n[0].colId]),$("#analysis_saved_chart").val(JSON.stringify(i))},restore_state_grid_table:function(e,t){if($("#analysis_saved_state"+t).val()){var n=JSON.parse($("#analysis_saved_state"+t).val());e.applyColumnState({state:n,applyOrder:!0})}if($("#analysis_saved_filter"+t).val()){var i=JSON.parse($("#analysis_saved_filter"+t).val());e.setFilterModel(i)}if($("#analysis_sort_aggregation"+t).val()){var a=JSON.parse($("#analysis_sort_aggregation"+t).val());e.setValueColumns(a)}$("#gridTableArea").show()},display_grid_deals:function(e,a){function t(e){var t=e.value;if(null===t||t===undefined||""===t)return"";var n=String(t).split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n.join(".")}function n(e){if(e.value)return moment(e.value).format("YYYY/MM/DD")}function i(e){var t=e.api.getRowGroupColumns(),n=e.api.getValueColumns(),i=e.api.getChartModels();0<t.length&&0<n.length?($(".show_graph").tooltip("disable"),$(".show_graph").prop("disabled",!1)):($(".show_graph").tooltip("enable"),$(".show_graph").prop("disabled",!0)),App.front_analyses.update_chart(e.api,i[0],n[0],t[0])}function s(e){var t=e.api.getRowGroupColumns(),n=e.api.getValueColumns(),i=e.api.getChartModels();App.front_analyses.update_chart(e.api,i[0],n[0],t[0])}function o(){$("div").hasClass("ag-row-group-expanded")&&$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002")}function r(){$("div").hasClass("ag-row-group-expanded")&&$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002")}function l(e){return-1===e.node.level?"\u7dcf\u8a08":"\u5408\u8a08 ("+(e.value||"\u5024\u7121\u3057")+")"}function c(e){return e.defaultItems.filter(function(e){return"chartUnlink"!==e&&"chartLink"!==e})}function d(){App.front_analyses.add_icon()}function u(){App.front_analyses.add_icon()}function _(e){var t=e.api.getValueColumns(),n=e.api.getChartModels();App.front_analyses.group_opened(e,n[0],t[0])}function h(e){var t=e.api.getValueColumns(),n=e.api.getChartModels();App.front_analyses.expand_all(e,n[0],t[0])}function p(e){var t=["amount"],n="groupedColumn";if($("#analysis_saved_chart"+a).val()){var i=JSON.parse($("#analysis_saved_chart"+a).val());t=i[0].cellRange.columns,n=i[0].chartType}e.api.createRangeChart({chartContainer:document.querySelector("#myChart"+a),cellRange:{columns:t},chartType:n,aggFunc:"sum",switchCategorySeries:!0,suppressChartRanges:!0}),$("#myChart"+a+".not-modal .ag-chart-menu").hide()}var f=[],m=[];if(document.getElementById("default_items"+a).value){m=[{headerName:"\u5546\u8ac7ID",field:"id",enableValue:!0,defaultAggFunc:"count",allowedAggFuncs:["count"],chartDataType:"series",cellDataType:"number"},{headerName:(f=JSON.parse(document.getElementById("default_items"+a).value)).title,field:"title",cellDataType:"text"},{headerName:f.user_id,field:"user_name",chartDataType:"category",cellDataType:"text"},{headerName:"\u55b6\u696d\u62c5\u5f53\u8005 \u90e8\u7f72",field:"user_department",chartDataType:"category",cellDataType:"text"},{headerName:f.client_id,field:"client_name",cellDataType:"text"},{headerName:f.status_kbn_id,field:"status_kbn_value",chartDataType:"category",cellDataType:"text"},{headerName:f.product_type_id,field:"product_type_id",cellDataType:"text"},{headerName:f.amount,field:"amount",enableValue:!0,defaultAggFunc:"sum",valueFormatter:t,allowedAggFuncs:["sum","min","max","avg"],chartDataType:"series",cellDataType:"number"},{headerName:f.gross_profit,field:"gross_profit",enableValue:!0,defaultAggFunc:"sum",valueFormatter:t,allowedAggFuncs:["sum","min","max","avg"],chartDataType:"series",cellDataType:"number"},{headerName:f.orders_date_on,field:"orders_date_on",valueFormatter:n,cellDataType:"date"},{headerName:"\u53d7\u6ce8\u4e88\u5b9a\u5e74\u6708",field:"orders_date_on_yyyy_mm",cellDataType:"text"},{headerName:"\u53d7\u6ce8\u4e88\u5b9a\u4f1a\u8a08\u5e74\u5ea6",field:"orders_date_on_yyyy",cellDataType:"text"},{headerName:"\u53d7\u6ce8\u4e88\u5b9a\u4f1a\u8a08\u671f\u9593",field:"orders_date_on_yyyy_quarter",cellDataType:"text"},{headerName:"\u5165\u529b\u65e5",field:"created_at",valueFormatter:n,cellDataType:"date"},{headerName:"\u5165\u529b\u5e74\u6708",field:"created_at_yyyy_mm",cellDataType:"text"},{headerName:"\u5165\u529b\u4f1a\u8a08\u5e74\u5ea6",field:"created_at_yyyy",cellDataType:"text"},{headerName:"\u5165\u529b\u4f1a\u8a08\u671f\u9593",field:"created_at_yyyy_quarter",cellDataType:"text"},{headerName:"\u66f4\u65b0\u65e5",field:"updated_at",valueFormatter:n,cellDataType:"date"},{headerName:"\u66f4\u65b0\u5e74\u6708",field:"updated_at_yyyy_mm",cellDataType:"text"},{headerName:"\u66f4\u65b0\u4f1a\u8a08\u5e74\u5ea6",field:"updated_at_yyyy",cellDataType:"text"},{headerName:"\u66f4\u65b0\u4f1a\u8a08\u671f\u9593",field:"updated_at_yyyy_quarter",cellDataType:"text"}];if(document.getElementById("custom_items"+a).value){var g=JSON.parse(document.getElementById("custom_items"+a).value);Object.keys(g).forEach(function(e){"3"==g[e][1]?(m.push({headerName:g[e][0],field:e,valueFormatter:n,cellDataType:"date"}),m.push({headerName:g[e][0]+":\u5e74\u6708",field:e+"_yyyy_mm",cellDataType:"text"}),m.push({headerName:g[e][0]+":\u5e74\u5ea6",field:e+"_yyyy",cellDataType:"text"}),m.push({headerName:g[e][0]+":\u4f1a\u8a08\u671f\u9593",field:e+"_yyyy_quarter",cellDataType:"text"})):"8"==g[e][1]||"10"==g[e][1]?m.push({headerName:g[e][0],field:e,enableValue:!0,defaultAggFunc:"sum",valueFormatter:t,allowedAggFuncs:["sum","min","max","avg"],chartDataType:"series",cellDataType:"number"}):m.push({headerName:g[e][0],field:e,cellDataType:"text"})})}$("#columnDefs").val(JSON.stringify(m))}var A=[];if(m.length){var v=document.getElementById("analysis_check_items"+a).value.split(",");m.forEach(function(e){v.includes(e.field)&&A.push(e)})}var b=!0,y=!1;a&&(y=!(b=!1)),locale=this.set_ag_grid_locale();var w={columnDefs:A,defaultColDef:{suppressMenu:y,enableRowGroup:!0,filter:"agSetColumnFilter",suppressHeaderFilterButton:!0,enablePivot:!0},rowData:e,sideBar:b,groupDisplayType:"singleColumn",groupTotalRow:"bottom",grandTotalRow:"bottom",localeText:locale,onDisplayedColumnsChanged:i,onColumnValueChanged:s,onStateUpdated:d,onDragStopped:u,onRowGroupOpened:_,onExpandOrCollapseAll:h,onSortChanged:o,onFilterChanged:r,columnMenu:"new",chartMenuItems:c,chartThemes:["ag-polychroma"],popupParent:document.body,chartToolPanelsDef:{panels:["settings"],settingsPanel:{chartGroupsDef:{columnGroup:["column"],barGroup:["bar"],pieGroup:["pie"],lineGroup:["line"]}}},suppressContextMenu:!0,autoGroupColumnDef:{cellRendererParams:{totalValueGetter:l}},enableRangeSelection:!0,enableCharts:!0,chartThemeOverrides:{common:{axes:{number:{label:{formatter:t}}},padding:{right:50}},bar:{axes:{"grouped-category":{bottom:{label:{autoRotate:!1,rotation:60}}}}},line:{axes:{"grouped-category":{label:{autoRotate:!1,rotation:60}}}}},onFirstDataRendered:p,excelStyles:[{id:"numberType",numberFormat:{format:"0"}}]},k=document.querySelector("#gridTable"+a);return $("#gridTable"+a).children().remove(),agGrid.createGrid(k,w)},display_grid_daily_reports:function(e,t){function n(e){var t=e.value;if(null===t||t===undefined||""===t)return"";var n=String(t).split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n.join(".")}function i(e){if(e.value)return moment(e.value).format("YYYY/MM/DD")}var a=[],s=[];if(document.getElementById("default_items"+t).value){s=[{headerName:"\u5831\u544aID",field:"id",enableValue:!0,defaultAggFunc:"count",allowedAggFuncs:["count"],cellDataType:"number"},{headerName:(a=JSON.parse(document.getElementById("default_items"+t).value)).name,field:"name",cellDataType:"text"},{headerName:a.user_id,field:"user_name",cellDataType:"text"},{headerName:"\u55b6\u696d\u62c5\u5f53\u8005 \u90e8\u7f72",field:"user_department",chartDataType:"category",cellDataType:"text"},{headerName:"\u5bfe\u5fdc\u65e5",field:"visit_on_format",valueFormatter:i,cellDataType:"date"},{headerName:"\u5bfe\u5fdc\u5e74\u6708",field:"visit_on_format_yyyy_mm",cellDataType:"text"},{headerName:"\u5bfe\u5fdc\u4f1a\u8a08\u5e74\u5ea6",field:"visit_on_format_yyyy",cellDataType:"text"},{headerName:"\u5bfe\u5fdc\u4f1a\u8a08\u671f\u9593",field:"visit_on_format_yyyy_quarter",cellDataType:"text"},{headerName:a.client_id,field:"client_name",cellDataType:"text"},{headerName:"\u5165\u529b\u65e5",field:"created_at",valueFormatter:i,cellDataType:"date"},{headerName:"\u5165\u529b\u5e74\u6708",field:"created_at_yyyy_mm",cellDataType:"text"},{headerName:"\u5165\u529b\u4f1a\u8a08\u5e74\u5ea6",field:"created_at_yyyy",cellDataType:"text"},{headerName:"\u5165\u529b\u4f1a\u8a08\u671f\u9593",field:"created_at_yyyy_quarter",cellDataType:"text"},{headerName:"\u66f4\u65b0\u65e5",field:"updated_at",valueFormatter:i,cellDataType:"date"},{headerName:"\u66f4\u65b0\u5e74\u6708",field:"updated_at_yyyy_mm",cellDataType:"text"},{headerName:"\u66f4\u65b0\u4f1a\u8a08\u5e74\u5ea6",field:"updated_at_yyyy",cellDataType:"text"},{headerName:"\u66f4\u65b0\u4f1a\u8a08\u671f\u9593",field:"updated_at_yyyy_quarter",cellDataType:"text"}];if(document.getElementById("custom_items"+t).value){var o=JSON.parse(document.getElementById("custom_items"+t).value);Object.keys(o).forEach(
function(e){3==o[e][1]?(s.push({headerName:o[e][0],field:e,valueFormatter:i,cellDataType:"date"}),s.push({headerName:o[e][0]+":\u5e74\u6708",field:e+"_yyyy_mm",cellDataType:"text"}),s.push({headerName:o[e][0]+":\u5e74\u5ea6",field:e+"_yyyy",cellDataType:"text"}),s.push({headerName:o[e][0]+":\u4f1a\u8a08\u671f\u9593",field:e+"_yyyy_quarter",cellDataType:"text"})):8==o[e][1]||10==o[e][1]?s.push({headerName:o[e][0],field:e,enableValue:!0,defaultAggFunc:"sum",valueFormatter:n,allowedAggFuncs:["sum","min","max","avg"],chartDataType:"series",cellDataType:"number"}):s.push({headerName:o[e][0],field:e,cellDataType:"text"})})}$("#columnDefs").val(JSON.stringify(s))}var r=[];if(s.length){var l=document.getElementById("analysis_check_items"+t).value.split(",");s.forEach(function(e){l.includes(e.field)&&r.push(e)})}return this.create_grid(e,r,t)},create_grid:function(e,t,a){function n(e){var t=e.api.getRowGroupColumns(),n=e.api.getValueColumns(),i=e.api.getChartModels();0<t.length&&0<n.length?($(".show_graph").tooltip("disable"),$(".show_graph").prop("disabled",!1)):($(".show_graph").tooltip("enable"),$(".show_graph").prop("disabled",!0)),App.front_analyses.update_chart(e.api,i[0],n[0],t[0])}function i(e){var t=e.api.getRowGroupColumns(),n=e.api.getValueColumns(),i=e.api.getChartModels();App.front_analyses.update_chart(e.api,i[0],n[0],t[0])}function s(){$("div").hasClass("ag-row-group-expanded")&&$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002")}function o(){$("div").hasClass("ag-row-group-expanded")&&$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002")}function r(e){return-1===e.node.level?"\u7dcf\u8a08":"\u5408\u8a08 ("+(e.value||"\u5024\u7121\u3057")+")"}function l(e){return e.defaultItems.filter(function(e){return"chartUnlink"!==e})}function c(e){var t=[],n="groupedColumn";if($("#analysis_saved_chart"+a).val()){var i=JSON.parse($("#analysis_saved_chart"+a).val());t=i[0].cellRange.columns,n=i[0].chartType}e.api.createRangeChart({chartContainer:document.querySelector("#myChart"+a),cellRange:{columns:t},chartType:n,aggFunc:"sum",switchCategorySeries:!0,suppressChartRanges:!0}),$("#myChart"+a+".not-modal .ag-chart-menu").hide()}function d(){App.front_analyses.add_icon()}function u(){App.front_analyses.add_icon()}function _(e){var t=e.api.getValueColumns(),n=e.api.getChartModels();App.front_analyses.group_opened(e,n[0],t[0])}function h(e){var t=e.api.getValueColumns(),n=e.api.getChartModels();App.front_analyses.expand_all(e,n[0],t[0])}function p(e){var t=e.value;if(null===t||t===undefined||""===t)return"";var n=String(t).split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n.join(".")}locale=this.set_ag_grid_locale();var f=!0,m=!1;a&&(m=!(f=!1));var g={columnDefs:t,rowData:e,sideBar:f,defaultColDef:{suppressMenu:m,enableRowGroup:!0,filter:"agSetColumnFilter",suppressHeaderFilterButton:!0,enablePivot:!0},groupDisplayType:"singleColumn",groupTotalRow:"bottom",grandTotalRow:"bottom",localeText:locale,columnMenu:"new",chartMenuItems:l,chartThemes:["ag-polychroma"],popupParent:document.body,chartToolPanelsDef:{panels:["settings"],settingsPanel:{chartGroupsDef:{columnGroup:["column"],barGroup:["bar"],pieGroup:["pie"],lineGroup:["line"]}}},suppressContextMenu:!0,autoGroupColumnDef:{cellRendererParams:{totalValueGetter:r}},onDisplayedColumnsChanged:n,onColumnValueChanged:i,onStateUpdated:d,onDragStopped:u,onRowGroupOpened:_,onExpandOrCollapseAll:h,onSortChanged:s,onFilterChanged:o,enableRangeSelection:!0,enableCharts:!0,chartThemeOverrides:{common:{axes:{number:{label:{formatter:p}}},padding:{right:50}},bar:{axes:{"grouped-category":{bottom:{label:{autoRotate:!1,rotation:60}}}}},line:{axes:{"grouped-category":{label:{autoRotate:!1,rotation:60}}}}},onFirstDataRendered:c},A=document.querySelector("#gridTable"+a);return $("#gridTable"+a).children().remove(),agGrid.createGrid(A,g)},select_data_source:function(){function e(){if($("#analysis_selected_object").val()){var n=[];$('.report_items:visible input[name="check_items[]"]:checked').each(function(e,t){return n.push(t.id)}),$.ajax({url:"/analyses/get_table_data",type:"POST",dataType:"script",data:{analysis_selected_object:$("#analysis_selected_object").val(),analysis_date_type:$("#analysis_date_type").val(),analysis_start_date:$("#analysis_start_date").val(),analysis_end_date:$("#analysis_end_date").val(),analysis_check_items:n.join()}}).done(function(){App.front_analyses.show_grid_table()}),$("#gridTableArea").show()}else $("#gridTableArea").hide()}$(document).on("change","#analysis_selected_object",function(){$("#gridTableArea").hide(),e()})},set_data_setting_modal_event:function(){var e=$('[data-form="data_setting_modal"]');e.find("[data-hp-role='datepicker']").datepicker({minViewMode:"months",format:"yyyy/mm"}),e.find("[data-hp-role='datepicker-default']").datepicker(Object.assign({orientation:"bottom"})),$(document).on("click",".data_setting_modal_show",function(){e.dialog({title:"\u30ec\u30dd\u30fc\u30c8\u6a5f\u80fd \u30c7\u30fc\u30bf\u62bd\u51fa\u6761\u4ef6\u306e\u8a2d\u5b9a",modal:!0,width:800,draggable:!1,resizable:!1,open:function(){$(".ui-dialog-titlebar").height("15px"),$(".ui-dialog-titlebar").css("border","white"),$(".ui-widget-header").css("background","white"),$("#analysis_date_type").val()&&$('[name="analysis[analysis_date_type]"]').val($("#analysis_date_type").val())},close:function(){$("#modal_message").html("")}});App.front_analyses.limit_check_items()}),$(document).on("click",'[data-event-role="submit"]',function(){;"submit"}),$(document).on("click",'[data-event-role="cancel"]',function(){e.dialog("close")}),$('[name="analysis[selected_object]"]:radio').change(function(){if($("[id=deals]").prop("checked")){$('[name="analysis[select_date_type]"] option').remove();var e=[];e={orders_date_on:"\u53d7\u6ce8\u4e88\u5b9a\u65e5",created_at:"\u5165\u529b\u65e5",updated_at:"\u66f4\u65b0\u65e5"},$.each(e,function(e,t){$('[name="analysis[select_date_type]"]').append($("<option>").html(t).val(e))}),$(".deals_items").css("display",""),$(".daily_reports_items").css("display","none")}else if($("[id=business_cards]").prop("checked")){$('[name="analysis[select_date_type]"] option').remove();e=[];e={"":"",trade_on:"\u540d\u523a\u4ea4\u63db\u65e5"},$.each(e,function(e,t){$('[name="analysis[select_date_type]"]').append($("<option>").html(t).val(e))})}else{$('[name="analysis[select_date_type]"] option').remove();e=[];e={visit_on:"\u5bfe\u5fdc\u65e5\u6642",created_at:"\u5165\u529b\u65e5",updated_at:"\u66f4\u65b0\u65e5"},$.each(e,function(e,t){$('[name="analysis[select_date_type]"]').append($("<option>").html(t).val(e))}),$(".daily_reports_items").css("display",""),$(".deals_items").css("display","none")}App.front_analyses.limit_check_items()});var t=function(){$('input[name="analysis[selected_object]"][checked]').val()?document.querySelector('input[name="analysis[selected_object]"][checked]').checked=!0:$('input[name="analysis[selected_object]"]:eq(0)').prop("checked",!0),$('[name="analysis[selected_object]"]:radio').trigger("change"),$("#analysis_date_type").val()&&$('[name="analysis[select_date_type]"]').val($("#analysis_date_type").val())};window.addEventListener("pageshow",t)},data_setting:function(i){$("#js_data_setting").off(),$("#js_data_setting").on("click",function(){$(this).prop("disabled",!0);var n=[];$('.report_items:visible input[name="check_items[]"]:checked').each(function(e,t){return n.push(t.id)});var t={name:$("#input_name").val(),selected_object:$('input[name="analysis[selected_object]"]:checked').val(),date_type:$('[name="analysis[select_date_type]"]').val(),start_date:$("#input_start_date").val(),end_date:$("#input_end_date").val(),check_items:n.join()};$.ajax({url:"/analyses/data_setting",type:"POST",dataType:"json",data:{analysis:t}}).success(function(e){var n=[];$('.report_items:visible input[name="check_items[]"]:checked').each(function(e,t){return n.push(t.id)}),$("#analysis_name").val(t.name),$("#analysis_date_type").val(t.date_type),$("#analysis_start_date").val(t.start_date),$("#analysis_end_date").val(t.end_date),$("#analysis_setting_data").text(e.messages),$("#analysis_selected_object").val(t.selected_object).trigger("change"),$("#analysis_check_items").val(n.join()),$('[data-form="data_setting_modal"]').dialog("close"),i.showLoadingOverlay()}).error(function(e){$("#form_data_setting").find("#modal_message").html(App.concerns.buildNoticeHtml(e.responseJSON.messages,"danger"))})})},limit_check_items:function(){var e=$('.report_items:visible input[name="check_items[]"]:checked').length;$(".item_count").text(e),10<=e?$('.report_items:visible input[name="check_items[]"]:not(:checked)').prop("disabled",!0):$('.report_items:visible input[name="check_items[]"]').prop("disabled",!1)},add_column_type_icon:function(e,t){var n;"number"==e?(n=document.createElement("i")).setAttribute("class","data-type-icon ag-icon-aggregation"):(n=document.createElement("i")).setAttribute("class","data-type-icon");t.setAttribute("class","added-icon"),t.before(n)},add_icon:function(){var n=[];$("#columnDefs").val()&&($.each(JSON.parse($("#columnDefs").val()),function(e,t){n.push([t.headerName,t.cellDataType])}),$.each(n,function(e,n){var t=$(".ag-column-select-column-label").not(".added-icon");$.each(t,function(e,t){n[0]==t.innerHTML&&App.front_analyses.add_column_type_icon(n[1],t)})}))},update_chart:function(e,t,n,i){function a(e){var t=e.value;if(null===t||t===undefined||""===t)return"";var n=String(t).split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),n.join(".")}if($("div").hasClass("ag-row-group-expanded"))$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002");else if(t){var s="sum",o=[];n&&(s=n.aggFunc,"count"==n.aggFunc&&(s="sum"),i&&(o=[n.colId])),e.updateChart({type:"rangeChartUpdate",chartId:t.chartId,cellRange:{columns:o},aggFunc:s,switchCategorySeries:!0,chartThemeOverrides:{common:{axes:{number:{label:{formatter:a}}},padding:{right:50}}}})}},group_opened:function(e,t,n){if(e.expanded)e.api.updateChart({type:"rangeChartUpdate",chartId:t.chartId,cellRange:{columns:[]},aggFunc:"sum",switchCategorySeries:!0}),$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002");else if($("div").hasClass("ag-row-group-expanded"))$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002");else{var i=e.api.getRowGroupColumns();App.front_analyses.update_chart(e.api,t,n,i[0])}},expand_all:function(e,t,n){if("expandAll"==e.source){e.api.updateChart({type:"rangeChartUpdate",chartId:t.chartId,cellRange:{columns:[]},aggFunc:"sum",switchCategorySeries:!0}),$("#myChart .ag-chart-empty-text.ag-unselectable").text("\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b\u3068\u30b0\u30e9\u30d5\u304c\u518d\u8868\u793a\u3055\u308c\u307e\u3059\u3002")}else{var i=e.api.getRowGroupColumns();App.front_analyses.update_chart(e.api,t,n,i[0])}},set_portlet_graph_user:function(){$('input[name="portlet_portlet_form[display_contents]"]').change(function(){"graph"==$(this).val()?$(".create_graph_user").show():$(".create_graph_user").hide()})},set_ag_grid_locale:function(){return{selectAll:"(\u5168\u3066\u9078\u629e)",selectAllSearchResults:"(\u3059\u3079\u3066\u306e\u691c\u7d22\u7d50\u679c\u3092\u9078\u629e)",addCurrentSelectionToFilter:"\u73fe\u5728\u306e\u9078\u629e\u3092\u30d5\u30a3\u30eb\u30bf\u30fc\u306b\u8ffd\u52a0",searchOoo:"\u691c\u7d22...",blanks:"(\u5024\u7121\u3057)",noMatches:"\u4e00\u81f4\u3057\u307e\u305b\u3093",filterOoo:"\u30d5\u30a3\u30eb\u30bf\u30fc",equals:"\u7b49\u3057\u3044",notEqual:"\u7b49\u3057\u304f\u306a\u3044",blank:"\u7a7a\u767d",notBlank:"\u7a7a\u767d\u3067\u306f\u306a\u3044",empty:"\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044",lessThan:"\u672a\u6e80",greaterThan:"\u3088\u308a\u5927\u304d\u3044",lessThanOrEqual:"\u4ee5\u4e0b",greaterThanOrEqual:"\u4ee5\u4e0a",inRange:"\u306e\u9593",inRangeStart:"\u304b\u3089",inRangeEnd:"\u304b\u3089",contains:"\u542b\u6709\u91cf",notContains:"\u542b\u307e\u306a\u3044",startsWith:"\u3067\u59cb\u307e\u308b",endsWith:"\u3067\u7d42\u308f\u308b",dateFormatOoo:"yyyy-mm-dd",before:"\u524d",after:"\u5f8c",andCondition:"\u304b\u3064",orCondition:"\u307e\u305f\u306f",applyFilter:"\u9069\u7528",resetFilter:"\u30ea\u30bb\u30c3\u30c8",clearFilter:"\u30af\u30ea\u30a2",cancelFilter:"\u30ad\u30e3\u30f3\u30bb\u30eb",textFilter:"\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30eb\u30bf\u30fc",numberFilter:"\u6570\u5024\u30d5\u30a3\u30eb\u30bf\u30fc",dateFilter:"\u65e5\u4ed8\u30d5\u30a3\u30eb\u30bf\u30fc",setFilter:"\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u8a2d\u5b9a",groupFilterSelect:"\u5217\u3092\u9078\u629e",advancedFilterContains:"\u542b\u3080",advancedFilterNotContains:"\u542b\u307e\u306a\u3044",advancedFilterTextEquals:"\u7b49\u3057\u3044",advancedFilterTextNotEqual:"\u7b49\u3057\u304f\u306a\u3044",advancedFilterStartsWith:"\u3067\u59cb\u307e\u308b",advancedFilterEndsWith:"\u3067\u7d42\u308f\u308b",advancedFilterBlank:"\u7a7a\u767d",advancedFilterNotBlank:"\u7a7a\u767d\u3067\u306f\u306a\u3044",advancedFilterEquals:"=",advancedFilterNotEqual:"!=",advancedFilterGreaterThan:">",advancedFilterGreaterThanOrEqual:">=",advancedFilterLessThan:"<",advancedFilterLessThanOrEqual:"<=",advancedFilterTrue:"\u304c\u771f",advancedFilterFalse:"\u306f\u507d",advancedFilterAnd:"\u304b\u3064",advancedFilterOr:"\u307e\u305f\u306f",advancedFilterApply:"\u9069\u7528",advancedFilterBuilder:"\u30d3\u30eb\u30c0\u30fc",advancedFilterValidationMissingColumn:"\u5217\u304c\u3042\u308a\u307e\u305b\u3093",advancedFilterValidationMissingOption:"\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u305b\u3093",advancedFilterValidationMissingValue:"\u5024\u304c\u3042\u308a\u307e\u305b\u3093",advancedFilterValidationInvalidColumn:"\u5217\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093",advancedFilterValidationInvalidOption:"\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093",advancedFilterValidationMissingQuote:"\u5024\u306e\u672b\u5c3e\u306b\u5f15\u7528\u7b26\u304c\u3042\u308a\u307e\u305b\u3093",advancedFilterValidationNotANumber:"\u5024\u304c\u6570\u5024\u3067\u306f\u3042\u308a\u307e\u305b\u3093",advancedFilterValidationInvalidDate:"\u5024\u304c\u6709\u52b9\u306a\u65e5\u4ed8\u3067\u306f\u3042\u308a\u307e\u305b\u3093",advancedFilterValidationMissingCondition:"\u6761\u4ef6\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093",advancedFilterValidationJoinOperatorMismatch:"\u6761\u4ef6\u5185\u306e\u7d50\u5408\u6f14\u7b97\u5b50\u306f\u540c\u3058\u3067\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093",advancedFilterValidationInvalidJoinOperator:"\u7d50\u5408\u6f14\u7b97\u5b50\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093",advancedFilterValidationMissingEndBracket:"\u7d42\u4e86\u62ec\u5f27\u304c\u898b\u3064\u304b\u3089\u306a\u3044",advancedFilterValidationExtraEndBracket:"\u7d42\u4e86\u62ec\u5f27\u304c\u591a\u3059\u304e\u307e\u3059",advancedFilterValidationMessage:"\u5f0f\u306b\u30a8\u30e9\u30fc\u304c\u3042\u308a\u307e\u3059\u3002${variable} - ${variable}.",advancedFilterValidationMessageAtEnd:"\u5f0f\u306b\u30a8\u30e9\u30fc\u304c\u3042\u308a\u307e\u3059\u3002\u5f0f\u306e\u6700\u5f8c\u306b ${variable} \u304c\u3042\u308a\u307e\u3059\u3002",advancedFilterBuilderTitle:"\u9ad8\u5ea6\u306a\u30d5\u30a3\u30eb\u30bf\u30fc",advancedFilterBuilderApply:"\u9069\u7528\u3059\u308b",advancedFilterBuilderCancel:"\u30ad\u30e3\u30f3\u30bb\u30eb",advancedFilterBuilderAddButtonTooltip:"\u30d5\u30a3\u30eb\u30bf\u30fc\u307e\u305f\u306f\u30b0\u30eb\u30fc\u30d7\u306e\u8ffd\u52a0",advancedFilterBuilderRemoveButtonTooltip:"\u524a\u9664",advancedFilterBuilderMoveUpButtonTooltip:"\u4e0a\u306b\u79fb\u52d5",advancedFilterBuilderMoveDownButtonTooltip:"\u4e0b\u306b\u79fb\u52d5",advancedFilterBuilderAddJoin:"\u30b0\u30eb\u30fc\u30d7\u8ffd\u52a0",advancedFilterBuilderAddCondition:"\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u8ffd\u52a0",advancedFilterBuilderSelectColumn:"\u5217\u3092\u9078\u629e",advancedFilterBuilderSelectOption:"\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e",advancedFilterBuilderEnterValue:"\u5024\u3092\u5165\u529b...",advancedFilterBuilderValidationAlreadyApplied:"\u73fe\u5728\u306e\u30d5\u30a3\u30eb\u30bf\u30fc\u306f\u3059\u3067\u306b\u9069\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002",advancedFilterBuilderValidationIncomplete:"\u3059\u3079\u3066\u306e\u6761\u4ef6\u304c\u5b8c\u4e86\u3057\u3066\u3044\u307e\u305b\u3093\u3002",advancedFilterBuilderValidationSelectColumn:"\u5217\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",advancedFilterBuilderValidationSelectOption:"\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",advancedFilterBuilderValidationEnterValue:"\u5024\u3092\u5165\u529b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",columns:"\u5217",filters:"\u30d5\u30a3\u30eb\u30bf\u30fc",pivotMode:"\u30d4\u30dc\u30c3\u30c8\u30fb\u30e2\u30fc\u30c9",groups:"\u884c\u30b0\u30eb\u30fc\u30d7",rowGroupColumnsEmptyMessage:"\u3053\u3053\u306b\u9805\u76ee\u3092\u30c9\u30e9\u30c3\u30b0\u3057\u3066\u884c\u30b0\u30eb\u30fc\u30d7\u3092\u8a2d\u5b9a",values:"\u96c6\u8a08\u5024",valueColumnsEmptyMessage:"\u3053\u3053\u306b\u9805\u76ee\u3092\u30c9\u30e9\u30c3\u30b0\u3057\u3066\u96c6\u8a08",pivots:"\u5217\u30e9\u30d9\u30eb",pivotColumnsEmptyMessage:"\u5217\u306e\u30e9\u30d9\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u3053\u3053\u3092\u30c9\u30e9\u30c3\u30b0\u3059\u308b",group:"\u30b0\u30eb\u30fc\u30d7",rowDragRow:"\u884c",rowDragRows:"\u884c",loadingOoo:"\u8aad\u307f\u8fbc\u307f\u4e2d...",loadingError:"\u30a8\u30e9\u30fc",noRowsToShow:"\u8868\u793a\u3059\u308b\u884c\u304c\u3042\u308a\u307e\u305b\u3093",enabled:"\u6709\u52b9",pinColumn:"\u5217\u3092\u30d4\u30f3\u7559\u3081",pinLeft:"\u5de6\u306b\u30d4\u30f3\u7559\u3081",pinRight:"\u53f3\u306b\u30d4\u30f3\u7559\u3081",noPin:"\u30d4\u30f3\u7559\u3081\u306a\u3057",valueAggregation:"\u5024\u306e\u96c6\u7d04",noAggregation:"\u306a\u3057",autosizeThisColumn:"\u3053\u306e\u5217\u306e\u5e45\u3092\u81ea\u52d5\u8abf\u6574",autosizeAllColumns:"\u3059\u3079\u3066\u306e\u5217\u306e\u5e45\u3092\u81ea\u52d5\u8abf\u6574",groupBy:"\u3053\u306e\u9805\u76ee\u3067\u884c\u30b0\u30eb\u30fc\u30d7\u5316 | ",ungroupBy:"\u30b0\u30eb\u30fc\u30d7\u89e3\u9664",ungroupAll:"\u30b0\u30eb\u30fc\u30d7\u5316\u89e3\u9664",addToValues:"\u5024\u306b${variable}\u3092\u8ffd\u52a0\u3059\u308b",removeFromValues:"\u5024\u304b\u3089${variable}\u3092\u524a\u9664\u3059\u308b",addToLabels:"\u30e9\u30d9\u30eb\u306b${variable}\u3092\u8ffd\u52a0\u3059\u308b",removeFromLabels:"\u30e9\u30d9\u30eb\u304b\u3089${variable}\u3092\u524a\u9664\u3059\u308b",resetColumns:"\u5217\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b",expandAll:"\u3059\u3079\u3066\u306e\u884c\u30b0\u30eb\u30fc\u30d7\u3092\u5c55\u958b\u3059\u308b",collapseAll:"\u3059\u3079\u3066\u306e\u884c\u30b0\u30eb\u30fc\u30d7\u3092\u9589\u3058\u308b",copy:"\u30b3\u30d4\u30fc",ctrlC:"Ctrl+C",ctrlX:"Ctrl+X",copyWithHeaders:"\u30d8\u30c3\u30c0\u30fc\u4ed8\u304d\u3067\u30b3\u30d4\u30fc",copyWithGroupHeaders:"\u30b0\u30eb\u30fc\u30d7\u30d8\u30c3\u30c0\u4ed8\u304d\u3067\u30b3\u30d4\u30fc",cut:"\u5207\u308a\u53d6\u308a",paste:"\u8cbc\u308a\u4ed8\u3051",ctrlV:"Ctrl+V","export":"\u30a8\u30af\u30b9\u30dd\u30fc\u30c8",csvExport:"CSV\u5f62\u5f0f\u3067\u30a8\u30af\u30b9\u30dd\u30fc\u30c8",excelExport:"Excel\u5f62\u5f0f\u3067\u30a8\u30af\u30b9\u30dd\u30fc\u30c8",columnFilter:"\u5217\u30d5\u30a3\u30eb\u30bf\u30fc",columnChooser:"\u5217\u306e\u9078\u629e",sortAscending:"\u6607\u9806\u30bd\u30fc\u30c8",sortDescending:"\u964d\u9806\u30bd\u30fc\u30c8",sortUnSort:"\u4e26\u3079\u66ff\u3048\u3092\u30af\u30ea\u30a2",sum:"\u5408\u8a08",first:"\u6700\u521d",last:"\u6700\u5f8c",min:"\u6700\u5c0f",max:"\u6700\u5927",none:"\u306a\u3057",count:"\u4ef6\u6570",avg:"\u5e73\u5747",filteredRows:"\u30d5\u30a3\u30eb\u30bf\u30fc",selectedRows:"\u9078\u629e\u3055\u308c\u305f",totalRows:"\u5408\u8a08\u884c\u6570",totalAndFilteredRows:"\u884c\u6570",more:"\u305d\u306e\u4ed6",to:" - ",of:"/ ",page:"\u30da\u30fc\u30b8",pageLastRowUnknown:"?",nextPage:"\u6b21\u306e\u30da\u30fc\u30b8",lastPage:"\u6700\u7d42\u30da\u30fc\u30b8",firstPage:"\u6700\u521d\u306e\u30da\u30fc\u30b8",previousPage:"\u524d\u306e\u30da\u30fc\u30b8",pageSizeSelectorLabel:"\u8868\u793a\u4ef6\u6570",footerTotal:"\u5408\u8a08",pivotColumnGroupTotals:"\u5408\u8a08",pivotChartAndPivotMode:"\u30d4\u30dc\u30c3\u30c8\u30fb\u30c1\u30e3\u30fc\u30c8\u3068\u30d4\u30dc\u30c3\u30c8\u30fb\u30e2\u30fc\u30c9",pivotChart:"\u30d4\u30dc\u30c3\u30c8\u30c1\u30e3\u30fc\u30c8",chartRange:"\u30b0\u30e9\u30d5\u7bc4\u56f2",columnChart:"\u5217",groupedColumn:"\u30b0\u30eb\u30fc\u30d7\u5316",stackedColumn:"\u7a4d\u307f\u4e0a\u3052",normalizedColumn:"100%\u7a4d\u307f\u4e0a\u3052",barChart:"\u30d0\u30fc",groupedBar:"\u30b0\u30eb\u30fc\u30d7\u5316",stackedBar:"\u30b9\u30bf\u30c3\u30af",normalizedBar:"100%\u30b9\u30bf\u30c3\u30af",pieChart:"\u30d1\u30a4",pie:"\u30d1\u30a4",donut:"\u30c9\u30fc\u30ca\u30c4",line:"\u30e9\u30a4\u30f3",xyChart:"X Y (\u30b9\u30ad\u30e3\u30c3\u30bf\u30fc)",scatter:"\u30b9\u30ad\u30e3\u30c3\u30bf\u30fc",bubble:"\u30d0\u30d6\u30eb",areaChart:"\u9762\u7a4d",area:"\u30a8\u30ea\u30a2",stackedArea:"\u30b9\u30bf\u30c3\u30af",normalizedArea:"100%\u30b9\u30bf\u30c3\u30af",histogramChart:"\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0",histogramFrequency:"\u5468\u6ce2\u6570",polarChart:"\u30dd\u30fc\u30e9\u30fc",radarLine:"\u30ec\u30fc\u30c0\u30fc\u30e9\u30a4\u30f3",radarArea:"\u30ec\u30fc\u30c0\u30fc\u30a8\u30ea\u30a2",nightingale:"\u30ca\u30a4\u30c1\u30f3\u30b2\u30fc\u30eb",radialColumn:"\u30e9\u30b8\u30a2\u30eb\u30b3\u30e9\u30e0",radialBar:"\u30e9\u30b8\u30a2\u30eb\u30d0\u30fc",statisticalChart:"\u7d71\u8a08",boxPlot:"\u30dc\u30c3\u30af\u30b9\u30d7\u30ed\u30c3\u30c8",rangeBar:"\u7bc4\u56f2\u30d0\u30fc",rangeArea:"\u7bc4\u56f2\u30a8\u30ea\u30a2",hierarchicalChart:"\u968e\u5c64\u578b",treemap:"\u30c8\u30ec\u30de\u30c3\u30d7",sunburst:"\u30b5\u30f3\u30d0\u30fc\u30b9\u30c8",specializedChart:"\u30b9\u30da\u30b7\u30e3\u30e9\u30a4\u30ba\u30c9",waterfall:"\u30a6\u30a9\u30fc\u30bf\u30fc\u30d5\u30a9\u30fc\u30eb",heatmap:"\u30d2\u30fc\u30c8\u30de\u30c3\u30d7",combinationChart:"\u30b3\u30f3\u30d3\u30cd\u30fc\u30b7\u30e7\u30f3",columnLineCombo:"\u30b3\u30e9\u30e0\uff06\u30e9\u30a4\u30f3",AreaColumnCombo:"\u30a8\u30ea\u30a2\uff06\u30ab\u30e9\u30e0",pivotChartTitle:"\u30d4\u30dc\u30c3\u30c8\u30c1\u30e3\u30fc\u30c8",rangeChartTitle:"\u30ec\u30f3\u30b8\u30c1\u30e3\u30fc\u30c8",settings:"\u30b0\u30e9\u30d5",data:"\u30c7\u30fc\u30bf",format:"\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",categories:"\u30ab\u30c6\u30b4\u30ea\u30fc",defaultCategory:"\u306a\u3057",series:"\u30b7\u30ea\u30fc\u30ba",switchCategorySeries:"\u30b9\u30a4\u30c3\u30c1\u30ab\u30c6\u30b4\u30ea/\u30b7\u30ea\u30fc\u30ba",categoryValues:"\u30ab\u30c6\u30b4\u30ea\u30fc\u5024",seriesLabels:"\u30b7\u30ea\u30fc\u30ba\u30e9\u30d9\u30eb",aggregate:"\u96c6\u8a08",xyValues:"X Y\u5024",paired:"\u30da\u30a2\u30e2\u30fc\u30c9",axis:"\u8ef8",xAxis:"\u6c34\u5e73\u8ef8",yAxis:"\u5782\u76f4\u8ef8",polarAxis:"\u6975\u8ef8",radiusAxis:"\u534a\u5f84\u8ef8",navigator:"\u30ca\u30d3\u30b2\u30fc\u30bf\u30fc",zoom:"\u30ba\u30fc\u30e0",animation:"\u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3",crosshair:"\u30af\u30ed\u30b9\u30d8\u30a2",color:"\u8272",thickness:"\u592a\u3055",preferredLength:"\u5e0c\u671b\u306e\u9577\u3055",xType:"X\u30bf\u30a4\u30d7",axisType:"\u8ef8\u30bf\u30a4\u30d7",automatic:"\u81ea\u52d5",category:"\u30ab\u30c6\u30b4\u30ea\u30fc",number:"\u8ef8\u6570",time:"\u6642\u9593",timeFormat:"\u6642\u9593\u30d5\u30a9\u30fc\u30de\u30c3\u30c8",autoRotate:"\u81ea\u52d5\u56de\u8ee2",labelRotation:"\u56de\u8ee2",circle:"\u5186",polygon:"\u30dd\u30ea\u30b4\u30f3",orientation:"\u30aa\u30ea\u30a8\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3",fixed:"\u56fa\u5b9a",parallel:"\u5e73\u884c",perpendicular:"\u5782\u76f4",radiusAxisPosition:"\u4f4d\u7f6e",ticks:"\u523b\u307f",gridLines:"\u30b0\u30ea\u30c3\u30c9\u7dda",width:"\u5e45",height:"\u9ad8\u3055",length:"\u9577\u3055",padding:"\u30d1\u30c7\u30a3\u30f3\u30b0",spacing:"\u9593\u9694",chart:"\u30c1\u30e3\u30fc\u30c8",title:"\u30bf\u30a4\u30c8\u30eb",titlePlaceholder:"\u30c1\u30e3\u30fc\u30c8\u30bf\u30a4\u30c8\u30eb - \u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3067\u7de8\u96c6",background:"\u80cc\u666f",font:"\u30d5\u30a9\u30f3\u30c8",top:"\u30c8\u30c3\u30d7",right:"\u53f3",bottom:"\u4e0b",left:"\u5de6",labels:"\u30e9\u30d9\u30eb",calloutLabels:"\u30b3\u30fc\u30eb\u30a2\u30a6\u30c8\u30e9\u30d9\u30eb",sectorLabels:"\u30bb\u30af\u30bf\u30fc\u30e9\u30d9\u30eb",positionRatio:"\u30dd\u30b8\u30b7\u30e7\u30f3\u6bd4\u7387",size:"\u30b5\u30a4\u30ba",shape:"\u5f62\u72b6",minSize:"\u6700\u5c0f\u30b5\u30a4\u30ba",maxSize:"\u6700\u5927\u30b5\u30a4\u30ba",legend:"\u51e1\u4f8b",position:"\u4f4d\u7f6e",markerSize:"\u30de\u30fc\u30ab\u30fc\u30b5\u30a4\u30ba",markerStroke:"\u30de\u30fc\u30ab\u30fc\u30b9\u30c8\u30ed\u30fc\u30af",markerPadding:"\u30de\u30fc\u30ab\u30fc\u30d1\u30c7\u30a3\u30f3\u30b0",itemSpacing:"\u30a2\u30a4\u30c6\u30e0\u9593\u9694",itemPaddingX:"\u30a2\u30a4\u30c6\u30e0\u30d1\u30c7\u30a3\u30f3\u30b0X",itemPaddingY:"\u9805\u76ee\u30d1\u30c7\u30a3\u30f3\u30b0 Y",layoutHorizontalSpacing:"\u6a2a\u306e\u9593\u9694",layoutVerticalSpacing:"\u7e26\u306e\u9593\u9694",strokeWidth:"\u30b9\u30c8\u30ed\u30fc\u30af\u5e45",offset:"\u30aa\u30d5\u30bb\u30c3\u30c8",offsets:"\u30aa\u30d5\u30bb\u30c3\u30c8",tooltips:"\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7",callout:"\u5439\u304d\u51fa\u3057",markers:"\u30de\u30fc\u30ab\u30fc",shadow:"\u30b7\u30e3\u30c9\u30a6",blur:"\u307c\u304b\u3057",xOffset:"X\u30aa\u30d5\u30bb\u30c3\u30c8",yOffset:"Y\u30aa\u30d5\u30bb\u30c3\u30c8",lineWidth:"\u30e9\u30a4\u30f3\u5e45",lineDash:"\u30e9\u30a4\u30f3\u30c0\u30c3\u30b7\u30e5",lineDashOffset:"\u30c0\u30c3\u30b7\u30e5\u30aa\u30d5\u30bb\u30c3\u30c8",scrollingZoom:"\u30b9\u30af\u30ed\u30fc\u30eb",scrollingStep:"\u30b9\u30af\u30ed\u30fc\u30eb\u30fb\u30b9\u30c6\u30c3\u30d7",selectingZoom:"\u9078\u629e",durationMillis:"\u6301\u7d9a\u6642\u9593 (ms)",crosshairLabel:"\u30e9\u30d9\u30eb",crosshairSnap:"\u30ce\u30fc\u30c9\u3078\u306e\u30b9\u30ca\u30c3\u30d7",normal:"\u901a\u5e38",bold:"\u592a\u5b57",italic:"\u30a4\u30bf\u30ea\u30c3\u30af",boldItalic:"\u592a\u5b57\u30a4\u30bf\u30ea\u30c3\u30af",predefined:"\u5b9a\u7fa9\u6e08\u307f",fillOpacity:"\u5857\u308a\u3064\u3076\u3057\u4e0d\u900f\u660e\u5ea6",strokeColor:"\u7dda\u306e\u8272",strokeOpacity:"\u7dda\u306e\u4e0d\u900f\u660e\u5ea6",miniChart:"\u30df\u30cb\u30c1\u30e3\u30fc\u30c8",histogramBinCount:"\u30d3\u30f3\u6570",connectorLine:"\u30b3\u30cd\u30af\u30bf\u30fc\u30e9\u30a4\u30f3",seriesItems:"\u30b7\u30ea\u30fc\u30ba\u9805\u76ee",seriesItemType:"\u30a2\u30a4\u30c6\u30e0\u30bf\u30a4\u30d7",seriesItemPositive:"\u6b63",seriesItemNegative:"\u30cd\u30ac\u30c6\u30a3\u30d6",seriesItemLabels:"\u30a2\u30a4\u30c6\u30e0\u30e9\u30d9\u30eb",columnGroup:"\u7e26\u68d2",barGroup:"\u6a2a\u68d2",pieGroup:"\u5186",lineGroup:"\u6298\u308c\u7dda",scatterGroup:"X Y\uff08\u6563\u5e03\u56f3\uff09",areaGroup:"\u9762\u7a4d",polarGroup:"\u6975\u5024",statisticalGroup:"\u7d71\u8a08\u7684",hierarchicalGroup:"\u968e\u5c64\u7684",specializedGroup:"\u7279\u6b8a\u5316",combinationGroup:"\u7d44\u307f\u5408\u308f\u305b",groupedColumnTooltip:"\u7e26\u68d2",stackedColumnTooltip:"\u30b9\u30bf\u30c3\u30af",normalizedColumnTooltip:"100%\u30b9\u30bf\u30c3\u30af",groupedBarTooltip:"\u6a2a\u68d2",stackedBarTooltip:"\u30b9\u30bf\u30c3\u30af",normalizedBarTooltip:"100% \u7a4d\u307f\u91cd\u306d",pieTooltip:"\u5186",donutTooltip:"\u30c9\u30fc\u30ca\u30c4",lineTooltip:"\u6298\u308c\u7dda",groupedAreaTooltip:"\u30a8\u30ea\u30a2",stackedAreaTooltip:"\u30b9\u30bf\u30c3\u30af",normalizedAreaTooltip:"100%\u30b9\u30bf\u30c3\u30af",scatterTooltip:"\u30b9\u30ad\u30e3\u30c3\u30bf\u30fc",bubbleTooltip:"\u30d0\u30d6\u30eb",histogramTooltip:"\u30d2\u30b9\u30c8\u30b0\u30e9\u30e0",radialColumnTooltip:"\u653e\u5c04\u72b6\u306e\u5217",radialBarTooltip:"\u30e9\u30b8\u30a2\u30eb\u30d0\u30fc",radarLineTooltip:"\u30ec\u30fc\u30c0\u30fc\u30e9\u30a4\u30f3",radarAreaTooltip:"\u30ec\u30fc\u30c0\u30fc\u30a8\u30ea\u30a2",nightingaleTooltip:"\u30ca\u30a4\u30c1\u30f3\u30b2\u30fc\u30eb",rangeBarTooltip:"\u30ec\u30f3\u30b8\u30d0\u30fc",rangeAreaTooltip:"\u30ec\u30f3\u30b8\u30a8\u30ea\u30a2",boxPlotTooltip:"\u30dc\u30c3\u30af\u30b9\u30d7\u30ed\u30c3\u30c8",treemapTooltip:"\u30c8\u30ec\u30de\u30c3\u30d7",sunburstTooltip:"\u30b5\u30f3\u30d0\u30fc\u30b9\u30c8",waterfallTooltip:"\u30a6\u30a9\u30fc\u30bf\u30fc\u30d5\u30a9\u30fc\u30eb",heatmapTooltip:"\u30d2\u30fc\u30c8\u30de\u30c3\u30d7",columnLineComboTooltip:"\u5217\u3068\u7dda",areaColumnComboTooltip:"\u30a8\u30ea\u30a2\uff06\u30ab\u30e9\u30e0",customComboTooltip:"\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30d3\u30cd\u30fc\u30b7\u30e7\u30f3",innerRadius:"\u5185\u5074\u534a\u5f84",startAngle:"\u958b\u59cb\u89d2\u5ea6",endAngle:"\u7d42\u4e86\u89d2\u5ea6",reverseDirection:"\u9006\u65b9\u5411",groupPadding:"\u30b0\u30eb\u30fc\u30d7\u30d1\u30c7\u30a3\u30f3\u30b0",seriesPadding:"\u30b7\u30ea\u30fc\u30ba\u30d1\u30c7\u30a3\u30f3\u30b0",tile:"\u30bf\u30a4\u30eb",whisker:"\u30a6\u30a3\u30b9\u30ab\u30fc",cap:"\u30ad\u30e3\u30c3\u30d7",capLengthRatio:"\u9577\u3055\u6bd4\u7387",labelPlacement:"\u914d\u7f6e",inside:"\u5185\u5074",outside:"\u5916\u5074",noDataToChart:"\u30b0\u30e9\u30d5\u5316\u53ef\u80fd\u306a\u30c7\u30fc\u30bf\u306f\u3042\u308a\u307e\u305b\u3093\u3002",pivotChartRequiresPivotMode:"\u30d4\u30dc\u30c3\u30c8\u30c1\u30e3\u30fc\u30c8\u306f\u30d4\u30dc\u30c3\u30c8\u30e2\u30fc\u30c9\u3092\u6709\u52b9\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002",chartSettingsToolbarTooltip:"\u30e1\u30cb\u30e5\u30fc",chartLinkToolbarTooltip:"\u30b0\u30ea\u30c3\u30c9\u306b\u30ea\u30f3\u30af",chartUnlinkToolbarTooltip:"\u30b0\u30ea\u30c3\u30c9\u304b\u3089\u30ea\u30f3\u30af\u3055\u308c\u3066\u3044\u306a\u3044",chartDownloadToolbarTooltip:"\u30b0\u30e9\u30d5\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9",chartEdit:"\u30b0\u30e9\u30d5\u306e\u7de8\u96c6",chartAdvancedSettings:"\u8a73\u7d30\u8a2d\u5b9a",chartLink:"\u30b0\u30ea\u30c3\u30c9\u3078\u306e\u30ea\u30f3\u30af",chartUnlink:"\u30b0\u30ea\u30c3\u30c9\u304b\u3089\u306e\u30ea\u30f3\u30af\u89e3\u9664",chartDownload:"\u30b0\u30e9\u30d5\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9",seriesChartType:"\u7cfb\u5217\u30c1\u30e3\u30fc\u30c8\u30bf\u30a4\u30d7",seriesType:"\u30b7\u30ea\u30fc\u30ba\u30bf\u30a4\u30d7",secondaryAxis:"\u7b2c2\u8ef8",seriesAdd:"\u7cfb\u5217\u306e\u8ffd\u52a0",categoryAdd:"\u30ab\u30c6\u30b4\u30ea\u30fc\u306e\u8ffd\u52a0",advancedSettings:"\u8a73\u7d30\u8a2d\u5b9a",direction:"\u65b9\u5411",horizontal:"\u6c34\u5e73",vertical:"\u5782\u76f4",seriesGroupType:"\u30b0\u30eb\u30fc\u30d7\u30bf\u30a4\u30d7",groupedSeriesGroupType:"\u30b0\u30eb\u30fc\u30d7\u5316",stackedSeriesGroupType:"\u30b9\u30bf\u30c3\u30af",normalizedSeriesGroupType:"100%\u30b9\u30bf\u30c3\u30af",ariaAdvancedFilterBuilderItem:"${variable}. \u30ec\u30d9\u30eb ${variable}. ENTER\u3092\u62bc\u3057\u3066\u7de8\u96c6\u3059\u308b\u3002",ariaAdvancedFilterBuilderItemValidation:"${variable} \u30ec\u30d9\u30eb ${variable}. ENTER\u3092\u62bc\u3057\u3066\u7de8\u96c6\u3057\u307e\u3059\u3002",ariaAdvancedFilterBuilderList:"\u9ad8\u5ea6\u306a\u30d5\u30a3\u30eb\u30bf-\u30d3\u30eb\u30c0\u306e\u30ea\u30b9\u30c8",ariaAdvancedFilterBuilderFilterItem:"\u30d5\u30a3\u30eb\u30bf\u30fc\u6761\u4ef6",ariaAdvancedFilterBuilderGroupItem:"\u30d5\u30a3\u30eb\u30bf\u30fc\u30b0\u30eb\u30fc\u30d7",ariaAdvancedFilterBuilderColumn:"\u5217",ariaAdvancedFilterBuilderOption:"\u30aa\u30d7\u30b7\u30e7\u30f3",ariaAdvancedFilterBuilderValueP:"\u5024",ariaAdvancedFilterBuilderJoinOperator:"\u7d50\u5408\u6f14\u7b97\u5b50",ariaAdvancedFilterInput:"\u9ad8\u5ea6\u306a\u30d5\u30a3\u30eb\u30bf\u30fc\u5165\u529b",ariaChecked:"\u30c1\u30a7\u30c3\u30af\u6e08\u307f",ariaColumn:"\u5217",ariaColumnGroup:"\u5217\u30b0\u30eb\u30fc\u30d7",ariaColumnFiltered:"\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u3055\u308c\u305f\u5217",ariaColumnSelectAll:"\u3059\u3079\u3066\u306e\u5217\u3092\u9078\u629e",ariaDateFilterInput:"\u65e5\u4ed8\u30d5\u30a3\u30eb\u30bf\u30fc\u5165\u529b",ariaDefaultListName:"\u30ea\u30b9\u30c8",
ariaFilterColumnsInput:"\u5165\u529b\u30ab\u30e9\u30e0\u306e\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0",ariaFilterFromValue:"\u5024\u304b\u3089\u306e\u30d5\u30a3\u30eb\u30bf\u30fc",ariaFilterInput:"\u30d5\u30a3\u30eb\u30bf\u30fc\u5165\u529b",ariaFilterList:"\u30d5\u30a3\u30eb\u30bf\u30fc\u30ea\u30b9\u30c8",ariaFilterToValue:"\u5024\u3078\u306e\u30d5\u30a3\u30eb\u30bf\u30fc",ariaFilterValue:"\u30d5\u30a3\u30eb\u30bf\u30fc\u5024",ariaFilterMenuOpen:"\u30d5\u30a3\u30eb\u30bf\u30fc\u30e1\u30cb\u30e5\u30fc\u3092\u958b\u304f",ariaFilteringOperator:"\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u6f14\u7b97\u5b50",ariaHidden:"\u975e\u8868\u793a",ariaIndeterminate:"\u4e0d\u5b9a",ariaInputEditor:"\u5165\u529b\u30a8\u30c7\u30a3\u30bf\u30fc",ariaMenuColumn:"ALT DOWN\u30ad\u30fc\u3067\u30ab\u30e9\u30e0\u30e1\u30cb\u30e5\u30fc\u3092\u958b\u304f",ariaFilterColumn:"CTRL ENTER\u30ad\u30fc\u3092\u62bc\u3057\u3066\u30d5\u30a3\u30eb\u30bf\u30fc\u3092\u958b\u304f",ariaRowDeselect:"\u3053\u306e\u884c\u306e\u9078\u629e\u3092\u89e3\u9664\u3059\u308b\u306b\u306f\u3001\u30b9\u30da\u30fc\u30b9\u30ad\u30fc\u3092\u62bc\u3057\u307e\u3059\u3002",ariaRowSelectAll:"\u30b9\u30da\u30fc\u30b9\u30ad\u30fc\u3092\u62bc\u3059\u3068\u3001\u3059\u3079\u3066\u306e\u884c\u306e\u9078\u629e\u304c\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002",ariaRowToggleSelection:"\u30b9\u30da\u30fc\u30b9\u30ad\u30fc\u3067\u884c\u306e\u9078\u629e\u3092\u5207\u308a\u66ff\u3048\u308b",ariaRowSelect:"\u3053\u306e\u884c\u3092\u9078\u629e\u3059\u308b\u306b\u306f\u3001SPACE\u30ad\u30fc\u3092\u62bc\u3057\u307e\u3059\u3002",ariaRowSelectionDisabled:"\u3053\u306e\u884c\u306f\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002",ariaSearch:"\u691c\u7d22",ariaSortableColumn:"ENTER\u30ad\u30fc\u3067\u4e26\u3079\u66ff\u3048",ariaToggleVisibility:"\u30b9\u30da\u30fc\u30b9\u30ad\u30fc\u3067\u8868\u793a/\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b",ariaToggleCellValue:"SPACE\u30ad\u30fc\u3092\u62bc\u3059\u3068\u30bb\u30eb\u306e\u5024\u304c\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002",ariaUnchecked:"\u30c1\u30a7\u30c3\u30af\u306a\u3057",ariaVisible:"\u53ef\u8996",ariaSearchFilterValues:"\u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u30fc\u306e\u5024",ariaPageSizeSelectorLabel:"\u30da\u30fc\u30b8\u30b5\u30a4\u30ba",ariaChartMenuClose:"\u30c1\u30e3\u30fc\u30c8\u7de8\u96c6\u30e1\u30cb\u30e5\u30fc\u3092\u9589\u3058\u308b",ariaSkeletonCellLoadingFailed:"\u884c\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f",ariaSkeletonCellLoading:"\u884c\u30c7\u30fc\u30bf\u306e\u8aad\u307f\u8fbc\u307f\u4e2d",ariaRowGroupDropZonePanelLabel:"\u884c\u30b0\u30eb\u30fc\u30d7",ariaValuesDropZonePanelLabel:"\u96c6\u8a08\u5024",ariaPivotDropZonePanelLabel:"\u5217\u30e9\u30d9\u30eb",ariaDropZoneColumnComponentDescription:"\u524a\u9664\u3059\u308b\u306b\u306fDELETE\u3092\u62bc\u3059",ariaDropZoneColumnValueItemDescription:"ENTER\u3092\u62bc\u3057\u3066\u96c6\u8a08\u30bf\u30a4\u30d7\u3092\u5909\u66f4\u3059\u308b",ariaDropZoneColumnGroupItemDescription:"ENTER\u3092\u62bc\u3057\u3066\u4e26\u3079\u66ff\u3048\u308b",ariaDropZoneColumnComponentAggFuncSeparator:"\u306e ",ariaDropZoneColumnComponentSortAscending:"\u6607\u9806",ariaDropZoneColumnComponentSortDescending:"\u964d\u9806",ariaLabelColumnMenu:"\u30b3\u30e9\u30e0\u30e1\u30cb\u30e5\u30fc",ariaLabelColumnFilter:"\u30ab\u30e9\u30e0\u30d5\u30a3\u30eb\u30bf\u30fc",ariaLabelCellEditor:"\u30bb\u30eb\u30a8\u30c7\u30a3\u30bf",ariaLabelDialog:"\u30c0\u30a4\u30a2\u30ed\u30b0",ariaLabelSelectField:"\u30bb\u30ec\u30af\u30c8\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9",ariaLabelRichSelectField:"\u30ea\u30c3\u30c1\u30fb\u30bb\u30ec\u30af\u30c8\u30fb\u30d5\u30a3\u30fc\u30eb\u30c9",ariaLabelTooltip:"\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7",ariaLabelContextMenu:"\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30e1\u30cb\u30e5\u30fc",ariaLabelSubMenu:"\u30b5\u30d6\u30e1\u30cb\u30e5\u30fc",ariaLabelAggregationFunction:"\u96c6\u8a08\u6a5f\u80fd",ariaLabelAdvancedFilterAutocomplete:"\u9ad8\u5ea6\u306a\u30d5\u30a3\u30eb\u30bf\u30fc\u30aa\u30fc\u30c8\u30b3\u30f3\u30d7\u30ea\u30fc\u30c8",ariaLabelAdvancedFilterBuilderAddField:"\u30a2\u30c9\u30d0\u30f3\u30b9\u30c9\u30fb\u30d5\u30a3\u30eb\u30bf\u30fc\u30fb\u30d3\u30eb\u30c0\u30fc \u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u8ffd\u52a0",ariaLabelAdvancedFilterBuilderColumnSelectField:"\u5217\u9078\u629e\u30d5\u30a3\u30fc\u30eb\u30c9",ariaLabelAdvancedFilterBuilderOptionSelectField:"\u30aa\u30d7\u30b7\u30e7\u30f3\u9078\u629e\u30d5\u30a3\u30fc\u30eb\u30c9",ariaLabelAdvancedFilterBuilderJoinSelectField:"\u30a2\u30c9\u30d0\u30f3\u30b9\u30c9\u30fb\u30d5\u30a3\u30eb\u30bf\u30fb\u30d3\u30eb\u30c0\u30fc Join Operator Select Field",ariaColumnPanelList:"\u30ab\u30e9\u30e0\u30ea\u30b9\u30c8",ariaFilterPanelList:"\u30d5\u30a3\u30eb\u30bf\u30fc\u30ea\u30b9\u30c8",thousandSeparator:",",decimalSeparator:".",TRUE:"\u771f",FALSE:"\u507d",invalidDate:"\u7121\u52b9\u306a\u65e5\u4ed8",invalidNumber:"\u7121\u52b9\u306a\u756a\u53f7",january:"1\u6708",february:"2\u6708",march:"3\u6708",april:"4\u6708",may:"5\u6708",june:"6\u6708",july:"7\u6708",august:"8\u6708",september:"9\u6708",october:"10\u6708",november:"11\u6708",december:"12\u6708",timeFormatSlashesDDMMYYYY:"DD/MM/YYYY",timeFormatSlashesMMDDYYYY:"MM/DD/YYYY",timeFormatSlashesDDMMYY:"DD/MM/YY",timeFormatSlashesMMDDYY:"MM/DD/YY",timeFormatDotsDDMYY:"DD.M.YY",timeFormatDotsMDDYY:"M.DD.YY",timeFormatDashesYYYYMMDD:"YYYY-MM-DD",timeFormatSpacesDDMMMMYYYY:"DD MMMM YYYY",timeFormatHHMMSS:"HH MM SS",timeFormatHHMMSSAmPm:"HH MM SS AM/PM"}}},function(D){"use strict";function O(e){var t=0|e;return 0<e||e===t?t:t-1}function S(e){for(var t,n,i=1,a=e.length,s=e[0]+"";i<a;){for(t=e[i++]+"",n=z-t.length;n--;t="0"+t);s+=t}for(a=s.length;48===s.charCodeAt(--a););return s.slice(0,a+1||1)}function R(e,t){var n,i,a=e.c,s=t.c,o=e.s,r=t.s,l=e.e,c=t.e;if(!o||!r)return null;if(n=a&&!a[0],i=s&&!s[0],n||i)return n?i?0:-r:o;if(o!=r)return o;if(n=o<0,i=l==c,!a||!s)return i?0:!a^n?1:-1;if(!i)return c<l^n?1:-1;for(r=(l=a.length)<(c=s.length)?l:c,o=0;o<r;o++)if(a[o]!=s[o])return a[o]>s[o]^n?1:-1;return l==c?0:c<l^n?1:-1}function B(e,t,n,i){if(e<t||n<e||e!==P(e))throw Error(U+(i||"Argument")+("number"==typeof e?e<t||n<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function N(e){var t=e.c.length-1;return O(e.e/z)==t&&e.c[t]%2!=0}function F(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function K(e,t,n){var i,a;if(t<0){for(a=n+".";++t;a+=n);e=a+e}else if(++t>(i=e.length)){for(a=n,t-=i;--t;a+=n);e+=a}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}var e,M=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,L=Math.ceil,P=Math.floor,U="[BigNumber Error] ",H=U+"Number primitive has more than 15 significant digits: ",Q=1e14,z=14,q=9007199254740991,W=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Y=1e7,V=1e9;(e=function D(e){function x(e,t){var n,i,a,s,o,r,l,c,d=this;if(!(d instanceof x))return new x(e,t);if(null==t){if(e&&!0===e._isBigNumber)return d.s=e.s,void(!e.c||e.e>w?d.c=d.e=null:e.e<$?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice()));if((r="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,o=e;10<=o;o/=10,s++);return void(w<s?d.c=d.e=null:(d.e=s,d.c=[e]))}c=String(e)}else{if(!M.test(c=String(e)))return _(d,c,r);d.s=45==c.charCodeAt(0)?(c=c.slice(1),-1):1}-1<(s=c.indexOf("."))&&(c=c.replace(".","")),0<(o=c.search(/e/i))?(s<0&&(s=o),s+=+c.slice(o+1),c=c.substring(0,o)):s<0&&(s=c.length)}else{if(B(t,2,T.length,"Base"),10==t)return I(d=new x(e),v+d.e+1,y);if(c=String(e),r="number"==typeof e){if(0*e!=0)return _(d,c,r,t);if(d.s=1/e<0?(c=c.slice(1),-1):1,x.DEBUG&&15<c.replace(/^0\.0*|\./,"").length)throw Error(H+e)}else d.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1;for(n=T.slice(0,t),s=o=0,l=c.length;o<l;o++)if(n.indexOf(i=c.charAt(o))<0){if("."==i){if(s<o){s=l;continue}}else if(!a&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){a=!0,o=-1,s=0;continue}return _(d,String(e),r,t)}r=!1,-1<(s=(c=u(c,t,10,d.s)).indexOf("."))?c=c.replace(".",""):s=c.length}for(o=0;48===c.charCodeAt(o);o++);for(l=c.length;48===c.charCodeAt(--l););if(c=c.slice(o,++l)){if(l-=o,r&&x.DEBUG&&15<l&&(q<e||e!==P(e)))throw Error(H+d.s*e);if((s=s-o-1)>w)d.c=d.e=null;else if(s<$)d.c=[d.e=0];else{if(d.e=s,d.c=[],o=(s+1)%z,s<0&&(o+=z),o<l){for(o&&d.c.push(+c.slice(0,o)),l-=z;o<l;)d.c.push(+c.slice(o,o+=z));o=z-(c=c.slice(o)).length}else o-=l;for(;o--;c+="0");d.c.push(+c)}}else d.c=[d.e=0]}function n(e,t,n,i){var a,s,o,r,l;if(null==n?n=y:B(n,0,8),!e.c)return e.toString();if(a=e.c[0],o=e.e,null==t)l=S(e.c),l=1==i||2==i&&(o<=p||g<=o)?F(l,o):K(l,o,"0");else if(s=(e=I(new x(e),t,n)).e,r=(l=S(e.c)).length,1==i||2==i&&(t<=s||s<=p)){for(;r<t;l+="0",r++);l=F(l,s)}else if(t-=o,l=K(l,s,"0"),r<s+1){if(0<--t)for(l+=".";t--;l+="0");}else if(0<(t+=s-r))for(s+1==r&&(l+=".");t--;l+="0");return e.s<0&&a?"-"+l:l}function t(e,t){for(var n,i=1,a=new x(e[0]);i<e.length;i++){if(!(n=new x(e[i])).s){a=n;break}t.call(a,n)&&(a=n)}return a}function b(e,t,n){for(var i=1,a=t.length;!t[--a];t.pop());for(a=t[0];10<=a;a/=10,i++);return(n=i+n*z-1)>w?e.c=e.e=null:n<$?e.c=[e.e=0]:(e.e=n,e.c=t),e}function I(e,t,n,i){var a,s,o,r,l,c,d,u=e.c,_=W;if(u){e:{for(a=1,r=u[0];10<=r;r/=10,a++);if((s=t-a)<0)s+=z,o=t,d=(l=u[c=0])/_[a-o-1]%10|0;else if((c=L((s+1)/z))>=u.length){if(!i)break e;for(;u.length<=c;u.push(0));l=d=0,o=(s%=z)-z+(a=1)}else{for(l=r=u[c],a=1;10<=r;r/=10,a++);d=(o=(s%=z)-z+a)<0?0:l/_[a-o-1]%10|0}if(i=i||t<0||null!=u[c+1]||(o<0?l:l%_[a-o-1]),i=n<4?(d||i)&&(0==n||n==(e.s<0?3:2)):5<d||5==d&&(4==n||i||6==n&&(0<s?0<o?l/_[a-o]:0:u[c-1])%10&1||n==(e.s<0?8:7)),t<1||!u[0])return u.length=0,i?(t-=e.e+1,u[0]=_[(z-t%z)%z],e.e=-t||0):u[0]=e.e=0,e;if(0==s?(u.length=c,r=1,c--):(u.length=c+1,r=_[z-s],u[c]=0<o?P(l/_[a-o]%_[o])*r:0),i)for(;;){if(0==c){for(s=1,o=u[0];10<=o;o/=10,s++);for(o=u[0]+=r,r=1;10<=o;o/=10,r++);s!=r&&(e.e++,u[0]==Q&&(u[0]=1));break}if(u[c]+=r,u[c]!=Q)break;u[c--]=0,r=1}for(s=u.length;0===u[--s];u.pop());}e.e>w?e.c=e.e=null:e.e<$&&(e.c=[e.e=0])}return e}function f(e){var t,n=e.e;return null===n?e.toString():(t=S(e.c),t=n<=p||g<=n?F(t,n):K(t,n,"0"),e.s<0?"-"+t:t)}var A,u,_,i,c,o,r,l,d,h,a=x.prototype={constructor:x,toString:null,valueOf:null},m=new x(1),v=20,y=4,p=-7,g=21,$=-1e7,w=1e7,k=!1,s=1,C=0,E={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xa0",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz";return x.clone=D,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(e){var t,n;if(null!=e){if("object"!=typeof e)throw Error(U+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(B(n=e[t],0,V,t),v=n),e.hasOwnProperty(t="ROUNDING_MODE")&&(B(n=e[t],0,8,t),y=n),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((n=e[t])&&n.pop?(B(n[0],-V,0,t),B(n[1],0,V,t),p=n[0],g=n[1]):(B(n,-V,V,t),p=-(g=n<0?-n:n))),e.hasOwnProperty(t="RANGE"))if((n=e[t])&&n.pop)B(n[0],-V,-1,t),B(n[1],1,V,t),$=n[0],w=n[1];else{if(B(n,-V,V,t),!n)throw Error(U+t+" cannot be zero: "+n);$=-(w=n<0?-n:n)}if(e.hasOwnProperty(t="CRYPTO")){if((n=e[t])!==!!n)throw Error(U+t+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw k=!n,Error(U+"crypto unavailable");k=n}else k=n}if(e.hasOwnProperty(t="MODULO_MODE")&&(B(n=e[t],0,9,t),s=n),e.hasOwnProperty(t="POW_PRECISION")&&(B(n=e[t],0,V,t),C=n),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(n=e[t]))throw Error(U+t+" not an object: "+n);E=n}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(n=e[t])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(U+t+" invalid: "+n);T=n}}return{DECIMAL_PLACES:v,ROUNDING_MODE:y,EXPONENTIAL_AT:[p,g],RANGE:[$,w],CRYPTO:k,MODULO_MODE:s,POW_PRECISION:C,FORMAT:E,ALPHABET:T}},x.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!x.DEBUG)return!0;var t,n,i=e.c,a=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(i)){if((1===s||-1===s)&&-V<=a&&a<=V&&a===P(a)){if(0===i[0]){if(0===a&&1===i.length)return!0;break e}if((t=(a+1)%z)<1&&(t+=z),String(i[0]).length==t){for(t=0;t<i.length;t++)if((n=i[t])<0||Q<=n||n!==P(n))break e;if(0!==n)return!0}}}else if(null===i&&null===a&&(null===s||1===s||-1===s))return!0;throw Error(U+"Invalid BigNumber: "+e)},x.maximum=x.max=function(){return t(arguments,a.lt)},x.minimum=x.min=function(){return t(arguments,a.gt)},x.random=(i=9007199254740992,c=Math.random()*i&2097151?function(){return P(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,n,i,a,s,o=0,r=[],l=new x(m);if(null==e?e=v:B(e,0,V),a=L(e/z),k)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));o<a;)9e15<=(s=131072*t[o]+(t[o+1]>>>11))?(n=crypto.getRandomValues(new Uint32Array(2)),t[o]=n[0],t[o+1]=n[1]):(r.push(s%1e14),o+=2);o=a/2}else{if(!crypto.randomBytes)throw k=!1,Error(U+"crypto unavailable");for(t=crypto.randomBytes(a*=7);o<a;)9e15<=(s=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])?crypto.randomBytes(7).copy(t,o):(r.push(s%1e14),o+=7);o=a/7}if(!k)for(;o<a;)(s=c())<9e15&&(r[o++]=s%1e14);for(a=r[--o],e%=z,a&&e&&(s=W[z-e],r[o]=P(a/s)*s);0===r[o];r.pop(),o--);if(o<0)r=[i=0];else{for(i=-1;0===r[0];r.splice(0,1),i-=z);for(o=1,s=r[0];10<=s;s/=10,o++);o<z&&(i-=z-o)}return l.e=i,l.c=r,l}),x.sum=function(){for(var e=1,t=arguments,n=new x(t[0]);e<t.length;)n=n.plus(t[e++]);return n},u=function(){function m(e,t,n,i){for(var a,s,o=[0],r=0,l=e.length;r<l;){for(s=o.length;s--;o[s]*=t);for(o[0]+=i.indexOf(e.charAt(r++)),a=0;a<o.length;a++)o[a]>n-1&&(null==o[a+1]&&(o[a+1]=0),o[a+1]+=o[a]/n|0,o[a]%=n)}return o.reverse()}var g="0123456789";return function(e,t,n,i,a){var s,o,r,l,c,d,u,_,h=e.indexOf("."),p=v,f=y;for(0<=h&&(l=C,C=0,e=e.replace(".",""),d=(_=new x(t)).pow(e.length-h),C=l,_.c=m(K(S(d.c),d.e,"0"),10,n,g),_.e=_.c.length),r=l=(u=m(e,t,n,a?(s=T,g):(s=g,T))).length;0==u[--l];u.pop());if(!u[0])return s.charAt(0);if(h<0?--r:(d.c=u,d.e=r,d.s=i,u=(d=A(d,_,p,f,n)).c,c=d.r,r=d.e),h=u[o=r+p+1],l=n/2,c=c||o<0||null!=u[o+1],c=f<4?(null!=h||c)&&(0==f||f==(d.s<0?3:2)):l<h||h==l&&(4==f||c||6==f&&1&u[o-1]||f==(d.s<0?8:7)),o<1||!u[0])e=c?K(s.charAt(1),-p,s.charAt(0)):s.charAt(0);else{if(u.length=o,c)for(--n;++u[--o]>n;)u[o]=0,o||(++r,u=[1].concat(u));for(l=u.length;!u[--l];);for(h=0,e="";h<=l;e+=s.charAt(u[h++]));e=K(e,r,s.charAt(0))}return e}}(),A=function(){function C(e,t,n){var i,a,s,o,r=0,l=e.length,c=t%Y,d=t/Y|0;for(e=e.slice();l--;)r=((a=c*(s=e[l]%Y)+(i=d*s+(o=e[l]/Y|0)*c)%Y*Y+r)/n|0)+(i/Y|0)+d*o,e[l]=a%n;return r&&(e=[r].concat(e)),e}function E(e,t,n,i){var a,s;if(n!=i)s=i<n?1:-1;else for(a=s=0;a<n;a++)if(e[a]!=t[a]){s=e[a]>t[a]?1:-1;break}return s}function T(e,t,n,i){for(var a=0;n--;)e[n]-=a,a=e[n]<t[n]?1:0,e[n]=a*i+e[n]-t[n];for(;!e[0]&&1<e.length;e.splice(0,1));}return function(e,t,n,i,a){var s,o,r,l,c,d,u,_,h,p,f,m,g,A,v,b,y,$=e.s==t.s?1:-1,w=e.c,k=t.c;if(!(w&&w[0]&&k&&k[0]))return new x(e.s&&t.s&&(w?!k||w[0]!=k[0]:k)?w&&0==w[0]||!k?0*$:$/0:NaN);for(h=(_=new x($)).c=[],$=n+(o=e.e-t.e)+1,a||(a=Q,o=O(e.e/z)-O(t.e/z),$=$/z|0),r=0;k[r]==(w[r]||0);r++);if(k[r]>(w[r]||0)&&o--,$<0)h.push(1),l=!0;else{for(A=w.length,b=k.length,$+=2,1<(c=P(a/(k[r=0]+1)))&&(k=C(k,c,a),w=C(w,c,a),b=k.length,A=w.length),g=b,f=(p=w.slice(0,b)).length;f<b;p[f++]=0);y=k.slice(),y=[0].concat(y),v=k[0],k[1]>=a/2&&v++;do{if(c=0,(s=E(k,p,b,f))<0){if(m=p[0],b!=f&&(m=m*a+(p[1]||0)),1<(c=P(m/v)))for(a<=c&&(c=a-1),u=(d=C(k,c,a)).length,f=p.length;1==E(d,p,u,f);)c--,T(d,b<u?y:k,u,a),u=d.length,s=1;else 0==c&&(s=c=1),u=(d=k.slice()).length;if(u<f&&(d=[0].concat(d)),T(p,d,f,a),f=p.length,-1==s)for(;E(k,p,b,f)<1;)c++,T(p,b<f?y:k,f,a),f=p.length}else 0===s&&(c++,p=[0]);h[r++]=c,p[0]?p[f++]=w[g]||0:(p=[w[g]],f=1)}while((g++<A||null!=p[0])&&$--);l=null!=p[0],h[0]||h.splice(0,1)}if(a==Q){for(r=1,$=h[0];10<=$;$/=10,r++);I(_,n+(_.e=r+o*z-1)+1,i,l)}else _.e=o,_.r=+l;return _}}(),o=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,l=/^\.([^.]+)$/,d=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,_=function(e,t,n,i){var a,s=n?t:t.replace(h,"");if(d.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!n&&(s=s.replace(o,function(e,t,n){return a="x"==(n=n.toLowerCase())?16:"b"==n?2:8,i&&i!=a?e:t}),i&&(a=i,s=s.replace(r,"$1").replace(l,"0.$1")),t!=s))return new x(s,a);if(x.DEBUG)throw Error(U+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},a.absoluteValue=a.abs=function(){var e=new x(this);return e.s<0&&(e.s=1),e},a.comparedTo=function(e,t){return R(this,new x(e,t))},a.decimalPlaces=a.dp=function(e,t){var n,i,a,s=this;if(null!=e)return B(e,0,V),null==t?t=y:B(t,0,8),I(new x(s),e+s.e+1,t);if(!(n=s.c))return null;if(i=((a=n.length-1)-O(this.e/z))*z,a=n[a])for(;a%10==0;a/=10,i--);return i<0&&(i=0),i},a.dividedBy=a.div=function(e,t){return A(this,new x(e,t),v,y)},a.dividedToIntegerBy=a.idiv=function(e,t){return A(this,new x(e,t),0,1)},a.exponentiatedBy=a.pow=function(e,t){var n,i,a,s,o,r,l,c,d=this;if((e=new x(e)).c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+f(e));if(null!=t&&(t=new x(t)),o=14<e.e,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!e.c||!e.c[0])return c=new x(Math.pow(+f(d),o?2-N(e):+f(e))),t?c.mod(t):c;if(r=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new x(NaN);(i=!r&&d.isInteger()&&t.isInteger())&&(d=d.mod(t))}else{if(9<e.e&&(0<d.e||d.e<-1||(0==d.e?1<d.c[0]||o&&24e7<=d.c[1]:d.c[0]<8e13||o&&d.c[0]<=9999975e7)))return s=d.s<0&&N(e)?-0:0,-1<d.e&&(s=1/s),new x(r?1/s:s);C&&(s=L(C/z+2))}for(o?(n=new x(.5),r&&(e.s=1),l=N(e)):l=(a=Math.abs(+f(e)))%2,c=new x(m);;){if(l){if(!(c=c.times(d)).c)break;s?c.c.length>s&&(c.c.length=s):i&&(c=c.mod(t))}if(a){if(0===(a=P(a/2)))break;l=a%2}else if(I(e=e.times(n),e.e+1,1),14<e.e)l=N(e);else{if(0==(a=+f(e)))break;l=a%2}d=d.times(d),s?d.c&&d.c.length>s&&(d.c.length=s):i&&(d=d.mod(t))}return i?c:(r&&(c=m.div(c)),t?c.mod(t):s?I(c,C,y,undefined):c)},a.integerValue=function(e){var t=new x(this);return null==e?e=y:B(e,0,8),I(t,t.e+1,e)},a.isEqualTo=a.eq=function(e,t){return 0===R(this,new x(e,t))},a.isFinite=function(){return!!this.c},a.isGreaterThan=a.gt=function(e,t){return 0<R(this,new x(e,t))},a.isGreaterThanOrEqualTo=a.gte=function(e,t){return 1===(t=R(this,new x(e,t)))||0===t},a.isInteger=function(){return!!this.c&&O(this.e/z)>this.c.length-2},a.isLessThan=a.lt=function(e,t){return R(this,new x(e,t))<0},a.isLessThanOrEqualTo=a.lte=function(e,t){return-1===(t=R(this,new x(e,t)))||0===t},a.isNaN=function(){return!this.s},a.isNegative=function(){return this.s<0},a.isPositive=function(){return 0<this.s},a.isZero=function(){return!!this.c&&0==this.c[0]},a.minus=function(e,t){var n,i,a,s,o=this,r=o.s;if(t=(e=new x(e,t)).s,!r||!t)return new x(NaN);if(r!=t)return e.s=-t,o.plus(e);var l=o.e/z,c=e.e/z,d=o.c,u=e.c;if(!l||!c){if(!d||!u)return d?(e.s=-t,e):new x(u?o:NaN);if(!d[0]||!u[0])return u[0]?(e.s=-t,e):new x(d[0]?o:3==y?-0:0)}if(l=O(l),c=O(c),d=d.slice(),r=l-c){for((s=r<0)?(r=-r,a=d):(c=l,a=u),a.reverse(),t=r;t--;a.push(0));a.reverse()}else for(i=(s=(r=d.length)<(t=u.length))?r:t,r=t=0;t<i;t++)if(d[t]!=u[t]){s=d[t]<u[t];break}if(s&&(a=d,d=u,u=a,e.s=-e.s),0<(t=(i=u.length)-(n=d.length)))for(;t--;d[n++]=0);for(t=Q-1;r<i;){if(d[--i]<u[i]){for(n=i;n&&!d[--n];d[n]=t);--d[n],d[i]+=Q}d[i]-=u[i]}for(;0==d[0];d.splice(0,1),--c);return d[0]?b(e,d,c):(e.s=3==y?-1:1,e.c=[e.e=0],e)},a.modulo=a.mod=function(e,t){var n,i,a=this;return e=new x(e,t),!a.c||!e.s||e.c&&!e.c[0]?new x(NaN):!e.c||a.c&&!a.c[0]?new x(a):(9==s?(i=e.s,e.s=1,n=A(a,e,0,3),e.s=i,n.s*=i):n=A(a,e,0,s),(e=a.minus(n.times(e))).c[0]||1!=s||(e.s=a.s),e)},a.multipliedBy=a.times=function(e,t){var n,i,a,s,o,r,l,c,d,u,_,h,p,f,m,g=this,A=g.c,v=(e=new x(e,t)).c;if(!(A&&v&&A[0]&&v[0]))return!g.s||!e.s||A&&!A[0]&&!v||v&&!v[0]&&!A?e.c=e.e=e.s=null:(e.s*=g.s,A&&v?(e.c=[0],e.e=0):e.c=e.e=null),e;for(i=O(g.e/z)+O(e.e/z),e.s*=g.s,(l=A.length)<(u=v.length)&&(p=A,A=v,v=p,a=l,l=u,u=a),a=l+u,p=[];a--;p.push(0));for(f=Q,m=Y,a=u;0<=--a;){for(n=0,_=v[a]%m,h=v[a]/m|0,s=a+(o=l);a<s;)n=((c=_*(c=A[--o]%m)+(r=h*c+(d=A[o]/m|0)*_)%m*m+p[s]+n)/f|0)+(r/m|0)+h*d,p[s--]=c%f;p[s]=n}return n?++i:p.splice(0,1),b(e,p,i)},a.negated=function(){var e=new x(this);return e.s=-e.s||null,e},a.plus=function(e,t){var n,i=this,a=i.s;if(t=(e=new x(e,t)).s,!a||!t)return new x(NaN);if(a!=t)return e.s=-t,i.minus(e);var s=i.e/z,o=e.e/z,r=i.c,l=e.c;if(!s||!o){if(!r||!l)return new x(a/0);if(!r[0]||!l[0])return l[0]?e:new x(r[0]?i:0*a)}if(s=O(s),o=O(o),r=r.slice(),a=s-o){for(0<a?(o=s,n=l):(a=-a,n=r),n.reverse();a--;n.push(0));n.reverse()}for((a=r.length)-(t=l.length)<0&&(n=l,l=r,r=n,t=a),a=0;t;)a=(r[--t]=r[t]+l[t]+a)/Q|0,r[t]=Q===r[t]?0:r[t]%Q;return a&&(r=[a].concat(r),++o),b(e,r,o)},a.precision=a.sd=function(e,t){var n,i,a,s=this;if(null!=e&&e!==!!e)return B(e,1,V),null==t?t=y:B(t,0,8),I(new x(s),e,t);if(!(n=s.c))return null;if(i=(a=n.length-1)*z+1,a=n[a]){for(;a%10==0;a/=10,i--);for(a=n[0];10<=a;a/=10,i++);}return e&&s.e+1>i&&(i=s.e+1),i},a.shiftedBy=function(e){return B(e,-q,q),this.times("1e"+e)},a.squareRoot=a.sqrt=function(){var e,t,n,i,a,s=this,o=s.c,r=s.s,l=s.e,c=v+4,d=new x("0.5");if(1!==r||!o||!o[0])return new x(!r||r<0&&(!o||o[0])?NaN:o?s:1/0);if(0==(r=Math.sqrt(+f(s)))||r==1/0?(((t=S(o)).length+l)%2==0&&(t+="0"),r=Math.sqrt(+t),l=O((l+1)/2)-(l<0||l%2),n=new x(t=r==1/0?"1e"+l:(t=r.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new x(r+""),n.c[0])for((r=(l=n.e)+c)<3&&(r=0);;)if(a=n,n=d.times(a.plus(A(s,a,c,1))),S(a.c).slice(0,r)===(t=S(n.c)).slice(0,r)){if(n.e<l&&--r,"9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(I(n,n.e+v+2,1),e=!n.times(n).eq(s));break}if(!i&&(I(a,a.e+v+2,0),a.times(a).eq(s))){n=a;break}c+=4,r+=4,i=1}return I(n,n.e+v+1,y,e)},a.toExponential=function(e,t){return null!=e&&(B(e,0,V),e++),n(this,e,t,1)},a.toFixed=function(e,t){return null!=e&&(B(e,0,V),e=e+this.e+1),n(this,e,t)},a.toFormat=function(e,t,n){var i,a=this;if(null==n)null!=e&&t&&"object"==typeof t?(n=t,t=null):e&&"object"==typeof e?(n=e,e=t=null):n=E;else if("object"!=typeof n)throw Error(U+"Argument not an object: "+n);if(i=a.toFixed(e,t),a.c){var s,o=i.split("."),r=+n.groupSize,l=+n.secondaryGroupSize,c=n.groupSeparator||"",d=o[0],u=o[1],_=a.s<0,h=_?d.slice(1):d,p=h.length;if(l&&(s=r,r=l,p-=l=s),0<r&&0<p){for(s=p%r||r,d=h.substr(0,s);s<p;s+=r)d+=c+h.substr(s,r);0<l&&(d+=c+h.slice(s)),_&&(d="-"+d)}i=u?d+(n.decimalSeparator||"")+((l=+n.fractionGroupSize)?u.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):u):d}return(n.prefix||"")+i+(n.suffix||"")},a.toFraction=function(e){var t,n,i,a,s,o,r,l,c,d,u,_,h=this,p=h.c;if(null!=e&&(!(r=new x(e)).isInteger()&&(r.c||1!==r.s)||r.lt(m)))throw Error(U+"Argument "+(r.isInteger()?"out of range: ":"not an integer: ")+f(r));if(!p)return new x(h);for(t=new x(m),c=n=new x(m),i=l=new x(m),_=S(p),s=t.e=_.length-h.e-1,t.c[0]=W[(o=s%z)<0?z+o:o],e=!e||0<r.comparedTo(t)?0<s?t:c:r,o=w,w=1/0,r=new x(_),l.c[0]=0;d=A(r,t,0,1),1!=(a=n.plus(d.times(i))).comparedTo(e);)n=i,i=a,c=l.plus(d.times(a=c)),l=a,t=r.minus(d.times(a=t)),r=a;return a=A(e.minus(n),i,0,1),l=l.plus(a.times(c)),n=n.plus(a.times(i)),l.s=c.s=h.s,u=A(c,i,s*=2,y).minus(h).abs().comparedTo(A(l,n,s,y).minus(h).abs())<1?[c,i]:[l,n],w=o,u},a.toNumber=function(){return+f(this)},a.toPrecision=function(e,t){return null!=e&&B(e,1,V),n(this,e,t,2)},a.toString=function(e){var t,n=this,i=n.s,a=n.e;return null===a?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=a<=p||g<=a?F(S(n.c),a):K(S(n.c),a,"0"):10===e?t=K(S((n=I(new x(n),v+a+1,y)).c),n.e,"0"):(B(e,2,T.length,"Base"),t=u(K(S(n.c),a,"0"),10,e,i,!0)),i<0&&n.c[0]&&(t="-"+t)),t},a.valueOf=a.toJSON=function(){return f(this)},a._isBigNumber=!0,j&&(a[Symbol.toStringTag]="BigNumber",a[Symbol["for"]("nodejs.util.inspect.custom")]=a.valueOf),null!=e&&x.set(e),x}())["default"]=e.BigNumber=e,"function"==typeof define&&define.amd?define(function(){return e}):"undefined"!=typeof module&&module.exports?module.exports=e:(D||(D="undefined"!=typeof self&&self?self:window),D.BigNumber=e)}(this),App.front_business_cards={simplyBusinessCardFormFields:["client_id","organization_name","post","family_name","first_name","first_name_kana","family_name_kana","email","tel","mobile_tel","zip","pref_id","address","url","note","tags"],index:function(){function t(e){for(var t=e+"=",n=decodeURIComponent(document.cookie).split(";"),i=0;i<n.length;i++){for(var a=n[i];" "===a.charAt(0);)a=a.substring(1);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return""}function e(e,t,n){var i=new Date;i.setDate(i.getDate()+n);var a=e+"="+t+"; expires="+i.toUTCString()+"; path=/";document.cookie=a}App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_business_cards",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("business_cards"),App.concerns.load_objects(this),App.concerns.change_display_number("form_search_business_cards"),App.concerns.change_order("form_search_business_cards"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),$("#search_status").select2(),$("#search_pref_ids").select2(),$("#search_open_status").select2(),$("#search_registration_kbn").select2(),$("#search_request_express_mode").select2(),App.concerns.select_search("search_client_id"),App.concerns.select_search_disable_user("search_owner_user_ids"),$("#search_lead_source_kbn_ids").select2({width:"100%",placeholder:$("#search_lead_source_kbn_ids").data("placeholder")}),this.change_client_index(),App.tags_bulk_deletion_visible_fields.init_tags("form_checked_business_cards"),$("[data-category='latest']").show(),$("[data-news-category]").on("click",function(){$("[data-news]").data("request")&&$("[data-news]").data("request").abort();var e=new XMLHttpRequest,t=$(this).data("news-category");$("[data-news-category]").removeClass("active"),$(this).addClass("active"),e.addEventListener("load",function(){$("[data-news]")[0].innerHTML=this.responseText}),e.open("GET","/xhr/business_cards/news?category="+t),e.send(),$("[data-news]").data("request",e)}),$("[data-news-settings]").on("click",function(){$(".news-settings-menu").toggle()}),$(document).ready(function(){$(document).on("click",function(e){$(e.target).closest("div").hasClass("news-settings-menu")||$(e.target).hasClass("fa-gears")||$(".news-settings-menu").hide()});var e="/xhr/business_cards/news?category="+("hotconcierge"==$(".news-category.active").data("newsCategory")?"hotconcierge":"latest");$.ajax({url:e,method:"GET"}).done(function(e){$(".news-area").html(e)})}),$(".news-settings-menu").on("click",function(){$(".news-row").hide(),$.ajax({url:"/users/hide_news",method:"PUT"})}),$("#js_submit_checked_mail").on("click",function(e){if(0==jQuery.map($('input[name="checked[business_card_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1}),$("#js_submit_search_mail").on("click",function(e){if(0==$('[name="checked[business_card_ids][]"]').length)return alert(I18n.t("js.common.serch_result_none")),e.stopImmediatePropagation(),!1}),App.front_business_cards.action_not_exist_modal(),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){if($(".modal-caller").not(".modal .modal-caller").css("pointer-events","none"),App.front_business_cards.check_exist_lead($(this).attr("id")))return event.stopImmediatePropagation(),!1;$(".btn-group.open").removeClass("open");var e=App.concerns.set_form_action("form_checked_business_cards",$(this).data("action"),$(this).data("remote"));return"js_submit_search_mail"===$(this).attr("id")?$("#js_search_mail").prop("disabled",!1):$("#js_search_mail").prop("disabled",!0),e.submit(),!1});var n=App.visible_fields.setup_list_visible_setting(["name","client_name","client_branch_name","post","organization"],"table.table-float-head-items"),i=App.summary_visible_fields.setup_list_visible_setting(["business_card_image","company_name","department_position","client_branch_department_position","contacts"],"table.table-float-head-summary");$(".switch-layout-menu-item").on("click",function(){var e=$(this).data("switch-to");App.front_business_cards.change_default_bc_layout(e),$(".switch-layout-menu-item").toggleClass("hidden"),$("table[data-layout]").toggleClass("hidden"),n.floatTheadOff(),i.floatTheadOff(),"by_items"===e?n.floatTheadOn():"summary"===e&&i.floatTheadOn()}),$(document).on("click",".summary-check-items.summary-checkbox",function(){var e=0;$(".summary-check-items.summary-checkbox").each(function(){this.checked&&e++}),$("[data-selected-number]").text("\uff08"+e+"\uff09")}),this.attach_add_button_handlers(),App.concerns.enable_csv_export_event("#form_search_business_cards","checked[business_card_ids][]"),App.concerns.datepicker(".search_datepicker"),App.concerns.all_checked_summary_items(),App.concerns.set_form_action_to_submit("#form_checked_business_cards",".checked_submit",!0),App.concerns.select_search("business_card_owner_user_id"),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("update-all-modal-tags","update-all-modal-tag-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#update-all-modal-tags","#tags"),App.front_business_card_lead_tags.init_suggest("advanced-search-tags","advanced-search-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search","#search_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search","#advanced-search-tags","#search_tag_ids"),App.front_business_card_lead_tags.init_suggest("advanced-search-remove-tags","advanced-search-pulldown-remove-tags"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search-remove-tags","#search_remove_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search-remove-tags"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search-remove-tags","#advanced-search-remove-tags","#search_remove_tag_ids"),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids","","","",!0),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),$("#modalsearchBusinessCardsLeadTags").on("hidden.bs.modal",function(){($("#myModal").is("[aria-hidden=false]")||$("#modaltagsBulkDeletionVisibleFields").is("[aria-hidden=false]"))&&$("body").addClass("modal-open")}),$("#modalsearchBusinessCardsLeadTags").on("shown.bs.modal",function(){$(".modal-backdrop").last().css("z-index",9998)}),App.concerns.bulk_delete_lead_tags_modal("#open-business-card-lead-tags-search-modal","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal"),App.concerns.bulk_delete_lead_tags_modal_selection("#lead_tag_selection_bulk_delete"),App.concerns.set_item_id(),App.concerns.select_search("search_lead_ids"),App.concerns.refresh_office365_icon("form_checked_business_cards"),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting($(this).data("title"),$(this).data("close-text"),$(this).data("alert-text"))}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.change_search_type(),App.concerns.prevent_submit_pressing_enter(),App.concerns.set_form_action_to_submit("#form_checked_business_cards",".js_open_modal_update_all",!0),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),App.concerns.open_mailer(),App.concerns.get_modal_to_search_save("#form_search_business_cards"),App.concerns.get_modal_to_search_call("#form_search_business_cards"),App.concerns.check_form_input("#myModal","#bulk_update");new Clipboard(".clipboard-btn");$(document).on("change",".summary-check-items[data-business-card-id]",function(){var e=$(this),t=e.data("businessCardId"),n=0;$(".summary-check-items[data-business-card-id='"+t+"']").prop("checked",
e.prop("checked")),$(".summary-check-items.summary-checkbox").each(function(){this.checked&&n++}),$("[data-selected-number]").text("\uff08"+n+"\uff09")}),App.searches.callForSearchCondition.init(),App.concerns.focus_to_first_element(),$("table[data-layout='summary'] tbody tr").on("click",function(e){"A"!==e.target.tagName&&"IMG"!==e.target.tagName&&"INPUT"!==e.target.tagName&&$(this).find(".summary-checkbox").trigger("click")}),$(document).on("click",".all-check,.summary-check-items",function(){var e=$(".switch-layout-menu").find("li a.hidden").data("switch-to"),t=$(("summary"===e?".summary-check-items.summary-checkbox":".summary-check-items.items-checkbox")+":checked"),n=t.closest("tr").find("td:first").length!=t.closest("tr").find("td:last a").not("[disabled='disabled']").length;$(".btn-activity-by-department-role").prop({disabled:n});var i=$(".data-original-title-by-activity"),a=n?i.attr("data-disabled-title"):i.attr("data-enabled-title");i.attr("data-original-title",a)}),$(".checked_delete_submit").on("click",function(){$("#form_checked_business_cards").attr("action",$(this).attr("data-confirm-action")),$("#form_checked_business_cards").attr("data-remote",!0),$(this).attr("clicked",!0),$("#form_checked_business_cards").submit()}),$(document).on("click","a[data-hp-role='simple_business_card']",function(e){e.preventDefault(),$(this).one("load_modal",function(){var e=$("#new_business_card");App.front_business_cards.attach_simply_business_card_form_button_event(e),App.concerns.search_zip_code(),App.concerns.select_search_name("business_card_client_id"),App.front_business_card_lead_tags.init_suggest("s2id_tags-on-modal","my-tag-dropdown-on-modal"),App.concerns.set_tooltip_to_select_search_client("business_card_client_id"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),App.front_business_cards.change_client(),App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("#new_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-on-modal","#business_card_tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags-on-modal","#business_card_tags"),App.concerns.set_tooltip()}),App.front_business_cards.modal_open($(this),$("#simplyFormModalContainer"))}),App.tooltip.display_tooltip();var a="business_cards";App.front_recommend.recommendScenarios(a),$(document).ready(function(){$("#note").on("input",function(){var e=$(this),t=e.val();5e3<(t=t.replace(/\n/g,"\r\n")).length&&(t=t.substring(0,5e3)),e.val(t)})});var s=t("business_card_note_method");s?$("#business_card_note_method").val(s):(e("business_card_note_method","1",365),$("#business_card_note_method").val(t("business_card_note_method")));$("#myModal").on("shown.bs.modal",function(){var e=t("business_card_note_method");e&&0<$("#business_card_note_method").length&&$("#business_card_note_method").val(e)}),$("#bulk_update").on("click",function(){e("business_card_note_method",$("#business_card_note_method").val(),365)})},association_index:function(){App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_display_number("form_search_business_cards"),App.concerns.change_order("form_search_business_cards"),App.concerns.select_search("search_client_id"),App.concerns.focus_to_first_element(),$("a.association-btn").on("click",function(){$(this).addClass("disabled")})},"new":function(){App.front_business_card_lead_tags.ajax_load(),this.submit_new(),this.click_select_client(),App.concerns.search_zip_code(),App.concerns.select_search_name("business_card_client_id"),App.concerns.set_client_branch_form("business_card_client_id"),App.concerns.set_organization_form("business_card_client_id"),App.concerns.select_search("business_card_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("business_card_client_id"),this.change_client(),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.datepicker(".search_datepicker"),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("#new_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags")},create:function(){App.front_business_card_lead_tags.ajax_load(),this.submit_new(),App.concerns.search_zip_code(),App.concerns.select_search_name("business_card_client_id"),App.concerns.select_search("business_card_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("business_card_client_id"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),this.change_client(),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.datepicker(".search_datepicker"),App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("#new_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags")},edit:function(){App.front_business_card_lead_tags.ajax_load(),this.submit_edit(),this.click_select_client_edit(),App.concerns.search_zip_code(),App.concerns.select_search_name("business_card_client_id"),App.concerns.set_client_branch_form("business_card_client_id"),App.concerns.set_organization_form("business_card_client_id"),App.concerns.select_search("business_card_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("business_card_client_id"),this.change_client(),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.datepicker(".search_datepicker"),App.concerns.hide_item_file_options(),App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("form.edit_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags"),this.rotate(".front-rotate-btn","front_picture","#rotate_front_picture"),this.rotate(".back-rotate-btn","back_picture","#rotate_back_picture"),this.image_replacement(".js-picture-replacement-btn","#front_picture","#back_picture"),this.prevent_click_event_on_enter()},update:function(){App.front_business_card_lead_tags.ajax_load(),this.submit_edit(),App.concerns.search_zip_code(),App.concerns.select_search_name("business_card_client_id"),App.concerns.select_search("business_card_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("business_card_client_id"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),this.change_client(),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.datepicker(".search_datepicker"),App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("form.edit_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags"),App.concerns.hide_item_file_options(),this.rotate(".front-rotate-btn","front_picture","#rotate_front_picture"),this.rotate(".back-rotate-btn","back_picture","#rotate_back_picture"),this.image_replacement(".js-picture-replacement-btn","#front_picture","#back_picture"),this.prevent_click_event_on_enter()},show:function(){App.front_deals.all_checked_items_modal_deals_index(),$("#btn_front_xhr_office365_index").on("click",function(){return $("#form_front_xhr_office365_index").submit(),!1}),App.front_business_cards.send_standard_mail(),App.front_business_cards.action_not_exist_modal();var e=function(){if("block"===$(".user-information-show").css("display"))return $(".user-information-show").hide(),!1;var e=$(this).data("user-id"),t=$(this).offset().top,n=$(this).offset().left+$(this).width()/2;$("#position_top").val(t),$("#position_left").val(n),$("#user-information-form").attr("action","/xhr/user_communications/user_information_show/"+e),$("#user-information-form").submit()};$(document).on("click",".user_information",e),$(window).on("click",function(e){0<!$(e.target).closest(".user-information-show").length&&"block"===$(".user-information-show").css("display")&&$(".user-information-show").hide()}),App.concerns.open_mailer();new Clipboard(".clipboard-btn");this.toggle_image_private(),App.front_business_cards.typo_dialog_setting(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),App.concerns.toggle_print_target()},show_correct_list_setting:function(e,t,n){void 0===e&&(e=I18n.t("js.visible_fields.set_search")),void 0===n&&(n=I18n.t("js.common.close")),"undefined"==typeof alert_text&&(alert_text=I18n.t("js.common.select_item")),$(".ui-dialog").css("box-shadow","0 0 4px gray"),$("#error_msg_text").hide(),$("#send").hide(),$("#spinner").hide(),$("#success_msg").hide(),$("#return-val").hide(),$("#fail_msg").hide(),$("#spinner-icon").hide(),$("#spinner-text").hide(),$("#field").show(),$("#dialog-footer").show(),$("html,body").scrollLeft(0);var i=!0;if($("#summary_correct_list_setting_dialog").removeClass("hide").dialog({autoOpen:!1,title:e,title_html:!0,draggable:!0,width:390,show:{effect:"slide",direction:"right"},position:{my:"right top",at:"right-10 top+60",of:"#typo_request_link",collision:"fit none"},resizable:!1,buttons:[{id:"ok",style:"height : 35px; font-size:14px; border: 1px #d3d3d3",text:t,click:function(){if(i=!1,0==$(this).find("input[type=checkbox]:checked").length)return $("#error_msg_text").show(),!1;$("#error_msg_text").hide(),$("#message_dialog").dialog("open"),$("#ok").button("disable"),$("#cancel").button("disable")}},{id:"cancel",style:"height : 35px; font-size:14px; border: 1px #d3d3d3",text:n,click:function(){$("#ok").button("enable"),1==i&&0!=$(this).find("input[type=checkbox]:checked").length&&$("input:checkbox").removeAttr("checked"),$(this).dialog("close")}}],open:function(){$(".ui-dialog").css("box-shadow","0 0 4px gray"),$(".ui-dialog-title").css("color","white"),$(".ui-dialog-titlebar-close").css("display","none"),$(".ui-widget-content").css("border","0px"),$(".ui-dialog").css("padding","0em"),$(".ui-effects-wrapper").css("height","100%"),document.getElementById("error_msg").textContent=""},close:function(){}}).prev(".ui-dialog-titlebar").css("background","#008080"),$(".ui-corner-all").removeClass("ui-corner-all"),$(".ui-dialog-titlebar").css("border-color","#008080"),$(".ui-dialog-titlebar").css("width","calc(100% + 2px)"),$(".ui-dialog-titlebar").css("margin-left","-1px"),$("#summary_correct_list_setting_dialog").dialog("isOpen"))return $("#summary_correct_list_setting_dialog").dialog("close"),void $("#message_dialog").dialog("close");$("#summary_correct_list_setting_dialog").dialog("open")},typo_dialog_setting:function(){$(function(){function e(){i(),$(document).keydown(function(e){if(27==e.keyCode)return!1}),n();var e="/xhr/business_cards/correct_data",t=$('form[name="loadingform"]').serializeObject();$.ajax({type:"POST",url:e,data:{business_card_correct:t},success:function(e){1==e.status?($("#spinner").hide(),$("#send,#success_msg").show(),setTimeout("location.reload(true)",1e3)):e.message?($("#spinner").hide(),$("#send,#return-val").show(),$(".return-data").remove(),$("#return-val").append("<div class='return-data'>"+e.message+"</div>")):($("#spinner").hide(),$("#send,#fail_msg").show()),setTimeout("$('#summary_correct_list_setting_dialog').dialog('close')",2e3)},error:function(){$("#spinner").hide(),$("#send,#fail_msg").show(),setTimeout("$('#summary_correct_list_setting_dialog').dialog('close')",2e3)}})}function n(){$("#ok").button("disable"),$("#cancel").button("disable")}function i(){$("#field").hide(),$("#send , #spinner , #spinner-icon , #spinner-text").show(),$("#spinner-icon").empty().prepend("<span><i class='fa fa-spinner fa-pulse fa-3x fa-fd'></i></span>")}$("#message_dialog").removeClass("hide").dialog({autoOpen:!1,position:{my:"right top",at:"right-10 top+50",of:"#summary_correct_list_setting_dialog"},width:370,dialogClass:"dialog-top-style",resizable:!1,buttons:[{style:"height : 35px; font-size:14px; border: 1px #d3d3d3",text:"OK",click:function(){"true"==$("#pic_val").val()?e():($("#field").hide(),$("#send").show(),$("#result_dialog_style").show(),$("#cancel").button("enable")),$(this).dialog("close")}},{style:"height :35px; font-size:14px; border: 1px #d3d3d3",text:"\u30ad\u30e3\u30f3\u30bb\u30eb",click:function(){$(this).dialog("close"),$("#ok").button("enable"),$("#cancel").button("enable")}}],open:function(){$(".ui-widget-content").css("border","0px"),$(this).parent(".ui-dialog").css({"border-radius":"0px",padding:""}),$(this).children(".modal-body").css({padding:"10px","padding-right":"0px","padding-bottom":"0px"})}}),$(".ui-dialog-titlebar").css("display","none"),$(document).keydown(function(e){27==e.keyCode&&($("#ok").button("enable"),$("#cancel").button("enable"),$("#message_dialog").dialog("close"),$("#summary_correct_list_setting_dialog").dialog("close"),document.getElementById("error_msg").textContent="")}),$("#summary_correct_list_setting_dialog").click(function(){$("#ok").button("enable"),$("#cancel").button("enable"),$("#message_dialog").dialog("close")}),$.fn.serializeObject=function(){var e={},t=this.serializeArray();return $.each(t,function(){e[this.name]!==undefined?(e[this.name].push||(e[this.name]=[e[this.name]]),e[this.name].push(this.value||"")):e[this.name]=this.value||""}),e}}),$(window).resize(function(){$("#summary_correct_list_setting_dialog").dialog("option","position",{my:"right top",at:"right-10 top+60",of:"#typo_request_link"}),$("#message_dialog").dialog("option","position",{my:"right top",at:"right-10 30",of:"#summary_correct_list_setting_dialog"})})},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("form.new_business_card").submit()})},click_select_client:function(){$("#open-associated-client").on("click",function(){App.concerns.select_search_name("business_card_client_id"),App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("#new_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),localStorage.setItem("client_onclick","#business_card_client_id")})},click_select_client_edit:function(){$("#open-associated-client").on("click",function(){App.concerns.select_search_name("business_card_client_id"),App.concerns.set_associate_entity_to_s2("#business_card_client_id",".hp-clients-table button.decision","clients",$("form.edit_business_card").data("js-alert-text")),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#business_card_client_id","single","#business_card_client_id"),localStorage.setItem("client_onclick","#business_card_client_id")})},submit_edit:function(){$("#edit_submit").on("click",function(){$(this).attr("disabled",!0),$("form.edit_business_card").submit()})},change_client:function(){$("#business_card_client_id").on("change",function(){var e=$("#business_card_client_id").val();if("0"===e){$("#new_client_alert").show();var t=$("#business_card_client_id").select2("data").text_name;$("#business_card_client_id").val(t),$("#client_name_field").val(t)}else $("#new_client_alert").hide(),$("#client_id").val(e),$("#select_options_client_id").val(e),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit();$(".tooltip").tooltip("hide")})},change_client_index:function(){$("#search_client_id").on("change",function(){$("#client_id").val($("#search_client_id").val()),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit()})},rotate:function(e,a,s){$(e).on("click",function(e){e.preventDefault();var t=document.getElementById(a),n=App.front_business_cards.image_natural_size(t);t.src=App.front_business_cards.image_resize(t,n.width,n.height,90);var i=Number($(s).val());i<270?i+=90:i=0,$(s).val(i)})},image_natural_size:function(e){var t,n=e.width,i=e.height;if("undefined"!=typeof e.naturalWidth)n=e.naturalWidth,i=e.naturalHeight;else if("undefined"!=typeof e.runtimeStyle){var a=e.runtimeStyle;t={w:a.width,h:a.height},a.width="auto",a.height="auto",n=e.width,i=e.height,a.width=t.w,a.height=t.h}else t={w:e.width,h:e.height},e.removeAttribute("width"),e.removeAttribute("height"),n=e.width,i=e.height,e.width=t.w,e.height=t.h;return{width:n,height:i}},image_resize:function(e,t,n,i){var a=document.createElement("canvas");90==i||270==i?(a.width=n,a.height=t):(a.width=t,a.height=n);var s=a.getContext("2d");return i&&0<i&&(s.rotate(i*Math.PI/180),90==i?s.translate(0,-n):180==i?s.translate(-t,-n):270==i&&s.translate(-t,0)),s.drawImage(e,0,0,t,n),a.toDataURL("image/png")},image_replacement:function(e,r,l){$(e).on("click",function(e){var t,n,i,a,s,o;e.preventDefault(),t=$(r).attr("src"),n=$(l).attr("src"),$(l).attr("src",t),$(r).attr("src",n),i=$("#delete_front_picture"),a=$("#delete_back_picture"),i.prop("checked")&&!a.prop("checked")?(i.prop("checked",!1),a.prop("checked",!0)):!i.prop("checked")&&a.prop("checked")&&(i.prop("checked",!0),a.prop("checked",!1)),front_rotate_button=$(".front-rotate-btn"),back_rotate_button=$(".back-rotate-btn"),front_rotate_button.length&&back_rotate_button.length&&(temp_rotate_button_style=front_rotate_button.css("display"),front_rotate_button.css("display",back_rotate_button.css("display")),back_rotate_button.css("display",temp_rotate_button_style)),s=$("#rotate_front_picture").val(),o=$("#rotate_back_picture").val(),$("#rotate_front_picture").val(o),$("#rotate_back_picture").val(s),"true"==$("#replacement_picture").val()?$("#replacement_picture").val(""):$("#replacement_picture").val("true"),""==t?($("#back_picture_area").hide(),$("#back_picture_button_group").hide()):($("#back_picture_area").show(),$("#back_picture_button_group").show()),""==n?($("#front_picture_area").hide(),$("#front_picture_button_group").hide()):($("#front_picture_area").show(),$("#front_picture_button_group").show())})},attach_add_button_handlers:function(){var i=$("#modalContainer");$(document).on("click","a.js_bussines_card_pictures_show,[data-hp-role='add_information']",function(){return App.front_business_cards.modal_open($(this)),!1}),$(document).on("load_modal","a.js_bussines_card_pictures_show",function(e,t){$link=$(this),$(".btn-tlp").tooltip({trigger:"hover"}),$(".btn-tlp").click(function(){$(".tooltip").hide()}),App.front_business_cards.rotate(".front-rotate-btn","front_picture","#rotate_front_picture"),App.front_business_cards.rotate(".back-rotate-btn","back_picture","#rotate_back_picture"),App.front_business_cards.image_replacement(".js-picture-replacement-btn","#front_picture","#back_picture"),$(".front-rotate-btn,.back-rotate-btn,.js-picture-replacement-btn").on("click",function(){App.front_business_cards.save_bc_pictures($('input[name="target_update_link"]').val())}),$(t).one("hidden.bs.modal",function(){var e=$link.find("img:first");e.data("original-url")==undefined&&(e.data("original-url",e.prop("src")),$link.data("original-href",$link.data("href")),e.data("append-url","&count=")),e.data("append-url",e.data("append-url")+"1"),e.prop("src",e.data("original-url")+e.data("append-url")),$link.data("href",$link.data("original-href")+e.data("append-url"))})});var t=function(n,e){var t=$(".modal-open");e==undefined&&(e="#new_submit"),n.find(".js_modal_search_users_caller_btn").on("click",function(){$(".modal-backdrop").last().css("z-index",1030)}),n.find(".item_datepicker").datepicker(),i.find(e).off("click"),i.find(e).on("click",function(e){e.preventDefault(),$("#modal_error_message").empty();var t=new FormData($(n).get(0));return t.append("format","json"),$.ajax($(n).attr("action"),{type:"post",processData:!1,contentType:!1,data:t}).done(function(e){"error"==e.status?""===e.message?$("#js_select_change_display_template option").last().attr("selected","selected").trigger("change"):$("#modal_error_message").html(e.message):("#new_daily_report"===n.selector?App.concerns.destroy_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val()):"#new_deal"===n.selector&&App.concerns.destroy_automatically_save("auto_saved_deals_new",$("#current_user_id").val()),i.modal("hide"),$("#js_search_registration_success_message").html(e.message),e.deals_message&&$("#js_search_registration_success_message").html(e.deals_message))}),!1}),n.on("ajax:success",function(e){e.target!==this&&($("#search-associated-resources-modal,#modal_block_for_search_users").on("hidden.bs.modal",function(){t.addClass("modal-open")}),$("#search-overlay-associated-resources-modal").on("hidden.bs.modal",function(){var e=1030;$(".modal-backdrop").each(function(){$(this).css("z-index",e),e+=10})}))})},e=function(n){var e=$("#js_form_change_display_template");e.attr("action",n.data("href")),e.data("remote",!0),e.on("ajax:success",function(e,t){i.html(t),i.find(".hidden-xs").addClass("hidden-xs-on-modal"),n.trigger("load_modal")})},n=function(){["#open-associated-client","#open-associated-daily-report","#open-associated-deal","#open-associated-lead","#daily_report_client_id","#client_temporary_business_card_id","#leads_multiple_decision","#deals_multiple_decision","#deal_client_id"].forEach(function(e){$(document).off("click",e)})};$(document).on("load_modal","[data-hp-role='add_information'][data-hp-target='daily_report']",function(){n(),App.front_daily_reports["new"](),e($(this)),t($("#new_daily_report")),ClientEditForm.init('[name="daily_report[client_id]"]')}),$(document).on("load_modal","[data-hp-role='add_information'][data-hp-target='deal']",function(){n(),App.front_deals["new"](),e($(this)),t($("#new_deal")),ClientEditForm.init('[name="deal[client_id]"]')}),$(document).on("load_modal","[data-hp-role='add_information'][data-hp-target='task']",function(){var e=$("#new_task");n(),App.front_tasks.init_form_from_another_controller(!0),i.find("a[href='/tasks/']").parent().hide(),t(e)})},modal_open:function(t,n,i,a){n||(n=$("#modalContainer")),$.ajax({url:t.data("href"),dataType:"html",data:t.data("params")}).done(function(e){n.html(e),n.find(".hidden-xs").addClass("hidden-xs-on-modal"),n.off("shown.bs.modal"),n.off("hidden.bs.modal"),n.on("shown.bs.modal",function(){modal_dom=$(document).find(".modal-open"),modal_dom[0]&&(i?(n.data("bs.modal").$backdrop.css("z-index",1055),n.css("z-index",1060)):($(".modal-backdrop").css("z-index",1020),n.css("z-index",1035))),n.scrollTop(0),t.trigger("load_modal",[n])}).on("hidden.bs.modal",function(){a&&$(a).css("pointer-events","auto"),n.empty()}).modal("show")})},save_bc_pictures:function(e){link_to_modal=$('input[name="self_modal_link"]').val(),$.ajax({url:e,data:{authenticity_token:$('meta[name="csrf-token"]').attr("content"),rotate_front_picture:$("input#rotate_front_picture").val(),replacement_picture:$("input#replacement_picture").val(),rotate_back_picture:$("input#rotate_back_picture").val()},beforeSend:function(){$("input#rotate_front_picture").val(0),$("input#rotate_back_picture").val(0),$("input#replacement_picture").val("")},type:"POST"}).done(function(){})},change_default_bc_layout:function(e){$.ajax({url:"/xhr/users/change_default_bc_layout",type:"PUT",data:{default_business_card_layout:e}})},prevent_click_event_on_enter:function(){$("input,select").on("keypress",function(e){return 13!==e.which})},toggle_image_private:function(){$(".js_image_private_radio").change(function(){var e=$("#form-image-private");"0"===$(this).val()?e.find('input[name="_method"]').val("patch"):e.find('input[name="_method"]').val("delete"),e.submit()})},load_split_index:function(e){rowIndex++;var t=rows[rowIndex],n=$("#pagination_id").val();xhrBusinessCardIds=$(t).data("xhr-business-card-ids"),$.ajax({url:"/xhr/business_cards/load_split_index",type:"GET",dataType:"html",data:{ids:xhrBusinessCardIds,pagination_id:n}}).done(function(e){$(t).replaceWith(e),$(document).trigger("floatTableUpdate"),App.front_business_cards.send_standard_mail()}).fail(function(){$(t).html("")}).always(function(){rowIndex<rows.length-2?App.front_business_cards.load_split_index(e):e.resolve()})},attach_simply_business_card_form_button_event:function(n,i,a){n.off("ajax:error"),n.on("ajax:error",function(e,t){n.find("#modal_message").html(App.concerns.buildNoticeHtml(t.responseJSON.messages,"danger"))}),n.find("#submitButton").on("click",function(){n.off("ajax:success"),n.one("ajax:success",function(e,t){$("#modalCloseButton").click(),i===undefined&&$("#form_search_business_cards").submit(),i&&(current_input_lead_ids=i.val()?i.val().split(","):[],t.lead_id&&(current_input_lead_ids.unshift(t.lead_id),i.val(current_input_lead_ids.join(",")).trigger("change.select2")))}),n.on("ajax:error",function(){return App.front_business_cards.check_status_button_reflect_info_selected_company(),!1})}),n.find("#submitAndNewButton").on("click",function(){n.off("ajax:success"),n.one("ajax:success",function(e,t){n.find("#modal_message").html(App.concerns.buildNoticeHtml(t.messages,"success")),App.front_business_cards.simplyBusinessCardFormFields.forEach(function(e){-1==["client_id","tel","fax","zip","pref_id","address","url"].indexOf(e)&&n.find("#business_card_"+e).val("")}),n.find("#business_card_open_status").val(t.open_status),$("#s2id_tags-on-modal li.select2-search-choice").remove(),$("#modalCloseButton").off("click"),$("#modalCloseButton").one("click",function(){$("#form_search_business_cards").submit()}),"0"===$("#business_card_client_id").val()?$("#new_client_alert").show():$("#new_client_alert").hide(),i&&(current_input_lead_ids=i.val()?i.val().split(","):[],t.lead_id&&(current_input_lead_ids.unshift(t.lead_id),i.val(current_input_lead_ids.join(",")).trigger("change.select2"))),App.concerns.set_client_value_from_form_to_modal_business_card(a)}),n.on("ajax:error",function(){return App.front_business_cards.check_status_button_reflect_info_selected_company(),!1})}),n.find("#importFromVCardInput").on("input",function(e){var t=new FormData;t.append("business_cards[vcard]",e.target.files[0]),$.ajax({type:"POST",url:"/xhr/business_cards/vcard",cache:!1,contentType:!1,processData:!1,data:t}).done(function(t){App.front_business_cards.simplyBusinessCardFormFields.forEach(function(e){"client_id"==e?0==t.business_card.new_company_flg?($("#business_card_client_id").select2("data",{id:t.business_card.client_id,text_name:t.business_card.client_name}),$("#new_client_alert").hide()):($("#business_card_client_id").select2("data",{id:t.business_card.client_name,text_name:t.business_card.client_name}),$("#new_client_alert").show()):"note"!=e&&n.find("#business_card_"+e).val(t.business_card[e])}),App.front_business_cards.check_status_button_reflect_info_selected_company()}).fail(function(e){n.find("#modal_message").html(App.concerns.buildNoticeHtml(e.responseJSON.messages,"danger"))}),$(this).val(null)}),n.find("#importFromVCardButton").on("click",function(e){return e.preventDefault(),$("#importFromVCardInput").click(),!1}),n.find("#resetBusinessCardButton").on("click",function(e){return e.preventDefault(),$("#business_card_client_id").select2("val","").trigger("change"),App.front_business_cards.simplyBusinessCardFormFields.forEach(function(e){n.find("#business_card_"+e).val("")}),n.find("#business_card_open_status").val("1"),$("#s2id_tags-on-modal li.select2-search-choice").remove(),!1}),$("#business_card_client_id").on("change",function(){App.front_business_cards.check_status_button_reflect_info_selected_company()}),n.find("#btn_reflect_info_selected_company").on("click",function(e){return e.preventDefault(),$.ajax({type:"POST",url:"/xhr/business_cards/reflect_info_selected_company",dataType:"json",data:{client_id:$("#business_card_client_id").val()}}).done(function(e){if(200===e.status){var t=e.client;$("#business_card_tel").val(t.tel),$("#business_card_zip").val(t.zip),$("#business_card_pref_id").val(t.pref_id),$("#business_card_address").val(t.address),$("#business_card_url").val(t.url)}}).fail(function(){}),!1}),n.find("#btn_clear_info_company").on("click",function(e){return e.preventDefault(),$("#business_card_tel").val(""),$("#business_card_zip").val(""),$("#business_card_pref_id").val(""),$("#business_card_address").val(""),$("#business_card_url").val(""),!1})},check_status_button_reflect_info_selected_company:function(){var e=$("#business_card_client_id").val();"0"==e||e>>>0!=parseFloat(e)?$("#btn_reflect_info_selected_company").prop("disabled",!0):$("#btn_reflect_info_selected_company").removeAttr("disabled")},send_standard_mail:function(){$(".js_submit_send_mail").off("click"),$(".js_submit_send_mail").on("click",function(){if(App.front_business_cards.check_exist_lead($(this).data("business-card-id")))return event.stopImmediatePropagation(),!1;$(".btn-group.open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));return $("#select_business_card_id").val($(this).data("business-card-id")),e.submit(),!1})},action_not_exist_modal:function(){$(".go-ahead").on("click",function(){if($("#modal_not_exist_lead_info").modal("hide"),$(".not_exist_lead").empty(),"js_submit_checked_mail"===$("#send_mail_go_ahead").val()||"js_submit_search_mail"===$("#send_mail_go_ahead").val()){$(".btn-group.open").removeClass("open");var e=App.concerns.set_form_action("form_checked_business_cards","/xhr/mail_queues/get_modal_to_send_mail/",!0);"js_submit_search_mail"===$("#send_mail_go_ahead").val()?$("#js_search_mail").prop("disabled",!1):$("#js_search_mail").prop("disabled",!0),e.submit()}else{$(".btn-group.open").removeClass("open"),clicked_business_card_id=$("#send_mail_go_ahead").val();e=App.concerns.set_form_action("form_open_send_mail","/xhr/mail_queues/get_modal_to_send_mail/",!0);clicked_business_card_id=clicked_business_card_id.replace(/[^0-9]/g,""),$("#select_business_card_id").val(clicked_business_card_id),e.submit()}}),$(".cancel").on("click",function(){$("#modal_not_exist_lead_info").modal("hide"),$(".not_exist_lead").empty()})},check_exist_lead:function(e){var t;$("#send_mail_go_ahead").val(""),$(".not_exist_lead").empty(),"js_submit_checked_mail"===e||"js_submit_search_mail"===e?("js_submit_search_mail"===e?$("#js_search_mail").prop("disabled",!1):$("#js_search_mail").prop("disabled",!0),t=App.concerns.set_form_action("form_checked_business_cards",$(this).data("action"),$(this).data("remote")).serialize(),$("#send_mail_go_ahead").val(e)):(t={select_business_card_id:e},$("#send_mail_go_ahead").val("one_"+e));var n=$.ajax({url:"/xhr/business_cards/check_exist_business_card_lead",type:"POST",dataType:"html",data:t,async:!1}).responseText;return!!n&&(reload_flg=!1,$.each(n.split(","),function(e,t){"reload"==t&&(location.reload(),
reload_flg=!0),$(".not_exist_lead").append("<p>\u30fb"+t+"</p>")}),reload_flg||$("#modal_not_exist_lead_info").modal("show"),!0)}},App.front_business_card_lead_tags={index:function(){function t(e){$("#loading").show();var t=$(e).closest("li"),n=t.data("depth");if($(e).hasClass("add_decision")||$(e).hasClass("add_decision_input")){$("#loading").show();var i=$("#new_tag_name").val(),a="",s="";a="none"===$("#my_tag").css("display")?"common_tag":2===n&&"private_my_tag"===$(e).closest('li[data-depth="1"]').data("group-code")?"private_my_tag":$("#new_group_code").val(),2===n&&(s=$(e).closest('li[data-depth="1"]').data("tag-id")),$(window).off("scroll"),$("#tag_list_id").val(t.attr("id")),$("#tag_tag_name").val(i),$("#tag_group_code").val(a),$("#tag_parent_tag_id").val(s),$("#tag_tag_category").val($("div.tags_div:visible").attr("id")),$("#tag_user_tags_lock_version").val($("#parent_my_tag_user_lock_version").val()),$("#tag_edit_form").attr("method","post"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/create_on_the_index_tags"),$("#tag_edit_form").submit()}else{$("#loading").show();var o=$(e).closest("li").data("tag-id");i=$(e).closest("div").find(".edit-name").val(),s=$(e).closest("div").find(".edit-parent-tag-id").val(),a="";if(a=2===n&&"private_my_tag"===$(e).closest('li[data-depth="1"]').data("group-code")?"private_my_tag":$(e).closest("div").find(".edit-group-code").val(),"true"!==t.attr("default-tag-flg")||"none"===$("#common_tag").css("display")||"public_my_tag"!==a&&"private_my_tag"!==a)r=$("#business_card_lead_tags_confirm_save").val();else var r=i+$("#business_card_lead_tags_confirm_update_default_tag").val();confirm(r)?($(window).off("scroll"),$("#tag_id").val(o),$("#tag_list_id").val(t.attr("id")),$("#tag_tag_name").val(i),$("#tag_group_code").val(a),$("#tag_parent_tag_id").val(s),$("#tag_tag_category").val($("div.tags_div:visible").attr("id")),$(e).closest("div").children("span").eq(1).text()===$("#business_card_lead_tags_no_owner").val()?$("#tag_user_tags_lock_version").val($("#parent_my_tag_user_lock_version").val()):$("#tag_user_tags_lock_version").val($(e).closest("li").find(".lock_version").val()),$("#tag_edit_form").attr("method","patch"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/update"),$("#tag_edit_form").submit()):($("#loading").hide(),ENTER_FLG=!0)}}function n(e,t){e.find(".edit-name").val(e.children("span").eq(0).text()),e.children("span").addClass("none"),e.children("span").eq(2).removeClass("none"),e.children("span").eq(3).removeClass("none"),e.children("span").eq(4).removeClass("none"),e.children("span").eq(5).removeClass("none"),t&&e.children("span").eq(3).find("option[value='common_tag'],option[value='public_my_tag']").wrap("<span>")}App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.inifinite_scroll(),$(".forbid-delete,.last-one-parent-tag").prop("disabled",!0),App.front_business_card_lead_tags.folding(),App.front_business_card_lead_tags.disabled_tooltip(),App.front_business_card_lead_tags.show_hide_all_folding_area(),App.front_business_card_lead_tags.children_more_display(),App.select_parent_tag_id.init_tags(),this.change_display_tag_type(),$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip()}),$(document).on("click","#search_submit",function(e){e.preventDefault(),$("#form_search_tags").data("processing",!0);var t=$(this);t.data("processing")||(t.data("processing",!0),$("#loading").show(),$(window).off("scroll"),$("#tag_name").val($("#search_name").val()),$("#tag_tag_category").val($("div.tags_div:visible").attr("id")),$("#tag_edit_form").attr("method","post"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/async_search"),$("#tag_edit_form").submit(),t.data("processing",!1))}),$(document).on("click","#js_clear_submit",function(e){e.preventDefault(),$("#form_search_tags").data("processing",!0);var t=$(this);t.data("processing")||(t.data("processing",!0),$("#loading").show(),$(window).off("scroll"),$("#search_name").val(""),$("#tag_name").val(""),$("#tag_tag_category").val($("div.tags_div:visible").attr("id")),$("#tag_edit_form").attr("method","post"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/async_search"),$("#tag_edit_form").submit(),t.data("processing",!1))}),$(".search-business-card-lead-tags").on("keydown",function(e){"Enter"===e.key&&e.preventDefault()}),$(document).on("keydown","#form_search_tags",function(e){if("Enter"===e.key){e.preventDefault();var t=$(this);if(t.data("processing"))return;t.data("processing",!0),$("#search_submit").trigger("click")}}),$(document).on("click","#new_parent_tag",function(e){e.preventDefault(),App.front_business_card_lead_tags.node_add_top()}),$(document).on("click",".add",function(){var e=$(this).closest("li"),t=e.children("button");0==e.children("ul").length?e.find(".folding").length?App.front_business_card_lead_tags.children_list_show(t,"1"):(e.append('<ul class="dd-list child-ul" data-child-tag-count="0"></ul>'),App.front_business_card_lead_tags.add_node(e)):0<e.find(".children-more").length&&"none"===e.find(".folding").css("display")?App.front_business_card_lead_tags.add_node(e):t.nextAll(".dd-list").find(".dd-item").length?(t.attr("data-action","collapse"),t.nextAll("ul").show(),App.front_business_card_lead_tags.add_node(e)):App.front_business_card_lead_tags.children_list_show(t,"1")}),$(document).on("click",".edit",function(){var e=$(this).closest("li"),t=!1;2===e.data("depth")&&"private_my_tag"===e.closest('li[data-depth="1"]').data("group-code")&&(t=!0);e.data("group-code");n(e.children("div:first"),t),e.find(".edit-name").focus(),e.find(".edit-name").select(),App.front_business_card_lead_tags.disabled_by_add_or_edit()}),$(document).on("click",".change-parent",function(){$("#s2id_parent_tag_tag_id").select2("val",$(this).parents("li").attr("data-tag-id")),$("#parent_tag_tag_id").data("self-id",$(this).parents("li").attr("id")),$("#parent_tag_tag_id").data("user-id",$(this).parents("li").attr("data-user-id")),$("#parent_tag_tag_id").data("search-type",$(this).parents("li").attr("data-group-code")),$(window).off("scroll")}),$(document).on("click",".cancel",function(){var e=$(this).closest("li");$(this).hasClass("add_cancel")?(1==$(this).closest("ul").find("li").length&&0==$(this).closest("ul").prevAll(".folding:first").length&&$(this).closest("ul").remove(),e.remove()):App.front_business_card_lead_tags.edit_cancel(e.children("div:first")),App.front_business_card_lead_tags.inifinite_scroll(),App.front_business_card_lead_tags.remove_disabled()}),$(document).on("click",".parent_add_cancel",function(){$(".new-parent-tag").remove(),App.front_business_card_lead_tags.inifinite_scroll(),App.front_business_card_lead_tags.remove_disabled()}),$(document).on("click",".input",function(){$(this).children().eq(0).focus()}),$(document).on("click",".decision",function(){t($(this))}),ENTER_FLG=!0,$(document).on("keydown",".edit-name",function(e){13==e.keyCode&&ENTER_FLG&&(ENTER_FLG=!1,t($(this)))}),$(document).on("click",".delete",function(){var e=$(this).closest("li").find(".de_tip").text();0<=window.navigator.userAgent.toLowerCase().indexOf("firefox")&&(e=[e.substr(0,85),e.substr(85,85),e.substr(170,85)].filter(Boolean).join("\n")+"\n");if(error_msg_filter_condition=e+$("#business_card_lead_tags_error_filter_condition").val(),error_msg_associated=e+$("#business_card_lead_tags_confirm_delete_associated").val(),error_msg_default_tag=e+$("#business_card_lead_tags_confirm_delete_default_tag").val(),error_msg_normal=e+$("#business_card_lead_tags_confirm_delete").val(),"true"!==$(this).closest("li").attr("filter-condition-flg")){if("true"===$(this).closest("li").attr("default-tag-flg")&&"true"===$(this).closest("li").attr("data-relation-flg")){if(!confirm(error_msg_default_tag))return;if(!confirm(error_msg_associated))return}else if("true"===$(this).closest("li").attr("default-tag-flg")){if(!confirm(error_msg_default_tag))return}else if("true"===$(this).closest("li").attr("data-relation-flg")){if(!confirm(error_msg_associated))return}else if(!confirm(error_msg_normal))return;$("#loading").show();var t=$(this).closest("li"),n=$(this).closest("li").data("tag-id"),i=$("#tag_company_tags_lock_version").val(),a=$(this).closest("li").find(".lock_version").val(),s=0;1<t.attr("data-depth")&&(s=t.closest("ul").closest("li").attr("id")),$.ajax({url:"/xhr/business_card_lead_tags/destroy",data:{tag_id:n,company_tags_lock_version:i,user_tags_lock_version:a},type:"DELETE"}).done(function(e){1==e.result?("common_tag"==e.group_code?$("#tag_company_tags_lock_version").val(e.company_tags_lock_version):($("#parent_my_tag_user_lock_version").val(e.user_tags_lock_version),$('li[data-user-id="'+e.user_id+'"]').each(function(){$(this).find(".lock_version").val(e.user_tags_lock_version)})),"0"!=s&&$("#"+s).attr("data-child_db_count",$("#"+s).attr("data-child_db_count")-1),$("#"+s).attr("data-child_db_count")<1&&(t.parent().closest("li").find(".delete").first().removeClass("forbid-delete"),t.parent().closest("li").find(".delete").first().prop("disabled",!1),t.parent().closest("li").find(".change-parent").first().removeClass("forbid-delete"),t.parent().closest("li").find(".change-parent").first().prop("disabled",!1),t.parent().closest("li").find(".tag-ids").first().prop("disabled",!1)),t.parent().children("li").length<=1&&1<t.parent().children("li").attr("data-depth")?(0<t.parent("ul").next(".children-more").length?(t.parent().closest("li").children("button").hide(),t.closest("ul").attr("data-child-tag-count",parseInt(t.closest("ul").attr("data-child-tag-count"))-1),t.closest("ul").attr("data-child-tag-size",parseInt(t.closest("ul").attr("data-child-tag-size"))-1),t.remove()):(t.parent().closest("li").children("button").remove(),t.parent("ul").eq(0).remove()),App.front_business_card_lead_tags.change_parent_enabled_decision(e.user_id,e.group_code)):1<parseInt(t.parent().children("li").attr("data-depth"))?(t.closest("ul").attr("data-child-tag-count",parseInt(t.closest("ul").attr("data-child-tag-count"))-1),t.closest("ul").attr("data-child-tag-size",parseInt(t.closest("ul").attr("data-child-tag-size"))-1),t.remove()):"1"===t.parent().children("li").attr("data-depth")&&1===t.closest("ul").children("li").length?(t.closest("ul").attr("data-tag-count",parseInt(t.closest("ul").attr("data-tag-count"))-1),$("#tag_"+$("div.tags_div:visible").attr("id")+"_size").val(parseInt($("#tag_"+$("div.tags_div:visible").attr("id")+"_size").val())-1),t.closest("ul").html("<p class='text-warning nothing-tag'>"+e.nothing_msg+"</p>"),App.front_business_card_lead_tags.show_hide_all_folding_area()):(t.closest("ul").attr("data-tag-count",parseInt(t.closest("ul").attr("data-tag-count"))-1),$("#tag_"+$("div.tags_div:visible").attr("id")+"_size").val(parseInt($("#tag_"+$("div.tags_div:visible").attr("id")+"_size").val())-1),t.remove(),App.front_business_card_lead_tags.change_parent_enabled_decision(e.user_id,e.group_code))):(App.front_business_card_lead_tags.show_result_error_message(e.result),$("html, body").animate({scrollTop:0},400,"swing"))}).fail(function(){App.front_business_card_lead_tags.ajax_error_message(),$("html, body").animate({scrollTop:0},400,"swing")}).always(function(){$("#loading").hide()})}else alert(error_msg_filter_condition)}),$(document).on("click","#bulk-delete-submit",function(){var n=$("div.tags_div:visible").find("form"),e=n.find("input:checked");if(0==e.size())return alert($("#business_card_lead_tags_select_tag").val()),!1;var i={},t=$.map(e,function(e){if(i[$(e).closest("li").data("userId")]=$(e).closest("li").find(".lock_version").val(),$(e).closest("li").data("relationFlg")){var t=$(e).closest("label").text();if(0<=window.navigator.userAgent.toLowerCase().indexOf("firefox")){var n=t.match(/.{85}/g);t=n?n.join("/n"):t}return t}}),a=$("#business_card_lead_tags_confirm_delete_selected").val()+"\n";0<t.length&&(a+=$("#business_card_lead_tags_warning_mark").val()+" ["+Object.values(t).join(", ")+"] "+$("#business_card_lead_tags_warning_delete_associated").val()),confirm(a)&&($("#loading").show(),n.append($("#tag_company_tags_lock_version")),$.each(i,function(e,t){n.append($("<input>").attr({type:"hidden",name:"user_tags_lock_versions["+e+"]",value:t}))}),n.submit())}),$(document).on("change",".all-check",function(){$("input.tag-ids:visible").not(":disabled").prop("checked",$(this).is(":checked"))})},children_more_display:function(){$(document).on("mouseover",".children-more",function(){$(this).off("mouseover");var e=$(this).closest("div.tags_div").attr("id"),t=parseInt($(this).prev().attr("data-child-tag-size"));if(t<parseInt($(this).prev().attr("data-child-tag-count"))){$("#loading").show();var n=$(this).prev().find("li").map(function(){return $(this).attr("data-tag-id")}).get();parent_id=$(this).parent("li").data("tag-id"),$("#tag_parent_tag_id").val(parent_id),$("#tag_child_tag_size").val(t),$("#tag_displayed_tag_ids").val(n.join(",")),$("#tag_tag_category").val(e),$("#tag_user_tags_lock_version").val($("#parent_my_tag_user_lock_version").val()),$("#tag_edit_form").attr("method","post"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/more_append_children/"),$("#tag_edit_form").submit()}})},add_node:function(e){"block"===$("#my_tag").css("display")&&"public_my_tag"===e.data("group-code")?e.children("ul").prepend("<li data-depth="+(parseInt(e.data("depth"))+1)+' data-tag-id = "" id="new_tag_list">'+App.front_business_card_lead_tags.create_text_select("new-tag","cancel add_cancel")+"</li>"):"block"===$("#my_tag").css("display")&&"private_my_tag"===e.data("group-code")?e.children("ul").prepend("<li data-depth="+(parseInt(e.data("depth"))+1)+' data-tag-id = "" id="new_tag_list">'+App.front_business_card_lead_tags.create_text_select("new-tag","cancel add_cancel",!1)+"</li>"):e.children("ul").prepend("<li data-depth="+(parseInt(e.data("depth"))+1)+' data-tag-id = "" id="new_tag_list">'+App.front_business_card_lead_tags.create_text("new-tag","cancel add_cancel")+"</li>"),e.children("ul").find("li").first().addClass("dd-item"),App.front_business_card_lead_tags.disabled_by_add_or_edit(),$("html, body").animate({scrollTop:e.find("li").filter(":first").offset().top-145},400,"swing"),e.children("ul:first").find(".edit-name").focus()},create_text:function(e,t){return'<div class="row-span '+e+'">\n<span class="input row-span"><input type="text" id="new_tag_name" name="name" class="edit-name add_decision_input" value=""></span>\n<span class="ml10 row-span"><a href="javascript:void(0)" class="sub-bnt decision add_decision task-button" tabindex="-1">'+$("#business_card_lead_tags_save").val()+'</a></span>\n<span class="ml15 row-span"><span class="sub-bnt '+t+' delete-button">'+$("#business_card_lead_tags_cancel").val()+"</span></span>\n</div>"},create_text_select:function(e,t,n){var i="";return 1==(n=void 0===n||n)&&(i="<option value='public_my_tag' selected>"+$("#business_card_lead_tags_mytag_public").val()+"</option>"),'<div class="row-span '+e+'">\n<span class="input row-span"><input type="text" id="new_tag_name" name="name" class="edit-name add_decision_input" value=""></span>\n<span class="input row-span group-code">'+$("#business_card_lead_tags_tag_category").val()+'<select id="new_group_code" name="group_code"> '+i+' <option value="private_my_tag">'+$("#business_card_lead_tags_mytag_private").val()+'</option></select></span>\n<span class="ml10 row-span"><a href="javascript:void(0)" class="sub-bnt decision add_decision task-button" tabindex="-1">'+$("#business_card_lead_tags_save").val()+'</a></span>\n<span class="ml15 row-span"><span class="sub-bnt '+t+' delete-button">'+$("#business_card_lead_tags_cancel").val()+"</span></span>\n</div>"},create_title:function(e){var t="";for(var n in e)t+=e[n]+"<br>";return t},disabled_by_add_or_edit:function(){$(".add,.edit,.delete,.user_link,.add_top,.folding,#all_open,#all_close,#search_submit,#js_clear_submit,#new_parent_tag,.display_tag_type input,.children-more,.change-parent,.all-check,#bulk-delete-submit,#search_name").addClass("add-disabled"),$(".user_link").removeAttr("onclick","target"),$(".add-disabled").prop("disabled",!0),$(document).off("mouseover",".forbid-delete,.last-one-parent-tag"),$(document).off("mouseover",".children-more"),$(document).off("change",".display_tag_type"),$(".btn-group").attr("data-toggle",""),$(window).off("scroll")},folding:function(){$(document).on("click",".dd-item button",function(){"expand"==$(this).attr("data-action")?App.front_business_card_lead_tags.children_list_show(this,"0"):($(this).attr("data-action","expand"),$(this).nextAll("ul").hide(),$(this).nextAll(".children-more").hide())}),$(document).on("click","#all_open",function(){var e=$("div.tags_div:visible").attr("id"),t=$("#tag_tree_"+e).children("li");!($("div.tags_div:visible ul").attr("data-tag-count")>parseInt($("#tag_"+e+"_size").val()))&&App.front_business_card_lead_tags.children_dom_check(t,!0)?($("#tag_tree_"+e+" .dd-list").show(),$("#tag_tree_"+e+" .folding").attr("data-action","collapse")):($(window).off("scroll"),App.front_business_card_lead_tags.tag_display_all("all_open",e))}),$(document).on("click","#all_close",function(){var e=$("div.tags_div:visible").attr("id");$("#tag_tree_"+e+" .dd-list").hide(),$("#tag_tree_"+e+" .dd-list").nextAll("a.children-more").hide(),$("#tag_tree_"+e+" .folding").attr("data-action","expand")})},children_list_show:function(e,t){$(e).nextAll(".dd-list").find(".dd-item").length?($(e).attr("data-action","collapse"),$(e).nextAll("ul").show(),$(e).nextAll(".children-more").show()):(parent_id=$(e).parent("li").data("tag-id"),App.front_business_card_lead_tags.load_list(parent_id),$("#tag_tag_category").val($("div.tags_div:visible").attr("id")),$("#tag_parent_tag_id").val(parent_id),$("#tag_add_flg").val(t),$("#tag_user_tags_lock_version").val($("#parent_my_tag_user_lock_version").val()),$("#tag_edit_form").attr("method","get"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/append_children/"),$("#tag_edit_form").submit())},tag_display_all:function(n,i){App.front_business_card_lead_tags.ajax_load(),$("#loading").show();var e=$("#tag_company_tags_lock_version").val(),t=$("#parent_my_tag_user_lock_version").val();$.ajax({url:"/xhr/business_card_lead_tags/tags_tree_index_html",type:"GET",data:{btn_name:n,processing_object:i,search_words:$("#tag_name").val(),company_tags_lock_version:e,user_tags_lock_version:t}}).done(function(e){if(e.error)App.front_business_card_lead_tags.show_result_error_message(e.messages),$("html, body").animate({scrollTop:0},400,"swing");else{$("#tag_tree_"+i).empty(),$("#tag_tree_"+i).append(e),$("#tag_"+i+"_size").val($("#tag_tree_"+i).attr("data-tag-count")),$('[data-toggle="tooltip"]').tooltip();var t=$.unique($("#tag_tree_"+i).find('li[data-depth="1"]').map(function(){return $(this).attr("data-user-id")}).get());$.each(t,function(e,t){App.front_business_card_lead_tags.change_parent_enabled_decision(t,i)}),$(".forbid-delete, .last-one-parent-tag").prop("disabled",!0),$("#tag_tree_"+i+" .dd-list").show(),"add_top"==n&&App.front_business_card_lead_tags.node_add_top(),$('#parent ul.tag_tree li[data-depth="1"]:last-child').addClass("last-node")}}).fail(function(){App.front_business_card_lead_tags.ajax_error_message(),$("html, body").animate({scrollTop:0},400,"swing")}).always(function(){$("#loading").hide(),App.front_business_card_lead_tags.inifinite_scroll()})},node_add_top:function(){var e="";e="none"===$("#my_tag").css("display")?App.front_business_card_lead_tags.create_text("new-tag new-parent-tag","parent_add_cancel"):App.front_business_card_lead_tags.create_text_select("new-tag new-parent-tag","parent_add_cancel"),$(".all_folding_area").after(e),$("#new_tag_name").focus(),App.front_business_card_lead_tags.disabled_by_add_or_edit()},edit_cancel:function(e){e.children("span").removeClass("none"),e.children("span").eq(2).addClass("none"),e.children("span").eq(3).addClass("none"),e.children("span").eq(4).addClass("none"),e.children("span").eq(5).addClass("none"),0<e.children("span").eq(3).find("span").length&&e.children("span").eq(3).find("option[value='common_tag'],option[value='public_my_tag']").unwrap()},confirm_text:function(e,t,n,a,s){var o='<li id="'+e.id+'" class="dd-item" data-depth="'+t+'" data-tag-id="'+e.id+'" data-group-code="'+e.group_code+'" data-user-id="'+e.user_id+'">\n<input class="lock_version" id="user_tags_lock_version" name="user_tags_lock_version" type="hidden" value="'+s+'">\n<div class="row-span">\n<span class="text de_tip" data-html="true" data-username="[]"><label class=\'checkbox-inline\'><input class="tag-ids" id="tag_ids_" name="tag_ids[]" type="checkbox" value="'+e.id+'">'+e.name+'</label></span>\n<span class="text">\uff08'+n+"\uff09";for("private_my_tag"===e.group_code&&(o+='<i class="fa fa-lock"></i>'),o+='</span>\n<span class="input none row-span"><input type="text" name="name" class="edit-name" value=""></span>\n<span class="input none row-span group-code">'+$("#business_card_lead_tags_tag_category").val()+'<select id="group_code" name="group_code" class="edit-group-code">',i=0;i<a.length;i++)e.group_code===a[i][1]?o+='<option value="'+a[i][1]+'" selected>'+a[i][0]+"</option>":o+='<option value="'+a[i][1]+'">'+a[i][0]+"</option>";return o+='</select></span>\n<span class="ml10 none row-span"><a href="javascript:void(0)" class="sub-bnt decision task-button" tabindex="-1">'+$("#business_card_lead_tags_save").val()+'</a></span>\n<span class="ml15 none row-span"><span class="sub-bnt cancel delete-button">'+$("#business_card_lead_tags_cancel").val()+"</span></span>\n",t<2&&(o+='<span class="ml10 row-span"><span class="sub-bnt add add-information-button">'+$("#business_card_lead_tags_add").val()+"</span></span>\n"),o+='<span class="ml15 row-span"><span class="sub-bnt edit edit-button">'+$("#business_card_lead_tags_edit").val()+'</span></span>\n<span class="ml15 row-span"><span class="sub-bnt delete delete-button">'+$("#business_card_lead_tags_delete").val()+'</span></span>\n<span class="ml15 row-span"><span class="sub-bnt change-parent change-parent-button">'+$("#business_card_lead_tags_change_parent").val()+"</span></span>\n</div>\n</li>"},add_collapse:function(e){0==e.children("button").length?e.prepend('<button class="folding" data-action="collapse" type="button">Expand></button>'):"none"===e.children("button").css("display")&&e.children("button").show()},remove_disabled:function(){$(".add-disabled,.btn").prop("disabled",!1),$(".add,.edit,.delete,.user_link,.add_top,.folding,#all_open,#all_close,#search_submit,#js_clear_submit,#new_parent_tag,.display_tag_type input,.children-more,.change-parent,.all-check,#bulk-delete-submit,#search_name").removeClass("add-disabled"),$(".forbid-delete, .last-one-parent-tag").prop("disabled",!0),$(document).on("mouseover",App.front_business_card_lead_tags.disabled_tooltip()),$(document).on("mouseover",App.front_business_card_lead_tags.children_more_display()),this.change_display_tag_type(),$(".btn-group").attr("data-toggle","buttons")},disabled_tooltip:function(){$(document).on("mouseover",".forbid-delete,.last-one-parent-tag",function(){if($(this).text()==$("#business_card_lead_tags_delete").val())var e=$("#business_card_lead_tags_error_delete_parent").val();else if($(this).text()==$("#business_card_lead_tags_change_parent").val()&&$(this).hasClass("last-one-parent-tag"))e=$("#business_card_lead_tags_info_change_parent_no_candidate").val();else if($(this).text()==$("#business_card_lead_tags_change_parent").val())e=$("#business_card_lead_tags_info_change_parent_exists_children").val();$(this).attr("title",e).tooltip("fixTitle").tooltip("show")}),$(document).on("mouseout",".forbid-delete,.last-one-parent-tag",function(){$(this).tooltip("destroy")})},children_dom_check:function(e,n){return e.each(function(e,t){return 0==$(t).children("button").length||(n=!(0<$(t).children("button").length&&0==$(t).children(".dd-list").length)&&(0!=$(t).children(".dd-list").children().length&&(!(0<$(t).has("a.children-more").length)&&App.front_business_card_lead_tags.children_dom_check($(t).children(".dd-list").children(".dd-item"),n))))}),n},ajax_load:function(){var e=$("<div>");e.attr("id","loading");var t=$("<div>");t.attr("id","spinner"),e.append(t),$("html").prepend(e),$(document).on("ajax:error",function(){$(".btn").prop("disabled",!1),$("#loading").hide(),$("#loading-list").hide(),App.front_business_card_lead_tags.ajax_error_message(),$("html, body").animate({scrollTop:0},400,"swing")})},inifinite_scroll:function(){$(window).on("scroll",function(){if(parseInt($("div.tags_div:visible ul").attr("data-tag-count"))>parseInt($("#tag_"+$("div.tags_div:visible").attr("id")+"_size").val())){var e=$(document).height()-($(window).height()+$(window).scrollTop());if(-3<e&&e<3){var t=$("div.tags_div:visible").find('li[data-depth="1"]').map(function(){return $(this).attr("data-tag-id")}).get();$("#loading").show(),$(window).off("scroll"),$("#tag_tag_category").val($("div.tags_div:visible").attr("id")),$("#tag_displayed_tag_ids").val(t.join(",")),$("#tag_user_tags_lock_version").val($("#parent_my_tag_user_lock_version").val()),$("#tag_edit_form").attr("method","post"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/next_tags"),$("#tag_edit_form").submit()}}})},load_list:function(e){var t=$("<div>");t.attr("id","loading-list");var n=$('<i class="fa fa-spinner fa-pulse fa-3x loading"></i>');n.attr("id","spinner-list"),t.append(n),$("li#"+e).before(t),$("#loading-list").show()},show_hide_all_folding_area:function(){function e(){0<$("input.tag-ids:visible").length?($("#bulk-delete-submit").show(),$(".all-check-div").show()):($("#bulk-delete-submit").hide(),$(".all-check-div").hide())}0<$("div.tags_div:visible").find("p.text-warning").length?$(".all_folding_area").css("visibility","hidden"):$(".all_folding_area").css("visibility","visible"),e()},change_parent_enabled_decision:function(e,t){function n(e){1===e.length?(e.children("div").find(".change-parent").not(".forbid-delete").addClass("last-one-parent-tag"),e.children("div").find(".change-parent").not(".forbid-delete").prop("disabled",!0)):(e.children("div").find(".change-parent").not(".forbid-delete").removeClass("last-one-parent-tag"),e.children("div").find(".change-parent").not(".forbid-delete").prop("disabled",!1))}var i=$("div.tags_div:visible").find('li[data-depth="1"]');"common_tag"===t?n(i.filter('[data-group-code="'+t+'"]')):(n(i.filter('[data-user-id="'+e+'"][data-group-code="public_my_tag"],[data-user-id="'+e+'"][data-group-code="private_my_tag"]')),n(i.filter('[data-user-id="'+e+'"][data-group-code="public_my_tag"]')))},change_parent_enabled:function(e){var t=$("div.tags_div:visible").find('li[data-depth="1"]');e?(t.children("div").find(".change-parent").not(".forbid-delete").removeClass("last-one-parent-tag"),t.children("div").find(".change-parent").not(".forbid-delete").prop("disabled",!1)):(t.children("div").find(".change-parent").not(".forbid-delete").addClass("last-one-parent-tag"),t.children("div").find(".change-parent").not(".forbid-delete").prop("disabled",!0))},ajax_error_message:function(){var e=$("#business_card_lead_tags_error_connection_reload").val();$("div#alert-message").html('        <div class="row">          <div class="col-xs-12">            <div class="alert alert-danger alert-error alert-dismissible" role="alert">              <button type="button" class="close" data-dismiss="alert" aria-label="Close">                <span aria-hidden="true">&times;</span>              </button>              <ul>                <li style="word-wrap: break-word;">'+e+"</li>              </ul>            </div>          </div>        </div>")},show_result_error_message:function(e){$("div#alert-message").html('        <div class="row">          <div class="col-xs-12">            <div class="alert alert-danger alert-error alert-dismissible" role="alert">              <button type="button" class="close" data-dismiss="alert" aria-label="Close">                <span aria-hidden="true">&times;</span>              </button>              <ul>                <li style="word-wrap: break-word;">'+e+"</li>              </ul>            </div>          </div>        </div>")},change_display_tag_type:function(){$(document).on("change",".display_tag_type",function(){$("#search_display_tag_type_1").is(":checked")?($("#common_tag").show(),$("#my_tag").hide(),$("#other_user_tag").hide(),"true"===$("#common_tag_create").val()?$("#new_parent_tag").show():$("#new_parent_tag").hide(),$("#search_display_tag_type").val($("#search_display_tag_type_1").val())):$("#search_display_tag_type_2").is(":checked")?($("#common_tag").hide(),$("#my_tag").show(),$("#other_user_tag").hide(),$("#new_parent_tag").show(),$("#search_display_tag_type").val($("#search_display_tag_type_2").val())):$("#search_display_tag_type_3").is(":checked")&&($("#common_tag").hide(),$("#my_tag").hide(),$("#other_user_tag").show(),$("#new_parent_tag").hide(),$("#search_display_tag_type").val($("#search_display_tag_type_3").val())),App.front_business_card_lead_tags.show_hide_all_folding_area()})},init_suggest:function(s,o){function e(){$("#"+s).on("click",function(){$("#"+s+" #s2id_autogen3").trigger("focus")}),$("#"+s+" #s2id_autogen3").on("focus",function(){"inline-block"===$("#"+s+" .select2-search-field span").css("display")&&$("#"+s+" .select2-search-field span").addClass("place-holder-hide");var e=0,t=$("#"+s+" ul.select2-choices").width();$("#"+s+" li.select2-search-choice").each(function(){t<=e+$(this).outerWidth(!0)&&(e=0),e+=$(this).outerWidth(!0)}),t-e-5<=20&&(e=0),$(this).css("width",t-e-5+"px"),0<$("#"+o+" li.new_tags").length&&$("#"+o+" li").length<=2?($("#"+o+" li.new_tags").show(),$("#"+o+" li.error-message-area").hide(),$("#"+o+" li.new_tags").addClass("select2-highlighted"),$("#"+o).css("display","block")):0<$("#"+o+" li.message-area").length&&"none"===$("#"+o).css("display")&&($("#"+o+" li.message-area").show(),$("#"+o+" li.message-area").removeClass("select2-ajax-error"),$("#"+o+" li.message-area").find("div").html($("#"+o+" li.message-area").attr("data-prompt")),$("#"+o+" li.message-area").addClass("select2-no-results"),$("#"+o).css("display","block")),$("#"+s).addClass("select2-dropdown-open"),a()}),$("#"+s+" #s2id_autogen3").on("input",function(i){""===$(i.target).val()&&(0<$("#"+o+" li.message-area").length?($("#"+o+" li.message-area").find("div").html($("#"+o+" li.message-area").attr("data-prompt")),$("#"+o+" li.message-area").removeClass("select2-ajax-error"),$("#"+o+" li.message-area").addClass("select2-no-results"),$("#"+o+" li.message-area").show()):0<$("#"+o+" li.new_tags").length&&($("#"+o+" li.new_tags").show(),$("#"+o+" li.error-message-area").hide(),$("#"+o+" li.new_tags").addClass("select2-highlighted")),t()),"none"===$("#"+o).css("display")&&$("#"+s+" #s2id_autogen3").trigger("focus"),c(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){if(""===$(i.target).val())return!1;var e=[];$("#"+s+" li[data-tag-id]").each(function(){e.push($(this).attr("data-tag-id"))}),$(i.target).addClass("select2-active"),0<$("#"+o+" li.message-area").length&&($("#"+o+" li.message-area").find("div").html($("#"+o+" li.message-area").attr("data-searching")),$("#"+o+" li.message-area").removeClass("select2-ajax-error"),$("#"+o+" li.message-area").addClass("select2-no-results"));var t=$(i.target).attr("data-result-area-name"),n=$(i.target).val();App.front_business_card_lead_tags.suggest_search(n,e.join(","),t,s,a)},500)})}function r(){$("#"+o+" li").removeClass("select2-highlighted"),n(),$("#"+o).css("display","none"),$("#"+s+" #s2id_autogen3").val(""),$("#"+s+" #s2id_autogen3").css("width","20px"),t(),$("#"+s).removeClass("select2-dropdown-open")}function t(){$("#"+o+" li.category_tags").remove(),$("#"+o+" li.select_tags").remove(),$("#"+o+" li.selected_tags").remove(),$("#"+o+" li.new_tags").show(),$("#"+o+" li.error-message-area").hide()}function n(){_=0,$("#"+o+" ul.my-tag-results").scrollTop(0)}function l(){$("#"+o+" ul.my-tag-results").get(0).offsetTop+_>$("#"+o+" li.select2-highlighted").get(0).offsetTop?(_=$("#"+o+" li.select2-highlighted").get(0).offsetTop-$("#"+o+" ul.my-tag-results").get(0).offsetTop,$("#"+o+" ul.my-tag-results").scrollTop(_)):$("#"+o+" ul.my-tag-results").height()+$("#"+o+" ul.my-tag-results").get(0).offsetTop+_<$("#"+o+" li.select2-highlighted").height()+$("#"+o+" li.select2-highlighted").get(0).offsetTop&&(_=$("#"+o+" li.select2-highlighted").height()+$("#"+o+" li.select2-highlighted").get(0).offsetTop-($("#"+o+" ul.my-tag-results").height()+$("#"+o+" ul.my-tag-results").get(0).offsetTop),$("#"+o+" ul.my-tag-results").scrollTop(_))}function a(){var e=window.navigator.userAgent.toLowerCase(),t=!1;-1==e.indexOf("msie")&&-1==e.indexOf("trident")||(t=!0),$("#"+s).hasClass(
"tag-select-modal")?($("#"+o).css("top",$("#"+s).get(0).offsetTop+$("#"+s).height()+$("#"+s).parents(".modal-body").prev().innerHeight()),$("#"+o).css("left",$("#"+s).position().left)):$("#"+s).hasClass("advanced-search")?($("#"+o).offset({top:$("#"+s).offset().top+$("#"+s).height()}),$("#"+o).css("left",$("#"+s).offset().left)):$("#"+s).hasClass("inside_sales_advanced-search")?$("#"+o).offset({top:$("#"+s).offset().top+$("#"+s).height(),left:$("#"+s).offset().left}):$("#"+s).hasClass("inside_sales_edit_lead_modal")?t?$("#"+o).css({top:$("#"+s).offset().top+$("div.lead-info-scroll").scrollTop()+$("#"+s).height()-110,left:$("#"+s).position().left}):$("#"+o).css({top:$("#"+s).get(0).offsetTop+$("#"+s).height(),left:$("#"+s).position().left}):$("#"+s).hasClass("mypage-tag-input-form")||$("#"+s).hasClass("tag-form")?($("#"+o).css("top",$("#"+s).get(0).offsetTop+$("#"+s).height()),$("#"+o).css("left",$("#"+s).position().left)):$("#"+s).hasClass("tag-select-modal-on-modal")?t?$("#"+o).css({top:$("#"+s).offset().top+$("#"+s).parents(".modal").scrollTop()+$("#"+s).height()-110,left:$("#"+s).position().left}):$("#"+o).css({top:$("#"+s).get(0).offsetTop+$("#"+s).height(),left:$("#"+s).position().left}):($("#"+s).get(0)&&$("#"+o).css("top",$("#"+s).get(0).offsetTop+$("#"+s).height()),$("#"+s).offset()&&$("#"+o).css("left",$("#"+s).offset().left)),$("#"+s).get(0)&&$("#"+o).css("width",$("#"+s).get(0).getBoundingClientRect().width),$("#"+o).css("min-height",$("#"+s).css("min-height")),$("#campaign-basic-setting").scrollTop(1e3)}function c(){$("#verification_search_word").html($("#"+s+" #s2id_autogen3").val()),$("#"+s+" #s2id_autogen3").width()<=$("#verification_search_word").width()&&$("#"+s+" #s2id_autogen3").css("width",$("#"+s+" ul.select2-choices").width()-5+"px"),a()}function i(e){var t=$("#"+s+" #s2id_autogen3").next();if(""!==t.val()){var n=t.val().split(",");n.push(e),t.val(n.join(","))}else t.val(e)}function d(e){var t=$("#"+s+" #s2id_autogen3").next(),n=t.val();n=1<n.split(",").length&&0===$.inArray(e,n.split(","))?n.replace(e+",",""):1<n.split(",").length&&0<$.inArray(e,n.split(","))?n.replace(","+e,""):"",t.val(n)}function u(){0===$("#"+s+" li.select2-search-choice").length&&$("#"+s+" .select2-search-field span").removeClass("place-holder-hide")}var _=0;e(),$("html").off("keydown"),$("html").on("keydown",function(e){if($("#"+s+" #s2id_autogen3").hasClass("select2-active"))return!1;if($("#"+s+" #s2id_autogen3").is(":focus")){var t=$("#"+o+" li.select2-highlighted"),n=$("#"+s+" li.select2-search-choice-focus");switch(n.removeClass("select2-search-choice-focus"),e.which){case 8:if(0===$("#"+s+" #s2id_autogen3").val().length)if(0===n.length)$("#"+s+" li.select2-search-choice").last().addClass("select2-search-choice-focus"),r();else if(0<n.prevAll("li.select2-search-choice").length){var i=n.prevAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),i.addClass("select2-search-choice-focus")}else if(0<n.nextAll("li.select2-search-choice").length){var a=n.nextAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),a.addClass("select2-search-choice-focus")}else $(n).find(".select2-search-choice-close").trigger("mousedown"),$("#"+s+" #s2id_autogen3").trigger("focus");break;case 46:if(0===$("#"+s+" #s2id_autogen3").val().length)if(0===n.length)$("#"+s+" #s2id_autogen3").trigger("focus");else if(0<n.nextAll("li.select2-search-choice").length){a=n.nextAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),a.addClass("select2-search-choice-focus")}else $(n).find(".select2-search-choice-close").trigger("mousedown"),$("#"+s+" #s2id_autogen3").trigger("focus");break;case 37:0===$("#"+s+" #s2id_autogen3").get(0).selectionStart&&(0===n.length?($("#"+s+" li.select2-search-choice").last().addClass("select2-search-choice-focus"),r()):0<n.prevAll("li.select2-search-choice").length&&n.prevAll("li.select2-search-choice").eq(0).addClass("select2-search-choice-focus"));break;case 38:e.preventDefault(),"none"===$("#"+o).css("display")?$("#"+s+" #s2id_autogen3").is(":focus")&&$("#"+s+" #s2id_autogen3").trigger("focus"):(0<$("#"+o+" li.new_tags").length&&"list-item"===$("#"+o+" li.new_tags").css("display")&&0===t.prevAll("li.select_tags").length?(t.removeClass("select2-highlighted"),$("#"+o+" li.new_tags").addClass("select2-highlighted")):0<t.prevAll("li.select_tags").length&&(t.removeClass("select2-highlighted"),t.prevAll("li.select_tags").eq(0).addClass("select2-highlighted")),l());break;case 39:0===$("#"+s+" #s2id_autogen3").val().length&&(0===n.nextAll("li.select2-search-choice").length?$("#"+s+" #s2id_autogen3").trigger("focus"):n.nextAll("li.select2-search-choice").eq(0).addClass("select2-search-choice-focus"));break;case 40:e.preventDefault(),"none"===$("#"+o).css("display")?$("#"+s+" #s2id_autogen3").is(":focus")&&$("#"+s+" #s2id_autogen3").trigger("focus"):(0<t.nextAll("li.select_tags").length&&(t.removeClass("select2-highlighted"),t.nextAll("li.select_tags").eq(0).addClass("select2-highlighted")),l());break;case 13:e.preventDefault(),"none"===$("#"+o).css("display")?$("#"+s+" #s2id_autogen3").is(":focus")&&$("#"+s+" #s2id_autogen3").trigger("focus"):($("#"+o+" li.select2-highlighted").trigger("mousedown"),$("#"+o+" li.select2-highlighted").hasClass("select_tags")&&r())}}}),$("#"+s+" #s2id_autogen3").off("blur"),$("#"+s+" #s2id_autogen3").on("blur",function(){var e=["my-tag-dropdown","advanced-search-pulldown","update-all-modal-tag-pulldown"];if(0<=$.inArray(document.activeElement.id,e))return $("#"+s+" #s2id_autogen3").focus(),!0;r(),u(),$("#"+s+" li.select2-search-choice-focus").removeClass("select2-search-choice-focus"),$("#verification_search_word").html("")}),$(document).off("click","#"+s+" li.select2-search-choice"),$(document).on("click","#"+s+" li.select2-search-choice",function(){$("#"+s+" li.select2-search-choice").removeClass("select2-search-choice-focus"),$(this).addClass("select2-search-choice-focus"),r()}),$(document).on("mouseover","#"+o+" li.select_tags,#"+o+" li.new_tags",function(){$("#"+o+" li").removeClass("select2-highlighted"),$(this).addClass("select2-highlighted")}),$(document).off("mousedown","#"+o+" li.select_tags"),$(document).on("mousedown","#"+o+" li.select_tags",function(){var e=$(this).find("span.select2-tag").html(),t=$(this).find("span.tag-owner").text(),n="";0<$(this).find("i").length&&(n=$(this).find("i").prop("outerHTML")),$("#"+s+" .select2-search-field").before('<li class="select2-search-choice" data-tag-id="'+$(this).attr("data-tag-id")+'"><div><span>'+e+"</span>"+App.concerns.xss_step(t)+n+'</div><a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>'),i($(this).attr("data-tag-id"))}),$(document).off("mousedown","#"+s+" .select2-search-choice-close"),$(document).on("mousedown","#"+s+" .select2-search-choice-close",function(e){e.preventDefault(),d($(this).parents("li").attr("data-tag-id")),$(this).parent("li.select2-search-choice").remove(),u()}),$("#"+o+" li.new_tags").off("mousedown"),$("#"+o+" li.new_tags").on("mousedown",function(){$(".notifications").remove(),$("#loading").show(),new_tag_name=$("#"+s+" #s2id_autogen3").val(),$.ajax({url:"/xhr/business_card_lead_tags/create",data:{new_tag_name:new_tag_name},type:"POST"}).done(function(e){e.result?($("#"+s+" .select2-search-field").before('<li class="select2-search-choice" data-tag-id="'+e.tag.id+'"><div><span>'+App.concerns.xss_step(new_tag_name)+"</span>\uff08"+App.concerns.xss_step(e.owner_name)+'\uff09</div><a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>'),$("#"+s+" #s2id_autogen3").val(""),$("div#tag-alert-message").html(""),i(e.tag.id),r(),$("#"+s+" .select2-search-field span").length&&$("#"+s+" .select2-search-field span").addClass("place-holder-hide")):$("body").prepend(e),$("#loading").hide()}).fail(function(){$("#loading").hide(),alert($("#business_card_lead_tags_error_connection").val())})}),$("#"+o+" ul.my-tag-results").off("scroll"),$("#"+o+" ul.my-tag-results").on("scroll",function(){_=$(this).scrollTop()}),$(window).off("resize"),$(window).on("resize",function(){a()})},suggest_search:function(e,u,_,t,n){var h="";h=0<$("#"+_+" .removable_tags").length?"removable_tags":"search_tags",$.ajax({url:"/xhr/business_card_lead_tags/search",type:"POST",data:{name:e,selected_tag_ids:u,search_type:h,display_tags:$("#display_tags").val()}}).done(function(e){if($("#loading").hide(),e.error)0<$("#"+_+" li.message-area").length?($("#"+_+" li.message-area").show(),$("#"+_+" li.message-area").addClass("select2-ajax-error"),$("#"+_+" li.message-area").removeClass("select2-no-results"),$("#"+_+" li.message-area").find("div").html($("#business_card_lead_tags_error_connection").val())):($("#"+_+" .new_tags").hide(),$("#"+_+" li.error-message-area").show(),$("#"+_+" li.error-message-area").find("div").html($("#business_card_lead_tags_error_connection").val()));else{$("#"+_+" li.message-area").removeClass("select2-ajax-error"),$("#"+_+" li.message-area").addClass("select2-no-results");var t={common_tag:$("#business_card_lead_tags_shared_tag").val(),my_tag:$("#business_card_lead_tags_mytag").val(),other_user_tag:$("#business_card_lead_tags_mytag_other").val()},n="",i="";$("#"+_+" .category_tags").remove(),$("#"+_+" .selected_tags").remove(),$("#"+_+" .select_tags").remove(),e.same_flg?$("#"+_+" .new_tags").hide():$("#"+_+" .new_tags").show(),$("#"+_+" li.error-message-area").hide();var a="",s="#"+_+" ul.my-tag-results",o=u.split(",");for(tag in e.tags)if(0<e.tags[tag].tags.length){a+='<li class="my-tag-results-tag-group select2-result select2-result-selectable category_tags '+tag+'" id="'+tag+'" role="presentation"><div class="select2-result-label" id="select2-result-label-1" role="option"><span class="select2-match"></span><span class="category-tag">'+t[tag]+"</span></div></li>";for(var r=0;r<e.tags[tag].tags.length;r++){var l=e.tags[tag].tags[r];n="private_my_tag"===l.group_code?'<i class="fa fa-lock"></i>':"",a+='<li class="select2-results-dept-0 select2-result select2-result-selectable '+(-1<o.indexOf(l.id.toString())?"selected_tags":e.parent_tag_unselectable_flg?"selected_tags":"removable_tags"==h&&"common_tag"==l.group_code&&null!=e.selectable_common_tag_ids&&0==e.selectable_common_tag_ids.includes(l.id)?"selected_tags":"select_tags")+" "+tag+'" role="presentation" data-tag-id="'+l.id+'"><div class="select2-result-label" id="select2-result-label-2" role="option"><span class="select2-match"></span><span class="select2-tag">'+App.concerns.xss_step(l.name)+"</span>","common_tag"!==l.group_code&&(a+='<span class="tag-owner">\uff08'+App.concerns.xss_step(e.tags[tag].owners[l.user_id])+"\uff09"+n+"</span>"),a+="</div></li>";for(var c=e.children_tags[tag].tags.filter(function(e){return e.parent_tag_id===l.id}),d=0;d<c.length;d++)i="private_my_tag"===c[d].group_code?'<i class="fa fa-lock"></i>':"",a+='<li class="select2-results-dept-1 select2-result select2-result-selectable select_tags '+tag+'" role="presentation" data-tag-id="'+c[d].id+'"><div class="select2-result-label" id="select2-result-label-2" role="option"><span class="select2-match"></span><span class="select2-tag">'+App.concerns.xss_step(c[d].name)+"</span>","common_tag"!==c[d].group_code&&(a+='<span class="tag-owner">\uff08'+App.concerns.xss_step(e.children_tags[tag].owners[c[d].user_id])+"\uff09"+i+"</span>"),a+="</div></li>"}}$(s).append(a),0===$(s).find("li.new_tags").length?0<$(s).find("li.select_tags").length?($("#"+_+" li.message-area").hide(),$(s).find("li.select_tags").eq(0).addClass("select2-highlighted")):($("#"+_+" li.message-area").show(),$("#"+_+" li.message-area").find("div").html($("#"+_+" li.message-area").attr("data-nothing"))):0<$(s).find("li.select_tags").length?($(s).find("li.select_tags").eq(0).addClass("select2-highlighted"),$(s).find("li.new_tags").removeClass("select2-highlighted")):$(s).find("li.new_tags").addClass("select2-highlighted")}}).fail(function(){0<$("#"+_+" li.message-area").length?($("#"+_+" li.message-area").show(),$("#"+_+" li.message-area").addClass("select2-ajax-error"),$("#"+_+" li.message-area").removeClass("select2-no-results"),$("#"+_+" li.message-area").find("div").html($("#business_card_lead_tags_error_connection").val())):($("#"+_+" .new_tags").hide(),$("#"+_+" li.error-message-area").show(),$("#"+_+" li.error-message-area").find("div").html($("#business_card_lead_tags_error_connection").val()))}).always(function(){$("#"+t+" #s2id_autogen3").removeClass("select2-active"),n&&n()})}};var CONST_ANOTHER_CONTROLLER_TYPE_INSIDE_SALES="7";App.front_campaigns={attach_input_handlers:function(e,t){App.lead_filters.target_extraction_condition_modal(e),App.concerns.attach_select_search_handlers(e),App.concerns.attach_date_time_picker_handlers(e),App.concerns.attach_date_picker_handlers(e),t(e),e.find("[data-hp-role='select2']").select2({minimumResultsForSearch:20})},index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn-advanced","#link-clear-campaigns-advanced"),App.concerns.disable_buttons_submit_custom(".js-disable-btn-simple","#link-clear-campaigns-simple"),App.concerns.disable_duplicate_request_search_form("#hp-form_search_campaigns",".js-disable-btn-advanced, js-disable-btn-simple");var e=$(".hp-page");App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_order("hp-form_search_campaigns"),App.concerns.change_display_number("hp-form_search_campaigns"),App.visible_fields.setup_list_visible_setting(),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.switch_search_form($(".hp-page [data-hp-role='form-switch']")),App.concerns.attach_date_picker_handlers(e),App.concerns.attach_select_search_handlers(e),$(".hp-page [data-hp-role='search-config']").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),$(".hp-page [data-hp-role='table-config']").on("click",function(){App.visible_fields.show_list_fields_setting()}),$(".hp-page [data-hp-role='select2']").select2({minimumResultsForSearch:20}),App.front_segments.set_segment_select2("#search_segment_ids"),App.concerns.focus_to_first_element(),this.set_campaign_create_modal(),App.concerns.set_form_action_to_submit("#form_checked_campaigns","#js_destroys_submit",!0),App.concerns.all_checked_items(),App.concerns.enable_csv_export_event("#hp-form_search_campaigns","checked[campaign_ids][]"),this.set_column_span(".js_leads_detail_parent",["hot_lead_cnt","reaction_lead_cnt","no_reaction_lead_cnt"]),this.set_column_span(".js_notification_parent",["hot_notification_flg","hot_lead_notification_flg","weekly_summary_flg","hot_notification_mail_to_user_ids"]),App.concerns.set_associate_entities_to_s2("#seminars_multiple_decision","#search_seminar",'input[name="associate_seminars[]"]',"seminars"),App.concerns.enable_associattion_search_modal("#open_seminar","/xhr/seminars/search_as_association_modal","#search_seminar","multiple");new Clipboard(".clipboard-btn");App.concerns.open_mailer(),App.tooltip.display_tooltip();var t="campaigns";App.front_recommend.recommendScenarios(t)},show:function(){App.front_campaigns.attach_input_handlers($(".hp-page"),function(e){App.lead_filters.lead_search_modal(e)}),App.concerns.set_form_action_to_submit("#form_checked_tasks","#js_updates_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_tasks","#js_get_modal_submit"),App.concerns.set_form_action_to_submit("#form_checked_tasks","#js_get_inside_sales_modal_submit"),App.concerns.submit_when_changed_element("form_set_mail_template","js_change_element","convert"),App.concerns.set_form_action_to_submit("#form_search_index",".search_index",!0),App.concerns.set_form_action_to_submit("#form_search_index_ransack",".search_index_ransack",!0),App.concerns.select_search_disable_user("sales_user_ids_on_new_campaign"),App.concerns.select_search_disable_user("holder_user_ids_on_new_campaign");var e=$("#lead_index_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search_disable_user("search_items___"+t+"_item_user_ids")});new Clipboard(".clipboard-btn");this.change_form("form_checked_tasks"),App.target_list_tags_search.init_suggest("client-container #target-search-tags-basic-campaign-targets","client-container #target-search-tags-pulldown-basic-campaign-targets"),App.concerns.lead_tags_modal("#client-container #open-business-card-lead-tags-campaign-targets","#client-container #campaign_targets_lead_filter_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_lead_filter_targets"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_lead_filter_targets","#client-container #target-search-tags-basic-campaign-targets","#client-container #campaign_targets_lead_filter_tag_ids"),$("#js_submit_checked_leads, #js_submit_all_leads, #js_get_modal_submit, #js_get_inside_sales_modal_submit").on("click",function(){function e(e){$("div#js_error_message").html('          <div class="row">            <div class="col-xs-12">              <div class="alert alert-danger alert-error alert-dismissible" role="alert">                <button type="button" class="close" data-dismiss="alert" aria-label="Close">                  <span aria-hidden="true">&times;</span>                </button>                <ul>                  <li style="word-wrap: break-word;">'+e+"</li>                </ul>              </div>            </div>          </div>"),$("body,html").animate({scrollTop:0},0),$(".modal-caller").attr("disabled",null),$(".modal-caller").css("pointer-events","")}if($(this).hasClass("require_checked")){if(0==$("#form_checked_tasks input[name='checked[lead_ids][]']:checked").length)return e(I18n.t("js.common.please_select")),!1}else if(0==$("#form_checked_tasks input[name='checked[lead_ids][]']").length)return e(I18n.t("js.common.please_select")),!1;return $(".modal-caller").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none"),form=App.concerns.set_form_action("form_checked_tasks",$(this).data("action"),$(this).data("remote")),$("#js_all_leads").prop("disabled","js_submit_all_leads"!==$(this).attr("id")),form.submit(),!1}),$("#checked-leads-link").on("click",function(){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),!1}),$("#js_submit_checked_mail").on("click",function(e){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1}),$("#js_submit_search_mail").on("click",function(e){if(!$("#all_lead_ids").val().trim())return alert(I18n.t("js.common.serch_result_none")),e.stopImmediatePropagation(),!1}),App.concerns.mail_type_select_modal_submit("form_checked_tasks"),App.concerns.mail_type_select_modal_submit("form_story_action_mail_new"),App.concerns.mail_type_select_modal_submit("form_story_action_mail_edit"),$(".hp-page .campaigns.front.show .hp-hot-leads-button-area").on("click",".hp-register-hot-lead-filter",function(){var e=$(".hp-page .campaigns.front.show .hp-lead-search-form").find("form"),t=$(".hp-page .campaigns.front.show .hp-dialog-container .hp-hot-leads-setting-dialog"),n=t.find(".hp-label.hp-filter-registered-at"),i=t.find(".hp-frm-hot-leads");return t.removeClass("hide").dialog({modal:!0,title:I18n.t("js.campaigns.lead_condition"),width:480,title_html:!0,draggable:!0,appendTo:".hp-page .campaigns.front.show .hp-dialog-container",buttons:[{text:I18n.t("js.common.save"),"class":"btn btn-primary btn-xs hp-button hp-hot-leads-setting-dialog-create",click:function(){(1!=n.data("hp-filter-exists")||confirm(I18n.t("js.campaigns.lead_registered")))&&$.ajax({url:i.prop("action"),type:i.attr("method"),data:e.serialize(),timeout:6e4,dataType:"script"}).done(function(){e.submit()})}},{text:I18n.t("js.common.delete"),"class":"btn btn-primary btn-xs hp-button hp-hot-leads-setting-dialog-destroy",disabled:0==n.data("hp-filter-exists"),click:function(){confirm(I18n.t("js.campaigns.lead_delete"))&&$.ajax({url:i.prop("action"),type:"delete",timeout:6e4,dataType:"script"}).done(function(){e.submit()})}}]}),!1}),$(".hp-campaign-chart-toggle").find(".dropdown-menu li a").click(function(){$(this).parents(".dropdown").find(".dropdown-toggle").html($(this).text()+' <span class="caret"></span>'),$(this).parents(".dropdown").removeClass("open")}),$(".hp-page .campaigns.front.show .hp-hot-leads-button-area").on("click",".hp-load-hot-leads",function(){if($(".hp-hot-leads-setting-dialog .hp-label.hp-filter-registered-at").data("hp-filter-exists")){$(this).closest(".hp-hot-leads-button-area").removeClass("open");var n=new App.concerns.loading_indicator($(".hp-page")),e=$(".hp-page .campaigns.front.show .hp-lead-search-form"),t=e.find("form"),i=e.find(".lead-filter-panels"),a={open_sections:i.find(".hp-lead-filter-panel .panel-body .panel .panel-body:visible").map(function(){return $(this).data("hpTarget")}).get()};n.begin(),$.ajax({url:$(this).data("action"),type:$(this).data("method"),data:a,timeout:6e4,dataType:"script"}).done(function(){App.lead_filters.reload_lead_filter_form(i)}).fail(function(e,t){"timeout"==t?n.timeout():n.error()}).always(function(){App.lead_filters.revive_placeholder(i),n.finish(),t.submit()})}else alert(I18n.t("js.campaigns.lead_set"))}),App.concerns.open_mailer(),$(".campain_tab").each(function(e,t){tab_id=e+1,$(t).hasClass("active")&&(1==tab_id||4==tab_id?($("#form_story_action_mail_new").addClass("do_not_submit"),$("#form_story_action_mail_edit").addClass("do_not_submit"),$("#form_checked_tasks").addClass("do_not_submit")):2==tab_id?($("#form_checked_tasks").removeClass("do_not_submit"),$("#form_story_action_mail_new").addClass("do_not_submit"),$("#form_story_action_mail_edit").addClass("do_not_submit")):3==tab_id&&($("#form_story_action_mail_new").removeClass("do_not_submit"),$("#form_story_action_mail_edit").removeClass("do_not_submit"),$("#form_checked_tasks").addClass("do_not_submit")))}),$(document).on("change",".campain_tab",function(){if($("#summary-container").hide(),$("#client-container").hide(),$("#scenario-container").hide(),$("#workflow-container").hide(),$("#campain_tab_1").is(":checked")){$("#summary-container").show();var e=$("#campaigns-lead-stauts-graph").highcharts();e.reflow(),!e.series[0].data.some(function(e){var t=e.y;return t&&0<t})&&e.redraw(),$(".hp-page-lead-custom-search").hasClass("active")&&($(".hp-page-lead-default-search").addClass("active"),$(".hp-page-lead-custom-search").removeClass("active")),$(".hp-lead-filter-panel-custom").addClass("hidden"),$(".hp-lead-filter-panel-default").removeClass("hidden")}else $("#campain_tab_2").is(":checked")?($("#client-container").show(),$("#form_checked_tasks").removeClass("do_not_submit"),$("#form_story_action_mail_new").addClass("do_not_submit"),$("#form_story_action_mail_edit").addClass("do_not_submit")):$("#campain_tab_3").is(":checked")?($("#scenario-container").show(),$("#form_story_action_mail_new").removeClass("do_not_submit"),$("#form_story_action_mail_edit").removeClass("do_not_submit"),$("#form_checked_tasks").addClass("do_not_submit")):$("#campain_tab_4").is(":checked")&&($("#workflow-container").show(),$("#form_checked_tasks").addClass("do_not_submit"),$("#form_story_action_mail_new").addClass("do_not_submit"),$("#form_story_action_mail_edit").addClass("do_not_submit"));$("#summary-container #target-search-tags-basic #s2id_autogen3").trigger("blur"),$("#client-container #target-search-tags-basic #s2id_autogen3").trigger("blur")}),this.attatch_event_handlers_to_summary_tab(),this.attatch_event_handlers_to_target_tab(),this.attatch_event_handlers_to_story_tab(),App.front_stories.load(),this.copy_to_clipboard("#invisible_number"),$(".js-slide-search-field").on("click",function(){$("#slide-target").slideToggle(),$(this).hasClass("in")?$(this).removeClass("in"):$(this).addClass("in")}),$("#copy-campaign").on("click",function(){$.ajax({url:$(this).data("check-href"),dataType:"json"}).done(function(e){if(0<e.creation_limit_msg.length)return alert(e.creation_limit_msg),!1;window.location.href=$("#copy-campaign").data("copy-href")})}),App.tooltip.display_tooltip(),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),App.next_steps.set_workflow_index_tooltip(),$(".stepable-record-field-modal-link").on("click",function(){$(".stepable_record_field_modal").find(".user_information").attr("stepable-record-field-page-scroll-top",$(document).scrollTop())})},"new":function(){App.front_campaigns.attach_input_handlers($(".hp-page"),function(e){App.lead_filters.lead_filter_modal(e)}),$("#campaign-scoring-setting-edit").find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),$("#campaign-scoring-condition").find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),App.front_scores.attach_event_handlers(),$("#new_campaign_name").focus(),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#tag-field","#tags"),App.front_segments.set_segment_select2("#campaign_segment_id")},create:function(){this["new"]()},edit:function(){App.front_deals.all_checked_items_modal_deals_index(),App.front_campaigns.attach_input_handlers($(".hp-page"),function(e){App.lead_filters.lead_additional_modal(e),App.lead_filters.lead_filter_modal(e),App.lead_filters.all_checked_items(),App.lead_filters.apply_leads_count()}),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#tag-field","#tags"),$("#campaign-scoring-setting-edit").find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),$("#campaign-scoring-condition").find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),App.front_scores.attach_event_handlers(),App.front_segments.set_segment_select2("#campaign_segment_id"),$("#campaign-scoring-condition .target_leads_custom_search_form_clear").each(function(){var e=$(this).attr("data-form-index");$("#target-search-tags"+e).size()&&(App.target_list_tags_search.init_suggest("target-search-tags"+e,"target-search-tags-pulldown"+e),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-custom-lead-filter"+e,"#campaign_score_lead_filter_score_custom_lead_filters_attributes_"+e+"_search_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"+e),App.concerns.lead_tags_modal_selection("#lead_tag_selection"+e,"#target-search-tags"+e,"#campaign_score_lead_filter_score_custom_lead_filters_attributes_"+e+"_search_ids"))})},update:function(){this.edit()},change_form:function(t){$(document).on("click",".checked_submit",function(){var e=$("#"+t);$(e).attr("action",$(this).data("action")),$(this).data("remote")?$(e).attr("data-remote","true"):($(e).removeAttr("data-remote"),$(e).removeData("remote"))})},get_modal_to_search_campaigns:function(e,t,n){$(".js_modal_search_campaigns_caller_btn").attr("disable","disable"),$(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_selected_campaign_ids").val($(e).val()),$("#js_search_type").val(t),$("js_without_move_button").val(n),$("#js_get_modal_to_search_campaigns").submit(),$(".modal-backdrop").last().css("z-index",9998)},modal_open:function(n){$.ajax({url:n.data("href"),dataType:"html",data:n.data("params")}).done(function(e){if(-1!=e.indexOf("campaign_limit"))return alert(e.replace('<div id="campaign_limit">',"").replace("</div>","").trim()),$(".modal-caller").not(".modal .modal-caller").attr("disabled",null),$(".modal-caller").not(".modal .modal-caller").css("pointer-events",""),!1;var t=$("#modalContainer");t.html(e),t.find(".hidden-xs").addClass("hidden-xs-on-modal"),t.off("shown.bs.modal"),t.off("hidden.bs.modal"),t.on("shown.bs.modal",function(){$(document).find(".modal-open")[0]&&($(".modal-backdrop").css("z-index",1020),t.css("z-index",1035)),t.scrollTop(0),n.trigger("load_modal",[t])}).on("hidden.bs.modal",function(){t.empty(),$("#target-select-modal").empty()}).modal("show"),App.front_campaigns.attach_input_handlers($("#campaign-basic-setting"),function(){}),App.lead_filters.lead_filter_modal($("#campaign-basic-setting, #target-select-modal, #campaign-target-setting")),App.front_campaigns.attach_input_handlers($("#campaign-target-setting"),function(){}),$("#campaign-scoring-setting").find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),$("#campaign-scoring-condition").find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),App.front_scores.attach_event_handlers()})},set_campaign_create_modal:function(){$(document).on("click","[data-hp-role='campaign_create_wizard']",function(){App.front_campaigns.modal_open($(this))}),$(document).off("load_modal","[data-hp-role='campaign_create_wizard']"),$(document).on("load_modal","[data-hp-role='campaign_create_wizard']",function(){function e(){$.ajax({type:"POST",url:"/xhr/campaigns/preview",data:$("#campaign-create-form").serialize()}).done(function(e){$("#step5").html(e)})}function t(e){$('a[data-toggle="tab"][href="#step'+e+'"]').tab("show")}function n(e){0!=$("#popup-YouTube-player").length&&$("#popup-YouTube-player")[0].contentWindow.postMessage('{"event":"command","func":"'+e+'","args":""}',"*")}function i(e){var t=$(e).parent("li");t.addClass("passed"),t.prevAll("li").addClass("passed"),t.nextAll("li").removeClass("passed")}function a(e){var t="4"==$(e).closest(".active").attr("data-step")?"95%":"850px";$("#campaign-new-modal").animate({width:t},"slow")}function s(t){return function(){var e=void 0===t?$('[data-hp-role="copy"]'):t;window.getSelection().selectAllChildren(e[0]),document.execCommand("copy")}}$setup_wizard=$(".setup-wizard"),$("div.tab-pane:first").addClass("active"),$(document).off("click","[data-hp-role='move_step']"),$(document).on("click","[data-hp-role='move_step']",function(){n("pauseVideo"),t($(this).data("step"),$(this).data("cur-step")),!0===$(this).data("preview")&&e()}),$('a[data-toggle="tab"]').on("shown.bs.tab",function(e){i(e.target),a(e.target),"2"==$(e.target).closest(".active").attr("data-step")&&$("#new_campaign_name").focus()}),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#tag-field","#tags"),$("#campaign-target-setting #copy-target-select-condition").click(s()),App.front_segments.set_segment_select2("#campaign_segment_id")})},attatch_event_handlers_to_summary_tab:function(){App.target_list_tags_search.init_suggest("summary-container #target-search-tags-basic-campaign-summary","summary-container #target-search-tags-pulldown-basic-campaign-summary"),App.concerns.lead_tags_modal("#summary-container #open-business-card-lead-tags-campaign-summary","#summary-container #campaign_summary_lead_filter_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_lead_filter_sumarry"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_lead_filter_sumarry","#summary-container #target-search-tags-basic-campaign-summary","#summary-container #campaign_summary_lead_filter_tag_ids"),$("[data-hp-role='apply-filter']").on("mousedown",function(){$("#clear_flg").val(!1)}),$("[data-hp-role='clear']").on("mousedown",function(){$("#clear_flg").val(!0),$("#client_id").val(null),$("#scenario_detail_id").val(null)})},attatch_event_handlers_to_target_tab:function(){$(
"#client-container").find("[data-hp-role='lead_filter_search_switch']").on("change",function(){var e={rootSelector:"#client-container"};App.lead_filters.lead_filter_search_switch_by_selector($(this).val(),e)});var o=$("#client-container").find(".hp-lead-filter-panel-custom"),e=$("#client-container").find("[data-hp-custom-role='custom_search_model_select']");e.select2({minimumResultsForSearch:20}),e.select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),$(document).on("nested:fieldAdded",function(e){var t=$(e.currentTarget.activeElement);if(t.parents("#client-container").length<1)return!1;var n=$("#client-container").find(".target_leads_custom_search_form");if(n.find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),n.find(".ah_placeholder").each(function(e,t){$(t).val()===$(t).data("placeholder-string")&&$(t).val("")}),n.find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),t.data("limit")){var i={section:"#client-container.hp-lead-filter-custom-section"};t.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count_by_selector(i)>=t.data("limit")&&t.hide()}}),$(document).on("nested:fieldRemoved",function(e){if($(e.currentTarget.activeElement).parents("#client-container").length<1)return!1;var t=o.find("a.add_nested_fields"),n=$("#client-container").find(".hp-lead-filter-custom-section"),i=n.attr("data-reset-flg"),a=n.attr("data-search-mode");if(t.data("limit")){var s={section:"#client-container.hp-lead-filter-custom-section"};t.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count_by_selector(s)<t.data("limit")&&t.show(),t.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count_by_selector(s)==0&&"true"!==i&&"true"==a&&t.click()}}),App.front_business_card_lead_tags.init_suggest("update-all-modal-tags","update-all-modal-tag-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#update-all-modal-tags","#tags"),$("#modalsearchBusinessCardsLeadTags").on("hidden.bs.modal",function(){($("#myModal").is("[aria-hidden=false]")||$("#modaltagsBulkDeletionVisibleFields").is("[aria-hidden=false]"))&&$("body").addClass("modal-open")}),$("#modalsearchBusinessCardsLeadTags").on("shown.bs.modal",function(){$(".modal-backdrop").last().css("z-index",9998)}),$(".js_open_modal_update_checked").on("click",function(){if($(this).hasClass("require_checked")&&0==$("#form_checked_tasks input[name='checked[lead_ids][]']:checked").length){var e=I18n.t("js.common.please_select");return $("div#js_error_message").html('            <div class="row">              <div class="col-xs-12">                <div class="alert alert-danger alert-error alert-dismissible" role="alert">                  <button type="button" class="close" data-dismiss="alert" aria-label="Close">                    <span aria-hidden="true">&times;</span>                  </button>                  <ul>                    <li style="word-wrap: break-word;">'+e+"</li>                  </ul>                </div>              </div>            </div>"),$("body,html").animate({scrollTop:0},0),$(".modal-caller").attr("disabled",null),$(".modal-caller").css("pointer-events",""),!1}return $("#lead_tags_update_type").val("checked"),form=App.concerns.set_form_action("form_checked_tasks",$(this).data("action"),$(this).data("remote"),".js_open_modal_update_checked",!0),$("#js_all_leads").prop("disabled","js_submit_all_leads"!==$(this).attr("id")),form.submit(),!1}),$(".js_open_modal_update_all").on("click",function(){return $("#lead_tags_update_type").val("all"),form=App.concerns.set_form_action("form_checked_tasks",$(this).data("action"),$(this).data("remote"),".js_open_modal_update_all",!0),$("#js_all_leads").prop("disabled","js_submit_all_leads"!==$(this).attr("id")),form.submit(),!1}),$("#bulk_update").on("click",function(e){e.preventDefault();var t=$("#myModal .select2-search-choice div");if(0==t.length)return alert("\u30bf\u30b0\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093"),!1;var n=I18n.t("js.campaigns.add_tag_confirm");if(t.each(function(e,t){n=n+"\n  "+$(t).text()}),!confirm(n))return!1;var i=$("#client_new_lead_filter"),a=$("#form_checked_tasks"),s=$.merge($.merge([],i.serializeArray()),a.serializeArray()),o=$(this).data().action;$.ajax({type:"POST",url:o,data:s}),$("#bulk_update").prop("disabled",!0)}),$("#js_submit_exclude_leads, #js_submit_unexclude_leads, #js_submit_end_sales").on("click",function(e){if(e.preventDefault(),0==$("#form_checked_tasks input[name='checked[lead_ids][]']:checked").length){var t=I18n.t("js.common.please_select");return $("div#js_error_message").html('          <div class="row">            <div class="col-xs-12">              <div class="alert alert-danger alert-error alert-dismissible" role="alert">                <button type="button" class="close" data-dismiss="alert" aria-label="Close">                  <span aria-hidden="true">&times;</span>                </button>                <ul>                  <li style="word-wrap: break-word;">'+t+"</li>                </ul>              </div>            </div>          </div>"),$("body,html").animate({scrollTop:0},0),!1}var n=$(this).data().confirmMessage;if(!confirm(n))return!1;var i=$("#client_new_lead_filter"),a=$("#form_checked_tasks"),s=$.merge($.merge([],i.serializeArray()),a.serializeArray()),o=$(this).data().action,r=$(this).data().method;$.ajax({type:r,url:o,data:s})}),App.front_campaigns.attach_input_handlers($("#add_lead_modal"),function(e){App.lead_filters.lead_additional_modal(e),App.lead_filters.all_checked_items(),App.lead_filters.apply_leads_count(),e.find("[data-hp-role='lead-filter-addition-modal']").on("hidden.bs.modal",function(){App.lead_filters.is_updated_added_leads&&$("[data-hp-role='lead-search-form']").find("form").submit()})}),App.visible_fields.setup_list_visible_setting(),$(".hp-page [data-hp-role='table-config']").on("click",function(){App.visible_fields.show_list_fields_setting()}),$("#modal_block_for_tasks").on("show.bs.modal",function(){$("#js_radio_user_id_type_search_user").prop("checked",!0),$("#js_user_id_type").show()})},attatch_event_handlers_to_story_tab:function(){var e=$("#scenario-container").find("[data-hp-target='stories-table']");e.on("change","[data-hp-role='check-all']",function(){e.find(":checkbox").prop("checked",$(this).prop("checked"))}),$("#js_submit_destroy_stories").on("click",function(e){if(e.preventDefault(),0==$("#scenario-container input[name='checked[story_ids][]']:checked").length){var t=I18n.t("js.common.please_select");return $("div#js_error_message").html('          <div class="row">            <div class="col-xs-12">              <div class="alert alert-danger alert-error alert-dismissible" role="alert">                <button type="button" class="close" data-dismiss="alert" aria-label="Close">                  <span aria-hidden="true">&times;</span>                </button>                <ul>                  <li style="word-wrap: break-word;">'+t+"</li>                </ul>              </div>            </div>          </div>"),$("body,html").animate({scrollTop:0},0),!1}var n=$(this).data().confirmMessage;if(confirm(n)){$("#form_checked_stories");return App.concerns.set_form_action("form_checked_stories",$(this).data("action"),$(this).data("remote")).submit(),!1}return!1})},set_column_span:function(e,t){$(document).on("click","#frm_visible_fields label",function(){var n=0;$.each(t,function(e,t){$("#frm_visible_fields label [value="+t+"]").prop("checked")&&(n+=1)}),$(e).attr("colspan",n),0==n?$(e).hide():$(e).show()})},copy_to_clipboard:function(e){$(e).on("click",function(){var e=this.dataset.value,t=$("<textarea></textarea>");t.text(e),$(this).append(t),t.select(),document.execCommand("copy"),t.remove()})},reset_scripts:function(){this.copy_to_clipboard("#invisible_number"),$(".tooltip.fade.in").remove(),$(".hp-tooltip").tooltip({container:"body",trigger:"hover"})},set_search_associate_modal_for_another_controller:function(a){App.concerns.datepicker(".search_datepicker"),App.concerns.change_display_number("form_xhr_campaigns_search"),App.concerns.change_order("form_xhr_campaigns_search"),$("#search_status_in").select2({width:"200"}),App.concerns.select_search_disable_user("search_user_ids_on_search_association_modal"),App.front_segments.set_segment_select2("#search_segment_id"),$("button.decision").on("click",function(){var t=$(this).data().hpEntityId,n=$(this),i=null;$("#another_controller_type").val()===CONST_ANOTHER_CONTROLLER_TYPE_INSIDE_SALES?$.ajax({url:"/xhr/segments/check_lead_stage",type:"post",dataType:"json",data:{campaign_ids:[t],another_controller_type:$("#another_controller_type").val(),another_object_id:$("#another_object_id").val()}}).done(function(e){e.lead_stage_down_flg?($("#dialog-confirm").html(e.message),$(function(){$("#dialog-confirm").dialog({modal:!0,width:"auto",buttons:[{text:I18n.t("js.dialog_confirm.yse_button"),click:function(){$(".modal-backdrop").last().css("z-index",1020),$(this).dialog("close"),App.front_campaigns.click_decision(a,t,n,i)}},{text:I18n.t("js.dialog_confirm.no_button"),click:function(){i=!0,$(".modal-backdrop").last().css("z-index",1020),$(this).dialog("close"),App.front_campaigns.click_decision(a,t,n,i)}}],close:function(){$(".modal-backdrop").last().css("z-index",1020)}}),$(".modal-backdrop").last().css("z-index",1499),$(".ui-dialog").css("z-index",1500)})):App.front_campaigns.click_decision(a,t,n,i)}):App.front_campaigns.click_decision(a,t,n,i)})},click_decision:function(t,e,n,i){$.ajax({url:"/xhr/campaigns_leads/create_from_another_controller/",type:"POST",dataType:"json",data:{campaign_ids:[e],another_controller_type:$("#another_controller_type").val(),another_object_id:$("#another_object_id").val(),end_sales_flg:i},context:n}).done(function(e){e.message&&alert(e.message),t(),n.closest(".modal").modal("hide")})}},jQuery(document).ready(function(){$(".destruction_selections").change(function(){$("input[type=checkbox].destroyable").prop("checked",$(this).prop("checked"))}),$(".add_keyword_text_field").click(function(){$("#classification_item_list").append($("#dummy_classification_item_list_form").html().replace(/NEW_ITEM_NUMBER/g,$.now())),keyword_adding_link_lister(),text_field_deleter()}),keyword_adding_link_lister(),text_field_deleter(),App.concerns.set_form_action_to_submit("#classification_submit_form",".checked_classification_submit_btn",!0)});var text_field_deleter=function(){$(".delete_keyword_text_field").click(function(){$(this).parent().parent().hide(),$(this).parent().children("input[name*=_destroy]").val("true"),keyword_adding_link_lister()})},keyword_adding_link_lister=function(){text_field_counter()<$("#classification_item_count_limit").data("limit")?$("#classification_item_keyword_adding_link").show():$("#classification_item_keyword_adding_link").hide()},text_field_counter=function(){return $("#classification_item_list input[name*=_destroy]").filter(function(){return"false"==$(this).val()}).length},text_field_lister=function(){$("#classification_item_list input[name*=_destroy]").filter(function(){return"true"==$(this).val()}).each(function(){$(this).parent().parent().hide()})};App.front_client_branches={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_leads",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("client_branches"),App.concerns.change_display_number("form_search_client_branches"),App.concerns.change_order("form_search_client_branches"),$("#form_search_xhr_organizations").submit(),$("#search_pref_ids").select2(),App.concerns.select_search_disable_user("search_user_ids"),$("#search_grant_flg").select2(),App.front_segments.set_segment_select2("#search_segment_ids"),$("#search_client_rank").select2(),$("#search_client_branch_lead_keyman").select2(),App.concerns.datepicker(".search_datepicker"),this.all_checked_items(),this.change_form("form_checked_client_branches"),App.concerns.set_item_id(),App.concerns.select_search("search_client_branch_lead_ids"),App.concerns.enable_csv_export_event("#form_search_client_branches","checked[client_branch_ids][]"),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#search_client_branch_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client-branch","/xhr/leads/search_as_association_modal","#search_client_branch_lead_ids","multiple",$("#unlink_clients_flg").val());var e=$("#client_index_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search_disable_user("search_items__"+t+"_item_user_ids")}),$(document).on("change.segment_id","#search_segment_ids",function(){var e=$("#form_search_client_branches");e.find("#search_client_rank").val(""),e.submit()}),App.concerns.change_search_type(),App.visible_fields.setup_list_visible_setting(["name"]),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting($(this).data("title"),$(this).data("close-text"),$(this).data("alert-text"))}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.get_modal_to_search_save("#form_search_client_branches"),App.concerns.get_modal_to_search_call("#form_search_client_branches"),App.searches.callForSearchCondition.init(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.focus_to_first_element(),App.tooltip.display_tooltip(),App.front_clients.handle_duplicate("index"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids"),App.concerns.set_tooltip_to_select_search_client("search_client_ids")},"new":function(){this.submit_new(),this.set_client_id(),App.concerns.select_search_name("client_branch_client_id"),App.concerns.search_zip_code(),App.concerns.select_search("client_branch_user_id"),App.concerns.select_search("client_branch_lead_ids"),App.concerns.set_tooltip_to_select_search_client("client_branch_client_id"),$("#open-associated-client-branch").on("click",function(){App.concerns.select_search_name("client_branch_client_id"),App.concerns.set_associate_entity_to_s2("#client_branch_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client-branch","/xhr/clients/search_modal","#client_branch_client_id","single","#client_branch_client_id"),localStorage.setItem("client_onclick","#client_branch_client_id")}),$("#open-associated-lead-client-branch").on("click",function(){App.concerns.select_search("client_branch_lead_ids"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#client_branch_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client-branch","/xhr/leads/search_as_association_modal","#client_branch_lead_ids","multiple","#client_branch_client_id",$("#unlink_clients_flg").val()),localStorage.setItem("client_onclick","#client_branch_lead_ids")});var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)})},create:function(){this.submit_new(),this.set_client_id(),App.concerns.search_zip_code(),App.concerns.select_search_name("client_branch_client_id"),App.concerns.select_search("client_branch_user_id"),App.concerns.select_search("client_branch_lead_ids"),App.concerns.set_tooltip_to_select_search_client("client_branch_client_id"),App.concerns.set_associate_entity_to_s2("#client_branch_client_id",".hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#client_branch_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-client-branch","/xhr/clients/search_modal","#client_branch_client_id","single","#client_branch_client_id"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client-branch","/xhr/leads/search_as_association_modal","#client_branch_lead_ids","multiple","#client_branch_client_id",$("#unlink_clients_flg").val());var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)})},edit:function(){this.submit_edit(),this.set_client_id(),App.concerns.select_search_name("client_branch_client_id"),App.concerns.search_zip_code(),App.concerns.select_search("client_branch_user_id"),App.concerns.select_search("client_branch_lead_ids"),App.concerns.set_tooltip_to_select_search_client("client_branch_client_id");var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)}),$("#open-associated-client-branch").on("click",function(){App.concerns.select_search_name("client_branch_client_id"),App.concerns.set_associate_entity_to_s2("#client_branch_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client-branch","/xhr/clients/search_modal","#client_branch_client_id","single","#client_branch_client_id"),localStorage.setItem("client_onclick","#client_branch_client_id")}),$("#open-associated-lead-client-branch").on("click",function(){App.concerns.select_search("client_branch_lead_ids"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#client_branch_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client-branch","/xhr/leads/search_as_association_modal","#client_branch_lead_ids","multiple","#client_branch_client_id",$("#unlink_clients_flg").val()),localStorage.setItem("client_onclick","#client_branch_lead_ids")})},update:function(){this.submit_edit(),this.set_client_id(),App.concerns.select_search_name("client_branch_client_id"),App.concerns.search_zip_code(),App.concerns.select_search("client_branch_user_id"),App.concerns.select_search("client_branch_lead_ids"),App.concerns.set_tooltip_to_select_search_client("client_branch_client_id"),App.concerns.set_associate_entity_to_s2("#client_branch_client_id",".hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#client_branch_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-client-branch","/xhr/clients/search_modal","#client_branch_client_id","single","#client_branch_client_id"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client-branch","/xhr/leads/search_as_association_modal","#client_branch_lead_ids","multiple","#client_branch_client_id",$("#unlink_clients_flg").val());var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)})},show:function(){function e(){function e(e){$(e+" #only_active_lead, "+e+" #show_uncontacted_officers_flg, "+e+" #lead_role_id").on("change",function(){$("#only_active_lead").prop("disabled",!0),$("#show_uncontacted_officers_flg").prop("disabled",!0),lead_status=$("#only_active_lead").is(":checked")?1:null,$("#search_lead_status").val(lead_status),show_uncontacted_officers_flg=$("#show_uncontacted_officers_flg").is(":checked")?1:null,$("#show_uncontacted_officers_flg_as_search_condition").val(show_uncontacted_officers_flg),lead_role_id=$("#lead_role_id").val(),$("#search_lead_role_id").val(lead_role_id),$("#form_search_xhr_organizations").submit()}),$(document).ajaxStop(function(){$("#only_active_lead").prop("disabled",!1),$("#show_uncontacted_officers_flg").prop("disabled",!1)})}$('[name="organization_tab"]').on("change",function(){var e=$(this).val();$(".organization_menu_content").hide().eq(e).show()}),""==$.trim($("#organizations_tree").html())&&$("#organizations_tree").html('<div class="text-center" id="spinner" ><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#form_search_xhr_organizations").submit(),$("#search_xhr_organizations_submit").on("click",function(){return $("#show_uncontacted_officers_flg").prop("checked",!1),$("#show_uncontacted_officers_flg_as_search_condition").val(""),lead_status=$("#only_active_lead").is(":checked")?1:null,$("#search_lead_status").val(lead_status),$("#form_search_xhr_organizations").submit(),!1}),App.concerns.tree_control_enable(".org-tree-control-grid"),e(".org-tree-control-grid")}function a(){$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"})}function t(){function n(){$.ajax({url:"/xhr/client_branches/client_branches/"+s+"/client_branches_leads/load_lead",type:"GET"}).done(function(e){$("#lead_list_items .hp-tooltip").mouseout(),$("#keyman_role").replaceWith(e.client_branches_leads_role_html),t(),i(),a()})}function t(){$.ajax({url:"/xhr/client_branches/client_branches/"+s+"/client_branches_leads_update_histories/load_history",type:"GET"}).done(function(e){$("#client_branches_leads_update_history").replaceWith(e.html)})}function i(){$(".sortable").sortable({cursor:"move",opacity:.7,update:function(){var e=$(this).data("url");$.ajax({url:e,type:"PUT",dataType:"json",data:$(this).sortable("serialize")}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():n()})}}),$(".sortable").disableSelection()}i(),$(document).on("click",'.role-change[data-hp-role="change_lead_role"][data-hp-target="lead"]',function(e){e.preventDefault();var t=$(this).data("url");$.ajax({url:t,type:"PUT",dataType:"json"}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():n()})}),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids2",'input[name="associate_leads[]"]',"leads"),$(document).on("click","#lead-add-modal",function(){$("#lead-add-modal").attr({"data-create-flg":"true"}),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids2","multiple","#lead_add_modal_client_id",$("#unlink_clients_flg").val(),null,"#lead_add_modal_client_branch_id"),$("#open-associated-lead").trigger("click")}),$(document).on("change","#lead_ids2",function(){var e=$(this).val().split(",");$.ajax({url:"/xhr/client_branches/client_branches/"+s+"/client_branches_leads",type:"POST",dataType:"json",data:{lead_ids:e}}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():(e.messages&&App.concerns.display_notice_message(e.messages,!1,!0),n())})}),$(document).on("click",'.lead-delete[data-hp-role="destroy_client_branch_lead"][data-hp-target="lead"]',function(){var e=$(this).data("url");$.ajax({url:e,type:"DELETE",dataType:"json"}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():n()})})}var s=$("#client_branch_detail").data("client-branch-id");App.concerns.search_index_default("form_search_index"),this.set_relations_table(),e(),a(),t(),App.concerns.toggle_print_target()},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("form#new_client_branch").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$("form.edit_client_branch").submit()})},all_checked_items:function(){$(document).on("click","#all-check, .check-items",function(){$(this).is("#all-check")&&($(this).is(":checked")?$(".check-items").prop("checked",!0):$(".check-items").prop("checked",!1))})},change_form:function(n){$(".checked_submit").on("click",function(){var e=$(this);if(confirm(e.data("message"))){var t=$("#"+n);t.attr("action",e.data("action")),t.submit()}})},set_client_id:function(){$("#client_branch_lead_ids").data("clientId",$("#client_branch_client_id").val()),$("#client_branch_client_id").on("change",function(){$("#client_branch_lead_ids").data("clientId",$(this).val())})},init_form_from_another_controller:function(){App.concerns.select_search_name("client_branch_modal_client_id"),App.concerns.select_search("client_branch_lead_ids"),App.concerns.search_zip_code(),this.set_client_id(),App.concerns.select_search("client_branch_modal_user_id"),App.concerns.set_tooltip_to_select_search_client("client_branch_modal_client_id");var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)}),$("#open-associated-client-branch").on("click",function(){App.concerns.select_search_name("client_branch_modal_client_id"),App.concerns.set_associate_entity_to_s2("#client_branch_modal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client-branch","/xhr/clients/search_modal","#client_branch_modal_client_id","single","#client_branch_modal_client_id"),localStorage.setItem("client_onclick","#client_branch_modal_client_id")}),$(".open_lead_modal").on("click",function(){"deals"==$("#controller_name").val()&&(App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_tab_modal(".open_lead_modal","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id","show",$("#unlink_clients_flg").val())),"daily_reports"==$("#controller_name").val()&&(App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_tab_modal(".open_lead_modal","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#daily_report_client_id","show",$("#unlink_clients_flg").val()))}),$("#open-associated-lead-client-branch").on("click",function(){App.concerns.select_search_name("client_branch_modal_client_id"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#client_branch_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client-branch","/xhr/leads/search_as_association_modal","#client_branch_lead_ids","multiple","#client_branch_modal_client_id",$("#unlink_clients_flg").val()),localStorage.setItem("client_onclick","#client_branch_modal_client_id")}),"daily_reports"==$("#controller_name").val()&&App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#deal_ids","multiple","#daily_report_client_id",$("#unlink_clients_flg").val())},set_relations_table:function(){["daily_reports","deals"].forEach(function(n){if(1==$("#client_branch_relations_table_"+n).length){$("#"+n+"_loading").prepend($("<div></div>",{id:"contents-loading-lead-relations-"+n,"class":"contents-loading-lead-relations"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-x loading-lead-relations"})));var e="/xhr/client_branches/"+$("#client_branch_id").val()+"/get_relations/";$.ajax({url:e,dataType:"html",data:{dataType:"html",id:$("#client_branch_id").val(),model:n}}).done(function(e){var t=$("#client_branch_relations_table_"+n);t.html(e),t.find(".hp-tooltip").tooltip({container:"body",trigger:"hover"}),$("#contents-loading-lead-relations-"+n).remove()})}})}},App.front_client_branches_customs={create:function(){CustomCombo.init()},"new":function(){CustomCombo.init()},update:function(){CustomCombo.init()},edit:function(){CustomCombo.init()}},App.front_client_customs={create:function(){CustomCombo.init()},"new":function(){CustomCombo.init()},update:function(){CustomCombo.init()},edit:function(){CustomCombo.init()}},App.front_client_mail_histories={index:function(){function e(e,t){$("#csv_dl_submit").on("click",function(){return App.concerns.set_export_ids(e,t),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_export_type").val(1),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),!1}),$("#csv_dl_url_datails_submit").on("click",function(){return App.concerns.set_export_ids(e,t),$("#csv_export_type").val(2),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),!1}),$("#csv_all_dl_url_datails_submit").on("click",function(){return $("#csv_export_type").val(3),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),!1})}App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_client_mail_histories",".js-disable-btn"),App.concerns.change_display_number("form_search_client_mail_histories"),App.concerns.change_order("form_search_client_mail_histories"),$(document).on("click",".js_resend_btn",function(){$("#open_modal_mail_queue_id").val($(this).data("id"))}),this.change_form("js_form_change_action_mail_histories"),this.datetimepicker(),this.set_select2("#search_mail_category_ids","100%"),this.set_select2("#search_file_path","100%"),App.concerns.select_search_disable_user("search_create_user_ids"),App.concerns.select_search_disable_user("search_update_user_ids"),App.concerns.change_search_type(),App.visible_fields.setup_list_visible_setting(["email_of_sender","title"]),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.all_checked_items(),e("#form_search_client_mail_histories","checked[mail_queue_ids][]"),App.concerns.focus_to_first_element(),CKEDITOR.on("instanceReady",function(e){e.editor.on("blur",function(){App.front_mails.autoDraftSave()})}),App.tooltip.display_tooltip()},show:function(){$(".js-slide-search-field").on("click",function(){$(this).hasClass("in")?$(this).removeClass("in"):$(this).addClass("in")}),App.concerns.change_order("mail_form_search_mail_queue_summaries","mail_queue_sammaries_table"),$("#clients_display_number").on("change",function(){$("#form_change_display_number").submit()}),$("#csv_dl_submit, #csv_all_dl_submit").on("click",function(){return"csv_all_dl_submit"===$(this).attr("id")&&$("#csv_all_dl_flg").val(1),action=$("#form_search_client_mail_histories").attr("action"),$("#form_search_client_mail_histories").attr("action",action+".csv"),$("#form_search_client_mail_histories").submit(),$("#form_search_client_mail_histories").attr("action",action),!1}),App.concerns.mail_editor_read_only_mode_init("mail_body"),$(document).on("click",".js_resend_btn",function(){$("#open_modal_mail_queue_id").val($(this).data("id"))}),this.change_form("js_form_change_action_mail_histories"),App.concerns.change_mail_history_tab_type(),App.concerns.create_mail_history_charts($("#main_mail_queue_id").val()),this.loadingDestinationsList("#target_table","#mail_histories_destinations_result"),this.fetchDestinationsList(),App.concerns.change_order_for_target_tab("#mail_histories_form_change_display_number_for_target_tab",".client_mail_histories_client_order_head"),App.visible_fields.change_horizontal_scroll=function(n){$("#visible_fields_setting_dialog input[type=checkbox]:checked").each(function(){var e=$(".js_visibility_"+$(this).val()),t=e.data("min-width");n.prop("checked")?e.css("min-width",t+"px"):e.css("min-width","")})},App.visible_fields.setup_list_visible_setting(),this.clearDestinationsSearchForm("#mail_histories_form_filter_for_target_tab"),$('a[name="target-tab-link"]').on("shown.bs.tab",function(e){$("#target_active_tab_type").val($(e.target).data("type"))}),$(document).on("click",".user-button",function(){$(this).css("pointer-events","none")}),$(document).on("hidden.bs.modal",".modal",function(){$(".user-button").css("pointer-events","")}),CKEDITOR.on("instanceReady",function(e){e.editor.on("blur",function(){App.front_mails.autoDraftSave()})})
,$(document).on("click",function(){$(".sent-pie-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".opened-pie-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".url-clicked-pie-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".sent-error-bar-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".unsubscribe-bar-chart").each(function(e,t){$(t).highcharts().reflow()})}),App.concerns.open_mailer(),App.concerns.set_mail_lead_link()},mail_editor_read_only_mode_init:function(e,t,n){CKEDITOR.replace(e,{toolbar:[{name:"document",groups:["mode"],items:["Source"]}],enterMode:CKEDITOR.ENTER_BR,readOnly:!0,removePlugins:"elementspath",height:350,language:I18n.locale}),this.show_editor_tab_for_mail_queue_type(t,n)},show_editor_tab_for_mail_queue_type:function(e,t){var n=$("#text-body-tab-"+e),i=$("#html-body-tab-"+e);n.show(),i.show();var a=t||"3";"1"===a?(n.tab("show"),i.hide()):"2"===a?(i.tab("show"),n.hide()):"3"===a&&i.tab("show")},change_form:function(n){$(document).on("click",".checked_submit",function(e){e.preventDefault();var t=$("#"+n);$(t).attr("action",$(this).data("action")),$(this).data("remote")?$(t).attr("data-remote","true"):($(t).removeAttr("data-remote"),$(t).removeData("remote")),$(this).data("method")&&$("#js_set_method").val($(this).data("method")),$(t).submit()})},datetimepicker:function(){$(".datetimepicker").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5})},set_select2:function(e,t,n){$(e).select2({width:t,placeholder:n})},clearDestinationsSearchForm:function(e){$(e+" .clear-btn").click(function(){$("form"+e+" :input").each(function(){"checkbox"===$(this).attr("type")?$(this).prop("checked",!1):"radio"===$(this).attr("type")||"submit"===$(this).attr("type")||$(this).val("")})})},fetchDestinationsList:function(){$("#mail_histories_form_change_display_number_for_target_tab").submit()},loadingDestinationsList:function(e,t){$(e).on({"ajax:beforeSend":function(){$(t).html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:error":function(){$(t).html($('<div class="loadError"><span>'+I18n.t("js.application.load_error")+"</span></div>"))}})},fixCurrentPageLink:function(e){$(e+" .pagination li.active a").click(function(){if("#"==$(this).attr("href"))return!1})}};var CUSTOMER_SHEET_BASIC_INFO_TAB=1,CUSTOMER_SHEET_CLIENT_HISTORY_TAB=2;App.front_clients={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_clients",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("clients"),App.concerns.change_display_number("form_search_clients"),App.concerns.change_order("form_search_clients"),$("#form_search_xhr_organizations").submit(),$("#search_pref_ids").select2(),App.concerns.select_search_disable_user("search_user_ids"),$("#search_grant_flg").select2(),$("#search_business_category_kbn").select2(),$("#search_worker_number_kbn").select2(),$("#search_capital_kbn").select2(),$("#search_ipo_kbn").select2(),$("#search_industry_kbn").select2(),$("#search_middle_business_categories").select2(),$("#search_small_business_categories").select2(),App.front_segments.set_segment_select2("#search_segment_ids"),$("#search_client_rank").select2(),$("#search_not_form_flg").select2(),$("#search_not_mail_flg").select2(),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids"),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),App.concerns.datepicker(".search_datepicker"),this.all_checked_items(),this.change_form("form_checked_clients"),App.concerns.set_item_id(),App.concerns.enable_csv_export_event("#form_search_clients","checked[client_ids][]"),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker");var e=$("#client_index_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search_disable_user("search_items__"+t+"_item_user_ids")}),$(document).on("change.segment_id","#search_segment_ids",function(){var e=$("#form_search_clients");e.find("#search_client_rank").val(""),e.submit()}),App.concerns.change_search_type(),App.visible_fields.setup_list_visible_setting(["name"]),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting($(this).data("title"),$(this).data("close-text"),$(this).data("alert-text"))}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.get_modal_to_search_save("#form_search_clients"),App.concerns.get_modal_to_search_call("#form_search_clients"),App.searches.callForSearchCondition.init(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.focus_to_first_element(),App.tooltip.display_tooltip(),App.concerns.merge_resources("#form_merge_client_list","client"),App.front_clients.handle_duplicate("index"),$(document).on("hidden.bs.modal",".modal",function(){App.concerns.unfix_background()});var t="clients";App.front_recommend.recommendScenarios(t)},show:function(){""==$.trim($("#organizations_tree").html())&&$("#organizations_tree").html('<div class="text-center" id="spinner" ><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#form_search_xhr_organizations").submit(),$("#search_xhr_organizations_submit").on("click",function(){return $("#show_uncontacted_officers_flg").prop("checked",!1),$("#show_uncontacted_officers_flg_as_search_condition").val(""),lead_status=$("#only_active_lead").is(":checked")?1:null,$("#search_lead_status").val(lead_status),show_having_business_card_flg=!!$("#show_having_business_card_flg").is(":checked"),$("#search_show_having_business_card_flg").val(show_having_business_card_flg),$("#form_search_xhr_organizations").submit(),!1}),App.concerns.search_index_default("form_search_index"),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.tree_control_enable(".org-tree-control-grid"),this.tree_filterable(".org-tree-control-grid");var e=$("#old_client_ids").val();e&&(e=e.split(" ")),$.each(e,function(e,t){""==$.trim($("#old_organization_tree_old_org").html())&&$("#old_organization_tree_"+t).html('<div id="spinner"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#form_search_xhr_organizations_"+t).submit(),App.concerns.tree_control_show_more("#old_organization_tree_"+t)}),App.concerns.old_tree_control_enable(e),App.front_organizations.old_tree_filterable(e),App.front_clients.search_old_org_submit(e),$(document).on("click","#get-list-all",function(){$(this).prop("disabled",!0);var e=$("#search_client_ids").val();$.ajax({url:"/xhr/clients/segment_client_list_all",type:"GET",dataType:"script",data:{client_id:e}})}),$(window).load(function(){"#cs_client_history"==location.hash&&(cs_link=$(".btn.js_customer_sheets_show")[0],CustomerSheets.modal_open($(cs_link).data("href"),$(cs_link).data("client-id"),CUSTOMER_SHEET_CLIENT_HISTORY_TAB))}),$(document).on("click","#client_old_org_export_button",function(){lead_status=$("#only_active_lead_old_org").is(":checked")?1:null,$("#only_active_lead_flg_as_export_condition").val(lead_status),show_having_business_card_flg=!!$("#show_having_business_card_flg_old_org").is(":checked"),$("#show_having_business_card_flg_as_export_condition_old_org").val(show_having_business_card_flg),show_uncontacted_officers_flg=$("#show_uncontacted_officers_flg_old_org").is(":checked")?1:null,$("#show_uncontacted_officers_flg_as_export_condition_old_org").val(show_uncontacted_officers_flg),$("#business_card_family_name_as_export_condition_old_org").val($("#business_card_family_name_old_org").val()),$("#business_card_first_name_as_export_condition_old_org").val($("#business_card_first_name_old_org").val())}),App.concerns.toggle_print_target()},"new":function(){this.submit_new(),this.get_name_disp(),this.call_middle_business_category_modal_side_button(),App.concerns.select_search("client_middle_business_categories"),App.concerns.search_zip_code(),App.concerns.select_search("client_user_id"),App.concerns.select_search("client_business_category_name");var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)});var t=$("#client_information_disable_flg").val();"true"===t&&($("#s2id_client_middle_business_categories ul").css({cursor:"not-allowed","background-color":"#EEEEEE"}),$("#client_middle_business_categories").prop("disabled",t))},create:function(){this.submit_new(),this.get_name_disp(),App.concerns.select_search("client_middle_business_categories"),App.concerns.search_zip_code(),App.concerns.select_search("client_user_id"),App.concerns.select_search("client_business_category_name");var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)});var t=$("#client_information_disable_flg").val();"true"===t&&($("#s2id_client_middle_business_categories ul").css({cursor:"not-allowed","background-color":"#EEEEEE"}),$("#client_middle_business_categories").prop("disabled",t))},edit:function(){this.submit_edit(),this.get_name_disp(),this.call_middle_business_category_modal_side_button(),App.concerns.select_search("client_middle_business_categories"),App.concerns.search_zip_code(),App.concerns.select_search("client_user_id"),App.concerns.select_search("client_business_category_name"),App.concerns.hide_item_file_options();var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)});var t=$("#client_information_disable_flg").val();"true"===t&&($("#s2id_client_middle_business_categories ul").css({cursor:"not-allowed","background-color":"#EEEEEE"}),$("#client_middle_business_categories").prop("disabled",t))},update:function(){this.submit_edit(),this.get_name_disp(),App.concerns.select_search("client_middle_business_categories"),App.concerns.search_zip_code(),App.concerns.select_search("client_user_id"),App.concerns.select_search("client_business_category_name"),App.concerns.hide_item_file_options();var e=$("#client_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)})},duplicate:function(){App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_order_for_duplicate("duplicate_search_clients"),$("#"+$("#result_search_selected_id").val()).css("background-color","#e0e0e0"),App.visible_fields.setup_list_visible_setting(["name"]);new Clipboard(".clipboard-btn");$(document).on("hidden.bs.modal",".modal",function(){App.concerns.unfix_background()}),App.front_clients.handle_duplicate("duplicate"),App.front_clients.handle_duplicate_automation(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("form#new_client").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$("form.edit_client").submit()})},get_name_disp:function(){$("#client_name").on("blur",function(){var e=$("#client_name").val().trim();if(""==e)return $("#client_name_disp").val(""),!1;$("#client_name").val()!=$("#client_name").data("default-value")&&$.ajax({type:"get",url:"/xhr/clients/name_disp_normalization",dataType:"json",data:{name:e}}).done(function(e){$("#client_name_disp").val(e.name)})})},change_form:function(n){$(".checked_submit").on("click",function(){var e=$(this);if(confirm(e.data("message"))){var t=$("#"+n);t.attr("action",e.data("action")),t.submit()}})},tree_filterable:function(e){$(e+" #only_active_lead, "+e+" #show_having_business_card_flg, "+e+" #show_uncontacted_officers_flg").on("click",function(){$("#only_active_lead").prop("disabled",!0),$("#show_having_business_card_flg").prop("disabled",!0),$("#show_uncontacted_officers_flg").prop("disabled",!0),lead_status=$("#only_active_lead").is(":checked")?1:null,$("#search_lead_status").val(lead_status),show_having_business_card_flg=!!$("#show_having_business_card_flg").is(":checked"),$("#search_show_having_business_card_flg").val(show_having_business_card_flg),show_uncontacted_officers_flg=$("#show_uncontacted_officers_flg").is(":checked")?1:null,$("#show_uncontacted_officers_flg_as_search_condition").val(show_uncontacted_officers_flg),$("#form_search_xhr_organizations").submit()}),$(document).ajaxStop(function(){$("#only_active_lead").prop("disabled",!1),$("#show_having_business_card_flg").prop("disabled",!1),$("#show_uncontacted_officers_flg").prop("disabled",!1)})},submit_middle_business_category_modal:function(){var e="#modalSearchMiddleBusinessCategory",t=App.concerns.init_side_by_side_select_fields(e),n=$("#middle_business_category_form").find("[data-hp-role='submit']"),i=$("#"+n.data("formTarget")),a=$.map(t.getSelectedValue(),function(e){return e.id});i.val(a).trigger("change")},submit_small_business_category_modal:function(){var e=[];$target=$("#business_category").val();var t=$("#alert_flg").val();$("#js_selected_business option").length>t?$("#max_select_alert").show():($("#js_selected_business option").each(function(){e.push($(this).val())}),$("#"+$target).val(e).trigger("change"),$("#modalSearchSmallBusinessCategory").modal("hide"))},close_middle_business_category_modal:function(){$("#business_category_name").val(""),$("#business_category_kbn").val("")},close_small_business_category_modal:function(){$(".client_business_category_name").val(""),$("#js_selected_business").find("option").remove(),$("#js_vertical").removeClass("js_vertical_move_button_block")},business_category_box_change:function(e,t){var n="";0!=$("#js_selected_business option").length&&($("#js_selected_business option").each(function(){n=""!=n?n:App.front_clients.is_shown_scroll(e,t,$(this).text().length)}),""!=n&&$("#selected_category_inner").css({overflow:"auto",border:"1px solid #DEDEDE","border-radius":"4px"}),n=""),0!=$("#js_searched_business option").length?($("#js_searched_business option").each(function(){n=""!=n?n:App.front_clients.is_shown_scroll(e,t,$(this).text().length)}),""!=n&&($("#js_searched_business").css({direction:"rtl"}),$("#js_searched_business").children().css({direction:"ltr"}),$("#js_selected_business").css({direction:"rtl"}),$("#js_selected_business").children().css({direction:"ltr"})),n=""):App.front_clients.searched_business_box_default()},is_shown_scroll:function(e,t,n){if("ja"==t){if(58<n||"client_middle_business_categories"==e&&53<n)return n}else if(90<n||"client_middle_business_categories"==e&&80<n)return n;return""},business_category_box_default:function(){},searched_business_box_default:function(){},call_middle_business_category_modal_side_button:function(){var e="#modalSearchMiddleBusinessCategory";App.concerns.init_side_by_side_select_fields(e).callSideBySideButton()},init_middle_business_category:function(e,t){void 0===t&&(t=!1);var n="#modalSearchMiddleBusinessCategory",i=$("#"+e),a=App.concerns.init_side_by_side_select_fields(n),s=$("#middle_business_category_form"),o=s.find("#middle_business_category_form_context"),r=s.find("[data-hp-role='business_category_kbn']"),l=s.find("[data-hp-role='submit']"),c="searchResult",d=r.data("textResult"),u=a.$context.find("[data-hp-role='right_btn']"),_=$(n).find(".sortable-button-group");t?_.removeClass("invisible"):_.addClass("invisible"),a.setSelectedValue(i.select2("data")),s.submit(),l.data("formTarget",e);var h=$(document).find(".modal-open");$(n).one("shown.bs.modal",function(){$(".modal-backdrop").last().css("z-index",1499),$(n).find("[data-hp-role='un_selected']").scrollTop(0),$(n).find("[data-hp-role='selected']").scrollTop(0)}),$(n).one("hidden.bs.modal",function(){h[0]&&h.addClass("modal-open"),App.front_clients.close_middle_business_category_modal(),$(".modal-backdrop").last().css("z-index",1031)}),l.on("click",function(){o.val(""),0==r.find("[value='"+c+"']").size()&&r.prepend($("<option>",{text:d,value:c})),r.val(c)}),u.off("click"),u.on("click",function(){a.$selectedField.find("option:selected").remove(),s.submit()}),r.change(function(){if($(this).val()==c)return l.trigger("click"),!1;o.val("business_category_kbn"),r.find("[value='"+c+"']").remove(),s.submit()}),s.on("ajax:success",function(e,t){a.setUnSelectedValue(t.results)}),$(e).select2()},init_small_business_category:function(n,i){App.concerns.select_search("client_business_category_name");var e="#modalSearchSmallBusinessCategory",t=$("#"+n).select2("data"),o=$("#small_business_category_form"),r=o.find("#business_category_keyword");r.val("");var l="",c=[];$("#s2id_client_business_category_name a:first-child span:first-child").text("");var a=o.find("#middle_business_category_form_context"),s=o.find("[data-hp-role='large_business_category_kbn']"),d=o.find("[data-hp-role='middle_business_category_kbn']"),u=o.find("[data-hp-role='small_business_category_kbn']"),_="searchResult",h=(o.find("[data-hp-role='submit']"),$(document).find(".modal-open"));t.forEach(function(e){$("#js_selected_business").append("<option value="+e.id+">"+e.text+"</option>")}),$(e).one("shown.bs.modal",function(){$(".modal-backdrop").last().css("z-index",1499),$("#max_select_alert").hide(),$("#js_selected_business").hide(),$("#load").show()}),"client_middle_business_categories"!=n?($(".js_vertical_move_button_block").hide(),$("#js_vertical").hide(),$("#selected_category").removeClass("col-xs-11"),$("#selected_category").addClass("col-xs-12")):($(".js_vertical_move_button_block").show(),$("#js_vertical").show(),$("#selected_category").removeClass("col-xs-12"),$("#selected_category").addClass("col-xs-11")),a.val("large_business_category"),o.submit(),$("#business_category").val(n),$(e).one("hidden.bs.modal",function(){h[0]&&h.addClass("modal-open"),$(".large_business_category_kbn").val(""),$(".middle_business_category_kbn").val(""),$(".middle_business_category_kbn option:not(:first)").remove(),$(".small_business_category_kbn").val(""),$(".small_business_category_kbn option:not(:first)").remove(),App.front_clients.close_small_business_category_modal(),$(".modal-backdrop").last().css("z-index",1031),App.front_clients.business_category_box_default()}),s.change(function(){$(".middle_business_category_kbn").val(""),$(".small_business_category_kbn").val(""),a.val("large_business_category"),s.find("[value='"+_+"']").remove(),o.submit()}),d.change(function(){$(".small_business_category_kbn").val(""),a.val("middle_business_category"),d.find("[value='"+_+"']").remove(),o.submit()}),u.change(function(){a.val("small_business_category"),u.find("[value='"+_+"']").remove(),o.submit()}),$('.select2-input[role="combobox"]').on("change keydown paste input",function(e){"Enter"!==e.key&&"Tab"!==e.key&&(c=(c=Array.from(document.querySelectorAll(".select2-input")).map(function(e){return e.value}))[c.length-1])});var p=$("#s2id_client_business_category_name");new MutationObserver(function(e){l=$("#s2id_client_business_category_name a span:first-child").text();var t=new TextEncoder,n=new TextDecoder("Shift_JIS"),i=t.encode(l),a=n.decode(i),s=I18n.t("js.clients.keyword_default_message");(l==s?l:a)==s&&($("#s2id_client_business_category_name a span:first-child").text(c),l=c),r.val(l),""!=l?$("#s2id_client_business_category_name").addClass("select2-allowclear"):($("#s2id_client_business_category_name").removeClass("select2-allowclear"),o.submit()),lastMutation=e[e.length-1],"undefined"!=typeof lastMutation.addedNodes[0]&&o.submit()}).observe(p[0],{childList:!0,subtree:!0}),o.off("ajax:success"),o.on("ajax:success",function(e,t){$("#load").hide(),$("#js_selected_business").show(),"undefined"!=typeof t.middle_kbn&&$(".middle_business_category_kbn option:not(:selected,:first)").remove(),"undefined"!=typeof t.small&&$(".small_business_category_kbn option:not(:selected,:first)").remove(),"undefined"==typeof t.middle_kbn&&"undefined"==typeof t.small||($.each(t.middle_kbn,function(e,t){0==$("#middle_business_category_kbn").find("[value='"+t.id+"']").size()&&$(".middle_business_category_kbn").append("<option value="+t.id+">"+t.text+"</option>")}),$.each(t.small,function(e,t){0==$("#small_business_category_kbn").find("[value='"+t.id+"']").size()&&$(".small_business_category_kbn").append("<option value="+t.id+">"+t.text+"</option>")})),$("#js_searched_business option").remove(),jQuery.each(t.un_selected,function(e,t){0==$("#js_selected_business").find("[value='"+t+"']").size()&&$("#js_searched_business").append("<option value="+t+">"+e+"</option>")}),a.val(""),App.front_clients.business_category_box_change(n,i)}),$(".js_lateral_move_button_block span button").on("click",function(){if($(this).hasClass("move_to_right"))(e=$("#js_selected_business option:selected"))[0]&&(e.each(function(){$("#js_searched_business").append($(this).clone()),$(this).remove()}),0==$("#js_selected_business option").length?App.front_clients.business_category_box_default():App.front_clients.business_category_box_change(n,i));else if($(this).hasClass("move_to_left")){var e;(e=$("#js_searched_business option:selected"))[0]&&(e.each(function(){$("#js_selected_business").append($(this).clone()),$(this).remove()}),0==$("#js_searched_business option").length&&App.front_clients.searched_business_box_default(),App.front_clients.business_category_box_change(n,i))}}),$(".js_vertical_move_button_block button").on("click",function(){$(this).parent();var e=$("#js_selected_business option:selected");if(1<e.size())return alert(I18n.t("js.common.unchanged_items")),!1;e[0]&&($(this).hasClass("move_to_up")?e.prev().before(e):$(this).hasClass("move_to_down")?e.next().after(e):$(this).hasClass("move_to_top")?$("#js_selected_business").prepend(e):$(this).hasClass("move_to_bottom")&&$("#js_selected_business").append(e))}),$(".searched_business_check_all").on("click",function(){$("#js_searched_business").find("option").prop("selected","selected")}),$(".selected_business_check_all").on("click",function(){$("#js_selected_business").find("option").prop("selected","selected")}),$(".clear-button").on("click",function(){$(".large_business_category_kbn").val(""),$(".middle_business_category_kbn").val(""),$(".small_business_category_kbn").val(""),o.find("#business_category_keyword").val(""),$("#s2id_client_business_category_name a:first-child span:first-child").text("")})},all_checked_items:function(){$(document).on("click","#all-check, .check-items",function(){$(this).is("#all-check")&&($(this).is(":checked")?$(".check-items").prop("checked",!0):$(".check-items").prop("checked",!1));var e=$(".form-checked-resources .check-items:checked").length;$("#alternative_attr_button_merge_clients").prop("disabled",e<2)})},handle_duplicate:function(e){$(document).on("click",".js-merge-clients",function(){$(this).data("display-confirm-popup")?"index"==e?App.front_clients.index_auto_merge_leads_before_merge_clients():"duplicate"==e&&App.front_clients.auto_merge_leads_before_merge_clients():($(".client-merge-lead-dup").css("transform","translateY(-30px)"),$(".client-merge-lead-dup").fadeOut(150),setTimeout(function(){$(".in-alternative").fadeIn(150),$(".in-alternative").css("transform","translateY(30px)")},170),$(".js-confirm-merge-lead-cancel").focus())}),$(document).on("click",".js-confirm-merge-lead-exec",function(){$(".in-alternative").css("transform","translateY(0px)"),$(".in-alternative").fadeOut(150),setTimeout(function(){$(".client-merge-lead-dup").fadeIn(150),$(".client-merge-lead-dup").css("transform","translateY(0px)")},170),"index"==e?App.front_clients.index_auto_merge_leads_before_merge_clients():"duplicate"==e&&App.front_clients.auto_merge_leads_before_merge_clients(),$(this).attr("disabled",!0),$(".js-confirm-merge-lead-cancel").attr("disabled",!0)}),$(document).on("click",".cancel-client-merge",function(){return confirm(I18n.t("js.clients.cancel_merge"))&&$("#alternative-attr-modal").modal("hide"),!1}),$(document).on("click",".client-merge-exec",function(){$(".in-alternative").fadeIn(150),$(".in-alternative").css("transform","translateY(30px)"),$(".js-merge-client-cancel").focus(),$("#backdrop-clients").css("display","block")}),$(document).on("click",".js-merge-client-cancel",function(){return $(".in-alternative").css("transform","translateY(0px)"),$(".in-alternative").fadeOut(150),$("#backdrop-clients").css("display","none"),!1}),$(document).on("click",".js-merge-client-exec",function(){App.front_clients.submit_form_merge_clients(),$(this).attr("disabled",!0),$(".js-merge-client-cancel").attr("disabled",!0)}),$(document).on("click",".js-confirm-merge-lead-cancel",function(){return $("#checkbox-confirm-merge-leads-modal").prop("checked")&&$("#checkbox-confirm-merge-leads-modal").prop("checked",!1),$(".in-alternative").css("transform","translateY(0px)"),$(".in-alternative").fadeOut(150),setTimeout(function(){$(".client-merge-lead-dup").fadeIn(150),$(".client-merge-lead-dup").css("transform","translateY(0px)")},170),!1}),$(document).on("shown.bs.modal","#alternative-attr-modal",function(){$(".js-automatically-merge-client-cancel").focus(),$("#checkbox-merge-clients-modal").on("click",function(){$("#checkbox_auto_merge").val($(this).prop("checked"))}),$("#checkbox-confirm-merge-leads-modal").on("click",function(){$("#form_automatically_merge_clients #checkbox_auto_merge_lead").val($(this).prop("checked"))})})},handle_duplicate_automation:function(){$(document).on("click",".js_automatically_merge_button",function(){return $(".btn-group.hidden-xs.open").removeClass("open"),$(this).data("display-confirm-popup")?App.front_clients.submit_form_automatically_merge_clients():($("#type_merge").val(!0),App.front_clients.submit_form_automatically_merge_clients(),$("#type_merge").val(!1)),!1}),$(document).on("click",".js-automatically-merge-client-exec",function(){App.front_clients.submit_form_automatically_merge_clients(),$(this).attr("disabled",!0),$(".js-automatically-merge-client-cancel").attr("disabled",!0),$("#checkbox-merge-clients-modal").attr("disabled",!0).css("cursor","default"),$("#checkbox-merge-clients-modal").parent().css("cursor","default")}),$(document).on("click",".js-auto-merge-clients",function(){$(this).data("display-confirm-popup")?App.front_clients.submit_form_auto_merge_lead_in_merge_client():($(".client-merge-lead-dup").css("transform","translateY(-30px)"),$(".client-merge-lead-dup").fadeOut(150),setTimeout(function(){$(".in-alternative").fadeIn(150),$(".in-alternative").css("transform","translateY(30px)")},170),$(".js-confirm-merge-lead-cancel").focus())}),$(document).on("click",".js-confirm-auto-merge-lead-exec",function(){App.front_clients.submit_form_auto_merge_lead_in_merge_client(),$(this).attr("disabled",!0),$(".js-confirm-merge-lead-cancel").attr("disabled",!0),$("#checkbox-confirm-merge-leads-modal").attr("disabled",!0).css("cursor","default"),$("#checkbox-confirm-merge-leads-modal").parent().css("cursor","default")})},submit_form_merge_clients:function(){$("#check_on").is(":checked")?$("#client_check_flg").val("on"):$("#client_check_flg").val(""),$("#form_not_auto_merge_clients").submit()},submit_form_auto_merge_lead_in_merge_client:function(){return $("#form_automatically_merge_clients").submit(),!1},submit_form_automatically_merge_clients:function(){$("#type_automatically").val("automatically"),$("#form_merge_clients").submit(),$("#type_automatically").val("")},auto_merge_leads_before_merge_clients:function(){$("#loading_auto_merge_leads").removeClass("tag-display-none"),$("#loading_auto_merge_leads").html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i></span></div>'));var e=Array.from(document.querySelectorAll(".merge-client-ids")).map(function(e){return e.value});$.ajax({url:"/leads/automatically_merge_leads_before_merge_clients",type:"POST",dataType:"json",data:{merge_client_ids:e,checkbox_auto_merge:$("#checkbox-confirm-merge-leads-modal").prop("checked")},timeout:12e4}).done(function(e){$("#notice_message_success_merge_leads").removeClass();var t="<div class='row'>        <div class='col-xs-12'>          <div class='alert alert-success alert-error alert-dismissible' role='alert'>            <button type='button' class='close' data-dismiss='alert' aria-label='Close'>              <span aria-hidden='true'>\xd7</span>            </button>            <ul class='list-unstyled'>              <li>#{notice}</li>            </ul>          </div>        </div>        </div>";t=t.replace("#{notice}",e.notice),$("#notice_message_success_merge_leads").html($(t)),$(this).closest(".modal").modal("hide"),$("#form_merge_clients").submit()}).fail(function(e){200!==e.status&&($("#loading_auto_merge_leads").find(".loading").remove(),$("#loading_auto_merge_leads").addClass("tag-display-none"),window.location.href="/errors/internal_server_error")})},search_old_org_submit:function(t){$(document).on("click","#search_xhr_old_organizations_submit",function(e){e.preventDefault(),$("#only_active_lead_old_org").prop("disabled",!0),$("#show_having_business_card_flg_old_org").prop("disabled",!0),$("#show_uncontacted_officers_flg_old_org").prop("disabled",!0),$("#search_xhr_old_organizations_submit").prop("disabled",!0),$("#show_uncontacted_officers_flg_old_org").prop("checked",!1),lead_status=$("#only_active_lead_old_org").is(":checked")?1:null,show_having_business_card_flg=!!$("#show_having_business_card_flg_old_org").is(":checked");var i=$("#business_card_first_name_old_org").val(),a=$("#business_card_family_name_old_org").val();t.reduce(function(e,n){return e.then(function(){var e=new $.Deferred,t=$("#form_search_xhr_organizations_"+n);return $("#show_uncontacted_officers_flg_as_search_condition_"+n).val(""),$("#old_org_lead_status_"+n).val(lead_status),$("#show_having_business_card_flg_"+n).val(show_having_business_card_flg),$("#old_org_business_card_first_name_"+n).val(i),$("#old_org_business_card_family_name_"+n).val(a),$.ajax({type:t.prop("method"),url:t.prop("action"),data:t.serialize(),timeout:12e4}).always(function(){e.resolve()}),e.promise()})},$.Deferred().resolve()).then(function(){$("#only_active_lead_old_org").prop("disabled",!1),$("#show_having_business_card_flg_old_org").prop("disabled",!1),$("#show_uncontacted_officers_flg_old_org").prop("disabled",!1),$("#search_xhr_old_organizations_submit").prop("disabled",!1)})})},index_auto_merge_leads_before_merge_clients:function(){$("#loading_auto_merge_leads").removeClass("tag-display-none"),$("#loading_auto_merge_leads").html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i></span></div>'));var e=Array.from(document.querySelectorAll(".merge-client-ids")).map(function(e){return e.value}),t=$("#redirect_url").val();$.ajax({url:"/leads/automatically_merge_leads_before_merge_clients",type:"POST",dataType:"json",data:{merge_client_ids:e,redirect_url:t,checkbox_auto_merge:$("#checkbox-confirm-merge-leads-modal").prop("checked")},timeout:12e4}).done(function(e){$("#notice_message_success_merge_leads").removeClass();var t="<div class='row'>        <div class='col-xs-12'>          <div class='alert alert-success alert-error alert-dismissible' role='alert'>            <button type='button' class='close' data-dismiss='alert' aria-label='Close'>              <span aria-hidden='true'>\xd7</span>            </button>            <ul class='list-unstyled'>              <li>#{notice}</li>            </ul>          </div>        </div>        </div>";t=t.replace("#{notice}",e.notice),$("#notice_message_success_merge_leads").html($(t)),$(this).closest(".modal").modal("hide"),$("#alternative_attr_button_merge_clients").click(),$("#form_merge_clients").submit()}).fail(function(e){200!==e.status&&($("#loading_auto_merge_leads").find(".loading").remove(),$("#loading_auto_merge_leads").addClass("tag-display-none"),window.location.href="/errors/internal_server_error")})}},$(document).on("click",".client-org-export-button",function(){lead_status=$("#client_detail #only_active_lead").is(":checked")?1:null,$("#client_detail #only_active_lead_flg_as_export_condition").val(lead_status),show_having_business_card_flg=!!$("#client_detail #show_having_business_card_flg").is(":checked"),$("#client_detail #show_having_business_card_flg_as_export_condition").val(show_having_business_card_flg),show_uncontacted_officers_flg=$("#client_detail #show_uncontacted_officers_flg").is(":checked")?1:null,$(
"#client_detail #show_uncontacted_officers_flg_as_export_condition").val(show_uncontacted_officers_flg),$("#export_organizations_tree_in_show_client #business_card_family_name_as_export_condition").val($("#form_search_xhr_organizations #search_business_card_family_name").val()),$("#export_organizations_tree_in_show_client #business_card_first_name_as_export_condition").val($("#form_search_xhr_organizations #search_business_card_first_name").val())}),App.front_common_tag_groups={index:function(){App.concerns.change_display_number("form_search_common_tag_groups"),App.concerns.change_order("form_search_common_tag_groups")},"new":function(){App.front_common_tag_groups.initialize_form()},create:function(){App.front_common_tag_groups.initialize_form()},edit:function(){App.front_common_tag_groups.initialize_form()},update:function(){App.front_common_tag_groups.initialize_form()},initialize_form:function(){App.front_common_tag_groups.switch_save_button_status(),$("#common_tag_group_name").on({input:function(){App.front_common_tag_groups.switch_save_button_status()}}),$(window).on("beforeunload",function(){App.front_common_tag_groups.set_check_states()}),App.front_common_tag_groups.set_tag_form()},switch_save_button_status:function(){0===$("#common_tag_group_name").val().length?$("#submit").prop("disabled",!0):$("#submit").prop("disabled",!1)},set_tag_form:function(){App.front_common_tag_groups.ajax_load(),App.front_common_tag_groups.async_search(),App.front_common_tag_groups.async_search_clear(),App.front_common_tag_groups.inifinite_scroll(),App.front_common_tag_groups.folding(),App.front_common_tag_groups.children_more_display(),App.front_common_tag_groups.all_check()},set_check_states:function(){var e={checked_tag_ids:[],unchecked_tag_ids:[]},t=[],n=[],i=[],a=[];return i=""==$("#tag_checked_tag_ids").val()?[]:$("#tag_checked_tag_ids").val().split(","),a=""==$("#tag_unchecked_tag_ids").val()?[]:$("#tag_unchecked_tag_ids").val().split(","),$(".tag_check_box:checked").each(function(){t.push($(this).data("tag-id").toString())}),$(".tag_check_box:not(:checked)").each(function(){n.push($(this).data("tag-id").toString())}),e.checked_tag_ids=i.concat(t).filter(function(e){return 0==n.includes(e)}),e.checked_tag_ids=App.front_common_tag_groups.array_distinct(e.checked_tag_ids),e.unchecked_tag_ids=a.concat(n).filter(function(e){return 0==t.includes(e)}),e.unchecked_tag_ids=App.front_common_tag_groups.array_distinct(e.unchecked_tag_ids),$("#tag_checked_tag_ids").val(e.checked_tag_ids.join(",")),$("#tag_unchecked_tag_ids").val(e.unchecked_tag_ids.join(",")),e},tag_display_all:function(){App.front_common_tag_groups.ajax_load(),$("#loading").show();var e=App.front_common_tag_groups.set_check_states();$.ajax({url:"/xhr/common_tag_groups/tags_tree_index_html",type:"GET",data:{tag:{tag_name:$("#tag_tag_name").val(),common_tag_group_id:$("#tag_common_tag_group_id").val(),checked_tag_ids:e.checked_tag_ids.join(","),unchecked_tag_ids:e.unchecked_tag_ids.join(",")}}}).done(function(e){$("#tag_tree").empty(),$("#tag_tree").append(e),$("#tag_common_tag_size").val($("#tag_tree").attr("data-tag-count")),$("#tag_tree .dd-list").show()}).always(function(){$("#loading").hide(),App.front_common_tag_groups.inifinite_scroll()})},ajax_load:function(){var e=$("<div>");e.attr("id","loading");var t=$("<div>");t.attr("id","spinner"),e.append(t),$("html").prepend(e)},search:function(){$("#loading").show(),$("#tag_tag_name").val($("#search_name").val()),App.front_common_tag_groups.set_check_states(),$("#tag_form").attr("method","post"),$("#tag_form").attr("action","/xhr/common_tag_groups/async_search"),$("#tag_form").submit()},async_search:function(){$(document).on("click","#search_submit",function(e){e.preventDefault(),App.concerns.disabled_btn("#js_clear_submit"),App.concerns.disabled_btn("#search_submit"),App.front_common_tag_groups.search()})},async_search_clear:function(){$(document).on("click","#js_clear_submit",function(e){e.preventDefault(),App.concerns.disabled_btn("#js_clear_submit"),App.concerns.disabled_btn("#search_submit"),$("#search_name").val(""),App.front_common_tag_groups.search()})},inifinite_scroll:function(){$(window).on("scroll",function(){if(parseInt($("#tag_tree").attr("data-tag-count"))>parseInt($("#tag_common_tag_size").val())){var e=$(document).height()-($(window).height()+$(window).scrollTop());if(-3<e&&e<3){var t=$("#tag_tree").find('li[data-depth="1"]').map(function(){return $(this).attr("data-tag-id")}).get();$("#loading").show(),$(window).off("scroll"),$("#tag_displayed_tag_ids").val(t.join(",")),$("#tag_form").attr("method","post"),$("#tag_form").attr("action","/xhr/common_tag_groups/next_tags"),$("#tag_form").submit()}}})},load_list:function(e){var t=$("<div>");t.attr("id","loading-list");var n=$('<i class="fa fa-spinner fa-pulse fa-3x loading"></i>');n.attr("id","spinner-list"),t.append(n),$("li#"+e).before(t),$("#loading-list").show()},folding:function(){$(document).on("click",".dd-item button",function(){"expand"==$(this).attr("data-action")?App.front_common_tag_groups.children_list_show(this,"0"):($(this).attr("data-action","expand"),$(this).nextAll("ul").hide(),$(this).nextAll(".children-more").hide())}),$(document).on("click","#all_open",function(){var e=$("#tag_tree").attr("data-tag-count")>parseInt($("#tag_common_tag_size").val()),t=$("#tag_tree").children("li");!e&&App.front_common_tag_groups.children_dom_check(t,!0)?($("#tag_tree .dd-list").show(),$("#tag_tree .folding").attr("data-action","collapse")):($(window).off("scroll"),App.front_common_tag_groups.tag_display_all("all_open"))}),$(document).on("click","#all_close",function(){$("#tag_tree .dd-list").hide(),$("#tag_tree .dd-list").nextAll("a.children-more").hide(),$("#tag_tree .folding").attr("data-action","expand")})},children_dom_check:function(e,n){return e.each(function(e,t){return 0==$(t).children("button").length||(n=!(0<$(t).children("button").length&&0==$(t).children(".dd-list").length)&&(0!=$(t).children(".dd-list").children().length&&(!(0<$(t).has("a.children-more").length)&&App.front_common_tag_groups.children_dom_check($(t).children(".dd-list").children(".dd-item"),n))))}),n},children_list_show:function(e){$(e).nextAll(".dd-list").find(".dd-item").length?($(e).attr("data-action","collapse"),$(e).nextAll("ul").show(),$(e).nextAll(".children-more").show()):(parent_id=$(e).parent("li").data("tag-id"),App.front_common_tag_groups.load_list(parent_id),$("#tag_parent_tag_id").val(parent_id),$("#tag_form").attr("method","get"),$("#tag_form").attr("action","/xhr/common_tag_groups/append_children/"),$("#tag_form").submit())},children_more_display:function(){$(document).on("mouseover",".children-more",function(){$(this).off("mouseover");var e=parseInt($(this).prev().attr("data-child-tag-size"));if(e<parseInt($(this).prev().attr("data-child-tag-count"))){$("#loading").show();var t=$(this).prev().find("li").map(function(){return $(this).attr("data-tag-id")}).get();parent_id=$(this).parent("li").data("tag-id"),$("#tag_parent_tag_id").val(parent_id),$("#tag_child_tag_size").val(e),$("#tag_displayed_tag_ids").val(t.join(",")),$("#tag_form").attr("method","post"),$("#tag_form").attr("action","/xhr/common_tag_groups/more_append_children/"),$("#tag_form").submit()}})},all_check:function(){$(document).on("change",".all-check",function(){$("input.tag_check_box:visible").not(":disabled").prop("checked",$(this).is(":checked"))})},array_distinct:function(e){return e.filter(function(e,t,n){return n.indexOf(e)===t})}},App.front_configs={index:function(){this.select_key(),this.sortable_configs()},"new":function(){this.select_key()},create:function(){this.select_key()},edit:function(){this.select_key()},update:function(){this.select_key()},select_key:function(){$("#key").select2({width:"50%"}),$("#key").on("change",function(){return location.href="/configs/"+$(this).val()+"/",!1})},sortable_configs:function(){$(".sortable").sortable({cursor:"move",opacity:.7,update:function(e){config_key=$(e.target).data("config-key"),$.ajax({url:"/xhr/configs",type:"POST",dataType:"json",data:$(this).sortable("serialize")+"&config_key="+config_key}).done(function(){}).fail(function(e){console.log(e.status),500===e.status&&alert(I18.t("js.common.occurred_error"))})}}),$(".sortable").disableSelection()}},App.front_corporate_analyses={index:function(){this.sortable_corporate_analyses(),this.sortable_corporate_analyses_branch()},sortable_corporate_analyses:function(){$(".sortable").sortable({cursor:"move",opacity:.7,update:function(){console.log($(this).sortable("toArray",{attribute:"data-index"})),$.ajax({url:"/xhr/corporate_analyses",type:"POST",dataType:"json",data:{order:$(this).sortable("toArray",{attribute:"data-index"})}}).done(function(){}).fail(function(e){console.log(e.status),500==e.status&&alert(I18.t("js.common.occurred_error"))})}}),$(".sortable").disableSelection()},sortable_corporate_analyses_branch:function(){$(".sortable-branch").sortable({cursor:"move",opacity:.7,update:function(){console.log($(this).sortable("toArray",{attribute:"data-index"})),$.ajax({url:"/xhr/corporate_analyses",type:"POST",dataType:"json",data:{order:$(this).sortable("toArray",{attribute:"data-index"}),branch_flg:!0}}).done(function(){}).fail(function(e){console.log(e.status),500==e.status&&alert(I18.t("js.common.occurred_error"))})}}),$(".sortable-branch").disableSelection()}},App.front_csv_updates={index:function(){this.file_submit(),this.common(),$("#search_import").on("change",function(){$(':input[type="submit"]').prop("disabled",!1)})},business_card:function(){this.file_submit(),this.common()},lead:function(){this.file_submit(),this.common()},client:function(){this.file_submit(),this.common()},user:function(){this.file_submit(),this.common()},task:function(){this.file_submit(),this.common()},daily_report:function(){this.file_submit(),this.common()},deal:function(){this.file_submit(),this.common()},deal_detail:function(){this.file_submit(),this.common()},deal_process:function(){this.file_submit(),this.common()},objective:function(){this.file_submit(),this.common()},smartphone_device:function(){this.file_submit(),this.common()},file_submit:function(){$(".file_submit").on("click",function(){if(!$("#search_import").val().length){var e=String()+"<div class='alert alert-danger alert-error'><a class='close' data-dismiss='alert'>\xd7</a><ul><li>"+I18n.t("js.common.select_import_target")+"</li></ul></div>";return $("#js_error_message").prepend(e),$(this).prop("disabled",!0),!1}$(this).parents("form:first").attr("action",$("#search_import").val())})},common:function(){$("#search_import").select2({minimumResultsForSearch:20,width:"40%",placeholder:I18n.t("js.common.select_import_target")})}},App.front_custom_reports={index:function(){App.concerns.change_display_number("form_search_custom_reports"),App.concerns.change_order("form_search_custom_reports"),App.concerns.focus_to_first_element()},"new":function(){this.submit_new(),this.change_visible_output()},create:function(){this.submit_new(),this.change_visible_output()},edit:function(){this.submit_edit()},update:function(){this.submit_edit()},submit_new:function(){$("#new_submit").on("click",function(){$("form.new_custom_report").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$("form.edit_custom_report").submit()})},change_visible_output:function(){$("#custom_report_data_type").change(function(){var e="none",t="hide";switch($(this).val()){case"2":t=e="";break;case"3":t=""}$("#output_year").css("display",e),$("#with_attached_file_row").attr("class",t)})}};var session_error_message_flg=!1;App.front_daily_reports={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#btn-clear-form"),App.concerns.disable_duplicate_request_search_form("#form_search_daily_reports",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("daily_reports"),this.set_index(),this.submit_search_sp(),this.change_button_actibity_by_role(),App.concerns.load_objects(this),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.tooltip.display_tooltip(),App.front_deals.all_checked_items_modal_deals_index();var e="daily_reports";App.front_recommend.recommendScenarios(e),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},inheritance_index:function(){this.set_index(),this.submit_search_sp(),this.change_button_actibity_by_role(),App.concerns.load_objects(this)},show:function(){$(document).on("shown.bs.modal","#modalContainer",function(){App.front_deals.sync_height_table_auto_calculate()}),$(document).on("ajax:complete","#modalContainer",function(){App.front_deals.sync_height_table_auto_calculate()}),App.concerns.load_pictures(this),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_task_submit",!0),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_deal_submit",!0),App.concerns.change_display_template(),App.concerns.set_form_action_to_submit("#js_copy_daily_report_submit","#js_copy_daily_report",!0),App.concerns.select_search("comment_to_user_ids"),App.concerns.open_mailer(),$(".js_submit_send_mail").on("click",function(){$(".btn-group.open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));$("#select_business_card_id").val($(this).data("business-card-id")),e.submit(),$(document).on("shown.bs.modal","#modal_block_for_send_mail",function(){$(document).on("show.bs.modal","#modal_check_tbc",function(){var e=Math.max.apply(null,Array.prototype.map.call(document.querySelectorAll("*"),function(e){return+e.style.zIndex}))+10;$(this).css("z-index",e),setTimeout(function(){$(".modal-backdrop").not(".modal-stack").css("z-index",e-1).addClass("modal-stack")},0),$(document).off("shown.bs.modal","#modal_check_tbc")});var e=$("#tbc_to_ids").val().split(","),t=$("#tbc_with_custom_item_param_mapping").val();return 1<=e.length&&""!==e[0]&&$.ajax({type:"POST",url:"/xhr/temporary_business_cards/check_tbc_modal",dataType:"script",data:{temporary_business_card_ids:e,tbc_with_custom_item_param_mapping:t}}),$(document).off("shown.bs.modal","#modal_block_for_send_mail"),!1})});new Clipboard(".clipboard-btn");this.setup_comments(),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#search_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#search_lead_ids","multiple",$("#unlink_clients_flg").val()),this.show_edit_deals(),this.edit_deals_modal_submit(),this.attach_add_or_edit_relation_handles(),this.delete_deal_edit_modal(),$("#add_all_parties_comment_destination").on("click",function(){$.ajax({url:"/xhr/users/existence_all/",type:"POST",data:{id:$("#daily_report_id").val(),comment_to_user_ids:$("#comment_to_user_ids").val()},dataType:"json",context:$(this)}).done(function(e){0<e.user_ids.length&&($("#comment_to_user_ids").select2("data",e.user_ids),$("#comment_to_user_ids").select2("open"),$("#comment_to_user_ids").select2("close"))})});var e=$("#default_comment_to_user_ids").val(),t=$("#last_number").val();null!=e&&""!=e&&t&&($("#comments_of_daily_report_reply_number").val(t),$("#js_comment_label").text(">"+t+I18n.t("js.daily_reports.reply_to")),$("#js_comment_label_box").show());var n=document.getElementById("edit_deals");if(n){var i=new MutationObserver(function(e){e.forEach(function(e){if(!$(e.target).hasClass("in")){var t=new URL(window.location);t.searchParams["delete"]("edit_deal_flg"),history.pushState({},"",t),i.disconnect()}})});i.observe(n,{attributes:!0,attributeFilter:["class"]})}App.concerns.all_checked_items(),App.concerns.toggle_print_target()},"new":function(){App.front_deals.all_checked_items_modal_deals_index(),this.add_name(),this.submit_new(),this.submit_new_next(),this.change_edit_deal(),this.change_client_form(),this.display_swith_roles_select(),this.set_client_id(),this.initializeDealsDetailFields(),this.init_select_roles("#confirmation_role_ids"),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.timepicker(".search_timepicker"),App.concerns.select_search_name("daily_report_client_id"),App.concerns.set_client_branch_form("daily_report_client_id"),App.concerns.select_search("daily_report_user_id"),App.concerns.select_search("deal_ids"),App.concerns.select_search("daily_report_campaign_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("confirmation_user_ids"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("accompany_user_ids"),App.concerns.set_tooltip_to_select_search_client("daily_report_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),this.set_data_to_confirmation_users(),$("#next_support_kbn_ids").select2({width:"100%"}),$("#js_select_role_ids select").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),App.concerns.change_display_template(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.set_associate_entity_to_s2("#daily_report_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#deal_ids",'input[name="associate_deals[]"]',"deals"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#daily_report_client_id","#client_temporary_business_card_id","single","#daily_report_client_id","show"),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#daily_report_client_id","show"),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#deal_ids","multiple","#daily_report_client_id",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),this.update_end_visit_on(),this.set_select_item_type_lead(),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block"),App.concerns.focus_to_first_element(),window.hasOwnProperty("__INITIAL_STATE__")&&window.__INITIAL_STATE__.hasOwnProperty("cooperation")&&$("#open-associated-client").length&&null!=window.__INITIAL_STATE__.cooperation.client_name&&$.ajax({url:"/xhr/clients/search_modal",data:"search[simple]="+window.__INITIAL_STATE__.cooperation.client_name+"&select_type=single"}),$(window).on("load",function(){App.concerns.load_pictures(App.front_daily_reports,!0)}),App.concerns.restore_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val(),null,null,null,"form.new_daily_report"),App.concerns.create_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val(),null,null,null,"form.new_daily_report"),App.front_segments.set_segment_select2("#daily_report_segment_id"),App.front_segments.change_segment_icon("#daily_report_segment_id"),this.update_ui_textarea_template_form(),App.concerns.all_checked_items()},attach_click_on_datepicker:function(e){var t={format:"YYYY/MM/DD hh:mm"};e.find(".details_datepicker").one("click",function(){$(this).attr(t),$(this).datepicker({language:"ja"}),$(this).find(".fa-calendar").trigger("click")})},initializeDealsDetailFields:function(){function n(e){return Number(e)>i.DEALS_MAX_NUMBER?i.DEALS_MAX_NUMBER:Number(e)<i.DEALS_MIN_NUMBER?i.DEALS_MIN_NUMBER:e}var i=this;i.attach_click_on_datepicker($(document)),$(document).off("click",'[data-hp-role="deals-details-up"]'),$(document).on("click",'[data-hp-role="deals-details-up"]',function(){var e=$(this).parents("tr");e.prevAll().filter(i.withoutDestroy()).first().before(e)}),$(document).off("click",'[data-hp-role="deals-details-down"]'),$(document).on("click",'[data-hp-role="deals-details-down"]',function(){var e=$(this).parents("tr");e.nextAll().filter(i.withoutDestroy()).first().after(e)}),$(document).off("click",'[data-hp-role="deals-details-aggregate"]'),$(document).on("click",'[data-hp-role="deals-details-aggregate"]',function(){if(0!=$('[name^="deal[deals_details_attributes]"][name$="[amount]"]').size()){var e=i.aggregate($('[name^="deal[deals_details_attributes]"][name$="[amount]"][type!="hidden"]'));$('[name="deal[amount]"]').val(n(e)).focusout()}if(0!=$('[name^="deal[deals_details_attributes]"][name$="[gross_profit]"]').size()){var t=i.aggregate($('[name^="deal[deals_details_attributes]"][name$="[gross_profit]"][type!="hidden"]'));$('[name="deal[gross_profit]"]').val(n(t)).focusout()}}),$(document).off("click",'[data-hp-role="deals-details-delete"]'),$(document).on("click",'[data-hp-role="deals-details-delete"]',function(){var e=$('[name="deals_details_box[]"]:checked').parents("tr").filter(i.withoutDestroy());0!=e.size()?e.size()>i.DEALS_DETAILS_DELETE_LIMIT?alert(I18n.t("js.deals.delete_rows_exceeds")):(e.size()&&confirm(I18n.t("js.deals.confirm_delete_item"))&&$('[name="deals_details_box[]"]:checked').siblings(".remove_deals_details").click(),$('[name="all-check"]:checked').prop("checked",!1),App.front_daily_reports.hide_detail_info()):alert(I18n.t("js.common.please_select"))}),$(document).off("click",'[data-hp-role="deals-details-copy"]'),$(document).on("click",'[data-hp-role="deals-details-copy"]',function(){var n=$('[name="deals_details_box[]"]:checked').parents("tr").filter(i.withoutDestroy()),e=n.clone(!1),t=$('[data-hp-role="deals-details-fields-for"]').find("tr").filter(i.withoutDestroy());0!=n.size()?n.size()>i.DEALS_DETAILS_COPY_LIMIT?alert(I18n.t("js.deals.copy_rows_exceeds")):t.size()+n.size()>i.DEALS_DETAILS_LIMIT?alert(I18n.t("js.deals.add_rows_exceeds")):(e.each(function(t){var e=(new Date).getTime();$(this).find("[name]").each(function(){$(this).attr("id")&&$(this).attr("id",$(this).attr("id").replace(/\_[0-9]+\_/,"_"+e+"_")),$(this).attr("name")&&$(this).attr("name",$(this).attr("name").replace(/\[[0-9]+\]/,"["+e+"]"))}),$(this).find("label[for]").each(function(){$(this).attr("for")&&$(this).attr("for",$(this).attr("for").replace(/\_[0-9]+\_/,"_"+e+"_"))}),$(this).find("td").each(function(){var e=$(this).find(".autonumeric"),t=e.attr("name");e.removeAttr("value"),e.siblings().each(function(){$(this).attr("name")==t&&$(this).remove()})}),$(this).find("select").each(function(e){$(this).val($($(n[t]).find("select")[e]).val())}),$(this).find("textarea").each(function(e){$(this).val($($(n[t]).find("textarea")[e]).val())}),$(this).find('[name$="[sales_on]"]').each(function(e){$(this).val($($(n[t]).find('[name$="[sales_on]"]')[e]).val())}),$(this).find('[name$="[id]"]').removeAttr("value"),$(this).find(".details_datepicker").datepicker()}),$('[data-hp-role="deals-details-fields-for"]').append(e.get().reverse()),$('[name="deals_details_box[]"]:checked').prop("checked",!1),$('[name="all-check"]:checked').prop("checked",!1),$(document).trigger("refresh_autonumeric"),$('tbody[data-hp-role="deals-details-fields-for"] [readonly="readonly"]').each(function(){var e=$(this).parent();$(e).hasClass("details_datepicker")&&$(e).datepicker("destroy"),$(this).on("keydown",function(e){-1!==[" ","Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].indexOf(e.key)&&e.preventDefault()})})):alert(I18n.t("js.common.please_select"))}),$(document).on("nested:fieldAdded",function(e){if(e.field.siblings().filter(i.withoutDestroy()).size()>=i.DEALS_DETAILS_LIMIT)return e.field.find(".remove_deals_details").click(),void alert(I18n.t("js.deals.add_rows_exceeds"));i.attach_click_on_datepicker(e.field),$(document).trigger("refresh_autonumeric")}),$(".add_nested_fields").on("click",function(){App.front_deals.show_detail_master_area()}),App.front_products.show_modal_product(),$(document).on("click","#modal_use_master_product",function(){$("#submit_search_product").click()})},withoutDestroy:function(t){return t===undefined&&(t=function(e){return e}),function(){var e=t($(this)).find('[name$="[_destroy]"]').val();return!e||"false"===e}},new_from_another_controller:function(){App.front_deals.all_checked_items_modal_deals_index(),this.add_name(),this.submit_new(),this.submit_new_next(),this.change_edit_deal(),this.change_client_form(),this.display_swith_roles_select(),this.set_client_id(),this.initializeDealsDetailFields(),this.init_select_roles("#confirmation_role_ids"),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.timepicker(".search_timepicker"),App.concerns.select_search_name("daily_report_client_id"),App.concerns.set_client_branch_form("daily_report_client_id"),App.concerns.select_search("daily_report_user_id"),App.concerns.select_search_lead("deal_ids"),App.concerns.select_search("daily_report_campaign_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("confirmation_user_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search("accompany_user_ids"),App.concerns.set_tooltip_to_select_search_client("daily_report_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),this.set_data_to_confirmation_users(),this.set_select_item_type_lead(),$("#next_support_kbn_ids").select2({width:"100%"}),$("#js_select_role_ids select").select2({width:"100%"}),$("#form_search_xhr_client_branches_select_options").submit(),App.concerns.change_display_template(),App.concerns.set_associate_entity_to_s2("#daily_report_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#deal_ids",'input[name="associate_deals[]"]',"deals"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#daily_report_client_id","#client_temporary_business_card_id","single","#daily_report_client_id","show"),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#daily_report_client_id","show"),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#deal_ids","multiple","#daily_report_client_id",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),this.update_end_visit_on(),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.init("#daily_report_client_branch_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block"),App.concerns.focus_to_first_element(),$(window).on("load",function(){App.concerns.load_pictures(App.front_daily_reports,!0)}),App.concerns.restore_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val(),null,null,null,"form.new_daily_report"),App.concerns.create_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val(),null,null,null,"form.new_daily_report"),App.front_segments.set_segment_select2("#daily_report_segment_id"),App.front_segments.change_segment_icon("#daily_report_segment_id")},create:function(){this.add_name(),this.submit_new(),this.submit_new_next(),this.change_edit_deal(),this.change_client_form(),this.display_swith_roles_select(),this.set_client_id(),this.init_select_roles("#confirmation_role_ids"),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.timepicker(".search_timepicker"),App.concerns.select_search_name("daily_report_client_id"),App.concerns.select_search("daily_report_user_id"),App.concerns.select_search_lead("deal_ids"),App.concerns.select_search("daily_report_campaign_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("confirmation_user_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search("accompany_user_ids"),App.concerns.set_tooltip_to_select_search_client("daily_report_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),this.set_data_to_confirmation_users(),$("#next_support_kbn_ids").select2({width:"100%"}),$("#js_select_role_ids select").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),$("#form_search_xhr_client_branches_select_options").submit(),App.concerns.change_display_template(),App.concerns.set_associate_entity_to_s2("#daily_report_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#deal_ids",'input[name="associate_deals[]"]',"deals"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#daily_report_client_id","#client_temporary_business_card_id","single","#daily_report_client_id","show"),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#daily_report_client_id","show"),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#deal_ids","multiple","#daily_report_client_id",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),this.update_end_visit_on(),this.set_select_item_type_lead(),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.init("#daily_report_client_branch_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block"),App.concerns.focus_to_first_element(),App.front_segments.set_segment_select2("#daily_report_segment_id"),App.front_segments.change_segment_icon("#daily_report_segment_id"),this.update_ui_textarea_template_form(),App.front_products.show_modal_product(),App.concerns.all_checked_items(),this.initializeDealsDetailFields()},edit:function(){App.front_deals.all_checked_items_modal_deals_index(),this.add_name(),this.submit_edit(),this.submit_edit_next(),this.change_edit_deal(),
this.change_client_form(),this.display_swith_roles_select(),this.set_client_id(),this.initializeDealsDetailFields(),this.init_select_roles("#confirmation_role_ids"),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.timepicker(".search_timepicker"),App.concerns.select_search_name("daily_report_client_id"),App.concerns.set_client_branch_form("daily_report_client_id"),App.concerns.select_search("daily_report_user_id"),App.concerns.select_search("deal_ids"),App.concerns.select_search("daily_report_campaign_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("confirmation_user_ids"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("accompany_user_ids"),App.concerns.set_tooltip_to_select_search_client("daily_report_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),this.set_data_to_confirmation_users(),$("#next_support_kbn_ids").select2({width:"100%"}),$("#js_select_role_ids select").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),App.concerns.change_display_template(),App.concerns.hide_item_file_options(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.set_associate_entity_to_s2("#daily_report_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#deal_ids",'input[name="associate_deals[]"]',"deals"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#daily_report_client_id","#client_temporary_business_card_id","single","#daily_report_client_id","show"),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#daily_report_client_id","show"),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#deal_ids","multiple","#daily_report_client_id",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),this.update_end_visit_on(),this.set_select_item_type_lead(),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.init("#daily_report_client_branch_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block"),this.change_open_status_all(),$(window).on("load",function(){App.concerns.load_pictures(App.front_daily_reports,!0)}),App.concerns.restore_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_daily_report"),App.concerns.create_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_daily_report"),App.front_segments.set_segment_select2("#daily_report_segment_id"),App.front_segments.change_segment_icon("#daily_report_segment_id"),this.update_ui_textarea_template_form(),App.concerns.all_checked_items()},update:function(){this.add_name(),this.submit_edit(),this.submit_edit_next(),this.change_edit_deal(),this.change_client_form(),this.display_swith_roles_select(),this.set_client_id(),this.init_select_roles("#confirmation_role_ids"),App.concerns.datepicker(".search_datepicker"),App.concerns.timepicker(".search_timepicker"),App.concerns.select_search_name("daily_report_client_id"),App.concerns.select_search("daily_report_user_id"),App.concerns.select_search("deal_ids"),App.concerns.select_search("daily_report_campaign_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("confirmation_user_ids"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("accompany_user_ids"),App.concerns.set_tooltip_to_select_search_client("daily_report_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),this.set_data_to_confirmation_users(),$("#next_support_kbn_ids").select2({width:"100%"}),$("#js_select_role_ids select").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),this.initializeDealsDetailFields(),$("#form_search_xhr_client_branches_select_options").submit(),App.concerns.change_display_template(),App.concerns.hide_item_file_options(),App.concerns.set_associate_entity_to_s2("#daily_report_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#deal_ids",'input[name="associate_deals[]"]',"deals"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#daily_report_client_id","#client_temporary_business_card_id","single","#daily_report_client_id","show"),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#daily_report_client_id","show"),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#deal_ids","multiple","#daily_report_client_id",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),this.update_end_visit_on(),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.init("#daily_report_client_branch_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block"),this.change_open_status_all(),this.set_select_item_type_lead(),App.front_segments.set_segment_select2("#daily_report_segment_id"),App.front_segments.change_segment_icon("#daily_report_segment_id"),this.update_ui_textarea_template_form(),App.front_products.show_modal_product(),App.concerns.all_checked_items()},makeSubmitFunction:function(e,t,n){var i=this;return function(){e.on("click",function(){$(this).attr("disabled",!0),$('[data-hp-role="deals-details-fields-for"]').find("tr").filter(i.withoutDestroy()).each(function(e){$(this).find('[name$="[sort_order]"]').val(e)}),n&&n.appendTo(t),t.submit()})}},submit_new:function(){var e=this.makeSubmitFunction($("#new_submit"),$("form.new_daily_report"));$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("#new_next_submit").attr("disabled",!0),App.concerns.destroy_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val()),$("form.new_daily_report").submit()}),e()},submit_new_next:function(){appendParam=$("<input>").attr({type:"hidden",name:"new_next_flg",value:1});var e=this.makeSubmitFunction($("#new_next_submit"),$("form.new_daily_report"),appendParam);$("#new_next_submit").on("click",function(){$(this).attr("disabled",!0),$("#new_submit").attr("disabled",!0),$("#new_next_flg").val(1),App.concerns.destroy_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val()),$("form.new_daily_report").submit()}),e()},submit_edit:function(){var e=this.makeSubmitFunction($("#edit_submit"),$("form.edit_daily_report"));$("#edit_submit").on("click",function(){$(this).attr("disabled",!0),$("#edit_next_submit").attr("disabled",!0),App.concerns.destroy_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val()),$("form.edit_daily_report").submit()}),e()},submit_edit_next:function(){appendParam=$("<input>").attr({type:"hidden",name:"edit_next_flg",value:1});var e=this.makeSubmitFunction($("#edit_next_submit"),$("form.edit_daily_report"),appendParam);$("#edit_next_submit").on("click",function(){$(this).attr("disabled",!0),$("#edit_submit").attr("disabled",!0),$("#edit_next_flg").val("1"),App.concerns.destroy_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val()),$("form.edit_daily_report").submit()}),e()},change_edit_deal:function(){$("#check_edit_deal_flg").on("change",function(){$(this).prop("checked")?($("input[id$=_next_submit]").addClass("disabled"),$("#edit_deal_flg").val("1")):($("input[id$=_next_submit]").removeClass("disabled"),$("#edit_deal_flg").val(""))})},submit_search_sp:function(){$(".responsive #search_unread_flg").on("change",function(){$("#form_search_daily_reports").submit()}),$(".responsive #search_private_flg").on("change",function(){$("#form_search_daily_reports").submit()})},change_client_form:function(){$("#client_branch_id").val($("#daily_report_client_branch_id").val()),$("#daily_report_client_id").on("change",function(){var e=$(this).val();$(".client_id").val(e),$("#js_client_id").val(e),$("#client_branch_id").val(""),$('[name="daily_report[client_branch_id]"]').val(""),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_business_cards_select_options").submit(),e&&$("#client_temporary_business_card_id").val("").trigger("change"),$("#client_branch_block").trigger("change"),$(".tooltip").tooltip("hide")})},change_client_index:function(){$("#search_client_id").on("change",function(e){$("#business_card_ids").data("clientId",e.val),$("#business_card_ids").select2("val",""),$("#lead_ids").data("clientId",e.val),$("#lead_ids").select2("val","")})},display_swith_roles_select:function(){3==$("#js_open_status").val()&&$("#js_select_role_ids").show(),$("#js_open_status").on("change",function(){var e=$("#js_open_status").val(),t=$("#js_open_status").data("open-status");3==e&&""==t?($("#js_user_id").val($("#daily_report_user_id").val()),$("#js_form_set_select_roles").submit()):($("#js_select_role_ids select").select2("val",""),$("#js_select_role_ids").hide())})},add_name:function(){$("#js_add_name").on("click",function(){var e=$("#js_add_name_select").val(),t=$("#daily_report_name").val(),n=t.length+e.length;1<=e.length&&n<=255&&($("#daily_report_name").val(t+e),$("#daily_report_name").focus(),$("#daily_report_name").createTextRange().select())})},set_index:function(){App.concerns.change_display_number("form_search_daily_reports"),App.concerns.change_order("form_search_daily_reports"),App.concerns.datepicker(".search_datepicker"),App.concerns.datetimepicker(".datetimepicker"),App.concerns.set_form_action_to_submit("#form_checked_tasks",".checked_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_tasks",".js_open_modal_update_all",!0),App.concerns.set_form_action_to_submit("#form_checked_tasks",".js_update_confirmations",!0),App.concerns.set_value("click",".js_clear_submit","#search_clear_flg","search-clear-flg"),App.concerns.select_search("search_client_id"),App.concerns.select_search_disable_user("search_user_ids"),App.concerns.select_search_disable_user("search_accompany_user_ids"),App.concerns.select_search("business_card_ids"),App.concerns.select_search("search_lead_ids"),App.concerns.select_search("search_client_name_from_daily_report_for_lead_ids"),App.concerns.select_search("search_deal_ids"),App.concerns.select_search_disable_user("search_mail_user_ids"),App.concerns.select_search("campaign_ids"),App.concerns.select_search_disable_user("search_confirmation_user_ids"),App.concerns.select_search("search_sale_approach_id"),$("#search_main_product_type_ids").select2(),$("#search_next_support_kbn_ids").select2(),$("#search_chance_kbn_ids").select2(),$("#search_superior_confirmation_flg").select2(),$("#search_next_accompany_flg").select2(),$("#search_open_status").select2(),$("#search_display_template_ids").select2(),$("#search_activity_content_ids").select2(),App.front_segments.set_segment_select2("#search_segment_ids"),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids","","","",!0),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),App.concerns.enable_csv_export_event("#form_search_daily_reports","checked[daily_report_ids][]"),App.concerns.set_item_id(),$("#search_client_name").on("blur",function(){$("#search_deal_ids").data("clientName",$("#search_client_name").val())}),App.visible_fields.setup_list_visible_setting(["name","client","lead_id","visit_on","deal"],"table.table-float-head"),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.change_search_type(),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),App.concerns.change_display_template(),$(document).on("click",".js_submit_report",function(e){e.preventDefault();var t=$("#form_search_daily_reports").attr("action"),n=$(this).data("report-id");$("#js_report_id").val(n),$("#form_search_daily_reports").attr("action",this.href),$("#form_search_daily_reports").submit(),$("#form_search_daily_reports").attr("action",t),$("#js_report_id").val("")}),App.concerns.all_checked_items(),App.concerns.get_modal_to_search_save("#form_search_daily_reports"),App.concerns.get_modal_to_search_call("#form_search_daily_reports"),App.concerns.request_search_call(),App.searches.callForSearchCondition.init(),$("#bulk_next_support_kbn_ids").select2({width:"100%"}),App.concerns.select_search("daily_report_bulk_user_id"),App.concerns.select_search("daily_report_bulk_campaign_id"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#search_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#search_lead_ids","multiple",$("#unlink_clients_flg").val()),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#search_deal_ids",'input[name="associate_deals[]"]',"deals"),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#search_deal_ids","multiple",$("#unlink_clients_flg").val()),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision_from_open-associated-lead-client","#search_client_name_from_daily_report_for_lead_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client","/xhr/clients/search_modal","#search_client_name_from_daily_report_for_lead_ids","multiple","#search_client_name_from_daily_report_for_lead_ids","","open-associated-lead-client"),App.concerns.select_search("search_client_daily_report"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision_from_open-associated-client-daily-report","#search_client_daily_report",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client-daily-report","/xhr/clients/search_modal","#search_client_daily_report","multiple","#search_client_daily_report","","open-associated-client-daily-report","",!0),App.concerns.check_form_input("#myModal","#bulk_update",["daily_report[next_accompany_flg]","daily_report[superior_confirmation_flg]"]),this.update_end_visit_on(),App.concerns.focus_to_first_element(),this.set_select_item_type_lead_index()},set_select_item_type_lead_index:function(e){e=e||"#daily_report_index_items_type_lead_ids";var t=$(e).val().split(" ");$.each(t,function(e,t){App.concerns.select_search_lead("search_items__"+t+"_item_lead_ids"),App.concerns.select_search_lead("search_items__"+t+"_item_lead_client_ids"),$("#search_items__"+t+"_item_lead_ids").prev().tooltip({title:function(){return $("#search_items__"+t+"_item_lead_ids").data("title")},placement:"top"}),App.concerns.set_associate_entities_to_s2("#"+t+"_multiple_decision","#search_items__"+t+"_item_lead_ids","input[name='associate_leads[]']","leads","lead_"),App.concerns.enable_associattion_search_modal("#open-search_items__"+t+"_item_lead_ids","/xhr/leads/search_as_association_modal","#search_items__"+t+"_item_lead_ids","multiple","","",String(t)),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision_from_item_lead_client_"+t,"#search_items__"+t+"_item_lead_client_ids","input[name='associate_clients[]']","clients"),App.concerns.enable_associattion_search_modal("#open-search_items__"+t+"_item_lead_client_ids","/xhr/clients/search_modal","#search_items__"+t+"_item_lead_client_ids","multiple","#search_items__"+t+"_item_lead_client_ids","","item_lead_client_"+String(t))})},set_select_item_type_lead:function(e){e=e||"#daily_report_index_items_type_lead_ids";var t=$(e).val().split(" ");$.each(t,function(e,t){App.concerns.select_search_lead("item_values_"+t),App.concerns.set_associate_entities_to_s2("#"+t+"_multiple_decision","#item_values_"+t,"input[name='associate_leads[]']","leads",!0),App.concerns.enable_associattion_search_tab_modal("#open-associated-items_"+t,"/xhr/leads/search_as_association_modal","#item_values_"+t,"#"+t+"_temporary_business_card_id","multiple","",!0,"","",String(t)),App.concerns.show_modal_simple_business_card("open_modal_simple_business_card_item_"+t,"item_values_"+t),App.concerns.set_associate_entities_to_s2("#"+t+"_tbc_multiple_decision","#"+t+"_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards",!0),$("#"+t+"_temporary_business_card_id").trigger("change")})},set_data_to_confirmation_users:function(){$(document).on("change","#role_ids",function(){$("#confirmation_user_ids").data("selected-role-ids",$(this).select2("val")).trigger("change"),$("#confirmation_user_ids").val("")}),$("#js_open_status").on("change",function(){$("#confirmation_user_ids").data("open-status",$(this).val()),3!=$(this).val()&&($("#confirmation_user_ids").trigger("change"),$("#confirmation_user_ids").val(""))}),$("#daily_report_user_id").on("change",function(){$("#confirmation_user_ids").data("user-id",$(this).val()).trigger("change"),$("#confirmation_user_ids").val("")})},setup_comments:function(){$(".js_comment_reply").on("click",function(){var e=$(this).parent().prev();$("#comment_to_user_ids").val(e.data("user-id")).trigger("change"),$("#comment_to_user_ids").val(""),$("#comments_of_daily_report_reply_number").val(e.data("number")),$("#js_comment_label").text(">"+e.data("number")+I18n.t("js.daily_reports.reply_to")),$("#js_comment_label_box").show()}),$(".js_comment_reply_all").on("click",function(){var e=$(this).parent().prevAll(".comment_data"),t=e.data("to-user-ids");t.unshift(e.data("user-id")),t=$.unique(t),$("#comment_to_user_ids").val(t).trigger("change"),$("#comment_to_user_ids").val(""),$("#comments_of_daily_report_reply_number").val(e.data("number")),$("#js_comment_label").text(">"+e.data("number")+I18n.t("js.daily_reports.reply_to")),$("#js_comment_label_box").show()}),$("#js_comment_label_delete").on("click",function(){$("#js_comment_label_box").hide(),$("#comments_of_daily_report_reply_number").val("")});var t=null,e=$(".js_comment_link");e.on("shown.bs.popover",function(){var e=$(this).attr("aria-describedby");0!==(t=$("#"+e).find("input")).size&&(t.select(),t.on("click focus",function(){t.select()}))}),e.on("hide.bs.popover",function(){t instanceof jQuery&&t.off()}),$(".js_disable_submit").on("click",function(){$(".js_disable_submit").prop("disabled",!0),$(".new_comments_of_daily_report").submit()})},set_leads_select_width:function(e){$(e).on("ajax:success",function(){$("#lead_ids").select2({width:"100%"})})},change_client_temporary_business_card_form:function(){$("#client_temporary_business_card_id").on("change",function(){$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$(this).val()&&$("#daily_report_client_id").select2("val","").trigger("change")})},change_lead_temporary_business_card_form:function(){$("#lead_temporary_business_card_id").on("change",function(){$("#temporary_business_card_item_id").val(""),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit()});var e=$("#daily_report_index_items_type_lead_ids").val().split(" ");$.each(e,function(e,t){$("#"+t+"_temporary_business_card_id").on("change",function(){$("#temporary_business_card_item_id").val(t),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit()})})},update_end_visit_on:function(){$("#daily_report_visit_on_date,#daily_report_visit_on_time").on("change",function(){var e=$("#daily_report_visit_on_date").val(),t=$("#daily_report_visit_on_time").val();""!==e&&""===t&&"daily_report_visit_on_time"!==$(this).attr("id")&&($("#daily_report_visit_on_time").val("00:00"),t="00:00");var n=moment(e+" "+t);if(n.isValid()){var i=n.add(1,"hours");$("#daily_report_end_visit_on_date").val(i.format("YYYY/MM/DD")),$("#daily_report_end_visit_on_time").val(i.format("HH:mm")),$(".search_datepicker").datepicker("update")}})},set_client_id:function(){$("#lead_ids").data("clientId",$("#daily_report_client_id").val()),$("#daily_report_client_id").on("change",function(){$("#lead_ids").data("clientId",$(this).val());var e=$("#daily_report_index_items_type_lead_ids").val().split(" ");$.each(e,function(e,t){$("#item_values_"+t).data("clientId",$("#daily_report_client_id").val())})})},click_select_client:function(){$("#open-associated-client").on("click",function(){App.concerns.select_search_name("daily_report_client_id"),App.concerns.set_associate_entity_to_s2("#daily_report_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#daily_report_client_id","#client_temporary_business_card_id","single","#daily_report_client_id","show"),localStorage.setItem("client_onclick","#daily_report_client_id")})},show_edit_deals:function(){$("#edit_deals").on("shown.bs.modal",function(){App.concerns.change_order("form_xhr_edit_deals_modal_order")}).modal("show"),this.deals_radio_check()},edit_deals_modal_submit:function(){$("#edit_deals_modal_submit_btn").on("click",function(e){e.preventDefault();var t=$("input[name=deal_select]:checked"),i={lead:[],client:null};t.parents(".js-selected-deal-box").find("input:checked").each(function(e,t){if("deal_select"!==t.name){var n=$(t).data("type");"lead"===n?i[n].push($(t).val()):"client"===n&&(i[n]=$(t).val())}});var n=$("#edit_deal_modal_form_tag");n.find("#lead_ids").val(i.lead.join(",")),n.find("#client_id").val(i.client),n.attr("action",t.data("action")),n.attr("method",t.data("method")),n.submit()})},init_form_from_another_controller:function(e){this.add_name(),this.submit_new(),this.submit_new_next(),this.change_edit_deal(),this.change_client_form(),this.display_swith_roles_select(),this.set_client_id(),this.initializeDealsDetailFields(),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.timepicker(".search_timepicker"),App.concerns.select_search_name("daily_report_client_id"),App.concerns.set_client_branch_form("daily_report_client_id"),App.concerns.select_search("daily_report_user_id"),App.concerns.select_search("deal_ids"),App.concerns.select_search("daily_report_campaign_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("confirmation_user_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search("accompany_user_ids"),App.concerns.set_tooltip_to_select_search_client("daily_report_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),this.set_data_to_confirmation_users(),$("#next_support_kbn_ids").select2({width:"100%"}),$("#js_select_role_ids select").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),$("#form_search_xhr_client_branches_select_options").submit(),App.front_segments.set_segment_select2("#daily_report_segment_id"),App.front_segments.change_segment_icon("#daily_report_segment_id"),App.concerns.change_display_template(),App.concerns.set_associate_entity_to_s2("#daily_report_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#deal_ids",'input[name="associate_deals[]"]',"deals"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),$(document).off("click","#open-associated-client"),$(document).off("click","#open-associated-lead"),$(document).off("click","#open-associated-deal"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#daily_report_client_id","#client_temporary_business_card_id","single","#daily_report_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#daily_report_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#deal_ids","multiple","#daily_report_client_id",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),this.update_end_visit_on(),e?(App.concerns.restore_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_daily_report"),App.concerns.create_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_daily_report")):(App.concerns.restore_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val(),null,null,null,"form.new_daily_report"),App.concerns.create_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val(),null,null,null,"form.new_daily_report")),this.set_select_item_type_lead()},attach_add_or_edit_relation_handles:function(){var n=function(t,n){var i=this;$.ajax({url:n.data("href"),dataType:"html",data:n.data("params")}).done(function(e){t.html(e),t.find(".hidden-xs").addClass("hidden-xs-on-modal"),t.off("shown.bs.modal"),t.off("hidden.bs.modal"),t.on("shown.bs.modal",function(){t.scrollTop(0),$(document).find(".modal-open")[0]&&($(".modal-backdrop").css("z-index",1020),t.css("z-index",1035)),n.trigger("load_modal",i)}).on("hidden.bs.modal",function(){t.empty()}).modal("show")})},i=function(a,n,s,o){var t=$(".modal-open"),i=!1;n.attr("format","json"),n.data("remote",!0),n.on("submit",function(){$("#modal_error_message").empty(),"json"===n.attr("format")?(i=!0,n.append('<input name="format" type="hidden" value="json">')):i=!1}),n.find(".js_modal_search_users_caller_btn").on("click",function(){$(".modal-backdrop").last().css("z-index",1030)}),n.find(".item_datepicker").datepicker(),a.find(o).off("click"),a.find(o).on("click",function(e){e.preventDefault(),$("#modal_error_message").empty();var t=new FormData($(n).get(0));return t.append("format","json"),$.ajax($(n).attr("action"),{type:"post",processData:!1,contentType:!1,data:t}).done(function(e){if("error"===e.status)""===e.message&&"deal"===s?$("#js_select_change_display_template option").last().attr("selected","selected").trigger("change"):$("#modal_error_message").html(e.message);else if(a.modal("hide"),"deal"===s){var t=$("#related_deals").data("id"),n=$("#related_deals").data("pagenator-id"),i=$("#related_deals").data("display-template-id");"#new_submit"===o?App.concerns.destroy_automatically_save("auto_saved_deals_new",$("#current_user_id").val()):"#edit_submit"===o&&App.concerns.destroy_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null),$.ajax({url:"/xhr/daily_reports/"+t+"/load_related_deals",type:"GET",dataType:"script",data:{pagination_id:n,display_template_id:i}})}else if("task"===s){t=$("#related_tasks").data("id"),n=$("#related_tasks").data("pagenator-id"),i=$("#related_tasks").data("display-template-id");$.ajax({url:"/xhr/daily_reports/"+t+"/load_related_tasks",type:"GET",dataType:"script",data:{pagination_id:n,display_template_id:i}})}}),!1}),n.on("ajax:success",function(e){i&&n.find('input[name="format"]').remove(),e.target!==this&&($("#search-associated-resources-modal, #modal_block_for_search_users").on("hidden.bs.modal",function(){t.addClass("modal-open")}),$("#search-associated-resources-modal").on("hidden.bs.modal",function(){var e=1030;$(".modal-backdrop").each(function(){$(this).css("z-index",e),e+=5})}),$("#search-overlay-associated-resources-modal").on("hidden.bs.modal",function(){var e=1040;$(".modal-backdrop").each(function(){$(this).css("z-index",e),e+=5})}))})},a=function(n,i){var e=$("#js_form_change_display_template");e.attr("action",i.data("href")),e.data("remote",!0),e.on("ajax:success",function(e,t){n.html(t),n.find(".hidden-xs").addClass("hidden-xs-on-modal"),i.trigger("load_modal")})},s=function(){["#open-associated-client","#open-associated-daily-report","#open-associated-deal","#open-associated-lead","#daily_report_client_id","#client_temporary_business_card_id","#leads_multiple_decision","#deals_multiple_decision","#deal_client_id"].forEach(function(e){$(document).off("click",e)})};$(document).on("click",'[data-hp-role="add_information"],[data-hp-role="edit_information"]',function(e){e.preventDefault();var t=$("#modalContainer");return n(t,$(this)),!1}),$(document).on("load_modal",'[data-hp-role="add_information"][data-hp-target="deal"]',function(){s();var e=$("#modalContainer");a(e,$(this)),App.front_deals.init_form_from_another_controller(!1),i(e,$("#new_deal"),"deal","#new_submit"),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block")}),$(document).on("load_modal",'[data-hp-role="edit_information"][data-hp-target="deal"]',function(){s();var e=$("#modalContainer"),t=$(".edit_deal");a(e,$(this)),App.front_deals.init_form_from_another_controller(!0),i(e,t,"deal","#edit_submit"),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.init("#deal_client_branch_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block")}),$(document).on("load_modal",'[data-hp-role="add_information"][data-hp-target="task"]',function(){s();var e=$("#modalContainer"),t=$("#new_task");App.front_tasks.init_form_from_another_controller(!0),e.find('a[href="/tasks/"]').parent().hide(),i(e,t,"task","#new_submit")}),$(document).on("load_modal",
'[data-hp-role="edit_information"][data-hp-target="task"]',function(){s();var e=$("#modalContainer"),t=$(".edit_task");App.front_tasks.init_form_from_another_controller(!0),e.find('a[href="/tasks/"]').parent().hide(),i(e,t,"task","#edit_submit")})},delete_deal_edit_modal:function(){$(".add_related_deal").on("click",function(){$("#edit_deals").remove()})},load_split_index:function(e){rowIndex++;var t=rows[rowIndex],n=$("#pagination_id").val();xhrDailyReportIds=$(t).data("xhr-daily-report-ids"),$.ajax({url:"/xhr/daily_reports/load_split_index",type:"GET",dataType:"html",data:{ids:xhrDailyReportIds,pagination_id:n}}).done(function(e){$(t).replaceWith(e),$(document).trigger("floatTableUpdate")}).fail(function(){$(t).html("")}).always(function(){rowIndex<rows.length-2?App.front_daily_reports.load_split_index(e):e.resolve()}).error(function(e){401==e.status&&(session_error_message_flg||(alert(I18n.t("js.daily_reports.session_error")),session_error_message_flg=!0))})},load_split_show_picture:function(e,t){Index++;var n=Pictures[Index];xhrTemporaryBusinessCardIds=$(n).data("xhr-temporary_business-card-ids"),$.ajax({url:"/xhr/daily_reports/load_split_temporary_picture",type:"GET",dataType:"html",data:{ids:xhrTemporaryBusinessCardIds,edit_flg:t}}).done(function(e){$(n).replaceWith(e),$(document).trigger("floatTableUpdate")}).fail(function(){$(n).html("")}).always(function(){Index<Pictures.length-1?App.front_daily_reports.load_split_show_picture(e,t):e.resolve()})},change_open_status_all:function(){""!==$("#js_open_status").data("open-status")&&$("#js_open_status option:first").val($("#js_open_status").data("open-status"))},deals_radio_check:function(){$("#edit_deals_selectable_table").find("input[id^='deal_select_']:first").prop("checked",!0)},change_button_actibity_by_role:function(){$(document).on("click","#all-check,.check-items",function(){var e=$(".check-items:checked"),t=e.closest("tr").find("td:last").length!=e.closest("tr").find("td:last a").not("[disabled='disabled']").length;$(".btn-activity-by-department-role").prop({disabled:t});var n=$(".data-original-title-by-activity"),i=n.attr(t?"data-disabled-title":"data-enabled-title");n.attr("data-original-title",i)})},update_ui_textarea_template_form:function(){null!==document.getElementById("lead_ids")&&$("#lead_ids").closest("div.col-xs-12")[0].insertAdjacentHTML("beforeend",""),null!==document.getElementById("daily_report_description")&&$("#daily_report_description").closest("div.col-xs-12")[0].insertAdjacentHTML("beforeend",""),null!==document.getElementById("accompany_user_ids")&&($("#accompany_user_ids").closest("div.col-xs-12")[0].insertAdjacentHTML("beforeend",""),$("#confirmation_users_daily_reports").closest(".table").find("th").addClass("border-top-custom"),$("#confirmation_users_daily_reports").closest(".table").find("td").addClass("border-top-custom")),$("#daily_report_attribute_name_client_id").closest(".table").find("th").addClass("border-top-custom"),$("#daily_report_attribute_name_client_id").closest(".table").find("td").addClass("border-top-custom"),$("#search_user_ids").closest(".table").find("th").addClass("border-top-custom"),$("#search_user_ids").closest(".table").find("td").addClass("border-top-custom")},hide_detail_info:function(){0==$("#detail_info .fields:visible").length&&($("#detail_info").addClass("hidden"),$("#no-product").removeClass("hidden"))},init_select_roles:function(t){$(t).select2({width:"100%"}),$("#add_user_role").on("click",function(){$.ajax({url:"/xhr/users/user_role_all/",type:"POST",data:{user_role_ids:$(t).val()},dataType:"json",context:$(this)}).done(function(e){0<e.role_user_ids.length&&($(t).select2("data",e.role_user_ids),$(t).select2("open"),$(t).select2("close"))})})},confirmation_user_dialog:function(){var e=function(){if("block"===$(".confirmation-user-information > .user-information-show").css("display"))return $(".confirmation-user-information > .user-information-show").hide(),!1;var e=$(this).data("user-id"),t=$(this).offset().top,n=$(this).offset().left+$(this).width()/2;t=$("#search-overlay-associated-resources-modal").scrollTop()+t,$("#confirmation_position_top").val(t),$("#confirmation_position_left").val(n),$("#confirmation-user-information-form").attr("action","/xhr/user_communications/user_information_show/"+e),$("#confirmation-user-information-form").submit()};$(document).off("click",".confirmation_users_dialog"),$(document).on("click",".confirmation_users_dialog",e),$(window).on("click",function(e){0<!$(e.target).closest(".confirmation-user-information > .user-information-show").length&&"block"===$(".confirmation-user-information > .user-information-show").css("display")&&$(".confirmation-user-information > .user-information-show").hide()})}},App.front_dashboards={show:function(){App.front_home.init_grid_stack(!0),App.front_home.init_clipboard()}},App.front_deals={DEALS_DETAILS_LIMIT:9999999999999,DEALS_DETAILS_COPY_LIMIT:Number.POSITIVE_INFINITY,DEALS_DETAILS_DELETE_LIMIT:Number.POSITIVE_INFINITY,DEALS_MAX_NUMBER:9999999999999,DEALS_MIN_NUMBER:-999999999999,DEAL_STATUS_ORDERED:"2",index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#btn-clear-form"),App.concerns.disable_duplicate_request_search_form("#form_search_deals",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("deals"),this.set_index(),this.change_button_actibity_by_role(),this.all_checked_items_modal_deals_index(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");this.summary_table_collapse(),this.tenkai_syukusyo(),this.load_summary_table(),this.order_summary_table(),this.change_deals_stage(),App.concerns.clipboard_copy("#invisible_number"),this.get_invsible_number(),App.tooltip.display_tooltip(),$(".stepable-record-field-modal-link").on("click",function(){$(".stepable_record_field_modal").find(".user_information").attr("stepable-record-field-page-scroll-top",$(document).scrollTop())}),App.concerns.add_class_name_to_tooltip($(".department-span"),"department-tooltip");var e="deals";App.front_recommend.recommendScenarios(e),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),$("#search_submit, #simple-search-submit-btn").click(function(){$("#portlet_id").val(""),$("#chart_segment_type").val(""),$("#chart_segment_ids").val(""),$("#is_others").val(""),$("#is_nil_segment_value_included").val("")}),$("#simple-search-submit-btn").click(function(){$("#from_orders_date_on_txt").val(""),$("#to_orders_date_on_txt").val("")})},inheritance_index:function(){this.set_index(),this.change_button_actibity_by_role(),this.all_checked_items_modal_deals_index(),this.tenkai_syukusyo(),this.load_summary_table(),this.order_summary_table(),this.change_deals_stage(),App.concerns.clipboard_copy("#invisible_number"),this.get_invsible_number()},show:function(){$(document).on("shown.bs.modal","#modalContainer",function(){App.front_deals.sync_height_table_auto_calculate()}),$(document).on("ajax:complete","#modalContainer",function(){App.front_deals.sync_height_table_auto_calculate()}),App.concerns.load_pictures(this),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_task_submit",!0),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_daily_report_submit",!0),App.concerns.change_display_template(),App.concerns.set_form_action_to_submit("#js_copy_deal_submit","#js_copy_deal",!0),App.concerns.open_mailer(),App.concerns.select_search("comment_to_user_ids");new Clipboard(".clipboard-btn");if(this.attach_add_or_edit_relation_handles(),this.setup_comments(),Dealsheets.init($("#deal-show")),$(function(){var e=$("#comments_panel"),t=($("#detail_box"),e.prev().children(".row").height());if(0<$("#comments").find("#deals_lead_role").size()){$(".lead-item").height();e.css("height",t).css("max-height",400)}else e.css("height",t).css("max-height",t);var n=$("#comments"),i=(location.search.split("?").find(function(e){e.split("=")[0]})||"").split("=")[1];i&&n.scrollTop($("#comment-"+i).position().top-120)}),$("#js_submit_end_sales").on("click",function(e){e.preventDefault();var t=$(this).data().confirmMessage;if(!confirm(t))return!1;var n=$("#id").val(),i=$(this).data().action,a=$(this).data().method;$.ajax({type:a,url:i,data:{id:n}})}),$(".campaign-add-modal-button").on("click",function(){var e=$(document).scrollTop();$(this).data().params.page_scroll_top=e}),$("#modalContainer").on("hidden.bs.modal",function(){$("#page_scroll_top").remove()}),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),$("#status_kbn").attr("data-status-kbn-search-group")==App.front_deals.DEAL_STATUS_ORDERED){var e=window.location.pathname.split("/")[4],t="deal_detail";App.front_recommend.recommendScenarios(t,e)}App.concerns.toggle_print_target()},"new":function(){this.submit_new(),this.submit_new_next(),this.change_client_form(),this.initializeDealsDetailFields(),this.set_client_id(),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search_name("deal_client_id"),App.concerns.set_client_branch_form("deal_client_id"),App.concerns.select_search("deal_user_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("deal_campaign_id"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("reapproach_user_ids"),App.concerns.select_search("deal_business_activity_id"),App.concerns.set_tooltip_to_select_search_client("deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),$("#next_action_kbn_ids").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),App.concerns.change_order("form_search_product"),App.concerns.change_display_template(),App.concerns.all_checked_items(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");this.setFormActionToSubmitForAjaxAdd("form.new_deal","#js_add_contract_period_submit"),this.setFormActionToSubmitForAjax("form.new_deal","#js_destroy_contracts_submit"),this.setFormActionToSubmitForAjax("form.new_deals_detail","#js_updates_contract_submit"),App.concerns.set_associate_entity_to_s2("#deal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#deal_client_id","#client_temporary_business_card_id","single","#deal_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id","show",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block"),App.concerns.focus_to_first_element(),$(window).on("load",function(){App.concerns.load_pictures(App.front_deals,!0)}),App.concerns.restore_automatically_save("auto_saved_deals_new",$("#current_user_id").val(),null,null,null,"form.new_deal"),App.concerns.create_automatically_save("auto_saved_deals_new",$("#current_user_id").val(),null,null,null,"form.new_deal"),this.change_deals_stage(),App.front_segments.set_segment_select2("#deal_segment_id"),App.front_segments.change_segment_icon("#deal_segment_id"),this.update_ui_textarea_deal_template_form(),this.setup_events_for_batch_operation(),App.front_daily_reports.set_select_item_type_lead("#deal_index_items_type_lead_ids")},new_from_another_controller:function(){App.front_deals.all_checked_items_modal_deals_index(),this.submit_new(),this.submit_new_next(),this.change_client_form(),this.initializeDealsDetailFields(),this.set_client_id(),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search_name("deal_client_id"),App.concerns.set_client_branch_form("deal_client_id"),App.concerns.select_search("deal_user_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("deal_campaign_id"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("reapproach_user_ids"),App.concerns.select_search("deal_business_activity_id"),App.concerns.set_tooltip_to_select_search_client("deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),$("#next_action_kbn_ids").select2({width:"100%"}),$("#form_search_xhr_client_branches_select_options").submit(),App.concerns.change_display_template(),App.concerns.all_checked_items(),this.setFormActionToSubmitForAjaxAdd("form.new_deal","#js_add_contract_period_submit"),this.setFormActionToSubmitForAjax("form.new_deal","#js_destroy_contracts_submit"),this.setFormActionToSubmitForAjax("form.new_deals_detail","#js_updates_contract_submit"),App.concerns.set_associate_entity_to_s2("#deal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#deal_client_id","#client_temporary_business_card_id","single","#deal_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id","show",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.init("#deal_client_branch_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block"),App.concerns.focus_to_first_element(),$(window).on("load",function(){App.concerns.load_pictures(App.front_deals,!0)}),App.concerns.restore_automatically_save("auto_saved_deals_new",$("#current_user_id").val(),null,null,null,"form.new_deal"),App.concerns.create_automatically_save("auto_saved_deals_new",$("#current_user_id").val(),null,null,null,"form.new_deal"),App.front_segments.set_segment_select2("#deal_segment_id"),App.front_segments.change_segment_icon("#deal_segment_id"),this.setup_events_for_batch_operation(),this.init_sum_gross(),App.front_deals.sync_height_table_auto_calculate(),App.front_daily_reports.set_select_item_type_lead("#deal_index_items_type_lead_ids")},create:function(){this.submit_new(),this.submit_new_next(),this.change_client_form(),this.initializeDealsDetailFields(),this.set_client_id(),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search_name("deal_client_id"),App.concerns.select_search("deal_user_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("deal_campaign_id"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("reapproach_user_ids"),App.concerns.select_search("deal_business_activity_id"),App.concerns.set_tooltip_to_select_search_client("deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),$("#next_action_kbn_ids").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),$("#form_search_xhr_client_branches_select_options").submit(),App.concerns.change_display_template(),App.concerns.all_checked_items(),this.setFormActionToSubmitForAjaxAdd("form.new_deal","#js_add_contract_period_submit"),this.setFormActionToSubmitForAjax("form.new_deal","#js_destroy_contracts_submit"),this.setFormActionToSubmitForAjax("form.new_deals_detail","#js_updates_contract_submit"),App.concerns.set_associate_entity_to_s2("#deal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#deal_client_id","#client_temporary_business_card_id","single","#deal_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id","show",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.init("#deal_client_branch_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block"),App.concerns.focus_to_first_element(),this.change_deals_stage(),App.front_segments.set_segment_select2("#deal_segment_id"),App.front_segments.change_segment_icon("#deal_segment_id"),this.update_ui_textarea_deal_template_form(),this.setup_events_for_batch_operation(),App.front_deals.sync_height_table_auto_calculate(),App.front_daily_reports.set_select_item_type_lead("#deal_index_items_type_lead_ids")},edit:function(){this.submit_edit(),this.submit_edit_next(),this.change_client_form(),this.initializeDealsDetailFields(),this.set_client_id(),this.click_select_client(),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search_name("deal_client_id"),App.concerns.set_client_branch_form("deal_client_id"),App.concerns.select_search("deal_user_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("deal_campaign_id"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("reapproach_user_ids"),App.concerns.select_search("deal_business_activity_id"),App.concerns.set_tooltip_to_select_search_client("deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),$("#next_action_kbn_ids").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),App.concerns.hide_item_file_options(),App.concerns.change_display_template(),App.concerns.all_checked_items(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");this.setFormActionToSubmitForAjaxAdd("form.edit_deal","#js_add_contract_period_submit"),this.setFormActionToSubmitForAjax("form.edit_deal","#js_destroy_contracts_submit"),this.setFormActionToSubmitForAjax("form.new_deals_detail","#js_updates_contract_submit"),App.concerns.set_associate_entity_to_s2("#deal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#deal_client_id","#client_temporary_business_card_id","single","#deal_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id","show",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.init("#deal_client_branch_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block"),$(window).on("load",function(){App.concerns.load_pictures(App.front_deals,!0)}),App.concerns.restore_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_deal"),App.concerns.create_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_deal"),this.change_deals_stage(),App.front_segments.set_segment_select2("#deal_segment_id"),App.front_segments.change_segment_icon("#deal_segment_id"),this.update_ui_textarea_deal_template_form(),this.setup_events_for_batch_operation(),App.front_deals.sync_height_table_auto_calculate(),App.front_daily_reports.set_select_item_type_lead("#deal_index_items_type_lead_ids")},update:function(){this.submit_edit(),this.submit_edit_next(),this.change_client_form(),this.initializeDealsDetailFields(),this.set_client_id(),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search_name("deal_client_id"),App.concerns.select_search("deal_user_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("deal_campaign_id"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("reapproach_user_ids"),App.concerns.select_search("deal_business_activity_id"),App.concerns.set_tooltip_to_select_search_client("deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),$("#next_action_kbn_ids").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),$("#form_search_xhr_client_branches_select_options").submit(),App.concerns.hide_item_file_options(),App.concerns.change_display_template(),App.concerns.all_checked_items(),this.setFormActionToSubmitForAjaxAdd("form.edit_deal","#js_add_contract_period_submit"),this.setFormActionToSubmitForAjax("form.edit_deal","#js_destroy_contracts_submit"),this.setFormActionToSubmitForAjax("form.new_deals_detail","#js_updates_contract_submit"),App.concerns.set_associate_entity_to_s2("#deal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#deal_client_id","#client_temporary_business_card_id","single","#deal_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id","show",$("#unlink_clients_flg").val()),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.init("#deal_client_branch_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block"),this.change_deals_stage(),App.front_segments.set_segment_select2("#deal_segment_id"),App.front_segments.change_segment_icon("#deal_segment_id"),this.update_ui_textarea_deal_template_form(),this.setup_events_for_batch_operation(),App.front_deals.sync_height_table_auto_calculate(),App.front_daily_reports.set_select_item_type_lead("#deal_index_items_type_lead_ids")},makeSubmitFunction:function(e,t,n){var i=this;return function(){e.on("click",function(){$(this).attr("disabled",!0),$('[data-hp-role="deals-details-fields-for"]').find("tr").filter(i.withoutDestroy()).each(function(e){$(this).find('[name$="[sort_order]"]').val(e)}),n&&n.appendTo(t),t.submit()})}},summary_table_collapse:function(){$(".activity-collapse-link").on("click",function(){$(this).hasClass("in")?($(this).removeClass("in"),$(this).addClass("collapsed")):($(this).removeClass("collapsed"),$(this).addClass("in"))})},tenkai_syukusyo:function(){$(document).on("click",".open-close-icon",function(){App.front_deals.tenkai_syukusyo_sub(this,400,200)}),$(".all-open").on("click",function(e){e.preventDefault(),$(".fa-plus-square-o").addClass("fa-minus-square-o"),$(".fa-plus-square-o").removeClass("fa-plus-square-o"),$(".table-row").show(),$(".table-row .target").show()}),$(".all-close").on("click",function(e){e.preventDefault(),$(".deals_sum_table th").eq(1).hasClass("order_head")||($(".fa-minus-square-o").addClass("fa-plus-square-o"),$(".fa-minus-square-o").removeClass("fa-minus-square-o"),$(".table-row").hide(),$(".table-row").find(".target").hide(),$(".table-row").each(function(){var e=$(this).children().eq(0);0==$(e).find(".open-close-icon").length||($(this).show(),$(this).find(".target").each(function(){$(this).show()}))}))})},tenkai_syukusyo_sub:function(e,t,n){$(e).hasClass("fa-plus-square-o")?($(e).removeClass("fa-plus-square-o"),$(e).addClass("fa-minus-square-o"),App.front_deals.tenkai_function(e,t)):($(e).removeClass("fa-minus-square-o"),$(e).addClass("fa-plus-square-o"),App.front_deals.syukusyo_function(e,n))},tenkai_function:function(e,t){var n=$(e).parent().parent(),i=$(n).index(),a=$(n).parent().next(),s=!0;if(n=$(a).children().eq(i+1),!$(n).find(".open-close-icon").hasClass("fa")){for(s=!0;s;){this.tenkai_sub_function(a,t);for(var o=0;o<i+1;o++)if(span=$(a).next().children().eq(o).find(".open-close-icon"),span.hasClass("fa")||0==$(a).length){s=!1;break}a=$(a).next()}return!0}for(;s;){if(n=$(a).children().eq(i+1),span=$(n).find(".open-close-icon"),span.hasClass("fa"))this.tenkai_sub_function(a,t);else{if(0==$(a).length){s=!1;break}for(o=0;o<i+1;o++)if(span=$(a).next().children().eq(o).find(".open-close-icon"),span.hasClass("fa")){s=!1;break}}if(a=$(a).next(),0==$(a).length){s=!1;break}}},tenkai_sub_function:function(e,t){$.when($(e).show(),$(e).find(".target").each(function(){$(this).fadeIn(t)})).done(function(){})},syukusyo_function:function(e,t){for(var n=$(e).parent().parent(),i=$(n).index(),a=$(n).parent().next(),s=!0;s;){if(n=$(a).children().eq(i),$(n).hasClass("deal-col-sum")||0==$(a).length){s=!1;break}$(a).find(".target").each(function(){var e=$(this).find(".open-close-icon");e.hasClass("fa")&&(e.removeClass("fa-minus-square-o"),e.addClass("fa-plus-square-o")),$(this).fadeOut(t)}),$(a).hide(),a=$(a).next()}},load_summary_table:function(){$("#overlay").fadeIn(300),window.onload=function(){App.front_deals.submit_summary_form()}},sync_height_table_auto_calculate:function(){$(".item_calculate").height($(".deal-details_table-scroll-full .fields:visible").first().height())},submit_summary_form:function(){var e=$("#load_deals_summary_table");$.ajax({url:e.attr("action"),type:e.attr("method"),data:e.serialize(),timeout:12e4}).done(function(){App.front_deals.set_clipboard_val()}).fail(function(e,t){"timeout"==t&&document.getElementById("overlay")&&($("#timeout_summary_table").show(),$("#show_deals_summary_table").hide())})},order_summary_table:function(){$(document).on("click",".deals_sum_table .order_head",function(){var e=$(this).find("span"),t=$(".deals_sum_table .order_head").find("span").not(e);if(t.removeClass("fa-sort-desc"),t.removeClass("fa-sort-asc"),t.addClass("fa-sort"),e.hasClass("fa-sort")){e.removeClass("fa-sort"),e.addClass("fa-sort-asc");var o="asc"}else if(e.hasClass("fa-sort-asc")){e.removeClass("fa-sort-asc"),e.addClass("fa-sort-desc");o="desc"}else if(e.hasClass("fa-sort-desc")){e.removeClass("fa-sort-desc"),e.addClass("fa-sort");o="none"}var r=this.cellIndex,n=[];$(".deals_sum_table tbody tr.first-tr").each(function(){n.push($(this).data("group_count"))});for(var i=Math.max.apply(null,n),a=1;a<=i;a++){$(".deals_sum_table tbody tr."+("group_"+a)).wrapAll("<div id='temporary_tag'></div>>")}$(".deals_sum_table tbody").html($(".deals_sum_table tbody #temporary_tag").sort(function(e,t){var n=$(e).find("td").eq(r).find(".target").text(),i=$(t).find("td").eq(r).find(".target").text();if(0==r){if("desc"==o)return n<i?1:-1;if("asc"==o)return i<n?1:-1;if("none"==o)return $(t).find("tr").data("group_count")<$(e).find("tr").data("group_count")?1:-1}else{var a=Number(n.replace(/[^0-9]/g,"")),s=Number(i.replace(/[^0-9]/g,""));if("desc"==o)return s-a;if("asc"==o)return a-s;if("none"==o)return $(t).find("tr").data("group_count")<$(e).find("tr").data("group_count")?1:-1}})),$(".first-tr").each(function(){$(this).unwrap()})})},copy_clipboard:function(){if(data="",void 0===$("#clipboard_val").val())return!1;data=data+$("#clipboard_val").val()+this.clipboard_get_table_val();var e=$("#copy_clipboard");e.removeClass("fa fa-clipboard"),e.addClass("fa fa-check");var t=function(){e.attr({"data-original-title":I18n.t("js.deals.copied")}),e.tooltip("show")};(function(e){var t=document.createElement("textarea");t.textContent=e;var n=document.getElementsByTagName("body")[0];n.appendChild(t),t.select();var i=document.execCommand("copy");n.removeChild(t)})(data);var n=function(){e.removeClass("fa fa-check"),e.addClass("fa fa-clipboard"),e.tooltip("hide"),e.attr({"data-original-title":I18n.t("js.deals.copy_clipboard")})};setTimeout(t,500),setTimeout(n,1500)},set_clipboard_val:function(){var e="";e=e+'"'+I18n.t("js.deals.search_criteria");var t=$("#search_params_for_clipboard").val().split(" ");""==$("#search_params_for_clipboard").val()&&$("#clipboard_val").val(e);var n="";for(i=0;i<t.length;i++){var a="",s="",o=$("#"+t[i]);if("search_from_orders_date_on"!=t[i]&&"search_to_orders_date_on"!=t[i])if("search_private_flg"!=t[i]&&"search_ing_flg"!=t[i]){if("search_result_factor_file"==t[i]||"search_role_id"==t[i])a=$(o.children()[0]).text(),s=$(o.children("option:selected")).text();else if(o.hasClass(
"select2-offscreen")){var r=o.parent().find(".select2-search-choice");s=[];for(j=0;j<r.length;j++)s.push(jQuery.trim($(r[j]).text()).replace(/\"/g,'""'));s=s.join('"\t"'),a=(a=(a=o.attr("placeholder"))||o.attr("data-placeholder"))||o.attr("data-prompt")}else a=o.attr("placeholder"),s=o.val();void 0!==a&&void 0!==s&&(a=a.replace("-- ","").replace(/(.*) --/,"$1").replace(/\"/g,'""'),t[i].match(/\_from\_/)||t[i].match(/\_gteq\_/)?e=e+'"\r\n"'+a+'"\t":"\t"'+s+" \uff5e ":t[i].match(/\_to\_/)||t[i].match(/\_lteq\_/)?n==a&&e.slice(-3).match(/ \uff5e /)?e+=s:e=e+'"\r\n"'+a+'"\t":"\t" \uff5e '+s:e=e+'"\r\n"'+a+'"\t":"\t"'+s,n=a)}else{if(!(s=jQuery.trim($(o).parent().text())))continue;e=e+'"\r\n"'+s}}var l="";""!==(l=$(".summary_search_date_from_to").text())&&(e=e+'"\r\n"'+I18n.t("js.deals.orders_date_on")+'"\t":"\t"'+l),$("#clipboard_val").val(e)},clipboard_get_table_val:function(){data="";var e=$("#unit_for_clipboard").val();data=data+'"\r\n\r\n"'+I18n.t("js.deals.amount_summary")+'"\r\n';for(var t=$("#show_deals_summary_table tr"),n=[],i=0;i<t.length;i++){for(var a=t.eq(i).children(),s=0,o="",r=!1,l=0;l<a.length;l++){var c='\t"',d='"';0==l&&(c='"'),l==a.length-1&&(d='"\r\n');var u=jQuery.trim(a.eq(l).text()).replace(/\"/g,'""');""!=(u=u.replace(/\/ +[\r\n] +/,""))||t.eq(i-1).children().eq(l).children().hasClass("subtotal")||a.eq(l).hasClass("first-line")?n[l]=u:u=n[l],a.eq(l).hasClass("sum-num")?u=u.replace(e,""):1!==i&&0==r&&(s=l+1),0<a.eq(l).find(".open-close-icon").length&&(r=!0),o=o+c+u+d}0==i&&(s=I18n.t("js.deals.total_category_level")),data=data+'"'+s+'"\t'+o}return data},submit_new:function(){var e=this.makeSubmitFunction($("#new_submit"),$("form.new_deal"));$("#new_submit").on("click",function(){$("#new_next_submit").attr("disabled",!0),App.concerns.destroy_automatically_save("auto_saved_deals_new",$("#current_user_id").val())}),e(),this.change_deals_stage()},submit_new_next:function(){appendParam=$("<input>").attr({type:"hidden",name:"new_next_flg",value:!0});var e=this.makeSubmitFunction($("#new_next_submit"),$("form.new_deal"),appendParam);$("#new_next_submit").on("click",function(){$("#new_submit").attr("disabled",!0),App.concerns.destroy_automatically_save("auto_saved_deals_new",$("#current_user_id").val())}),e()},submit_edit:function(){var e=this.makeSubmitFunction($("#edit_submit"),$("form.edit_deal"));$("#edit_submit").on("click",function(){$("#edit_next_submit").attr("disabled",!0),App.concerns.destroy_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null)}),e(),this.change_deals_stage()},submit_edit_next:function(){appendParam=$("<input>").attr({type:"hidden",name:"edit_next_flg",value:!0});var e=this.makeSubmitFunction($("#edit_next_submit"),$("form.edit_deal"),appendParam);$("#edit_next_submit").on("click",function(){$("#edit_submit").attr("disabled",!0),App.concerns.destroy_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null)}),e()},change_client:function(){$("#deal_client_id").on("change",function(e){$("#business_card_ids").data("clientId",e.val),$("#business_card_ids").select2("val","")})},change_client_form:function(){$("#client_branch_id").val($("#deal_client_branch_id").val()),$("#deal_client_id").on("change",function(){var e=$("#store_client_id").val(),t=$(this).val();$(".client_id").val(t),$("#js_client_id").val(t),e===t?$("#client_branch_id").val($("#deal_client_branch_id").val()):$("#client_branch_id").val(""),$('[name="deal[client_branch_id]"]').val(""),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_business_cards_select_options").submit(),t&&$("#client_temporary_business_card_id").val("").trigger("change"),$("#client_branch_block").trigger("change"),$(".tooltip").tooltip("hide")})},set_index:function(){App.concerns.change_display_number("form_search_deals"),App.concerns.change_order("form_search_deals"),App.concerns.datepicker(".search_datepicker"),$(document).on("click",".js_clear_submit",function(e){e.preventDefault(),$(this).prop("disabled",!0);var t=$(this).data("search-clear-flg");$("#search_clear_flg").val(t),$("#form_search_deals").submit()}),App.concerns.set_form_action_to_submit("#form_checked_tasks",".checked_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_tasks",".js_open_modal_update_all",!0),$("#search_status_kbn_ids").select2(),$("#search_product_type_ids").select2(),$("#search_chance_kbn_ids").select2(),$("#search_next_action_kbn_ids").select2(),$("#search_configs_deals_details_product_name_ids").select2(),$("#search_configs_deals_details_product_type_ids").select2(),$("#search_display_template_ids").select2(),$('select[id^="search_select_detail_item_"]').each(function(){$(this).select2()}),$("#search_result_factor_ids").select2(),App.front_segments.set_segment_select2("#search_segment_ids"),App.concerns.select_search("search_client_id"),App.concerns.select_search_disable_user("search_user_ids"),App.concerns.select_search("search_lead_ids"),App.concerns.select_search_disable_user("search_mail_user_ids"),App.concerns.select_search("campaign_ids"),App.concerns.select_search_disable_user("search_reapproach_users"),App.concerns.select_search("reapproach_user_ids"),App.concerns.select_search("business_activity_id"),App.concerns.select_search("sale_approach_id"),App.concerns.select_search("web_form_ids"),App.concerns.select_search("search_client_name_from_deal_for_lead_ids"),App.front_segments.set_segment_select2("#search_segment_ids"),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids","","","",!0),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),App.concerns.enable_csv_export_event("#form_search_deals","checked[deal_ids][]"),App.concerns.set_item_id(),App.visible_fields.setup_list_visible_setting(["title","client","lead_id","chance_kbn_id","status_kbn_id"],"table.table-float-head"),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.change_search_type(),this.search_type_tab_workflow(),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),App.concerns.change_display_template(),$(document).on("click",".js_submit_report",function(e){e.preventDefault();var t=$("#form_search_deals").attr("action"),n=$(this).data("report-id");$("#js_report_id").val(n),$("#form_search_deals").attr("action",this.href),$("#form_search_deals").submit(),$("#form_search_deals").attr("action",t),$("#js_report_id").val("")}),App.concerns.all_checked_items(),App.concerns.get_modal_to_search_save("#form_search_deals"),App.concerns.get_modal_to_search_call("#form_search_deals"),App.concerns.request_search_call(),App.searches.callForSearchCondition.init(),$("#bulk_deal_next_action_kbn_ids").select2({width:"100%"}),App.concerns.select_search("bulk_deal_user_id"),App.concerns.select_search("bulk_deal_campaign_id"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#search_lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#search_lead_ids","multiple","#deal_client_id","show",$("#unlink_clients_flg").val()),App.concerns.check_form_input("#myModal","#bulk_update"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision_from_open-associated-lead-client","#search_client_name_from_deal_for_lead_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-lead-client","/xhr/clients/search_modal","#search_client_name_from_deal_for_lead_ids","multiple","#search_client_name_from_deal_for_lead_ids","","open-associated-lead-client"),App.concerns.select_search("search_client_deal"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision_from_open-associated-client-deal","#search_client_deal",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client-deal","/xhr/clients/search_modal","#search_client_deal","multiple","#search_client_deal","","open-associated-client-deal","",!0),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),App.concerns.focus_to_first_element(),App.front_display_templates.lateral_move_option(".modal-summary-display-templates .js_lateral_move_button_block"),App.front_display_templates.vertical_move_option(".modal-summary-display-templates .js_vertical_move_button_block"),App.front_daily_reports.set_select_item_type_lead_index("#deal_index_items_type_lead_ids")},withoutDestroy:function(t){return t===undefined&&(t=function(e){return e}),function(){var e=t($(this)).find('[name$="[_destroy]"]').val();return!e||"false"===e}},withDestroy:function(t){return t===undefined&&(t=function(e){return e}),function(){var e=t($(this)).find('[name$="[_destroy]"]').val();return e&&"false"!==e}},aggregate:function(e){return e.filter(this.withoutDestroy(function(e){return e.parents("tr")})).toArray().reduce(function(e,t){return e+(parseInt($(t).val().replace(/,/g,""))||0)},0)},attach_click_on_datepicker:function(e){var t={format:"YYYY/MM/DD hh:mm"};e.find(".details_datepicker").one("click",function(){$(this).attr(t),$(this).datepicker({language:"ja"}),$(this).find(".fa-calendar").trigger("click")})},initializeDealsDetailFields:function(){function i(e){return Number(e)>r.DEALS_MAX_NUMBER?r.DEALS_MAX_NUMBER:Number(e)<r.DEALS_MIN_NUMBER?r.DEALS_MIN_NUMBER:e}var r=this;"true"==$("#table_form_deal").attr("data-detail_master_flg")&&($("tbody .fields").filter(r.withDestroy()).each(function(){var e=$('[data-hp-role="deals-details-fields-for"] tr').index(this);$(".item_calculate").eq(e).css("display","none"),$(this).find(".check-items-deals-details-box").siblings(".remove_deals_details").click()}),"edit"!=$("body").data("action_name")&&App.front_deals.sum_gross()),r.attach_click_on_datepicker($(document)),$(document).off("click",'[data-hp-role="deals-details-up"]'),$(document).on("click",'[data-hp-role="deals-details-up"]',function(){var e=$(this).parents("tr");if(e.prevAll().filter(r.withoutDestroy()).first().length){var t=e.parents("tbody").find("tr").index(e),n=$(".item_calculate").eq(t);n.prevAll().filter(function(e,t){return"none"!=t.style.display}).first().before(n)}e.prevAll().filter(r.withoutDestroy()).first().before(e)}),$(document).on("click","#modal_use_master_product",function(){$("#submit_search_product").click(),0<$("#hidden-input-trigger-for-approach").length&&$("html,#selected_option_modal").animate({scrollTop:0},100)}),$(document).off("click",'[data-hp-role="deals-details-down"]'),$(document).on("click",'[data-hp-role="deals-details-down"]',function(){var e=$(this).parents("tr");if(e.nextAll().filter(r.withoutDestroy()).first().length){var t=e.parents("tbody").find("tr").index(e),n=$(".item_calculate").eq(t);n.nextAll().filter(function(e,t){return"none"!=t.style.display}).first().after(n)}e.nextAll().filter(r.withoutDestroy()).first().after(e)}),$(document).off("click",'[data-hp-role="deals-details-aggregate"]'),$(document).on("click",'[data-hp-role="deals-details-aggregate"]',function(){if($(this).data("useDetailMasters")){var a=0,s=0,o=0;$('[data-hp-role="deals-details-fields-for"]').find("tr").filter(r.withoutDestroy()).each(function(){var e=+$(this).find($('.deal-details_table-scroll-full [name*="[amount]"]')).val().replaceAll(",",""),t=$(this).find($('.deal-details_table-scroll-full [name*="[volume]"]')).val();if(t!=undefined&&null!=t&&""!=t)var n=+$(this).find($('.deal-details_table-scroll-full [name*="[volume]"]')).val().replaceAll(",","");else n=1;var i=+$(this).find($('.deal-details_table-scroll-full [name*="[cost_price]"]')).val().replaceAll(",","");a+=n*e,s+=n*i,o+=n*e-n*i}),$('[name="deal[amount]"]').val(i(a)).focusout(),$('[name="deal[cost_price]"]').val(i(s)).focusout(),$('[name="deal[gross_profit]"]').val(i(o)).focusout();var e=App.front_deals.cal_rate(o,a);$('[name="deal[gross_profit_margin]"]').val(i(e)).focusout()}else{if(0!=$('[name^="deal[deals_details_attributes]"][name$="[amount]"]').size()){var t=r.aggregate($('[name^="deal[deals_details_attributes]"][name$="[amount]"][type!="hidden"]'));$('[name="deal[amount]"]').val(i(t)).focusout()}if(0!=$('[name^="deal[deals_details_attributes]"][name$="[gross_profit]"]').size()){var n=r.aggregate($('[name^="deal[deals_details_attributes]"][name$="[gross_profit]"][type!="hidden"]'));$('[name="deal[gross_profit]"]').val(i(n)).focusout()}}}),$(document).off("click",'[data-hp-role="deals-details-delete"]'),$(document).on("click",'[data-hp-role="deals-details-delete"]',function(){var e=$('[name="deals_details_box[]"]:checked').parents("tr").filter(r.withoutDestroy());if(0!=e.size())if(e.size()>r.DEALS_DETAILS_DELETE_LIMIT)alert(I18n.t("js.deals.delete_rows_exceeds"));else{if(e.size()&&confirm(I18n.t("js.deals.confirm_delete_item"))){var n=$('[name="deals_details_box[]"]:checked').parents("tr").filter(r.withoutDestroy());n.each(function(e){var t=$('[data-hp-role="deals-details-fields-for"] tr').index(n[e]);$(".item_calculate").eq(t).css("display","none"),$('[name="deals_details_box[]"]:checked').siblings(".remove_deals_details").click(),App.front_deals.sum_gross()})}$('[name="all-check"]:checked').prop("checked",!1),App.front_deals.hide_detail_info()}else alert(I18n.t("js.common.please_select"))}),$(document).off("click",'[data-hp-role="deals-details-copy"]'),$(document).on("click",'[data-hp-role="deals-details-copy"]',function(){var p=$('[name="deals_details_box[]"]:checked').parents("tr").filter(r.withoutDestroy()),e=$('[data-hp-role="deals-details-fields-for"]').find("tr").filter(r.withoutDestroy()),t=p.clone(!1);0!=p.size()?p.size()>r.DEALS_DETAILS_COPY_LIMIT?alert(I18n.t("js.deals.copy_rows_exceeds")):e.size()+p.size()>r.DEALS_DETAILS_LIMIT?alert(I18n.t("js.deals.add_rows_exceeds")):(t.get().reverse().forEach(function(e,t){$('[data-hp-role="deals-details-fields-for"]').append(e);var n=$('[data-hp-role="deals-details-fields-for"] tr').last();App.front_deals.append_item_calculate();var i=(new Date).getTime();$(e).find("#deals_details_box_").val(i),$(e).find("[name]").each(function(){$(this).attr("id")&&$(this).attr("id",$(this).attr("id").replace(/\_[0-9]+\_/,"_"+i+"_")),$(this).attr("name")&&$(this).attr("name",$(this).attr("name").replace(/\[[0-9]+\]/,"["+i+"]"))}),$(e).find("label[for]").each(function(){$(this).attr("for")&&$(this).attr("for",$(this).attr("for").replace(/\_[0-9]+\_/,"_"+i+"_"))}),$(e).find("td").each(function(){var e=$(this).find(".autonumeric"),t=e.attr("name");e.removeAttr("value"),e.siblings().each(function(){$(this).attr("name")==t&&$(this).remove()})}),$(e).find("select").each(function(e){$(this).val($($(p.get().reverse()[t]).find("select")[e]).val())}),$(e).find("textarea").each(function(e){$(this).val($($(p.get().reverse()[t]).find("textarea")[e]).val())}),$(e).find('[name$="[id]"]').each(function(){$(this).removeAttr("value"),$(this).datepicker()}),$(e).find('[name$="[sales_on]"]').each(function(e){$(this).val($($(p.get().reverse()[t]).find('[name$="[sales_on]"]')[e]).val())}),$(e).find(".details_datepicker").each(function(){$(this).datepicker()}),$('[data-hp-role="deals-details-fields-for"]').append(e);var a=$(".tbody-calculate tr").last(),s=n.find('input[name*="[amount]"]')[0],o=n.find('input[name*="[volume]"]')[0],r=n.find('input[name*="[cost_price]"]')[0],l=0,c=1,d=0;s!=undefined&&s.value!==undefined&&(l=s.value.replaceAll(",","")),o!=undefined&&""!=o.value&&null!=o.value&&(c=o.value.replaceAll(",","")),r!=undefined&&r.value!==undefined&&(d=r.value.replaceAll(",",""));var u=l*c,_=c*d,h=u-_;$(a).find(".price_quantity").text(App.front_deals.number_with_commas(u)),$(a).find(".cost_price_quantity").text(App.front_deals.number_with_commas(_)),$(a).find(".gross_profit").text(App.front_deals.number_with_commas(h)),$(a).find(".gross_profit_rate").text(App.front_deals.cal_rate(h,l)+"%"),App.front_deals.sum_gross()}),$('[name="deals_details_box[]"]:checked').prop("checked",!1),$('[name="all-check"]:checked').prop("checked",!1),$(document).trigger("refresh_autonumeric"),$('tbody[data-hp-role="deals-details-fields-for"] [readonly="readonly"]').each(function(){var e=$(this).parent();$(e).hasClass("details_datepicker")&&$(e).datepicker("destroy"),$(this).on("keydown",function(e){-1!==[" ","Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].indexOf(e.key)&&e.preventDefault()})})):alert(I18n.t("js.common.please_select"))}),$(document).on("nested:fieldAdded",function(e){if(e.field.siblings().filter(r.withoutDestroy()).size()>=r.DEALS_DETAILS_LIMIT)return e.field.find(".remove_deals_details").click(),void alert(I18n.t("js.deals.add_rows_exceeds"));r.attach_click_on_datepicker(e.field),$(document).trigger("refresh_autonumeric"),App.front_deals.sync_height_table_auto_calculate()}),App.front_products.show_modal_product(),this.handle_click_add()},insertDealDetails:function(e,t,n,i){result_flg=!1;for(var a=0;a<e.length;a++){var s=e[a];if(update_params.sales_on=s,App.front_deals.setDealDetailValue(update_params,n,i)){result_flg=!0;break}}return $("a.add_nested_fields").attr("render-use-detail-master",!1),$("#detail_master_id_batch_operation").val(undefined),result_flg},setDealDetailValue:function(e,t,n){if($('[data-hp-role="deals-details-fields-for"]').find("tr").filter(App.front_deals.withoutDestroy()).size()<App.front_deals.DEALS_DETAILS_LIMIT){$("a.add_nested_fields").click();var i=$('[data-hp-role="deals-details-fields-for"] .fields').last();for(key in e)i.find('[name$="['+key+']"]').val(e[key]),["amount","gross_profit","cost_price","volume"].includes(key)&&i.find('[name$="['+key+']"]').focusout();"true"==$("a.add_nested_fields").attr("render-use-detail-master")&&(i.find("[id$='_detail_master_id']").val($("#detail_master_id_batch_operation").val()),n.forEach(function(e){$('[data-hp-role="deals-details-fields-for"] .fields').last().find(".input_"+e).attr("readonly",!0),$('[data-hp-role="deals-details-fields-for"] .fields').last().find(".input_"+e).css("pointer-events","none"),$('[data-hp-role="deals-details-fields-for"] .fields').last().find(".input_"+e).parent().css("pointer-events","none")}));var a=$(".tbody-calculate tr").last();$(a).height($(".deal-details_table-scroll-full .fields:visible").first().height());var s=i.find('input[name*="[amount]"]')[0],o=i.find('input[name*="[volume]"]')[0],r=i.find('input[name*="[cost_price]"]')[0],l=0,c=1,d=0;s!=undefined&&s.value!=undefined&&(l=s.value.replaceAll(",","")),o!=undefined&&""!=o.value&&null!=o.value&&(c=o.value.replaceAll(",","")),r!=undefined&&r.value!=undefined&&(d=r.value.replaceAll(",",""));var u=l*c,_=c*d,h=u-_;for(key in $(a).find(".price_quantity").text(App.front_deals.number_with_commas(u)),$(a).find(".cost_price_quantity").text(App.front_deals.number_with_commas(_)),$(a).find(".gross_profit").text(App.front_deals.number_with_commas(h)),$(a).find(".gross_profit_rate").text(App.front_deals.cal_rate(h,l)+"%"),App.front_deals.sum_gross(),t){var p=t[key];if($.isArray(p))0<=$.inArray("checkbox",p)?i.find('[name$="[deals_details_items_attributes]['+key+'][value][]"]').each(function(e,t){0<=$.inArray(String($(t).val()),p)&&$(t).prop("checked",!0)}):0<=$.inArray("radio",p)?i.find('[name$="[deals_details_items_attributes]['+key+'][value]"]').each(function(e,t){0<=$.inArray(String($(t).val()),p)&&$(t).prop("checked",!0)}):i.find('[name$="[deals_details_items_attributes]['+key+'][value]"]').val(p);else{var f=i.find('[name$="[deals_details_items_attributes]['+key+'][value]"]');f.val(p),f.focusout()}}return!1}return!0},setFormActionToSubmitForAjax:function(l,e){$(document).off("click",e),$(document).on("click",e,function(e){e.preventDefault(),$(".btn-group.open").removeClass("open");var t=$(this);if(!t.data("message")||confirm(t.data("message"))){var n=$(l),i=n.attr("action"),a=n.data("remote");if(n.append('<input name="format" type="hidden" value="js">'),t.data("action")&&n.attr("action",t.data("action")),n.attr("data-remote","true"),n.attr("format")){var s=n.attr("format");n.attr("format","script")}if(0==$("#js_form_change_display_template").length||document.URL.includes("new_from_another_controller"))var o=$("#display_template_id").val();else o=$("#js_form_change_display_template #js_select_change_display_template").val();var r=$("<input>").attr("type","hidden").attr("name","display_template_id").val(o);n.append(r),n.submit(),i&&n.attr("action",i),a||(n.removeAttr("data-remote"),n.removeData("remote")),s&&n.attr("format",s)}})},setFormActionToSubmitForAjaxAdd:function(i,e){$(document).off("click",e),$(document).on("click",e,function(e){e.preventDefault(),$(".btn-group.open").removeClass("open");var t=$(this);if(!t.data("message")||confirm(t.data("message"))){var n=$(i);n.append('<input name="format" type="hidden" value="js">'),$.ajax({url:t.data("action"),type:n.attr("method"),dataType:"script",contentType:"application/x-www-form-urlencoded",scriptCharset:"utf-8",data:n.serialize()})}})},setup_comments:function(){var e=$("#comment_form"),t=$("#open_comment");t.on("click",function(){$(this).hide(),e.show(),e.find("textarea").focus(),$(".comment-min-height").css("min-height",640)}),$("#clear_comment").on("click",function(){$("#comments_of_deal_body").val(""),$("#comment_to_user_ids").val(null).trigger("change"),$("#js_comment_label_delete").click()}),$("#cancel_comment").on("click",function(){t.show(),e.hide(),$("#open_comment").val($("#comments_of_deal_body").val()),$(".comment-min-height").css("min-height",400)}),$(".js_comment_reply").on("click",function(){$("#comment_to_user_ids").val("").trigger("change");var e=$(this).parent().prev();$("#comment_to_user_ids").val(e.data("user-id")).trigger("change"),$("#comment_to_user_ids").val(""),$("#comments_of_deal_reply_number").val(e.data("number")),$("#js_comment_label").text(">"+e.data("number")+I18n.t("js.deals.reply_to")),$("#js_comment_label_box").show(),$("#open_comment").hide(),setTimeout(function(){$("#comment_form").show(),$("#comment_form").find("textarea").focus(),$(".comment-min-height").css("min-height",640)},500)}),$(".js_comment_reply_all").on("click",function(){var e=$(this).parent().prevAll(".comment_data"),t=e.data("to-user-ids");t.unshift(e.data("user-id")),t=$.unique(t),$("#comment_to_user_ids").val(t).trigger("change"),$("#comment_to_user_ids").val(""),$("#comments_of_deal_reply_number").val(e.data("number")),$("#js_comment_label").text(">"+e.data("number")+I18n.t("js.deals.reply_to")),$("#js_comment_label_box").show(),$("#open_comment").hide(),$("#comment_form").show(),$("#comment_form").find("textarea").focus(),$(".comment-min-height").css("min-height",640)}),$("#js_comment_label_delete").on("click",function(){$("#js_comment_label_box").hide(),$("#comments_of_deal_reply_number").val("")});var n=null,i=$(".js_comment_link");i.on("shown.bs.popover",function(){var e=$(this).attr("aria-describedby");0!==(n=$("#"+e).find("input")).size&&(n.select(),n.on("click focus",function(){n.select()}))}),i.on("hide.bs.popover",function(){n instanceof jQuery&&n.off()}),$(".js_disable_submit").on("click",function(){$(".js_disable_submit").prop("disabled",!0);var e=$(".new_comments_of_deal");$.ajax({type:"post",url:e.attr("action"),data:e.serialize(),success:function(){$(".js_disable_submit").prop("disabled",!1)}})}),$("#add_all_parties_comment_destination").on("click",function(){$.ajax({url:"/xhr/users/deal_existence_all/",type:"POST",data:{id:$("#deal_id").val(),comment_to_user_ids:$("#comment_to_user_ids").val()},dataType:"json",context:$(this)}).done(function(e){0<e.user_ids.length&&($("#comment_to_user_ids").select2("data",e.user_ids),$("#comment_to_user_ids").select2("open"),$("#comment_to_user_ids").select2("close"))})});var a=$("#default_comment_to_user_ids").val(),s=$("#last_number").val();null!=a&&""!=a&&s&&($("#comments_of_deal_reply_number").val(s),$("#js_comment_label").text(">"+s+I18n.t("js.deals.reply_to")),$("#js_comment_label_box").show())},destroy_comment:function(e,t){confirm(I18n.t("js.deals.comment_destroy",{title:t}))&&$.ajax({type:"delete",url:e})},chevron_click:function(e){var t=$(e).parent().find(".fa-chevron-down").size(),n=$(e).parent().parent().parent(),i=$(e).attr("data-item-id"),a=void 0===i?$(".transform-lead-role"):$("#show_more_"+i);n.find(".panel-body").toggle(),0<t?($(e).removeClass("fa-chevron-down"),$(e).addClass("fa-chevron-up"),n.parent().find("#comments_panel").size()?($("#comments_panel").addClass("comment-min-height"),"block"==$("#comment_form").css("display")&&$(".comment-min-height").css("min-height",640)):a.css("display","block")):($(e).addClass("fa-chevron-down"),$(e).removeClass("fa-chevron-up"),n.parent().find("#comments_panel").size()?($("#comments_panel").removeClass("comment-min-height"),$("#comments_panel").css("min-height","")):a.css("display","none"))},transform_lead_role:function(e){var t=$(e).attr("data-item"),n=void 0===t?$(".deals_lead_role"):$(".deals_lead_role_"+t);$(e).text()==I18n.t("js.deals.show_more")?(n.css("max-height",450).css("overflow-y","scroll"),$(e).text(I18n.t("js.deals.show_less"))):(n.css("max-height",130).css("overflow","hidden"),$(e).text(I18n.t("js.deals.show_more")))},set_leads_select_width:function(e){$(e).on("ajax:success",function(){$("#lead_ids").select2({width:"100%"})})},click_select_client:function(){$("#open-associated-client").on("click",function(){App.concerns.select_search_name("deal_client_id"),App.concerns.set_associate_entity_to_s2("#deal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#deal_client_id","#client_temporary_business_card_id","single","#deal_client_id","show"),localStorage.setItem("client_onclick","#deal_client_id")})},set_client_id:function(){$("#lead_ids").data("clientId",$("#deal_client_id").val()),$("#deal_client_id").on("change",function(){$("#lead_ids").data("clientId",$(this).val());var e=$("#deal_index_items_type_lead_ids").val().split(" ");$.each(e,function(e,t){$("#item_values_"+t).data("clientId",$("#deal_client_id").val())})})},init_form_from_another_controller:function(e){this.submit_new(),this.submit_new_next(),this.change_client_form(),this.initializeDealsDetailFields(),this.set_client_id(),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search_name("deal_client_id"),App.concerns.set_client_branch_form("deal_client_id"),App.concerns.select_search("deal_user_id"),App.concerns.select_search("mail_user_ids"),App.concerns.select_search("deal_campaign_id"),App.concerns.select_search_lead("lead_ids"),App.concerns.select_search("reapproach_user_ids"),App.concerns.select_search("deal_business_activity_id"),App.concerns.set_tooltip_to_select_search_client("deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),$("#next_action_kbn_ids").select2({width:"100%"}),$("#form_search_xhr_business_cards_select_options").submit(),$("#form_search_xhr_client_branches_select_options").submit(),App.front_segments.set_segment_select2("#deal_segment_id"),App.front_segments.change_segment_icon("#deal_segment_id"),App.concerns.change_display_template(),App.concerns.all_checked_items(),e?(this.setFormActionToSubmitForAjaxAdd("form.edit_deal","#js_add_contract_period_submit"),this.setFormActionToSubmitForAjax("form.edit_deal","#js_destroy_contracts_submit")):(this.setFormActionToSubmitForAjaxAdd("form.new_deal","#js_add_contract_period_submit"),this.setFormActionToSubmitForAjax("form.new_deal","#js_destroy_contracts_submit")),this.setFormActionToSubmitForAjax("form.new_deals_detail","#js_updates_contract_submit"),App.concerns.set_associate_entity_to_s2("#deal_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entity_to_s2("#client_temporary_business_card_id","#search-associated-resources-modal .hp-temporary-business-cards-table button.decision-temporary-business-card","temporary_business_cards"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#temporary_business_cards_multiple_decision","#lead_temporary_business_card_id",'input[name="associate_temporary_business_cards[]"]',"temporary_business_cards"),$(document).off("click","#open-associated-client"),$(document).off("click","#open-associated-lead"),App.concerns.enable_associattion_search_tab_modal("#open-associated-client","/xhr/clients/search_modal","#deal_client_id","#client_temporary_business_card_id","single","#deal_client_id","show",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id","show",$("#unlink_clients_flg").val()),this.click_select_client(),$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit(),this.change_client_temporary_business_card_form(),this.change_lead_temporary_business_card_form(),App.concerns.hide_item_file_options(),e?(App.concerns.restore_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_deal"),App.concerns.create_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null,"form.edit_deal")):(App.concerns.restore_automatically_save("auto_saved_deals_new",$("#current_user_id").val(),null,null,null,"form.new_deal"),App.concerns.create_automatically_save("auto_saved_deals_new",$("#current_user_id").val(),null,null,null,"form.new_deal")),App.front_daily_reports.set_select_item_type_lead("#deal_index_items_type_lead_ids")},reset_associated_button:function(){["#open-associated-client","#open-associated-daily-report","#open-associated-deal","#open-associated-lead","#daily_report_client_id","#client_temporary_business_card_id","#leads_multiple_decision","#deals_multiple_decision","#deal_client_id"].forEach(function(e){$(document).off("click",e)})},parse_html_to_json:function(e){var t;try{t=JSON.parse(e)}catch(n){}return t},change_client_temporary_business_card_form:function(){$("#client_temporary_business_card_id").on("change",function(){$("#form_search_xhr_temporary_business_cards_search_select_in_client").submit(),$(this).val()&&$("#deal_client_id").select2("val","").trigger("change")})},change_lead_temporary_business_card_form:function(){$("#lead_temporary_business_card_id").on("change",function(){$("#temporary_business_card_item_id").val(""),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit()});var e=$("#deal_index_items_type_lead_ids").val().split(" ");$.each(e,function(e,t){$("#"+t+"_temporary_business_card_id").on("change",function(){$("#temporary_business_card_item_id").val(t),$("#form_search_xhr_temporary_business_cards_search_select_in_lead").submit()})})},attach_add_or_edit_relation_handles:function(){var n=function(t,n){var i=this;$.ajax({url:n.data("href"),dataType:"html",data:n.data("params")}).done(function(e){data_obj=App.front_deals.parse_html_to_json(e),data_obj&&"error"===data_obj.status?confirm(data_obj.message)&&location.reload():data_obj&&"deny"===data_obj.status?$("#error_message").html(data_obj.message):(t.html(e),t.find(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"}),t.find(".hidden-xs").addClass("hidden-xs-on-modal"),t.off("shown.bs.modal"),t.off("hidden.bs.modal"),t.on("shown.bs.modal",function(){t.scrollTop(0),$(document).find(".modal-open")[0]&&($(".modal-backdrop").css("z-index",1020),t.css("z-index",1035)),n.trigger("load_modal",i)}).on("hidden.bs.modal",function(){t.empty()}).modal("show"))})},i=function(o,r,l,c){var t=$(".modal-open");r.append('<input name="format" type="hidden" value="json">'),r.data(
"remote",!0),r.on("submit",function(){$("#modal_error_message").empty()}),r.find(".js_modal_search_users_caller_btn").on("click",function(){$(".modal-backdrop").last().css("z-index",1030)}),r.find(".item_datepicker").datepicker(),o.find(c).off("click"),o.find(c).on("click",function(e){var t=$(e.target);e.preventDefault(),$("#modal_error_message").empty();var n=new FormData($(r).get(0));n.append("format","json");var i=null,a=null,s=null;if("undefined"!=typeof r[0].lead_ids&&(i=r[0].lead_ids.value),"undefined"!=typeof r[0].campaign_ids&&(a=r[0].campaign_ids.value),"undefined"!=typeof r[0].business_activities&&(s=r[0].business_activities.value),"inside_sales"!=l&&"campaign"!=l||!i||!a&&!s){if("deal"!=l)return App.front_deals.attachForm_submit(o,r,l,c,n,t),!1;$('[data-hp-role="deals-details-fields-for"]').find("tr").filter(App.front_deals.withoutDestroy()).each(function(e){$(this).find('[name$="[sort_order]"]').val(e)}),n=new FormData($(r).get(0)),App.front_deals.attachForm_submit(o,r,l,c,n,t)}else $.ajax({url:"/xhr/segments/check_lead_stage",type:"post",processData:!1,contentType:!1,data:n}).done(function(e){if(!e.lead_stage_down_flg)return App.front_deals.attachForm_submit(o,r,l,c,n,t),!1;$("#dialog-confirm").html(e.message),$(function(){$("#dialog-confirm").dialog({modal:!0,width:"auto",buttons:[{text:I18n.t("js.dialog_confirm.yse_button"),click:function(){return $(this).dialog("close"),App.front_deals.attachForm_submit(o,r,l,c,n,t),!1}},{text:I18n.t("js.dialog_confirm.no_button"),click:function(){return n.append("end_sales_flg",!0),$(this).dialog("close"),App.front_deals.attachForm_submit(o,r,l,c,n,t),!1}}]})})})}),r.on("ajax:success",function(e){e.target!==this&&($("#search-associated-resources-modal, #modal_block_for_search_users").on("hidden.bs.modal",function(){t.addClass("modal-open")}),$("#search-associated-resources-modal").on("hidden.bs.modal",function(){var e=1030;$(".modal-backdrop").each(function(){$(this).css("z-index",e),e+=5})}),$("#search-overlay-associated-resources-modal").on("hidden.bs.modal",function(){var e=1040;$(".modal-backdrop").each(function(){$(this).css("z-index",e),e+=5})}))})},a=function(n,i){var e=$("#js_form_change_display_template");e.attr("action",i.data("href")),e.data("remote",!0),e.on("ajax:success",function(e,t){n.html(t),n.find(".hidden-xs").addClass("hidden-xs-on-modal"),i.trigger("load_modal")})};$(document).on("click",'[data-hp-role="edit_deals_sheet_result_factor"], [data-hp-role="edit_deals_sheet_process_status"],[data-hp-role="add_information"],[data-hp-role="edit_information"]',function(e){e.preventDefault();var t=$("#modalContainer");return n(t,$(this)),!1}),$(document).on("load_modal",'[data-hp-role="edit_deals_sheet_process_status"][data-hp-target="deal"]',function(){App.front_deals.reset_associated_button();var e=$("#modalContainer"),t=$(".edit_deal");App.front_deals.init_form_from_another_controller(!0),i(e,t,"deals_sheet_process_status","#edit_submit")}),$(document).on("load_modal",'[data-hp-role="edit_deals_sheet_result_factor"][data-hp-target="deal"]',function(){App.front_deals.reset_associated_button();var e=$("#modalContainer"),t=$(".edit_deal");App.front_deals.init_form_from_another_controller(!0),i(e,t,"deals_sheet_result_factor","#edit_submit")}),$(document).on("load_modal",'[data-hp-role="edit_information"][data-hp-target="deal"]',function(){App.front_deals.reset_associated_button();var e=$("#modalContainer"),t=$(".edit_deal");a(e,$(this)),App.front_deals.init_form_from_another_controller(!0),i(e,t,"deal","#edit_submit"),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block")}),$(document).on("load_modal",'[data-hp-role="add_information"][data-hp-target="daily_report"]',function(){App.front_deals.reset_associated_button();var e,t=$("#modalContainer");App.front_daily_reports.init_form_from_another_controller(!1),a(t,$(this)),e=$(this).attr("data-hp-spot")?$(this).attr("data-hp-spot"):"daily_report",i(t,$("#new_daily_report"),e,"#new_submit"),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block")}),$(document).on("load_modal",'[data-hp-role="edit_information"][data-hp-target="daily_report"]',function(){App.front_deals.reset_associated_button();var e,t=$("#modalContainer"),n=$(".edit_daily_report");App.front_daily_reports.init_form_from_another_controller(!0),a(t,$(this)),e=$(this).attr("data-hp-spot")?$(this).attr("data-hp-spot"):"daily_report",i(t,n,e,"#edit_submit"),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.init("#daily_report_client_branch_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block")}),$(document).on("hidden.bs.modal",function(){"true"==$("#write_permission_role_users").val()&&$("#btn_edit_deal").attr("disabled",!0)}),$(document).on("load_modal",'[data-hp-role="add_information"][data-hp-target="task"]',function(){App.front_deals.reset_associated_button();var e,t=$("#modalContainer"),n=$("#new_task");App.front_tasks.init_form_from_another_controller(!0),t.find('a[href="/tasks/"]').parent().hide(),e=$(this).attr("data-hp-spot")?$(this).attr("data-hp-spot"):"task",i(t,n,e,"#new_submit")}),$(document).on("load_modal",'[data-hp-role="edit_information"][data-hp-target="task"]',function(){App.front_deals.reset_associated_button();var e,t=$("#modalContainer"),n=$(".edit_task");App.front_tasks.init_form_from_another_controller(!0),t.find('a[href="/tasks/"]').parent().hide(),e=$(this).attr("data-hp-spot")?$(this).attr("data-hp-spot"):"task",i(t,n,e,"#edit_submit")}),$(document).on("load_modal",'[data-hp-role="add_information"][data-hp-target="inside_sales"]',function(){App.front_deals.reset_associated_button();var e,t=$("#modalContainer"),n=$("#new_activity_lists");t.find('a[href="/inside_sales/"]').parent().hide(),e=$(this).attr("data-hp-spot")?$(this).attr("data-hp-spot"):"inside_sales",i(t,n,e,"#new_submit"),$("#business_activities_select").select2({width:"100%"}),$("#activity_lists_lead_ids").data("another_object_id",$("#activity_lists_deal_id").val()),App.concerns.select_search("activity_lists_lead_ids"),App.concerns.select_search("activity_lists_user_ids"),App.concerns.select_search("activity_lists_mail_user_ids"),App.concerns.datepicker(".search_datepicker"),App.concerns.enable_associattion_search_modal("#open-associated-inside-sales","/xhr/inside_sales/search_as_association_modal","#business_activities_select","multiple"),App.front_inside_sales.set_associate_entities_to_s2_with_new_option("#inside_sales_multiple_decision","#business_activities_select",'input[name="associate_business_activities[]"]',"inside_sales"),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#activity_lists_lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id",""),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#activity_lists_lead_ids",'input[name="associate_leads[]"]',"leads")}),$(document).on("load_modal",'[data-hp-role="add_information"][data-hp-target="campaign"]',function(){App.front_deals.reset_associated_button();var e=$("#modalContainer"),t=$("#new_campaigns_leads");e.find('a[href="/campaign/"]').parent().hide(),i(e,t,"campaign","#new_submit"),$("#lead_ids").data("another_object_id",$("#campaigns_leads_deal_id").val()),App.concerns.select_search("campaign_ids"),App.concerns.select_search("lead_ids"),App.concerns.enable_associattion_search_modal("#open-associated-campaigns","/xhr/campaigns/search_as_association_modal","#campaign_ids","multiple"),App.concerns.set_associate_entities_to_s2("#campaigns_multiple_decision","#campaign_ids",'input[name="associate_campaigns[]"]',"campaigns"),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","#lead_temporary_business_card_id","multiple","#deal_client_id",""),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads")})},change_button_actibity_by_role:function(){$(document).on("click","#all-check,.check-items",function(){var e=$(".check-items:checked"),t=e.closest("tr").find("td:last").length!=e.closest("tr").find("td:last a").not("[disabled='disabled']").length;$(".btn-activity-by-department-role").prop({disabled:t});var n=$(".data-original-title-by-activity"),i=n.attr(t?"data-disabled-title":"data-enabled-title");n.attr("data-original-title",i)})},all_checked_items_modal_deals_index:function(){$(document).on("click","#all-check",function(){$(this).is(":checked")?$(".check-items-deals-details-box").prop("checked",!0):$(".check-items-deals-details-box").prop("checked",!1)})},get_modal_to_summary_display_templates:function(){0==$("#modalSummaryDisplayTemplates").length?($("#js_get_modal_to_summary_display_templates").submit(),$(".modal-backdrop").last().css("z-index",9998)):($("#display_templates_message").children().remove(),$("#modalSummaryDisplayTemplates").modal("show"))},load_split_show_picture:function(e,t){Index++;var n=Pictures[Index];xhrTemporaryBusinessCardIds=$(n).data("xhr-temporary_business-card-ids"),$.ajax({url:"/xhr/deals/load_split_temporary_picture",type:"GET",dataType:"html",data:{ids:xhrTemporaryBusinessCardIds,edit_flg:t}}).done(function(e){$(n).replaceWith(e),$(document).trigger("floatTableUpdate")}).fail(function(){$(n).html("")}).always(function(){Index<Pictures.length-1?App.front_deals.load_split_show_picture(e,t):e.resolve()})},reload_activities:function(){var e=$("#related_business_activities").data("id"),t=$("#related_business_activities").data("pagenator-id");$.ajax({url:"/xhr/deals/"+e+"/load_related_business_activities",type:"GET",dataType:"script",data:{pagination_id:t}})},reload_campaigns:function(){var e=$("#related_campaigns").data("id");$.ajax({url:"/xhr/deals/"+e+"/load_related_campaigns",type:"GET",dataType:"script"})},change_deals_stage:function(){$("#deal_deals_stage_id, #deal_deals_stage_id2").on("change",function(){if($(this).prop("selectedIndex")-1<0)$("#deals_status_kbn_id_select_wrapper select").removeClass("show-inline-block"),"deal_deals_stage_id"==$(this).attr("id")?($("#deal_deals_stage_id option").attr("selected",!1),$("#deal_status_kbn_id option").attr("selected",!1)):($("#deal_deals_stage_id2 option").attr("selected",!1),$("#deal_status_kbn_id2 option").attr("selected",!1));else{if($("#deals_status_kbn_id_select_wrapper select").addClass("show-inline-block"),"deal_deals_stage_id"==$(this).attr("id"))for(var e=document.getElementById("deal_status_kbn_id");e.lastChild;)e.removeChild(e.lastChild);else for(var t=document.getElementById("deal_status_kbn_id2");t.lastChild;)t.removeChild(t.lastChild);var n=$("#status-kbn-data").text(),i=new DOMParser,a=JSON.parse(i.parseFromString(n,"text/html").documentElement.textContent)[$(this).val()],s=$("select.status_kbn_child_select"),o=Object.keys(a),r=$("<option>").text("").val("");s.append(r),o.forEach(function(e){var t=this[e],n=$("<option>").text(t[0]).val(t[1]);s.append(n)},a)}})},change_deals_stage_on_modal:function(e,t){$(e).on("change",function(){var i=$(this).val(),e=$(t);e.val(""),i?e.addClass("show-inline-block"):e.removeClass("show-inline-block"),$.each(e.find("option"),function(e,t){var n=$(t);if(!n.val())return!0;n.data("deals_stage_id")==i?n.css("display","block"):n.css("display","none")})})},search_type_tab_workflow:function(){var e=$("#search_type_tab_workflow");$(document).on("change",".search_type",function(){e.is(":checked")?($("#search_multiple").hide(),$("#search_show").hide(),$("#search_submit").hide(),$(".show_list_fields").hide(),$("#search_save").hide(),$(".search_call").hide(),$(".detail-search").hide(),$("#search_share").hide(),$("#search_user").hide(),$(".checkbox-search").hide(),$("#checkbox-search_private").hide(),$("#checkbox-search_active").hide(),$("#search_multiple_abms").hide(),$("#abm_search").hide(),$(".index_default_display_block").addClass("hidden"),$(".deal_index_workflow_tab").removeClass("hidden")):($(".index_default_display_block").removeClass("hidden"),$(".deal_index_workflow_tab").addClass("hidden"))})},attachForm_submit:function(a,e,s,o,t,n){$.ajax($(e).attr("action"),{type:"post",processData:!1,contentType:!1,data:t,beforeSend:function(){1==n.hasClass("js_disabled_submit")&&n.prop("disabled",!0)}}).done(function(e){if("error"===e.status)""===e.message&&"daily_report"===s?$("#js_select_change_display_template option").last().attr("selected","selected").trigger("change"):"deals_sheet_process_status"===s?confirm(e.message)&&location.reload():"deals_sheet_stage"===s?(a.modal("hide"),$("#error_message").html(e.message)):"timeline_daily_report"===s?"reload"===e.type?confirm(e.message)&&location.reload():$("#modal_error_message").html(e.message):"timline_task"===s?"reload"===e.type?confirm(e.message)&&location.reload():$("#modal_error_message").html(e.message):($("#modal_error_message").html(e.message),$("#modalContainer").scrollTop(0));else if(a.modal("hide"),"daily_report"===s){var t=$("#related_daily_reports").data("id"),n=$("#related_daily_reports").data("pagenator-id"),i=$("#related_daily_reports").data("display-template-id");"#new_submit"===o?App.concerns.destroy_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val()):"#edit_submit"===o&&App.concerns.destroy_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val()),$.ajax({url:"/xhr/deals/"+t+"/load_related_daily_reports",type:"GET",dataType:"script",data:{pagination_id:n,display_template_id:i}})}else if("task"===s){t=$("#related_tasks").data("id"),n=$("#related_tasks").data("pagenator-id"),i=$("#related_tasks").data("display-template-id");$.ajax({url:"/xhr/deals/"+t+"/load_related_tasks",type:"GET",dataType:"script",data:{pagination_id:n,display_template_id:i}})}else if("timeline_daily_report"===s||"timline_task"===s)"timeline_daily_report"===s&&"#new_submit"===o&&App.concerns.destroy_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val()),$("a[href='#timeline']").tab("show"),Dealsheets.reload_activities();else if("deal"===s){i=$("#js_form_change_display_template > #js_select_change_display_template").val();Dealsheets.reload_deal(i,location.search),App.concerns.destroy_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null)}else"deals_sheet_process_status"===s?a.on("hidden.bs.modal",function(){Dealsheets.reload_deal_sheet(!0,!0),Dealsheets.reload_details(),Dealsheets.reload_histories()}):"deals_sheet_result_factor"===s?(Dealsheets.reload_deal_sheet(!1),Dealsheets.reload_lead(),Dealsheets.reload_info(),location.reload()):"inside_sales"===s?location.reload():"campaign"===s&&location.reload()})},get_invsible_number:function(){$(document).ready(function(){$form=$("#form_search_deals"),$("#search_invisible_id_flg").val(!0),$form.data("remote",!0),action=$form.attr("action"),$form.attr("action",action+"index.js"),$form.submit(),$form.attr("action",action),$form.removeAttr("data-remote"),$form.removeData("remote"),$("#search_invisible_id_flg").val(null)})},update_ui_textarea_deal_template_form:function(){null!==document.getElementById("lead_ids")&&($("#lead_ids").closest("div.col-xs-12")[0].insertAdjacentHTML("beforeend",""),$("#search_status_kbn_id").closest(".table").find("th").addClass("border-top-custom"),$("#search_status_kbn_id").closest(".table").find("td").addClass("border-top-custom")),null!==document.getElementById("deal_result_factor_detail")&&0<$("#deal_orders_date_on").closest("div.col-xs-12").length&&($("#deal_orders_date_on").closest("div.col-xs-12")[0].insertAdjacentHTML("beforeend",""),$("#txt_deal_note1").closest(".table").find("th").addClass("border-top-custom"),$("#txt_deal_note1").closest(".table").find("td").addClass("border-top-custom"))},handle_click_add:function(){$(".group-btn-event-deal-details .add_nested_fields").on("click",function(){App.front_deals.show_detail_master_area(),App.front_deals.append_item_calculate()}),$(document).on("keyup",'.deal-details_table-scroll-full [name*="[amount]"], .deal-details_table-scroll-full [name*="[volume]"], .deal-details_table-scroll-full [name*="[cost_price]"]',function(_){0!=$(".item_calculate").length&&($("#"+_.currentTarget.id).closest("tbody").find("tr").each(function(e,t){if($(t).find("#"+_.currentTarget.id).length){var n=+$(t).find('input[name*="[amount]"]')[1].value.replaceAll(",",""),i=$(t).find('input[name*="[volume]"]')[1];if(i!=undefined&&""!=String(i.value).replaceAll(",",""))var a=parseInt(String(i.value).replaceAll(",",""));else a=1;var s=$(t).find('input[name*="[cost_price]"]')[1];if(s!=undefined&&""!=String(s.value).replaceAll(",",""))var o=parseInt(String(s.value).replaceAll(",",""));else o=0;var r=n*a,l=a*o,c=r-l,d=$("#detail-masters-segment").find("tr").index(this),u=$(".item_calculate").eq(d);$(u).find(".price_quantity").text(App.front_deals.number_with_commas(r)),$(u).find(".cost_price_quantity").text(App.front_deals.number_with_commas(l)),$(u).find(".gross_profit").text(App.front_deals.number_with_commas(c)),$(u).find(".gross_profit_rate").text(App.front_deals.cal_rate(c,r)+"%")}}),App.front_deals.sum_gross())})},numberInRange:function(e){return Number(e)>App.front_deals.DEALS_MAX_NUMBER?App.front_deals.DEALS_MAX_NUMBER:Number(e)<App.front_deals.DEALS_MIN_NUMBER?App.front_deals.DEALS_MIN_NUMBER:e},sum_gross:function(){var n=0,i=0,a=0;$('tr:not([style*="display: none"]) .price_quantity').each(function(e,t){if("E%"!=t.parentElement.querySelector(".gross_profit_rate").innerText)return n+=+t.innerText.replaceAll(",","")}),$('tr:not([style*="display: none"]) .cost_price_quantity').each(function(e,t){if("E%"!=t.parentElement.querySelector(".gross_profit_rate").innerText)return i+=+t.innerText.replaceAll(",","")}),$('tr:not([style*="display: none"]) .gross_profit').each(function(e,t){if("E%"!=t.parentElement.querySelector(".gross_profit_rate").innerText)return a+=+t.innerText.replaceAll(",","")}),$(".sum_total_1").text(App.front_deals.number_with_commas(n)),$(".sum_total_2").text(App.front_deals.number_with_commas(i)),$(".sum_total_3").text(App.front_deals.number_with_commas(a)),$(".sum_total_4").text(App.front_deals.cal_rate(a,n)+"%"),$("#table_form_deal").data("use_detail_master_statistical_flg")&&($("#table_form_deal #deal_amount").val(App.front_deals.numberInRange(n)).focusout(),$("#table_form_deal #deal_amount_val").val(App.front_deals.numberInRange(n)),$("#table_form_deal #deal_cost_price").val(App.front_deals.numberInRange(i)).focusout(),$("#table_form_deal #deal_cost_price_val").val(App.front_deals.numberInRange(i)),$("#table_form_deal #deal_gross_profit").val(App.front_deals.numberInRange(a)).focusout(),$("#table_form_deal #deal_gross_profit_val").val(App.front_deals.numberInRange(a)),deal_gross_profit_margin=App.front_deals.cal_rate(a,n),"E"!=deal_gross_profit_margin?($("#deal_gross_profit_margin").val(deal_gross_profit_margin),$("#deal_gross_profit_margin_val").val(deal_gross_profit_margin)):($("#deal_gross_profit_margin").val("0"),$("#deal_gross_profit_margin_val").val("0")))},append_item_calculate:function(){var e=$(".item_calculate").length;if(0<e)var t=$(".item_calculate").first().clone();else t=$(".item_calculate_none").first().clone();t.css("display","table-row"),t.find(".price_quantity").text("0"),t.find(".cost_price_quantity").text("0"),t.find(".gross_profit").text("0"),t.find(".gross_profit_rate").text("E%"),t.attr("index",e),t.appendTo(".tbody-calculate"),t.removeClass("item_calculate_none").addClass("item_calculate"),t.height($(".deal-details_table-scroll-full .fields:visible").first().height())},cal_rate:function(e,t){return 0==t?"E":Math.floor(e/t*100)},number_with_commas:function(e){return e.toLocaleString("en-US")},show_detail_master_area:function(){$("#detail_info").attr("class").includes("hidden")&&($("#detail_info").removeClass("hidden"),$("#no-product").addClass("hidden"))},hide_detail_info:function(){0==$("#detail_info .fields:visible").length&&$("#table_form_deal").data("detail_master_flg")&&($("#detail_info").addClass("hidden"),$("#no-product").removeClass("hidden"))},trigger_search_detail_master:function(){setTimeout(function(){$("#submit_search_product").click()},1e3)},setup_events_for_batch_operation:function(){$(".operation-button").on("click",function(){$("a.add_nested_fields").attr("render-use-detail-master",!1),$("#detail_master_id_batch_operation").val(undefined)})},init_sum_gross:function(){$("#table_form_deal").data("use_detail_master_statistical_flg")&&$("#no-product").hasClass("hidden")&&this.sum_gross()}},$(function(e){e("#btn_save").on("click",function(){e(this).prop("disabled",!0),e("#btn_detail").prop("disabled",!0),e("#btn_list").prop("disabled",!0),e("#form_attribute_name").submit()}),e("#btn_detail").on("click",function(){e(this).prop("disabled",!0),e("#btn_save").prop("disabled",!0),e("#btn_list").prop("disabled",!0),e("#show_recode").submit()}),e("#btn_list").on("click",function(){e(this).prop("disabled",!0),e("#btn_save").prop("disabled",!0),e("#btn_detail").prop("disabled",!0),e("#btn_edit").prop("disabled",!0)}),e("#btn_edit").on("click",function(){e(this).prop("disabled",!0),e("#btn_list").prop("disabled",!0),e("#js_form_edit_default_attribute").submit()})}),App.front_deals_details_display_items={requireDataAster:" \uff0a",comboMove:function(o,r){var l=this;return function(){var e=$(o),t=$(r),n=e.find("option:selected"),i=n.clone();if("left-btn"==$(this).data("hp-role")){var a=0,s=10;if(n.each(function(){$(this).data("calculate-item-flg")&&(a+=1)}),t.find("option").each(function(){$(this).data("calculate-item-flg")&&(a+=1)}),s<a)return alert(I18n.t("js.common.caluc_item_max_exceeded")),!1}i.each(function(){$(this).attr("data-label",""),$(this).attr("title",$(this).html().replace(" \uff0a","")),$(this).html($(this).html().replace(new RegExp(l.requireDataAster+"$"),""))}),n.attr("title",n.text()),t.append(i),n.remove()}},comboMoveOne:function(t){return function(){var e=$('[data-hp-role="visible-fields"] option:selected');1<e.size()?alert(I18n.t("js.common.unchanged_items")):t(e)}},requiredOptionReload:function(){var t=this;$('[data-hp-role="visible-fields"] option').each(function(){var e=$(this);e.html(e.html().replace(new RegExp(t.requireDataAster+"$"),"")),e.append(e.attr("data-label")),e.attr("title",e.text())})},formInit:function(){var n=this;this.requiredOptionReload(),$(document).on("submit",'form[data-hp-role="deals-details-display-item-form"]',function(){var t=$(this);$('[data-hp-role="visible-fields"]').val($('[data-hp-role="visible-fields"] option').map(function(){return $(this).val()})),$('[data-hp-role="visible-fields"] option[data-label="'+n.requireDataAster+'"]').each(function(){var e=$("<input />").attr("name","deals_details_display_item[item_params][manual_required_display_items][]").attr("value",$(this).val()).attr("type","hidden");t.append(e)})}),$(document).on("click",'[data-hp-role="right-btn"]',this.comboMove('[data-hp-role="visible-fields"]','[data-hp-role="invisible-fields"]')),$(document).on("click",'[data-hp-role="left-btn"]',this.comboMove('[data-hp-role="invisible-fields"]','[data-hp-role="visible-fields"]')),$(document).on("click",'[data-hp-role="top-btn"]',n.comboMoveOne(function(e){e.prevAll().last().before(e)})),$(document).on("click",'[data-hp-role="bottom-btn"]',n.comboMoveOne(function(e){e.nextAll().last().after(e)})),$(document).on("click",'[data-hp-role="up-btn"]',n.comboMoveOne(function(e){e.prevAll().first().before(e)})),$(document).on("click",'[data-hp-role="down-btn"]',n.comboMoveOne(function(e){e.nextAll().first().after(e)})),$(document).on("click",'[data-hp-role="required-btn"]',function(){var e=!1;$('[data-hp-role="visible-fields"] option:selected:not([data-norequired])').each(function(){if($(this).data("calculate-item-flg"))return e=!0,alert(I18n.t("js.common.caluc_item_required")),!1}),e||($('[data-hp-role="visible-fields"] option:selected:not([data-norequired])').each(function(){var e=$(this);e.attr("data-label",e.attr("data-label")?"":n.requireDataAster)}),n.requiredOptionReload())})},index:function(){this.formInit()},update:function(){this.formInit()},create:function(){this.formInit()}},App.front_deals_processes={DEALS_PROCESS_ITEM_LIMIT_PER_STATU_KBN:10,"new":function(){this.init_nested_form(),this.sortable_items(),this.deals_stage_selected(),this.reset_form()},create:function(){this["new"]()},edit:function(){this["new"]()},update:function(){this["new"]()},init_nested_form:function(){var i=this;$(document).on("nested:fieldAdded",function(e){var t=e.field,n=$(e.target);n.siblings(".fields:visible").length>=i.DEALS_PROCESS_ITEM_LIMIT_PER_STATU_KBN&&(e.field.find(".remove_nested_fields").click(),alert(I18n.t("js.common.max_exceeded"))),t.find(".status_kbn_id").val(n.parent().data("status_kbn_id")),t.find(".position").val(n.siblings(".fields:visible").length),n.siblings(".fields:visible").each(function(e){$(this).find(".position").val(e)})}),$(document).on("nested:fieldRemoved",function(e){$(e.target).siblings(".fields:visible").each(function(e){$(this).find(".position").val(e)})})},sortable_items:function(){$(".sortable").sortable({cursor:"move",opacity:.7,items:"div.fields",update:function(e){$target=$(e.target),$target.children(".fields:visible").each(function(e){$(this).find(".position").val(e)})}})},deals_stage_selected:function(){var t=$("#deals_process_deals_stage_id").val(),n=$("#items_table").get(0).innerHTML;$("#deals_process_deals_stage_id").on("change",function(){var e=$(this).val();if(e==t)return $("#items_table").html(n),void App.front_deals_processes.sortable_items();$.ajax({url:"/xhr/deals_processes/set_deals_status_kbns",type:"POST",dataType:"json",data:{id:e}}).done(function(e){var t=e.results,n="";$.each(t,function(e,t){n+="<tr>",n+='<th class="col-xs-2">'+t.value+"</th>",n+='<td class="col-xs-10">',n+='<ul class="col-xs-12 sortable ui-sortable" data-status_kbn_id="'+t.id+'">',n+='<a style="margin-left: 18px;" class="add_nested_fields" data-association="deals_process_items" data-blueprint-id="deals_process_items_fields_blueprint" href="javascript:void(0)">',n+=I18n.t("js.deals.add_items"),n+="</a></ul></td></tr>"}),$("#items_table").html(n),App.front_deals_processes.sortable_items()}).fail(function(e){console.log(e.status),500===e.status&&alert(I18n.t("js.common.occurred_error"))})})},reset_form:function(){window.onpageshow=function(){$("#form_deals_process")[0].reset()}}},App.front_deals_stages={"new":function(){this.init_nested_form(),this.sortable_items()},create:function(){this["new"]()},edit:function(){this["new"]()},update:function(){this["new"]()},init_nested_form:function(){$(document).on("nested:fieldAdded",function(e){var t=e.field,n=$(e.target);t.find(".position").val(n.siblings(".fields:visible").length),n.siblings(".fields:visible").each(function(e){$(this).find(".position").val(e)})}),$(document).on("nested:fieldRemoved",function(e){$(e.target).siblings(".fields:visible").each(function(e){$(this).find(".position").val(e)})})},sortable_items:function(){$(".sortable").sortable({cursor:"move",opacity:.7,items:"div.fields",update:function(e){$target=$(e.target),$target.children(".fields:visible").each(function(e){$(this).find(".position").val(e)})}})}},App.front_default_items={index:function(){App.concerns.change_display_number("form_search_default_items"),App.concerns.change_order("form_search_default_items"),$(".js_register_default_attribute").on("click",function(){var e=$(this).data("attribute-name"),t=$(this).data("action");$("#register_attribute_name").val(e),form=App.concerns.set_form_action("js_form_register_default_attribute",t,!1),form.submit()}),$(".js_show_default_attribute").on("click",function(){var e=$(this).data("attribute-name"),t=$(this).data("action");$("#show_attribute_name").val(e),form=App.concerns.set_form_action("js_form_show_default_attribute",t,!1),form.submit()}),App.concerns.focus_to_first_element()}},App.front_department_role_patterns={item:function(){App.front_department_role_patterns.lateral_move_option(".js_lateral_move_button_block")},lateral_move_option:function(e){$(document).on("click",e+" button",function(){if($(this).hasClass("move_to_right"))(t=(e=$(this).parent()).prev().find("select option:selected"))[0]&&t.each(function(){e.next().children("select").append($(this).clone()),$(this).remove()});else if($(this).hasClass("move_to_left")){var e,t;(t=(e=$(this).parent()).next().find("select option:selected"))[0]&&t.each(function(){e.prev().children("select").append($(this).clone()),$(this).remove()})}})}},App.front_department_roles={index:function(){App.concerns.ajax_error_message(),App.front_department_roles.folding(),$(window).on("load resize",function(){$(".accessed_department_title").remove(),App.front_department_roles.accessed_department_title()}),$(document).ready(function(){var e=window.navigator.userAgent.toLowerCase();-1==e.indexOf("msie")&&-1==e.indexOf("trident")&&$('[data-toggle="tooltip"]').tooltip(),$(".subject_title").css("width",$("tbody th").outerWidth()+1),$(".access_department").css("width",$("th.access_department").outerWidth()+1),$(".access_department").each(function(){null!=$(this).data("depth")&&1!=$(this).data("depth")&&$(this).parent().hide()}),App.front_department_roles.accessed_department_title(),$("#loading").hide()}),$(document).on("click",".check",function(){if("block"===$(".department-role-show").css("display"))return $(".department-role-show").hide(),!1;var e=$(this).data("pattern-id");$(".department-role-show").css("top",$(this).position().top+$(this).height()),$(".department-role-show").css("left",$(this).outerWidth()/2+$(this).position().left),$("#pattern-show-form").attr("action","/xhr/department_roles/department_role_pattern_show/"+e),$("#pattern-show-form").submit()}),$(window).on("click",function(){"block"===$(".department-role-show").css("display")&&$(".department-role-show").hide()}),$(document).on("click","a",function(){"block"===$(".department-role-show").css("display")&&$(".department-role-show").hide()}),$(document).on("mousedown","#access_roles_table",function(e){"block"===$(".department-role-show").css("display")&&($(this).outerWidth()<=e.clientX||$(this).outerHeight()<=e.clientY)&&$(".department-role-show").hide()}),$(function(){$("#file_tag").change(function(){$(this).closest("form").submit()})}),$("#import-btn").click(function(){return $("#file_tag").click(),!1})},edit:function(){App.concerns.ajax_error_message(),$(window).on("load resize",function(){$(".accessed_department_title").remove(),App.front_department_roles.accessed_department_title()}),$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip(),$("span.edit-patterns").each(function(){$(this).attr("data-current-pattern-id")!=$(this).attr("data-origin-pattern-id")&&$(this).addClass("changed_data")}),$(".subject_title").css("width",$("tbody th").outerWidth()+1),$(".access_department").css("width",$("th.access_department").outerWidth()+1),$(".access_department").each(function(){null!=$(this).data("depth")&&1!=$(this).data("depth")&&$(this).parent().hide()}),App.front_department_roles.accessed_department_title(),$("#loading").hide()}),App.front_department_roles.error_frame(),App.front_department_roles.folding(),App.front_department_roles.inherit_change(),App.front_department_roles.bulk_change(),$(document).on("click",".check",function(){var e=$(this).find(".edit-patterns").attr("data-current-pattern-id"),t=$(this).attr("data-access-department-id"),n=$(this).attr("data-accessed-department-id");$("input#pattern_id").val(e),$("input#access_department_id").val(t),$("input#accessed_department_id").val(n),$("#pattern-select-form").submit(),$("input#pattern_id").val(""),$("input#access_department_id").val(""),$("input#accessed_department_id").val("")}),$(document).on("click","#department-role-cancel",function(){confirm(I18n.t("js.department_roles.confirm_discard_content"))&&(window.location.href="/department_roles")}),$(document).on("click","#department-role-edit",function(){if(confirm(I18n.t("js.common.confirm_save"))){var s={};$(".changed_data").each(function(e,t){var n=$(t).parents("tr").children("th").attr("data-department-id"),i=$(t).parent("td").data("accessed-department-id"),a=$(t).attr("data-current-pattern-id");$(t).attr("data-origin-pattern-id")!=a&&(s[n]?s[n][i]=a:(accessed_department_pattern={},accessed_department_pattern[i]=a,s[n]=accessed_department_pattern))}),$(
"#department_role_form input#department_role").val(JSON.stringify(s)),$("#department_role_form").submit()}})},update:function(){App.front_department_roles.edit(),$(document).ready(function(){$(".department_role_folding_area #all_open").click()})},folding:function(){$(document).on("click",".access_department button.folding",function(){if("expand"==$(this).attr("data-action"))App.front_department_roles.children_list_show(this);else{var e=$(this).parent("th").data("department-id");$(this).attr("data-action","expand");var t=$(this).parents("tr").nextAll("tr[data-parent-id="+e+"]");t.hide(),App.front_department_roles.children_list_hide(t)}}),$(document).on("click",".department_role_folding_area #all_open",function(){$(".access_department button").attr("data-action","collapse"),$(".access_pattern_table").find("tr").show()}),$(document).on("click","#all_close",function(){$(".access_department button.folding").attr("data-action","expand"),$(".access_pattern_table tbody").find("tr").not("[data-depth=1]").hide()})},children_list_show:function(e){var t=$(e).parent("th").data("department-id");$(e).attr("data-action","collapse");var n=$(e).parents("tr").nextAll("tr[data-parent-id="+t+"]");n.show(),n.each(function(){$(this).find("button.folding").length&&"collapse"==$(this).find("button.folding").attr("data-action")&&App.front_department_roles.children_list_show($(this).find("button.folding"))})},children_list_hide:function(e){for(var t=e.find("button.folding"),n=0;n<t.length;n++){parent_id=t.eq(n).parent("th").data("department-id");var i=e.nextAll("tr[data-parent-id="+parent_id+"]");i.hide(),App.front_department_roles.children_list_hide(i)}},children_list_all_show:function(e){var t=e.find("button.folding");t.attr("data-action","collapse");for(var n=0;n<t.length;n++){parent_id=t.eq(n).parent("th").data("department-id");var i=e.nextAll("tr[data-parent-id="+parent_id+"]");i.show(),App.front_department_roles.children_list_all_show(i)}},bulk_change:function(){$(".glyphicon-circle-arrow-down").on("click",function(){var e="";if("access_department"==$(this).parents("th").attr("class")){var t=$(this).parents("th").attr("data-department-id"),n=$(this).parents("th.access_department").parent().index();e=$("tbody").children("tr").eq(n).children("td").eq(0),$("input#access_department_id").val(t)}else{var i=$(this).parents("td").attr("data-department-id"),a=$(this).parents("td.accessed_departments").index()-1;e=$("tbody").children("tr").eq(0).children("td").eq(a),$("input#accessed_department_id").val(i)}$("input#pattern_id").val(e.find(".edit-patterns").attr("data-current-pattern-id")),$("#pattern-select-form").submit(),$("input#pattern_id").val(""),$("input#access_department_id").val(""),$("input#accessed_department_id").val("")}),$(".glyphicon-circle-arrow-right").on("click",function(){var e="";if("access_department"==$(this).parents("th").attr("class")){var t=$(this).parents("th").attr("data-department-id"),n=$(this).parents("th.access_department").parent().index();e=$("tbody").children("tr").eq(n).children("td").eq(0),$("input#access_department_id").val(t)}else{var i=$(this).parents("td").attr("data-department-id"),a=$(this).parents("td.accessed_departments").index()-1;e=$("tbody").children("tr").eq(0).children("td").eq(a),$("input#accessed_department_id").val(i)}$("input#pattern_id").val(e.find(".edit-patterns").attr("data-current-pattern-id")),$("#pattern-select-form").submit(),$("input#pattern_id").val(""),$("input#access_department_id").val(""),$("input#accessed_department_id").val("")})},inherit_change:function(){$(document).on("click",".inherit-change",function(){var e=$(this).parents(".access_department").find(".department_role_dapeartment_name").text()+I18n.t("js.department_roles.do_same");if(confirm(e)){var t=$(this).parents("th").children("button.folding"),n=$(t).parent("th").data("department-id");$(t).attr("data-action","collapse");var i=$(t).parents("tr").nextAll("tr[data-parent-id="+n+"]");i.show(),App.front_department_roles.children_list_all_show(i);var a=$(this).parents("tr").find(".edit-patterns"),s=$.map(a,function(e){return{pattern_id:$(e).attr("data-current-pattern-id"),pattern_name:$(e).text(),accessed_department_id:$(e).parent().data("accessed-department-id")}});App.front_department_roles.inheritance_recursion(i,s)}})},inheritance_recursion:function(e,i){e.each(function(e,t){if($.each(i,function(){var e=$(t).children("td[data-accessed-department-id="+this.accessed_department_id+"]").children("span");e.attr("data-current-pattern-id",this.pattern_id),e.text(this.pattern_name),App.front_department_roles.text_red(e)}),$(t).find("button.folding").length){var n=$(t).nextAll("tr[data-parent-id="+$(t).find("button.folding").parent("th").data("department-id")+"]");App.front_department_roles.inheritance_recursion(n,i)}})},text_red:function(e){e.attr("data-current-pattern-id")!=e.attr("data-origin-pattern-id")&&e.addClass("changed_data")},error_frame:function(){if(""!=$("#department_role").val()){var e=JSON.parse($("#department_role").val()),t=JSON.parse($("#role_patterns").val());for(var n in e)for(var i in e[n])$("td#"+n+"_"+i).find("span").attr("data-current-pattern-id",e[n][i]),$("td#"+n+"_"+i).find("span").text(t[e[n][i]])}if($("div#error").length){var a=$("div#error").data("not-exist-pattern-id");$.each(a,function(e,t){$("span[data-current-pattern-id="+t+"]").parents("td").addClass("error_frame"),$("span[data-current-pattern-id="+t+"]").text(I18n.t("js.department_roles.error"))})}},accessed_department_title:function(){var e=$(".access_pattern_table thead").width(),t=$(".access_pattern_table ").innerWidth(),n=window.navigator.userAgent.toLowerCase(),i=0<=n.indexOf("trident"),a=0<=n.indexOf("edge");if(t<e){i||a?$(".department-role-header").prepend('<div class="accessed_department_title">'+I18n.t("js.department_roles.access_department")+"</div>"):$("#table-wrapper").prepend('<div class="accessed_department_title">'+I18n.t("js.department_roles.access_department")+"</div>");var s=$("th.access_department").innerWidth(),o=s+(t-s)/2-$(".accessed_departments").innerWidth()/2;$(".accessed_department_title").css("position","absolute"),$(".accessed_department_title").css("top","15px"),$(".accessed_department_title").css("z-index","10"),$(".accessed_department_title").css("left",o+"px")}else $(".department-role-header").prepend('<div class="accessed_department_title">'+I18n.t("js.department_roles.access_department")+"</div>")}},App.front_departments={index:function(){function t(e){$(".btn").prop("disabled",!0),$("#loading").show();var t=$(e).closest("li"),n=$(e).closest("div").find(".edit-name").val();t.data("depth");if($(e).hasClass("add_decision")||$(e).hasClass("add_decision_input")){var i=$(e).closest("ul").closest("li").data("department-id"),a=$(e).closest("li").data("sort"),s=$(e).closest("li").data("depth");$("#department_name").val(n),$("#department_parent_department_id").val(i),$("#department_sort").val(a),$("#department_depth").val(s),$("#department_department_list_id").val(t.attr("id")),$("#department_edit_form").attr("method","post"),$("#department_edit_form").attr("action","/xhr/departments/create"),$("#department_edit_form").submit()}else{var o=I18n.t("js.common.confirm_save"),r=$(e).closest("li").data("department-id");confirm(o)?($("#department_id").val(r),$("#department_name").val(n),$("#department_department_list_id").val(t.attr("id")),$("#department_edit_form").attr("method","patch"),$("#department_edit_form").attr("action","/xhr/departments/update"),$("#department_edit_form").submit()):$("#loading").hide()}}function n(e){e.find(".edit-name").val(e.children("span").eq(0).text()),e.children("span").addClass("none"),e.children("span").eq(2).removeClass("none"),e.children("span").eq(3).removeClass("none"),e.children("span").eq(4).removeClass("none")}App.front_departments.ajax_load(),App.front_departments.inifinite_scroll(),App.front_departments.departments_count_limit_3000(),$(".forbid-delete").prop("disabled",!0),App.front_departments.folding(),App.front_departments.disabled_tooltip(),ie_click_flag=!1,IE_ERROR_MSG=I18n.t("js.departments.dep_in_operation"),$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip()}),$(document).on("click",".user_link",function(){if(1==ie_click_flag)return alert(IE_ERROR_MSG),!1;ie_click_flag=!0,App.front_departments.disabled_by_add_or_edit()}),$(document).on("click",".add_top",function(){if(1==ie_click_flag)return alert(IE_ERROR_MSG),!1;ie_click_flag=!0,App.front_departments.disabled_by_add_or_edit(),0==$("#parent").children("ul").length&&$("#parent").append('<ul class="dd-list" id="department_tree"></ul>'),$("#department_tree").data("routes-depth-size")>$("#department_tree").children("li").length?App.front_departments.department_display_all("add_top"):App.front_departments.node_add_top()}),$(document).on("click",".add",function(){function e(){sort=t(n),n.children("ul").append("<li data-depth="+(parseInt(n.data("depth"))+1)+" data-sort="+sort+' data-department-id = "" id="new_department_list">'+App.front_departments.create_text()+"</li>"),n.children("ul").find("li").last().addClass("dd-item"),App.front_departments.disabled_by_add_or_edit(),$("html, body").animate({scrollTop:n.find("li").filter(":last").offset().top-145},400,"swing"),n.children("ul:last").find(".edit-name").focus()}function t(e){return(sort=0)==e.children("ul").children("li").length?sort=1:sort=e.children("ul").children("li").last().data("sort")+1,sort}var n=$(this).closest("li"),i=n.children("button");if(1==ie_click_flag)return alert(IE_ERROR_MSG),!1;if(ie_click_flag=!0,0==n.children("ul").length)n.append('<ul class="dd-list"></ul>'),e();else if(i.nextAll(".dd-list").find(".dd-item").length)i.attr("data-action","collapse"),i.nextAll("ul").show(),e();else{App.front_departments.children_list_show(i).done(function(){e()})}}),$(document).on("click",".edit",function(){if(1==ie_click_flag)return alert(IE_ERROR_MSG),!1;ie_click_flag=!0;var e=$(this).closest("li");n(e.children("div:first")),e.find(".edit-name").focus(),e.find(".edit-name").select(),App.front_departments.disabled_by_add_or_edit()}),$(document).on("click",".cancel",function(){ie_click_flag=!1;var e=$(this).closest("li");$(this).hasClass("add_cancel")?(1==$(this).closest("ul").find("li").length&&$(this).closest("ul").remove(),e.remove(),$('#parent ul.department_tree li[data-depth="1"]:last-child').addClass("last-node")):App.front_departments.edit_cancel(e.children("div:first")),$("#department_tree").data("routes-depth-size")>$("#department_tree").children("li").length&&App.front_departments.inifinite_scroll(),App.front_departments.remove_disabled()}),$(document).on("click",".input",function(){$(this).children().eq(0).focus()}),$(document).on("click",".decision",function(){t($(this))}),ENTER_FLG=!0,$(document).on("keydown",".edit-name",function(e){13==e.keyCode&&ENTER_FLG&&(ENTER_FLG=!1,t($(this)))}),$(document).on("click",".delete",function(){if(1==ie_click_flag)return alert(IE_ERROR_MSG),!1;var e=I18n.t("js.common.confirm_delete",{name:$(this).closest("li").find(".de_tip").text()});if(confirm(e)){$(".btn").prop("disabled",!0),$("#loading").show();var t=$(this).closest("li"),n=$(this).closest("li").data("department-id");$("#department_id").val(n),$("#department_department_list_id").val(t.attr("id")),$("#department_edit_form").attr("method","delete"),$("#department_edit_form").attr("action","/xhr/departments/destroy"),$("#department_edit_form").submit()}}),$(document).on("mouseover",".de_tip",function(){$(this).attr("title",App.front_departments.create_title($(this).data("username"))).tooltip("fixTitle").tooltip("show")}),$(document).on("mouseout",".de_tip",function(){$(this).tooltip("destroy")}),$(function(){$("#file_tag").change(function(){$(this).closest("form").submit()})}),$("#import-btn").click(function(){return $("#file_tag").click(),!1})},edit:function(){App.front_departments.ajax_load(),$("#loading").show(),$.ajax({url:"/xhr/departments/departments_tree_html",type:"GET",dataType:"html"}).done(function(e){var n;$("#department_tree").append(e),$("#parent").nestable({listNodeName:"ul",itemIdAttribute:"data-id",maxdepth:5,scroll:!0,scrollSpeed:20,onDragStart:function(){$(".tooltip").remove(),n=JSON.stringify($(".dd").nestable("serialize"))},callback:function(e,t){n!=JSON.stringify($(".dd").nestable("serialize"))&&t.find("div").css("color","red")}}),$('[data-toggle="tooltip"]').tooltip(),$("#departments_tree_data").val(JSON.stringify($("#parent").nestable("toArray"))),$("#loading").hide()}),$("#all_open").on("click",function(){$(".dd").nestable("expandAll")}),$("#all_close").on("click",function(){$(".dd").nestable("collapseAll")}),$(document).on("change",function(){$("#departments_tree_data").val(JSON.stringify($("#parent").nestable("toArray")))}),$(document).on("mouseover",".de_tip",function(){$(this).attr("title",App.front_departments.create_title($(this).data("username"))).tooltip("fixTitle").tooltip("show")}),$(document).on("mouseout",".de_tip",function(){$(this).tooltip("destroy")})},update:function(){this.edit()},create_text:function(){return'<div class="row-span group-icon">\n<span class="none"></span>\n<span class="none">0</span>\n<span class="input row-span"><input type="text" name="name" class="edit-name add_decision_input" value=""></span>\n<span class="ml10 row-span"><a href="javascript:void(0)" class="sub-bnt decision add_decision task-button" tabindex="-1">'+I18n.t("js.common.save")+'</a></span>\n<span class="ml15 row-span"><span class="sub-bnt cancel add_cancel delete-button">'+I18n.t("js.common.cancel")+'</span></span>\n<span class="none"></span>\n<span class="none"></span>\n<span class="none"></span>\n<span class="none"></span>\n</div>'},create_title:function(e){var t="";for(var n in e)t+=e[n]+"<br>";return t},disabled_by_add_or_edit:function(){0==0<=window.navigator.userAgent.toLowerCase().indexOf("trident")&&$(".add,.edit,.delete,.user_link,.add_top,.folding,#all_open,#all_close").addClass("add-disabled"),$(".user_link").removeAttr("onclick","target"),$(".add-disabled").prop("disabled",!0),$(document).off("mouseover",".forbid-add,.forbid-delete,.add-disabled,.limit-department"),$(window).off("scroll")},folding:function(){$(document).on("click",".dd-item button",function(){"expand"==$(this).attr("data-action")?App.front_departments.children_list_show(this):($(this).attr("data-action","expand"),$(this).nextAll("ul").hide())}),$(document).on("click","#all_open",function(){if(1==ie_click_flag)return alert(IE_ERROR_MSG),!1;$(window).off("scroll"),App.front_transfer_tools.children_dom_check($("#department_tree").children("li"),!0)&&$("#department_tree").data("routes-depth-size")<=$("#department_tree").children("li").length?($("#department_tree .dd-list").show(),$("#department_tree .folding").attr("data-action","collapse")):App.front_departments.department_display_all("all_open")}),$(document).on("click","#all_close",function(){if(1==ie_click_flag)return alert(IE_ERROR_MSG),!1;$("#department_tree .dd-list").hide(),$("#department_tree .folding").attr("data-action","expand")})},children_list_show:function(t){if(!$(t).nextAll(".dd-list").find(".dd-item").length){parent_id=$(t).parent("li").data("department-id");var e=new $.Deferred;return App.front_departments.load_list(parent_id),$.ajax({url:"/xhr/departments/append_children/",type:"GET",dataType:"html",data:{parent_id:parent_id},context:$(t)}).done(function(e){$(t).attr("data-action","collapse"),$(t).nextAll(".dd-list").empty(),$(t).nextAll(".dd-list").append(e),$(t).nextAll("ul").show(),$(".forbid-delete,.forbid-add").prop("disabled",!0)}).fail(function(){App.front_departments.ajax_error_message()}).always(function(){App.front_departments.departments_count_limit_3000(),$("#loading-list").remove(),e.resolve()}),e}$(t).attr("data-action","collapse"),$(t).nextAll("ul").show()},department_display_all:function(t){App.front_departments.ajax_load(),$("#loading").show(),$.ajax({url:"/xhr/departments/departments_tree_index_html",type:"GET",data:{btn_name:t},dataType:"html"}).done(function(e){var n=parseInt($("#department_search_user_all").val());$("#department_tree").empty(),$("#department_tree").append(e),$('[data-toggle="tooltip"]').tooltip(),$(".forbid-add, .forbid-delete").prop("disabled",!0),$("#department_tree").find("li").each(function(){var e=$(this).data("department-id"),t="App.front_users.get_modal_to_related_users('#user_relation"+e+"',"+n+","+e+",true);";$(this).find(".user_link").first().attr("onclick",t)}),$("#department_tree .dd-list").show(),$("#department_size").val($("#department_tree").children("li").length),$("#loading").hide(),"add_top"==t&&App.front_departments.node_add_top(),App.front_departments.departments_count_limit_3000(),$(".dd-list-last").show(),$('#parent ul.department_tree li[data-depth="1"]:last-child').addClass("last-node")}).fail(function(){App.front_transfer_tools.ajax_error_message()})},node_add_top:function(){(sort=0)!=$("#department_tree").children("li").length&&(sort=$("#department_tree").children("li").last().data("sort")),$("#parent ul:first").append('<li class="dd-item last-node" data-depth="1" data-sort='+(sort+1)+' data-department-id = "" id="new_department_list">'+App.front_departments.create_text()+"</li>"),$("html, body").animate({scrollTop:$("#parent").find("#new_department_list").offset().top},400,"swing"),$(".edit-name").last().focus()},edit_cancel:function(e){e.children("span").removeClass("none"),e.children("span").eq(2).addClass("none"),e.children("span").eq(3).addClass("none"),e.children("span").eq(4).addClass("none")},confirm_text:function(e,t,n){e='<div class="row-span group-icon">\n<span class="text de_tip" data-html="true" data-username="[]">'+e+'</span>\n<span class="text">'+I18n.t("js.departments.no_person")+'</span>\n<span class="input none row-span"><input type="text" name="name" class="edit-name" value=""></span>\n<span class="ml10 none row-span"><a href="javascript:void(0)" class="sub-bnt decision task-button" tabindex="-1">'+I18n.t("js.common.save")+'</a></span>\n<span class="ml15 none row-span"><span class="sub-bnt cancel delete-button">'+I18n.t("js.common.cancel")+"</span></span>\n";return e+=t<5?'<span class="ml10 row-span"><span class="sub-bnt add add-information-button">'+I18n.t("js.common.add")+"</span></span>\n":'<span class="ml10 row-span"><span class="sub-bnt add add-information-button forbid-add">'+I18n.t("js.common.add")+"</span></span>\n",e+='<span class="ml15 row-span"><span class="sub-bnt edit edit-button">'+I18n.t("js.common.edit")+'</span></span>\n<span class="ml15 row-span"><span class="sub-bnt delete delete-button">'+I18n.t("js.common.delete")+"</span></span>\n",e+='<span class="ml15 row-span"><a class="sub-bnt user_link group_button" href="javascript:void(0)" tabindex="-1"">'+I18n.t("js.departments.user_link")+'</a>\n<input type="hidden" id="user_relation'+n+'" data-department-id="'+n+'"data-relation-flg="false"></span>\n</div>'},add_collapse:function(e){0==e.children("button").length&&0==e.children("#department_tree").length&&e.prepend('<button class="folding" data-action="collapse">Expand></button>')},remove_disabled:function(){var n=parseInt($("#department_search_user_all").val());$(".add-disabled,.btn").prop("disabled",!1),$(".add,.edit,.delete,.user_link,.add_top,.folding,#all_open,#all_close").removeClass("add-disabled"),$("#department_tree").find("li").each(function(){var e=$(this).data("department-id"),t="App.front_users.get_modal_to_related_users('#user_relation"+e+"',"+n+","+e+",true);";$(this).find(".user_link").first().attr("onclick",t)}),$(".forbid-add, .forbid-delete,.limit-department").prop("disabled",!0),$(document).on("mouseover",App.front_departments.disabled_tooltip())},disabled_tooltip:function(){$(document).on("mouseover",".forbid-add,.forbid-delete,.add-disabled,.limit-department",function(){if($(this).text()==I18n.t("js.common.delete"))var e=I18n.t("js.departments.not_deleted");else if($(this).text()==I18n.t("js.common.add")&&$(this).hasClass("limit-department"))e=I18n.t("js.departments.cant_add_dep");else if($(this).text()==I18n.t("js.common.add")&&$(this).hasClass("forbid-add")||$(this).hasClass("add-disabled"))e=I18n.t("js.departments.cant_add_hierarchy");$(this).attr("title",e).tooltip("fixTitle").tooltip("show")}),$(document).on("mouseout",".forbid-add,.forbid-delete,.add-disabled,.limit-department",function(){$(this).tooltip("destroy")})},ajax_load:function(){var e=$("<div>");e.attr("id","loading");var t=$("<div>");t.attr("id","spinner"),e.append(t),$("html").prepend(e),$(document).on("ajax:error",function(){$(".btn").prop("disabled",!1),$("#loading").hide(),App.front_departments.ajax_error_message()})},inifinite_scroll:function(){20<$("#department_tree").data("routes-depth-size")?$(window).on("scroll",function(){var e=$(document).height()-($(window).height()+$(window).scrollTop());-3<e&&e<3&&($("#loading").show(),$(window).off("scroll"),$("#department_edit_form").attr("method","get"),$("#department_edit_form").attr("action","/xhr/departments/next_departments"),$("#department_edit_form").submit())}):($(".dd-list-last").show(),$('#parent ul.department_tree li[data-depth="1"]:last-child').addClass("last-node"))},load_list:function(e){var t=$("<div>");t.attr("id","loading-list");var n=$('<i class="fa fa-spinner fa-pulse fa-3x loading"></i>');n.attr("id","spinner-list"),t.append(n),$("li#"+e).before(t),$("#loading-list").show()},ajax_error_message:function(){$("div#alert-message").html('        <div class="row">          <div class="col-xs-12">            <div class="alert alert-danger alert-error alert-dismissible" role="alert">              <button type="button" class="close" data-dismiss="alert" aria-label="Close">                <span aria-hidden="true">&times;</span>              </button>              <ul>                <li style="word-wrap: break-word;">'+I18n.t("js.common.communication_failed")+"</li>              </ul>            </div>          </div>        </div>")},departments_count_limit_3000:function(){3e3==$("#department_tree").data("department-all-size")?($(".add,.add_top").addClass("limit-department"),$(".limit-department").prop("disabled",!0)):($(".limit-department").prop("disabled",!1),$(".add,.add_top").removeClass("limit-department"))}},App.destinations_visible_fields={setup_list_visible_setting:function(e,t){var n=App.concerns.set_float_table_header(t);return $("#destinations_visible_fields_setting_dialog").find(".js_list_field").change(function(){n.floatTheadOff(),App.destinations_visible_fields.change_visibility($(this)),n.floatTheadOn()}),$("#destinations_visible_fields_setting_dialog").find("#destinations_enable_horizontal_scroll_flg").change(function(){App.destinations_visible_fields.change_horizontal_scroll($(this))}),n},show_list_fields_setting:function(e,t,n){void 0===e&&(e=I18n.t("js.visible_fields.set_search")),void 0===t&&(t=I18n.t("js.common.close")),void 0===n&&(n=I18n.t("js.common.select_item")),$("html,body").scrollLeft(0);var i=$("#modal_block_for_send_mail").length?window.innerHeight:"auto";$("#destinations_visible_fields_setting_dialog").removeClass("hide").dialog({modal:!0,title:e,width:400,title_html:!0,draggable:!0,maxHeight:i,buttons:[{text:t,"class":"btn btn-primary btn-xs",click:function(){$(this).dialog("close")}}],open:function(){$("body,html").css({"word-wrap":"break-word"}),$(document).trigger("floatTableUpdate"),$(".ui-widget-overlay").css("z-index",1081),$("#destinations_visible_fields_setting_dialog").parent(".ui-dialog").css({"z-index":1082})},beforeClose:function(){if(0==$(this).find("input[name=visible_fields\\[\\]]:checked:visible").length)return alert(n),!1},close:function(){var e=[];$(this).find("input[type=checkbox]:checked").each(function(){e.push($(this).val())}),App.destinations_visible_fields.save_visible_fields(e.join(",")),$(document).trigger("floatTableUpdate"),$("#destinations_visible_fields_setting_dialog").addClass("hide")}})},change_visibility:function(e){var t=$("#leads_result_for_target_tab .js_visibility_"+e.val());t.is(":visible")?t.hide():t.show()},change_horizontal_scroll:function(n){$("#destinations_visible_fields_setting_dialog input[type=checkbox]:checked").each(function(){var e=$(".js_visibility_"+$(this).val()),t=e.data("min-width");n.prop("checked")?e.css("min-width",t+"px"):e.css("min-width","")})},save_visible_fields:function(){$("#frm_destinations_visible_fields").submit()}},App.front_detail_master_items={ITEM_TYPES:{ITEM_TYPE_SELECT:[4,5,6],CALCULATE:10},"new":function(){this.submit_new(),this.submit_list(),$("#item_item_type").on("change",function(){App.front_detail_master_items.display_item_datas()}),this.change_index(),App.front_items.change_event_decimal_point(),App.front_detail_master_items.handle_calculate_item(),App.front_detail_master_items.reset_local_storage(),App.front_items.check_attr_label_in_sample_max()},create:function(){this.submit_new(),this.submit_list(),this.display_item_datas(),this.change_index(),$("#item_item_type").on("change",function(){App.front_detail_master_items.display_item_datas(),App.front_detail_master_items.set_first_value_item_select()}),$(".sample-calculate").trigger("change"),App.front_items.change_event_decimal_point(),App.front_items.control_decimal_point($("#item_item_type").val()),App.front_items.handle_round_result(),App.front_detail_master_items.handle_calculate_item(),App.front_detail_master_items.set_first_value_item_select(),App.front_items.handle_error_calculate(),App.front_items.check_attr_label_in_sample_max(),App.front_detail_master_items.show_message_sample_max(),App.front_items.handle_update_length_db()},edit:function(){this.submit_edit(),this.submit_list(),this.submit_detail(),this.display_item_datas(),$("#item_item_type").on("change",function(){App.front_detail_master_items.display_item_datas()}),this.change_index(),App.front_items.handle_add_value_result_sample_hidden(),App.front_detail_master_items.handle_calculate_item(),App.front_detail_master_items.reset_local_storage(),App.front_items.check_attr_label_in_sample_max(),App.front_detail_master_items.show_message_sample_max()},update:function(){this.submit_edit(),this.submit_list(),this.submit_detail(),this.display_item_datas(),this.change_index(),$("#item_item_type").on("change",function(){App.front_detail_master_items.display_item_datas(),App.front_detail_master_items.set_first_value_item_select()}),App.front_detail_master_items.set_first_value_item_select(),App.front_detail_master_items.handle_calculate_item(),$(".sample-calculate").trigger("change"),App.front_items.check_attr_label_in_sample_max(),App.front_detail_master_items.show_message_sample_max(),App.front_items.handle_round_result(),App.front_items.handle_update_length_db()},show:function(){this.submit_list(),this.submit_edit()},submit_new:function(){$("#new_submit").on("click",function(){$("#new_submit").prop("disabled",!0),$("#btn_list").prop("disabled",!0),App.front_detail_master_items.storage_content_item_type_select(),parseFloat($("#item_item_type").val())==App.front_detail_master_items.ITEM_TYPES.CALCULATE?$(".sample-calculate").trigger("change"):$(".check-valid-calculate").attr("value","true"),$("form.new_item").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$(this).prop("disabled",!0),$("#btn_list").prop("disabled",!0),$("#btn_detail").prop("disabled",!0),App.front_detail_master_items.storage_content_item_type_select(),parseFloat($("#item_item_type").val())==App.front_detail_master_items.ITEM_TYPES.CALCULATE?$(".sample-calculate").trigger("change"):$(".check-valid-calculate").attr("value","true"),$("form.edit_item").submit(),$("#btn_delete").attr("disabled",!0)})},submit_delete:function(){$("#btn_delete").on("click",function(){$(this).attr("disabled",!0),$("#edit_submit").prop("disabled",!0),$("#btn_list").prop("disabled",!0)})},submit_list:function(){$("#btn_list").on("click",function(){$(this).attr("disabled",!0),$("#new_submit").prop("disabled",!0),$("#edit_submit").prop("disabled",!0),$("#btn_detail").prop("disabled",!0),$("#btn_delete").attr("disabled",!0),$("#btn_edit").prop("disabled",!0)})},submit_detail:function(){$("#btn_detail").on("click",function(){$(this).prop("disabled",!0),$("#btn_list").prop("disabled",!0),$("#edit_submit").prop("disabled",!0)})},display_item_datas:function(){var e=$("#item_item_type").val();"4"==e||"5"==e||"6"==e?$(".item_datas").show():$(".item_datas").hide()},change_index:function(){$(".sortable").sortable({cursor:"move",opacity:.7,items:"li.fields",update:function(){$("[name=sort_order]").val($(".sortable").sortable("toArray"))}}),$(".sortable").disableSelection()},handle_calculate_item:function(){App.front_items.select_option_calculate(),App.front_items.add_formula_to_calculate(),App.front_items.show_calculate_segment(),$(".result-sample-hidden").text($(".result-sample").text()),$(".round-sample").trigger("change")},set_first_value_item_select:function(){var e=JSON.parse(localStorage.getItem("item_calculate"));e=e||{},Object.values(App.front_detail_master_items.ITEM_TYPES.ITEM_TYPE_SELECT).includes(parseInt($("#item_item_type").val()))?$("#item_item_datas_attributes_0_value").val(e.item_select):parseInt($("#item_item_type").val())==App.front_detail_master_items.ITEM_TYPES.CALCULATE&&($(".result-sample").html(e.result_sample),$(".param-value-calculate").first().val(e.param_value_calculate))},storage_content_item_type_select:function(){var e=JSON.parse(localStorage.getItem("item_calculate"));e=e||{},Object.values(App.front_detail_master_items.ITEM_TYPES.ITEM_TYPE_SELECT).includes(parseInt($("#item_item_type").val()))?(e.item_select=$("#item_item_datas_attributes_0_value").val(),localStorage.setItem("item_calculate",JSON.stringify(e))):parseInt($("#item_item_type").val())==App.front_detail_master_items.ITEM_TYPES.CALCULATE&&(e.result_sample=$(".result-sample").text(),e.param_value_calculate=App.front_detail_master_items.get_param_value_calculate(),e.item_formula=$(".formula-value").html(),localStorage.setItem("item_calculate",JSON.stringify(e)))},reset_local_storage:function(){localStorage.removeItem("item_calculate")},get_param_value_calculate:function(){var t="";return $(".formula-value").contents().each(function(){if((e=$(this).attr("value"))==undefined)var e=$(this).text();t+=e}),t.replace(/\s\s+/g," ")},show_message_sample_max:function(){$("#item_item_type").val()==String(App.front_detail_master_items.ITEM_TYPES.CALCULATE)&&($(".formula-value").attr("title",""),10<=$(".attr-label-in-sample").length&&$(".add_formula").prop("disabled",!0),$(".formula-value").on("click",function(){10<=$(".attr-label-in-sample").length?$(".error-length-label").show():$(".error-length-label").hide()}))}},window.detail_masters={xhr:{search_detail_masters_list:null}},App.front_detail_masters={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#search_clear"),App.concerns.disable_duplicate_request_search_form("#form_search_detail_masters",".js-disable-btn"),App.concerns.datepicker(".search_datepicker"),App.concerns.fetch_remote_list("#form_search_detail_masters","#detail_master_lists_area",window.detail_masters.xhr.search_detail_masters_list,!0,"#search_submit"),this.change_display_number("form_get_custom_item"),this.set_index(),this.change_content_tab(),this.change_index(),this.collapse_icon(".js-search-collapse",!0),this.handle_bulk_destroy(),this.user_information(),this.button_disabled("#search_clear"),this.button_disabled(".new-button"),this.edit_default_item(),this.show_default_item(),$("#search_display_flg").on("change",function(){App.concerns.disabled_btn(".js-disable-btn"),$("#form_search_detail_masters").submit()}),$("#content_tab_detail_master").on("click",function(){this.className.includes("active")||$("#form_search_detail_masters").submit()}),$("#csv_dl_submit").on("click",function(){App.concerns.remove_export_ids();var e="#form_search_detail_masters";App.concerns.set_export_ids(e,"checked[detail_master_ids][]");var t=$(".pagination > li.active a").html(),n=parseInt(t);App.concerns.set_page_parameter_custom_value(e,n);var i=$(e),a=i.attr("action");i.attr("action",$(this).data("action")),i.removeAttr("data-remote"),i.removeData("remote"),i.removeAttr("data-loading"),i.removeData("loading"),i.submit(),i.attr("action",a),i.attr("data-remote","true"),i.attr("data-loading","true"),App.concerns.remove_export_ids(),$("#page_for_export").remove()}),$("#csv_all_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(1);var e=$("#form_search_detail_masters"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),e.removeAttr("data-loading"),e.removeData("loading"),e.submit(),e.attr("action",t),e.attr("data-remote","true"),e.attr("data-loading","true"),$("#csv_all_dl_flg").val(0)}),$("#import_new").on("click",function(
){return $("#file_import_new").trigger("click"),!1}),$("#file_import_new").on("change",function(){App.front_detail_masters.handle_import_file($(this))}),$("#import_update").on("click",function(){return $("#file_import_update").trigger("click"),!1}),$("#file_import_update").on("change",function(){App.front_detail_masters.handle_import_file($(this))}),$("#destroy_and_import_new").on("click",function(){if(confirm(I18n.t("js.detail_masters.sure_delete")))return $("#file_destroy_and_import_new").trigger("click"),!1}),$("#file_destroy_and_import_new").on("change",function(){$("#destroy_all_products").val("true"),App.front_detail_masters.handle_import_file($(this))})},show:function(){App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_daily_report_submit",!0),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_deal_submit",!0),$(document).on("click",".page-top",function(){$("html,body").animate({scrollTop:0},100)}),$("#search_deal").on("click",function(){$(this).css("pointer-events","none"),$("#js_form_search_deals").submit()}),$("#search_daily_report").on("click",function(){$(this).css("pointer-events","none"),$("#js_form_search_daily_reports").submit()})},"new":function(){App.concerns.datepicker(),this.submit_new(),this.submit_new_next()},edit:function(){App.concerns.datepicker(),this.submit_edit(),this.submit_edit_next()},create:function(){App.concerns.datepicker(),this.submit_new(),this.submit_new_next()},update:function(){App.concerns.datepicker(),this.submit_edit(),this.submit_edit_next()},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("form.new_detail_master").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$(this).attr("disabled",!0),$("form.edit_detail_master").submit()})},submit_new_next:function(){$("#new_next_submit").on("click",function(){$(this).attr("disabled",!0),$("#next_flg").val("1"),$("form.new_detail_master").submit()})},submit_edit_next:function(){$("#edit_next_submit").on("click",function(){$(this).attr("disabled",!0),$("#next_flg").val("1"),$("form.edit_detail_master").submit()})},handle_import_file:function(e){var t=$("#form_checked_detail_masters"),n=t.attr("action");t.attr("action",e.data("action")),t.removeAttr("data-remote"),t.removeData("remote"),t.submit(),t.attr("action",n),t.attr("data-remote","true"),$("#destroy_all_products").val("false")},change_content_tab:function(){var e=$("#content_tab_1"),t=$("#content_tab_2");$(document).on("change",".content_tab",function(){e.is(":checked")?($(".content_list_detail_master").show(),$(".content_list_item").hide(),$(".checkbox-search").show()):t.is(":checked")&&($(".content_list_detail_master").hide(),$(".content_list_item").show(),$(".checkbox-search").hide())})},change_index:function(){$(".sortable").sortable({cursor:"move",opacity:.7,item:"tr.item",update:function(){var e=new URLSearchParams(window.location.search).get("items_page"),t=$("#per_page").val();$.ajax({url:"/xhr/items/update_positions/update",type:"PATCH",dataType:"json",data:{display_items_position:$(this).sortable("toArray"),page:e,per_page:t}}).done(function(){}).fail(function(e){console.log(e.status),500===e.status&&alert(I18n.t("js.common.occurred_error"))})}}),$(".sortable").disableSelection()},collapse_icon:function(e,t){$(document).on({"shown.bs.collapse":function(){$(this).hasClass("in")&&(t?$(this).prev(".activity-collapse-link").addClass("in"):$(this).parent().find(".activity-collapse-link").addClass("in"))},"hidden.bs.collapse":function(){$(this).hasClass("in")||(t?$(this).prev(".activity-collapse-link").removeClass("in"):$(this).parent().find(".activity-collapse-link").removeClass("in"))}},e)},handle_bulk_update:function(){App.concerns.datepicker(".modal_datepicker"),App.concerns.datepicker(".item_datepicker"),App.concerns.set_form_action_to_submit("#form_checked_detail_masters",".js-bulk-update",!0,!0),$(".js-open-bulk-update").on("click",function(e){e.preventDefault(),0<$("#form_checked_detail_masters").find("[name='checked[detail_master_ids][]']:checked").length?$("#detail_master_bulk_update_modal").modal("show"):($("#detail_masters_message_area").html($("<div class='row'>\n  <div class='col-xs-12'>\n    <div class='alert alert-danger alert-error alert-dismissible' role='alert'>\n      <button type='button' class='close' data-dismiss='alert' aria-label='Close'>\n        <span aria-hidden='true'>\xd7</span>\n      </button>\n      <ul>\n        <li style='word-wrap: break-word;'>"+I18n.t("js.common.please_select")+"</li>\n      </ul>\n    </div>\n  </div>\n</div>")),e.stopImmediatePropagation())});var a="#bulk_target_modal_sales_on, #detail_master_item_code",s="#detail_master_configs_deals_details_product_name_id, #detail_master_configs_deals_details_product_type_id",o="#detail_master_amount, #detail_master_gross_profit, #detail_master_volume, #detail_master_cost_price",r="#detail_master_display_flg_1, #detail_master_display_flg_0",l="input[name='detail_master[display_flg]']:checked",c="",d="",e=$("#custom_item_for_detail_master").find("input, textarea, select");$.each(e,function(e,t){if("INPUT"==t.tagName&&"text"==t.type||"TEXTAREA"==t.tagName)a=a.concat(", #"+t.id);else if("SELECT"==t.tagName)s=s.concat(", #"+t.id);else if("INPUT"==t.tagName&&"tel"==t.type)o=o.concat(", #"+t.id);else if("INPUT"==t.tagName&&"radio"==t.type){var n="input[name='"+t.name+"']:checked";r=r.concat(", #"+t.id),l.includes(n)||(l=l.concat(", "+n))}else if("INPUT"==t.tagName&&"checkbox"==t.type){var i="input[name='"+t.name+"']";n="input[name='"+t.name+"']:checked";""==c?(c=i,d=n):""==c||c.includes(i)||(c=c.concat(", "+i),d=d.concat(", "+n))}}),$.each(s.split(","),function(e,t){$(t).select2({width:"80%",allowClear:!0})});var t=a.concat(","+s);$(document).on("change input",t,function(){App.front_detail_masters.check_value_exists(t)||$(d).val()!=undefined||$(l).val()!=undefined||App.front_detail_masters.check_value_exists(o)?$("#detail_master_bulk-update_submit_btn").prop("disabled",!1):$("#detail_master_bulk-update_submit_btn").prop("disabled",!0)}),$(o).on("keypress",function(){App.front_detail_masters.check_value_exists(o)&&$("#detail_master_bulk-update_submit_btn").prop("disabled",!1)}),$(o).on("keydown",function(e){"Backspace"!=e.key&&"Delete"!=e.key||App.front_detail_masters.check_value_exists(t)||$(d).val()!=undefined||$(l).val()!=undefined||App.front_detail_masters.check_value_exists(o)||$("#detail_master_bulk-update_submit_btn").prop("disabled",!0)}),$(r).on("click",function(){$(l).val()==undefined?$("#detail_master_bulk-update_submit_btn").prop("disabled",!0):$("#detail_master_bulk-update_submit_btn").prop("disabled",!1)}),$(c).on("click",function(){App.front_detail_masters.check_value_exists(t)||$(d).val()!=undefined||$(l).val()!=undefined||App.front_detail_masters.check_value_exists(o)?$("#detail_master_bulk-update_submit_btn").prop("disabled",!1):$("#detail_master_bulk-update_submit_btn").prop("disabled",!0)}),$("#detail_master_bulk_update_modal").off("hidden.bs.modal").on("hidden.bs.modal",function(){$(this).find("#bulk_error_message").empty(),$(this).find("input, textarea").not(":button, :submit, :reset, [type='hidden'], .select2-input, [type='radio'], [type='checkbox']").val(""),$(this).find("[type='radio'], [type='checkbox']").prop("checked",!1),$(this).find("select").prop("selectedIndex",0),$(this).find("select").each(function(e,t){$(t).select2("data",null)}),$("#detail_master_bulk-update_submit_btn").prop("disabled",!0),"fixed"==$("body").css("position")&&$("body").css("position","static")}),$("#detail_master_bulk-update_submit_btn").prop("disabled",!0)},handle_bulk_destroy:function(){$(document).on("click",".js-bulk-destroy",function(e){e.preventDefault();var t=$(this),n=$("#form_checked_detail_masters"),i=$('#form_checked_detail_masters input[name="checked[detail_master_ids][]"]:checked');if($(".btn-group.open").removeClass("open"),0<i.length)t.data("action")&&n.attr("action",t.data("action")),n.submit();else{var a=App.concerns.buildNoticeHtml([I18n.t("js.common.please_select")],"danger");$("#detail_masters_message_area").html(a)}})},user_information:function(){$(document).on("click",".user_information",function(){if("block"===$(".user-information-show").css("display"))return $(".user-information-show").hide(),!1;var e=$(this).data("user-id"),t=$(this).offset().top,n=$(this).offset().left+$(this).width()/2;$("#position_top").val(t),$("#position_left").val(n),$("#user-information-form").attr("action","/xhr/user_communications/user_information_show/"+e),$("#user-information-form").submit()});new Clipboard(".clipboard-btn")},check_value_exists:function(e){var n=!1;return $.each(e.split(","),function(e,t){if(0<$(t).length&&""!=$(t).val())return!(n=!0)}),n},button_disabled:function(e){$(e).on("click",function(){$(e).attr("disabled",!0)})},edit_default_item:function(){$(".js_register_default_attribute").on("click",function(){var e=$(this).data("attribute-name"),t=$(this).data("action");$("#register_attribute_name").val(e),form=App.concerns.set_form_action("js_form_register_default_attribute",t,!1),form.submit()})},show_default_item:function(){$(".js_show_default_attribute").on("click",function(){var e=$(this).data("attribute-name"),t=$(this).data("action");$("#show_attribute_name").val(e),form=App.concerns.set_form_action("js_form_show_default_attribute",t,!1),form.attr("target","_blank"),form.submit()})},setup_list_visible_setting:function(e){$("#visible_fields_setting_dialog").find(".js_list_field").off("change"),$("#visible_fields_setting_dialog").find(".js_list_field").change(function(){App.visible_fields.change_visibility($(this))}),$("#visible_fields_setting_dialog").find("#enable_horizontal_scroll_flg").change(function(){App.visible_fields.change_horizontal_scroll($(this),e)})},set_index:function(){$("#search_configs_deals_details_product_name_id").select2(),$("#search_configs_deals_details_product_type_id").select2(),$("select[id^='search_item_select_detail_item_']").each(function(){$(this).select2()}),App.concerns.select_search_disable_user("search_create_user_id"),App.concerns.select_search_disable_user("search_update_user_id")},change_display_number:function(e){$("#per_page").on("change",function(){$("#"+e).submit()})}},App.front_display_templates={DISPLAY_TEMPLATE_DATA_TYPE_DAILY_REPORT:"1",DISPLAY_TEMPLATE_DATA_TYPE_DEAL:"2",DISPLAY_TEMPLATE_DATA_TYPE_BUSINESS_CARD:"3",DISPLAY_TEMPLATE_DATA_TYPE_LEAD:"4",index:function(){$(window).ready(function(){$("#q_data_type_eq").find(":selected").val()==App.front_display_templates.DISPLAY_TEMPLATE_DATA_TYPE_BUSINESS_CARD||$("#q_data_type_eq").find(":selected").val()==App.front_display_templates.DISPLAY_TEMPLATE_DATA_TYPE_LEAD?$("#template_index_department_visible").css("display","none"):$("#template_index_department_visible").css("display","inline")}),$("#q_data_type_eq").change(function(){this.value==App.front_display_templates.DISPLAY_TEMPLATE_DATA_TYPE_BUSINESS_CARD||this.value==App.front_display_templates.DISPLAY_TEMPLATE_DATA_TYPE_LEAD?$("#template_index_department_visible").css("display","none"):$("#template_index_department_visible").css("display","inline")}),App.concerns.change_display_number("form_search_display_templates"),App.concerns.change_order("form_search_display_templates"),$("#search_role_ids").select2({width:"100%"}),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},show:function(){App.concerns.set_form_action_to_submit("#js_copy_display_template_submit","#js_copy_display_template",!0),this.set_modal_event(),this.set_branch_modal_event(),CustomCombo.init(),this.initBranch(),this.set_deals_sheet_modal();var e="disabled"==$("#display-template-negotiation-settings").attr("disabled");$(document).on("click",".display-template-modal-caller",function(e){$(this).tooltip("hide"),e.currentTarget.setAttribute("disabled","disabled");var t=$(this).closest(".modal");0<t.length?t.children(".display-template-modal-caller").css("pointer-events","none"):$(".display-template-modal-caller").not(".modal .display-template-modal-caller").css("pointer-events","none")}),$(document).on("hidden.bs.modal",".modal",function(){$(".display-template-modal-caller").attr("disabled",null),$(".display-template-modal-caller").css("pointer-events",""),e&&$("#display-template-negotiation-settings").attr("disabled",!0)})},"new":function(){this.init_form(),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),App.concerns.select_search_product_items(),this.handle_render_input_item("product_master_sort_order"),this.handle_render_input_item("detail_master_filter_1"),this.handle_render_input_item("detail_master_filter_2"),this.handle_render_input_item("detail_master_filter_3")},copy:function(){this.init_form(),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},create:function(){this.init_form(),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},edit:function(){this.init_form(),this.handle_use_detail_master_statistical_flg(),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),$("#display_template_detail_flg").prop("disabled",$("#use_product_master_flg").prop("checked")),$("#use_product_master_flg").prop("disabled",!$("#display_template_detail_flg").prop("checked")),$("#detail_master_filter_1, #detail_master_filter_2, #detail_master_filter_3").trigger("select2:select")},update:function(){this.init_form(),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},modal_open:function(n){$.ajax({url:n.data("href"),dataType:"html",data:n.data("params")}).done(function(e){var t=$("#modalContainer");t.html(e),t.find(".hidden-xs").addClass("hidden-xs-on-modal"),t.off("shown.bs.modal"),t.off("hidden.bs.modal"),t.on("shown.bs.modal",function(){modal_dom=$(document).find(".modal-open"),modal_dom[0]&&($(".modal-backdrop").css("z-index",1020),t.css("z-index",1035)),t.scrollTop(0),n.trigger("load_modal",[t])}).on("hidden.bs.modal",function(){t.empty()}).modal("show")})},set_deals_sheet_modal:function(){$(document).on("click","[data-hp-role='edit_deals_sheet']",function(){App.front_display_templates.modal_open($(this))}),$(document).on("load_modal","[data-hp-role='edit_deals_sheet']",function(){function t(t){$(".process_notice").hide();var a=$("#rule_tables"),s=a.clone(),e=a.find(".rule_form_table"),i=[];$.each(e,function(e,t){var n=$(t).attr("id").replace("rule_form_table_","");i.push(n)}),i=i.sort(),t&&(i=i.filter(function(e){return e!=t})).unshift(t),a.empty(),$.each(i,function(e,t){var n="#rule_form_table_"+t,i=s.find(n)[0];a.append(i)}),$(document).on("change",".interval_days_form",function(){n();var e=this.value,t="#"+$(this).attr("id")+"_val";$(t).val(e)}),a.find("#rule_form_table_"+t).find(".process_notice").show()}function n(){$(".interval_days_form").each(function(e,t){for(var n="input[id='"+($(t).attr("id")+"_val")+"'][type='hidden']";1<$(n).length;)$(n)[1].remove()})}function e(){$("#deals_sheet_form [data-hp-role='selected'] option").prop("selected",!0),$.ajax({type:"POST",url:"/xhr/display_templates/"+$setup_wizard.data("display-template-id")+"/deals_sheets/preview",data:$("#deals_sheet_form").serialize()}).done(function(e){$("#step7").html(e)})}function i(e,t){t&&"4"==t&&0<$("#deals_sheet_received_order_flg:checked").length&&0==$("#deals_sheet_received_order_causes option").length?alert(I18n.t("js.common.select_item")):t&&"5"==t&&0<$("#deals_sheet_failed_order_flg:checked").length&&0==$("#deals_sheet_failed_order_causes option").length?alert(I18n.t("js.common.select_item")):($("#deals_sheet_form [data-hp-role='selected'] option").prop("selected",!1),$("#deals_sheet_form [data-hp-role='un_selected'] option").prop("selected",!1),$('a[data-toggle="tab"][href="#step'+e+'"]').tab("show"))}function a(e){$("#popup-YouTube-player")[0].contentWindow.postMessage('{"event":"command","func":"'+e+'","args":""}',"*")}function s(e){var t=$(e).parent("li");t.addClass("passed"),t.prevAll("li").addClass("passed"),t.nextAll("li").removeClass("passed")}$setup_wizard=$(".setup-wizard"),$("#deals_sheet_deals_process_id").select2({allowClear:!0,placeholder:I18n.t("js.display_templates.select_process"),ajax:{url:function(e){return $(this).data("action")+"?name_cont="+encodeURIComponent(e)},dataType:"json",results:function(e){return e}},initSelection:function(e,t){var n=e.val();null!=n&&$.get(e.data("action"),{id_eq:n}).done(function(e){t(e.results[0])})}}),$("#deals_sheet_deals_process_id").on("change",function(){var e=this.value;e?$.ajax({type:"POST",url:"/xhr/deals_processes/get_deals_stage_id",data:{id:e}}).done(function(e){t(e.id)}):t()}),$("div.tab-pane:first").addClass("active"),!0===$setup_wizard.data("record-persisted")&&(i(7),e(),s($("a[href='#step7']").get(0))),$(document).on("click","[data-hp-role='move_step']",function(){a("pauseVideo"),i($(this).data("step"),$(this).data("cur-step")),!0===$(this).data("preview")&&e()}),$('a[data-toggle="tab"]').on("shown.bs.tab",function(e){s(e.target)}),App.concerns.init_side_by_side_select_fields($("#step2")).callSideBySideButton(),App.concerns.init_side_by_side_select_fields($("#step4")).callSideBySideButton(),App.concerns.init_side_by_side_select_fields($("#step5")).callSideBySideButton(),App.front_display_templates.change_manual_required_flg_of_option("#deals_sheet_received_order_causes","#js_change_manual_required_received_flg"),App.front_display_templates.change_manual_required_flg_of_option("#deals_sheet_failed_order_causes","#js_change_manual_required_failed_flg"),App.front_display_templates.set_manual_required_display_item_names("#deals_sheet_received_order_causes","#js_input_manual_required_received_display_items",".is-to-preview"),App.front_display_templates.set_manual_required_display_item_names("#deals_sheet_failed_order_causes","#js_input_manual_required_failed_display_items",".is-to-preview")})},set_modal_event:function(){var e=$('[data-form="client_category_modal"]'),t="",n=$(".visible_fields").html(),i=$(".invisible_fields").html();$(document).on("click",".client_category_modal_show",function(){e.dialog({modal:!0,title:I18n.t("js.display_templates.company_category"),width:1e3,draggable:!0,close:function(){""===t?($(".visible_fields").html(n),$(".invisible_fields").html(i)):(n=$(".visible_fields").html(),i=$(".invisible_fields").html(),t=""),$(".error_message").html("")}})}),$(document).on("click",'[data-event-role="submit"]',function(){t="submit"}),$(document).on("click",'[data-event-role="cancel"]',function(){e.dialog("close")})},set_branch_modal_event:function(){var e=$('[data-form="client_branches_category_modal"]'),t="",n=$(".visible_branch_fields").html(),i=$(".invisible_branch_fields").html();$(document).on("click",".client_branches_category_modal_show",function(){e.dialog({modal:!0,title:I18n.t("js.display_templates.client_branches_category"),width:1e3,draggable:!0,close:function(){""===t?($(".visible_branch_fields").html(n),$(".invisible_branch_fields").html(i)):(n=$(".visible_branch_fields").html(),i=$(".invisible_branch_fields").html(),t=""),$(".error_message").html("")}})}),$(document).on("click",'[data-event-role="submit"]',function(){t="submit"}),$('[data-event-role="branch-cancel"]').on("click",function(){e.dialog("close")})},init_form:function(){var a=this;$(document).on("change",$(".indicator_icons"),function(){App.front_display_templates.toggle_warning_flg_check_box()}),App.front_display_templates.toggle_warning_flg_check_box(),$(".check_icons:enabled").each(function(){$(this).closest("li").tooltip("disable")}),$(document).ready(function(){$("#xhr_select_data_type").val()===a.DISPLAY_TEMPLATE_DATA_TYPE_DEAL&&$('[data-hp-role="deals-stage-field"]').removeClass("hidden")}),$(document).on("change","#xhr_select_data_type",function(){var e=$('[data-hp-role="detail-flg-field-visibility"]'),t=$('[data-hp-role="location-flg-field-visibility"]'),n=$('[data-hp-role="deals-stage-field"]'),i=$('input[name="display_template[detail_master_flg]"]:checked').val();$(this).val()===a.DISPLAY_TEMPLATE_DATA_TYPE_DEAL?($('[data-hp-role="form_text"]').removeClass("hidden"),e[0].children[1].classList.remove("hidden"),e.removeClass("hidden"),n.removeClass("hidden"),t.addClass("hidden"),$("#use_product_master_flg").prop("disabled",!0),$('[data-hp-role="detail-flg-field-other_display"]').removeClass("hidden"),$("#detail_master_statistical_flg_span").removeClass("hidden"),1==i||2==i?($("#display_detail_calc_btn_flg").removeClass("hidden"),useDetailMasterStatisticalFlg=$('input[name="use_detail_master_statistical_flg"]').prop("checked"),2==i&&useDetailMasterStatisticalFlg&&($('input[name="display_template[detail_calc_btn_flg]"]').prop("checked",!1).prop("disabled",!0),$("#tooltip_display_detail_calc_btn_flg").tooltip("enable"))):$("#display_detail_calc_btn_flg").addClass("hidden")):$(this).val()===a.DISPLAY_TEMPLATE_DATA_TYPE_DAILY_REPORT?($('[data-hp-role="form_text"]').addClass("hidden"),e[0].children[1].classList.add("hidden"),e.removeClass("hidden"),e.last().addClass("hidden"),n.removeClass("hidden"),t.removeClass("hidden"),$("#use_product_master_flg").prop("disabled",!1),$('[data-hp-role="detail-flg-field-other_display"]').addClass("hidden"),$("#detail_master_statistical_flg_span").addClass("hidden"),$("#display_detail_calc_btn_flg").addClass("hidden")):($('[data-hp-role="detail-flg-field-visibility"]').addClass("hidden"),$('[data-hp-role="form_text"]').addClass("hidden"),e[0].children[1].classList.add("hidden"),e.addClass("hidden"),n.addClass("hidden"),t.addClass("hidden"),$("#use_product_master_flg").prop("disabled",!0),$('[data-hp-role="detail-flg-field-other_display"]').addClass("hidden"),$("#detail_master_statistical_flg_span").addClass("hidden"),$("#display_detail_calc_btn_flg").addClass("hidden"),App.front_display_templates.uncheck_deals_progress()),$("#data_type").val($(this).val()),$("#form_xhr_get_select_options").submit(),document.getElementById("js_copy_display_template_id")&&($("#js_copy_display_template_id").remove(),$("#display_template_name").val(""),$("#display_template_description").val(""),$("#display_template_display_flg_true").prop("checked",!0),$("#js_open_status option").attr("selected",!1).trigger("change"))}),$(".js_display_template_submit").on("click",function(){return 1<=$("#js_summary_category_display_items").children("option").length&&0==$("#js_summary_column_display_items").children("option").length?(alert(I18n.t("js.deals.no_summary_column")),!1):1<=$("#js_summary_column_display_items").children("option").length&&0==$("#js_summary_category_display_items").children("option").length?(alert(I18n.t("js.deals.no_summary_category")),!1):void 0}),App.front_display_templates.lateral_move_option(".js_lateral_move_button_block"),App.front_display_templates.vertical_move_option(".js_vertical_move_button_block"),App.concerns.select_search_product_items(),App.front_display_templates.set_display_item_ids("#js_display_items","#js_input_display_items"),App.front_display_templates.set_display_item_ids("#js_index_display_items","#js_input_index_display_items"),App.front_display_templates.set_display_item_ids("#js_relation_display_items","#js_input_relation_display_items"),App.front_display_templates.set_display_item_ids("#js_dashboard_display_items","#js_input_dashboard_display_items"),App.front_display_templates.set_display_item_ids("#js_summary_category_display_items","#js_input_summary_category_display_items"),App.front_display_templates.set_display_item_ids("#js_summary_column_display_items","#js_input_summary_column_display_items"),App.front_display_templates.set_display_item_ids("#js_display_detail_master_params","#js_input_display_detail_master_params"),App.front_display_templates.set_detail_master_filter("#input-detail_master_filter_1","#js_input_display_detail_master_params"),App.front_display_templates.change_manual_required_flg_of_option("#js_display_items","#js_change_manual_required_flg"),App.front_display_templates.change_manual_required_flg_of_option("#js_display_detail_master_params","#js_change_manual_required_product_master_flg"),App.front_display_templates.set_manual_required_display_item_names("#js_display_items","#js_input_manual_required_display_items",".js_display_template_submit"),App.front_display_templates.set_manual_required_display_item_names("#js_display_detail_master_params","#js_input_manual_required_detail_master_items",".js_display_template_submit"),App.front_display_templates.set_display_item_ids("#js_non_display_items","#js_input_non_display_items"),App.front_display_templates.set_display_item_ids("#js_none_display_detail_master_params","#js_input_none_display_detail_master_params"),App.front_display_templates.set_display_item_ids("#js_index_non_display_items","#js_input_index_non_display_items"),App.front_display_templates.set_display_item_ids("#js_relation_non_display_items","#js_input_relation_non_display_items"),App.front_display_templates.set_display_item_ids("#js_dashboard_non_display_items","#js_input_dashboard_non_display_items"),App.front_display_templates.set_display_item_ids("#js_summary_category_non_display_items","#js_input_summary_category_non_display_items"),App.front_display_templates.set_display_item_ids("#js_summary_column_non_display_items","#js_input_summary_column_non_display_items"),App.front_display_templates.set_display_item_ids("#js_none_display_detail_master_params","#js_input_none_display_detail_master_params"),this.handle_render_input_item("product_master_sort_order"),this.handle_render_input_item("detail_master_filter_1"),this.handle_render_input_item("detail_master_filter_2"),this.handle_render_input_item("detail_master_filter_3"),this.display_switch_roles_select(),this.display_switch_roles_select(),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker")},progress_icon_option:function(e,t){if("display-item-flg"==t)var n=!1,i=!0,a="enable";else if("button-disabled"==t)n=!1,i=!0,a="enable";else n="",i=!1,a="disable";e.each(function(e,t){switch($(t).val()){case"amount":$("#display_template_deals_progress_attributes_amount_icon_flg").prop("checked",n).prop("disabled",i).closest("li").tooltip(a);break;case"gross_profit":$("#display_template_deals_progress_attributes_gross_profit_icon_flg").prop("checked",n).prop("disabled",i).closest("li").tooltip(a);break;case"chance_kbn_id":$("#display_template_deals_progress_attributes_chance_kbn_id_icon_flg").prop("checked",n).prop("disabled",i).closest("li").tooltip(a)}}),App.front_display_templates.toggle_warning_flg_check_box()},lateral_move_option:function(e){$(document).on("click",e+" button",function(){if($(this).hasClass("move_to_right")){var l=(c=$(this).parent()).prev().find("select option:selected");if(c.data("display-index-item-flg")&&App.front_display_templates.progress_icon_option(l,"button-disabled"),"js_display_detail_master_params"==c.prev().find("select").attr("id")&&c.prev().find("select option").length==l.length)return alert(I18n.t("js.display_templates.master_item_can_not_blank")),!1;if(l[0])l.is("#select_option_client")&&(l.remove("#select_option_lead_ids"),l.remove("#select_option_deal_id"),l.remove("#select_option_client_branch_id")),0<=l.map(function(e,t){return $(t).data("required-flg")}).get().indexOf(!0)&&alert(I18n.t("js.display_templates.not_hidden_item")),l.each(function(){if(!$(this).data("required-flg")){if(!1===$(this).data("blank-flg")&&(($(this).data("manual-required-flg")||"open_status"==$(this).val())&&($(this).data("manual-required-flg",!1),$(this).attr("data-manual-required-flg",!1),$(this).attr("title",$(this).html().replace(" \uff0a","")),"open_status"==$(this).val()&&$(this).removeAttr("data-manual-required-flg"),$(this).text().match(/\uff0a/)&&$(this).text($(this).text().replace(/ \uff0a/g,""))),c.next().children("select").append($(this).clone()),c.data("display-item-flg"))){if($(this).data("client-flg")){var e=c.prev().find("select #select_option_lead_ids");e[0]&&(e.data("manual-required-flg")&&(e.data("manual-required-flg",!1),e.attr("data-manual-required-flg",!1),e.attr("title",e.html().replace(/ \uff0a/g,"")),e.text().match(/\uff0a/)&&e.text(e.text().replace(/ \uff0a/g,""))),c.next().children("select").append(e.clone()),c.prev().find("select #select_option_lead_ids").remove(),$(".js_select_other_display [value="+e.val()+"]").remove(),$(".js_select_other_non_display [value="+e.val()+"]").remove(),$(".js_summary_category_select_other_non_display [value="+e.val()+"]").remove(),$(".js_summary_column_select_other_non_display [value="+e.val()+"]").remove());var t=c.prev().find("select #select_option_deal_id");t[0]&&(t.data("manual-required-flg")&&(t.data("manual-required-flg",!1),t.attr("data-manual-required-flg",!1),t.attr("title",t.html().replace(/ \uff0a/g,"")),t.text().match(/\uff0a/)&&t.text(t.text().replace(/ \uff0a/g,""))),c.next().children("select").append(t.clone()),c.prev().find("select #select_option_deal_id").remove(),$(".js_select_other_display [value="+t.val()+"]").remove(),$(".js_select_other_non_display [value="+t.val()+"]").remove(),$(".js_summary_category_select_other_non_display [value="+t.val()+"]").remove(),$(".js_summary_column_select_other_non_display [value="+t.val()+"]").remove());var n=c.prev().find("select #select_option_client_branch_id");n[0]&&(n.data("manual-required-flg")&&(n.data("manual-required-flg",!1),n.attr("data-manual-required-flg",!1),n.attr("title",n.html().replace(/ \uff0a/g,"")),n.text().match(/\uff0a/)&&n.text(n.text().replace(/ \uff0a/g,""))),c.next().children("select").append(n.clone()),c.prev().find("select #select_option_client_branch_id").remove(),$(".js_select_other_display [value="+n.val()+"]").remove(),$(".js_select_other_non_display [value="+n.val()+"]").remove(),$(".js_summary_category_select_other_non_display [value="+n.val()+"]").remove(),$(".js_summary_column_select_other_non_display [value="+n.val()+"]").remove())}if("select_option_confirmation_users_daily_reports"==$(this)[0].id){var i=$(this).data("confirmation-value");i&&($(".js_select_other_display [value="+i+"]").remove(),$(".js_select_other_non_display [value="+i+"]").remove(),$(".js_summary_category_select_other_non_display [value="+i+"]").remove(),$(".js_summary_column_select_other_non_display [value="+i+"]").remove())}}$(this).remove(),c.data("display-item-flg")&&($(".js_select_other_display [value="+$(this).val()+"]").remove(),$(".js_select_other_non_display [value="+$(this).val()+"]").remove(),$(".js_summary_category_select_other_non_display [value="+$(this).val()+"]").remove(),$(".js_summary_column_select_other_non_display [value="+$(this).val()+"]").remove(),App.front_display_templates.progress_icon_option(l,"display-item-flg"))}})}else if($(this).hasClass("move_to_left")){var c;l=(c=$(this).parent()).next().find("select option:selected");c.data("display-index-item-flg")&&App.front_display_templates.progress_icon_option(l);var e=c.prev().children("select").data("maximum");if(null==e==0&&c.prev().children("select").children().size()+l.size()>e)return alert(I18n.t("js.common.max_exceeded")),!1;var t=0,n=10;if(l.each(function(){$(this).data("calculate-item-flg")&&(t+=1)}),c.prev().children("select").children().each(function(){$(this).data("calculate-item-flg")&&(t+=1)}),n<t)return alert(I18n.t("js.common.caluc_item_max_exceeded",n)),!1;l[0]&&((l.is("#select_option_deal_id")||l.is("#select_option_lead_ids")||l.is("#select_option_client_branch_id"))&&l.remove("#select_option_client"),l.each(function(){var e=$(this).clone();if($(this).parents("#js_non_display_items").length&&"open_status"==e.val()){var t=e.text()+" \uff0a";e.text(t),e.attr("title",t)}if(c.prev().children("select").append(e),c.data("display-item-flg")){if(!1===$(this).data("blank-flg")){var n=$(this).clone(
).removeAttr("id"),i=$(this).clone().removeAttr("id");if("web_form_ids"==n.val()||"inquiry_created_at"==n.val())return void $(this).remove();"open_status"==n.val()&&n.text(n.text().replace(/ \uff0a/g,"")),!0===$(this).data("only-list-display-flg")?$("#js_index_non_display_items").append(n):!0===$(this).data("summary-category-list-display-flg")?!0===$(this).data("monthly-flg")?(i.text(n.text().concat(I18n.t("js.deals.monthly"))),$("#js_summary_category_non_display_items").append(i),$(".js_select_other_non_display").append(n)):$(".js_select_other_non_display, #js_summary_category_non_display_items").append(n):!0===$(this).data("summary-column-list-display-flg")?$(".js_select_other_non_display, #js_summary_column_non_display_items").append(n):$(".js_select_other_non_display").append(n)}App.front_display_templates.progress_icon_option(l,"display-item-flg")}if(c.data("display-item-flg")&&$(this).data("relation-client-flg")){var a=c.next().find("select #select_option_client");a[0]&&(c.prev().children("select").append(a.clone()),$(".js_select_other_non_display").append(a.clone().removeAttr("id")),c.next().find("select #select_option_client").remove())}if(c.data("display-item-flg")&&"select_option_confirmation_users_daily_reports"==$(this)[0].id){var s=$(this).data("confirmation-value"),o=$(this).data("confirmation-title");if(s&&o){var r=$("<option>",{value:s,title:o,text:o,"data-blank-flg":!1});$(".js_select_other_non_display").append(r)}}!1===$(this).data("blank-flg")&&$(this).remove()}))}App.concerns.select_search_product_items()})},vertical_move_option:function(e){$(document).on("click",e+" button",function(){var e=$(this).parent(),t=e.next().find("select option:selected");if(1<t.size())return alert(I18n.t("js.common.unchanged_items")),!1;t[0]&&($(this).hasClass("move_to_up")?t.prev().before(t):$(this).hasClass("move_to_down")?t.next().after(t):$(this).hasClass("move_to_top")?e.next().children("select").prepend(t):$(this).hasClass("move_to_bottom")&&e.next().children("select").append(t))})},set_display_item_ids:function(e,t){var n=[];$(".js_display_template_submit").on("click",function(){return!(1<=$("#js_summary_category_display_items").children("option").length&&0==$("#js_summary_column_display_items").children("option").length)&&(!(1<=$("#js_summary_column_display_items").children("option").length&&0==$("#js_summary_category_display_items").children("option").length)&&($(e+" option").each(function(){n[n.length]=$(this).val()}),void $(t).val(n)))})},set_detail_master_filter:function(e,t){var n=$(t).find("input:hidden");$(e).on("click",function(){if(0==n.length)return!1})},set_manual_required_display_item_names:function(t,n,e){$(e).on("click",function(){var e=[];$(t+" option").each(function(){$(this).data("manual-required-flg")&&(e[e.length]=$(this).val())}),$(n).val(e)})},manual_required_detail_master_item_names:function(t,n,e){$(e).on("click",function(){var e=[];$(t+" option").each(function(){$(this).data("manual-required-flg")&&(e[e.length]=$(this).val())}),$(n).val(e)})},change_manual_required_flg_of_option:function(t,e){$(e).on("click",function(){selected_client_option=$(t+" option[data-client-flg='true']:selected"),selected_relation_client_options=$(t+" option[data-relation-client-flg='true']:selected"),sync_client_flg=0<selected_client_option.size()&&0<selected_relation_client_options.size();var e=!1;$(t+" option:selected").each(function(){$(this).data("calculate-item-flg")&&(e=!0,alert(I18n.t("js.common.caluc_item_required")))}),e||($(t+" option:selected").each(function(){if(sync_client_flg&&$(this).data("relation-client-flg"))return!0;$(this).data("manual-required-flg")?($(this).data("manual-required-flg",!1),$(this).attr("data-manual-required-flg",!1),$(this).data("client-flg")&&(option_client=$(t+" option[data-relation-client-flg='true']"),option_client.data("manual-required-flg",!1),option_client.attr("data-manual-required-flg",!1))):!1===$(this).data("manual-required-flg")&&($(this).data("manual-required-flg",!0),$(this).attr("data-manual-required-flg",!0),$(this).data("relation-client-flg")&&(option_client=$(t+" option[data-client-flg='true']"),option_client.data("manual-required-flg",!0),option_client.attr("data-manual-required-flg",!0)),sync_client_flg&&$(this).data("client-flg")&&(selected_relation_client_options.data("manual-required-flg",!0),selected_relation_client_options.attr("data-manual-required-flg",!0)))}),$(t+" option[data-manual-required-flg='true']").each(function(){var e=$(this);if(!e.text().match(/\uff0a/)){var t=e.text()+" \uff0a";e.text(t),e.attr("title",t)}}),$(t+" option[data-manual-required-flg='false']").each(function(){var e=$(this);if(e.text().match(/\uff0a/)){var t=e.text().replace(/ \uff0a/g,"");e.text(t),e.attr("title",t)}}))})},display_switch_roles_select:function(){var e=$("#js_open_status");2==e.val()&&($("#js_select_role_ids").show(),$("#js_select_role_ids select").select2({width:"100%"})),3==e.val()&&$(".department_ids_form").show(),e.on("change",function(){2==e.val()?$("#js_form_set_user_roles").submit():3==e.val()?$(".department_ids_form").show():($("#js_select_role_ids select").select2("val",""),$("#js_select_role_ids").hide(),$(".department_ids_form").hide())})},toggle_warning_flg_check_box:function(){0==$(".indicator_icons:checked").size()?$("#display_template_deals_progress_attributes_warning_flg").prop("disabled",!0).prop("checked",!1).closest("li").tooltip("enable"):$("#display_template_deals_progress_attributes_warning_flg").prop("disabled",!1).closest("li").tooltip("disable")},uncheck_deals_progress:function(){$("input.check_icons").prop("checked",!1).prop("disabled",!0)},handle_template_detail_master_flg:function(){var e=$('input[name="display_template[detail_master_flg]"]:checked').val();2==e?$(".detail-master-section").removeClass("hidden"):$(".detail-master-section").addClass("hidden");var t=$("#js_display_template_data_type").val()?$("#js_display_template_data_type").val():$("#xhr_select_data_type").val();if(2!=t||1!=e&&2!=e?$("#display_detail_calc_btn_flg").addClass("hidden"):$("#display_detail_calc_btn_flg").removeClass("hidden"),!!$("#xhr_select_data_type").val()){var n=$('input[name="use_detail_master_statistical_flg"]').prop("checked");2==t&&2==e&&n?($('input[name="display_template[detail_calc_btn_flg]"]').prop("checked",!1).prop("disabled",!0),$("#tooltip_display_detail_calc_btn_flg").tooltip("enable")):($('input[name="display_template[detail_calc_btn_flg]"]').prop("checked",!0).prop("disabled",!1),$("#tooltip_display_detail_calc_btn_flg").tooltip("disable"))}this.handle_use_detail_master_statistical_flg()},handle_use_detail_master_statistical_flg:function(){var e=$("#js_display_template_data_type").val()?$("#js_display_template_data_type").val():$("#xhr_select_data_type").val(),t=$('input[name="display_template[detail_master_flg]"]:checked').val(),n=$('input[name="use_detail_master_statistical_flg"]').prop("checked"),i=!!$("#xhr_select_data_type").val();if(2==e&&2==t&&n)$('input[name="display_template[detail_calc_btn_flg]"]').prop("checked",!1).prop("disabled",!0),$("#tooltip_display_detail_calc_btn_flg").tooltip("enable");else{if(null!=$("#js_detail_calc_btn_flg").val()){var a=JSON.parse($("#js_detail_calc_btn_flg").val().toLowerCase());$('input[name="display_template[detail_calc_btn_flg]"]').prop("checked",!!i||a).prop("disabled",!1)}$("#tooltip_display_detail_calc_btn_flg").tooltip("disable")}},comboMoveBranch:function(n,i){return function(){var e=$(n).find("option:selected"),t=e.clone();$(i).append(t),e.remove(),$('[data-hp-role="branch-visible-fields"]').change()}},comboMoveOneBranch:function(t){return function(){var e=$('[data-hp-role="branch-visible-fields"] option:selected');1<e.size()?alert(I18n.t("js.common.unchanged_items")):(t(e),$('[data-hp-role="branch-visible-fields"]').change())}},comboValueSetBranch:function(t,n){return function(){var e=[];$(t).each(function(){e.push($(this).val())}),$(n).val(e)}},initBranch:function(){var e=this;$(document).on("click",'[data-hp-role="branch-right-btn"]',this.comboMoveBranch('[data-hp-role="branch-visible-fields"]','[data-hp-role="branch-invisible-fields"]')),$(document).on("click",'[data-hp-role="branch-left-btn"]',this.comboMoveBranch('[data-hp-role="branch-invisible-fields"]','[data-hp-role="branch-visible-fields"]')),$(document).on("click",'[data-hp-role="branch-top-btn"]',e.comboMoveOneBranch(function(e){e.prevAll().last().before(e)})),$(document).on("click",'[data-hp-role="branch-bottom-btn"]',e.comboMoveOneBranch(function(e){e.nextAll().last().after(e)})),$(document).on("click",'[data-hp-role="branch-up-btn"]',e.comboMoveOneBranch(function(e){e.prevAll().first().before(e)})),$(document).on("click",'[data-hp-role="branch-down-btn"]',e.comboMoveOneBranch(function(e){e.nextAll().first().after(e)})),$(document).on("change",'[data-hp-role="branch-visible-fields"]',e.comboValueSetBranch('[data-hp-role="branch-visible-fields"] option','[data-hp-role="branch-visible-values"]'))},handle_render_input_item:function(n){$(document).on("change","#"+n,function(){var e=$("#js_display_detail_master_params").find("option"),t=[];e.toArray().forEach(function(e){t.push(e.value)}),$.ajax({url:"/xhr/display_templates/set_item_input",type:"POST",dataType:"script",data:{id:$(this).val(),type:n,"display_detail_master_params[]":t},success:function(){App.concerns.datepicker(".search_items_datepicker"),$(".search_items_select2:not(div):not(.select2-offscreen)").select2()}})})}},BigNumber.evaluate=function(){var r,l,c,d,u,s,e,_="BigNumber.evaluate error: ",h=c=/(?:(\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)|(0)|(\)))(?=([\w($\u221A\u0370-\u03FF]|!(?!=))?)|([!<>=]=|[-+*\/(^%><!\u221A,]|&&|\|\|)|\S/g,p=/^[a-zA-Z_$\u0370-\u03FF][\w\u0370-\u03FF$]*$/,f=(s={},(e=function(e,t,n,i){var a={};(a.lbp=t)?(a.infix="string"==typeof n?t<50?function(e){return new BigNumber(+e[n](v(t)))}:function(e){return e[n](v(t))}:n,i&&(a.prefix=i)):a.prefix=n,s[a.val=e]=a})("^",80,function(e){return e.pow(v(79))}),e("*",60,"times"),e("/",60,"div"),e("%",60,"mod"),e("+",50,"plus",function(){return v(70)}),e("-",50,"minus",function(){var e=new BigNumber(v(70));return e.s=-e.s,e}),e(">",40,"gt"),e(">=",40,"gte"),e("<",40,"lt"),e("<=",40,"lte"),e("==",30,"eq"),e("!=",30,function(e){return new BigNumber(+!e.eq(v(30)))}),e("&&",20,function(e){var t=v(20);return e.isZero()?e:t}),e("||",10,function(e){var t=v(10);return e.isZero()?t:e}),e("\u221a",0,function(){return v(79).sqrt()}),e("!",0,function(){return new BigNumber(+v(70).isZero())}),e("(",0,function(){var e=v(0);if(")"!=l.val)throw _+"expected )";return l=d[++r],e}),e(")",0),e(",",0),s),m=function(){var e=[];if("("!=l.val)throw _+"expected (";if(")"!=(l=d[++r]).val)for(;;){if(e.push(v(0)),","!=l.val){if(")"!=l.val)throw _+"expected )";break}l=d[++r]}return l=d[++r],new BigNumber(u[this.val].apply(null,e))},g=function(){return u[this.val]},A=function(){return this.val},v=function(e){var t,n=l;if(!n.prefix)throw _+"unexpected "+("end"==n.val?"end":"symbol: "+n.val);for(l=d[++r],t=n.prefix();e<l.lbp;)n=l,l=d[++r],t=n.infix(t);return t};return function(e,t){var n,i,a,s,o=Object.prototype.hasOwnProperty;if(e&&"object"==typeof e){for(i in t=e){if(!o.call(u,i))throw _+"identifier not in scope: "+i;if(s=t[i],"function"==typeof u[i]){if("function"!=typeof s)throw _+"not a function: "+i+": "+s;u[i]=s}else u[i]=new BigNumber(s)}if(!d)return null}else{if(t&&"object"==typeof t){for(i in u={},n=[],t)if(o.call(t,i)){if(!p.test(i))throw _+"invalid identifier: "+i;s=t[i],u[i]="function"==typeof s?s:new BigNumber(s),n.push(i)}n[0]?(n.sort(function(e,t){return t.length-e.length}),c=new RegExp("(?:(\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)|("+n.join("|").replace(/\$/g,"\\$")+")|(\\)))(?=([\\w($\\u221A\\u0370-\\u03FF]|!(?!=))?)|([!<>=]=|[-+*\\/(^%><!\\u221A,]|&&|\\|\\|)|\\S","g")):c=h}else null===t&&(u=null,c=h);if(null!=e&&/\S/.test(e+="")){for(a="",d=[],c.lastIndex=0,e=e.replace(/\*\*/g,"^");n=c.exec(e);){if(s=n[1])l={val:new BigNumber(s),prefix:A};else if(s=n[5]||n[3])l=f[s];else{if(!(s=n[2]))throw d=null,_+"unknown symbol: "+n[0].charAt(0);l="function"==typeof u[s]?(n[4]=null,{val:s,prefix:m}):{val:s,prefix:g}}d.push(l),a+=s,n[4]&&(d.push(f["*"]),a+="*")}BigNumber.evaluate.expression=a,d.push({val:"end"})}else if(void 0!==e||!d)return BigNumber.evaluate.expression=d=null}if(l=d[r=0],s=new BigNumber(v(0)),"end"!=l.val)throw _+"unexpected symbol: "+l.val;return s}}(),App.front_files={index:function(){App.concerns.change_display_number("form_search_files"),App.concerns.change_order("form_search_files"),$("#search_status").select2({width:"100%",placeholder:I18n.t("js.common.status")}),App.concerns.datepicker(".search_datepicker")}},App.front_form_sale_queues={index:function(){function e(e,t){$("#csv_dl_submit").on("click",function(){return App.concerns.set_export_ids(e,t),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_export_type").val(1),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),!1})}App.concerns.disable_buttons_submit_custom(".js-disable-btn","#btn-clear-form"),App.concerns.disable_duplicate_request_search_form("#form_search_form_sale_queues",".js-disable-btn"),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_display_number("form_search_form_sale_queues"),App.concerns.change_order("form_search_form_sale_queues"),App.concerns.datepicker(".search_datepicker",{language:"ja"}),$("#q_status_in").select2(),App.concerns.select_search_disable_user("q_send_user_id_in"),App.concerns.set_value("click",".js_clear_submit","#search_clear_flg","search-clear-flg"),App.concerns.change_search_type("#search_type_1","#search_type_2"),App.visible_fields.setup_list_visible_setting(["subject","sent_at","send_user_id","user_name","status","sent_num"]),App.search_visible_fields.setup_list_search_visible_setting(),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.concerns.focus_to_first_element(),App.concerns.all_checked_items(),e("#form_search_form_sale_queues","checked[form_sale_queue_ids][]"),App.tooltip.display_tooltip();new Clipboard(".clipboard-btn");App.concerns.open_mailer()},show:function(){App.front_deals.all_checked_items_modal_deals_index(),this.change_form_sale_queue_tab_type(),$("#csv_dl_submit, #csv_all_dl_submit").on("click",function(){return"csv_all_dl_submit"===$(this).attr("id")&&$("#csv_all_dl_flg").val(1),action=$("#form_search_form_sale_queues").attr("action"),$("#form_search_form_sale_queues").attr("action",action+".csv"),$("#form_search_form_sale_queues").submit(),$("#form_search_form_sale_queues").attr("action",action),!1}),this.loadingTransmissionsList("#target_table","#form_sale_queue_transmissions_result"),this.fetchTransmissionsList(),App.concerns.change_order_for_target_tab("#form_sale_queues_form_change_display_number_for_target_tab",".form_sale_queues_detail_order_head"),App.visible_fields.setup_list_visible_setting(["name","client_web_form_url","sent_at","status","error_code","zip","address","business_category"]),App.concerns.set_value("click",".js_clear_submit","#search_clear_flg","search-clear-flg");new Clipboard(".clipboard-btn")},change_form_sale_queue_tab_type:function(e,t){var n=e===undefined?"#form_sale_queue_tab_type_1":e,i=t===undefined?"#form_sale_queue_tab_type_2":t;$(document).on("change",".form_sale_queue_tab_type",function(){$(n).is(":checked")?($("#summary_tab").show(),$("#target_table").hide()):$(i).is(":checked")&&($("#summary_tab").hide(),$("#target_table").show()),$(document).trigger("floatTableUpdate")})},fetchTransmissionsList:function(){$("#form_sale_queues_form_change_display_number_for_target_tab").submit()},loadingTransmissionsList:function(e,t){$(e).on({"ajax:beforeSend":function(){$(t).html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:error":function(){$(t).html($('<div class="loadError"><span>'+I18n.t("js.application.load_error")+"</span></div>"))}})},fixCurrentPageLink:function(e){$(e+" .pagination li.active a").click(function(){if("#"==$(this).attr("href"))return!1})},datepicker:function(){var t={format:"YYYY-MM-DD hh:mm"};$(function(){var e=$(".search_datepicker");e.attr(t),e.datepicker({language:"ja"})})}},App.front_form_sale_templates={index:function(){App.concerns.change_display_number("form_search_form_sale_templates"),App.concerns.change_order("form_search_form_sale_templates"),App.concerns.all_checked_items(),App.concerns.set_form_action_to_submit("#form_checked_form_sale_templates",".delete-button",!0),App.concerns.select_search_disable_user("search_update_user_ids"),$("#search_template_type").select2({width:"100%"});new Clipboard(".clipboard-btn");App.concerns.open_mailer()},"new":function(){this.init_form()},create:function(){this.init_form()},edit:function(){this.init_form()},update:function(){this.init_form()},set_select2:function(e,t,n){$(e).select2({width:t,placeholder:n})},init_form:function(){App.concerns.set_mail_tag("mail_text_body"),this.set_tooltip_by_position()},set_tooltip_by_position:function(){["right","bottom","top"].forEach(function(e){$(".hp-tooltip-"+e).tooltip({container:"body",trigger:"hover",placement:e,html:"true"})})}},$(document).on("ready",function(){$(document).on("change","#js-form-sale-template-type-select",function(){var e=$(this).val(),t=$("#js-add-sub-form-sale-template-btn ~ input[name='template_type']").val();$("#js-add-sub-form-sale-template-btn ~ input[name='template_type']").val(e);var n=$("#new_form_sale_template").serializeArray(),i={};$.each(n,function(e,t){i[t.name]=t.value}),$("#js-add-sub-form-sale-template-btn ~ input[name='"+t+"_data']").val(JSON.stringify(Object.assign({},i))),$("#js-add-sub-form-sale-template-btn").click()}),$(document).on("input","#js-form-sale-template-name-input",function(){var e=$(this).val();$("#js-add-sub-form-sale-template-btn ~ input[name='name']").val(e)})}),App.front_form_sale_wizard={addActiveClass:function(e){e.hasClass("active")||(e.addClass("active"),App.front_form_sale_wizard.addActiveClass(e.prev()))},removeActiveClass:function(e){e.hasClass("active")&&(e.removeClass("active"),App.front_form_sale_wizard.removeActiveClass(e.next()))}},$(document).ready(function(){function t(e,t){var n=45,i=parseInt(e.getBoundingClientRect().left,10),a=parseInt(e.getBoundingClientRect().width,10),s=parseInt(e.getBoundingClientRect().top,10),o=(a=parseInt(window.getComputedStyle(e).width,10),parseInt(window.getComputedStyle(e).height,10),window.getComputedStyle(e,":before"),parseInt(i+(a-n)/2,10)),r=o+parseInt(n,10),l=parseInt(s,10),c=l+parseInt(n,10),d=t.clientX,u=t.clientY;return o<=d&&d<=r&&l<=u&&u<=c}function n(){return""==$("#form_sale_template_customer_id").val()?(error_message="\u62c5\u5f53\u8005\u60c5\u5831\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002",$(".js-form-sale-queues-errors").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul class="list-unstyled">        <li>'+error_message+"</li>      </ul>    </div>  </div></div>"),error_message):""}function i(e){var t="";return""!=$("#form_sale_template_contact_id").val()||(t=0!=e.length?"<ul><li>"+e+"</li> <li>\u554f\u3044\u5408\u308f\u305b\u60c5\u5831\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002</li></ul>":'<ul class="list-unstyled"> <li>\u554f\u3044\u5408\u308f\u305b\u60c5\u5831\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002</li></ul>',$(".js-form-sale-queues-errors").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>'+t+"    </div>  </div></div>"),!1)}function a(){var n=[],e=$("#business_activities_lead_lists_area input[name='checked[client_sale_approach_ids][]']");$.each(e,function(e,t){t.checked&&n.push(t.value)});var t=$("#form_sale_template_contact_id").val(),i=$("#form_sale_template_customer_id").val(),a=$("#ha_exclusion").val(),s=$("#sale_approach_id").val(),o=$(".result_company_basic_information_ids").val();App.front_sale_approaches.show_loading_wizard(),$.ajax({type:"post",url:"/xhr/form_sale_templates/render_data_last_step",data:{client_sale_approach_ids:n.join(","),form_sale_template_contact_id:t,form_sale_template_customer_id:i,ha_exclusion:a,sale_approach_id:s,result_company_basic_information_ids:o}})}var s,o,e;$("#form_sales_implementation_wizard .next").click(function(){return s=$(this).parent(),o=$(this).parent().next(),1==s.find(".steps3").length&&0!=n().length||(1==s.find(".steps4").length&&!i("")||($(".js-form-sale-queues-errors").html(""),$("#progressbar li").eq($("fieldset").index(o)).addClass("active"),s.hide(),o.show(),void(4==$(this).data("page")&&a())))}),$("#form_sales_implementation_wizard .submit").click(function(){var e=n(),t=i(e);0==e.length&&t&&($("#new_form_sale_queue").submit(),App.front_sale_approaches.show_loading_wizard())}),$("#form_sales_implementation_wizard .previous").click(function(){$(".js-form-sale-queues-errors").html(""),s=$(this).parent(),e=$(this).parent().prev(),$("#progressbar li").eq($("fieldset").index(s)).removeClass("active"),s.hide(),e.show()}),$("#form_sales_implementation_wizard .close").click(function(){$("#form_sales_implementation_wizard").modal("hide"),$(".js-form-sale-queues-errors").html("")}),$("#form_sales_implementation_wizard #progressbar li").mousemove(function(e){t(this,e)?$(this).addClass("hover-before"):$(this).removeClass("hover-before")}),$("#form_sales_implementation_wizard #progressbar li").click(function(e){if(t(this,e)&&$("#progressbar li").index($("#progressbar li.active").last())!=$("#progressbar li").index($(this))){if($(".js-form-sale-queues-errors").html(""),s=$("fieldset").eq($("#progressbar li").index($("#progressbar li.active").last())),o=$("fieldset").eq($("#progressbar li").index($(this))),current_clicked_element=$(this),2==$("#progressbar li").index($("#progressbar li.active").last())&&2<$("#progressbar li").index($(this))&&1==s.find(".steps3").length&&0!=n().length)return!0;if(3==$("#progressbar li").index($("#progressbar li.active").last())&&3<$("#progressbar li").index($(this))&&1==s.find(".steps4").length&&!i(""))return!0;$(".js-form-sale-queues-errors").html(""),$("#progressbar li").index($("#progressbar li.active").last())<4&&(3==$("#progressbar li").index($(this))?0!=n().length&&(o=$("fieldset").eq(2),current_clicked_element=$("#progressbar li").eq(2)):4==$("#progressbar li").index($(this))&&(0!=n().length?(o=$("fieldset").eq(2),current_clicked_element=$("#progressbar li").eq(2)):i("")||(o=$("fieldset").eq(3),current_clicked_element=$("#progressbar li").eq(3)))),s.hide(),o.show(),o.find(".steps5")&&a(),current_clicked_element.hasClass("active")?App.front_form_sale_wizard.removeActiveClass(current_clicked_element.next()):App.front_form_sale_wizard.addActiveClass(current_clicked_element)}}),$("#form_sales_implementation_wizard").on("shown.bs.modal",function(){$("body").css("position","initial")})});var modules={$window:$(window),$html:$("html"),$body:$("body"),$container:$(".container"),init:function(){$(function(){modules.modals.init()})},modals:{trigger:$(".explanation"),modal:$(".modal"),scrollTopPosition:null,init:function(){var e=this;0<e.trigger.length&&0<e.modal.length&&(modules.$body.append('<div class="modal-overlay"></div>'),e.triggers())},triggers:function(){var n=this;n.trigger.on("click",function(e){e.preventDefault();var t=$(this);n.openModal(t,t.data("modalId"))}),$(".modal-overlay").on("click",function(e){e.preventDefault(),n.closeModal()}),modules.$body.on("keydown",function(e){27===e.keyCode&&n.closeModal()}),$(".modal-close").on("click",function(e){e.preventDefault(),n.closeModal()})},openModal:function(e,t){var n=this,i=modules.$window.scrollTop(),a=$("#"+t);n.scrollTopPosition=i,modules.$html.addClass("modal-show").attr("data-modal-effect",a.data("modal-effect")),a.addClass("modal-show"),modules.$container.scrollTop(i)},closeModal:function(){var e=this;$(".modal-show").removeClass("modal-show"),modules.$html.removeClass("modal-show").removeAttr("data-modal-effect"),modules.$window.scrollTop(e.scrollTopPosition)}}};modules.init(),App.front_home={DASHBOARD_ROW_HEIGHT:40,DASHBOARD_MARGIN:20,index:function(){this.init_grid_stack(!0),this.init_personnel_change_modal(),this.init_clipboard(),this.init_add_dashboard_modal(),this.init_copy_dashboard_modal(),this.clear_dashboard_modal(),this.scroll_navbar_menu(),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),default_dashboard=document.querySelector("#default-dashboard")},edit:function(){var n=this;n.init_grid_stack(!1),n.disable_add_portlet_button(),$(".grid-stack").on("dragstop",function(){n.save_position()}),$(".grid-stack").on("resizestop",function(e,t){n.save_position(),n.load_portlet_content(t.element)}),this.init_portlet_button($(".grid-stack")),this.init_new_portlet_form(),this.init_update_dashboard_modal();new Clipboard(".clipboard-btn");App.front_deals.all_checked_items_modal_deals_index(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},create:function(){this.disable_add_portlet_button()},init_new_portlet_form:function(){var r=this;$("#new_portlet").on("submit",function(e){e.preventDefault();var t=$(this),n=t.find("[name=portlet\\[dashboard_id\\]]").val(),i=t.find("[name=portlet\\[data_type\\]]").val(),a=$(".grid-stack").attr("data-gs-current-height"),s=$(".grid-stack").data("gridstack"),o={x:0,y:a+1,width:2,height:5,data_type:i,dashboard_id:n};$.ajax({type:"POST",url:t.attr("action"),dataType:"json",contentType:"application/json",data:JSON.stringify({portlet:o}),success:function(e){var t=$(e.html);s.addWidget(t),App.front_home.load_portlet_content(t),App.front_home.init_portlet_button(t),r.go_bottom(t)},error:function(){}})})},init_portlet_button:function(e){e.find(".portlet-edit-button").on("ajax:success",App.front_home.init_portlet_form),e.find("a.portlet-destroy-button").on("ajax:success",function(){var e=$(".grid-stack").data("gridstack"),t=$(this).closest(".grid-stack-item");e.removeWidget(t)})},init_grid_stack:function(e){var t={width:4,cellHeight:this.DASHBOARD_ROW_HEIGHT,verticalMargin:0,disableDrag:e||!1,disableResize:e||!1,resizable:{handles:"e, w"},draggable:{scroll:!0,handle:".move-heading"}};$(".grid-stack").gridstack(t),[].forEach.call($(".grid-stack-item"),this.load_portlet_content)},disable_add_portlet_button:function(){$("#portlet_data_type").on("change",function(){$("#add_portlet_btn").prop("disabled",!$(this).val())})},save_position:function(){if($(".grid-stack-item")){var e=_.map($(".grid-stack > .grid-stack-item:visible"),function(e){var t=$(e).data("_gridstack_node");if(t)return{id:t.id,x:t.x,y:t.y,width:t.width,height:t.height}},this);$.ajax({type:"POST",url:$("#positionUpdate").data("url"),dataType:"json",contentType:"application/json",data:JSON.stringify({portlets:e})})}},init_portlet_form:function(e,t){var a=$("#portletEditModal"),n=$(this).closest(".grid-stack-item");$("#pref_display_flg")!=undefined&&"0"==$("#pref_display_flg").val()&&$(n).data("params")!=undefined&&($(n).data("params").pref_display_flg=0),a.html(t),a.modal("show"),a.one("hidden.bs.modal",function(){$(".modal-body #modal-error-message").remove(),App.front_home.load_portlet_content(n)}),a.find("form").submit(function(e){return e.preventDefault(),$("#modal-error-message").remove(),$.ajax({type:$(this).attr("method"),url:$(this).prop("action"),dataType:"json",data:$(this).serialize()}).done(function(e){if("success"===e.status)a.modal("hide");else{var t=$("<div></div>",{id:"modal-error-message",addClass:"alert alert-danger alert-error"}),n=$("<ul></ul>");for(var i in e.messages)n.append("<li>"+e.messages[i]+"</li>");$(".modal-body").prepend(t.append(n))}}),!1}),App.concerns.attach_radio_toggle_handlers(a),App.concerns.select_search("portlet_portlet_form_user_ids"),App.concerns.select_search("portlet_search_params_target_list_ids"),App.concerns.set_associate_entities_to_s2("#target_lists_multiple_decision","#portlet_search_params_target_list_ids",'input[name="associate_target_lists[]"]',"target_lists"),App.concerns.enable_associattion_search_modal("#open_target_list","/xhr/target_lists/search_as_association_modal","#portlet_search_params_target_list_ids","multiple"),a.find("select").select2(),a.find("[data-hp-select2-destroy='true']").select2("destroy"),a.find("[data-hp-role='datepicker']").datepicker({minViewMode:"months",format:"yyyy/mm"}),a.find("[data-hp-role='datepicker-default']").datepicker(Object.assign({orientation:"bottom"})),App.front_segments.set_segment_select2("#portlet_form_search_segment_ids"),App.concerns.set_associate_entities_to_s2("#web_forms_multiple_decision","#portlet_form_search_web_form_ids",'input[name="associate_web_forms[]"]',"web_forms"),App.concerns.enable_associattion_search_modal("#open_web_form","/xhr/web_forms/search_segment_association_modal","#portlet_form_search_web_form_ids","multiple"),$("#s2id_portlet_form_search_web_form_ids").width("100%"),["by_pref","by_industry","by_worker_number","by_capital","by_listing_classification","by_product_type"].forEach(function(n){var e=document.getElementById(n);e&&e.addEventListener("change",function(){var t=this.checked;document.querySelectorAll('[id^="'+n+'_"]').forEach(function(e){e.checked=t})});var i=document.querySelectorAll('[id^="'+n+'_"]');i.forEach(function(e){e.addEventListener("change",function(){var e=this.checked,t=document.getElementById(n);!t.checked&&e&&(t.checked=!0),i[0].checked||i[1].checked||i[2].checked||(t.checked=!1)})})});var i=a.find("#portlet_portlet_form_selected_search_period");if(a.find("life-cycle-funnel").data("modal")){var s=a.find("life-cycle-funnel");t={portlet_id:s.data("portlet_id"),aggregation_point_id:s.data("aggregation_point_id"),client_rank:s.data("client_rank"),lead_stages:s.data("lead_stages")};App.front_segments.set_life_cycle_funnel_modal(t)}i.on("change",function(){var e=$("#search_period_month_in");"input_period"==$(this).val()?e.show():e.hide()}),i.trigger("change");var o=a.find("#select_start_search_period");o.on("change",function(){var e=$("#search_start_period_by_date");"input_start_period"==$(this).val()?e.show():e.hide()}),o.trigger("change");var r=a.find("#select_finish_search_period");r.on("change",function(){var e=$("#search_finish_period_by_date");"input_finish_period"==$(this).val()?e.show():e.hide()}),r.trigger("change");var l=a.find("#portlet_portlet_form_selected_search_period");l.on("change",function(){var e=$("#search_period_by_select"),t=$("#search_period_by_date");$(this).is(":checked")?(e.hide(),t.show()):(e.show(),t.hide())}),l.trigger("change");var c=a.find("#task_summary_sort_flg");c.on("change",function(){var e=$("#select_sort_status_and_order");$(this).is(":checked")?e.show():e.hide()}),c.trigger("change")},load_portlet_content:function(e){var n=App.front_home,i=$(e),t=i.find(".portlet"),a=$(".grid-stack").data("gridstack"),s=t.find(".portlet-content"),o=new App.concerns.loading_indicator(t,{spin_area:"portlet-loading-spinner"}),r=function(){var e=t.height();e+=n.DASHBOARD_MARGIN,e/=n.DASHBOARD_ROW_HEIGHT,e=Math.ceil(e),a.resize(i,i.attr("data-gs-width"),e)};o.begin(),$.ajax({type:"GET",url:i.data("url"),data:i.data("params")}).done(function(e){o.finish(),s.html(e),s.find(".hp-tooltip").tooltip({container:"body",trigger:"hover"}),r(),r();var t=s.find("[data-hp-role='chart-form']");t.find("[name=stacking_type]").on("click",function(){t.find("[data-hp-role='stacking-type']").attr({name:this.name,value:this.value})}),t.find("[name=attribute]").on("click",function(){t.find("[data-hp-role='attribute']").attr({name:this.name,value:this.value})}),t.on("submit",function(e){return e.preventDefault(),i.data("params",$(this).serialize()),n.load_portlet_content(i),!1})})},
load_portlet_content_pref:function(e,t){var n=$("#portlet_chart_form");$("#pref_display_flg").val(e),$("#area_name").val(t),n.submit()},go_bottom:function(e){$("html,body").delay(100).animate({scrollTop:e.offset().top-$("[role='navigation']").outerHeight(!0)},1500)},set_personnel_data:function(){$("#personnel_business_card_id").val($(this).data("business-card-id")),$("#personnel_id").val($(this).data("id")),$("#p_created_at").text($(this).data("created-at")),$("#p_registration_kbn").text($(this).data("registration-kbn")),$("#p_department").text($(this).data("department")),$("#p_department_post").text($(this).data("department-post")),$("#p_business_card_department_post").text($(this).data("business-card-department-post")),$("#p_icon_old_department_post").text($(this).data("old-department-post")),$("#p_announced_at").text($(this).data("announced-at")),$(this).data("effected-at")?$("#p_effected_at").text($(this).data("effected-at")):$("#p_effected_at").text($(this).data("effected-date-str")),$("#p_image").attr("src",$(this).data("image-path")),""==$(this).data("image-path")?$("#p_image").css("visibility","hidden"):$("#p_image").css("visibility","visible"),$("#p_personnel_change_image").attr("src",$(this).data("personnel-change-image-path")),""==$(this).data("image-path")?$("#p_personnel_change_image").css("visibility","hidden"):$("#p_personnel_change_image").css("visibility","visible"),$("#p_web_link_client").text($(this).data("client-name")),$("#p_web_link_name").text($(this).data("full-name")),$("#personnel_post").val($(this).data("department-post")),$("#personnel_read_flg").prop("checked",$(this).data("read-flg")),$("#p_google_search_link").attr("href","https://www.google.co.jp/search?q="+$(this).data("client-name")+" "+$(this).data("full-name")),$("#p_business_card_show_link").attr("href",$(this).data("business-card-show-path")),$("#error_messege").html("")},init_personnel_change_modal:function(){$(".write-department-button").click(function(){$("#personnel_department").val($("#p_input_department_post").text())}),$(".write-post-button").click(function(){$("#personnel_post").val($("#p_input_department_post").text())}),$(".write-trade-on-button").click(function(){$("#personnel_trade_on").val($("#p_input_effected_at").text())});var e=$("#modal_personnel_change_edit .datepicker");e.datepicker().on("show",function(){e.css("zIndex","1151")}).on("hide",function(){e.css("zIndex","10")}),e.attr({format:"YYYY-MM-DD hh:mm"}),e.datepicker()},init_clipboard:function(){$(".clipboard-btn").tooltip({trigger:"hover",placement:"right"});var e=new Clipboard(".clipboard-btn"),t=$(".clipboard-btn").data("original-title");e.on("success",function(e){$(e.trigger).attr("data-original-title",t).tooltip("show")})},init_add_dashboard_modal:function(){$("#add_own_dashboard").select2(),$("#add_share_dashboard").select2(),$("#toggle_dashboard_list").click(function(){$("#own_dashboard_list").toggleClass("active"),$("#share_dashboard_list").toggleClass("active"),$("#add_own_dashboard").val("").trigger("change"),$("#add_share_dashboard").val("").trigger("change")}),$("#addDashBoardModal").on("hidden.bs.modal",function(){$("#add_dashboard_error_message").empty(),$("#toggle_dashboard_list").prop("checked",!1),$("#add_own_dashboard").val("").trigger("change"),$("#add_share_dashboard").val("").trigger("change")}),$("#addDashBoardModal #new_submit_share, #addDashBoardModal #new_submit_own").on("click",function(){$("#new_submit_own").css("pointer-events","none"),$("#new_submit_own").css("background-color","#e0e0e0"),$("#new_submit_own").css("background-image","none"),$("#new_submit_share").css("pointer-events","none"),$("#new_submit_share").css("background-color","#e0e0e0"),$("#new_submit_share").css("background-image","none")})},clear_dashboard_modal:function(){$(function(){$(".modal").on("hidden.bs.modal",function(){$('span[name="dashboard_error_message"]').empty(),$(this).find('input[type="text"]').val(""),$(this).find("input#dashboard_id").val(""),$(this).find('input[type="checkbox"][name="dashboard[public_flg]"]').prop("checked",!1)})})},init_copy_dashboard_modal:function(){$(function(){$('a[name="fill_in_copy_modal"]').on("click",function(){$("#copyDashboardModal").find('input[name="dashboard[title]"]').val($(this).data("title")),$("#copyDashboardModal").find('input[name="dashboard[title_en]"]').val($(this).data("title-en")),$("#copyDashboardModal").find('input[name="dashboard[id]"]').val($(this).data("id")),$("#copyDashboardModal").find('input[type="checkbox"]').prop("checked",$(this).data("public-flg"))})})},init_update_dashboard_modal:function(){$("#updateDashboardModal").on("hidden.bs.modal",function(){$("#dashboard_error_message").empty()})},scroll_navbar_menu:function(){function a(e){e.className.includes("active")?e.classList.add("add_active_color_gradient_right"):e.classList.add("add_color_gradient_right")}function s(e){e.className.includes("active")?e.classList.add("add_active_color_gradient_left"):e.classList.add("add_color_gradient_left")}function o(e){e.classList.remove("add_active_color_gradient_right","add_color_gradient_right","add_active_color_gradient_left","add_color_gradient_left")}function r(){$("a.dashboard-name").each(function(){$(this).css({width:"",overflow:"","padding-left":"","padding-right":""})}),$(".nav-item.btn-group.nav-item-scroll").css("margin-left",""),$(".nav-item.btn-group.nav-item-scroll")[0].style.marginLeft="0px"}function l(e,t){width=t.right-v-e.getBoundingClientRect().left;var n=0;width<0&&(width=0),width<v-2&&(n=(v-2-width)/2);var i=e.querySelector("a");i.style.width=width+"px",i.style.overflow="hidden",0<n&&(i.style.paddingLeft=12-n+"px",i.style.paddingRight=12-n+"px"),lasterTab=Array.from(g).indexOf(i.parentElement),lasterTab==g.length-1&&g[lasterTab].getBoundingClientRect().right+4<t.right&&a(g[lasterTab])}function c(e,t){tabPosition=e.getBoundingClientRect(),width=tabPosition.right-v-t.left;var n=0;if(width<0&&(width=0),width<v-2&&(n=(v-2-width)/2),widthLeftDefault=t.left,0<width&&tabPosition.left<t.left){0<tabPosition.left?margin_left=C+(t.left-tabPosition.left):margin_left=C+Math.abs(tabPosition.left)+t.left;var i=e.querySelector("a");0<n&&(i.style.paddingLeft=12-n+"px",i.style.paddingRight=12-n+"px"),i.style.width=width+"px",i.style.overflow="hidden",e.style.marginLeft=margin_left+"px"}else e.style.marginLeft="0px"}function i(){A=$(".navbar_menu")[0].getBoundingClientRect(),r();for(var e=0,t=g.length-1,n=0,i=0;e<g.length;){if(tabPosition=g[e].getBoundingClientRect(),d(tabPosition,A)){a(g[n=e-1]),o(g[e-2]),m.removeClass("disabled");break}o(g[e]),++e==g.length&&g[e-1].getBoundingClientRect().right>A.right+4&&a(g[e-1])}for(;0<=t;){if(tabPosition=g[t].getBoundingClientRect(),u(tabPosition,A)){s(g[i=t+1]),o(g[t+2]);break}t--}0!=i&&c(g[i],A),0!=n?l(g[n],A):g[e-1].getBoundingClientRect().right>A.right&&l(g[e-1],A)}function d(e,t){return 0<e.left-t.right}function u(e,t){return e.right<t.left}function e(){r();for(var e=0;e<g.length;){if(tabPosition=g[e].getBoundingClientRect(),d(tabPosition,A)){b+=tabPosition.right-A.right;break}e++}return e==g.length&&(b+=g[g.length-1].getBoundingClientRect().right-A.right+4),b<=0?y-p.width():b}function t(){r();for(var e=g.length-1;0<=e;){if(tabPosition=g[e].getBoundingClientRect(),u(tabPosition,A)){b-=A.left-tabPosition.left;break}e--}return e<=0&&(b=0),b}function _(){if(new Date-h<T)setTimeout(_,T);else{E=!1,r();var e=Math.round(100*b)/100,t=Math.round(100*A.right)/100-e;A=$(".navbar_menu")[0].getBoundingClientRect();var n=t-(Math.round(100*A.right)/100-e);b=Math.max(0,e+n),$(".navbar_menu").animate({scrollLeft:b},100,function(){0===p.scrollLeft()&&(f.prop("disabled",!0),f.addClass("disabled")),m.prop("disabled",!1),m.removeClass("disabled"),p.scrollLeft()+p.width()+2>=p[0].scrollWidth&&(m.prop("disabled",!0),m.addClass("disabled")),f.prop("disabled",!1),f.removeClass("disabled"),i()})}}function n(e){var t=e.querySelector("ul");left=e.getBoundingClientRect().width-t.getBoundingClientRect().width,"default-dashboard"!=e.id?left<0?t.style.left=e.getBoundingClientRect().left-Math.abs(left)+"px":t.style.left=e.getBoundingClientRect().left+left+"px":t.style.left=e.getBoundingClientRect().left+"px",t.style.top=Number(e.getBoundingClientRect().top+38)+"px"}$("html, body").animate({scrollTop:0});var h,p=$(".navbar_menu"),f=$(".scroll-left"),m=$(".scroll-right"),g=document.querySelectorAll(".nav-item.btn-group.nav-item-scroll"),A=$(".navbar_menu")[0].getBoundingClientRect(),v=$(".dashboard-btn.dropdown-toggle.dropdown-toggle-split")[0].getBoundingClientRect().width,b=0,y=0,w=document.querySelector(".nav-item-scroll.active"),k=Array.from(g).indexOf(w),C=5.9,E=!1,T=100;g.forEach(function(e){y+=e.offsetWidth+9}),g[k].getBoundingClientRect().right>p.width()&&(b=g[k].getBoundingClientRect().right-A.right)<0&&(b=0),y<p.width()?$(".dashboards").css("justifyContent","space-between"):$(".area-control").css("marginLeft","9px"),-1!==k&&(g[k]!=g[g.length-1]?a(g[k]):(m.prop("disabled",!0),m.addClass("disabled")),g[k].scrollIntoView()),i(),0===b&&0===p.scrollLeft()?(f.prop("disabled",!0),f.addClass("disabled")):(f.prop("disabled",!1),f.removeClass("disabled")),y<=p.width()&&(f.prop("disabled",!0),f.addClass("disabled"),m.prop("disabled",!0),m.addClass("disabled")),f.click(function(){p.animate({scrollLeft:t()},100,function(){0===p.scrollLeft()&&(f.prop("disabled",!0),f.addClass("disabled")),m.prop("disabled",!1),m.removeClass("disabled"),i()})}),$(window).resize(function(){h=new Date,document.querySelector("#default-dashboard")==default_dashboard&&(m.prop("disabled",!1),m.removeClass("disabled"),i()),!1===E&&(E=!0,setTimeout(_,T))}),window.addEventListener("scroll",function(){var e=document.querySelector(".nav-item.btn-group.nav-item-scroll.open");e&&n(e),0!=this.scrollX&&(A=$(".navbar_menu")[0].getBoundingClientRect())}),m.click(function(){p.animate({scrollLeft:e()},100,function(){p.scrollLeft()+p.width()+2>=p[0].scrollWidth&&(m.prop("disabled",!0),m.addClass("disabled")),f.prop("disabled",!1),f.removeClass("disabled"),i()})}),$(".js-customer-dropdown .dropdown-toggle-split-item").click(function(){var e=$(this).next(),t=$(this).parent()[0].getBoundingClientRect().right,n=e.innerWidth()-$(this).innerWidth();e.css({position:"fixed",top:$(this).offset().top-$(window).scrollTop()+38,left:$(this)[0].getBoundingClientRect().right-(n+$(this)[0].getBoundingClientRect().width),right:"auto"}),t<160&&e.css({position:"fixed",top:$(this).offset().top-$(window).scrollTop()+38,left:15,right:"auto"})}),$(".js-customer-dropdown .dropdown-toggle-split-home").click(function(){$(this).next().css({position:"fixed",top:$(this).offset().top-$(window).scrollTop()+38,left:"auto"})})}};var autoDraftSaveFlag=!0;App.front_hot_approach_mails={create:function(){this.setting(),this.setSubmitCaption()},send_test_mail:function(){this.setting(),this.setSubmitCaption()},setting:function(){App.concerns.mail_editor_init("mail_body"),App.concerns.set_mail_tag("mail_body"),App.concerns.submit_when_changed_element("form_set_mail_template","js_change_element","convert"),App.concerns.prevent_submit_pressing_enter(),$('#mail_template_id option[value=""]').after($("<option>").html(I18n.t("js.mails.mail_template")).val("-1")),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||$(e.target).closest(".cke_dialog,.cke").length||this.$element.trigger("focus")},this))},1<=mail_categories.length&&(mail_categories=mail_categories[0].split(",")),0==tagging_operable_flag?$("#mail_categories").select2():$("#mail_categories").select2({tags:mail_categories,tokenSeparators:[","]}),"ab"===$("#mail_queue_mail_type").val()?$(".datetimepicker").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5,showClose:!0}).on("dp.change",function(){App.front_mails.viewSendDate()}):$(".datetimepicker").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5,showClose:!0}),$("#mail_template_id").length&&$("#mail_template_id").select2({width:"300px"}),$(document).on("click",'input[name="mail_queue[sender_auto_flg]"]:radio',function(){"true"==$(this).val()?($("#mail_queue_email_of_sender").addClass("hide"),$("#name_of_sender_row").css("display","none")):($("#mail_queue_email_of_sender").removeClass("hide"),$("#name_of_sender_row").css("display",""))}),$(".checked_submit_button").on("click",function(e){e.preventDefault();var t=$(this),n=$("#form_send_mail");setTimeout(function(){$(".save_from_button_flg").val("true"),$("#mail_queue_status").val(t.data("status")),$("#select_mail_template_id").val($("[name=mail_template_id]").val()),t.data("remote")?n.data("remote",t.data("remote")):n.removeData("remote"),n.attr("action",t.data("action")),n.find('[name="_method"]').val(t.data("method")),App.front_hot_approach_mails.check_err_file_not_found(n),$(".tooltip").hide(),"commit"==t.attr("name")&&setTimeout(function(){t.prop("disabled",!1)},1e3)},1e3),t.prop("disabled",!0)});var e=this,t=window.navigator.userAgent.toLowerCase();$("s2id_mail_template_id").on("change",function(){e.autoDraftSave()}),$(document).on("mousedown","#modalSendMail .close",function(e){e.preventDefault()}),$("#form_send_mail table input, textarea").not("input[type=hidden], input[type=file], #js_html_tag_tracking_insert_url").on("blur",function(){-1!=t.indexOf("firefox")&&document.activeElement!=document.body||e.autoDraftSave()}),$("input#mail_queue_test_mail_to").on("blur",function(){e.autoDraftSave()}),this.toggleSwitchAfterAutoSave(),$(".standard-insert-tag").hide(),$(".insert_tag_enable_button").prop("disabled",!0),$(".insert_tag_enable_button").on("click",function(){$(".insert_enable_flg").val("true"),$("#insert_tag_enable_button_flg").val("true"),e.autoDraftSave(),$("#insert_tag_enable_button_flg").val("false")}),$("#mail_template_id").change(function(){$("#template_to_ids").val($("#search_to_ids").val())}),this.previewModal(),["right","bottom","top"].forEach(function(e){$(".hp-tooltip-"+e).tooltip({container:"body",trigger:"hover",placement:e,html:"true"})}),-1!=t.indexOf("firefox")&&$("#mail_template_id").on("select2-close",function(){$(".tooltip").hide()}),$("#mail_queue_content_type").on("change",this.show_editor_tab),this.createMail()},createMail:function(){var t,a=this,i=null;$("#choose-file").on("click",function(){$("#mail_queue_file").click()}),$(".attach-file-name").on("click",function(){$("#mail_queue_file").click()}),$("#mail_queue_file").on("change",function(){attachmentList=$(this).prop("files"),0<attachmentList.length?(i=attachmentList[0],attachment=i.name,-1==$(".download-attach-file").attr("class").indexOf("hide")&&$("#check_exists_file").val(!0)):i&&(attachment=$("#attach_file_name").val()+$("#attach_file_extension").val(),a.setFileUpload(i)),attachment&&($(".trash-o-button.delete-attach-file").removeClass("hide"),$(".pen-button.edit-file-name").removeClass("hide"),$("#check_choose_file").val(!0),$("#delete_file_flg").val(""),-1==attachment.indexOf(".")||-1!=attachment.indexOf(".")&&!attachment.split(".").at(-1)?($(".attach-file-name").html(a.truncateNameFile(attachment)),$("#attach_file_name").val(attachment),$("#attach_file_extension").val(""),a.regexFile(attachment)):(arr_file=attachment.split("."),extension_file="."+arr_file.pop(),name_file=arr_file.join("."),$(".attach-file-name").html(a.truncateNameFile(attachment)),$("#attach_file_name").val(name_file),$("#attach_file_extension").val(extension_file),a.regexFile(name_file,extension_file))),$(".download-attach-file").addClass("hide")}),($("#attach_file_name").val()||$("#attach_file_extension").val())&&($(".attach-file-name").html(a.truncateNameFile($("#attach_file_name").val()+$("#attach_file_extension").val())),a.regexFile($("#attach_file_name").val(),$("#attach_file_extension").val())),$(".edit-file-name").on("click",function(){if(a.checkExistsFileToMail()){var e=ModalUtils.maxZIndex();$("#modalEditFileName").css("z-index",e+1).modal("show"),t=a.ltrim($("#attach_file_name").val()),$("#name_file").val(t),$("#extension_file").html(a.truncateExtensionFile($("#attach_file_extension").val())),a.regexNameFileInModal(t)}}),$(".rename_exec").on("click",function(){if(size_name=$("#name_file").val().length+$("#attach_file_extension").val().length,255<size_name)alert(I18n.t("js.mails.alert_message_file_name_longest"));else if(0==$("#name_file").val().trim().length)alert(I18n.t("js.mails.alert_message_file_name_shortest"));else{var e=a.ltrim($("#name_file").val()),t=a.truncateNameFile(e+$("#attach_file_extension").val());if($("#attach_file_name").val(e),$(".attach-file-name").html(t),a.regexFile($("#attach_file_name").val(),$("#attach_file_extension").val()),i){var n=new File([i],$(".attach-file-name").html(),{type:i.type,lastModified:i.lastModified,lastModifiedDate:i.lastModifiedDate});a.setFileUpload(n)}$("#modalEditFileName").modal("hide")}}),$("#name_file").on("keypress",function(e){return 13!==e.which}),$("#name_file").on("focusout",function(){a.regexNameFileInModal($(this).val())}),$(".download-attach-file").on("click",function(){if(a.checkExistsFileToMail()){var e=$("#attach_file_name").val()+$("#attach_file_extension").val(),t=$("#link-download-attach-file").attr("href"),n=t.split("/"),i=n.indexOf("download")+1;t=(t=-1!=$("#link-download-attach-file").attr("href").indexOf("mail_templates")?"/mail_templates/download/"+n[i]:"/client_mail_histories/download/"+n[i]).concat("?file_name="+e),$("#link-download-attach-file").attr("href",t),$("#link-download-attach-file")[0].click()}}),$(".delete-attach-file").on("click",function(){a.checkExistsFileToMail()&&confirm(I18n.t("js.mails.confirm_delete_attach_file"))&&($("#mail_queue_file").val(""),$("#delete_file_flg").val(!0),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mails.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(this).addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"))})},check_err_file_not_found:function(e){var t=$("#mail_queue_file");if(t.val()){var n=URL.createObjectURL(t.get(0).files[0]);fetch(n).then(function(){e.submit()})["catch"](function(){$("#mail_queue_file").val(""),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(".delete-attach-file").addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"),$("#error_not_found").val(!0),e.submit(),$("#error_not_found").val(!1)})}else e.submit()},checkExistsFileToMail:function(){var t=!0,n=!1;return $(".download-attach-file").attr("class")&&-1==$(".download-attach-file").attr("class").indexOf("hide")&&(n=!0),$.ajax({url:"/xhr/hot_approach_mail_queues/check_exists_file_to_mail",type:"POST",data:{id:$("#mail_queue_id").val()},async:!1}).success(function(e){!e.check_exists_file&&n&&(alert(I18n.t("js.mails.err_file_not_found")),$("#mail_queue_file").val(""),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(".delete-attach-file").addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"),t=!1)}),t},regexFile:function(e,t,n){e=e||"",t=t||"",n=n||"";var i=new RegExp("^[a-zA-Z0-9]*.?[a-zA-Z0-9]+$"),a=new RegExp("^[a-zA-Z0-9]*$"),s=e+t;i.test(s)&&""!=t||a.test(s)&&""==t?$(n+".attach-file-warning").addClass("hide"):$(n+".attach-file-warning").removeClass("hide")},truncateNameFile:function(e){var t=e||"";return 22<t.length&&(t=t.slice(0,9)+"..."+t.slice(-12)),t},truncateExtensionFile:function(e){return 11<e.length&&(e=e.slice(0,6)+"..."+e.slice(-5)),e},regexNameFileInModal:function(e){new RegExp('["*:<>?/\\\\|]').test(e)&&(alert(I18n.t("js.mails.invalid_special_character").replace(/&quot;/g,'"')),$("#name_file").val($("#attach_file_name").val()))},setFileUpload:function(e,t){t=t||$("#mail_queue_file");var n=new DataTransfer;n.items.add(e);var i=n.files;t.prop("files",i)},ltrim:function(e){return e?e.replace(/^\s+/g,""):e},setSubmitCaption:function(){$("[id^='mail_queue_reservation_flg_']").on("click",function(){var e="";$("#mail_queue_reservation_flg_0").prop("checked")?(e=$("#send_caption").val(),$("#mail_queue_reservation_at").prop("disabled",!0)):(e=$("#scheduled_delivery_caption").val(),$("#mail_queue_reservation_at").prop("disabled",!1)),$("#mail_submit").text(e)})},autoDraftSave:function(){var e=$(".checked_submit_button"),t=$("#form_send_mail"),n=e.data("method");if("post"==n)return!1;$("#mail_queue_status").val(e.data("status")),$("#select_mail_template_id").val($("[name=mail_template_id]").val()),t.attr("action",e.data("action")),t.find('[name="_method"]').val(n),$("<input>",{type:"hidden",name:"save_type_draft",value:!0,id:"auto-draft-save"}).appendTo(t),!$("#skip-atuo-save").length&&autoDraftSaveFlag&&(data_param=t.serialize(),data_param=data_param.replace(/&mail_queue\%5Bbody\%5D=(.*?)&/,"&mail_queue%5Bbody%5D="+encodeURIComponent(CKEDITOR.instances.mail_body.getData())+"&"),$.ajax({url:t.attr("action"),type:t.attr("method"),data:data_param,timeout:7e4,beforeSend:function(){$(".auto-draft-msgbox.saving").css("opacity",1),$(".auto-draft-msgbox.saving").css("visibility","visible"),autoDraftSaveFlag=!1},complete:function(){$(".auto-draft-msgbox.saving").css("opacity",0),$(".auto-draft-msgbox.saving").css("visibility","hidden"),setTimeout(function(){autoDraftSaveFlag=!0},0)},success:function(){},error:function(){$(".auto-draft-msgbox.error").css("opacity",1),$(".auto-draft-msgbox.error").css("visibility","visible"),setTimeout(function(){$(".auto-draft-msgbox.error").css("opacity",0),$(".auto-draft-msgbox.error").css("visibility","hidden")},2e3)}})),$("#auto-draft-save").remove(),$("#skip-atuo-save").remove()},toggleSwitchAfterAutoSave:function(){var t=this;[".hp-page > ul.search-nav a",".btn-to-list","a#open-associated-to","a#open-associated-cc","a#open-associated-bcc"].forEach(function(e){$(e).on("mousedown",function(){t.setTempButtonToPreventAutoSave($(this))})})},setTempButtonToPreventAutoSave:function(e){this.autoDraftSave(),$("<input>",{type:"hidden",value:!0,id:"skip-atuo-save"}).appendTo(e),e.click()},setClient:function(e){$("#change_client_select2_flg").val()?$("#search_client_id_on_search_association_modal").val(e):(reg=new RegExp("^lead_"),id=$("#search_to_ids").val().split(",").filter(function(e){return reg.test(e)})[0],id?$.getJSON("/xhr/leads/return_client",{id:id.slice(5)},function(e){$("#search_client_id_on_search_association_modal").val(e.id),App.concerns.select_search("search_client_id_on_search_association_modal"),App.concerns.set_associate_entity_to_s2("#search_client_id_on_search_association_modal",".hp-clients-table button.decision","clients"),$("#business_card_service_client_id").val(e.id)}):$("#business_card_service_client_id").val(""))},previewModal:function(){var o=$("#previewModal");$(document).on("show.bs.modal","#previewModal",function(){if($(document).find(".modal-open")[0]){var e=ModalUtils.maxZIndex();$(".modal-backdrop").last().css("z-index",e+1),o.css("z-index",e+2)}$("#previewTextTab").removeClass("hide"),$("#previewHtmlTab").removeClass("hide");var t=$("#mail_queue_content_type").val(),n=$("input[name='mail_queue[sender_auto_flg]']:checked").val(),i=$("#mail_queue_name_of_sender").val();"true"===n&&(i=I18n.t("js.mails.preview_from_client"));var a=$("#mail_queue_file").prop("files"),s="";0<a.length?s=a[0].name:($("#attach_file_name").val()||$("#attach_file_extension").val())&&(s=$("#attach_file_name").val()+$("#attach_file_extension").val()),"1"===t?($("#previewHtmlTab").addClass("hide"),$('[href="#previewTextBody"]').tab("show")):"2"===t?($("#previewTextTab").addClass("hide"),$('[href="#previewHtmlBody"]').tab("show")):"3"===t&&$('[href="#previewHtmlBody"]').tab("show"),$("#previewFrom").html(i),$("#previewSubject").html($("#mail_queue_title").val()),$("#previewAttachment").html(s),$("#previewHtmlBody").html(CKEDITOR.instances.mail_body.getData()),$("#previewTextBodyArea").text($("#mail_text_body").val())}).on("hidden.bs.modal","#previewModal, #modal_check_tbc, #relation_lead_client_edit_container, #search-associated-resources-modal, #excluded_destinations_modal",function(){var e=ModalUtils.maxZIndex();$(".modal-backdrop").last().css("z-index",e-1)}),$(document).on("hidden.bs.modal",function(){$("#modalSendMail").addClass("modal-open")})},viewSendDate:function(){var e=$("#day_of_the_week").val().split(",");if(document.getElementById("ab_test_mail_setting_reservation_flg_0").checked)$("#period-box").fadeIn(250),$("#test-period-start").text($("#after_send").val()),$("#test-period-tilde").removeAttr("hidden"),App.front_mails.showSec();else if(document.getElementById("ab_test_mail_setting_reservation_flg_1").checked){$("#period-box").fadeIn(250);var t=new Date($("#ab_test_mail_setting_reservation_at").val());if("Invalid Date"!==t.toString()){$("#test-period-start").text(App.concerns.formatDate(t,"yyyy/MM/dd(aaa) HH:mm",e)),$("#test-period-tilde").removeAttr("hidden");var n=new Date(t.getTime()+60*$("#ab_test_mail_setting_period").val()*60*1e3);$("#test-period-end").text(App.concerns.formatDate(n,"yyyy/MM/dd(aaa) HH:mm",e))}}},clearDestinationsSearchForm:function(e){$(e+" .clear-btn").click(function(){$("form"+e+" :input").each(function(){"checkbox"===$(this).attr("type")?$(this).prop("checked",!1):"radio"===$(this).attr("type")||"submit"===$(this).attr("type")||$(this).val("")})})},fetchDestinationsList:function(e){e?($("#check_specific_mark").val(!0),$("#form_change_display_number_for_target_tab").submit(),$("#check_specific_mark").val("")):$("#form_change_display_number_for_target_tab").submit()},loadingDestinationsList:function(e,t){$(e).on({"ajax:beforeSend":function(){$(t).html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:error":function(){$(t).html($('<div class="loadError"><span>'+I18n.t("js.application.load_error")+"</span></div>"))}})},addDestination:function(){$(".mail_lead_filter").on("hidden.bs.modal",function(){"ab"!=$("#template_mail_type").val()&&(App.front_hot_approach_mails.fetchDestinationsList(!0),$("input[name='mail_queue[lead_ids]']").val($("#lead_filter_added_lead_ids").val()))})},clearDestinaion:function(){$("#clear_destination").click(function(){return $("#form_send_mail input[name='mail_queue[client_ids]']").val().length<=0?(alert(I18n.t("js.mail.alert_destination_not_set")),!1):!!window.confirm(I18n.t("js.mail.confirm_clear_destination"))&&void 0})},updateMailHistoriesDestination:function(){App.front_mail_histories.fetchDestinationsList(),$("#destinations_visible_fields_setting_dialog .js_list_field").each(function(){$("#visible_fields_setting_dialog input:checkbox[value="+$(this).val()+"]").prop("checked",$(this).prop("checked"))})},updateWhenNotShowAbility:function(){$(".modal-caller").attr("disabled",null),$(".modal-caller").css("pointer-events",""),$("body").addClass("modal-open"),App.front_mails.fetchDestinationsList(!0)},fixCurrentPageLink:function(e){$(e+" .pagination li.active a").click(function(){if("#"==$(this).attr("href"))return!1})}},App.front_hot_approaches={index:function(){App.front_deals.all_checked_items_modal_deals_index(),form_id="form_search_hot_approaches",App.concerns.datepicker(".search_datepicker",{language:"ja"}),$(document).on("click",".btn-ha-base-modal",function(){targe_id=$(this).data("target"),$(targe_id).html($(targe_id+"_template").html())}),$(document).on("click",".search-conditions-title > button",function(){$(this).hasClass("collapsed")?($(this).attr("aria-expanded","false"),$(this).removeClass("collapsed"),$(this).parent().find(".glyphicon-chevron-down").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-right"),$("input[id=others_display_search_condition]").val(!1)):($(this).attr("aria-expanded","true"),$(this).addClass("collapsed"),$(this).parent().find(".glyphicon-chevron-right").removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-down"),$("input[id=others_display_search_condition]").val(!0)),App.front_hot_approaches.submit_form_search_hot_approaches(),$(".ha-loading").hide()}),$(document).on("click",".remove-date-save-search",function(){$("#search_name").val("")}),this.get_modal_to_search_save("#form_search_hot_approaches"),App.searches.callForSearchCondition.init(),$(document).on("click",".ha-chose-item",function(){targe_id=$(this).data("target"),$(targe_id+"_left input:checked").each(function(e,t){item=$(targe_id+"-"+$(t).val()),item.find("input").remove(),item.removeClass("ha-business_keyword-item"),$(targe_id+"_right").append(item.clone()),item.remove()})}),$(document).on("keyup","#ha_business_keyword_search",function(e){13===e.keyCode&&App.front_hot_approaches.ha_filter_keyword()}),$(document).on("change",".ha-search .checkbox-circle input[type='checkbox']",function(){$(this).prop("checked")?$(this).parent(".checkbox-circle").addClass("active"):$(this).parent(".checkbox-circle").removeClass("active")}),$(document).on("click",".ha-search .btn-check-all",function(){$(".ha-search .modal-body input[type='checkbox']").prop("checked",!1),$(".ha-search .modal-body input[type='checkbox']").click()}),$(document).on("click",".ha-search .btn-uncheck-all",function(){$(".ha-search .modal-body input[type='checkbox']").prop("checked",!0),$(".ha-search .modal-body input[type='checkbox']").click()}),$(document).on("click",".submit_multiple_select_modal",function(){id=$(this).data("id"),target=$(this).data("target"),App.front_hot_approaches.submit_multiple_select_modal(id,target)}),$(document).on("click",".ha-search .submit_multiple_checkbox_modal",function(){source=$(this).data("source"),target=$(this).data("target"),App.front_hot_approaches.submit_multiple_checkbox_modal(source,target)}),$(document).on("click",".ha-search .submit_datetime_range",function(){source=$(this).data("source"),target=$(this).data("target"),error_message_container=$(this).data("error-message")||"#alert-message",App.front_hot_approaches.submit_datetime_range(source,target,error_message_container)}),$(document).on("keyup",".ha-free-word",function(e){$("#js_search_success_message").empty();var n="";if($(".ha-free-word").each(function(e,t){100<$(t).val().length&&(error_message=$(this).data("validate"),n+="<li>"+$(t).data("validate")+"</li>")}),0<n.length&&(error_message_html='<div class="row"><div class="col-xs-12"><div class="alert alert-danger alert-error alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><ul>'+n+"</ul></div></div></div>",$("#js_search_success_message").append(error_message_html),13===e.keyCode))return e.preventDefault(),!1}),$(document).on("keypress",".ha-free-word",function(e){"Enter"!==e.key||e.isComposing||(target="#"+$(this).attr("id").replace("ha_",""),val=$(this).val(),$(target).val(val),App.front_hot_approaches.submit_checkbox_search(val,target),e.preventDefault())}),$(document).on("change",".js_ha_and_or",function(){var e="1"==$(this).val();$("#ha_search_search_conditions_and").prop("checked",e),$("#ha_search_search_conditions_and").trigger("change")}),$(document).on("change","#ha_search_client_sale_approaches_deadline_from, #ha_search_client_sale_approaches_deadline_to",function(){var e=$("#ha_search_client_sale_approaches_deadline_from").val(),t=$("#ha_search_client_sale_approaches_deadline_to").val();$("#search_client_sale_approaches_deadline_from").val(e),$("#search_client_sale_approaches_deadline_to").val(t),0!=e.length&&0!=t.length&&moment(e,"YYYY/MM/DD")>moment(t,"YYYY/MM/DD")?($("body,html").animate({scrollTop:0},0),$("#alert-deadline-date-error-message").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul>        <li>'+$("#valid_date_range_messsage").val()+"</li>      </ul>    </div>  </div></div>")):($("#alert-deadline-date-error-message").html(""),App.front_hot_approaches.submit_form_search_hot_approaches())}),$(document).on("change","#search_ha_search_owner_user_ids",function(){target="[name='search[owner_user_ids][]']",val=$(this).val(),
App.front_hot_approaches.submit_checkbox_search(val,target)}),$(document).on("change",".ha-left-content.ha-search input[type='checkbox']",function(){$(this).is(":checked")?val=1:val=0,target="#"+$(this).attr("id").replace("ha_",""),App.front_hot_approaches.submit_checkbox_search(val,target)}),$("#ha_search_small_business_categories").select2(),$(document).on("click",".page-top",function(){$("#main-page").animate({scrollTop:0},100)}),App.front_hot_approaches.submit_form_search_hot_approaches(),App.front_hot_approaches.init_setup_wizard(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},ha_filter_keyword:function(){$(".ha-business_keyword-item").each(function(e,t){key_work=$("#ha_business_keyword_search").val().toLocaleLowerCase(),$(t).data("key_work").includes(key_work)?$(t).removeClass("hide"):$(t).addClass("hide")})},submit_multiple_select_modal:function(e,t){var n=[];200<$(e+" option").length?($("#max_select_alert").show(),$(".max_select_alert").show()):($(".ha-loading").show(),$(e+" option").each(function(){if("#search_business_type_id"==t){var e=$($(this).val().split("-")).last()[0];n.push(e)}else n.push($(this).val())}),$(t).val(n),$("input[id=ignore_save_search]").val(!0),$("#form_search_hot_approaches").submit(),$("input[id=ignore_save_search]").val(!1),App.front_clients.submit_small_business_category_modal(),$(".modal").not("#ha_exclusion_modal_dialog").modal("hide"))},submit_multiple_checkbox_modal:function(e,t){var n=[];$(e+" input:checked").each(function(){n.push($(this).val())}),$(t).val(n),App.front_hot_approaches.submit_form_search_hot_approaches(),$(".modal").not("#ha_exclusion_modal_dialog").modal("hide")},submit_datetime_range:function(e,t,n){var i=$(e+"_from").val().replace("\u5e74","/"),a=$(e+"_to").val().replace("\u5e74","/");i.includes("\u65e5")||a.includes("\u65e5")?(i=i.replace("\u6708","/").replace("\u65e5",""),a=a.replace("\u6708","/").replace("\u65e5","")):(i=i.replace("\u6708",""),a=a.replace("\u6708","")),0<$(".search_year:visible").length&&(0<i.length&&(i=moment(i,"YYYY/MM/DD").startOf("year").format("YYYY/MM/DD")),0<a.length&&(a=moment(a,"YYYY/MM/DD").endOf("year").format("YYYY/MM/DD"))),0<$(".search_month_year:visible").length&&(0<i.length&&(i=moment(i,"YYYY/MM/DD").startOf("month").format("YYYY/MM/DD")),0<a.length&&(a=moment(a,"YYYY/MM/DD").endOf("month").format("YYYY/MM/DD"))),0<$(".search_date_month_year:visible").length&&(0<i.length&&(i=moment(i,"YYYY/MM/DD").format("YYYY/MM/DD")),0<a.length&&(a=moment(a,"YYYY/MM/DD").format("YYYY/MM/DD"))),0!=i.length&&0!=a.length&&moment(i,"YYYY/MM/DD")>moment(a,"YYYY/MM/DD")?$(n).html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul>        <li>'+$("#valid_date_range_messsage").val()+"</li>      </ul>    </div>  </div></div>"):($(t+"_from").val(i),$(t+"_to").val(a),App.front_hot_approaches.submit_form_search_hot_approaches(),$(".modal").not("#ha_exclusion_modal_dialog").modal("hide"))},submit_checkbox_search:function(e,t){$(t).val(e),App.front_hot_approaches.submit_form_search_hot_approaches()},init_business_keyword_modal:function(){business_keywords=$("#search_business_keyword_id").val(),0!=business_keywords.length&&jQuery.each(business_keywords.split(","),function(e){option=$("#js_searched_busines_keywords").find("[value='"+e+"']"),$("#js_selected_busines_keywords_select").append(option)})},init_prefecture_modal:function(){var a="active",s=1,t=document.querySelectorAll(".tab__nav li"),n=document.querySelectorAll(".tab");t.forEach(function(e){e.addEventListener("click",function(){$(".js-btn-back").attr("style","display: none"),$("#js-submit-municipalities-modal").attr("style","display: none"),$("#js-submit-prefecture-modal").attr("style","display: block"),t.forEach(function(e){e.classList.remove(a)}),e.classList.add(a),n.forEach(function(e){e.classList.remove(a)}),s=e.getAttribute("data-tab"),document.querySelector("#tab_"+e.getAttribute("data-tab")).classList.add(a)})}),document.querySelectorAll(".item_prefecture .container-prefecture input").forEach(function(i){i.addEventListener("change",function(){var e=i.parentElement.parentElement;if($('.item_prefecture .container-prefecture input[value="'+i.value+'"]').each(function(){this!==i&&(this.parentElement.click(),2!=s&&(i.checked?this.parentElement.classList.add("show"):this.parentElement.classList.remove("show")))}),e.classList.contains(a)?e.classList.remove(a):e.classList.add(a),2==s){var t=i.parentElement,n="show";t.classList.contains(n)?t.classList.remove(n):t.classList.add(n)}})}),$(".js-select-all-pref").click(function(){var e=$(this).data("class");console.log($("#tab_1 ."+e+" .item_prefecture").length==$("#tab_1 ."+e+" .item_prefecture.active").length),$("#tab_1 ."+e+" .item_prefecture").length==$("#tab_1 ."+e+" .item_prefecture.active").length?$("#tab_1 ."+e+" .item_prefecture.active .container-prefecture").click():$("#tab_1 ."+e+" .item_prefecture .container-prefecture").each(function(){this.parentElement.classList.contains(a)||this.click()})}),$(".tab_municipalities .row").addClass("row-none-margin");var e=document.querySelectorAll("#tab_1 .item_prefecture .container-prefecture input"),i=$('#form_search_hot_approaches input[name="search[pref_id]"]').val().split(",");e.forEach(function(e){i.includes(e.value)&&e.click()}),$("#js-submit-prefecture-modal").click(function(){var e=$('#tab_1 input:checkbox:checked[name="search[pref_id][]"]').map(function(){return $(this).val()}).get().join(",");$('#form_search_hot_approaches input[name="search[pref_id]"]').val(e),App.front_hot_approaches.submit_form_search_hot_approaches()}),$(".js-open-municipalities").click(function(){$("#loading").show();var e=$(this),t="/xhr/hot_approaches/search_modals/active_tab_municipalities?prefecture_id="+e.data("prefecture-id");e.data("sale-approach-id")&&(t+="&sale_approach_id="+e.data("sale-approach-id")),$.ajax({url:t,type:"POST",data:$("#form_search_hot_approaches").serializeArray()})})},init_municipalities_modal:function(){$(".js-btn-back").attr("style","display: block"),$("#js-submit-municipalities-modal").attr("style","display: block"),$("#js-submit-prefecture-modal").attr("style","display: none"),$(".js-btn-back").click(function(){$('#tab .tab__nav [data-tab="2"]').click()}),$('#tab .tab__nav [data-tab="1"], #tab .tab__nav [data-tab="2"]').click(function(){$(".tab_municipalities").attr("style","display: none")}),$("#js-submit-municipalities-modal").click(function(){var e=[],t=[],n=$('input:checkbox:checked[name="search[municipalities_id][]"]').map(function(){return e.push($(this).data("name")),t.push($(this).closest(".tab_municipalities").data("pref_id")),$(this).val()}).get().join(",");$('#form_search_hot_approaches input[name="search[municipalities_id]"]').val(n),$('#form_search_hot_approaches input[name="municipalities_name"]').val(e.join(",")),$('#form_search_hot_approaches input[name="selected_pref_ids"]').val($.unique(t).join(",")),App.front_hot_approaches.submit_form_search_hot_approaches()});var e=document.querySelectorAll("input[name='search[municipalities_id][]']"),t=$('#form_search_hot_approaches input[name="search[municipalities_id]"]').val().split(",");e.forEach(function(e){t.includes(e.value)&&$(e).prop("checked",!0)}),$(".tab").removeClass("active"),$(".tab_municipalities").addClass("active"),$(".tab_municipalities").attr("style","display: none"),$("#loading").hide()},init_setup_wizard:function(){$(document).on("click",".ha-wizard-step-1",function(){$(".line.step_settings").removeClass("passed"),$(".li-num.step_settings").removeClass("passed"),$(".step_settings").removeClass("passed"),$(".line.step_preview").removeClass("passed"),$(".li-num.step_preview").removeClass("passed"),$(".step_preview").removeClass("passed"),$(".step_number").addClass("passed")}),$(document).on("click","a.step_settings",function(){$(".ha-submit-step-number:visible").click(),$(".ha-back-step-preview:visible").click()}),$(document).on("click","a.step_preview",function(){$(".ha-submit-step-number:visible").click(),$("#preview_sale_appraoch:visible").click()}),$(document).on("click",".move-step",function(){var e="."+$(this).data("hide"),t="."+$(this).data("show"),n=new Number($("#ha_wizard_limit").val()),i=new Number($("#max_limit_wizard").val());"limit"==$("#ha_type_limit:checked").val()?n<=0?App.front_hot_approaches.load_error_step_number($("#max_limit_wizard").data("limit_gt_0")):i<n?App.front_hot_approaches.load_error_step_number($("#max_limit_wizard").data("limit_lt_search")):($(e).removeClass("passed"),$(t).addClass("passed"),$(this).hasClass("next")&&($(".line"+e).addClass("passed"),$(".li-num"+e).addClass("passed"))):($(e).removeClass("passed"),$(t).addClass("passed"),$(this).hasClass("next")&&($(".line"+e).addClass("passed"),$(".li-num"+e).addClass("passed")))}),$(document).on("click",".create-list",function(){$(".ha-loading").show(),front_xhr_hot_approaches_setup_wizards_path=$("#front_xhr_hot_approaches_setup_wizards_path").val(),$("#form_search_hot_approaches").attr("action",front_xhr_hot_approaches_setup_wizards_path),$("#form_search_hot_approaches").submit()}),$(document).on("hide.bs.modal","#ha-wizard-modal-dialog",function(){front_xhr_hot_approaches_search_path=$("#front_xhr_hot_approaches_search_path").val(),$("#form_search_hot_approaches").attr("action",front_xhr_hot_approaches_search_path),App.front_hot_approaches.reset_wizard_order()})},load_error_step_number:function(e){$("#js_ha_step_number_clone ul li").html(e),$("#js_ha_step_number_error").html($("#js_ha_step_number_clone").html()),"1"==e?$("#js_ha_step_number_error").attr("style","margin: 10px -15px; display: none !important;"):$("#js_ha_step_number_error").attr("style","margin: 10px -15px;")},submit_form_search_hot_approaches:function(){$("input").blur(),$(".ha-loading").show(),$("input[id=ignore_save_search]").val(!0),$("#form_search_hot_approaches").submit(),$("#ha_business_base").modal("hide"),$("input[id=ignore_save_search]").val(!1)},get_modal_to_search_save:function(t){$(document).on("click","#search_save",function(){if("disabled"==$("#search_save").attr("disabled"))return!1;$("#search_save").attr("disabled",!0);var e=$(t).attr("action");$(t).attr("action",$(this).data("action")),$(t).attr("data-remote","true"),$(t).submit(),$(t).attr("action",e),$(".modal-backdrop").remove()})},submit_form_wizard_hot_approaches_setup_numbers:function(){$(".ha-search .ha-loading").show(),front_xhr_hot_approaches_setup_numbers_path=$("#front_xhr_hot_approaches_setup_numbers_path").val(),"true"==$("#is_recommend").val()&&(front_xhr_hot_approaches_setup_numbers_path+="?hot_recommend=true"),console.log(front_xhr_hot_approaches_setup_numbers_path),$("#ha_wizard_limit").val($("#last_ha_wizard_limit").val()),$("#form_search_hot_approaches").attr("action",front_xhr_hot_approaches_setup_numbers_path),$("#form_search_hot_approaches").submit()},reset_wizard_order:function(){$("#wizard_hot_approach_sort_item").val($("#wizard_hot_approach_sort_item").data("default")),$("#wizard_hot_approach_sort_order").val($("#wizard_hot_approach_sort_order").data("default")),$("#wizard_ha_exclusion_id").val($("#wizard_ha_exclusion_id").data("default")),$("#wizard_hot_approach_type").val($("#wizard_hot_approach_type").data("default")),$("#wizard_hot_approach_limit").val($("#wizard_hot_approach_limit").data("default")),$("#wizard_hot_approach_limit").val($("#wizard_hot_approach_limit").data("default")),$(".dom_ha_company_basic_infomation_ids").val("")},setup_wizard_order:function(){var e=$("#ha_wizard_limit").val();$("#wizard_hot_approach_limit").val(e),$("#preview_hot_approach_limit").val(e);var t=$("#ha_wizard_order_type").val();$("#wizard_hot_approach_sort_item").val(t),$("#preview_hot_approach_sort_item").val(t);var n=$("#ha_wizard_order_by_asc").val();$("#wizard_hot_approach_sort_order").val(n),$("#preview_hot_approach_sort_order").val(n);var i=$("input[name='ha[type]']:checked").val();$("#wizard_hot_approach_type").val(i),$("#preview_hot_approach_type").val(i);var a=$("#ha_exclusion").val();$("#wizard_ha_exclusion_id").val(a),$("#preview_ha_exclusion_id").val(a)},submit_additional_modal:function(e,t){$(".btn-addition-modal-"+t).blur(),$(".ha-loading").show();var n=new URLSearchParams(e),i=Object.fromEntries(n),a=$("#front_xhr_hot_approaches_additional_modal_path").val();$.ajax({url:a,type:"post",dataType:"*",data:i})}},data=[];var updateDataChart=[],updateDataChartTab1=[],updateDataChartTab2=[],leadPerPageDefault;if(corporateNumbersData=[],$(document).ready(function(){leadPerPageDefault=$("#default_display_number").val()}),!client_search_tab_click_count)var client_search_tab_click_count=0;if(!lead_search_tab_click_count)var lead_search_tab_click_count=0;var LOADING_TYPE_LEAD="lead",LOADING_TYPE_CHART="chart";App.front_hot_recommends={"var":barchartData=[],"var":barchartCorporateNumbersData=[],index:function(){$(document).on("ready",function(){App.concerns.change_hot_recommends_tab_type(),$($(".hot_recommend")[0]).click(),("0"==$("#init_hot_scenario_default_scenario_flg").val()&&"1"==$("#init_hot_scenario_scenario_type").val()||"1"==$("#init_hot_scenario_default_scenario_flg").val()&&"2"==$("#init_hot_scenario_scenario_type").val())&&$($(".hot_recommend")[1]).click()}),App.front_hot_recommends.disable_select_chart_option(),App.front_hot_recommends.submit_form_search_hot_recommends(),App.front_hot_recommends.add_filter_condition(!0,"tab1"),App.front_hot_recommends.add_filter_condition(!0,"tab2"),App.front_hot_recommends.getHotScenario(),App.concerns.set_form_action_to_submit("#new_business_activity","#js_submit_business_activity_target",!0),App.concerns.set_form_action_to_submit("#form_activity_target_leads","#js_submit_activity_target_leads",!0),App.concerns.load_objects(this),App.visible_fields.setup_list_visible_setting(),App.front_hot_recommends.change_order(),$(document).on("change","#search_search_type_1, #search_search_type_2",function(){if($("#search_search_type_1").is(":checked")&&$("#lead_count").text()!=I18n.t("js.hot_approach_scenario.now_searching"))1==++lead_search_tab_click_count&&updateChart(2);else if($("#search_search_type_2").is(":checked")&&$("#client_count").text()!=I18n.t("js.hot_approach_scenario.now_searching")&&1==++client_search_tab_click_count){var e=$("#hot_approach_scenario_selection option:selected").text();App.front_hot_recommends.search_by_scenario(e,1)}}),App.concerns.all_checked_items(),App.concerns.open_mailer(),$(document).on("change","#hot_approach_scenario_selection",function(){updateDataChartTab1=[],$("#form_hot_recommends_scenario").submit()}),$(document).on("change","#hot_approach_scenario_selection_lead",function(){updateDataChartTab2=[],$("#form_hot_recommends_scenario").submit()}),$("#js_submit_checked_mail").on("click",function(e){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1}),$("#js_submit_search_mail").on("click",function(e){if(0==$('[name="checked[lead_ids][]"]').length)return alert(I18n.t("js.common.serch_result_none")),e.stopImmediatePropagation(),!1}),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){$(".btn-group.open").removeClass("open"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none");var e=App.concerns.set_form_action("form_checked_leads",$(this).data("action"),$(this).data("remote"));return"js_submit_search_mail"===$(this).attr("id")?$("#js_search_mail").prop("disabled",!1):$("#js_search_mail").prop("disabled",!0),e.submit(),!1}),$("#js_get_inside_sales_modal_submit").on("click",function(e){var t=jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()});return 0==t.length?(alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation()):($(".modal-caller").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none"),form=App.concerns.set_form_action("js_form_another_new",$(this).data("action"),$(this).data("remote")),$('#js_form_another_new [name="checked[lead_ids][]"]').remove(),$('#js_form_another_new [name="search"]').remove(),$('#js_form_another_new [name="page"]').remove(),$('#js_form_another_new [name="chart_data"]').remove(),t.forEach(function(e){$("#js_form_another_new").append('<input type="hidden" name="checked[lead_ids][]" value="'+e+'">')}),form.submit()),!1}),$("#js_get_inside_sales_modal_submit_search").on("click",function(){return 0==$('[name="checked[lead_ids][]"]').length?(alert(I18n.t("js.common.serch_result_none")),event.stopImmediatePropagation()):($(".modal-caller").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none"),form=App.concerns.set_form_action("js_form_another_new",$(this).data("action"),$(this).data("remote")),$('#js_form_another_new [name="checked[lead_ids][]"]').remove(),$('#js_form_another_new [name="chart_data"]').remove(),$('#js_form_another_new [name="search"]').remove(),$('#js_form_another_new [name="page"]').remove(),search=$("#js_search_mail").val().replace(/\\n/g,"\\n").replace(/\\'/g,"\\'").replace(/\\"/g,'\\"').replace(/\\&/g,"\\&").replace(/\\r/g,"\\r").replace(/\\t/g,"\\t").replace(/\\b/g,"\\b").replace(/\\f/g,"\\f"),chart_data=JSON.stringify(barchartCorporateNumbersData).replace(/\\n/g,"\\n").replace(/\\'/g,"\\'").replace(/\\"/g,'\\"').replace(/\\&/g,"\\&").replace(/\\r/g,"\\r").replace(/\\t/g,"\\t").replace(/\\b/g,"\\b").replace(/\\f/g,"\\f"),$("#js_form_another_new").append('<input type="hidden" name="search">'),$("#js_form_another_new").append('<input type="hidden" name="page" value="'+$("#js_page_mail").val()+'">'),$("#js_form_another_new").append('<input type="hidden" name="chart_data">'),$('#js_form_another_new [name="search"]').val(search),$('#js_form_another_new [name="chart_data"]').val(chart_data),form.submit()),!1})},modal_open:function(t,n){n||(n=$("#simplyFormModalRecommend")),$.ajax({url:t.data("href"),dataType:"html",data:t.data("params")}).done(function(e){n.html(e),n.find(".hidden-xs").addClass("hidden-xs-on-modal"),n.off("shown.bs.modal"),n.off("hidden.bs.modal"),n.on("shown.bs.modal",function(){modal_dom=$(document).find(".modal-open"),modal_dom[0]&&($(".modal-backdrop").css("z-index",1020),n.css("z-index",1035)),n.scrollTop(0),t.trigger("load_modal",[n])}).on("hidden.bs.modal",function(){n.empty()}).modal("show")})},search_by_scenario:function(e,t){App.front_hot_recommends.disable_action_panel(t);var n={order_key:$("#order_key").val(),order_type:$("#order_type").val(),order_flg:$("#order_flg").val(),keyword:$("#keyword").val(),search_data_type:$("#search_data_type").val()};if(1==$("#hot_approach_pagination").find(".active").length)var i=$("#hot_approach_pagination").find(".active")[0].firstElementChild.text;else i=1;inactivatedTabClick(t),1==t?$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{hot_scenario:e,tab:t,lead_order_params:n,lead_per_page:leadPerPageDefault,page:i},success:function(){activatedTabClick(t),App.front_hot_recommends.enable_action_panel(t)},error:function(){activatedTabClick(t),App.front_hot_recommends.enable_action_panel(t)}}):($.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{hot_scenario:e,tab:t,lead_order_params:n,lead_per_page:leadPerPageDefault,page:i,loading_type:LOADING_TYPE_LEAD}}).always(function(){activatedTabClick(t),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_LEAD)}),$.ajax({url:"/front/xhr/hot_recommends/update_chart",data:{hot_scenario:e,tab:t,lead_order_params:n,lead_per_page:leadPerPageDefault,page:i,loading_type:LOADING_TYPE_CHART}}).always(function(){activatedTabClick(t),App.front_hot_recommends.enable_action_panel(LOADING_TYPE_CHART)}))},new_hot_approach_scenario:function(n){n.off("ajax:error"),n.on("ajax:error",function(e,t){$(".ha-loading").hide(),n.find("#modal_message").html(App.concerns.buildNoticeHtml(t.responseJSON.messages,"danger"))}),n.find("#submitButton").on("click",function(){$(".ha-loading").show(),n.off("ajax:success"),n.one("ajax:success",function(e,t){if($(".ha-loading").hide(),$("#modalCloseButton").click(),$("#js_search_success_message").html($("<div></div>",{"class":"alert alert-success alert-dismissible",role:"alert"}).html($("<button></button>",{type:"button","class":"close","data-dismiss":"alert","aria-label":"Close"}).html($("<span></span>",{"aria-hidden":"true"}).text("\xd7")).add($("<ul></ul>",{"class":"list-unstyled"}).html($("<li></li>").text(I18n.t("js.hot_approach_scenario.create.saved")))))),t.hot_approach_scenario.scenario_list_company){$("#hot_approach_scenario_selection").empty(),$.each(t.hot_approach_scenario.scenario_list_company,function(e,t){$("#hot_approach_scenario_selection").append($("<option></option>").val(t.id).text(t.name))});var n=$("#hot_approach_scenario_name").val();App.front_hot_recommends.search_by_scenario(n,1)}if(t.hot_approach_scenario.scenario_list_lead){$("#hot_approach_scenario_selection_lead").empty(),$.each(t.hot_approach_scenario.scenario_list_lead,function(e,t){$("#hot_approach_scenario_selection_lead").append($("<option></option>").val(t.id).text(t.name))});n=$("#hot_approach_scenario_name").val();App.front_hot_recommends.search_by_scenario(n,2)}App.front_hot_recommends.getHotScenario()})})},add_chart_company_infor:function(e,t){for(var n=0;$("#chart-left-bottom-".concat(t+n))[0];)n++;var i='<div class="col-xs-6"><div class="checkbox" style="justify-content: center; display: flex;">'+'<select name="chart_recommend_type_'.concat(n,'" id="open_status" class="form-control chart-select chart-select-').concat(t,'" style="width: 200px; height: 32px; padding-top: 3px; text-align: left;">');i+='<option value="">-</option>',CLASSIFICATION_MASTER.forEach(function(e){i+='<option value="'+e[0]+'">'+e[1]+"</option>"}),i+='</select><span class="txt-category-chart">\u3067\u5206\u985e</span></div><div id="chart-item1" class="bar-chart ha-loading-part ha-loading-part-chart">'+'<div class="bar-chart bar-chart-'.concat(t,'" id="chart-left-bottom-').concat(t+n,'">')+"</div></div>",1==e?$(".group-chart-container-1").append(i):$(".group-chart-container-2").append(i),setOnclickToChartSelect(),initHaLoadingPart(),App.front_hot_recommends.draw_high_chart("chart-left-bottom-".concat(t+n))},"var":conditionIndexTab1=0,"var":conditionIndexTab2=0,add_filter_condition:function(e,t){if("tab1"==t){var n=(i=document.getElementById("hot_approach_scenario_selection")).options[i.selectedIndex].text;e&&(conditionIndexTab1=0),conditionIndexTab1++,conditionIndex=conditionIndexTab1}else{var i;n=(i=document.getElementById("hot_approach_scenario_selection_lead")).options[i.selectedIndex].text;e&&(conditionIndexTab2=0),conditionIndexTab2++,conditionIndex=conditionIndexTab2}var a=$("<div>").attr({"class":"filter-condition",id:"filter_condition_"+t+conditionIndex}),s=$("<select>").attr({"class":"form-control input-sm mr10 registration_condition_selection",style:"display:inline-block; width: 400px",id:"registration_condition_selection_"+t+conditionIndex,condition_index:t+conditionIndex});if(s.append('<option value="0">-</option>'),"tab1"==t){if("\u58f2\u4e0a\u304c\u5897\u52a0\u3057\u305f\u4e0a\u5834\u4f01\u696d"==n)var o=[5,6];else o=[5,6,8];REGISTRATION_CONDITIONS.forEach(function(e){if(o.includes(e[0])){var t=$("<option>").attr({value:e[0]});t.text(e[1]),s.append(t)}})}else REGISTRATION_CONDITIONS.forEach(function(e){if([8].includes(e[0])&&"\u58f2\u4e0a\u304c\u5897\u52a0\u3057\u305f\u4e0a\u5834\u4f01\u696d"==n)return!0;var t=$("<option>").attr({value:e[0]});t.text(e[1]),s.append(t)});a.append(s),a.append('<div id = "condition_checkbox_group_'.concat(t).concat(conditionIndex,'" class = "registration_condition_checkbox"></div>')),a.append('<div id = "condition_selection_group_'.concat(t).concat(conditionIndex,'" class = "registration_condition_selection_select_box"></div>')),e||$("#append-filter-condition-".concat(t)).append('<div style="text-align: center; margin: 5px;"><span style="font-size: 18px;">AND</span></div>'),$("#append-filter-condition-".concat(t)).append(a),10==conditionIndexTab1&&$("#add_filter_condition_tab1").prop("disabled",!0),10==conditionIndexTab2&&$("#add_filter_condition_tab2").prop("disabled",!0)},draw_high_chart:function(e,t,n){blank_data_chart=!1,t==undefined&&n==undefined&&(blank_data_chart=!0,t=[[["\u5efa\u8a2d",571158]]],n=Object.assign({},t)),color=e.includes("tab2")?"#AC292C":"#004DA0",chart=Highcharts.chart(e,{chart:{type:"column",height:400,backgroundColor:null,marginBottom:200},tooltip:{enabled:!1},credits:{enabled:!1},title:{text:null},xAxis:{type:"category",labels:{rotation:0,useHTML:!0,style:{fontSize:"10px",fontFamily:"Hiragino Sans",align:"right",color:"#444444",lineHeight:"14px",align:"center",width:"50px",whiteSpace:"normal",textOverflow:"none"},formatter:function(){return regex=/([0-9\uFF10-\uFF19]+)/g,this.value.toString().replace(regex,"<span>$1</span>")}},lineColor:"#D8D8D8",tickWidth:0,tickLength:0},yAxis:{min:0,minRange:6,tickAmount:6,gridLineWidth:3,title:{text:null},labels:{style:{fontSize:"10px",fontFamily:"Hiragino Sans",align:"right",color:"#000000",lineHeight:"52px",align:"center"},formatter:function(){return Highcharts.numberFormat(this.value,0)}}},legend:{enabled:!1},credits:{enabled:!1},series:[{data:t,color:color,states:{hover:{enabled:!1}},apiData:n,title:e}],tooltip:{useHTML:!0,style:{padding:2},formatter:function(){var e=this.point;return e.isCalculatedValue&&(e=this.series.points[e.index-1]),xName=e.name||e.x,"<span style='font-size: 12px; color:'"+e.series.color+">\u25cf<b> "+xName+": "+e.y+" </b><br>\u30af\u30ea\u30c3\u30af\u3059\u308b\u3053\u3068\u3067\u6761\u4ef6\u306b\u8ffd\u52a0\u3001\u524a\u9664\u3067\u304d\u307e\u3059\u3002</br></span>"}},plotOptions:{series:{dataLabels:{enabled:!0,style:{fontSize:7,opacity:0}},cursor:"pointer",borderWidth:0,point:{events:{click:function(){var t,e=$(this.series.chart.renderTo).hasClass("bar-chart-tab2")?"2":"1";t=this.name!=undefined&&""!=this.name?this.name:this.x;var n=this.series.options.apiData.find(function(e){return e.value?e.value==t:e.id==t});xId=new String(n.id||n.value).toString();var i=this.series.options.title.substring(11);if("1"==e){var a=data.find(function(e){return e.chart_name==i});a||(a={chart_name:i,ids:[]},data.push(a)),-1<(s=a.ids.indexOf(xId))?("industry_name"==a.chart_name&&a.ids.length>industryIdsTab1.length?chartDataLength=industryIdsTab1.length:chartDataLength=a.ids.length,chartDataLength==this.series.options.apiData.length?a.ids=[xId]:a.ids.splice(s,1)):a.ids.push(xId)}else{var s,o=corporateNumbersData.find(function(e){return e.chart_name==i});o||(o={chart_name:i,ids:[]},corporateNumbersData.push(o)),-1<(s=o.ids.indexOf(xId))?("industry_name"==o.chart_name&&o.ids.length>industryIdsTab2.length?chartCorporateNumbersDataLength=industryIdsTab2.length:chartCorporateNumbersDataLength=o.ids.length,chartCorporateNumbersDataLength==this.series.options.apiData.length?o.ids=[xId]:o.ids.splice(s,1)):o.ids.push(xId)}items=[],$("[data-chart]").each(function(e,t){items.push($(t).data("chart"))});$("#checkbox_tel_exists").is(":checked"),$("#checkbox_form_url_exists").is(":checked"),$("#checkbox_mail_exists").is(":checked");"1"==e?barchartData=data:barchartCorporateNumbersData=corporateNumbersData,updateChart(e)}}}}}}),blank_data_chart&&($("#".concat(e)).find(".highcharts-xaxis-labels").addClass("visibility-hidden"),$("#".concat(e)).find(".highcharts-yaxis-labels").addClass("visibility-hidden"))},submit_form_search_hot_recommends:function(){App.front_hot_recommends.disable_action_panel(2),$("#form_search_hot_approaches").off("ajax:error"),$("#form_search_hot_approaches").on("ajax:error",function(){App.front_hot_recommends.enable_action_panel()}),firstTimeSearch()},update_company_list:function(){$("#hot-approach-header-page").html("<%= escape_javascript(render '/front/xhr/hot_approaches/hot_approach_header_page') %>"),$("#main-page").html("<%= escape_javascript(render partial: '/front/xhr/hot_approaches/hot_approach_main_page', collection: @clients, as: :client) %>")},disable_select_chart_option:function(){$(".tab-panel-company-information").find("select[name^='chart_recommend_type']").on("change",function(){App.front_hot_recommends.get_value_select_chart()}),App.front_hot_recommends.get_value_select_chart()},get_value_select_chart:function(){var e=$(".chart-select-tab1"),n=[];e.find(":selected").filter(function(e,t){return $(t).attr("value")}).each(function(e,t){n.push($(t).attr("value"))}),e.find("option").each(function(e,t){if(-1<n.indexOf($(t).attr("value"))){if($(t).is(":checked"))return;$(this).attr("disabled",!0)}else $(this).attr("disabled",!1)});var t=$(".chart-select-tab2"),i=[];t.find(":selected").filter(function(e,t){return $(t).attr("value")}).each(function(e,t){i.push($(t).attr("value"))}),t.find("option").each(function(e,t){if(-1<i.indexOf($(t).attr("value"))){if($(t).is(":checked"))return;$(this).attr("disabled",!0)}else $(this).attr("disabled",!1)})},disable_action_panel:function(e){e=e||null,$(".scenario_selection").attr("disabled",!0),$(".submit-on-change").attr("disabled",!0),$(".chart-select").attr("disabled",!0),$(".add-button").attr("disabled",!0),null!=e&&"1"!=e||$("#client_count").text(I18n.t("js.hot_approach_scenario.now_searching")),null!=e&&"2"!=e||$("#lead_count").text(I18n.t("js.hot_approach_scenario.now_searching")),$(".ha-loading-part .ha-loading-part__loading").show(),$(".btn-modal-custom").addClass("disabled")},enable_action_panel:function(e){$(".scenario_selection").attr("disabled",!1),$(".submit-on-change").attr("disabled",!1),$(".add-button").attr("disabled",!1),$(".chart-select-tab1").length>=CLASSIFICATION_MASTER.length&&$("#add_chart_company_infor").attr("disabled",!0),$(".chart-select-tab2").length>=CLASSIFICATION_MASTER.length&&$("#add_chart_company_infor_2").attr("disabled",!0),$(".btn-modal-custom").removeClass("disabled"),e==LOADING_TYPE_LEAD?$(".ha-loading-part").not(".ha-loading-part-chart").children(".ha-loading-part__loading").hide():e==LOADING_TYPE_CHART?($(".chart-select").attr("disabled",!1),$(".ha-loading-part-chart .ha-loading-part__loading").hide()):e==undefined&&($(".chart-select").attr("disabled",!1),$(".ha-loading-part .ha-loading-part__loading").hide())},load_split_index:function(e){rowIndex++;var t=rows[rowIndex],n=$("#search_segment_ids").val();xhrLeadIds=$(t).data("xhr-lead-ids");new Clipboard(".clipboard-btn");$.ajax({url:"/xhr/leads/load_split_index",type:"GET",dataType:"html",data:{ids:xhrLeadIds,pagination_id:null,segment_id:n,is_hot_recommend:!0}}).done(function(e){$(t).replaceWith(e),$(document).trigger("floatTableUpdate"),$(".js_submit_send_mail").off("click"),$(".js_submit_send_mail").on("click",function(){$(".js_visibility_email.open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));return $("#select_lead_id").val($(this).data("lead-id")),e.submit(),!1})}).fail(function(){$(t).html("")}).always(function(){rowIndex<rows.length-2?App.front_hot_recommends.load_split_index(e):e.resolve()})},getHotScenario:function(){var e=[],t=[];$("#scenario-type-checkbox-company").is(":checked")&&e.push("company"),$("#scenario-type-checkbox-lead").is(":checked")&&e.push("lead"),0===e.length?e.push(""):$(".scenario-category-checkbox").each(function(){$(this).is(":checked")&&t.push($(this).val())}),0!==t.length&&0!==e.length||(t.push(""),e.push(""));var n={scenario_types:e,scenario_categories:t,scenario_search:$($(".ah_placeholder#search")[0]).val()};$.ajax({url:"/front/xhr/hot_scenarios",type:"GET",contentType:"text/javascript",data:n,success:function(){},error:function(e,t,n){console.log("Error: "+n)}})},change_order:function(){$(".order_head").on("click",function(){$(this).data("order-summary")||($("#order_key").val($(this).data("order-key")),$("#order_type").val($(this).data("order-type")),$("#order_flg").val(1),$('input[name="order_key"]').val($(this).data("order-key")),$('input[name="order_type"]').val($(this).data("order-type")),$('input[name="order_flg"]').val(1),$("#keyword").val($("#result_search_selected_id").val()),$("#search_data_type").val("sort_data_by_key"),updateChart(2,"lead"))})}},jQuery(document).ready(function(){initHaLoadingPart(),setOnclickToChartSelect(),App.concerns.clipboard_copy("#invisible_number")}),$(document).on("change",
"#hot_approach_scenario_selection",function(){$("#append-filter-condition-tab1").children().remove();var e=this.options[this.selectedIndex].text;App.front_hot_recommends.add_filter_condition(!0,"tab1"),App.front_hot_recommends.search_by_scenario(e,1)}),$(document).on("change","#hot_approach_scenario_selection_lead",function(){$("#append-filter-condition-tab2").children().remove();var e=this.options[this.selectedIndex].text;App.front_hot_recommends.add_filter_condition(!0,"tab2"),App.front_hot_recommends.search_by_scenario(e,2)}),$(document).on("click","a[data-hp-role='simple_hot_scenario']",function(e){e.preventDefault(),$(this).one("load_modal",function(){var e=$("#new_hot_approach_scenario");$("#form_submit_default_scenario").submit(),App.front_hot_recommends.new_hot_approach_scenario(e);var t=$('#new_hot_approach_scenario .hp-page .col-xs-12 [name="tab"]').val();"1"==t?(barchartData.forEach(function(e,t){$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" class="scenario-data" name="data['+t+'][chart_name]" value="'+e.chart_name+'">'),e.ids.forEach(function(e){$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" class="scenario-data" name="data['+t+'][ids][]" value="'+e+'">')})}),tel_exists=$("#checkbox_tel_exists").is(":checked"),form_url_exists=$("#checkbox_form_url_exists").is(":checked"),mail_exists=$("#checkbox_mail_exists").is(":checked"),$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" name="corporate_num" value="'+$("#client_count_num").text()+'">')):(corporateNumbersData.forEach(function(e,t){$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" class="scenario-data" name="data['+t+'][chart_name]" value="'+e.chart_name+'">'),e.ids.forEach(function(e){$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" class="scenario-data" name="data['+t+'][ids][]" value="'+e+'">')})}),tel_exists=$("#checkbox_tel_exists_tab2").is(":checked"),form_url_exists=!1,mail_exists=$("#checkbox_mail_exists_tab2").is(":checked")),$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" name="tel_exists" value="'+(tel_exists?1:0)+'">'),$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" name="form_url_exists" value="'+(form_url_exists?1:0)+'">'),$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" name="mail_exists" value="'+(mail_exists?1:0)+'">'),$(".chart-select-tab"+t).each(function(e,t){$("#new_hot_approach_scenario .hp-page .col-xs-12").append('<input type="hidden" name="items[]" value="'+$(t).data("chart")+'">')})}),App.front_business_cards.modal_open($(this),$("#simplyFormModalRecommend"))}),$(document).on("click","#add_chart_company_infor",function(){$(".chart-select-tab1").length>=CLASSIFICATION_MASTER.length||(App.front_hot_recommends.add_chart_company_infor(1,"tab1"),$(".chart-select-tab1").length<CLASSIFICATION_MASTER.length&&App.front_hot_recommends.add_chart_company_infor(1,"tab1"),App.front_hot_recommends.disable_select_chart_option(),$(".chart-select-tab1").length>=CLASSIFICATION_MASTER.length&&$("#add_chart_company_infor").attr("disabled",!0))}),$(document).on("click","#add_chart_company_infor_2",function(){$(".chart-select-tab2").length>=CLASSIFICATION_MASTER.length||(App.front_hot_recommends.add_chart_company_infor(2,"tab2"),$(".chart-select-tab2").length<CLASSIFICATION_MASTER.length&&App.front_hot_recommends.add_chart_company_infor(2,"tab2"),App.front_hot_recommends.disable_select_chart_option(),$(".chart-select-tab2").length>=CLASSIFICATION_MASTER.length&&$("#add_chart_company_infor_2").attr("disabled",!0))}),$(document).on("click","#add_filter_condition_tab1",function(){App.front_hot_recommends.add_filter_condition(!1,"tab1")}),$(document).on("click","#add_filter_condition_tab2",function(){App.front_hot_recommends.add_filter_condition(!1,"tab2")}),$(document).on("change","#piechart_checkbox_tab1 .submit-on-change",function(){updateChart(1)}),$(document).on("change","#piechart_checkbox_tab2 .submit-on-change",function(){updateChart(2)}),$(document).on("change","#append-filter-condition-tab1 .company_condition",function(){updateChart(1)}),$(document).on("change","#append-filter-condition-tab2 .company_condition",function(){updateChart(2)}),$(document).on("change","#append-filter-condition-tab1 .registration-condition-checkbox",function(){updateChart(1)}),$(document).on("change","#append-filter-condition-tab2 .registration-condition-checkbox",function(){updateChart(2)}),$(document).on("click",".js-create-list",function(){$(".ha-loading").show(),front_xhr_hot_approaches_setup_wizards_path=$("#front_xhr_hot_approaches_setup_wizards_path").val(),$("#form_search_hot_approaches").attr("action",front_xhr_hot_approaches_setup_wizards_path+"?hot_recommend="+!0),$("#form_search_hot_approaches").submit()}),$(document).on("click",".ha-wizard-step-1",function(){$(".line.step_settings").removeClass("passed"),$(".li-num.step_settings").removeClass("passed"),$(".step_settings").removeClass("passed"),$(".line.step_preview").removeClass("passed"),$(".li-num.step_preview").removeClass("passed"),$(".step_preview").removeClass("passed"),$(".step_number").addClass("passed")}),$(document).on("click","a.step_settings",function(){$(".ha-submit-step-number:visible").click(),$(".ha-back-step-preview:visible").click()}),$(document).on("click","a.step_preview",function(){$(".ha-submit-step-number:visible").click(),$("#preview_sale_appraoch:visible").click()}),$(document).on("hide.bs.modal","#ha-wizard-modal-dialog",function(){front_xhr_hot_approaches_search_path="/front/xhr/hot_recommends/search",$("#form_search_hot_approaches").attr("action",front_xhr_hot_approaches_search_path),App.front_hot_approaches.reset_wizard_order()}),$(document).on("click",".move-step",function(){var e="."+$(this).data("hide"),t="."+$(this).data("show"),n=new Number($("#ha_wizard_limit").val()),i=new Number($("#max_limit_wizard").val());"limit"==$("#ha_type_limit:checked").val()?n<=0?App.front_hot_approaches.load_error_step_number($("#max_limit_wizard").data("limit_gt_0")):i<n?App.front_hot_approaches.load_error_step_number($("#max_limit_wizard").data("limit_lt_search")):($(e).removeClass("passed"),$(t).addClass("passed"),$(this).hasClass("next")&&($(".line"+e).addClass("passed"),$(".li-num"+e).addClass("passed"))):($(e).removeClass("passed"),$(t).addClass("passed"),$(this).hasClass("next")&&($(".line"+e).addClass("passed"),$(".li-num"+e).addClass("passed")))}),$(document).on("change",".registration_condition_selection",function(){updateChartIfChecked($(this)),changeRegistrationConditionSelection(this);var e=$(this).attr("id"),t=$("#js-"+e);t&&t.remove(),6==$(this).val()&&$(this).after('<span id= "js-'+e+'" style="font-size: 14px; color: #707070; margin-left: 18px">'+I18n.t("js.hot_approach_scenario.registration_condition_memo")+"</span>")}),$(document).on("change",".scenario-type-checkbox",function(){App.front_hot_recommends.getHotScenario()}),$(document).on("change",".scenario-category-checkbox",function(){App.front_hot_recommends.getHotScenario()}),$(document).on("keyup","#search.ah_placeholder",function(e){if(13==e.keyCode){var t=$(this).closest("form");if(t.data("processing"))return;t.data("processing",!0),App.front_hot_recommends.getHotScenario()}}),$(document).on("click","button.js_customer_sheets_show",function(){return CustomerSheets.modal_open($(this).data("href"),$(this).data("client-id")),!1}),$(document).on("change","#change_display_number",function(){updateChart(2,"lead")}),$(document).on("click",".ui-dialog-titlebar-close",function(){var e=[];$('[name="visible_fields[]"][checked]').each(function(){e.push($(this).val())})});var openUserInformationDialog=function(){if("block"===$(".user-information-show").css("display"))return $(".user-information-show").hide(),!1;var e=$(this).data("user-id"),t=$(this).offset().top,n=$(this).offset().left+$(this).width()/2;console.log("openUserInformationDialog userId: "),$("#position_top").val(t),$("#position_left").val(n),$("#user-information-form").attr("action","/xhr/user_communications/user_information_show/"+e),$("#user-information-form").submit()};$(document).on("click",".user_information",openUserInformationDialog),$(window).on("click",function(e){0<!$(e.target).closest(".user-information-show").length&&"block"===$(".user-information-show").css("display")&&$(".user-information-show").hide()}),$(document).on("click","a.js_customer_sheets_show",function(){$(".user-information-show").is(":visible")&&$(".user-information-show").hide()}),App.front_imports={index:function(){this.file_submit(),this.common(),$("#search_import").on("change",function(){$(':input[type="submit"]').prop("disabled",!1)})},import_user:function(){this.file_submit(),this.common()},import_business_card:function(){this.file_submit(),this.common()},import_lead:function(){this.file_submit(),this.common()},import_task:function(){this.file_submit(),this.common()},import_daily_report:function(){this.file_submit(),this.common()},import_deal:function(){this.file_submit(),this.common()},import_deal_detail:function(){this.file_submit(),this.common()},import_smartphone_device:function(){this.file_submit(),this.common()},file_submit:function(){$(".file_submit").on("click",function(){if(!$("#search_import").val().length){var e=String()+"<div class='alert alert-danger alert-error'><a class='close' data-dismiss='alert'>\xd7</a><ul><li>"+I18n.t("js.common.select_import_target")+"</li></ul></div>";return $("#js_error_message").prepend(e),$(this).prop("disabled",!0),!1}$(this).parents("form:first").attr("action",$("#search_import").val())})},common:function(){$("#search_import").select2({minimumResultsForSearch:20,width:"40%",placeholder:I18n.t("js.common.select_import_target")})}},App.front_individual_authentications={"new":function(){this.set_user_id(),App.concerns.select_search("smartphone_device_user_id"),this.open_modal_select_user(),this.disable_button_after_click()},create:function(){this.set_user_id(),App.concerns.select_search("smartphone_device_user_id"),this.open_modal_select_user(),this.disable_button_after_click()},edit:function(){this.set_user_id(),App.concerns.select_search("smartphone_device_user_id"),this.open_modal_select_user(),this.disable_button_after_click()},update:function(){this.set_user_id(),App.concerns.select_search("smartphone_device_user_id"),this.open_modal_select_user(),this.disable_button_after_click()},open_modal_select_user:function(){$("#open-associated-user").on("click",function(){App.front_users.get_modal_to_search_users("#smartphone_device_user_id",$(this).data("search-type"),!0,!1)})},set_user_id:function(){var t=this;$("#smartphone_device").data("userId",$("#smartphone_device_user_id").val()),$("#smartphone_device_user_id").on("change",function(){$("#smartphone_device").data("userId",$(this).val());var e=[];e.push($(this).val()),$.ajax({url:"/xhr/users/existence/",type:"POST",dataType:"json",data:{ids:e},context:$(this)}).done(function(e){t.set_information_user(e.user_info)})})},set_information_user:function(e){0<Object.keys(e).length?($("#terminal-user-id").html(e.code),$("#terminal-department").html(e.department_text),$("#terminal-email-address").html(e.email),$("#terminal-phone").html(e.tel)):($("#terminal-user-id").html(""),$("#terminal-department").html(""),$("#terminal-email-address").html(""),$("#terminal-phone").html(""))},disable_button_after_click:function(){var e=$(".disable-after-click[type=submit]"),t=$(".disable-after-click").not(".disable-after-click[type=submit]");e.on("click",function(){t.attr("disabled",!0)}),t.on("click",function(){$(".disable-after-click").attr("disabled",!0)})}},App.front_inquiries={index:function(){App.concerns.change_display_number("form_checked_inquiries"),App.concerns.change_order("form_checked_inquiries"),App.concerns.set_form_action_to_submit("#form_checked_inquiries","#js_destroys_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_inquiries","#js_get_modal_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_inquiries","#js_task_exclusion_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_inquiries","#js_task_status_unset_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_inquiries",".checked_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_inquiries","#js_import_lead_submit",!0,!0),["#js_get_inside_sales_modal_submit","#js_get_campaign_modal_submit","#js_get_seminar_modal_submit"].forEach(function(e){App.front_inquiries.reject_blank_submit(e),App.concerns.set_form_action_to_submit("#form_checked_inquiries",e,!0)}),$("#search-associated-resources-modal,#modal_block_for_add_inside_sales").on("hidden.bs.modal",function(){var e=$("#order_url").val(),t=$("#form_checked_inquiries");t.attr("action",e),t.removeAttr("data-remote"),t.removeData("remote"),$(".order_head").off("click"),$("#change_display_number").off("change"),$("#change_display_number_on_modal").off("change"),App.concerns.change_display_number("form_checked_inquiries"),App.concerns.change_order("form_checked_inquiries")}),App.concerns.all_checked_items(),App.visible_fields.setup_list_visible_setting(["task_status"]),App.concerns.clipboard_copy("#invisible_number");new Clipboard(".clipboard-btn");$(".js-slide-basic-infomation").on("click",function(){$("#slide-target").slideToggle(),$("#slide-target-workflow").slideToggle()}),App.next_steps.set_workflow_index_tooltip(),App.next_steps.set_work_flow_load_more("#work_flow_load_more_link"),$("#csv_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(0);var e="#form_checked_inquiries",t=$(e).attr("action");return App.concerns.set_export_ids(e,"checked[inquiry_ids][]"),App.concerns.set_page_parameter(e),$(e).attr("action",$(this).data("action")+".csv"),$(e).submit(),$(e).attr("action",t),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){var e,t;return $("#csv_all_dl_flg").val(1),t=(e=$("#form_checked_inquiries")).attr("action"),e.attr("action",$(this).data("action")+".csv"),e.submit(),e.attr("action",t),!1}),$(".stepable-record-field-modal-link").on("click",function(){$(".stepable_record_field_modal").find(".user_information").attr("stepable-record-field-page-scroll-top",$(document).scrollTop())})},show:function(){App.concerns.set_form_action_to_submit("#form_inquiry","#js_get_modal_submit",!0),App.concerns.set_form_action_to_submit("#form_inquiry","#js_task_exclusion_submit",!0),App.concerns.set_form_action_to_submit("#form_inquiry","#js_task_status_unset_submit",!0),App.concerns.set_form_action_to_submit("#form_inquiry",".checked_submit",!0)},new_lead:function(){App.concerns.search_zip_code(),App.concerns.add_class_for_table_bottom_text(),this.submit_new()},create_leads:function(){App.concerns.search_zip_code(),this.submit_new()},reject_blank_submit:function(e){$(e).on("click",function(){if($(document).scrollTop(0),!$("input[name='checked[inquiry_ids][]']:checked").length)return App.concerns.display_notice_message([I18n.t("js.common.please_select")],!0,!0),!1})},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$(this).parents("form").submit()})}},window.inside_sales={xhr:{activity_summary:null,task_summary:null,deal_summary:null,search_inside_sales_list:null,search_activity_list:null,correspondence_history:null,form:{form_basic_information:null,setting_activity_history:null,form_lead_information:null,show_lead_information:null,edit_lead_information:null},modal:{activity_summary_visible_fields:null,task_summary_visible_fields:null,setting_activity_histories:null,target_lead_filter:null},pagination:{correspondence_history:null},files:{upload_talk_scripts:null}}},App.front_inside_sales={INSIDE_SALES_OPEN_STATUS_SELF:3,INSIDE_SALES_OPEN_STATUS_SELF_AND_DEPARTMENT:5,CONTAINER_NAME:"additional_modal_container",index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#search_clear_inside_sales"),App.concerns.disable_duplicate_request_search_form("#form_search_inside_sales",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("inside_sales"),App.concerns.change_display_number("form_search_inside_sales"),App.concerns.change_search_type(),this.get_modal_to_search_save(),App.concerns.get_modal_to_search_call("#form_search_inside_sales"),App.searches.callForSearchCondition.init(),App.concerns.fetch_remote_list("#form_search_inside_sales","#business_activity_lists_area",window.inside_sales.xhr.search_inside_sales_list,!0),this.monitor_visible_fields("#frm_visible_fields","#form_search_inside_sales"),App.front_segments.set_segment_select2("#search_segment_ids"),this.setup_activity_type(),$(document).on("change","#search_activity_type, #search_private_flg, #search_private_correspondence_flg, #search_ing_flg",function(){App.concerns.disabled_btn(".js-disable-btn"),$("#form_search_inside_sales").submit()}),$("#search_activity_type_ids").select2(),App.concerns.select_search_disable_user("search_owner_user_ids"),App.concerns.select_search_disable_user("search_user_ids"),$(".open_search_user_ids").on("click",function(e){e.preventDefault(),App.front_users.get_modal_to_search_users($(this).data("css-selector"),$(this).data("search-type"),!0)}),$(".search-form-clear").on("click",function(e){e.preventDefault(),$(this).prop("disabled",!0),window.location="/inside_sales/?clear_flg=true"}),App.front_segments.set_segment_select2("#business_activity_segment_id"),$("#csv_dl_submit").on("click",function(){var e="#form_search_inside_sales";App.concerns.set_export_ids(e,"checked[business_activity_ids][]"),App.concerns.set_page_parameter(e);var t=$(e),n=t.attr("action");t.attr("action",$(this).data("action")),t.removeAttr("data-remote"),t.removeData("remote"),t.removeAttr("data-loading"),t.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(t),t.submit(),t.attr("action",n),t.attr("data-remote","true"),t.attr("data-loading","true")}),$("#csv_all_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(1);var e=$("#form_search_inside_sales"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),e.removeAttr("data-loading"),e.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(e),e.submit(),e.attr("action",t),e.attr("data-remote","true"),e.attr("data-loading","true")}),$(".js-open-bulk-update").on("click",function(e){e.preventDefault(),0<$("#form_checked_inside_sales").find('[name="checked[business_activity_ids][]"]:checked').length?$("#ba_bulk_update_modal").modal("show"):($("#inside_sales_message_area").html($('<div class="row">\n  <div class="col-xs-12">\n    <div class="alert alert-danger alert-error alert-dismissible" role="alert">\n      <button type="button" class="close" data-dismiss="alert" aria-label="Close">\n        <span aria-hidden="true">\xd7</span>\n      </button>\n      <ul>\n        <li style="word-wrap: break-word;">'+I18n.t("js.common.please_select")+"</li>\n      </ul>\n    </div>\n  </div>\n</div>")),e.stopImmediatePropagation())}),App.concerns.datepicker(".search_datepicker"),$("#bulk_select_activity_types").select2(),App.concerns.set_form_action_to_submit("#form_checked_inside_sales",".js-bulk-update",!0),$("#ba_bulk_update_modal").off("hidden.bs.modal").on("hidden.bs.modal",function(){$(this).find("#bulk_error_message").empty(),$(this).find("input, textarea").not(":button, :submit, :reset, [type='hidden'], .select2-input, [type='radio'], [type='checkbox']").val(""),$(this).find("[type='radio'], [type='checkbox']").prop("checked",!1),$(this).find("select").prop("selected",!1),$(this).find("input.select2-offscreen, select.select2-offscreen").select2("val",""),$("#ba_bulk-update_submit_btn").prop("disabled",!0)}),$(document).on("click",".all-check,.summary-check-items",function(){var e=$(".summary-check-items:checked"),t=e.length!=e.not(".not_allowed").length;$(".btn-activity-by-department-role").prop({disabled:t});var n=$(".data-original-title-by-activity"),i=n.attr(t?"data-disabled-title":"data-enabled-title");n.attr("data-original-title",i)}),$(document).on("change input","#bulk_update_modal_activity_name,#bulk_update_modal_begin,#bulk_update_modal_end,#bulk_select_activity_types",function(){var e=$("#bulk_update_modal_activity_name").val(),t=$("#bulk_update_modal_begin").val(),n=$("#bulk_update_modal_end").val(),i=$("#bulk_select_activity_types").val(),a=$('input[name="business_activity[status]"]:checked').val();0==e.trim().length&&0==t&&0==n&&null==i&&a==undefined?$("#ba_bulk-update_submit_btn").prop("disabled",!0):$("#ba_bulk-update_submit_btn").prop("disabled",!1)}),$("#business_activity_status_1,#business_activity_status_2").on("click",function(){$('input[name="business_activity[status]"]:checked').val()==undefined?$("#ba_bulk-update_submit_btn").prop("disabled",!0):$("#ba_bulk-update_submit_btn").prop("disabled",!1)}),$("#ba_bulk-update_submit_btn").prop("disabled",!0),App.concerns.set_form_action_to_submit("#form_checked_inside_sales",".js-bulk-destroy",!0),this.table_check_cnt(".summary-check-items.summary-checkbox"),App.tooltip.display_tooltip();var e="inside_sales";App.front_recommend.recommendScenarios(e)},"new":function(){this.setup_form(),this.setup_talk_script_form(".js-talk-script-input-area",".js-talk-script-upload-btn",".js-talk-script-upload-status"),this.open_inside_departments_modal()},create:function(){this.setup_form(),this.setup_talk_script_form(".js-talk-script-input-area",".js-talk-script-upload-btn",".js-talk-script-upload-status"),this.open_inside_departments_modal()},show:function(){this.change_content_tab(),this.collapse_icon(".js-search-collapse",!0),this.collapse_icon(".js-memo-collapse",!1),App.concerns.fetch_table_list("#inside_sales_activity_summary",window.inside_sales.xhr.activity_summary,!0),this.change_order_summary("inside_sales_activity_summary"),App.concerns.fetch_table_list("#inside_sales_task_summary",window.inside_sales.xhr.task_summary,!0),App.concerns.fetch_remote_list("#form_search_activity_list","#business_activities_lead_lists_area",window.inside_sales.xhr.search_activity_list,!0),App.concerns.disable_buttons_submit_custom(".js-disable-btn","#search_clear_inside_sale"),App.concerns.disable_duplicate_request_search_form("#form_search_activity_list",".js-disable-btn"),$(document).ready(function(){var e=$(".remote_deals_summary");$.each(e,function(e,t){var n=$(t).attr("id");App.concerns.fetch_table_list("#"+n,window.inside_sales.xhr.deal_summary,!0),App.front_inside_sales.change_order_summary(n)})}),App.concerns.ajax_post_once("#form_setting_activity_history",window.inside_sales.xhr.form.setting_activity_history),App.concerns.fetch_and_duplication_abort(".remote-history-btn",window.inside_sales.xhr.correspondence_history),App.concerns.fetch_and_duplication_abort(".js-edit-lead-information-btn",window.inside_sales.xhr.form.edit_lead_information),App.concerns.fetch_and_duplication_abort(".js-show-lead-information-btn",window.inside_sales.xhr.form.show_lead_information),App.concerns.fetch_and_duplication_abort("#form_correspondence_history_relation_lead",window.inside_sales.xhr.form.form_lead_information),App.concerns.fetch_and_duplication_abort(".js-edit-information-btn",window.inside_sales.xhr.form.form_basic_information),App.concerns.fetch_and_duplication_abort(".js-open-activity-fields-modal",window.inside_sales.xhr.modal.activity_summary_visible_fields),App.concerns.fetch_and_duplication_abort(".js-open-task-fields-modal",window.inside_sales.xhr.modal.task_summary_visible_fields),App.concerns.fetch_and_duplication_abort(".js-open-setting-history-modal",window.inside_sales.xhr.modal.setting_activity_histories),App.concerns.fetch_and_duplication_abort(".js-target-lead-filter-btn",window.inside_sales.xhr.modal.target_lead_filter),App.concerns.set_form_action_to_submit("#form_activity_target_leads","#js_submit_activity_target_leads",!0),App.concerns.datepicker(".modal_datepicker"),$(document).on("hidden.bs.modal",'[data-hp-role="activity-target-modal"]',function(){$(".modal_lead_filter").remove()}),$(document).on("hidden.bs.modal","#modalSendMail",function(){$(".modal_lead_filter").remove()}),$(document).on("show.bs.modal",'[data-hp-role="activity-target-modal"]',function(){$("#modalNewAbMail").remove()}),$(document).on("show.bs.modal","#modalSendMail",function(){$("#modalNewAbMail").remove()}),App.concerns.open_mailer(),new Clipboard(".clipboard-btn"),App.concerns.select_search_disable_user("search_user_ids"),App.concerns.select_search_disable_user("search_history_user_ids"),App.concerns.select_search_disable_user("search_latest_user_ids"),$("#search_state_ids").select2(),$("#search_last_activity_content").select2(),$(".open_search_user_ids").on("click",function(e){e.preventDefault(),App.front_users.get_modal_to_search_users($(this).data("css-selector"),$(this).data("search-type"),!0)}),$("#search_leakage_flg, #search_ing_flg, #search_unassign_flg").on("change",function(){App.concerns.disabled_btn(".js-disable-btn"),$("#form_search_activity_list").submit()}),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client2","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids","","",null,!0),App.concerns.set_tooltip_to_select_search_client("search_client_ids");var e=$("#inside_sales_show_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search_disable_user("search_items__"+t+"_item_user_ids")}),$(document).on("click",".js-cancel-information-btn",function(e){window.inside_sales.xhr.files.upload_talk_scripts&&window.inside_sales.xhr.files.upload_talk_scripts.abort(),e.preventDefault(),$(".js-edit-information-btn").show(),$("#information-editable-area").empty(),$("#information-viewable-area").show()}),this.editable_cancel(".js-add-history-btn",".js-cancel-history-btn","#history-additional-area",".blank_history"),this.monitor_visible_fields("#frm_visible_fields","#form_search_activity_list"),this.sortable_list(),this.search_lead_form(),App.concerns.set_associate_entity_to_s2("#lead_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",1),localStorage.setItem("client_onclick","#lead_client_id"),$(document).on("change",".js-bal-check",function(){if($(this).prop("checked")){var e=$(this).data("lead-id");$(this).parent().append($("<input>",{type:"hidden",name:"checked[lead_ids][]",value:e}))}else $(this).parent().find('[type="hidden"]').remove()}),this.table_check_cnt(".summary-check-items.summary-checkbox"),$("#js_submit_checked_mail_business_activities_lead_ids").on("click",function(e){if(0==jQuery.map($('input[name="checked[business_activities_lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1}),$("#js_submit_search_mail_business_activities_lead_ids").on("click",function(e){if(!$("#all_lead_ids").val().trim())return alert(I18n.t("js.common.serch_result_none")),e.stopImmediatePropagation(),!1}),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){if($(".btn-group.open").removeClass("open"),$(".modal-caller").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none"),"js_submit_search_mail"===$(this).attr("id")){var e=$("#form_search_activity_list").attr("action");(t=App.concerns.set_form_action("form_search_activity_list",$(this).data("action"),$(this).data("remote"))).removeAttr("data-loading"),t.removeData("loading"),t.submit(),t.attr("action",e),t.attr("data-loading","true")}else{var t;e=$("#form_checked_business_activities_leads").attr("action");(t=App.concerns.set_form_action("form_checked_business_activities_leads",$(this).data("action"),$(this).data("remote"))).submit(),t.attr("action",e)}return!1}),App.concerns.submit_when_changed_element("form_set_mail_template","js_change_element","convert"),$("#import-btn").on("click",function(){return $("#file_tag").trigger("click"),!1}),$("#import_new").on("click",function(){return $("#file_import_new").trigger("click"),!1}),$("#import_update").on("click",function(){return $("#file_import_update").trigger("click"),!1}),$("#file_tag").on("change",function(){var e=$("#form_checked_business_activities_leads"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(e),e.submit(),e.attr("action",t),e.attr("data-remote","true")}),$("#file_import_new").on("change",function(){var e=$("#form_checked_business_activities_leads"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),e.submit(),e.attr("action",t),e.attr("data-remote","true")}),$("#file_import_update").on("change",function(){var e=$("#form_checked_business_activities_leads"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),e.submit(),e.attr("action",t),e.attr("data-remote","true")}),$("#csv_dl_submit").on("click",function(){var e="#form_search_activity_list";App.concerns.remove_export_ids(),App.concerns.set_export_ids(e,"checked[business_activities_lead_ids][]"),App.concerns.set_page_parameter(e);var t=$(e),n=t.attr("action");t.attr("action",$(this).data("action")),t.removeAttr("data-remote"),t.removeData("remote"),t.removeAttr("data-loading"),t.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(t),t.submit(),t.attr("action",n),t.attr("data-remote","true"),t.attr("data-loading","true")}),$("#csv_all_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(1);var e=$("#form_search_activity_list"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),e.removeAttr("data-loading"),e.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(e),e.submit(),e.attr("action",t),e.attr("data-remote","true"),e.attr("data-loading","true")}),$(".js-open-bulk-update").on("click",function(e){e.preventDefault(),0<$("#form_checked_business_activities_leads").find('[name="checked[business_activities_lead_ids][]"]:checked').length?$("#bal_bulk_update_modal").modal("show"):($("#inside_sales_message_area").html($('<div class="row">\n  <div class="col-xs-12">\n    <div class="alert alert-danger alert-error alert-dismissible" role="alert">\n      <button type="button" class="close" data-dismiss="alert" aria-label="Close">\n        <span aria-hidden="true">\xd7</span>\n      </button>\n      <ul>\n        <li style="word-wrap: break-word;">'+I18n.t("js.common.please_select")+"</li>\n      </ul>\n    </div>\n  </div>\n</div>")),e.stopImmediatePropagation())}),App.concerns.select_search("bulk_update_modal_user_id"),App.concerns.set_form_action_to_submit("#form_checked_business_activities_leads",".js-bulk-update",!0),$("#bal_bulk_update_modal").off("hidden.bs.modal").on("hidden.bs.modal",function(){$(this).find("#bulk_error_message").empty(),$(this).find("input, textarea").not(":button, :submit, :reset, [type='hidden'], .select2-input, [type='radio'], [type='checkbox']").val(""),$(this).find("[type='radio'], [type='checkbox']").prop("checked",!1),$(this).find("select").prop("selected",!1),$(this).find("input.select2-offscreen, select.select2-offscreen").select2("val",""),$("#bal_bulk-update_submit_btn").prop("disabled",!0)}),$("#bulk_target_modal_deadline,#bulk_update_modal_user_id").on("change input",function(){var e=$("#bulk_update_modal_user_id").val(),t=$("#bulk_target_modal_deadline").val();0==e.length&&0==t.length?$("#bal_bulk-update_submit_btn").prop("disabled",!0):$("#bal_bulk-update_submit_btn").prop("disabled",!1)}),$(document).ready(function(){$("#modal_block_for_search_users").on(
"DOMSubtreeModified propertychange",function(){var e=$("#bulk_update_modal_user_id").val(),t=$("#bulk_target_modal_deadline").val();0==e.length&&0==t.length?$("#bal_bulk-update_submit_btn").prop("disabled",!0):$("#bal_bulk-update_submit_btn").prop("disabled",!1)})}),$("#bal_bulk-update_submit_btn").prop("disabled",!0),App.concerns.set_form_action_to_submit("#form_checked_business_activities_leads",".js-bulk-destroy",!0),this.xhr_change_display_template_for_deal(),$(document).on("click",".modal_top_for_inside_sales",function(){$(this).parents(".modal-overflow-scroll").animate({scrollTop:0},100)}),$(document).on("click",".check-pagination-close-link-activity-history-modal",function(e){e.preventDefault(),window.inside_sales.xhr.pagination.correspondence_history&&window.inside_sales.xhr.pagination.correspondence_history.abort(),window.inside_sales.xhr.pagination.correspondence_history=$.ajax({url:$(this).attr("href"),dataType:"json"}).done(function(e){window.inside_sales.xhr.pagination.correspondence_history=$.ajax({type:"GET",url:e.path,dataType:"script"}).fail(function(e,t){"abort"!==t&&console.log("fail",e.status)})}).fail(function(e,t){"abort"!==t&&console.log("fail",e.status)})}),$("#checked-leads-link").on("click",function(){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),!1}),App.concerns.mail_type_select_modal_submit("form_checked_business_activities_leads"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),App.next_steps.set_workflow_index_tooltip(),$(".stepable-record-field-modal-link").on("click",function(){$(".stepable_record_field_modal").find(".user_information").attr("stepable-record-field-page-scroll-top",$(document).scrollTop())}),null!=window.__INITIAL_STATE__.inside_sales.shown_history_path?$.ajax({type:"GET",url:window.__INITIAL_STATE__.inside_sales.shown_history_path,dataType:"script"}):window.__INITIAL_STATE__.inside_sales.shown_target_flg&&$(".js-target-lead-filter-btn").trigger("click")},setup_form:function(){App.concerns.select_search("business_activity_owner_user_id"),App.concerns.datepicker(".search_datepicker"),this.display_switch_roles_select(),$("#business_activity_activity_type_ids").select2()},display_switch_roles_select:function(){var e=this,t=$("#js_open_status"),n=$("#js_open_status_edit");t.val()==e.INSIDE_SALES_OPEN_STATUS_SELF&&($("#js_select_role_ids").show(),$("#js_select_role_ids select").select2({width:"100%"})),t.val()==e.INSIDE_SALES_OPEN_STATUS_SELF_AND_DEPARTMENT&&($("#js_select_department_role_ids").show(),$("#js_select_department_caller").show(),$("#js_select_department_role_ids select").select2({width:"100%"})),t.on("change",function(){t.val()==e.INSIDE_SALES_OPEN_STATUS_SELF?($("#js_user_id").val($("#business_activity_owner_user_id").val()),$("#js_form_set_select_roles").submit()):($("#js_select_role_ids select").select2("val",""),$("#js_select_role_ids").hide())}),t.on("change",function(){t.val()==e.INSIDE_SALES_OPEN_STATUS_SELF_AND_DEPARTMENT?($("#js_select_department_caller").show(),$("#js_select_department_role_ids").show()):($("#js_select_department_role_ids select").select2("val",""),$("#js_select_department_role_ids").hide(),$("#js_select_department_caller").hide())}),App.front_segments.set_segment_select2("#business_activity_segment_id"),App.front_inside_sales.inside_sales_change_discription("#business_activity_segment_id"),n.val()==e.INSIDE_SALES_OPEN_STATUS_SELF&&($("#js_select_role_ids").show(),$("#js_select_role_ids select").select2({width:"100%"})),n.val()==e.INSIDE_SALES_OPEN_STATUS_SELF_AND_DEPARTMENT&&($("#js_select_department_role_ids").show(),$("#js_select_department_caller").show(),$("#js_select_department_role_ids select").select2({width:"100%"})),n.on("change",function(){n.val()==e.INSIDE_SALES_OPEN_STATUS_SELF?0==$("#business_activities_roles_cnt").val()?($("#js_user_id").val($("#business_activity_owner_user_id").val()),$("#js_form_set_select_roles").submit()):($("#js_select_role_ids").show(),$("#js_select_role_ids select").select2({width:"100%"})):$("#js_select_role_ids").hide()}),n.on("change",function(){n.val()==e.INSIDE_SALES_OPEN_STATUS_SELF_AND_DEPARTMENT?($("#js_select_department_caller").show(),$("#js_select_department_role_ids").show()):($("#js_select_department_role_ids").hide(),$("#js_select_department_caller").hide())})},open_inside_departments_modal:function(){App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},change_content_tab:function(){var e=$("#content_tab_1"),t=$("#content_tab_2"),n=$("#content_tab_3");$(document).on("change",".content_tab",function(){e.is(":checked")?($(".content_summary").show(),$(".content_activity_list").hide(),$(".content_workflow").hide(),$(".checkbox-search").hide()):t.is(":checked")?($(".content_summary").hide(),$(".content_activity_list").show(),$(".content_workflow").hide(),$(".checkbox-search").show()):n.is(":checked")&&($(".content_summary").hide(),$(".content_activity_list").hide(),$(".content_workflow").show(),$(".checkbox-search").hide())})},collapse_icon:function(e,t){$(document).on({"shown.bs.collapse":function(){$(this).hasClass("in")&&(t?$(this).prev(".activity-collapse-link").addClass("in"):$(this).parent().find(".activity-collapse-link").addClass("in"))},"hidden.bs.collapse":function(){$(this).hasClass("in")||(t?$(this).prev(".activity-collapse-link").removeClass("in"):$(this).parent().find(".activity-collapse-link").removeClass("in"))}},e)},editable_cancel:function(t,e,n,i){$(document).on("click",e,function(e){e.preventDefault(),$(t).show(),$(n).empty(),void 0!==i&&$(i).show()})},get_modal_to_search_save:function(){$(document).on("click","#search_save",function(){if("disabled"==$(this).attr("disabled"))return!1;$(this).attr("disabled",!0);var e=$("#form_search_inside_sales"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-loading"),e.removeData("loading"),e.submit(),e.attr("action",t),e.attr("data-loading","true")})},monitor_visible_fields:function(e,t){$(e).on("ajax:complete",function(){$(t).trigger("submit.rails")})},check_limit_add_fields:function(e){return 5===$(e).parent().find("li").filter(function(){return"none"!==$(this).css("display")}).length&&(alert(I18n.t("js.inside_sales.sort_limited")),!0)},sortable_list:function(){var e=$(".sortable");e.sortable({cursor:"move",opacity:.7,items:"li.fields",update:function(){$(this).find(".sort_order").val($(this).sortable("toArray"))}}),e.disableSelection(),e.find('input[type="text"], textarea').off("mousedown.ui-disableSelection selectstart.ui-disableSelection").on("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(e){e.stopImmediatePropagation()})},search_lead_form:function(){App.concerns.change_display_number("form_search_activity_list"),App.concerns.change_order("form_search_activity_list"),$("#search_lead_pref_ids").select2(),App.front_business_card_lead_tags.init_suggest("advanced-search-tags","advanced-search-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search","#search_lead_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search","#advanced-search-tags","#search_lead_tag_ids"),$("#search_lead_interest_product_type_ids").select2(),App.concerns.select_search("search_client_id"),App.concerns.select_search_disable_user("search_lead_owner_user_ids"),App.concerns.select_search_disable_user("search_lead_user_ids"),App.concerns.select_search("search_lead_campaign_ids"),App.concerns.select_search("search_lead_target_list_ids"),App.concerns.select_search("search_lead_web_form_ids"),App.concerns.select_search("search_lead_inside_sales_ids"),App.concerns.select_search("search_lead_sale_approach_ids"),$("#search_lead_lead_source_kbn_ids").select2({width:"100%",placeholder:I18n.t("js.common.lead_source")}),$("#search_lead_lead_status").select2({width:"100%",placeholder:I18n.t("js.common.lead_status")}),App.concerns.set_item_id(),$("#search_lead_important_customer_flg").select2({width:"100%",placeholder:I18n.t("js.common.important_customer")}),$("#search_lead_end_user_flg").select2({width:"100%",placeholder:I18n.t("js.common.end_user")}),$("#search_lead_store_flg").select2({width:"100%",placeholder:I18n.t("js.common.store")}),$("#search_lead_competitor_flg").select2({width:"100%",placeholder:I18n.t("js.common.competitor")}),$("#search_lead_error_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.mail_error")}),$("#search_lead_error_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.tel_error")}),$("#search_lead_error_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.fax_error")}),$("#search_lead_error_address_flg").select2({width:"100%",placeholder:I18n.t("js.common.address_error")}),$("#search_lead_not_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_mail")}),$("#search_lead_not_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_tel")}),$("#search_lead_not_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_fax")}),$("#search_lead_not_dm_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_dm")}),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_datepicker"),App.concerns.datepicker(".search_items_datepicker")},reload_summary_and_activity_table:function(){$("#inside_sales_activity_summary").trigger("reload"),$("#inside_sales_task_summary").trigger("reload"),$(".remote_deals_summary").trigger("reload"),$("#form_search_activity_list").trigger("submit.rails")},reload_ajax_element:function(e){$.ajax({type:"GET",url:$(e).data("remote-url"),dataType:"script"})},setup_activity_type:function(){function e(e){$(".btn").prop("disabled",!0);var t=$(e).closest("li"),n=$(e).closest("div").find(".edit-name").val();t.data("depth");if($(e).hasClass("add_decision")||$(e).hasClass("add_decision_input")){var i=$(e).closest("ul").closest("li").data("activity-type-id"),a=$(e).closest("ul").children("li").length,s=$(e).closest("li").data("depth");$("#activity_type_name").val(n),$("#activity_type_parent_activity_type_id").val(i),$("#activity_type_sort").val(a),$("#activity_type_depth").val(s),$("#activity_type_activity_type_list_id").val(t.attr("id")),$("#activity_type_edit_form").attr("method","post"),$("#activity_type_edit_form").attr("action","/xhr/inside_sales/activity_types/create"),$("#activity_type_edit_form").submit()}else{var o=I18n.t("js.common.confirm_save"),r=$(e).closest("li").data("activity-type-id");confirm(o)&&($("#activity_type_id").val(r),$("#activity_type_name").val(n),$("#activity_type_activity_type_list_id").val(t.attr("id")),$("#activity_type_edit_form").attr("method","patch"),$("#activity_type_edit_form").attr("action","/xhr/inside_sales/activity_types/update"),$("#activity_type_edit_form").submit())}}function t(e){e.find(".edit-name").val(e.children("span").eq(1).text()),e.children("span").addClass("none"),e.children("span").eq(2).removeClass("none"),e.children("span").eq(3).removeClass("none"),e.children("span").eq(4).removeClass("none")}$("#activity_type_setting_dialog").off("show.bs.modal").off("hidden.bs.modal").on("show.bs.modal",function(){$.ajax({type:"GET",url:"/xhr/inside_sales/activity_types/editable_form/",dataType:"script",beforeSend:function(){$("#activity_type_form_area").html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))}}).fail(function(){$("#activity_type_form_area").html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.inside_sales.load_error")+"</span></div>"))}).always(function(){$("#activity_type_form_area").find(".loading").remove()})}).on("hidden.bs.modal",function(){$("#loading-area").css("display","none"),$("#activity_type_form_error_area").empty(),$.ajax({type:"GET",url:"/xhr/inside_sales/activity_types/get_select_box/",dataType:"script"}).fail(function(e){console.log(e)})}),$(document).on("click","#js_sortable_all",function(){if(0===$("ul.activity_type_tree li").length)return alert(I18n.t("js.inside_sales.no_activity_type")),!1;$.ajax({type:"GET",url:$(this).data("remote-url"),dataType:"script",beforeSend:function(){$("#activity_type_form_error_area").empty(),$("#activity_type_form_area").html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))}}).fail(function(){$("#activity_type_form_area").html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.inside_sales.load_error")+"</span></div>"))}).always(function(){$("#activity_type_form_area").find(".loading").remove()})}),$(document).on({"ajax:beforeSend":function(){$("#activity_type_form_error_area").empty(),$("#activity_type_form_area").html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:error":function(){$("#activity_type_form_area").html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.inside_sales.load_error")+"</span></div>"))},"ajax:complete":function(){$("#activity_type_form_area").find(".loading").remove()}},"#js_cancel_sortable"),App.front_inside_sales.folding(),$(document).on("click",".add_top",function(){0==$("#activity_type_setting_dialog").find("#parent").children("ul").length&&$("#activity_type_setting_dialog").find("#parent").append('<ul class="dd-list" id="activity_type_tree"></ul>');var e=$("#activity_type_setting_dialog").find("#activity_type_tree");e.data("routes-depth-size")>e.children("li").length?App.front_inside_sales.activity_type_display_all("add_top"):App.front_inside_sales.node_add_top()}),$(document).on("click",".add",function(){function e(){t.children("ul").append("<li data-depth="+(parseInt(t.data("depth"))+1)+' data-activity-type-id = "" id="new_activity_type_list">'+App.front_inside_sales.create_text()+"</li>"),t.children("ul").find("li").last().addClass("dd-item"),App.front_inside_sales.disabled_by_add_or_edit(),t.children("ul:last").find(".edit-name").focus()}var t=$(this).closest("li"),n=t.children("button");if(0==t.children("ul").length)t.append('<ul class="dd-list"></ul>'),e();else if(n.nextAll(".dd-list").find(".dd-item").length)n.attr("data-action","collapse"),n.nextAll("ul").show(),e();else{App.front_inside_sales.children_list_show(n).done(function(){e()})}}),$(document).on("click",".edit",function(){var e=$(this).closest("li");t(e.children("div:first")),e.find(".edit-name").focus(),e.find(".edit-name").select(),App.front_inside_sales.disabled_by_add_or_edit()}),$(document).on("click",".cancel",function(){var e=$(this).closest("li");$(this).hasClass("add_cancel")?(1==$(this).closest("ul").find("li").length&&$(this).closest("ul").remove(),e.remove()):App.front_inside_sales.edit_cancel(e.children("div:first")),App.front_inside_sales.remove_disabled()}),$(document).on("click",".decision",function(){e($(this))}),$(document).on("click",".delete",function(){var e=I18n.t("js.common.confirm_delete",{name:$(this).closest("li").find(".de_tip").first().text()});if(confirm(e)){$(".btn").prop("disabled",!0);var t=$(this).closest("li"),n=$(this).closest("li").data("activity-type-id");$("#activity_type_id").val(n),$("#activity_type_activity_type_list_id").val(t.attr("id")),$("#activity_type_edit_form").attr("method","delete"),$("#activity_type_edit_form").attr("action","/xhr/inside_sales/activity_types/destroy"),$("#activity_type_edit_form").submit()}}),$(document).on("click",".default_link",function(){if(!$(this).hasClass("add-disabled")){var e=$(this),t=e.parents("li").data("activity-type-id");$(this).hasClass("selected")?$.ajax({url:"/xhr/inside_sales/activity_types/unset_default/",type:"POST",dataType:"json",data:{id:t},context:e}).done(function(){$(".default_link.selected").removeClass("selected")}):$.ajax({url:"/xhr/inside_sales/activity_types/set_default/",type:"POST",dataType:"json",data:{id:t},context:e}).done(function(){$(".default_link.selected").removeClass("selected"),e.addClass("selected")})}})},setup_talk_script_form:function(e,t,n){var i=$(e),a=$(t),s=$(n);a.on("change",function(){if(this.value){for(var e=Array.prototype.slice.call(this.files,0,this.files.length),t=0,n=0;n<e.length;n++)t+=e[n].size;31457280<t?alert(I18n.t("js.inside_sales.file_size_below")):App.front_inside_sales.upload_talk_script(this.files,s)}}),$(document).on("dragover drop",function(e){e.preventDefault()}),i.on({dragover:function(){$(this).addClass("file-dragover")},dragleave:function(){$(this).removeClass("file-dragover")},drop:function(e){if($(this).removeClass("file-dragover"),!$(this).hasClass("disabled")){var t=e.originalEvent.dataTransfer.files;if(t)if(0<$.grep(t,function(e){return""===e.type}).length||t.length<=0)alert(I18n.t("js.inside_sales.drop_file"));else{for(var n=Array.prototype.slice.call(t,0,t.length),i=0,a=0;a<n.length;a++)i+=n[a].size;31457280<i?alert(I18n.t("js.inside_sales.file_size_below")):App.front_inside_sales.upload_talk_script(t,s)}}}}),$(document).on("click",".js-talk-script-uploaded-delete",function(){var e=$(this).parent("li"),t=e.data("uploaded-id");if(""!=t){if(0!==$("[name=delete_talk_script_id]").length){var n=$("[name=delete_talk_script_id]"),i=""!=n.val()?n.val().split(","):[];return i.push(t),n.val(i.join(",")),void e.remove()}$.ajax({url:"/xhr/inside_sales/talk_script/destroy",type:"POST",dataType:"json",data:{id:t}}).done(function(){e.remove()}).fail(function(e){console.log(e)})}else e.remove()})},upload_talk_script:function(e,t){var n,i=$(".js-disabled-target"),a=t.children("li").length,s=e.length,o=new FormData;for(i.prop("disabled",!0),i.addClass("disabled"),n=0;n<s;n++){var r=a+n;t.append('<li data-upload-index="'+r+'" data-uploaded-id=""><span class="text-muted js-talk-script-file-name">'+e[n].name+'</span><div class="progress progress-striped active"><div class="progress-bar" style="width: 0%"></div></div></li>'),o.append("files["+r+"]",e[n])}o.append("uploaded_file_id",$("[name=talk_script_id]").val()),window.inside_sales.xhr.files.upload_talk_scripts=$.ajax({url:"/xhr/inside_sales/talk_script/create",type:"POST",dataType:"script",processData:!1,contentType:!1,cache:!1,data:o,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=parseInt(e.loaded/e.total*100);$(".progress .progress-bar").css("width",t+"%")},!1),e}}).done(function(){i.removeClass("disabled"),i.prop("disabled",!1)}).fail(function(e){console.log(e)})},activity_type_display_all:function(n){$.ajax({url:"/xhr/inside_sales/activity_types/activity_types_tree_index_html",type:"GET",data:{btn_name:n},dataType:"html"}).done(function(e){var t=$("#activity_type_tree");t.empty(),t.append(e).find(".hp-tooltip").tooltip({trigger:"hover"}),$(".forbid-add, .forbid-delete").prop("disabled",!0),t.find("li").each(function(){var e=$(this).data("activity-type-id"),t="App.front_inside_sales.get_modal_to_related_activities('#business_activity_relation"+e+"',"+e+");";$(this).find(".activity_link").first().attr("onclick",t)}),$("#activity_type_tree .dd-list").show(),$("#activity_type_size").val(t.children("li").length),"add_top"===n&&App.front_inside_sales.node_add_top(),"all_open"===n&&t.find(".hp-tooltip").tooltip({trigger:"hover"})}).fail(function(e){console.log(e)}).always(function(){$("#loading-area").css("display","none")})},node_add_top:function(){$("#activity_type_setting_dialog").find("#parent ul:first").append('<li class="dd-item" data-depth="1" data-activity-type-id = "" id="new_activity_type_list">'+App.front_inside_sales.create_text()+"</li>"),$(".edit-name").last().focus(),App.front_inside_sales.disabled_by_add_or_edit()},create_text:function(){return'<div class="row-span">\n<span class="none"></span>\n<span class="input row-span"><input type="text" name="name" class="edit-name add_decision_input" value=""></span>\n<span class="ml10 row-span"><a href="javascript:void(0)" class="sub-bnt decision add_decision task-button" tabindex="-1">'+I18n.t("js.common.save")+'</a></span>\n<span class="ml15 row-span"><span class="sub-bnt cancel add_cancel delete-button">'+I18n.t("js.common.cancel")+'</span></span>\n<span class="none"></span>\n<span class="none"></span>\n<span class="none"></span>\n<span class="none"></span>\n</div>'},disabled_by_add_or_edit:function(){$(".add,.edit,.delete,.activity_link,.add_top,.sortable_all,.default_link,.folding,#all_open,#all_close").addClass("add-disabled hp-tooltip"),$(".activity_link").removeAttr("onclick","target"),$(".add-disabled").prop("disabled",!0),$(window).off("scroll")},remove_disabled:function(){$(".add-disabled,.btn").prop("disabled",!1),$(".add,.edit,.delete,.activity_link,.add_top,.sortable_all,.default_link,.folding,#all_open,#all_close").removeClass("add-disabled hp-tooltip"),$("#activity_type_tree").find("li").each(function(){var e=$(this).data("activity-type-id"),t="App.front_inside_sales.get_modal_to_related_activities('#business_activity_relation"+e+"',"+e+");";$(this).find(".activity_link").first().attr("onclick",t)}),$(".forbid-add, .add-disabled").prop("title",""),$(".forbid-add, .forbid-delete,.limit-activity-type").prop("disabled",!0)},children_list_show:function(t){if(!$(t).nextAll(".dd-list").find(".dd-item").length){parent_id=$(t).parent("li").data("activity-type-id");var e=new $.Deferred;return $.ajax({url:"/xhr/inside_sales/activity_types/append_children/",type:"GET",dataType:"html",data:{parent_id:parent_id},context:$(t)}).done(function(e){$(t).attr("data-action","collapse"),$(t).nextAll(".dd-list").empty(),$(t).nextAll(".dd-list").append(e).find(".hp-tooltip").tooltip({trigger:"hover"}),$(t).nextAll("ul").show(),$(".forbid-delete,.forbid-add").prop("disabled",!0)}).fail(function(e){console.log(e)}).always(function(){e.resolve()}),e}$(t).hasClass("dd-expand")||$(t).attr("data-action","collapse"),$(t).nextAll("ul").show()},edit_cancel:function(e){e.children("span").removeClass("none"),e.children("span").eq(2).addClass("none"),e.children("span").eq(3).addClass("none"),e.children("span").eq(4).addClass("none")},confirm_text:function(e,t,n){e='<div class="row-span">\n<span class="row-span"><span class="default_link"><i class="fa fa-star"></i></span></span>\n<span class="text de_tip" data-html="true">'+e+'</span>\n<span class="input none row-span"><input type="text" name="name" class="edit-name" value=""></span>\n<span class="ml10 none row-span"><a href="javascript:void(0)" class="sub-bnt decision task-button" tabindex="-1">'+I18n.t("js.common.save")+'</a></span>\n<span class="ml15 none row-span"><span class="sub-bnt cancel delete-button">'+I18n.t("js.common.cancel")+"</span></span>\n";return e+=t<5?'<span class="ml10 row-span"><span class="sub-bnt add"><i class="fa fa-plus-circle"></i></span></span>\n':'<span class="ml10 row-span"><span class="sub-bnt add forbid-add hp-tooltip" title="'+I18n.t("js.inside_sales.max_hierarchy")+'"><i class="fa fa-plus-circle"></i></span></span>\n',e+='<span class="ml15 row-span"><span class="sub-bnt edit"><i class="fa fa-pencil"></i></span></span>\n<span class="ml15 row-span"><span class="sub-bnt delete" title=""><i class="fa fa-trash"></i></span></span>\n',e+='<span class="ml15 row-span"><a class="sub-bnt activity_link hp-tooltip" href="javascript:void(0)" tabindex="-1" title="'+I18n.t("js.inside_sales.activity_link")+'"><i class="fa fa-link"></i></a>\n<input type="hidden" id="business_activity_relation'+n+'" data-activity-type-id="'+n+'" data-relation-flg="false"></span>\n</div>'},add_collapse:function(e){0==e.children("button").length&&0==e.children("#activity_type_tree").length&&e.prepend('<button class="folding" data-action="collapse">Expand></button>')},folding:function(){$(document).on("click",".dd-item button",function(){"expand"==$(this).attr("data-action")?App.front_inside_sales.children_list_show(this):($(this).hasClass("dd-collapse")||$(this).attr("data-action","expand"),$(this).nextAll("ul").hide())}),$(document).on("click","#all_open",function(){$("#loading-area").css("display","block"),App.front_inside_sales.activity_type_display_all("all_open"),$(btn).nextAll(".dd-list").append(data).find(".hp-tooltip").tooltip({trigger:"hover"})}),$(document).on("click","#all_close",function(){$("#activity_type_tree .dd-list").hide(),$("#activity_type_tree .folding").attr("data-action","expand")})},table_check_cnt:function(t){$(document).on("click",t,function(){var e=0;$(t).each(function(){this.checked&&e++}),$("[data-selected-number]").text("\uff08"+e+"\uff09")})},get_modal_to_search_activity_types:function(e){$(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_selected_activity_type_ids").val($(e).select2("data").map(function(e){return e.id})),$("#js_get_modal_to_search_activity_types").submit()},get_modal_to_related_activities:function(e,t){$(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_selected_activity_ids").val($(e).val()),$("#js_activity_type_id").val(t),$("#js_activity_type_size").val($("#activity_type_tree").children("li").length),$("#js_get_modal_to_related_activities").submit()},add_fields_for_inside_sales:function(e,t,n){if(10<=$(e).parent().find("li").filter(function(){return"none"!==$(this).css("display")}).length)return alert(I18n.t("js.inside_sales.item_set")),!1;add_fields(e,t,n),$(".sortable").find('input[type="text"], textarea').off("mousedown.ui-disableSelection selectstart.ui-disableSelection").on("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(e){e.stopImmediatePropagation()})},change_order_summary:function(e){var t=$("#"+e);$(document).on("click","#"+e+" .order_head_summary",function(){$.ajax({type:"GET",url:t.data("remote-url"),dataType:"script",data:{order_key:$(this).data("order-key"),order_type:$(this).data("order-type"),order_flg:!0},beforeSend:function(){t.html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))}}).fail(function(){t.html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.inside_sales.load_error")+"</span></div>"))}).always(function(){t.find(".loading").remove()})})},xhr_change_display_template_for_deal:function(){$(document).on("change","#js_select_change_display_template",function(){if($("#js_select_change_display_template").hasClass("action_for_xhr_deals")){var e=$("#js_form_change_display_template");e.attr("action","/xhr/deals/new_modal"),e.data("remote",!0),e.on("ajax:success",function(e,t){var n=RelationModals.find_or_create_dom("history_relation_deal_container");n.html(t),n.find(".hidden-xs").addClass("hidden-xs-on-modal"),RelationModals.resetAssociatedButton(),RelationModals.changeDisplayTemplate(n,$(this)),App.front_deals.init_form_from_another_controller(!1),RelationModals.attachForm(n,$("#new_deal"),"deal","#new_submit"),$("#js_select_change_display_template").addClass("action_for_xhr_deals"),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id")})}else $("#js_select_change_display_template").removeClass("action_for_xhr_deals")})},inside_sales_change_discription:function(n){$(document).on("change.segment_id",n,function(){var e=$(n).val(),t=$("#business_activity_segment_id  option:selected").text();$(".segment_icon_area").find("img").attr("src","/xhr/segments/show_icon/?id="+e),$("#segment-name").text(t)}),$(".segment_hidden_icons").attr("disabled",!0)},clear_inside_sales_search_modal:function(e,t,n){e.stopPropagation(),t=t||"#form_xhr_inside_sales_search",n=n||"#status, #start_contract_at, #end_contract_at, #activity_type, #search_segment_id",$Modal=$(t),$Modal.find("#start_contract_at").val(""),$Modal.find("#end_contract_at").val(""),$Modal.find("#status").val(""),$Modal.find("#activity_type").val(""),$Modal.find("#search_segment_id").val(""),$Modal.find("input").not("input[name='_method']").not("input[name='authenticity_token']").not("input[name^='segment-icon']").not(":checkbox").not(".non_clear").val(""),$(n).trigger("change")},set_associate_entities_to_s2_with_new_option:function(e,a,t,n){$(document).on("click",e,function(){var i=jQuery.map($(t+":checked"),function(e){return $(e).val()});return 0==i.length?(alert(I18n.t("js.common.please_select")),!1):jQuery.map($(t+":checked"),function(e){return $(e).data("check-permission")}).some(function(e){return e})?(alert(I18n.t("js.common.can_not_add_private_item")),!1):(i.push.apply(i,jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value})),$('input[name="another_controller_type"]').val()==CONST_ANOTHER_CONTROLLER_TYPE_INSIDE_SALES&&(i=i.filter(function(e){return e!=$('input[name="exclude_business_activity_id"]').val()})),void $.ajax({url:"/xhr/"+n+"/existence/",type:"POST",dataType:"json",data:{ids:i},context:$(this)}).done(function(n){n.does_not_exist_ids.length&&jQuery.each(n.does_not_exist_ids,function(e,t){i=jQuery.grep(i,function(e){return e!=t})}),$.each(i,function(e,t){option_slector='option[value="'+t+'"]',0==$(a).find(option_slector).length&&(activity_name=n.exist_activities[t],activity_name&&(option_dom='<option value="'+t+'">'+activity_name+"</option>",$(a).append(option_dom)))}),$(a).val(i).trigger("change"),$(a).select2("open"),$(a).select2("close"),$(this).closest(".modal").modal("hide")}))})},attach_new_activity_lists_form:function(n){var i=$("#new_activity_lists");i.data("remote",!0),i.on("submit",function(){$("#modal_error_message").empty()}),n.find("#new_submit").off("click"),n.find("#new_submit").on("click",function(e){e.preventDefault(),$("#modal_error_message").empty();var t=new FormData($(i).get(0));return t.append("format","json"),$.ajax($(i).attr("action"),{type:"post",processData:!1,contentType:!1,data:t}).done(function(e){e.message?$("#modal_error_message").html(e.message):(App.front_inside_sales.reload_ajax_element("#correspondence_history_area"),n.modal("hide"))}),!1})}},App.front_items={ITEM_TYPES:{NUMERICAL:8,CALCULATE:10},index:function(){App.concerns.change_display_number("form_search_items"),App.concerns.change_order("form_search_items"),App.concerns.focus_to_first_element(),this.display_option_item_type_index(),App.concerns.datepicker(".search_datepicker"),$(document).on("click",".item-checkbox",function(){var e=0;$(".item-checkbox").each(function(){this.checked&&e++}),$("[data-selected-number]").text("\uff08"+e+"\uff09")}),$(document).on("click",".all-check",function(){var e=this.checked,t=0;$(".item-checkbox").each(function(){t++,this.checked=e}),e?$("[data-selected-number]").text("\uff08"+t+"\uff09"):$("[data-selected-number]").text("\uff080\uff09")}),$(document).on("click",".js_open_modal_batch_delete",function(){var e=[];if($(".item-checkbox").each(function(){this.checked&&e.push(this.value)}),e.length){$("#delete_items_accept_term").attr("checked",!1),$(".btn-confirm-delete-items").attr("disabled",!0);var t=0;$(".item-checkbox").each(function(){this.checked&&t++}),$("#delete_items_selected_count").text(t),$("#modalItemsBulkDeletion").modal("show")}else App.front_items.alert_error_message("#js_error_message",I18n.t("js.items.error_please_select"))}),$(document).on("change","#delete_items_accept_term",function(){this.checked?$(".btn-confirm-delete-items").removeAttr("disabled"):$(".btn-confirm-delete-items").attr("disabled","true")}),$(document).on("click",".js_open_modal_batch_update",function(){var e=[];$(".item-checkbox").each(function(){this.checked&&e.push(this.value)}),e.length?100<e.length?App.front_items.alert_error_message("#js_error_message",I18n.t("js.items.select_exceeds_100")):($(".btn-confirm-update-items").attr("disabled",!0),$('input[name="enable_flg"]').prop("checked",!1),$("#update_error_alert_messeges").children().remove(),$("#modalItemsBulkUpdation").modal("show")):App.front_items.alert_error_message("#js_error_message",I18n.t("js.items.error_please_select"))}),$(document).on("change",'input[name="enable_flg"]',function(){$(".btn-confirm-update-items").removeAttr("disabled")}),$(document).on("click",".btn-confirm-update-items",function(){$(".btn-confirm-update-items").attr("disabled",!0);var e=[];$(".item-checkbox").each(function(){this.checked&&e.push(
this.value)}),$.ajax({type:"post",url:"/xhr/items/bulk_change/update",data:{ids:e,enable_flg:$('input[name="enable_flg"]:checked').val()},success:function(){$(".item-checkbox, .all-check").each(function(){this.checked=!1}),location.reload()},error:function(e){App.front_items.alert_error_message("#js_error_message",e.responseJSON.message),$("#modalItemsBulkUpdation").modal("hide")},complete:function(){$(".btn-confirm-update-items").removeAttr("disabled")}})}),$(document).on("click",".btn-confirm-delete-items",function(){$(".btn-confirm-delete-items").attr("disabled",!0);var e=[];$(".item-checkbox").each(function(){this.checked&&e.push(this.value)}),$.ajax({type:"post",url:"/xhr/items/bulk_change/delete",data:{ids:e},success:function(){$(".item-checkbox, .all-check").each(function(){this.checked=!1}),location.reload()},error:function(e){App.front_items.alert_error_message("#js_error_message",e.responseJSON.message),$("#modalItemsBulkDeletion").modal("hide")},complete:function(){$(".btn-confirm-delete-items").removeAttr("disabled")}})})},alert_error_message:function(e,t){if(Array.isArray(t)){var n=t.map(function(e){return'<li style="word-wrap: break-word;">'+e+"</li>"}).join("");$(e).html('      <div class="row">        <div class="col-xs-12">          <div class="alert alert-danger alert-error alert-dismissible" role="alert">            <button type="button" class="close" data-dismiss="alert" aria-label="Close">              <span aria-hidden="true">&times;</span>            </button>            <ul>'+n+"</ul>          </div>        </div>      </div>")}else $(e).html('        <div class="row">          <div class="col-xs-12">            <div class="alert alert-danger alert-error alert-dismissible" role="alert">              <button type="button" class="close" data-dismiss="alert" aria-label="Close">                <span aria-hidden="true">&times;</span>              </button>              <ul>                <li style="word-wrap: break-word;">'+t+"</li>              </ul>            </div>          </div>        </div>")},"new":function(){this.submit_new(),this.set_on_change_item_item_type(),$(".setting-decimal-place").hide(),this.display_description(),this.change_index(),this.change_event_decimal_point(),this.handle_calculate_item(),this.check_attr_label_in_sample_max(),this.check_attr_label_in_sample_item_data_type(),this.clear_localStorage_when_reload(),this.display_item_datas(),App.front_items.control_decimal_point($("#item_item_type").val());var e=$("#item_data_type").val();"2"!=e&&"3"!=e&&"7"!=e&&$(".item_type option[value=10]").hide(),$("#item_item_type").val()==String(App.front_items.ITEM_TYPES.CALCULATE)&&($(".table-calculate").show(),$(".formula-value").attr("title",""),10<=$(".attr-label-in-sample").length&&$(".add_formula").prop("disabled",!0))},create:function(){this.submit_new(),this.display_item_datas(),this.set_on_change_item_item_type(),this.display_description(),this.change_index(),this.change_event_decimal_point(),this.control_decimal_point($("#item_item_type").val()),this.handle_calculate_item(),this.check_attr_label_in_sample_max(),$(".sample-calculate").trigger("change"),App.front_items.fetch_options_formula(),this.handle_layout_formula(),this.handle_round_result(),this.handle_error_calculate(),App.front_items.handle_update_length_db(),$("#item_item_type").val()==String(App.front_items.ITEM_TYPES.CALCULATE)&&($(".formula-value").attr("title",""),10<=$(".attr-label-in-sample").length&&$(".add_formula").prop("disabled",!0))},edit:function(){this.submit_edit(),this.display_item_datas(),$("#item_item_type").on("change",function(){App.front_items.display_item_datas()}),this.change_index(),this.handle_add_value_result_sample_hidden(),this.handle_calculate_item(),this.check_attr_label_in_sample_max(),this.check_attr_label_in_sample_item_data_type(),$("#item_item_type").val()==String(App.front_items.ITEM_TYPES.CALCULATE)&&($(".formula-value").attr("title",""),10<=$(".attr-label-in-sample").length&&$(".add_formula").prop("disabled",!0))},update:function(){this.submit_edit(),this.display_item_datas(),$("#item_item_type").on("change",function(){App.front_items.display_item_datas()}),this.display_description(),this.change_index(),this.handle_calculate_item(),this.check_attr_label_in_sample_max(),this.handle_layout_formula(),$(".sample-calculate").trigger("change"),App.front_items.fetch_options_formula(),this.handle_round_result(),App.front_items.handle_update_length_db(),$("#item_item_type").val()==String(App.front_items.ITEM_TYPES.CALCULATE)&&($(".formula-value").attr("title",""),10<=$(".attr-label-in-sample").length&&$(".add_formula").prop("disabled",!0))},submit_new:function(){$("#new_submit").on("click",function(){App.front_items.storage_content_sample_html(),parseFloat($("#item_item_type").val())==App.front_items.ITEM_TYPES.CALCULATE?$(".sample-calculate").trigger("change"):$(".check-valid-calculate").attr("value","true"),$("form.new_item").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){App.front_items.storage_content_sample_html(),parseFloat($("#item_item_type").val())==App.front_items.ITEM_TYPES.CALCULATE?$(".sample-calculate").trigger("change"):$(".check-valid-calculate").attr("value","true"),$("form.edit_item").submit()})},set_on_change_item_item_type:function(){var e=undefined;$("#item_item_type").on("focus",function(){e=this.value}),$("#item_item_type").change(function(){parseInt(e)!=App.front_items.ITEM_TYPES.CALCULATE&&parseInt(this.value)!=App.front_items.ITEM_TYPES.CALCULATE||($("input[id^='item_item_datas_attributes_']").not("[id$='__destroy']").val(undefined),$("#item_sample_calculate").val(undefined),$(".sample-calculate").html(null),$(".result-sample").text("0")),App.front_items.display_item_datas(),e=this.value})},display_item_datas:function(){var e=$("#item_item_type").val();"4"==e||"5"==e||"6"==e?$(".item_datas").show():"10"==e?($(".item_datas").hide(),$(".sample-calculate").trigger("change")):$(".item_datas").hide()},display_description:function(){$(".data_type").change(function(){var e=$(".data_type").val();2==e||3==e?$(".description_item").show():$(".description_item").hide()}),$(".data_type").trigger("change")},change_index:function(){$(".sortable").sortable({cursor:"move",opacity:.7,items:"li.fields",update:function(){$("[name=sort_order]").val($(".sortable").sortable("toArray"))}}),$(".sortable").disableSelection()},control_decimal_point:function(e){parseInt(e)==App.front_items.ITEM_TYPES.NUMERICAL?$(".setting-decimal-place").show():($("#item_decimal_point").val(undefined),$(".setting-decimal-place").hide())},change_event_decimal_point:function(){$("#item_item_type").on("change",function(e){App.front_items.control_decimal_point(e.target.value)})},display_option_item_type:function(){$(".data_type").change(function(){backup_formula_value="";var e=$(".data_type").val();2==e?App.front_items.get_item_local_storage("deal"):3==e?App.front_items.get_item_local_storage("daily_report"):7==e&&App.front_items.get_item_local_storage("deal_detail"),$(".param-value-calculate").val(),$(".sample-calculate").trigger("change"),App.front_items.fetch_options_formula()})},get_html_formula_before_change:function(){$(document).on("focus",".data_type",function(){var e=$(this).val();2==e?App.front_items.set_item_local_storage("deal"):3==e?App.front_items.set_item_local_storage("daily_report"):7==e&&App.front_items.set_item_local_storage("deal_detail")})},clear_localStorage_when_reload:function(){$(window).on("load",function(){App.front_items.remove_item_local_storage("deal"),App.front_items.remove_item_local_storage("daily_report"),App.front_items.remove_item_local_storage("deal_detail")})},get_item_local_storage:function(e){var t=localStorage.getItem("description_"+e),n=localStorage.getItem("formula_"+e),i=localStorage.getItem("decimal_point_"+e),a=localStorage.getItem("rounding_kbn_"+e);$(".formula-value").html(n),$("#item_description").val(t),null!=i&&($(".decimal-point-calculate").val(i),$("#item_rounding_kbn").val(a))},get_item_select_local_storage:function(e){var t=localStorage.getItem("item_"+e),n=localStorage.getItem("value_item_"+e);null!=t&&($("#item_value").val(t),$(".value-item-calculate").val(n))},set_item_local_storage:function(e){localStorage.setItem("description_"+e,$("#item_description").val()),localStorage.setItem("formula_"+e,$(".formula-value").html()),localStorage.setItem("item_"+e,$("#item_value").val()),localStorage.setItem("value_item_"+e,$(".value-item-calculate").val()),localStorage.setItem("decimal_point_"+e,$(".decimal-point-calculate").val()),localStorage.setItem("rounding_kbn_"+e,$("#item_rounding_kbn").val())},remove_item_local_storage:function(e){localStorage.removeItem("description_"+e),localStorage.removeItem("formula_"+e),localStorage.removeItem("item_"+e),localStorage.removeItem("value_item_"+e),localStorage.removeItem("decimal_point_"+e),localStorage.removeItem("rounding_kbn_"+e)},display_option_item_type_index:function(){$("#search_data_type").change(function(){var e=$("#search_data_type").val(),t=$("#search_item_type").val();2==e||3==e||7==e||""==e?$("#search_item_type option[value=10]").show():(10==t&&$("#search_item_type").val(undefined),$("#search_item_type option[value=10]").hide())})},select_option_calculate:function(){$(".item_type").on("change",function(e){parseInt(e.target.value)==App.front_items.ITEM_TYPES.CALCULATE?(CKEDITOR.instances.editor1.on("change",function(){App.front_items.handle_remove_full_width()}),$(".formula-value").attr("title",""),$(".text-noti-calculate").show(),$(".table-calculate").show(),$(".value_decimal").prop("disabled",!1),$(".round-sample").prop("disabled",!1)):($(".text-noti-calculate").hide(),$(".table-calculate").hide(),$(".value_decimal").prop("disabled",!0),$(".round-sample").prop("disabled",!0))})},add_formula_to_calculate:function(){var i;$(".formula-value").on("dblclick",function(e){e.preventDefault()}),$(".formula-value").on("click",function(e){e.preventDefault(),$(".formula-value span").length&&(bookmarks=CKEDITOR.instances.editor1.getSelection().createBookmarks2(!0),$(".formula-value").html($(".formula-value").html().replace(/\&nbsp;/g,"").replace(/\u200B/g,"").replace(/<[^/>][^>]*><\/[^>]+>/,"")),CKEDITOR.instances.editor1.focus(),CKEDITOR.instances.editor1.getSelection().selectBookmarks(bookmarks))}),$(".formula-value").keydown(function(){App.front_items.handle_remove_full_width(),$(".formula-value").data("bk_flg",!1),backup_formula_value=$(this).html()}),$(".formula-value").keyup(function(e){if(App.front_items.handle_remove_full_width(),$(".formula-value p:first").addClass("content-sample")," "==e.key)return!1;$(".sample-calculate").trigger("change"),App.front_items.handle_update_length_db()}),$(".formula-value").keypress(function(e){if(App.front_items.handle_update_length_db(),App.front_items.handle_formula_too_many_characters())return!1;if(null==e.key.match(/^[-, +, *, /, (, ), ., 0-9, \xa0]+$/))return!1;if(","==e.key)return!1;if(["*","/","+","-","(",")"].includes(e.key)){e.preventDefault();var t=CKEDITOR.dom.element.createFromHtml(App.front_items.generate_content_sample(undefined,undefined,undefined,e.key,undefined));CKEDITOR.instances.editor1.insertElement(t)}}),$(window).load(function(){$(".formula-value").length&&($(".sample-calculate").trigger("change"),CKEDITOR.instances.editor1.on("key",function(e){if(13==e.data.keyCode||2228237===e.data.keyCode||32==e.data.keyCode)e.cancel();else if(8===e.data.keyCode){var t=CKEDITOR.instances.editor1.getSelection().getRanges()[0];if(t.startOffset==t.endOffset){if(t.startOffset<=2&&1==t.endContainer.type&&t.endContainer.getChildren().getItem(t.endOffset)&&1==t.endContainer.getChildren().getItem(t.endOffset).type)return!1;if(0==t.startOffset&&3==t.endContainer.type&&$(".formula-value span").text()==$(".formula-value").text().replace(/\u200B/g,""))return!1}}}))}),$(".formula-value").keyup(function(e){if(e.preventDefault(),App.front_items.handle_update_length_db(),App.front_items.handle_formula_too_many_characters())return!1;var t=CKEDITOR.instances.editor1,n=t.getSelection().getRanges()[0];if(8===e.keyCode||46==e.keyCode)bookmarks=CKEDITOR.instances.editor1.getSelection().createBookmarks2(!0),n.deleteContents(),$(".formula-value").html($(".formula-value").html().replace(/\&nbsp;/g,"").replace(/\u200B/g,"").replace(/<[^/>][^>]*><\/[^>]+>/,"")),t.focus(),bookmarks[0].endOffset=bookmarks[0].startOffset,t.getSelection().selectBookmarks(bookmarks),$(".sample-calculate").trigger("change"),App.front_items.handle_update_length_db();else if(37===e.keyCode){(i=t.createRange()).setStart(n.startContainer,n.startOffset),i.setEnd(n.endContainer,n.startOffset),t.focus(),t.getSelection().selectRanges([i])}else if(39===e.keyCode){var i;(i=t.createRange()).setStart(n.startContainer,n.endOffset),i.setEnd(n.endContainer,n.endOffset),t.focus(),t.getSelection().selectRanges([i])}}),$(".add_formula").on("click",function(){if(App.front_items.handle_formula_too_many_characters(a,t))return!1;$(".formula-value").trigger("keydown");var e=$("#item_value option:selected").text(),t=$("#item_value option:selected").val(),n=$("#item_data_type").val();if(""==$(".value-item-calculate").val())var i,a=(i=1e4).toLocaleString();else if((i=$(".value-item-calculate").val().replace(/,/g,"")).includes("."))a=i.toLocaleString();else a=i.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");$(".formula-value br").remove();var s=CKEDITOR.dom.element.createFromHtml(App.front_items.generate_content_sample(t,a,e,undefined,n));CKEDITOR.instances.editor1.insertElement(s),$(".sample-calculate").append(a+" "),$(".sample-calculate").trigger("change"),App.front_items.handle_update_length_db()}),$(".option-calculation").on("click",function(){var e=this.value;if(App.front_items.handle_formula_too_many_characters(e))return!1;if($(".formula-value").trigger("keydown"),"\xd7(*)"==(t=this.value)||"\xf7(/)"==t||"mod(%)"==t)var t=this.value.replace(/[\xd7,(,),\xf7,mod]/g,"");$(".formula-value br").remove();var n=CKEDITOR.dom.element.createFromHtml(App.front_items.generate_content_sample(undefined,undefined,undefined,t,undefined));CKEDITOR.instances.editor1.insertElement(n),$(".sample-calculate").append(t+" "),$(".sample-calculate").trigger("change"),App.front_items.handle_update_length_db()}),$(".sample-calculate").on("change",function(){if(App.front_items.handle_formula_too_many_characters())return!1;if(parseInt($("#item_item_type").val())!=App.front_items.ITEM_TYPES.CALCULATE)return!1;$(".attr-label-in-sample").length<10&&($(".error-length-label").hide(),$(".add_formula").prop("disabled",!1));var i="",a="";if($(".formula-value").contents().each(function(){if(!$(this).is("div")){var e=$(this).attr("value"),t=$(this).attr("value_sample");if(e==undefined)e=$(this).text();if(t==undefined)t=$(this).text();var n=t.split(".");n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=n.join("."),a=a+" "+t,i=i+" "+e}}),a=a.trim().replace(/\u200b/g,""),$(".param-value-calculate").first().val(i.trim().replace(/\s\s+/g," ")),$(".sample-calculate").text(a),$(".sample-calculate-field").val(a.replace(/\s\s+/g," ")),""==(a=(a=$(this).text().replace(/,|\n/g,"").replace(/\u200b/g,"")).replace(/mod/g,"%")))var e="";else{if(null==a.match(/^[-, +, *, /, (, ), ., %, 0-9,\xa0]+$/))return $(".result-sample").text(""),$(".result-sample").append(I18n.t("js.items.error_char_calculate")),$(".result-sample").css("font-size","21px"),$(".check-valid-calculate").attr("value","false"),!1;try{e=BigNumber.evaluate(a)}catch(t){return $(".result-sample").text(""),$(".result-sample").append(I18n.t("js.items.error_calculate")),$(".result-sample").css("font-size","21px"),$(".check-valid-calculate").attr("value","false"),!1}}if(e==Infinity||e==-Infinity||isNaN(e))return $(".result-sample").text(""),$(".result-sample").append(I18n.t("js.items.error_calculate")),$(".result-sample").css("font-size","21px"),$(".check-valid-calculate").attr("value","false"),!1;e=e.toString().replace(/,/g,".");$(".result-sample-hidden").text(e.toLocaleString()),$(".result-sample").css("font-size","21px"),$(".result-sample").text(e.toLocaleString()),$(".check-valid-calculate").removeAttr("value"),$(".round-sample").trigger("change"),value_elm_invalue=[],$(".formula-value").contents().each(function(){var e=$(this).text();e!=undefined&&"\u200b\u200b\u200b\u200b\u200b\u200b\u200b"!=e&&"\xa0"!=e&&""!=e&&0==$(this).is("p")&&value_elm_invalue.push($(this))}),$.each(value_elm_invalue,function(e){if($(this).hasClass("attr-label-in-sample")){var t=value_elm_invalue[e+1],n=value_elm_invalue[e-1],i=!1;if(1==value_elm_invalue.length)return;if(n&&$.isNumeric(n.text().substr(-1)))i=!0;if(e==value_elm_invalue.length-1){if(/^\d+$/.test(n.text().replace(/[\u200B-\u200D\uFEFF]/g,"").charAt(0)))i=!0}else if(0==e){if(t.hasClass("attr-label-in-sample")||/^\d+$/.test(t.text().replace(/[\u200B-\u200D\uFEFF]/g,"").charAt(0)))i=!0}else if(t.hasClass("attr-label-in-sample")||/^\d+$/.test(t.text().replace(/[\u200B-\u200D\uFEFF]/g,"").charAt(0))||/^\d+$/.test(n.text().replace(/[\u200B-\u200D\uFEFF]/g,"").charAt(0)))i=!0;if(1==i)return $(".result-sample").text(""),$(".result-sample").append(I18n.t("js.items.error_calculate")),$(".result-sample").css("font-size","21px"),$(".check-valid-calculate").attr("value","false"),!1}}),""!=a&&a!=undefined||$(".check-valid-calculate").attr("value","false_blank")}),$(".value_decimal").on("change",function(){$(".round-sample").trigger("change"),$(".sample-calculate").trigger("change")}),$(".round-sample").on("change",function(){function e(e,t){return t=t||0,e.toFixed(+t,1)}function t(e,t){return t=t||0,e.toFixed(+t,0)}function n(e,t){return t=+t||0,e.toFixed(+t)}if("false"!=$(".check-valid-calculate").val()){var i=$(this).val(),a=$(".value_decimal").val(),s=$(".result-sample-hidden").text();if(s=BigNumber.evaluate(0+s),"1"==i)var o=n(s,a);else if("2"==i)var o=e(s,a);else if("3"==i)o=t(s,a);if((o=o.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")).includes(".")){var r=o.split("."),l=r[1].replace(/,/g,"");o=r[0]+"."+l}$(".result-sample").text(o)}}),(i=jQuery).fn.inputFilter=function(t,n){return this.on("input keydown keyup mousedown mouseup select contextmenu drop focusout",function(e){t(this.value)?(0<=["keydown","mousedown","focusout"].indexOf(e.type)&&(i(this).removeClass("input-error"),this.setCustomValidity("")),this.oldValue=this.value,this.oldSelectionStart=this.selectionStart,this.oldSelectionEnd=this.selectionEnd):this.hasOwnProperty("oldValue")?(i(this).addClass("input-error"),this.setCustomValidity(n),this.reportValidity(),this.value=this.oldValue,this.setSelectionRange(this.oldSelectionStart,this.oldSelectionEnd)):this.value=""})},$(".decimal-point-calculate").inputFilter(function(e){return/^-?\d*[.,]?\d*$/.test(e)&&(""===e||parseInt(e)<=10)},"")},show_calculate_segment:function(){$("#item_item_type").val()==String(App.front_items.ITEM_TYPES.CALCULATE)?($(".text-noti-calculate").show(),$(".table-calculate").show(),$(".item_type option[value=10]").show(),$(".value_decimal").prop("disabled",!1)):$(".value_decimal").prop("disabled",!0)},generate_content_sample:function(e,t,n,i,a){return"*"==i?"<span contenteditable='false' value='"+i+"' class='value-form-calculation operator-multiply'>"+i+"</span>":"%"==i?"<span contenteditable='false' value='"+i+"' class='value-form-calculation'>mod</span>":i!=undefined?"<span contenteditable='false' value='"+i+"' class='value-form-calculation'>"+i+"</span>":"<span data-item-data-type='"+a+"' contenteditable='false' value = '"+e+"' value_sample = '"+t+"' class='btn btn attr-label-in-sample'>"+n+"</span>"},storage_content_sample_html:function(){var e=$(".formula-value").html();localStorage.setItem("item_formula",e)},handle_calculate_item:function(){App.front_items.select_option_calculate(),App.front_items.get_html_formula_before_change(),App.front_items.display_option_item_type(),App.front_items.add_formula_to_calculate(),App.front_items.show_calculate_segment(),$(".round-sample").trigger("change")},fetch_options_formula:function(){var e=$(".data_type").val();2==e||3==e||7==e?($(".value-item-calculate").val(""),$(".item_type option[value=10]").show(),$.ajax({type:"POST",url:"/items/select_items",data:{data_type:e}})):($(".text-noti-calculate").hide(),$(".table-calculate").hide(),10==$(".item_type").val()&&($(".item_type").val(undefined),$(".decimal-point-calculate").attr("disabled",!0)),$(".item_type option[value=10]").hide())},handle_layout_formula:function(){$(".formula-value p").each(function(){0<$(this).text().length?$(this).addClass("content-sample"):$(this).remove()})},handle_round_result:function(){parseInt($(".item_type").val())==App.front_items.ITEM_TYPES.CALCULATE&&($(".value_decimal").prop("disabled",!1),$(".value_decimal").trigger("change"),$(".sample-calculate").trigger("change"))},handle_error_calculate:function(){""==$(".formula-value:visible").text()&&$(".formula-value:visible").addClass("filed-cal-error")},check_attr_label_in_sample_item_data_type:function(){$(document).on("DOMSubtreeModified propertychange",".formula-value",function(){$(".formula-value").data("bk_flg")||$(".attr-label-in-sample").each(function(){if($(this).data("item-data-type")!=Number($("#item_data_type").val()))return $(".formula-value").data("bk_flg",!0),$(".formula-value").html(backup_formula_value),!1})})},check_attr_label_in_sample_max:function(){$(document).on("DOMSubtreeModified propertychange",".formula-value",function(){$(".error-length-label").hide(),$(".add_formula").prop("disabled",!1),10<$(".attr-label-in-sample").length&&($(".formula-value").data("bk_flg",!0),$(".formula-value").html(backup_formula_value),alert(I18n.t("js.items.error-length-label"))),10==$(".attr-label-in-sample").length&&($(".error-length-label").show(),$(".add_formula").prop("disabled",!0))})},handle_formula_too_many_characters:function(e,t){var n=e?e.length:0,i=t?t.length:0;if(255<$("#check_length_calculate_db").val().length+i||255<$("#check_length_calculate_sample").val().length+n)return $(".result-sample").text(""),$(".result-sample").append(I18n.t("js.items.error_length_calculate")),$(".result-sample").css("font-size","21px"),$(".check-valid-calculate").attr("value","false"),!0},handle_update_length_db:function(){var i="",a="";$(".formula-value p").contents().each(function(){if(!$(this).is("p")){var e=$(this).attr("value"),t=$(this).attr("value_sample");if(e==undefined)e=$(this).text();if(t==undefined)t=$(this).text();var n=t.split(".");n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=n.join("."),a+=t,i+=e}}),$("#check_length_calculate_db").val(i.replace(/\s\s+/g," ")),$("#check_length_calculate_sample").val(a),$(".sample-calculate").trigger("change")},handle_add_value_result_sample_hidden:function(){var e=$(".sample-calculate").text().trim().replace(/\,/g,"").replace(/mod/g,"%");null!=BigNumber.evaluate(e)&&$(".result-sample-hidden").text(BigNumber.evaluate(e).toString())},handle_remove_full_width:function(){if(/[^-, +, *, /, (, ), ., 0-9]/g.test($(".formula-value").text())){var e=CKEDITOR.instances.editor1.getSelection().createBookmarks2(!0);html_replace_full_width="",$(".formula-value").contents().each(function(){$(this).hasClass("attr-label-in-sample")||$(this).hasClass("value-form-calculation")?html_replace_full_width+=$(this).prop("outerHTML"):html_replace_full_width+=$(this).text().replace(/\u200b/g,"").replace(/[^-, +, *, /, (, ), ., 0-9]/g,"")}),$(".formula-value").html(html_replace_full_width.replace(/\u200B/g,"").trim()),CKEDITOR.instances.editor1.focus(),CKEDITOR.instances.editor1.getSelection().selectBookmarks(e)}}},App.front_kintone_integrate_base_settings={tab_changed:["tab-company"],"new":function(){$("input[type=text]").on("keypress",function(e){if("Enter"===e.key)return e.preventDefault(),!1}),$(".gloval-menu").css({"z-index":1e5}),$(".github-fork-ribbon-wrapper").css({"z-index":100001}),"back_forward"===performance.getEntriesByType("navigation")[0].type&&(App.front_kintone_integrate_base_settings.show_loader(),location.reload());var t=this.get_state_form_value();window.onbeforeunload=function(){$("#kintone_integrate_base_setting_submit-form-success").val()&&(t=App.front_kintone_integrate_base_settings.get_state_form_value());var e=App.front_kintone_integrate_base_settings.is_data_change(t);return e||undefined},$(".submit-base-setting").on("click",function(){App.front_kintone_integrate_base_settings.show_loader()}),$(".btn_submit").on("click",function(){App.front_kintone_integrate_base_settings.connect_api("app_info",!0)}),$(".test-api").on("click",function(){App.front_kintone_integrate_base_settings.connect_api("api_test",!0)}),$(".mapping-api-test").on("click",function(){App.front_kintone_integrate_base_settings.connect_api("api_test","mapping_item")}),$('[data-toggle="tooltip"]').tooltip(),$(".select2_demo").select2({width:"100%"}),App.concerns.select_search("selected_user_id_user_id"),App.concerns.select_search("company_id_tab-company"),App.concerns.select_search("lead_id_tab-lead","","from_kintone_setting"),App.concerns.select_search("organization_id_tab-department"),App.concerns.select_search("kintone_integrate_base_setting_selected_user_id"),$(".datetimepicker").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"})}),this.handle_reload_records_api("tab-company"),this.toggle_test_button(),this.handle_tab_organization(),this.handle_unique_checkbox_setting_item(),this.handle_duplicate_option_setting_item(),this.handle_mapping_params(),this.handle_btn_mapping_data(),this.handle_change_integration_test_item("company_id","tab-company"),0==$(".new_kintone_integrate_base_setting").length?this.handle_render_setting_item():($("input.setting_items").select2({data:[{id:"",text:I18n.t("js.kintone_integrate_base_setting.blank_value")}],width:"400%"}),$(".form-check-input").attr("disabled",!0),this.disable_default_radio()),this.handle_check_duplicate_item(),this.handle_unique_checkbox_setting_item(),this.handle_duplicate_option_setting_item(),this.handle_mapping_params(),$("input.setting_items").trigger("change.select2"),$(".submit-base-setting").on("click",function(){var e=$("#kintone_integrate_base_setting_selected_user_id").val();$("#kintone_integrate_base_setting_selected_user_id").val(e).change()})},get_state_form_value:function(){var t={mapping_item_company_json:$("#mapping_item_hidden_tab-company").val(),mapping_item_department_json:$("#mapping_item_hidden_tab-department").val(),mapping_item_lead_json:$("#mapping_item_hidden_tab-lead").val(),company_id_tab_company:$("#company_id_tab-company").val(),organization_id_tab_department:$("#organization_id_tab-department").val(),lead_id_tab_lead:$("#lead_id_tab-lead").val()};return["kintone_integrate_base_setting_kintone_url","kintone_integrate_base_setting_kintone_login_name","kintone_integrate_base_setting_kintone_password","kintone_integrate_base_setting_start_at","kintone_integrate_base_setting_interval_kbn","kintone_integrate_base_setting_selected_user_id","kintone_integrate_base_setting_notify_mail_address","kintone_integrate_base_setting_kintone_integrate_data_settings_attributes_1_sample_department_id","app_id_tab-company_val","api_token_tab-company","app_id_tab-department_val","api_token_tab-department","app_id_tab-lead_val","api_token_tab-lead"].forEach(function(e){t[e]=$("#"+e).val()}),t},is_data_change:function(e){var t=this.get_state_form_value(),n=!1;for(var i in e)if(e[i]!==t[i]){n=!0;break}return n},show_loader:function(){var e=$(".loader");e.show(),e.html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw loading"></i></span></div>'))},connect_api:function(e,t){this.show_loader();var n=$("[name*='kintone_url']:visible").val(),i=$("[name*='kintone_password']:visible").val(),a=$("[name*='kintone_login_name']:visible").val(),s=$("[name*='app_id']:visible").val(),o=App.front_kintone_integrate_base_settings.handle_btn_test_data(),r=$(".tab-setting:visible").attr("id"),l=jQuery.parseJSON($("#mapping_item_hidden_"+r).val());delete l.unique_kintone_integrate_base_settings;var c=JSON.stringify(l),d=$("input[type='radio']:visible").filter(":checked").val();data_params={kintone_url:n,kintone_password:i,kintone_login_name:a,app_id:s,option_select:o,data_select:c,tab_type:r,update_key:d,condition:t},url="/kintone_integrate_base_settings/"+e,$.ajax({type:"POST",url:url,data:data_params})},change_tab:function(n){["tab-company","tab-department","tab-lead"].forEach(function(e,t){n==e?($("#"+e).show(),$("#search_search_type_"+ ++t).parents(".radio_tab").addClass("active"),App.front_kintone_integrate_base_settings.tab_changed.includes(e)||(App.front_kintone_integrate_base_settings.tab_changed.push(e),App.front_kintone_integrate_base_settings.handle_check_duplicate_item(),"tab-department"==e?(App.front_kintone_integrate_base_settings.handle_reload_records_api(e),App.front_kintone_integrate_base_settings.handle_change_integration_test_item("organization_id",e)):"tab-lead"==e&&(App.front_kintone_integrate_base_settings.handle_reload_records_api(e),App.front_kintone_integrate_base_settings.handle_change_integration_test_item("lead_id",e)))):($("#search_search_type_"+ ++t).parents(".radio_tab").removeClass("active"),$("#"+e).hide())})},handle_btn_test_data:function(){var e=$("#api-test-tab-company:visible").find("#company_id_tab-company").val(),t=$("#api-test-tab-lead:visible").find("#lead_id_tab-lead").val(),n=$("#api-test-tab-department:visible").find(".organizations_params").find(":selected").val();return e!==undefined&&""!==e?{client:e}:t!==undefined&&""!==t?{lead:t}:n!=undefined&&""!==n?{organization:n}:void 0},toggle_test_button:function(){["tab-company","tab-department","tab-lead"].forEach(function(t){var e=$("[name*='kintone_url']").val(),n=$("[name*='kintone_login_name']").val(),i=$("[name*='kintone_password']").val(),a=$("#"+t+" [name*='app_id']").val(),s=""!=e.trim()&&""!=a.trim()&&""!=n.trim()&&""!=i.trim();if(item_choices={kintone_integrate_base_setting_kintone_url:e,app_id:a,kintone_integrate_base_setting_kintone_login_name:n,kintone_integrate_base_setting_kintone_password:i},event.clipboardData!==undefined){var o=event.clipboardData.getData("text/plain");s=s||""!=o.trim(),event.target.id=="app_id_"+t&&(isInteger=Number.isInteger(parseInt(o)),s=isInteger),["app_id"].forEach(function(e){event.target.id!=e+"_"+t&&""==item_choices[e].trim()&&(s=!1)}).kintone_integrate_base_setting_kintone_password.forEach(function(e){event.target.id!=e&&""==item_choices[e].trim()&&(s=!1)})}$("#"+t+" #get_app_info").attr("disabled",!s)})},handle_unique_checkbox_setting_item:function(){$(".setting_items").on("change",function(){var e=$(this).select2("data");if(e){var t=$(this).parents(".form-check").find(".form-check-input"),n=e.text,i=e.unique;t.attr("value",n),1==i?t.attr("disabled",!1):(t.prop("checked",!1),t.attr("disabled",!0))}})},handle_duplicate_option_setting_item:function(){$("input.setting_items").on("change",function(){App.front_kintone_integrate_base_settings.handle_check_duplicate_item()})},handle_mapping_params:function(){$("input.setting_items").on("change",function(){App.front_kintone_integrate_base_settings.handle_mapping_item_value(this)})},handle_render_setting_item:function(){$("input.setting_items").each(function(){var e=$(this).select2("data"),t=$(this).parents(".form-check").find(".form-check-input");e&&""!=$(this).val()&&1==e.unique?t.attr("disabled",!1):(t.prop("checked",!1),t.attr("disabled",!0))})},disable_default_radio:function(){$("input[type='radio']").filter(":checked").prop("checked",!1)},handle_btn_mapping_data:function(){["#tab-lead","#tab-company","#tab-department"].forEach(function(e){""!==$(e).val()&&$(e+" #mapping-api-test").attr("disabled",!1),$(e+" #item-data-mapping").on("change",function(){"disabled"==$(e+" #mapping-api-test").attr("disabled")&&$(e+" #mapping-api-test").attr("disabled",!1)})}),App.front_kintone_integrate_base_settings.disable_organization_tab(),$("#organization_id_tab-department").on("change",function(){""!=$(this).val()?$(this).parent().find("#test-api").attr("disabled",!1):$(this).parent().find("#test-api").attr("disabled",!0)}),$(".organizations_params").on("change",function(){$(this).find(":selected").text()==I18n.t("js.kintone_integrate_base_setting.prompt_select")?$("#organization_id_tab-department").parent().find("#test-api").attr("disabled",!0):$("#organization_id_tab-department").parent().find("#test-api").attr("disabled",!1)}),["#company_id_tab-company","#lead_id_tab-lead"].forEach(function(e){""!==$(e).val()&&$(e).parent().find("#test-api").attr("disabled",!1),$(e).on("change",function(){""!=$(this).val()?$(this).parent().find("#test-api").attr("disabled",!1):$(this).parent().find("#test-api").attr("disabled",!0)})})},handle_tab_organization:function(){$("#organization_id_tab-department"
).on("change",function(){if(url="/kintone_integrate_base_settings/organization_test ",data=$("#organization_id_tab-department").val(),""==data)return $(".organizations_params").html('<option value="">'+I18n.t("js.kintone_integrate_base_setting.prompt_select")+"</option>"),void App.front_kintone_integrate_base_settings.handle_change_integration_test_item("organization_id","tab-department");$.ajax({type:"POST",url:url,data:{client_organization:data}}).done(function(e){options="",e.results.forEach(function(e){options+='<option value="'+e.id+'">'+e.name+"</option>"});var t='<option value="">'+I18n.t("js.kintone_integrate_base_setting.prompt_select")+"</option>";$(".organizations_params").html(options),$(".organizations_params").prepend(t),App.front_kintone_integrate_base_settings.disable_organization_tab(),App.front_kintone_integrate_base_settings.handle_change_integration_test_item("organization_id","tab-department")})})},disable_organization_tab:function(){$(".organizations_params").find(":selected").text()==I18n.t("js.kintone_integrate_base_setting.prompt_select")||""==$("#organization_id_tab-department").val()?$("#organization_id_tab-department").parent().find("#test-api").attr("disabled",!0):$("#organization_id_tab-department").parent().find("#test-api").attr("disabled",!1)},handle_check_duplicate_item:function(){var e=$(".select-tab-app").find(".active").find("input").attr("tab");all_items=JSON.parse($("#value_app_data_"+e).val()),items_include_value=[],$("input.setting_items_"+e).each(function(){var t=$(this).select2("data");null!=t&&(1==t.unique&&$(this).parents(".form-check").find(".form-check-input").attr("value",t.text),all_items=all_items.filter(function(e){return e.text!==t.text&&e.text!==I18n.t("js.kintone_integrate_base_setting.blank_value")}))}),$("input.setting_items_"+e).each(function(){(t=$(this).select2("data"))&&""!=$(this).val()&&1==t.unique&&items_include_value.push($(this));var e=$(this).select2("data"),t=[{id:"",text:I18n.t("js.kintone_integrate_base_setting.blank_value")}].concat(all_items);$(this).select2({data:t,width:"400%"}),$(this).select2("data",e)}),$("input[type='radio']:visible").filter(":checked").val()==undefined&&0<items_include_value.length&&items_include_value[0].parents(".form-check").find(".form-check-input").prop("checked",!0)},handle_change_tab_error:function(e){for(var t in App.front_kintone_integrate_base_settings.change_tab(e),tabs=["tab-company","tab-department","tab-lead"],tabs)tabs[t]==e?$("#search_search_type_"+ ++t).parents(".radio_tab").addClass("active"):$("#search_search_type_"+ ++t).parents(".radio_tab").removeClass("active")},handle_change_integration_test_item:function(e,t){value_integration_test=$("#"+e+"_"+t).val();var n=!0;"tab-department"==t&&(n=$(".organizations_params :selected").text()!==I18n.t("js.kintone_integrate_base_setting.prompt_select")),value_integration_test&&""!=value_integration_test&&value_integration_test!=undefined&&n?App.front_kintone_integrate_base_settings.connect_api("api_test","mapping_item"):($("#"+t+" #item-list-test").hide(),$("#"+t+" #app-infor").hide(),$(".loader").hide())},handle_mapping_item_value:function(e){var t=$(e).select2("data");if(t){var n=$(e).parents(".select-mapping-item").find(".item-hot-profile").attr("name"),i=t.text,a=$(".select-tab-app").find(".active").find("input").attr("tab"),s=jQuery.parseJSON($("#mapping_item_hidden_"+a).val());i==I18n.t("js.kintone_integrate_base_setting.blank_value")?delete s[n]:(1==t.unique&&(s.unique_kintone_integrate_base_settings&&0<s.unique_kintone_integrate_base_settings.length?s.unique_kintone_integrate_base_settings.includes(i)||s.unique_kintone_integrate_base_settings.push(i):(s.unique_kintone_integrate_base_settings=[],s.unique_kintone_integrate_base_settings.push(i))),s[n]=i),s.unique_kintone_integrate_base_settings!=undefined&&s.unique_kintone_integrate_base_settings.forEach(function(e,t){Object.values(s).includes(e)||s.unique_kintone_integrate_base_settings.splice(t,1)}),$("#mapping_item_hidden_"+a).val(JSON.stringify(s))}},handle_reload_records_api:function(e){$("#mapping_item_hidden_"+e).val("{}"),$("#"+e+" input.setting_items").each(function(){App.front_kintone_integrate_base_settings.handle_mapping_item_value(this)})},handle_submit_form_kintone_integrate_base_settings:function(){$("#kintone_integaret_base_setting_form").submit()}},App.lead_filters={is_reload_lead_filter_modal:!0,is_reload_lead_additional_modal:!0,is_updated_added_leads:!1,revive_placeholder:function(e){e.find(".ah_placeholder").blur()},clear_form:function(e){$("#target-search-tags-basic").find(".select2-search-choice").remove(),$("#target-search-tags-basic .select2-search-field span").removeClass("place-holder-hide"),e.find(".hp-lead-filter-panel-default").find(":input").not("input[name='_method']").not("input[name='authenticity_token']").not(":checkbox").not(".non_clear").val(""),e.find(":checked").prop("checked",!1),e.find("[data-hp-role='select2'], [data-hp-role='select-search']").change(),e.find("[data-hp-role='custom_search_condition']").val("included_in"),e.find(".remove_nested_fields").click()},reset_form:function(e){e.get(0).reset(),$(document).find(".hp-lead-filter-custom-section").attr("data-reset-flg","true"),e.find(".remove_nested_fields").click();var t=e.find(".custom_search_form"),n=$(document).attr("data-defalut-custom-search");$.ajax({type:"PATCH",url:t.attr("action"),data:n,success:function(){$(document).find(".hp-lead-filter-custom-section").attr("data-reset-flg",""),App.lead_filters.is_reload_lead_filter_modal=!0},error:function(){alert(I18n.t("js.lead_filters.communication_failed"))}}),e.find("[data-hp-role='select2'], [data-hp-role='select-search']").change()},lead_filter_search_switch:function(e){$(document).find(".hp-lead-filter-custom-section").attr("data-search-mode",e),"true"==e?($(".hp-page-lead-default-search").hasClass("active")&&($(".hp-page-lead-custom-search").addClass("active"),$(".hp-page-lead-default-search").removeClass("active")),$(".hp-lead-filter-panel-default").addClass("hidden"),$(".hp-lead-filter-panel-custom").removeClass("hidden")):"false"==e&&($(".hp-page-lead-custom-search").hasClass("active")&&($(".hp-page-lead-default-search").addClass("active"),$(".hp-page-lead-custom-search").removeClass("active")),$(".hp-lead-filter-panel-custom").addClass("hidden"),$(".hp-lead-filter-panel-default").removeClass("hidden"))},custom_lead_filter_model_change:function(e){var t=e.closest(".custom-lead-filter-record"),n=$.extend({},$(e).data("customLeadFilterParams"));n[$(e).data("customLeadFilterParamName")]=$(e).val(),t.find("input").attr("disabled","disabled"),$.ajax({type:"PATCH",url:t.attr("action"),data:n,success:function(){},error:function(){t.find("input").removeAttr("disabled"),alert(I18n.t("js.lead_filters.communication_failed"))}})},custom_lead_filter_default_set:function(e){$(document).attr("data-defalut-custom-search",e.serialize())},remove_placeholder_values:function(e){e.find(".ah_placeholder").each(function(e,t){$(t).val()===$(t).data("placeholder-string")&&$(t).val("")}),e.find("[data-hp-role='select2'], [data-hp-role='select-search']").change()},reload_lead_filter_form:function(e){App.concerns.attach_date_picker_handlers(e),App.concerns.attach_date_time_picker_handlers(e),App.concerns.attach_select_search_handlers(e),e.find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-lead-filter","#lead_filter_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_lead_filter"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_lead_filter","#target-search-tags-basic","#lead_filter_tag_ids")},lead_filter_modal:function(e,t){function n(){return"true"==w.val()}function i(){w.val("true"),l.trigger("confirmed.lead-filter")}function a(){A.not("#scenario_action_count_no_data").addClass("hide"),v.not("#scenario_action_count").removeClass("hide")}function s(){A.not("#scenario_action_count_no_data").removeClass("hide"),v.not("#scenario_action_count").addClass("hide")}function o(){b.children().appendTo(c),App.lead_filters.lead_filter_search_switch($("input[name='lead_filter[custom_mode]']:checked").val()),null==$(document).attr("data-defalut-custom-search")&&App.lead_filters.custom_lead_filter_default_set(c)}function r(){c.children().appendTo(b)}t===undefined&&(t="");var l=e.find("[data-hp-role='lead-filter-modal"+t+"']"),c=l.find(".modal-body").find("form"),d=l.find("[data-hp-role='decision']"),u=l.find("[data-hp-role='individual-decision']"),_=l.find("[data-hp-role='search']"),h=l.find("[data-hp-role='clear']"),p=l.find("[data-hp-role='reset']"),f=l.find("[data-hp-role='lead_filter_search_switch']"),m=l.find(".hp-lead-filter-panel-custom"),g=l.find("[data-hp-custom-role='custom_search_model_select']"),A=e.find("[data-hp-role='lead-filter-control-nodata']"),v=e.find("[data-hp-role='lead-filter-control-show']"),b=(v.find("a").first(),e.find("[data-hp-role='lead-filter-data']")),y=e.find("[data-hp-role='lead-filter-confirm']"),w=y.children("input[type='hidden']").first(),k=c.find('[data-hp-form="lead_filter"]');w.size()<=0&&(w=$("<input>").attr({type:"hidden",name:"leadFilterConfirmed",value:!1}),y.append(w)),$("#new_lead_filter").length&&(App.concerns.get_modal_to_lead_search_save("#new_lead_filter"),App.concerns.get_modal_to_lead_search_call("#new_lead_filter")),$("#edit_lead_filter").length&&(App.concerns.get_modal_to_lead_search_save("#edit_lead_filter"),App.concerns.get_modal_to_lead_search_call("#edit_lead_filter")),l.modal({show:!1}),r(),n()?a():s(),$(document).on("nested:fieldAdded",function(e){var t=$(e.currentTarget.activeElement);$(".target_leads_custom_search_form").find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),$(".target_leads_custom_search_form").find(".ah_placeholder").each(function(e,t){$(t).val()===$(t).data("placeholder-string")&&$(t).val("")}),$(".target_leads_custom_search_form").find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),t.data("limit")&&t.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count()>=t.data("limit")&&t.hide()}),$(document).on("nested:fieldRemoved",function(){var e=m.find("a.add_nested_fields"),t=$(document).find(".hp-lead-filter-custom-section").attr("data-reset-flg"),n=$(document).find(".hp-lead-filter-custom-section").attr("data-search-mode");e.data("limit")&&(e.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count()<e.data("limit")&&e.show(),e.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count()==0&&"true"!==t&&"true"==n&&e.click())}),$(document).on("nested:fieldRemoved",function(){var e=$(document).find("#seminar-mail-reject-setting-edit a.add_nested_fields");e.data("limit")&&e.siblings(".fields:visible").length+App.lead_filters.load_mail_reject_custom_lead_filter_count()<e.data("limit")&&e.show()}),l.on("show.bs.modal",function(){o()}),l.on("hide.bs.modal",function(e){e.target===l.get(0)&&(l.find(".collapse.in").collapse("hide"),r(),$("#js_lead_search_registration_success_message").html(""))}),l.on("confirmed.lead-filter",function(){a()}),l.on("unconfirmed.lead-filter",function(){s()}),d.click(function(){App.lead_filters.post_form(c,c.attr("data-hp-validation-href"),12e4,function(){App.lead_filters.is_reload_lead_filter_modal&&(i(),_.click(),App.lead_filters.custom_lead_filter_default_set(c),l.modal("hide"),App.lead_filters.is_reload_lead_filter_modal=!1)})}),u.click(function(){App.lead_filters.post_form(c,c.attr("data-hp-individual-validation-href"),12e4,function(){App.lead_filters.is_reload_lead_filter_modal&&(i(),_.click(),App.lead_filters.custom_lead_filter_default_set(c),l.modal("hide"),App.lead_filters.is_reload_lead_filter_modal=!1)})}),_.on("click",function(){$(this).prop("disabled",!0),h.prop("disabled",!0),App.lead_filters.post_form(c,c.prop("action"),12e4,function(){h.prop("disabled",!1),_.prop("disabled",!1)})}),h.on("click",function(){seach_mode=$("input[name='lead_filter[custom_mode]']:checked").val(),$(document).find(".hp-lead-filter-custom-section").attr("data-search-mode",seach_mode),App.lead_filters.clear_form(c),_.trigger("click"),$("input[name='lead_filter[custom_mode]").val([seach_mode]),"false"==seach_mode&&m.find(".add_nested_fields").click()}),p.on("click",function(){App.lead_filters.reset_form(c)}),k.on("reload",function(){App.lead_filters.reload_lead_filter_form(k)}),f.on("change",function(){App.lead_filters.lead_filter_search_switch($(this).val())}),g.select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),l.on("shown.bs.modal",function(){App.lead_filters.is_reload_lead_filter_modal&&(_.click(),App.lead_filters.is_reload_lead_filter_modal=!1),g.select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),App.lead_filters.lead_filter_search_switch($("input[name='lead_filter[custom_mode]']:checked").val()),App.target_list_tags_search.init_suggest("target-search-tags-basic"+t,"target-search-tags-pulldown-basic"+t),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-lead-filter"+t,"#lead_filter_tag_ids"+t,"/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_lead_filter"+t),App.concerns.lead_tags_modal_selection("#lead_tag_selection_lead_filter"+t,"#target-search-tags-basic"+t,"#lead_filter_tag_ids"+t),App.target_list_tags_search.bind_suggest_events(),$("#modalsearchBusinessCardsLeadTags").on("hidden.bs.modal",function(){$("#target-extraction").is("[aria-hidden=false]")&&$("body").addClass("modal-open")}),$("#modalsearchBusinessCardsLeadTags").on("shown.bs.modal",function(){$(".modal-backdrop").last().css("z-index",9998)})})},post_form:function(e,t,n,i){var a=new App.concerns.loading_indicator(e);$("#js_lead_search_registration_success_message").html(""),this.remove_placeholder_values(e),a.begin(),$.ajax({url:t,type:"POST",data:e.serialize(),timeout:n,dataType:"script"}).done(function(e){i(e)}).fail(function(e,t){"timeout"==t?a.timeout():a.error()}).always(function(){App.lead_filters.revive_placeholder(e),a.finish(),App.tooltip.display_tooltip()})},lead_additional_modal:function(e){var t=e.find("[data-hp-role='lead-filter-addition-modal']"),n=t.find(".modal-body").find("form"),i=e.find("[data-hp-role='lead-filter-control-edit']").find("a").first(),a=(t.find("[data-hp-target='leads-table-cold']"),t.find("[data-hp-target='leads-table-hot']")),s=n.find("input[type='hidden'][name='append_all']").first(),o={timeout_message:I18n.t("js.lead_filters.timeout"),error_message:I18n.t("js.lead_filters.load_error")},r=new App.concerns.loading_indicator(e,o);s.size()<=0&&(s=$("<input>").attr({type:"hidden",name:"append_all",value:!1}),n.prepend(s)),a.find(":checkbox").prop("checked",!1),i.on("click",function(){}),n.on("submit",function(e){e.preventDefault(),r.begin(),$.ajax({url:n.prop("action"),type:n.attr("method"),data:n.serialize(),timeout:12e4,dataType:"script"}).done(function(){}).fail(function(e,t){"timeout"==t?r.timeout():r.error()}).always(function(){r.finish()})}),a.on("change","[data-hp-role='check-all']",function(){s.val("false"),a.find(":checkbox").prop("checked",$(this).prop("checked"))}),a.on("click","[data-hp-role='add-all']",function(){s.val("true"),n.submit(),s.val("false")}),a.on("click","[data-hp-role='add-checked']",function(){a.find(":checkbox:checked").size()<=0?alert(I18n.t("js.lead_filters.select_lead")):n.submit()}),t.on("shown.bs.modal",function(){App.lead_filters.is_reload_lead_additional_modal&&($("<input>").attr({type:"hidden",name:"reload",value:"true"}).appendTo(n),n.submit(),n.find("[name=reload]").remove(),App.lead_filters.is_reload_lead_additional_modal=!1)})},lead_search_modal:function(n){function i(){return function(e){var t=t||$(e.target).data("show-lead-params")||"";if(""!==t){$("#client-container").find("#campaigns-lead-filter-search").html(t),App.front_campaigns.attach_input_handlers($("#client-container"),function(){}),App.target_list_tags_search.init_suggest("client-container #target-search-tags-basic-campaign-targets","client-container #target-search-tags-pulldown-basic-campaign-targets"),App.concerns.lead_tags_modal("#client-container #open-business-card-lead-tags-campaign-targets","#client-container #campaign_targets_lead_filter_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_lead_filter_targets"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_lead_filter_targets","#client-container #target-search-tags-basic-campaign-targets","#client-container #campaign_targets_lead_filter_tag_ids"),$("#client-container").find("[data-hp-role='lead_filter_search_switch']").on("change",function(){var e={rootSelector:"#client-container"};App.lead_filters.lead_filter_search_switch_by_selector($(this).val(),e)});var n=$("[data-hp-custom-role='custom_search_model_select']");n.select2({minimumResultsForSearch:20}),n.select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),s.off("click"),s.on("click",function(){a.submit()})}var i=$(this).data("filterTarget");$("#client-container").find("input[name=filter_condition]").val(i),a.find(".hp-lead-filter-panel-special").remove(),$("#campain_tab_2").click(),s.click()}}var e=n.find("[data-hp-role='lead-search-form']"),a=e.find("form"),s=e.find("[data-hp-role='search']"),t=e.find("[data-hp-role='clear']"),o=n.find("[data-hp-target='leads-table-search']"),r=new App.concerns.loading_indicator(n),l=n.find("[data-hp-role='lead-status-praph-filter-form']"),c=l.find("form"),d=l.find("[data-hp-role='apply-filter']"),u=l.find("[data-hp-role='clear']"),_=n.find(".campaigns-lead-graph-search-filter-section-wrapper").find("[data-hp-role='filter']"),h=$("#client-container").find("[data-hp-role='filter']");_.on("click",i()),d.on("click",function(){c.submit()}),u.on("click",function(){$(this).prop("disabled",!0),c.data("processing")||(c.data("processing",!0),App.lead_filters.clear_form_by_root_selector(c,"#summary-container","-campaign-summary"),c.find("input[name=filter_condition]").val(""),c.submit())}),c.on("submit",function(e){$(this).prop("action");e.preventDefault(),r.begin(),$.ajax({url:c.prop("action"),type:c.attr("method"),data:c.serialize(),timeout:6e4,dataType:"script"}).done(function(){var e=n.find(".campaigns-lead-graph-search-filter-section-wrapper").find("[data-hp-role='filter']"),t=$(".campaigns-lead-graph-search-filter-section-wrapper").find("[data-hp-role='filter']").data("show-lead-params");e.off("click"),e.on("click",i(t))}).fail(function(e,t){"timeout"==t?r.timeout():r.error()}).always(function(){r.finish()})}),a.on("submit",function(e){a.prop("action");e.preventDefault(),r.begin(),$.ajax({url:a.prop("action"),type:a.attr("method"),data:a.serialize(),timeout:12e4,dataType:"script"}).done(function(){}).fail(function(e,t){"timeout"==t?r.timeout():r.error()}).always(function(){r.finish()})}),o.on("change","[data-hp-role='check-all']",function(){o.find(":checkbox").prop("checked",$(this).prop("checked"))}),s.on("click",function(){a.submit()}),t.on("click",function(){$(this).prop("disabled",!0),a.data("processing")||(a.data("processing",!0),seach_mode=$("#client-container").find("input[name='lead_filter[custom_mode]']:checked").val(),App.lead_filters.clear_form_by_root_selector(a,$("#client-container"),"-campaign-targets"),a.find("input[name=filter_condition]").val(""),a.find(".hp-lead-filter-panel-special").remove(),a.submit(),$("#client-container").find("input[name='lead_filter[custom_mode]']").val([seach_mode]),"false"==seach_mode&&a.find(".add_nested_fields").click())}),h.on("click",function(){var e=$("#client-container").find("[data-hp-role='lead-search-form']").find("form"),t=$(this).data("filterTarget");$("#client-container").find("input[name=filter_condition]").val(t),e.submit()})},target_extraction_condition_modal:function(e){var n=e.find("[data-hp-role='target-extraction-condition-modal']"),t=n.find("[data-hp-role='copy-button']"),i=window.getSelection();t.on("click",function(){0<i.rangeCount&&i.removeAllRanges();var e=document.createRange(),t=n.find("[data-hp-role='copy']").get(0);e.selectNode(t),i.addRange(e)})},seminars_mail_reject_edit:function(){var e=$(document).find("#seminar-mail-reject-setting-edit a.add_nested_fields");e.data("limit")&&e.siblings(".fields:visible").length+App.lead_filters.load_mail_reject_custom_lead_filter_count()>=e.data("limit")&&e.hide()},modal_seminars_mail_reject:function(e){var n=e.find("[data-hp-role='target-extraction-condition-modal-seminars']"),t=n.find("[data-hp-role='copy-button']"),i=window.getSelection();t.on("click",function(){0<i.rangeCount&&i.removeAllRanges();var e=document.createRange(),t=n.find("[data-hp-role='copy']").get(0);e.selectNode(t),i.addRange(e)})},apply_leads_count:function(){var e=$('.hp-page [data-hp-role="lead-filter-num"]').not("#scenario_action_lead_filter_num"),t=parseInt(e.data("lead-id-counts")||0)+parseInt(e.data("cold-lead-id-counts")||0)+parseInt(e.data("current-leads-counts")||0);e.text(App.concerns.number_with_delimiter(t))},apply_target_leads_count:function(){var e=$('.hp-page [data-hp-resource="lead-filter-num"]'),t=parseInt(e.data("lead-id-counts")||0);e.text(App.concerns.number_with_delimiter(t))},new_lead_merge:function(e,t){var n=$('.hp-page [data-hp-role="lead-filter-num"]');$("[name='lead_filter[added_lead_ids]']").each(function(){$(this).val(t).change()}),n.data("lead-id-counts",parseInt(e)),this.apply_leads_count()},cold_lead_merge:function(e,t){var n=$('.hp-page [data-hp-role="lead-filter-num"]');$("[name='lead_filter[colded_lead_ids]']").each(function(){$(this).val(t)}),n.data("cold-lead-id-counts",parseInt(e)),this.apply_leads_count()},all_checked_items:function(e,t){e=void 0!==e?e:"#lead_search_table_all_check",t=void 0!==t?t:".lead_search_table_add_check";$(document).on("click",e,function(){$(t).prop("checked",$(this).is(":checked"))})},load_custom_search_form_count:function(){var e=0,t=0,n=0,i=0;return $(".hp-lead-filter-custom-section").find(".custom_search_form").find(".fields").each(function(){++e,"none"==$(this).css("display")&&++t}),$(".hp-lead-filter-custom-section").find(".custom_search_form_load").find(".fields").each(function(){++n,"none"==$(this).css("display")&&++i}),0!=e&&n-i==0?e-t==0?$(".hp-lead-filter-custom-section").find(".custom_search_form").find(".fields").length-t:e:n-i},load_mail_reject_custom_lead_filter_count:function(){var e=0,t=0,n=0,i=0;return $("#seminar-mail-reject-setting-edit").find(".custom_search_form").find(".fields").each(function(){++e,"none"==$(this).css("display")&&++t}),$("#seminar-mail-reject-setting-edit").find(".custom_search_form_load").find(".fields").each(function(){++n,"none"==$(this).css("display")&&++i}),0!=e&&n-i==0?e-t==0?$("#seminar-mail-reject-setting-edit").find(".custom_search_form").find(".fields").length-t:e:n-i},reload_custom_lead_filter_record:function(e,t,n){var i=$(".hp-lead-filter-panel-custom"),a="[data-hp-custom-lead-filter-index="+e+"]";if(0==i.find(a).length){var s='<div class="fields"> <div action="/xhr/lead_filters/render_custom_lead_filter/" class="row custom-lead-filter-record" data-hp-custom-lead-filter-index='+e+"> </div>";i.find(".custom_search_form_load").append(s)}i.find(a).html(t),!1===n&&i.find(a).parent(".fields").show()},scenario_mail_lead_filter_modal:function(e){function t(){f.val("true"),o.trigger("confirmed.lead-filter")}function n(e){var t=$(e.currentTarget.activeElement);if(t.parents("#story-mail-target-extraction-modal").length<1)return!1;if($("#story-mail-target-extraction-modal").find(".target_leads_custom_search_form").find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),$("#story-mail-target-extraction-modal").find(".target_leads_custom_search_form").find(".ah_placeholder").each(function(e,t){$(t).val()===$(t).data("placeholder-string")&&$(t).val("")}),$("#story-mail-target-extraction-modal").find(".target_leads_custom_search_form").find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),t.data("limit")){var n={section:"#story-mail-target-extraction-modal .hp-lead-filter-custom-section"};t.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count_by_selector(n)>=t.data("limit")&&t.hide()}}function i(e){var t=$(e.currentTarget.activeElement);if(t.parents("#story-mail-target-extraction-modal").length<1)return!1;if($("#story-mail-target-extraction-modal").find(".target_leads_custom_search_form").find("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),$("#story-mail-target-extraction-modal").find(".target_leads_custom_search_form").find(".ah_placeholder").each(function(e,t){$(t).val()===$(t).data("placeholder-string")&&$(t).val("")}),$("#story-mail-target-extraction-modal").find(".target_leads_custom_search_form").find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),t.data("limit")){var n={section:"#story-mail-target-extraction-modal .hp-lead-filter-custom-section"};t.siblings(".fields:visible").length+App.lead_filters.load_custom_search_form_count_by_selector(n)>=t.data("limit")&&t.hide()}}function a(){$("#target-extraction").is("[aria-hidden=false]")&&$("body").addClass("modal-open")}function s(){$(".modal-backdrop").last().css("z-index",9998)}var o=e.find("[data-hp-role='lead-filter-modal']"),r=o.find(".modal-body").find("form"),l=o.find("[data-hp-role='decision']"),c=o.find("[data-hp-role='search']"),d=o.find("[data-hp-role='clear']"),u=o.find("[data-hp-role='lead_filter_search_switch']"),_=o.find(".hp-lead-filter-panel-custom"),h=o.find("[data-hp-custom-role='custom_search_model_select']"),p=e.find("[data-hp-role='lead-filter-confirm']"),f=p.children("input[type='hidden']").first(),m=r.find('[data-hp-form="lead_filter"]');f.size()<=0&&(f=$("<input>").attr({type:"hidden",name:"leadFilterConfirmed",value:!1}),p.append(f)),$("#new_lead_filter").length&&($(document).off("click","#lead_search_save"),$(document).off("click",".lead_search_call"),App.concerns.get_modal_to_lead_search_save("#new_lead_filter"),App.concerns.get_modal_to_lead_search_call("#new_lead_filter")),$("#edit_lead_filter").length&&($(document).off("click","#lead_search_save"),$(document).off("click",".lead_search_call"),App.concerns.get_modal_to_lead_search_save("#edit_lead_filter"),App.concerns.get_modal_to_lead_search_call("#edit_lead_filter")),o.modal({show:!1}),$(document).off("nested:fieldAdded",n),$(document).on("nested:fieldAdded",n),$(document).off("nested:fieldRemoved",i),$(document).on("nested:fieldRemoved",i),l.click(function(){App.lead_filters.post_form(r,r.attr("data-hp-validation-href"),12e4,function(){App.lead_filters.is_reload_lead_filter_modal&&(t(),c.click(),App.lead_filters.custom_lead_filter_default_set(r),o.modal("hide"),App.lead_filters.is_reload_lead_filter_modal=!1,storyFunctions.draw())})}),c.on("click",function(){$(this).prop("disabled",!0),d.prop("disabled",!0),App.lead_filters.post_form(r,r.prop("action"),6e4,function(){c.prop("disabled",!1),d.prop("disabled",!1)})}),d.on("click",function(){seach_mode=$("#story-mail-target-extraction-modal").find("input[name='lead_filter[custom_mode]']:checked").val(),$("#story-mail-target-extraction-modal").find(".hp-lead-filter-custom-section").attr("data-search-mode",seach_mode),App.lead_filters.clear_form_by_root_selector(r,"#story-mail-target-extraction-modal","-story"),c.trigger("click"),$("#story-mail-target-extraction-modal").find("input[name='lead_filter[custom_mode]']").val([seach_mode]),"false"==seach_mode&&_.find(".add_nested_fields").click(),$("a.add_nested_fields").show()}),m.on("reload",function(){App.lead_filters.reload_lead_filter_form(m)}),u.on("change",function(){var e={rootSelector:"#story-mail-target-extraction-modal"};App.lead_filters.lead_filter_search_switch_by_selector($(this).val(),e)}),h.select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),o.on("hidden.bs.modal",function(){$("#summary-container #target-search-tags-basic #s2id_autogen3").trigger("blur"),$("#client-container #target-search-tags-basic #s2id_autogen3").trigger("blur"),$(document).off("nested:fieldAdded",n),$(document).off("nested:fieldRemoved",i),$("#modalsearchBusinessCardsLeadTags").off("hidden",a),$("#modalsearchBusinessCardsLeadTags").off("shown",s)}),o.on("shown.bs.modal",function(){App.lead_filters.is_reload_lead_filter_modal&&(c.click(),App.lead_filters.is_reload_lead_filter_modal=!1),h.select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))});var e={rootSelector:"#story-mail-target-extraction-modal"};App.lead_filters.lead_filter_search_switch_by_selector($(e.rootSelector).find("input[name='lead_filter[custom_mode]']:checked").val(),e),App.target_list_tags_search.init_suggest("story-mail-target-extraction-modal #target-search-tags-basic-story","story-mail-target-extraction-modal #target-search-tags-pulldown-basic-story"),App.concerns.lead_tags_modal("#story-mail-target-extraction-modal #open-business-card-lead-tags-story","#story-mail-target-extraction-modal #story_lead_filter_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_lead_filter_story_mail"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_lead_filter_story_mail","#story-mail-target-extraction-modal #target-search-tags-basic-story","#story-mail-target-extraction-modal #story_lead_filter_tag_ids"),$("#story-mail-target-extraction-modal").on("hidden.bs.modal",function(){$("#story-mail-target-extraction-modal").remove()}),App.target_list_tags_search.bind_suggest_events(),$("#modalsearchBusinessCardsLeadTags").off("hidden",a),$("#modalsearchBusinessCardsLeadTags").on("hidden.bs.modal",a),$("#modalsearchBusinessCardsLeadTags").off("shown",s),$("#modalsearchBusinessCardsLeadTags").on("shown.bs.modal",s)}),$(document).on("click",".remove_nested_fields",function(){$("a.add_nested_fields").show()})},load_custom_search_form_count_by_selector:function(e){var t=(e=e||{}).section||".hp-lead-filter-custom-section",n=e.form||".custom_search_form",i=e.form||".fields",a=0,s=0,o=0,r=0;return $(t).find(n).find(i).each(function(){++a,"none"==$(this).css("display")&&++s}),$(t).find(n).find(i).each(function(){++o,"none"==$(this).css("display")&&++r}),0!=a&&o-r==0?a-s==0?$(t).find(n).find(i).length-s:a:o-r},lead_filter_search_switch_by_selector:function(e,t){var n=(t=t||{}).rootSelector||document,i=t.customSection||".hp-lead-filter-custom-section",a=t.defaultSearch||".hp-page-lead-default-search",s=t.customSearch||".hp-page-lead-custom-search",o=t.panelDefault||".hp-lead-filter-panel-default",r=t.panelCustom||".hp-lead-filter-panel-custom";$(n).find(i).attr("data-search-mode",e),"true"==e?($(n).find(a).hasClass("active")&&($(n).find(s).addClass("active"),$(n).find(a).removeClass("active")),$(n).find(o).addClass("hidden"),$(n).find(r).removeClass("hidden")):"false"==e&&($(n).find(s).hasClass("active")&&($(n).find(a).addClass("active"),$(n).find(s).removeClass("active")),$(n).find(r).addClass("hidden"),$(n).find(o).removeClass("hidden"))},clear_form_by_root_selector:function(e,t,n){null==n&&(n=""),t=t||document,$(t).find("#target-search-tags-basic"+n).find(".select2-search-choice").remove(),$(t).find("#target-search-tags-basic"+n+" .select2-search-field span").removeClass("place-holder-hide"),e.find(".hp-lead-filter-panel-default").find(":input").not("input[name='_method']").not("input[name='authenticity_token']").not(":checkbox").not(".non_clear").val(""),e.find(":checked").prop("checked",!1),e.find("[data-hp-role='select2'], [data-hp-role='select-search']").change(),e.find("[data-hp-role='custom_search_condition']").val("included_in"),e.find(".remove_nested_fields").click()}},App.front_leads={index:function(){function t(e){for(var t=e+"=",n=decodeURIComponent(document.cookie).split(";"),i=0;i<n.length;i++){for(var a=n[i];" "===a.charAt(0);)a=a.substring(1);if(0===a.indexOf(t))return a.substring(t.length,a.length)}return""}function e(e,t,n){var i=new Date;i.setDate(i.getDate()+n);var a=e+"="+t+"; expires="+i.toUTCString()+"; path=/";document.cookie=a}App.concerns.disable_buttons_submit_custom(".js-disable-btn","#btn-clear-form"),App.concerns.disable_duplicate_request_search_form("#form_search_leads",".js-disable-btn"),App.concerns.disable_duplicate_request_clear_form("leads"),App.front_deals.all_checked_items_modal_deals_index(),
App.concerns.load_objects(this),App.concerns.change_display_number("form_search_leads"),App.concerns.change_order("form_search_leads"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),App.concerns.all_checked_items(),App.concerns.set_form_action_to_submit("#form_checked_leads",".checked_submit",!0),App.concerns.select_search("lead_owner_user_id"),$("#search_pref_ids").select2(),$("#search_interest_product_type_ids").select2(),App.front_segments.set_segment_select2("#search_segment_ids"),$("#search_client_rank").select2(),$("#search_lead_stage").select2(),$("#search_industry_kbn").select2({width:"100%"}),$("#search_business_category_kbn").select2({width:"100%"}),$("#search_worker_number_kbn").select2({width:"100%"}),$(".search_clients_items_select2").select2({width:"100%"}),$("#search_jsic_business_category_kbns").select2({width:"100%"}),App.concerns.select_search("search_client_id"),App.concerns.select_search_disable_user("search_owner_user_ids"),App.concerns.select_search_disable_user("search_user_ids"),App.concerns.select_search("campaign_ids"),App.concerns.select_search("target_list_ids"),App.concerns.select_search("web_form_ids"),App.concerns.select_search("inside_sales_ids");var n=$("#lead_index_items_type_user_ids").val().split(" ");if($.each(n,function(e,t){App.concerns.select_search_disable_user("search_items__"+t+"_item_user_ids")}),$("#lead_edit_items_type_user_ids")[0]){n=$("#lead_edit_items_type_user_ids").val().split(" ");$.each(n,function(e,t){App.concerns.select_search("item_values_"+t)})}$("#search_lead_source_kbn_ids").select2({width:"100%",placeholder:I18n.t("js.common.lead_source")}),$("#search_lead_status").select2({width:"100%",placeholder:I18n.t("js.common.lead_status")}),this.change_client_index(),App.tags_bulk_deletion_visible_fields.init_tags("form_checked_leads"),this.ajax_load(),App.concerns.datepicker(".search_datepicker"),App.concerns.set_item_id(),App.concerns.enable_csv_export_event("#form_search_leads","checked[lead_ids][]"),$("#js_submit_checked_mail").on("click",function(e){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1}),$("#js_submit_search_mail").on("click",function(e){if(0==$('[name="checked[lead_ids][]"]').length)return alert(I18n.t("js.common.serch_result_none")),e.stopImmediatePropagation(),!1}),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){$(".btn-group.open").removeClass("open"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none");var e=App.concerns.set_form_action("form_checked_leads",$(this).data("action"),$(this).data("remote"));return"js_submit_search_mail"===$(this).attr("id")?$("#js_search_mail").prop("disabled",!1):$("#js_search_mail").prop("disabled",!0),e.submit(),!1}),$("#js_submit_checked_map").on("click",function(e){e.preventDefault(),$("#js_error_message").empty();var t=$("#form_checked_leads");if(0!==t.find("input:checkbox:checked").length){var n=$(this).data("action");t.removeAttr("data-remote"),t.removeData("remote"),t.attr("action",n),t.attr("target","_blank"),t.submit(),setTimeout(function(){t.removeAttr("target")},100)}else{var i='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.please_select")+"</li></ul></div>";$("#js_error_message").append(i)}}),$("#search_important_customer_flg").select2({width:"100%",placeholder:I18n.t("js.common.important_customer")}),$("#search_end_user_flg").select2({width:"100%",placeholder:I18n.t("js.common.end_user")}),$("#search_store_flg").select2({width:"100%",placeholder:I18n.t("js.common.store")}),$("#search_competitor_flg").select2({width:"100%",placeholder:I18n.t("js.common.competitor")}),$("#search_error_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.mail_error")}),$("#search_error_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.tel_error")}),$("#search_error_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.fax_error")}),$("#search_error_address_flg").select2({width:"100%",placeholder:I18n.t("js.common.address_error")}),$("#search_not_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_mail")}),$("#search_not_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_tel")}),$("#search_not_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_fax")}),$("#search_not_dm_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_dm")}),App.concerns.submit_when_changed_element("form_set_mail_template","js_change_element","convert"),App.visible_fields.setup_list_visible_setting(["name","client_id","post","organization_id"],"table.table-float-head"),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting($(this).data("title"),$(this).data("close-text"),$(this).data("alert-text"))}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.change_search_type(),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("update-all-modal-tags","update-all-modal-tag-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#update-all-modal-tags","#tags"),App.front_business_card_lead_tags.init_suggest("advanced-search-tags","advanced-search-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search","#search_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search","#advanced-search-tags","#search_tag_ids"),App.front_business_card_lead_tags.init_suggest("advanced-search-remove-tags","advanced-search-pulldown-remove-tags"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search-remove-tags","#search_remove_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search-remove-tags"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search-remove-tags","#advanced-search-remove-tags","#search_remove_tag_ids"),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids","","","",!0),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),$("#modalsearchBusinessCardsLeadTags").on("hidden.bs.modal",function(){($("#myModal").is("[aria-hidden=false]")||$("#modaltagsBulkDeletionVisibleFields").is("[aria-hidden=false]"))&&$("body").addClass("modal-open")}),$("#modalsearchBusinessCardsLeadTags").on("shown.bs.modal",function(){$(".modal-backdrop").last().css("z-index",9998)}),App.concerns.bulk_delete_lead_tags_modal("#open-business-card-lead-tags-search-modal","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal"),App.concerns.bulk_delete_lead_tags_modal_selection("#lead_tag_selection_bulk_delete"),$("#interest_product_type_ids").select2(),App.concerns.prevent_submit_pressing_enter(),App.concerns.set_form_action_to_submit("#form_checked_leads",".js_open_modal_update_all",!0),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.get_modal_to_search_save("#form_search_leads"),App.concerns.get_modal_to_search_call("#form_search_leads"),App.concerns.check_form_input("#myModal","#bulk_update"),this.check_form_input_user(),App.searches.callForSearchCondition.init(),App.concerns.focus_to_first_element(),this.change_button_actibity_by_role(),$(".checked_delete_submit").on("click",function(){$("#form_checked_leads").attr("action",$(this).attr("data-confirm-action")),$("#form_checked_leads").attr("data-remote",!0),$(this).attr("clicked",!0),$("#form_checked_leads").submit()}),$(document).on("change.segment_id","#search_segment_ids",function(){var e=$("#form_search_leads");e.find("#search_client_rank").val(""),e.find("#search_lead_stage").val(""),e.submit()}),$(document).ready(function(){$form=$("#form_search_leads"),$("#search_invisible_id_flg").val(!0),$form.data("remote",!0),action=$form.attr("action"),$form.attr("action",action+"index.js"),$form.submit(),$form.attr("action",action),$form.removeAttr("data-remote"),$form.removeData("remote"),$("#search_invisible_id_flg").val(null)}),App.tooltip.display_tooltip(),App.concerns.merge_resources("#form_merge_leads","lead"),App.front_leads.handle_duplicate();var i="leads";App.front_recommend.recommendScenarios(i),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id");var a=t("leads_note_method");a?$("#leads_note_method").val(a):(e("leads_note_method","1",365),$("#leads_note_method").val(t("leads_note_method")));$("#myModal").on("shown.bs.modal",function(){var e=t("leads_note_method");e&&0<$("#leads_note_method").length&&$("#leads_note_method").val(e)}),$("#bulk_update").on("click",function(){e("leads_note_method",$("#leads_note_method").val(),365)}),$(document).ready(function(){$("#note").on("input",function(){var e=$(this),t=e.val();5e3<(t=t.replace(/\n/g,"\r\n")).length&&(t=t.substring(0,5e3)),e.val(t)})})},show:function(){App.front_deals.all_checked_items_modal_deals_index(),App.concerns.set_form_action_to_submit("#form_search_index",".search_index",!0),App.concerns.set_form_action_to_submit("#form_search_index_task",".search_index_task",!0),App.concerns.set_form_action_to_submit("#form_search_index_web",".search_index_web",!0),this.set_relations_table(),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_task_submit",!0),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_daily_report_submit",!0),App.concerns.set_form_action_to_submit("#js_form_another_new","#js_add_deal_submit",!0),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.set_tooltip(),$(".js_submit_send_mail").on("click",function(){$(".open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));return $("#select_lead_id").val($(this).data("lead-id")),e.submit(),!1}),$(document).on("click","#get-list-all",function(){$(this).prop("disabled",!0);var e=$("#lead_id").val(),t=$("#client_id").val();$.ajax({url:"/xhr/leads/segment_lead_list_all",type:"GET",dataType:"script",data:{lead_id:e,client_id:t}})}),$(document).on("click","#get-update-history",function(){var e=$("#lead_id").val();$.ajax({url:"/xhr/leads/load_update_history",type:"GET",dataType:"script",data:{lead_id:e}})});var e=function(){if("block"===$(".user-information-show").css("display"))return $(".user-information-show").hide(),!1;var e=$(this).data("user-id"),t=$(this).offset().top,n=$(this).offset().left+$(this).width()/2;$("#position_top").val(t),$("#position_left").val(n),$("#user-information-form").attr("action","/xhr/user_communications/user_information_show/"+e),$("#user-information-form").submit()};$(document).on("mouseover",".update_history_user_information",e),$(window).on("mouseover",function(e){0<!$(e.target).closest(".user-information-show").length&&"block"===$(".user-information-show").css("display")&&$(".user-information-show").hide()}),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),App.concerns.toggle_print_target()},"new":function(){App.concerns.search_zip_code(),App.concerns.select_search_name("lead_client_id"),App.concerns.set_client_branch_form("lead_client_id"),App.concerns.set_organization_form("lead_client_id"),App.concerns.select_search("lead_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("lead_client_id"),this.change_client(),this.click_select_client(),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),this.submit_form("new_submit","new_lead"),App.concerns.datepicker(".datepicker"),$("#interest_product_type_ids").select2({width:"100%"}),App.concerns.set_associate_entity_to_s2("#lead_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("user_ids");var e=$("#lead_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)}),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#tag-field","#tags")},edit:function(){App.concerns.search_zip_code(),App.concerns.select_search_name("lead_client_id"),App.concerns.set_client_branch_form("lead_client_id"),App.concerns.set_organization_form("lead_client_id"),App.concerns.select_search("lead_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("lead_client_id"),this.change_client(),this.click_select_client(),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),this.submit_form("edit_submit","edit_lead"),App.concerns.datepicker(".datepicker"),$("#interest_product_type_ids").select2({width:"100%"}),App.concerns.hide_item_file_options(),App.concerns.set_associate_entity_to_s2("#lead_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("user_ids");var e=$("#lead_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)}),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#tag-field","#tags")},confirm:function(){App.concerns.search_zip_code(),App.concerns.select_search("lead_client_id"),App.concerns.select_search("lead_owner_user_id"),this.change_client(),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),this.submit_confirm("confirm_lead"),App.concerns.datepicker(".datepicker"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),$("#interest_product_type_ids").select2({width:"100%"})},create:function(){App.concerns.search_zip_code(),App.concerns.select_search_name("lead_client_id"),App.concerns.select_search("lead_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("lead_client_id"),this.change_client(),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),this.submit_form("new_submit","new_lead"),App.concerns.datepicker(".datepicker"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),$("#interest_product_type_ids").select2({width:"100%"}),App.concerns.set_associate_entity_to_s2("#lead_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("user_ids");var e=$("#lead_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)}),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#tag-field","#tags")},update:function(){App.concerns.search_zip_code(),App.concerns.select_search_name("lead_client_id"),App.concerns.select_search("lead_owner_user_id"),App.concerns.set_tooltip_to_select_search_client("lead_client_id"),this.change_client(),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),this.submit_form("edit_submit","edit_lead"),App.concerns.datepicker(".datepicker"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),$("#interest_product_type_ids").select2({width:"100%"}),App.concerns.hide_item_file_options(),App.concerns.set_associate_entity_to_s2("#lead_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("user_ids"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#tag-field","#tags");var e=$("#lead_edit_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search("item_values_"+t)})},duplicate:function(){$(document).on("keydown","#duplicate_search_leads",function(e){if(13==e.keyCode){e.preventDefault();var t=$(this);if(t.data("processing"))return;t.data("processing",!0),t.submit(),App.front_hot_recommends.getHotScenario()}}),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_order_for_duplicate("duplicate_search_leads");new Clipboard(".clipboard-btn");$("#"+$("#result_search_selected_id").val()).css("background-color","#e0e0e0"),App.visible_fields.setup_list_visible_setting(["name","client_id","post","organization_id"],"table.table-float-head"),App.front_leads.handle_duplicate(),App.front_leads.handle_duplicate_automation(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},entry_import:function(){App.concerns.search_zip_code(),App.concerns.select_search("lead_client_id"),App.concerns.select_search("lead_owner_user_id"),this.change_client(),this.init_tags(),this.submit_confirm("confirm_lead"),App.concerns.datepicker(".datepicker"),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit(),$("#interest_product_type_ids").select2({width:"100%"})},change_client:function(){$("#lead_client_id").on("change",function(){var e=$("#lead_client_id").val();if("0"===e){$("#new_client_alert").show();var t=$("#lead_client_id").select2("data").text_name;$("#lead_client_id").val(t)}else $("#new_client_alert").hide(),$("#client_id").val(e),$("#select_options_client_id").val(e),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit();$(".tooltip").tooltip("hide")})},click_select_client:function(){$("#open-associated-client").on("click",function(){App.concerns.select_search_name("lead_client_id"),App.concerns.set_associate_entity_to_s2("#lead_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",$("#unlink_clients_flg").val()),localStorage.setItem("client_onclick","#lead_client_id")})},change_client_index:function(){$("#search_client_id").on("change",function(){$("#client_id").val($("#search_client_id").val()),$("#form_search_xhr_client_branches_select_options").submit(),$("#form_search_xhr_organizations_select_options").submit()})},init_tags:function(){var e=$("#tags");e&&e.select2({tags:e.data("tags"),tokenSeparators:[","]})},submit_form:function(e,t){e=$("#"+e),t=$("."+t),e.on("click",function(){e.prop("disabled",!0),t.submit()})},submit_confirm:function(e){$("#confirm_submit").on("click",function(){form=$("."+e),$(form).attr("action",$(this).data("action")),$("input[name^='_method']").val("post"),$(form).submit()})},set_relations_table:function(t){void 0===t&&(t=!1),["business_cards","tasks","daily_reports","deals","target_lists","campaigns","seminars","mail_queues","web_forms","web_trackings","inside_sales"].forEach(function(n){var e;1==$("#lead_relations_table_"+n).length&&($("#"+n+"_loading").prepend($("<div></div>",{id:"contents-loading-lead-relations-"+n,"class":"contents-loading-lead-relations"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-x loading-lead-relations"}))),e=t?"/xhr/leads/leads_relations/"+$("#lead_id").val()+"/?into_modal_flg=true":"/xhr/leads/leads_relations/"+$("#lead_id").val()+"/",$.ajax({url:e,dataType:"html",data:{dataType:"html",id:$("#lead_id").val(),model:n}}).done(function(e){var t=$("#lead_relations_table_"+n);t.html(e),t.find(".hp-tooltip").tooltip({container:"body",trigger:"hover"}),$("#contents-loading-lead-relations-"+n).remove()}))})},change_button_actibity_by_role:function(){$(document).on("click","#all-check,.check-items",function(){var e=$(".check-items:checked"),t=e.closest("tr").find("td:last").length,n=e.closest("tr").find("td:last a").not("[disabled='disabled']").length,i=null,a=null;0<$(".btn-activity-by-department-role").length?(i=t!=n,a=$(".btn-activity-by-department-role")):(i=0<e.closest("tr").find('td:last a[data-permission="false"]').length,a=$(".btn-activity-by-department-role-delete")),a.prop({disabled:i}),i?(a.parent().attr("data-original-title",a.attr("data-disabled-title")),a.parent().tooltip({container:"body",trigger:"hover"})):(a.parent().attr("data-original-title",""),a.parent().tooltip({disabled:!0}));var s=$("#form_checked_leads .check-items:checked").length;$("#alternative_attr_button_merge_leads").prop("disabled",s<2)})},check_form_input_user:function(){$(document).on("click","#js_set_user_ids_to_caller_select",function(){$("#bulk_update").prop("disabled",!1)})},ajax_load:function(){var e=$("<div>");e.attr("id","loading");var t=$("<div>");t.attr("id","spinner"),e.append(t),$("html").prepend(e)},load_split_index:function(e){rowIndex++;var t=rows[rowIndex],n=$("#pagination_id").val(),i=$("#search_segment_ids").val();xhrLeadIds=$(t).data("xhr-lead-ids"),$.ajax({url:"/xhr/leads/load_split_index",type:"GET",dataType:"html",data:{ids:xhrLeadIds,pagination_id:n,segment_id:i}}).done(function(e){$(t).replaceWith(e),$(document).trigger("floatTableUpdate"),$(".js_submit_send_mail").off("click"),$(".js_submit_send_mail").on("click",function(){$(".js_visibility_email.open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));return $("#select_lead_id").val($(this).data("lead-id")),e.submit(),!1})}).fail(function(){$(t).html("")}).always(function(){rowIndex<rows.length-2?App.front_leads.load_split_index(e):e.resolve()})},init_new_client_sale_approach_leads_form:function(){var e=$("#new_lead");App.front_leads.attach_client_sale_approach_leads_form_button_event(e),App.concerns.search_zip_code(),App.concerns.select_search("lead_client_id"),this.change_client(),App.front_business_card_lead_tags.init_suggest("s2id_tags-on-modal","my-tag-dropdown-on-modal"),this.submit_form("new_submit","new_lead"),App.concerns.set_associate_entity_to_s2("#lead_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",$("#unlink_clients_flg").val()),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#lead_tags_c","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags-on-modal","#lead_tags_c")},attach_client_sale_approach_leads_form_button_event:function(n){n.off("ajax:error"),n.on("ajax:error",function(e,t){n.find("#modal_message").html(App.concerns.buildNoticeHtml(t.responseJSON.messages,"danger"))}),n.find("#submitButton").on("click",function(){n.off("ajax:success"),n.one("ajax:success",function(e,t){if($("#new_client_sale_approach_leads_message").html(App.concerns.buildNoticeHtml(t.messages,"success")),1==t.permission_denied)$("#new_lead_modal").modal("hide"),$("#new_client_sale_approach_leads_message").css("display","block");else{var n={lead_id:t.lead_id,client_sale_approach_id:t.client_sale_approach_id};$.ajax({type:"POST",url:"/xhr/leads/select_next_step_new_lead",data:n})}})}),n.find("#resetBusinessCardButton").on("click",function(e){return e.preventDefault(),App.front_business_cards.simplyBusinessCardFormFields.forEach(function(e){-1==["client_id"].indexOf(e)&&n.find("#lead_"+e).val("")}),$("#s2id_tags-on-modal li.select2-search-choice").remove(),!1})},handle_duplicate:function(){$(document).on("click",".cancel-lead-merge",function(){return confirm(I18n.t("js.leads.cancel_lead_merge"))&&$("#alternative-attr-modal").modal("hide"),!1}),$(document).on("click",".js-lead-merge-exec",function(){$(".in-alternative").fadeIn(150),$(".in-alternative").css("transform","translateY(30px)"),$(".js-merge-lead-cancel").focus(),$("#backdrop-leads").css("display","block")}),$(document).on("click",".js-merge-lead-cancel",function(){return $(".in-alternative").css("transform","translateY(0px)"),$(".in-alternative").fadeOut(150),$("#backdrop-leads").css("display","none"),!1}),$(document).on("click",".js-merge-lead-exec",function(){App.front_leads.submit_form_merge_leads(),$(this).attr("disabled",!0),$(".js-merge-lead-cancel").attr("disabled",!0)}),$(document).on("shown.bs.modal","#alternative-attr-modal",function(){$(".js-automatically-merge-lead-cancel").focus(),$("#checkbox-auto-merge-leads-modal").on("click",function(){$("#checkbox_auto_merge").val($(this).prop("checked"))})})},handle_duplicate_automation:function(){$(document).on("click",".js_automatically_merge_lead_button",function(){return $(".btn-group.hidden-xs.open").removeClass("open"),$(this).data("display-confirm-popup")?App.front_leads.submit_form_automatically_merge_leads():($("#type_merge").val(!0),$(".btn-group.open").removeClass("open"),$("#form_merge_leads").submit(),$("#type_merge").val(!1)),!1}),$(document).on("click",".js-automatically-merge-lead-exec",function(){$(".js-automatically-merge-lead-cancel").attr("disabled",!0),$("#checkbox-auto-merge-leads-modal").attr("disabled",!0).css("cursor","default"),$("#checkbox-auto-merge-leads-modal").parent().css("cursor","default")})},submit_form_merge_leads:function(){$("#check_on").is(":checked")?$("#lead_check_flg").val("on"):$("#lead_check_flg").val(""),$("#form_not_auto_merge_leads").submit()},submit_form_automatically_merge_leads:function(){var e=$("#form_automatically_merge_leads");e.find('[name="ids[]"]').remove(),$('.merge input[name="ids[]"]:checked').each(function(e,t){console.log($(t).val()),$("<input>").attr({type:"hidden",name:"ids[]",value:$(t).val()}).appendTo("#form_automatically_merge_leads")}),e.submit()}},$(document).on("click",".check-lead-merge-radio",function(){var e=$(this).data("lead");return $('input[type="radio"][value="'+e+'"]').each(function(){if($(this).is(":disabled"))return!0;$(this).prop("checked",!0).change()}),!1});var ClientEditForm={change:function(n,e){$(e).on("change",function(){var e=$(n).val();if(""!=e){$('[data-form-index="client_id"]').val(e);var t=[];$(".js_show_client_custom").find(".collapse.in").each(function(){t.push($(this).data("id"))}),$('[data-form-index="collapse_open"]').val(t),$("#js_form_client_custom").submit()}else $(".js_show_client_custom").html("")})},init:function(e){var t=$(e).val();""!=t&&($('[data-form-index="client_id"]').val(t),$("#js_form_client_custom").submit())}},ClientBranchesEditForm={change:function(n,e){$(e).on("change",function(){var e=$(n).val();if(""!=e){$('[data-form-index="client_branch_id"]').val(e);var t=[];$(".js_form_client_branches_custom").find(".collapse.in").each(function(){t.push($(this).data("id"))}),$('[data-form-index="collapse_open"]').val(t),$("#js_form_client_branches_custom").submit()}else $(".js_show_client_branches_custom").html("")})},init:function(e){var t=$(e).val();""!=t&&($('[data-form-index="client_branch_id"]').val(t),$("#js_form_client_branches_custom").submit())}},CommunicationModals=function(){};CommunicationModals={init:function(){var t=function(e,t,n,i){$(".user_information.hp-tooltip").trigger("mouseleave");var a=n?".user-information-show.for-customer-sheet":".user-information-show",s=n?"#user-information-form-for-customer-sheet":"#user-information-form";if("block"===$(a).css("display"))return $(a).hide(),!1;var o=$(t).data("user-id"),r=$(t).offset().top,l=$(t).offset().left+$(t).width()/2;if(n)$("#is_customer_sheet").val(n),$("#position_top_for_customer_sheet").val(r),$("#position_left_for_customer_sheet").val(l);else{if(i&&(r=$("#search-associated-resources-modal").scrollTop()+r-60),$("#page_scroll_top").val())r+=parseInt($("#page_scroll_top").val())-60;if($(t).attr("stepable-record-field-page-scroll-top"))r+=parseInt($(".user_information").attr("stepable-record-field-page-scroll-top"))+240;$("#position_top").val(r),$("#position_left").val(l)}$(s).attr("action","/xhr/user_communications/user_information_show/"+o),$(s).submit()};$(document).on("click",".user_information",function(e){t(e,this,!1,!1)}),$(document).on("click",".user_information_modal",function(e){t(e,this,!1,!0)}),$(document).on("click",".user_information_for_customer_sheet",function(e){t(e,this,!0,!1)}),$(window).on("click",function(e){0<!$(e.target).closest(".user-information-show").length&&0<!$(e.target).closest(".user-information-show.for-customer-sheet").length&&("block"===$(".user-information-show").css("display")&&$(".user-information-show").hide(),"block"===$(".user-information-show.for-customer-sheet").css("display")&&$(".user-information-show").hide())})}};var CustomCombo={comboMove:function(n,i){return function(){var e=$(n).find("option:selected"),t=e.clone();$(i).append(t),e.remove(),$('[data-hp-role="visible-fields"]').change()}},comboMoveOne:function(t){return function(){var e=$('[data-hp-role="visible-fields"] option:selected');1<e.size()?alert(I18n.t("js.common.unchanged_items")):(t(e),$('[data-hp-role="visible-fields"]').change())}},comboValueSet:function(t,n){return function(){var e=[];$(t).each(function(){e.push($(this).val())}),$(n).val(e)}},init:function(){var e=this;$(document).on("click",'[data-hp-role="right-btn"]',this.comboMove('[data-hp-role="visible-fields"]','[data-hp-role="invisible-fields"]')),$(document).on("click",'[data-hp-role="left-btn"]',this.comboMove('[data-hp-role="invisible-fields"]','[data-hp-role="visible-fields"]')),$(document).on("click",'[data-hp-role="top-btn"]',e.comboMoveOne(function(e){e.prevAll().last().before(e)})),$(document).on("click",'[data-hp-role="bottom-btn"]',e.comboMoveOne(function(e){e.nextAll().last().after(e)})),$(document).on("click",'[data-hp-role="up-btn"]',e.comboMoveOne(function(e){e.prevAll().first().before(e)})),$(document).on("click",'[data-hp-role="down-btn"]',e.comboMoveOne(function(e){e.nextAll().first().after(e)})),$(document).on("change",'[data-hp-role="visible-fields"]',e.comboValueSet('[data-hp-role="visible-fields"] option','[data-hp-role="visible-values"]'))}},CustomerSheets=function(){},ajax_content_load,timer=!1,timelines_last_end_at=null,timelines_last_ignore_id=null,CONST_ENABLED_COLOR="#777777",CONST_DISABLED_COLOR="lightgrey",MODAL_NO_ALERT_HEIGHT_ADJUSTMENT=70,MODAL_CONTAIN_ALERT_HEIGHT_ADJUSTMENT=125;CustomerSheets={visible_fields:{open:function(t){$("html, body").scrollLeft(0),target_dialog=$("#"+t);var i="";if(
"client_custom_fields_setting_dialog"===t)var e=$("#js_selected_client_custom_fields").html(),n=$("#js_unselected_client_custom_fields").html();dialog=target_dialog.removeClass("hide").dialog({modal:!0,title_html:!0,draggable:!0,width:"client_custom_fields_setting_dialog"==t?700:450,height:target_dialog.data("height"),title:target_dialog.data("title"),buttons:[{text:target_dialog.data("close-text"),"class":"btn btn-primary btn-xs",click:function(){if("timeline_visible_fields_setting_dialog"==t){var n=target_dialog.find("form");$.ajax({url:n.attr("action"),type:n.attr("method"),data:n.serialize()}).done(function(){var e=$("#collapse_timelin"),t=$("#js_select_change_client option:selected").data("contain-old-client-flg");e.find(".timelin-block").empty(),e.find(".timelin-more,.timelin-none").addClass("hide"),$("#collapse_timelin").removeData("ignore_id"),CustomerSheets.timelines.get_contents(1,null,t),n.find("input[type='checkbox']").each(function(){$(this).prop("checked")?$(this).attr("checked","checked"):$(this).removeAttr("checked")})})}else if("client_custom_fields_setting_dialog"==t){var e=[];$("#js_selected_client_custom_fields").find("option").each(function(){e.push($(this).val())}),n=$("#client_custom_fields_setting_dialog form"),$.ajax({url:n.attr("action"),type:n.attr("method"),data:{visible_fields_kbn:$("#client_custom_fields_kbn").val(),customer_sheet_client_id:$("#customer_sheet_client_id").val(),visible_fields:e}}).done(function(e){CustomerSheets.visible_fields.rebuild_table(e)}),i="save"}$(this).data("none-reset-flg",!0).dialog("close")}}],open:function(){$(".ui-dialog").zIndex(9994),$(".ui-widget-overlay.ui-front").zIndex(9993)},beforeClose:function(){if("timeline_visible_fields_setting_dialog"!=t&&"client_custom_fields_setting_dialog"!=t&&0==$(this).find("input[name=visible_fields\\[\\]]:checked").length)return alert(target_dialog.data("alert-text")),!1},close:function(){"timeline_visible_fields_setting_dialog"!=t&&"client_custom_fields_setting_dialog"!=t?target_dialog.find("form").submit():("client_custom_fields_setting_dialog"===t&&"save"!==i&&($("#js_selected_client_custom_fields").html(e),$("#js_unselected_client_custom_fields").html(n)),$(this).data("none-reset-flg")||target_dialog.find("form")[0].reset(),$(this).removeData("none-reset-flg"))}})},change:function(e){target=$("#customer-sheets-contents").find(".js_visibility_"+e.value),e.checked?target.removeClass("hide"):target.addClass("hide")},init:function(){0==localStorage.hasOwnProperty("check_value")?($("#only_active_user_of_customer_sheets").prop("checked",!1),$("#is_checked").val(0)):1==localStorage.hasOwnProperty("check_value")&&(localStorage.setItem("check",localStorage.getItem("check_value")),1==localStorage.getItem("check")?($("#only_active_user_of_customer_sheets").prop("checked",!0),$("#is_checked").val(1)):($("#only_active_user_of_customer_sheets").prop("checked",!1),$("#is_checked").val(0)),$("#form_customer_sheets_client_branches").submit()),contents=$("#customer-sheets-contents"),CustomerSheets.resize_customer_sheets(),contents.find(".visible_fields_btn").on("click",function(){return CustomerSheets.visible_fields.open($(this).data("target")),!1}),contents.find(".js_visible_field").on("change",function(){CustomerSheets.visible_fields.change(this)}),App.concerns.open_mailer();new Clipboard(".clipboard-btn")},rebuild_table:function(e){var t=$("#collapse_custom");t.find("table tbody tr").remove();var n=t.find("table");if(0<e.length){n.show();for(var i=t.find("table tbody"),a=0;a<e.length;a++)i.append($("<tr></tr>").attr("class","js_visibility_item_"+e[a].id).append($("<th></th>").text(e[a].name)).append($("<td></td>").html(e[a].value)));$("#custom_unset").hide()}else n.hide(),$("#custom_unset").show()}},timelines:{get_contents:function(e,t,n){if(null!=e&&timelines_last_end_at==e&&JSON.stringify(timelines_last_ignore_id)==JSON.stringify(t))return!1;timelines_last_end_at=e,timelines_last_ignore_id=$.extend(!0,{},t),url=$("#collapse_timelin").data("url"),$.ajax({type:"POST",url:url,dataType:"json",data:{dataType:"json",end_at:e,ignore_id:t,contain_old_client_flg:n},beforeSend:function(){$("#collapse_timelin").prepend($("<div></div>",{id:"customer-sheets-contents-timelin-loading","class":"contents-loading"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-3x loading-timeline"})))}}).done(function(e){if(void 0===(t=$("#collapse_timelin").data("ignore_id"))&&(t={}),data=e.data,timelin_block=$("#collapse_timelin .timelin-block"),0<data.length){for(index in data)for(item_index in timelin_data=data[index],timelin_date_block=$("#timelin-date-"+timelin_data.date_num),timelin_date_block[0]||(timelin_block.append(CustomerSheets.timelines.init_timelin_block(data[index].date,data[index].date_num)),timelin_date_block=$("#timelin-date-"+timelin_data.date_num)),timelin_data.timeline_items)timeline_item=timelin_data.timeline_items[item_index],timelin_date_block.next().append(CustomerSheets.timelines.init_timelin_item_block(timeline_item.badge,timeline_item.time,timeline_item.message)),"undefined"==typeof t[timeline_item.timeline_type]&&(t[timeline_item.timeline_type]=[]),t[timeline_item.timeline_type].push(timeline_item.ignore_id);$("#collapse_timelin .timelin-none").addClass("hide"),e.next_flg?($("#collapse_timelin .timelin-more").removeClass("hide"),$(".timelin-date-item-block:last").css("border-left","dotted 4px #c3c3c3")):($("#collapse_timelin .timelin-more").addClass("hide"),$(".timelin-date-item-block:last").css("border-left","none"),$(".timelin-date-item-block:last").css("margin-left","54px"))}else $("#collapse_timelin .timelin-more").addClass("hide"),$("#collapse_timelin .timelin-none").removeClass("hide"),$(".timelin-date-item-block:last").css("border-left","dotted 4px #c3c3c3");$("#collapse_timelin").data("end_at",e.end_at).data("ignore_id",t),$("#customer-sheets-contents-timelin-loading").remove()})},init_timelin_block:function(e,t){return $("<h5></h5>",{id:"timelin-date-"+t,"class":"timelin-date"}).text(e).add($("<ul></ul>",{"class":"timelin-date-block"}))},init_timelin_item_block:function(e,t,n){return badge_block=$("<div></div>",{"class":"timeline-badge "+e}),message_block=$("<div></div>",{"class":"timeline-message-block"}).html(n),t?(item_block=message_block,time_block=$("<div></div>",{"class":"timeline-time-block text-muted"}).append($("<i></i>",{"class":"glyphicon glyphicon-time"})).append(t),item_block=item_block.add(time_block)):item_block=message_block,item_block=item_block.add($("<div></div>",{"class":"clear"})),$("<li></li>",{"class":"timelin-date-item"}).html($("<div></div>",{"class":"timelin-date-item-block"}).html(badge_block.add($("<div></div>",{"class":"timeline-body"}).html($("<div></div>",{"class":"timeline-panel"}).html(item_block)))))}},modal_open:function(e,n,i){$("#customer_sheets_base_client_id").remove(),modal=$("#modal_customer_sheets"),0<modal.length&&modal.remove(),0<$("#customer_sheets_client_relation_modal").length&&$("#customer_sheets_client_relation_modal").remove(),$.ajax({url:e,dataType:"html",async:!1,data:{dataType:"html"},beforeSend:function(e,t){i&&(t.url+="&tab_type="+i)}}).done(function(e){$("body").append(e),modal_dom=$(document).find(".modal-open"),$("#modal_customer_sheets").on("show.bs.modal",function(){if(modal_dom[0]){var t=this;setTimeout(function(){var e=ModalUtils.maxZIndex();$(t).css("z-index",e+3),$(".modal-backdrop:last").css("z-index",e+2)},0)}App.concerns.set_tooltip(),$("#customer_sheets_base_client_id").val()||$("#customer_sheets_base_client_id").val(n)}).on("hidden.bs.modal",function(){modal_dom[0]&&0<$(".modal:visible").length&&(modal_dom.addClass("modal-open"),setTimeout(function(){var e=ModalUtils.maxZIndex();$(".modal-backdrop:last").css("z-index",e-1)},0))}).modal("show"),CustomerSheets.get_contents($("#modal_customer_sheets .customer-sheets-sidebar .default_display")),CustomerSheets.get_sidebar_count().done(function(){$("#js_select_change_client").prop("disabled",!1)})})},sidebar_toggle_btn_hover:function(){$(document).on("mouseenter","#js_customer_sheets_sidebar_toggle",function(){target=$(this).find("i.fa"),$("#modal_customer_sheets .js_customer_sheets_menu_name").is(":visible")?target.addClass("fa-arrow-left").removeClass("fa-bars"):target.addClass("fa-arrow-right").removeClass("fa-bars")}),$(document).on("mouseleave","#js_customer_sheets_sidebar_toggle",function(){target.addClass("fa-bars").removeClass("fa-arrow-left").removeClass("fa-arrow-right")})},modal_change:function(){$(document).on("change","#js_select_change_client",function(){var t=$(this).val();$("#js_select_change_client").prop("disabled",!0),CustomerSheets.cancel_loading_content(),$("#customer_sheets_base_client_id").empty(),$("#related_client_ids_of_customer_sheets").empty();var e=$("#js_select_change_client option:selected").data("contain-old-client-flg");$.ajax({url:"/xhr/customer_sheets/"+t,dataType:"html",async:!1,data:{dataType:"html",change_display_client_flg:!0,contain_old_client_flg:e}}).done(function(e){$("#js_customer_sheet_body").html(e),$("#customer_sheets_base_client_id").val(t),$("#js_select_change_client").children("option:nth-child(1)").val()!=$("#js_select_change_client").val()&&$("#customer_sheet_alert").remove(),CustomerSheets.get_contents($("#modal_customer_sheets .customer-sheets-sidebar .default_display")),CustomerSheets.get_sidebar_count().done(function(){$("#js_select_change_client").prop("disabled",!1)})})})},sidebar_toggle:function(){modal=$("#modal_customer_sheets"),visible_target=modal.find(".js_customer_sheets_menu_name"),visible_sidebar_count=modal.find(".sidebar_count"),animate_target=modal.find(".customer-sheets-sidebar"),hide_width=animate_target.data("hide-width"),show_width=animate_target.data("show-width"),anti_check_label=modal.find(".anti-check-label"),visible_target.is(":visible")?(visible_target.hide(),visible_sidebar_count.hide(),animate_target.animate({width:hide_width},200,function(){btn=$("#js_customer_sheets_sidebar_toggle i.fa"),btn.hasClass("fa-arrow-left")&&btn.addClass("fa-arrow-right").removeClass("fa-arrow-left"),$(document).trigger("floatTableUpdate")}),anti_check_label[0].style.marginLeft="-3px",anti_check_label[0].style.marginRight="5px"):(animate_target.animate({width:show_width},200,function(){visible_target.css("display",""),visible_sidebar_count.css("display",""),btn=$("#js_customer_sheets_sidebar_toggle i.fa"),btn.hasClass("fa-arrow-right")&&btn.addClass("fa-arrow-left").removeClass("fa-arrow-right"),$(document).trigger("floatTableUpdate")}),anti_check_label[0].style.marginLeft="5px",anti_check_label[0].style.marginRight="-5px")},click_sidemenu:function(e){return target_li=$(e),target_li.hasClass("active")||(target_id=target_li.find("a").data("target-id"),CustomerSheets.cancel_loading_content(),document.querySelector("#"+target_id)?($("#modal_customer_sheets").find(".js_customer_sheets_get_contents").removeClass("active"),target_li.addClass("active"),$("#customer-sheets-contents").find(".customer-sheets-contents-child").addClass("hide"),$("#"+target_id).removeClass("hide")):CustomerSheets.get_contents(e),$("#customer-sheets-contents").scrollTop(0)),!1},force_reload_side_menu_content:function(e){return CustomerSheets.cancel_loading_content(),CustomerSheets.get_contents(e),$("#customer-sheets-contents").scrollTop(0),!1},get_contents:function(e){target_li=$(e),modal=$("#modal_customer_sheets"),modal.find(".js_customer_sheets_get_contents").removeClass("active"),target_li.addClass("active"),target_id=target_li.find("a").data("target-id"),target_half=target_li.find("a").attr("href");var t=$("#js_select_change_client option:selected").data("contain-old-client-flg");ajax_content_load=$.ajax({url:target_half,dataType:"html",data:{dataType:"html",contain_old_client_flg:t},beforeSend:function(){$("#customer-sheets-contents").prepend($("<div></div>",{id:"customer-sheets-contents-loading","class":"contents-loading"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-3x loading"})))}}).done(function(e){ajax_content_load=undefined;var t=$("<div></div>",{id:target_id,"class":"hide customer-sheets-contents-child"}).html(e);contents=$("#customer-sheets-contents"),contents.append(t),contents.find(".customer-sheets-contents-child").addClass("hide"),$("#"+target_id).removeClass("hide"),"customer_sheets_contents_client"===target_id&&CustomerSheets.resize_chart_size(),"customer_sheets_contents_daily_reports"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.daily-report-table-float-head")),"customer_sheets_contents_deals"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.deal-table-float-head")),"customer_sheets_contents_client_news"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_inside_sales"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_mail_histories"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_personnel_changes"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_target_lists"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_client_branches"===target_id&&(CustomerSheets.visible_fields.init(),$(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_tasks"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_web_access_rankings"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_web_forms"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_web_trackings"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_seminars"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_organizations"===target_id&&$(document).off("ajax:beforeSend ajax:complete","#form_xhr_leads_modal_owner_users_of_customer_sheets").on({"ajax:beforeSend":function(){if($(this).data("ajax-processing"))return!1;$(this).data("ajax-processing",!0)},"ajax:complete":function(){$(this).data("ajax-processing",!1)}},"#form_xhr_leads_modal_owner_users_of_customer_sheets"),"customer_sheets_contents_campaigns"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),"customer_sheets_contents_client_mail_histories"===target_id&&($(t).find(".modal-fixed-content-header").height($("#customer-sheets-contents").height()),CustomerSheets.set_hidden_info_cell(t),CustomerSheets.set_float_table_header("table.table-float-head")),CustomerSheets.set_resource_functions(target_id);var n=$("#"+target_id).find(".sidebar_count_for_reloading").text();n&&$(".js_customer_sheets_get_contents.active").find(".sidebar_count").text("\uff08"+n+"\uff09");App.concerns.set_tooltip(),$("#customer-sheets-contents-loading").remove()})},init:function(){$(document).on("click","a.js_customer_sheets_show",function(){return localStorage.removeItem("check_value"),CustomerSheets.modal_open($(this).data("href"),$(this).data("client-id"),$(this).data("tab-type")),!1}),$(document).on("click","#customer_sheet_alert a",function(){setTimeout(function(){CustomerSheets.resize_customer_sheets()},0)}),$(document).on("hide.bs.modal","#modal_customer_sheets",function(){CustomerSheets.cancel_loading_content(),$("#customer_sheets_client_relation_modal").remove(),$(".user-information-show.for-customer-sheet").remove()}),$(document).on("hide.bs.modal","#customer_sheets_client_relation_modal",function(){$(".add_client_relation_link").removeClass("double_click")}),CustomerSheets.sidebar_toggle_btn_hover(),$(document).on("click","#js_customer_sheets_sidebar_toggle",function(){CustomerSheets.sidebar_toggle()}),$(document).on("click","#modal_customer_sheets .js_customer_sheets_get_contents",function(e){return"true"==this.getElementsByTagName("a")[0].getAttribute("data-enable-flg")&&CustomerSheets.click_sidemenu(this),0<!$(e.target).closest(".user-information-show").length&&0<!$(e.target).closest(".user-information-show.for-customer-sheet").length&&("block"===$(".user-information-show").css("display")&&$(".user-information-show").hide(),"block"===$(".user-information-show.for-customer-sheet").css("display")&&$(".user-information-show").hide()),!1}),$(document).on("click",".pagenate_loading a",function(){"active"!==$(this).parent().attr("class")&&$.ajax({dataType:"html",data:{dataType:"html"},beforeSend:function(){$("#customer-sheets-contents").prepend($("<div></div>",{"class":"contents-loading-paging"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-3x loading-paging"})))}})}),$(document).on("click",".modal_top_for_customer_sheets",function(){$("#modal_customer_sheets").animate({scrollTop:0},100)}),CustomerSheets.modal_change(),CustomerSheets.change_display_number_for_customer_sheets(),CustomerSheets.change_order_for_customer_sheets(),CustomerSheets.change_display_template_for_customer_sheets(),CustomerSheets.change_customer_sheet_tab_type()},close_pagenate_loading:function(){$(".contents-loading-paging").remove()},set_resource_functions:function(e){var t=$("#js_select_change_client option:selected").data("contain-old-client-flg");switch(e){case"customer_sheets_contents_base_config":CustomerSheets.visible_fields.init(),$(".js_lateral_move_button_block button").on("click",function(){if($(this).hasClass("move_to_right"))(e=$("#js_selected_client_custom_fields option:selected"))[0]&&e.each(function(){$("#js_unselected_client_custom_fields").append($(this).clone()),$(this).remove()});else if($(this).hasClass("move_to_left")){var e;(e=$("#js_unselected_client_custom_fields option:selected"))[0]&&e.each(function(){$("#js_selected_client_custom_fields").append($(this).clone()),$(this).remove()})}}),$(".js_vertical_move_button_block button").on("click",function(){var e=$(this).parent(),t=$("#js_selected_client_custom_fields option:selected");if(1<t.size())return alert(I18n.t("js.common.unchanged_items")),!1;t[0]&&($(this).hasClass("move_to_up")?t.prev().before(t):$(this).hasClass("move_to_down")?t.next().after(t):$(this).hasClass("move_to_top")?e.next().children("select").prepend(t):$(this).hasClass("move_to_bottom")&&e.next().children("select").append(t))}),$(".add_client_relation_link").on("click",function(){if($(this).hasClass("double_click"))return!1;$(this).addClass("double_click");var e=$("#related_client_ids_of_customer_sheets").val().split(",");e.push($("#customer_sheets_base_client_id").val());var t={exclude_ids:e};$.ajax({url:"/xhr/clients/search_overlay_modal",data:"utf8=\u2713&"+$.param(t)+"&select_type=multiple&customer_sheets_flg=1"})}),$("#customer_sheets_client_relation_modal").off("click").on("click","#clients_multiple_decision_in_customer_sheets",function(){var e=jQuery.map($('input[name="associate_clients_in_customer_sheets[]"]:checked'),function(e){return $(e).val()});if(0==e.length)return alert(I18n.t("js.common.please_select")),!1;var t={client_id:$("#customer_sheets_base_client_id").val(),client_relation_ids:e};$.ajax({type:"POST",url:"/xhr/client_relations/",data:t})});break;case"customer_sheets_contents_timelines":CustomerSheets.removeCustomerSheetClientBranch(),CustomerSheets.visible_fields.init(),$("#collapse_timelin .timelin-more a").off("click.timelin_more").off("mouseover.timelin_more").on("click.timelin_more",function(){return!1}).on("mouseover.timelin_more",function(){CustomerSheets.timelines.get_contents($("#collapse_timelin").data("end_at"),$("#collapse_timelin").data("ignore_id"),t)}),$("#collapse_timelin").off("click.js_mail_histories_get_modal_to_leads").on("click.js_mail_histories_get_modal_to_leads",".js_mail_histories_get_modal_to_leads",function(){return $("#customer_sheets_mail_queue_id").val($(this).data("mail-queue-id")),$("#form_mail_histories_get_modal_to_leads").submit(),!1}),CustomerSheets.timelines.get_contents(null,{},t);case"customer_sheets_contents_organizations":""==$.trim($("#organizations_tree_of_customer_sheets").html())&&$("#organizations_tree_of_customer_sheets").html('<div class="text-center" id="spinner"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#form_search_xhr_organizations_of_customer_sheets").submit();var a=$("#old_org_tree_client_ids_in_customer_sheet").val();a&&(a=a.split(" "),$.each(a,function(e,n){var t=$("#old_organization_tree_in_customer_sheet_"+n);""==$.trim(t.html())&&t.html('<div class="text-center" id="spinner"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#form_search_xhr_organizations_in_customer_sheet_"+n).submit(),$(document).on("click","#old_org_tree_export_button_"+n,function(){lead_status=$("#only_active_lead_of_customer_sheets_"+n).is(":checked")?1:null;var e=$("#show_uncontacted_officers_flg_on_customer_sheet_"+n).is(":checked")?1:null,t=!!$("#show_having_business_card_flg_on_customer_sheet_"+n).is(":checked");$("#only_active_lead_flg_as_export_condition_in_customer_sheet_"+n).val(lead_status),$("#show_uncontacted_officers_flg_as_export_condition_in_customer_sheet_"+n).val(e),$("#show_having_business_card_flg_as_export_condition_in_customer_sheet_"+n).val(t),$("#business_card_family_name_as_export_condition_in_customer_sheet_"+n).val($("#customer_sheets_contents_organizations #search_business_card_family_name").val()),$("#business_card_first_name_as_export_condition_in_customer_sheet_"+n).val($("#customer_sheets_contents_organizations #search_business_card_first_name").val()),$("#org_export_form_of_customer_sheet_"+n).submit()})}),App.concerns.old_tree_control_enable(a,!0),App.front_organizations.old_tree_filterable(a,!0)),$("#search_xhr_organizations_submit_of_customer_sheets").on("click",function(){$("#show_uncontacted_officers_flg_on_customer_sheet").prop("checked",!1),lead_status=$("#only_active_lead_of_customer_sheets").is(":checked")?1:null;var e=!!$("#show_having_business_card_flg_on_customer_sheet").is(":checked");if($("#search_lead_status_of_customer_sheets").val(lead_status),$("#search_show_having_business_card_flg_in_customer_sheets").val(e),$("#form_search_xhr_organizations_of_customer_sheets").submit(),a){$("#show_uncontacted_officers_flg_old_org_in_customer_sheet").prop("checked",!1);var n=$("#only_active_lead_old_org_in_customer_sheet").is(":checked")?1:null,i=!!$("#show_having_business_card_flg_old_org_in_customer_sheet").is(":checked");$.each(a,function(e,t){$("#old_org_lead_status_in_customer_sheet_"+t).val(n),$("#show_uncontacted_officers_flg_as_search_condition_in_customer_sheet_"+t).val(null),$("#show_having_business_card_in_customer_sheets_"+t).val(i),$("#old_org_business_card_family_name_in_customer_sheet_"+t).val($("#search_business_card_family_name_in_customer_sheet").val()),$("#old_org_business_card_first_name_in_customer_sheet_"+t).val($("#search_business_card_first_name_in_customer_sheet").val()),$("#form_search_xhr_organizations_in_customer_sheet_"+t).submit()})}return!1}),App.concerns.tree_control_enable("#latest_org_tree_control_grid","#organizations_tree_of_customer_sheets"),$(".org-tree-control-grid #only_active_lead_of_customer_sheets, .org-tree-control-grid #show_uncontacted_officers_flg_on_customer_sheet, .org-tree-control-grid #show_having_business_card_flg_on_customer_sheet").on("click",function(){$("#only_active_lead_of_customer_sheets").prop("disabled",!0),$("#show_having_business_card_flg_on_customer_sheet").prop("disabled",!0);var e=$("#only_active_lead_of_customer_sheets").is(":checked")?1:null,t=!!$("#show_having_business_card_flg_on_customer_sheet").is(":checked");$("#search_lead_status_of_customer_sheets").val(e),$("#search_show_having_business_card_flg_in_customer_sheets").val(t),$("#form_search_xhr_organizations_of_customer_sheets").submit(),$("#show_uncontacted_officers_flg_on_customer_sheet").prop("disabled",!0)}),$(document).ajaxStop(function(){$("#only_active_lead_of_customer_sheets").prop("disabled",!1),$("#show_uncontacted_officers_flg_on_customer_sheet").prop("disabled",!1),$("#show_having_business_card_flg_on_customer_sheet").prop("disabled",!1)});case"customer_sheets_contents_client_branches":$("#only_active_user_of_customer_sheets").on("click",function(){var e=$("#only_active_user_of_customer_sheets").is(":checked")?1:0;$("#is_checked").val(e),$("#form_customer_sheets_client_branches").submit()});case"customer_sheets_contents_client_relations":$(".add_client_relation_link").on("click",function(){if($(this).hasClass("double_click"))return!1;$(this).addClass("double_click");var e=$("#related_client_ids_of_customer_sheets").val().split(",");e.push($("#customer_sheets_base_client_id").val());var t={exclude_ids:e};$.ajax({url:"/xhr/clients/search_overlay_modal",data:"utf8=\u2713&"+$.param(t)+"&select_type=multiple&customer_sheets_flg=1"})}),$("#customer_sheets_client_relation_modal").off("click").on("click","#clients_multiple_decision_in_customer_sheets",function(){var e=jQuery.map($('input[name="associate_clients_in_customer_sheets[]"]:checked'),function(e){return $(e).val()});if(0==e.length)return alert(I18n.t("js.common.please_select")),!1;var t={client_id:$("#customer_sheets_base_client_id").val(),client_relation_ids:e};$.ajax({type:"POST",url:"/xhr/client_relations/",data:t})}),$("#client_relation_contents").off("click").on("click",".remove_client_relation",function(){confirm($("#remove_relation_confirm_message").html())&&$.ajax({type:"POST",url:"/xhr/client_relations/"+$(this).data("client-relation-id"),data:{_method:"DELETE"}})}),$(".client_relation_more a").off("click.client_relation_more").off("mouseover.client_relation_more").on("click.client_relation_more",function(){return!1}).on("mouseover.client_relation_more",function(){CustomerSheets.get_client_relation_more()}),$(".sortable_client_relation").sortable({helper:"clone",axis:"y",opacity:.5,revert:!1,forceHelperSize:!0,placeholder:"draggable-placeholder",forcePlaceholderSize:!0,tolerance:"pointer",handle:".move_icon",start:function(e,t){t.item.startPos=t.item.index()},stop:function(e,t){$(t.item).css("z-index","auto");var n={start_index:t.item.startPos,current_index:t.item.index()};$.ajax({type:"PATCH",url:"/xhr/client_relations/"+$(t.item[0]).data("client-relation-id"),data:n})}});case"customer_sheets_contents_client":$("#btn01").click(function(e){return e.stopImmediatePropagation(),$("#content1").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn02").click(function(e){return e.stopImmediatePropagation(),$("#content2").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn03").click(function(e){return e.stopImmediatePropagation(),$("#content3").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn04").click(function(e){return e.stopImmediatePropagation(),$("#content4").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn05").click(function(e){return e.stopImmediatePropagation(),$("#content5").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn06").click(function(e){return e.stopImmediatePropagation(),$("#content6").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn07").click(function(e){return e.stopImmediatePropagation(),$("#content7").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn08").click(function(e){return e.stopImmediatePropagation(),$("#content8").slideToggle(),$(this).toggleClass("active"),!1}),$("#btn09").click(function(e){return e.stopImmediatePropagation(),$("#content9").slideToggle(),$(this).toggleClass("active"),!1})}},change_display_number_for_customer_sheets:function(){base_display_number_id="#display_number",base_change_display_number_id="#change_display_number",base_form_customer_sheets_id="#form_customer_sheets",$(document).on("change",".change_display_number_for_customer_sheets",function(){switch($(this).data("resource")){case"target_lists":$(base_display_number_id+"_target_lists").val($(base_change_display_number_id+"_target_lists").val()),$(base_form_customer_sheets_id+"_target_lists").submit();break;case"tasks":$(base_display_number_id+"_tasks").val($(base_change_display_number_id+"_tasks").val()),$(base_form_customer_sheets_id+"_tasks").submit();break;case"daily_reports":$(base_display_number_id+"_daily_reports").val($(base_change_display_number_id+"_daily_reports").val()),$(base_form_customer_sheets_id+"_daily_reports").submit();break;case"deals":$(base_display_number_id+"_deals").val($(base_change_display_number_id+"_deals").val()),$(base_form_customer_sheets_id+"_deals").submit();break;case"web_forms":$(base_display_number_id+"_web_forms").val($(base_change_display_number_id+"_web_forms").val()),$(base_form_customer_sheets_id+"_web_forms").submit();break;case"web_trackings":$(base_display_number_id+"_web_trackings").val($(base_change_display_number_id+"_web_trackings").val()),$(base_form_customer_sheets_id+"_web_trackings").submit();break;case"web_access_rankings":$(base_display_number_id+"_web_access_rankings").val($(base_change_display_number_id+"_web_access_rankings").val()),$(base_form_customer_sheets_id+"_web_access_rankings").submit();break;case"mail_histories":$(base_display_number_id+"_mail_histories").val($(base_change_display_number_id+"_mail_histories").val()),$(base_form_customer_sheets_id+"_mail_histories").submit();break;case"client_news":$(base_display_number_id+"_client_news").val($(base_change_display_number_id+"_client_news").val()),$(base_form_customer_sheets_id+"_client_news").submit();break;case"personnel_changes":$(base_display_number_id+"_personnel_changes").val($(base_change_display_number_id+"_personnel_changes").val()),$(base_form_customer_sheets_id+"_personnel_changes").submit();break;case"inside_sales":$(base_display_number_id+"_inside_sales").val($(base_change_display_number_id+"_inside_sales").val()),$(base_form_customer_sheets_id+"_inside_sales").submit();break;case"seminars":$(base_display_number_id+"_seminars").val($(base_change_display_number_id+"_seminars").val()),$(base_form_customer_sheets_id+"_seminars").submit();break;case"campaigns":$(base_display_number_id+"_campaigns").val($(base_change_display_number_id+"_campaigns").val()),$(base_form_customer_sheets_id+"_campaigns").submit();break;case"client_mail_histories":$(base_display_number_id+"_client_mail_histories").val($(base_change_display_number_id+"_client_mail_histories").val()),$(base_form_customer_sheets_id+"_client_mail_histories").submit();break;case"client_branches":$(base_display_number_id+"_client_branches").val($(base_change_display_number_id+"_client_branches").val()),$(base_form_customer_sheets_id+"_client_branches").submit()}})},change_order_for_customer_sheets:function(){base_order_key_id="#order_key",base_order_type_id="#order_type",base_form_customer_sheets_id="#form_customer_sheets",$(document).on("click",".order_head_for_customer_sheets",function(){switch($(this).data("resource")){case"target_lists":$(base_order_key_id+"_target_lists").val($(this).data("order-key")),$(
base_order_type_id+"_target_lists").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_target_lists").submit();break;case"tasks":$(base_order_key_id+"_tasks").val($(this).data("order-key")),$(base_order_type_id+"_tasks").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_tasks").submit();break;case"daily_reports":$(base_order_key_id+"_daily_reports").val($(this).data("order-key")),$(base_order_type_id+"_daily_reports").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_daily_reports").submit();break;case"deals":$(base_order_key_id+"_deals").val($(this).data("order-key")),$(base_order_type_id+"_deals").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_deals").submit();break;case"web_forms":$(base_order_key_id+"_web_forms").val($(this).data("order-key")),$(base_order_type_id+"_web_forms").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_web_forms").submit();break;case"web_trackings":$(base_order_key_id+"_web_trackings").val($(this).data("order-key")),$(base_order_type_id+"_web_trackings").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_web_trackings").submit();break;case"web_access_rankings":$(base_order_key_id+"_web_access_rankings").val($(this).data("order-key")),$(base_order_type_id+"_web_access_rankings").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_web_access_rankings").submit();break;case"mail_histories":$(base_order_key_id+"_mail_histories").val($(this).data("order-key")),$(base_order_type_id+"_mail_histories").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_mail_histories").submit();break;case"client_news":$(base_order_key_id+"_client_news").val($(this).data("order-key")),$(base_order_type_id+"_client_news").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_client_news").submit();break;case"personnel_changes":$(base_order_key_id+"_personnel_changes").val($(this).data("order-key")),$(base_order_type_id+"_personnel_changes").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_personnel_changes").submit();break;case"campaigns":$(base_order_key_id+"_campaigns").val($(this).data("order-key")),$(base_order_type_id+"_campaigns").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_campaigns").submit();break;case"client_mail_histories":$(base_order_key_id+"_client_mail_histories").val($(this).data("order-key")),$(base_order_type_id+"_client_mail_histories").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_client_mail_histories").submit();break;case"client_branches":$(base_order_key_id+"_client_branches").val($(this).data("order-key")),$(base_order_type_id+"_client_branches").val($(this).data("order-type")),$(base_form_customer_sheets_id+"_client_branches").submit()}})},change_display_template_for_customer_sheets:function(){base_form_customer_sheets_id="#form_customer_sheets",base_display_template_id="#display_template_id",base_change_display_template_flg="#change_display_template_flg",$(document).on("change",".js_select_change_display_template",function(){switch($(this).data("resource")){case"daily_reports":$(base_display_template_id+"_daily_reports").val($(this).val()),$(base_change_display_template_flg+"_daily_reports").val("1"),$(base_form_customer_sheets_id+"_daily_reports").submit();break;case"deals":$(base_display_template_id+"_deals").val($(this).val()),$(base_change_display_template_flg+"_deals").val("1"),$(base_form_customer_sheets_id+"_deals").submit()}})},cancel_loading_content:function(){ajax_content_load&&(ajax_content_load.abort(),$("#customer-sheets-contents-loading").remove())},resize_customer_sheets:function(){var e=.9*$("#modal_customer_sheets").height();if($("#customer_sheet_alert").length)var t=MODAL_CONTAIN_ALERT_HEIGHT_ADJUSTMENT;else t=MODAL_NO_ALERT_HEIGHT_ADJUSTMENT;var n=e-t;785<e?(e=785,n=715):e<551&&(e=552,n=482),$("#modal_customer_sheets .modal-content").height(e),$("#modal_customer_sheets .modal-body").height(n),$("#customer-sheets-contents").height(n),$(".modal-fixed-content-header").height(n),$("#customer-sheets-sidebar").height(n-40)},resize_chart_size:function(){var e=window.innerWidth;chartWidth=e<1120?0<1120-e?330-(1120-e):0:330,chartHeight=200,window.chart_consolidated_balance_sheet_prior1_year!==undefined&&window.chart_consolidated_balance_sheet_prior1_year.setSize(chartWidth,chartHeight),window.chart_consolidated_balance_sheet!==undefined&&window.chart_consolidated_balance_sheet.setSize(chartWidth,chartHeight),window.chart_non_consolidated_balance_sheet_prior1_year!==undefined&&window.chart_non_consolidated_balance_sheet_prior1_year.setSize(chartWidth,chartHeight),window.chart_non_consolidated_balance_sheet!==undefined&&window.chart_non_consolidated_balance_sheet.setSize(chartWidth,chartHeight),window.chart_consolidated_net_sales!==undefined&&window.chart_consolidated_net_sales.setSize(chartWidth,chartHeight),window.chart_consolidated_profits!==undefined&&window.chart_consolidated_profits.setSize(chartWidth,chartHeight),window.chart_non_consolidated_net_sales!==undefined&&window.chart_non_consolidated_net_sales.setSize(chartWidth,chartHeight),window.chart_non_consolidated_profits!==undefined&&window.chart_non_consolidated_profits.setSize(chartWidth,chartHeight),window.chart_consolidated_cash_flow!==undefined&&window.chart_consolidated_cash_flow.setSize(chartWidth,chartHeight),window.chart_non_consolidated_cash_flow!==undefined&&window.chart_non_consolidated_cash_flow.setSize(chartWidth,chartHeight)},get_client_relation_more:function(){$(".client_relation_more a").off("mouseover");var n=[];$(".client_relation_block").each(function(e,t){n.push($(t).data("client-relation-id"))}),$.ajax({url:$(".customer-sheets-sidebar .client_relations").attr("href")+"?exists_ids="+n,dataType:"script",beforeSend:function(){$("#customer_sheets_client_relations_index").prepend($("<div></div>",{id:"customer-sheets-contents-client-relation-loading","class":"contents-loading"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-3x loading-timeline"})))}})},get_sidebar_count:function(){var i=$.Deferred();$("#modal_customer_sheets .customer-sheets-sidebar ul").prepend($("<div></div>",{id:"customer-sheets-sidebar-loading","class":"contents-loading-sidebar"}).html($("<i></i>",{"class":"fa fa-spinner fa-pulse fa-3x loading-sidebar"}))),$("#js_select_change_client_div").prepend($("<i></i>",{id:"customer-sheets-js_select_change_client_div_loading","class":"fa fa-spinner fa-pulse fa-2x loading-sidebar",style:"position: absolute;top: -45%;left: 74%;color: #5bc0de;"}));var a=0,e=document.getElementById("customer_sheets_sidebar_list");findLi=e.children;for(var s=e.getElementsByClassName("sidebar_count").length,t=$("#js_select_change_client option:selected").data("contain-old-client-flg"),n=0;n<findLi.length;n++){var o=findLi[n].getElementsByTagName("a")[0];if(o!==undefined&&0!=o.getElementsByClassName("sidebar_count").length){var r=o.getAttribute("class");o.style.color=CONST_DISABLED_COLOR,o.setAttribute("data-enable-flg","false"),$.ajax({type:"GET",url:"/xhr/customer_sheets/sidebar_count/"+$("#customer_sheets_base_client_id").val()+"/",dataType:"json",data:{dataType:"json",id:$("#customer_sheets_base_client_id").val(),index:n,sidebar_list_name:r,contain_old_client_flg:t}}).done(function(e){var t=e.count;$("#modal_customer_sheets .customer-sheets-sidebar ."+e.list_name).find(".sidebar_count").text("\uff08"+t+"\uff09");var n=findLi[Number(e.index)].getElementsByTagName("a")[0];n.style.color=CONST_ENABLED_COLOR,n.setAttribute("data-enable-flg","true"),s<=++a&&($("#customer-sheets-sidebar-loading").remove(),$("#customer-sheets-js_select_change_client_div_loading").remove(),i.resolve())})}}return i.promise()},set_float_table_header:function(e){var t=$(e),n={floatTheadOn:function(){t.floatThead({position:"absolute",zIndex:function(){return 999},scrollContainer:function(e){return e.closest(".modal-fixed-content-header")}})},floatTheadOff:function(){t.not(".floatThead-table").floatThead("destroy")},reflow:function(){t.floatThead("reflow")}};return $("html,body").scrollLeft(0),n.floatTheadOn(),n.reflow(),$(document).on("floatTableUpdate",function(){t.floatThead("reflow")}),n},set_hidden_info_cell:function(e){$("#modal_customer_sheets").data("hidden-info-btn")&&$(e).find(".js-hidden-info-cell").remove()},change_customer_sheet_tab_type:function(){var e="#customer_sheet_tab_type_1",t="#customer_sheet_tab_type_2";$(document).on("change",".customer_sheet_tab_type",function(){$(e).is(":checked")?($("#customer_sheet_basic_info").show(),$("#customer_sheet_client_history").hide()):$(t).is(":checked")&&($("#customer_sheet_basic_info").hide(),$("#customer_sheet_client_history").show()),$(document).trigger("floatTableUpdate")})},removeCustomerSheetClientBranch:function(){var e=$('[data-target-id="customer_sheets_contents_client_branches"]').parent();target_id=e.find("a").data("target-id"),$("#"+target_id).remove()}},$(document).on("click","a.js_customer_sheets_show",function(){$(".user-information-show").is(":visible")&&$(".user-information-show").hide()}),$(window).resize(function(){0!=timer&&clearTimeout(timer),timer=setTimeout(function(){CustomerSheets.resize_customer_sheets(),CustomerSheets.resize_chart_size()},200)}),$(document).on("click",".cs-org-export-button",function(){lead_status=$("#only_active_lead_of_customer_sheets").is(":checked")?1:null,$("#customer_sheets_contents_organizations #only_active_lead_flg_as_export_condition").val(lead_status);var e=$("#show_uncontacted_officers_flg_on_customer_sheet").is(":checked")?1:null,t=!!$("#show_having_business_card_flg_on_customer_sheet").is(":checked");$("#customer_sheets_contents_organizations #show_uncontacted_officers_flg_as_export_condition").val(e),$("#customer_sheets_contents_organizations #show_having_business_card_flg_as_export_condition").val(t),$("#customer_sheets_contents_organizations #business_card_family_name_as_export_condition").val($("#customer_sheets_contents_organizations #search_business_card_family_name_in_customer_sheet").val()),$("#customer_sheets_contents_organizations #business_card_first_name_as_export_condition").val($("#customer_sheets_contents_organizations #search_business_card_first_name_in_customer_sheet").val()),$("#org_export_form_of_customer_sheet").submit()}),$(document).on("click","#client_old_org_export_button_in_customer_sheet",function(){var e=$("#only_active_lead_old_org_in_customer_sheet").is(":checked")?1:null,t=$("#show_uncontacted_officers_flg_old_org_in_customer_sheet").is(":checked")?1:null,n=!!$("#show_having_business_card_flg_old_org_in_customer_sheet").is(":checked");$("#only_active_lead_flg_as_export_condition_old_org_in_customer_sheet").val(e),$("#show_uncontacted_officers_flg_as_export_condition_old_org_in_customer_sheet").val(t),$("#show_having_business_card_flg_as_export_condition_old_org_in_customer_sheet").val(n),$("#business_card_family_name_as_export_condition_old_org_in_customer_sheet").val($("#search_business_card_family_name_in_customer_sheet").val()),$("#business_card_first_name_as_export_condition_old_org_in_customer_sheet").val($("#search_business_card_first_name_in_customer_sheet").val()),$("#org_export_form_of_customer_sheet_old_org").submit()}),Dealsheets=function(){function t(e){e.preventDefault()}var r,o,n;return init=function(e){r=e.data("deal-id"),o=e.data("display-template-id"),segment_id=e.data("deal-segment-id"),init_tooltips(),init_deal(),init_update_history(),init_timeline(),init_lead()},init_tooltips=function(){App.concerns.generate_tooptip($(".hp-tooltip-text")),$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"})},init_update_history=function(){n=1,scroll_container=function(e){if($container=$(e),!0!==$container.data("load")){if(e.scrollHeight===e.scrollTop+e.offsetHeight){if(n>=$("#deals_update_histories").data("num-pages"))return void $("#table_bottom").hide();if(!1===$container.data("load"))return $container.data("load",null),void $("#table_bottom").hide();$container.data("load",!0),n+=1,$.ajax({type:"GET",cache:!1,async:!0,data:{deal_id:r,display_template_id:o,narrow_down_value:$('input[name="narrow_down"]:radio:checked').val(),page:n},url:"/xhr/deals_sheets/deals/"+r+"/histories/additional"}).done(function(e){$("#deals_update_histories tbody").append(e),setTimeout(function(){var e=$("#scroll_container")[0];e.scrollHeight===e.offsetHeight&&$("#table_bottom").show(),$("#scroll_container").data("load",!1)},100)})}}else $("#table_bottom").show()},$("a[href='#deals_update_history']").click(function(){$.ajax({type:"GET",data:{display_template_id:o,deal_id:r},url:"/xhr/deals_sheets/deals/"+r+"/histories"}).done(function(){n=1,CustomerSheets.set_float_table_header("#deals_update_histories"),App.concerns.generate_tooptip($(".hp-tooltip-text")),$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"}),$("#table_bottom").hide(),$(document).on("change",'input[name="narrow_down"]:radio',function(){$this=$(this);var e=new App.concerns.loading_indicator($("#scroll_container"),{spin_area:"loading-spinner"});narrow_down_value=$(this).val(),e.ajax({type:"GET",async:!0,data:{deal_id:r,display_template_id:o,narrow_down_value:$this.val()},url:"/xhr/deals_sheets/deals/"+r+"/histories"},{done:function(){CustomerSheets.set_float_table_header("#deals_update_histories"),App.concerns.generate_tooptip($(".hp-tooltip-text")),$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"}),$("#table_bottom").hide(),$('input[name="narrow_down"]:radio[value="'+narrow_down_value+'"]').attr("checked",!0),$("#scroll_container").on("scroll",function(){scroll_container(this)})}}),n=1}),$("#scroll_container").on("scroll",function(){scroll_container(this)})})})},init_deal=function(){$(document).on("change",'[data-hp-role="edit_deals_process_item"],[data-hp-target="deal"]',function(){var t=this,e=$(this).prop("checked"),n=$(this).data("deals-process-item-id"),i=$(this).data("display-template-id"),a=$(this).data("process-item-id");if(e)var s="/xhr/deals_sheets/deals/"+r+"/process_items",o="POST";else s="/xhr/deals_sheets/deals/"+r+"/process_items/"+a,o="DELETE";$.ajax({url:s,type:o,dataType:"json",data:{deals_process_item_id:n,display_template_id:i}}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():"deny"===e.status?$("#error_message").html(e.message):$(t).data("process-item-id",e.id)})})},init_timeline=function(){$(document).on("click","#all-item-open",function(){$(".timeline-collups").addClass("collups-open"),$(".is-activity-timeline.collapse").collapse("show"),$(".is-activity-timeline.collapse").collapse("show"),$("#all-item-open").prop("disabled",!0),$("#all-item-close").prop("disabled",!1)}),$(document).on("click","#all-item-close",function(){$(".timeline-collups").removeClass("collups-open"),$(".is-activity-timeline.collapse.in").collapse("hide"),$("#all-item-open").prop("disabled",!1),$("#all-item-close").prop("disabled",!0)}),$(document).on("click",".panel_header_wrapper",function(e){if(!($(e.target).hasClass("hp-tooltip")||$(e.target).hasClass("btn-default")||$(e.target).attr("data-hp-role")||$(e.target).hasClass("js_open_modal_update_all"))){var t=$(e.target).parents(".timeline-panel").find(".collapse").attr("id");$("a[href='#"+t+"']").addClass("collups-open"),$("#"+t).collapse("show")}}),$(document).on("click",".panel_header_wrapper",function(e){if(!($(e.target).hasClass("hp-tooltip")||$(e.target).hasClass("btn-default")||$(e.target).attr("data-hp-role")||$(e.target).hasClass("js_open_modal_update_all"))){var t=$(e.target).parents(".timeline-panel").find(".collapse").attr("id");$("a[href='#"+t+"']").removeClass("collups-open"),$("#"+t).collapse("hide")}}),$(document).on("mouseenter","#get-previous-activity",function(){$(this).addClass("disabled"),$("#deals_segment_id").prop("disabled",!0);var e=$(this).data("page");$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_prev_activities",type:"GET",dataType:"script",data:{page:e}}).done(function(){""!=segment_id&&$("#deals_segment_id").prop("disabled",!1)})}),$(document).on("click","#get-next-activity",function(){$(this).prop("disabled",!0),$("#deals_segment_id").prop("disabled",!0);var e=$("#get-next-activity").data("page");$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_next_activities",type:"GET",dataType:"script",data:{page:e}}).done(function(){""!=segment_id&&$("#deals_segment_id").prop("disabled",!1)})}),$(document).on("mouseenter","#get-process-deal-occurs",function(){$(this).addClass("disabled"),$("#deals_segment_id").prop("disabled",!0);var e=$("#get-process-deal-occurs").data("page"),t=$("#get-process-deal-occurs").data("searchDealSegmentFlg");$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_process_deal_occurs",type:"GET",dataType:"script",data:{page:e,search_deal_segment_flg:t}}).done(function(){""!=segment_id&&$("#deals_segment_id").prop("disabled",!1)})}),$(document).on("click",'[data-hp-role="status_update"][data-update-type="task"]',function(){var e,t=$(this).attr("data-status-value"),n=$(this).attr("data-task-id"),i=$(this).text();switch($(this).closest("ul").siblings("span").text(i),$(this).closest("ul").siblings("span").removeClass(),t){case"1":e="btn btn-default not-started";break;case"2":e="btn btn-default in-progress";break;case"3":e="btn btn-default pending";break;case"4":e="btn btn-default completed"}$(this).closest("ul").siblings("span").addClass(e),$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/tasks/"+n+"/update_status/",type:"PUT",dataType:"json",data:{status:t}}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():"deny"===e.status?$("#error_message").html(e.message):reload_activities()})}),$(document).on("click",'[data-hp-role="task_destroy"]',function(){var e=$(this).attr("data-task-id");confirm(I18n.t("js.deals_sheets.delete_task"))&&$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/tasks/"+e,type:"DELETE",dataType:"json",data:{display_template_id:o}}).done(function(e){"error"===e.status?$("#error_message").html(e.message):reload_activities()})}),$(document).on("click",'[data-hp-role="daily_report_destroy"]',function(){var e=$(this).attr("data-daily-report-id");confirm(I18n.t("js.deals_sheets.delete_report"))&&$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/daily_reports/"+e,type:"DELETE",dataType:"json",data:{display_template_id:o}}).done(function(e){"error"===e.status?$("#error_message").html(e.message):reload_activities()})}),$(document).on("click","#deals_segment_id",function(){$("#get-process-deal-occurs").addClass("disabled"),$("#deals_segment_id").prop("disabled",!0),$("#deals_segment_id").is(":checked")?$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_activities",type:"GET",dataType:"script",data:{search_deal_segment_flg:!0}}).done(function(){""!=segment_id&&$("#deals_segment_id").prop("disabled",!1),$("#deals_segment_id").prop("checked",!0)}):$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_activities",type:"GET",dataType:"script"}).done(function(){""!=segment_id&&$("#deals_segment_id").prop("disabled",!1),$("#deals_segment_id").prop("checked",!1)})})},init_lead=function(){sortable_lead(),$(document).on("click",'.role-change[data-hp-role="change_lead_role"][data-hp-target="lead"]',function(e){e.preventDefault();var t=$(this),n=$(this).data("url");$.ajax({url:n,type:"PUT",dataType:"json"}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():"deny"===e.status?$("#error_message").html(e.message):reload_lead(t)})});var e=function(e,t,n){$(document).on("click",e,function(){var e=jQuery.map($(n+":checked"),function(e){return $(e).val()});return 0==e.length?(alert(I18n.t("js.common.please_select")),!1):jQuery.map($(n+":checked"),function(e){return $(e).data("check-permission")}).some(function(e){return e})?(alert(I18n.t("js.common.can_not_add_private_item")),!1):(e.push.apply(e,jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value})),$(t).val(e).trigger("change"),$(t).select2("open"),$(t).select2("close"),void $(this).closest(".modal").modal("hide"))})};$(document).on("click","#lead-add-modal",function(){$("#lead-add-modal").attr({"data-create-flg":"true"}),App.front_deals.reset_associated_button(),e("#leads_multiple_decision","#lead_ids2",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids2","multiple","#deal_client_id2",$("#unlink_clients_flg").val()),$("#open-associated-lead").trigger("click")}),$(document).on("click","#lead-add-modal-custom-item",function(){$(this).attr({"data-create-flg":"true"});var e=$(this).attr("data-item-id");App.front_deals.reset_associated_button(),t("#leads_multiple_decision","#lead_ids2_"+e,'input[name="associate_leads[]"]',e),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids2_"+e,"multiple","",$("#unlink_clients_flg").val()),$("#open-associated-lead").trigger("click")}),$(document).on("click","#lead-add-modal-customs",function(){var e=$(this).attr("data-item-id");$(document).off("click","#open-associated-lead-customs"),App.concerns.set_associate_entities_to_s2("#"+e+"_multiple_decision","#item_values_"+e,'input[name="associate_leads[]"]',"leads",!0),App.concerns.enable_associattion_search_tab_modal("#open-associated-lead-customs","/xhr/leads/search_as_association_modal","#item_values_"+e,"#"+e+"_temporary_business_card_lead","multiple",null,!0,"","",String(e)),$("#open-associated-lead-customs").trigger("click")});var t=function(e,i,a,s){$(document).on("click",e,function(){var e=jQuery.map($(a+":checked"),function(e){return $(e).val()});if(0==e.length)return alert(I18n.t("js.common.please_select")),!1;if(jQuery.map($(a+":checked"),function(e){return $(e).data("check-permission")}).some(function(e){return e}))return alert(I18n.t("js.common.can_not_add_private_item")),!1;e.push.apply(e,jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value}));var t=jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value});$(i).val(e);var n=$(i).val().split(",");$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/deals_item_values",type:"POST",dataType:"json",data:{lead_ids:n,display_template_id:o,item_id:s}}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():"leads-over"===e.status?(alert(e.message),$(i).val(t),n=$(i).val().split(",")):(e.messages&&App.concerns.display_notice_message(e.messages,!1,!0),reload_lead())}),$(i).select2("open"),$(i).select2("close"),$(this).closest(".modal").modal("hide")})};$(document).on("change","#lead_ids2",function(){var e=$(this).val().split(",");$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/deals_leads",type:"POST",dataType:"json",data:{lead_ids:e,display_template_id:o}}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():(e.messages&&App.concerns.display_notice_message(e.messages,!1,!0),reload_lead())})}),$(document).on("click",'.lead-delete[data-hp-role="destroy_deal_lead"][data-hp-target="lead"]',function(){var e=$(this).data("url"),t=$(this);$.ajax({url:e,type:"DELETE",dataType:"json"}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():reload_lead(t)})})},reload_lead=function(){var e=$("#lead-add-modal-custom-item").attr("data-item-id"),t=void 0===e?{display_template_id:o}:{display_template_id:o,item_id:e};$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_lead",data:t,type:"GET",dataType:"script"}).done(function(){reload_histories(),reload_details(),reload_deals_attribute(),sortable_lead(),reload_activities(),$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"})})},reload_activities=function(){$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_activities",type:"GET",dataType:"script",data:{display_template_id:o}})},reload_details=function(){$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_details",type:"GET",dataType:"script",data:{display_template_id:o}})},reload_info=function(){$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_info",type:"GET",dataType:"script",data:{display_template_id:o}})},reload_histories=function(){$.ajax({type:"GET",data:{display_template_id:o,deal_id:r},url:"/xhr/deals_sheets/deals/"+r+"/histories"}).done(function(){CustomerSheets.set_float_table_header("#deals_update_histories"),$("#table_bottom").hide(),n=1,$("#scroll_container").on("scroll",function(){scroll_container(this)})})},reload_activities=function(){var e=new App.concerns.loading_indicator($("#activities_timelin"),{spin_area:"loading-spinner"});document.addEventListener("mousewheel",t,{passive:!1}),e.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_activities",type:"GET",dataType:"script",data:{display_template_id:o}},{done:function(){document.removeEventListener("mousewheel",t,{passive:!1})}})},reload_deal_sheet=function(i,a){$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_deal",type:"GET",dataType:"script",data:{display_template_id:o}}).done(function(){for(var e=document.getElementById("js_notifications_recommends");e.firstChild;)e.removeChild(e.firstChild);if($("#check_reload_flg").data("deal-status")&&1==i&&($("#edit_deals_sheet_result_factor").click(),a&&$("#status_kbn").attr("data-status-kbn-search-group")==App.front_deals.DEAL_STATUS_ORDERED)){var t=window.location.pathname.split("/")[4],n="deal_detail";App.front_recommend.recommendScenarios(n,t)}})},reload_deals_attribute=function(){$.ajax({url:"/xhr/deals_sheets/deals/"+r+"/load_deals_attribute",type:"GET",dataType:"script",data:{display_template_id:o}})},reload_deal=function(e,t){location.href="/inheritance/deals/"+e+"/"+r+"/"+t},sortable_lead=function(){$(".sortable").sortable({cursor:"move",opacity:.7,update:function(){var e=$(this).data("url");$.ajax({url:e,type:"PUT",dataType:"json",data:$(this).sortable("serialize")}).done(function(e){"error"===e.status?confirm(e.message)&&location.reload():"deny"===e.status&&$("#error_message").html(e.message)})}}),$(".sortable").disableSelection()},{init:init,reload_deal:reload_deal,reload_deal_sheet:reload_deal_sheet,reload_activities:reload_activities,reload_lead:reload_lead,reload_details:reload_details,reload_histories:reload_histories,reload_deals_attribute:reload_deals_attribute,reload_info:reload_info}}(),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).html2canvas=t()}(this,function(){"use strict";function e(e,t){function n(){this.constructor=e}Ue(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function c(s,o,r,l){return new(r||(r=Promise))(function(e,t){function n(e){try{a(l.next(e))}catch(e){t(e)}}function i(e){try{a(l["throw"](e))}catch(e){t(e)}}function a(t){t.done?e(t.value):new r(function(e){e(t.value)}).then(n,i)}a((l=l.apply(s,o||[])).next())})}function F(n,i){function e(e){return function(t){return function(e){if(a)throw new TypeError("Generator is already executing.");for(;r;)try{if(a=1,s&&(o=2&e[0]?s["return"]:e[0]?s["throw"]||((o=s["return"])&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++,s=e[1],e=[0];continue;case 7:e=r.ops.pop(),r.trys.pop();continue;default:if(!(o=0<(o=r.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){r=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){r.label=e[1];break}if(6===e[0]&&r.label<o[1]){r.label=o[1],o=e;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(e);break}o[2]&&r.ops.pop(),r.trys.pop();continue}e=i.call(n,r)}catch(t){e=[6,t],s=0}finally{a=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}var a,s,o,t,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return t={next:e(0),"throw":e(1),"return":e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t}function a(e,t,n,i){this.left=e,this.top=t,this.width=n,this.height=i}function t(e,t,n){return e.slice?e.slice(t,n):new Uint16Array(Array.prototype.slice.call(e,t,n))}function n(e,t,n,i,a,s){this.initialValue=e,this.errorValue=t,this.highStart=n,this.highValueIndex=i,this.index=a,this.data=s}function f(e,t,n,i){var a=i[n];if(Array.isArray(e)?-1!==e.indexOf(a):e===a)for(var s=n;s<=i.length;){if((l=i[++s])===t)return!0;if(l!==lt)break}if(a===lt)for(s=n;0<s;){var o=i[--s];if(Array.isArray(e)?-1!==e.indexOf(o):e===o)for(var r=n;r<=i.length;){var l;if((l=i[++r])===t)return!0;if(l!==lt)break}if(o!==lt)break}return!1}function m(e,t){for(var n=e;0<=n;){var i=t[n];if(i!==lt)return i;n--}return 0}function d(e,t,n,i,a){if(0===n[i])return St;var s=i-1;if(Array.isArray(a)&&!0===a[s])return St;var o=s-1,r=1+s,l=t[s],c=0<=o?t[o]:0,d=t[r];if(2===l&&3===d)return St;if(-1!==Nt.indexOf(l))return"!";if(-1!==Nt.indexOf(d))return St;if(-1!==Ft.indexOf(d))return St;if(8===m(s,t))return"\xf7";if(11===Rt.get(e[s])&&(d===Tt||d===wt||d===kt))return St;if(7===l||7===d)return St;if(9===l)return St;if(-1===[lt,ct,dt].indexOf(l)&&9===d)return St;if(-1!==[ut,_t,ht,gt,yt].indexOf(d))return St;if(m(s,t)===mt)return St;if(f(23,mt,s,t))return St;if(f([ut,_t],ft,s,t))return St;if(f(12,12,s,t))return St;if(l===lt)return"\xf7";if(23===l||23===d)return St;if(16===d||16===l)return"\xf7";if(-1!==[ct,dt,ft].indexOf(d)||14===l)return St;if(36===c&&-1!==Lt.indexOf(l))return St;if(l===yt&&36===d)return St;if(d===pt&&-1!==Bt.concat(pt,ht,At,Tt,wt,kt).indexOf(l))return St;if(-1!==Bt.indexOf(d)&&l===At||-1!==Bt.indexOf(l)&&d===At)return St;if(l===bt&&-1!==[Tt,wt,kt].indexOf(d)||-1!==[Tt,wt,kt].indexOf(l)&&d===vt)return St;if(-1!==Bt.indexOf(l)&&-1!==Kt.indexOf(d)||-1!==Kt.indexOf(l)&&-1!==Bt.indexOf(d))return St;if(-1!==[bt,vt].indexOf(l)&&(d===At||-1!==[mt,dt].indexOf(d)&&t[1+r]===At)||-1!==[mt,dt].indexOf(l)&&d===At||l===At&&-1!==[At,yt,gt].indexOf(d))return St;if(-1!==[At,yt,gt,ut,_t].indexOf(d))for(var u=s;0<=u;){if((_=t[u])===At)return St;if(-1===[yt,gt].indexOf(_))break;u--}if(-1!==[bt,vt].indexOf(d))for(u=-1!==[ut,_t].indexOf(l)?o:s;0<=u;){var _;if((_=t[u])===At)return St;if(-1===[yt,gt].indexOf(_))break;u--}if(xt===l&&-1!==[xt,It,Ct,Et].indexOf(d)||-1!==[It,Ct].indexOf(l)&&-1!==[It,Dt].indexOf(d)||-1!==[Dt,Et].indexOf(l)&&d===Dt)return St;if(-1!==jt.indexOf(l)&&-1!==[pt,vt].indexOf(d)||-1!==jt.indexOf(d)&&l===bt)return St;if(-1!==Bt.indexOf(l)&&-1!==Bt.indexOf(d))return St;if(l===gt&&-1!==Bt.indexOf(d))return St;if(-1!==Bt.concat(At).indexOf(l)&&d===mt||-1!==Bt.concat(At).indexOf(d)&&l===_t)return St;if(41===l&&41===d){for(var h=n[s],p=1;0<h&&41===t[--h];)p++;if(p%2!=0)return St}return l===wt&&d===kt?St:"\xf7"}function u(n,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(e,a){void 0===a&&(a="strict");var s=[],o=[],r=[];return e.forEach(function(e,t){var n=Rt.get(e);if(50<n?(r.push(!0),n-=50):r.push(!1),-1!==["normal","auto","loose"].indexOf(a)&&-1!==[8208,8211,12316,12448].indexOf(e))return o.push(t),s.push(16);if(4!==n&&11!==n)return o.push(t),31===n?s.push("strict"===a?ft:Tt):n===Ot?s.push($t):29===n?s.push($t):43===n?131072<=e&&e<=196605||196608<=e&&e<=262141?s.push(Tt):s.push($t):void s.push(n);if(0===t)return o.push(t),s.push($t);var i=s[t-1];return-1===Mt.indexOf(i)?(o.push(o[t-1]),s.push(i)):(o.push(t),s.push($t))}),[o,s,r]}(n,e.lineBreak),i=t[0],a=t[1],s=t[2];return"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(a=a.map(function(e){return-1!==[At,$t,Ot].indexOf(e)?Tt:e})),[i,a,"keep-all"===e.wordBreak?s.map(function(e,t){return e&&19968<=n[t]&&n[t]<=40959}):void 0]}function i(e,t,n,i){this.codePoints=e,this.required="!"===t,this.start=n,this.end=i}function _(e){return 48<=e&&e<=57}function h(e){return _(e)||65<=e&&e<=70||97<=e&&e<=102}function p(e){return 10===e||9===e||32===e}function g(e){return 97<=e&&e<=122||65<=e&&e<=90||128<=e||95===e}function A(e){return g(e)||_(e)||45===e}function v(e,t){return 92===e&&10!==t}function b(e,t,n){return 45===e?g(t)||v(t,n):!!g(e)||!(92!==e||!v(e,t))}function y(e,t,n){return 43===e||45===e?!!_(t)||46===t&&_(n):_(46===e?t:e)}function s(){this._value=[]}function o(e){this._tokens=e}function r(e){return e.type===st.DIMENSION_TOKEN}function l(e){return e.type===st.NUMBER_TOKEN}function $(e){return e.type===st.IDENT_TOKEN}function w(e){return e.type===st.STRING_TOKEN}function k(e,t){return $(e)&&e.value===t}function C(e){return e.type!==st.WHITESPACE_TOKEN}function E(e){return e.type!==st.WHITESPACE_TOKEN&&e.type!==st.COMMA_TOKEN}function T(e){var t=[],n=[];return e.forEach(function(e){if(e.type===st.COMMA_TOKEN){if(0===n.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(n),void(n=[])}e.type!==st.WHITESPACE_TOKEN&&n.push(e)}),n.length&&t.push(n),t}function x(e){return e.type===st.NUMBER_TOKEN||e.type===st.DIMENSION_TOKEN}function I(e){
return e.type===st.PERCENTAGE_TOKEN||x(e)}function D(e){return 1<e.length?[e[0],e[1]]:[e[0]]}function O(e,t,n){var i=e[0],a=e[1];return[bn(i,t),bn(void 0!==a?a:i,n)]}function S(e){return e.type===st.DIMENSION_TOKEN&&("deg"===e.unit||"grad"===e.unit||"rad"===e.unit||"turn"===e.unit)}function R(e){switch(e.filter($).map(function(e){return e.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[gn,gn];case"to top":case"bottom":return $n(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[gn,vn];case"to right":case"left":return $n(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[vn,vn];case"to bottom":case"top":return $n(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[vn,gn];case"to left":case"right":return $n(270)}return 0}function B(e){return 0==(255&e)}function K(e){var t=255&e,n=255&e>>8,i=255&e>>16,a=255&e>>24;return t<255?"rgba("+a+","+i+","+n+","+t/255+")":"rgb("+a+","+i+","+n+")"}function N(e,t){if(e.type===st.NUMBER_TOKEN)return e.number;if(e.type!==st.PERCENTAGE_TOKEN)return 0;var n=3===t?1:255;return 3===t?e.number/100*n:Math.round(e.number/100*n)}function M(e){var t=e.filter(E);if(3===t.length){var n=t.map(N),i=n[0],a=n[1],s=n[2];return kn(i,a,s,1)}if(4!==t.length)return 0;var o=t.map(N),r=(i=o[0],a=o[1],s=o[2],o[3]);return kn(i,a,s,r)}function j(e,t,n){return n<0&&(n+=1),1<=n&&(n-=1),n<1/6?(t-e)*n*6+e:n<.5?t:n<2/3?6*(t-e)*(2/3-n)+e:e}function L(e){var t=e.filter(E),n=t[0],i=t[1],a=t[2],s=t[3],o=(n.type===st.NUMBER_TOKEN?$n(n.number):yn(n))/(2*Math.PI),r=I(i)?i.number/100:0,l=I(a)?a.number/100:0,c=void 0!==s&&I(s)?bn(s,1):1;if(0==r)return kn(255*l,255*l,255*l,1);var d=l<=.5?l*(1+r):l+r-l*r,u=2*l-d,_=j(u,d,o+1/3),h=j(u,d,o),p=j(u,d,o-1/3);return kn(255*_,255*h,255*p,c)}function P(e){var t=wn(e[0]),n=e[1];return n&&I(n)?{color:t,stop:n}:{color:t,stop:null}}function U(e,n){var t=e[0],i=e[e.length-1];null===t.stop&&(t.stop=gn),null===i.stop&&(i.stop=vn);for(var a=[],s=0,o=0;o<e.length;o++){var r=e[o].stop;if(null!==r){var l=bn(r,n);s<l?a.push(l):a.push(s),s=l}else a.push(null)}var c=null;for(o=0;o<a.length;o++){var d=a[o];if(null===d)null===c&&(c=o);else if(null!==c){for(var u=o-c,_=(d-a[c-1])/(1+u),h=1;h<=u;h++)a[c+h-1]=_*h;c=null}}return e.map(function(e,t){return{color:e.color,stop:Math.max(Math.min(1,a[t]/n),0)}})}function H(e,t,n){var i,a,s,o,r,l,c,d="number"==typeof e?e:(o=(a=t)/2,r=(s=n)/2,l=bn((i=e)[0],a)-o,c=r-bn(i[1],s),(Math.atan2(c,l)+2*Math.PI)%(2*Math.PI)),u=Math.abs(t*Math.sin(d))+Math.abs(n*Math.cos(d)),_=t/2,h=n/2,p=u/2,f=Math.sin(d-Math.PI/2)*p,m=Math.cos(d-Math.PI/2)*p;return[u,_-m,_+m,h-f,h+f]}function Q(e,t){return Math.sqrt(e*e+t*t)}function z(e,t,s,o,r){return[[0,0],[0,t],[e,0],[e,t]].reduce(function(e,t){var n=t[0],i=t[1],a=Q(s-n,o-i);return(r?a<e.optimumDistance:a>e.optimumDistance)?{optimumCorner:t,optimumDistance:a}:e},{optimumDistance:r?1/0:-1/0,optimumCorner:null}).optimumCorner}function q(e){var a=$n(180),s=[];return T(e).forEach(function(e,t){if(0===t){var n=e[0];if(n.type===st.IDENT_TOKEN&&-1!==["top","left","right","bottom"].indexOf(n.value))return void(a=R(e));if(S(n))return void(a=(yn(n)+$n(270))%$n(360))}var i=P(e);s.push(i)}),{angle:a,stops:s,type:Tn.LINEAR_GRADIENT}}function W(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]}function Y(e){var t=e.id,n=e.enabled;this.id=t,this.enabled=n,this.start=Date.now()}function V(){}function G(e,t){this.id=e,this._options=t,this._cache={}}function X(e){var a=In.CIRCLE,s=On.FARTHEST_CORNER,o=[],r=[];return T(e).forEach(function(e,t){var n=!0;if(0===t?n=e.reduce(function(e,t){if($(t))switch(t.value){case"center":return r.push(An),!1;case"top":case"left":return r.push(gn),!1;case"right":case"bottom":return r.push(vn),!1}else if(I(t)||x(t))return r.push(t),!1;return e},n):1===t&&(n=e.reduce(function(e,t){if($(t))switch(t.value){case"circle":return a=In.CIRCLE,!1;case Zn:return a=In.ELLIPSE,!1;case ei:case Vn:return s=On.CLOSEST_SIDE,!1;case Gn:return s=On.FARTHEST_SIDE,!1;case Xn:return s=On.CLOSEST_CORNER,!1;case"cover":case Jn:return s=On.FARTHEST_CORNER,!1}else if(x(t)||I(t))return Array.isArray(s)||(s=[]),s.push(t),!1;return e},n)),n){var i=P(e);o.push(i)}}),{size:s,shape:a,stops:o,position:r,type:Tn.RADIAL_GRADIENT}}function J(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:Ut.TYPE_VALUE,format:"color"}}function Z(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:Ut.LIST,parse:function(e){return D(e.filter(I))}}}function ee(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"none":return _i.NONE}return _i.SOLID}}}function te(e){return{name:"border-"+e+"-width",initialValue:"0",type:Ut.VALUE,prefix:!1,parse:function(e){return r(e)?e.number:0}}}function ne(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:Ut.TOKEN_VALUE}}function ie(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:Ut.TYPE_VALUE,format:"length-percentage"}}function ae(e,t){return 0!=(e&t)}function se(e,t,n){if(!e)return"";var i=e[Math.min(t,e.length-1)];return i?n?i.open:i.close:""}function oe(e){this.backgroundClip=ls(Rn,e.backgroundClip),this.backgroundColor=ls(Bn,e.backgroundColor),this.backgroundImage=ls(si,e.backgroundImage),this.backgroundOrigin=ls(oi,e.backgroundOrigin),this.backgroundPosition=ls(ri,e.backgroundPosition),this.backgroundRepeat=ls(di,e.backgroundRepeat),this.backgroundSize=ls(pi,e.backgroundSize),this.borderTopColor=ls(mi,e.borderTopColor),this.borderRightColor=ls(gi,e.borderRightColor),this.borderBottomColor=ls(Ai,e.borderBottomColor),this.borderLeftColor=ls(vi,e.borderLeftColor),this.borderTopLeftRadius=ls(bi,e.borderTopLeftRadius),this.borderTopRightRadius=ls(yi,e.borderTopRightRadius),this.borderBottomRightRadius=ls($i,e.borderBottomRightRadius),this.borderBottomLeftRadius=ls(wi,e.borderBottomLeftRadius),this.borderTopStyle=ls(Ei,e.borderTopStyle),this.borderRightStyle=ls(Ti,e.borderRightStyle),this.borderBottomStyle=ls(xi,e.borderBottomStyle),this.borderLeftStyle=ls(Ii,e.borderLeftStyle),this.borderTopWidth=ls(Di,e.borderTopWidth),this.borderRightWidth=ls(Oi,e.borderRightWidth),this.borderBottomWidth=ls(Si,e.borderBottomWidth),this.borderLeftWidth=ls(Ri,e.borderLeftWidth),this.boxShadow=ls(as,e.boxShadow),this.color=ls(Bi,e.color),this.display=ls(Ni,e.display),this["float"]=ls(Pi,e.cssFloat),this.fontFamily=ls(Ka,e.fontFamily),this.fontSize=ls(ja,e.fontSize),this.fontStyle=ls(Za,e.fontStyle),this.fontVariant=ls(Pa,e.fontVariant),this.fontWeight=ls(La,e.fontWeight),this.letterSpacing=ls(Ui,e.letterSpacing),this.lineBreak=ls(Hi,e.lineBreak),this.lineHeight=ls(Qi,e.lineHeight),this.listStyleImage=ls(zi,e.listStyleImage),this.listStylePosition=ls(Yi,e.listStylePosition),this.listStyleType=ls(Xi,e.listStyleType),this.marginTop=ls(Ji,e.marginTop),this.marginRight=ls(Zi,e.marginRight),this.marginBottom=ls(ea,e.marginBottom),this.marginLeft=ls(ta,e.marginLeft),this.opacity=ls(Ba,e.opacity);var t=ls(oa,e.overflow);this.overflowX=t[0],this.overflowY=t[1<t.length?1:0],this.overflowWrap=ls(ra,e.overflowWrap),this.paddingTop=ls(la,e.paddingTop),this.paddingRight=ls(ca,e.paddingRight),this.paddingBottom=ls(da,e.paddingBottom),this.paddingLeft=ls(ua,e.paddingLeft),this.position=ls(ga,e.position),this.textAlign=ls(pa,e.textAlign),this.textDecorationColor=ls(Na,e.textDecorationColor||e.color),this.textDecorationLine=ls(Fa,e.textDecorationLine),this.textShadow=ls(Aa,e.textShadow),this.textTransform=ls(ya,e.textTransform),this.transform=ls($a,e.transform),this.transformOrigin=ls(Ea,e.transformOrigin),this.visibility=ls(Ia,e.visibility),this.wordBreak=ls(Sa,e.wordBreak),this.zIndex=ls(Ra,e.zIndex)}function re(e){var t=Ua.call(this,e)||this;return t.src=e.currentSrc||e.src,t.intrinsicWidth=e.naturalWidth,t.intrinsicHeight=e.naturalHeight,jn.getInstance().addImage(t.src),t}function le(e){var t=Ha.call(this,e)||this;return t.canvas=e,t.intrinsicWidth=e.width,t.intrinsicHeight=e.height,t}function ce(e){var t=Qa.call(this,e)||this,n=new XMLSerializer;return t.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(e)),t.intrinsicWidth=e.width.baseVal.value,t.intrinsicHeight=e.height.baseVal.value,jn.getInstance().addImage(t.svg),t}function de(e){var t=za.call(this,e)||this;return t.value=e.value,t}function ue(e){var t=qa.call(this,e)||this;return t.start=e.start,t.reversed="boolean"==typeof e.reversed&&!0===e.reversed,t}function _e(e){var t,n,i,a=Wa.call(this,e)||this;switch(a.type=e.type.toLowerCase(),a.checked=e.checked,a.value=0===(i=(n=e).type===xs?new Array(n.value.length+1).join("\u2022"):n.value).length?n.placeholder||"":i,a.type!==Es&&a.type!==Ts||(a.styles.backgroundColor=3739148031,a.styles.borderTopColor=a.styles.borderRightColor=a.styles.borderBottomColor=a.styles.borderLeftColor=2779096575,a.styles.borderTopWidth=a.styles.borderRightWidth=a.styles.borderBottomWidth=a.styles.borderLeftWidth=1,a.styles.borderTopStyle=a.styles.borderRightStyle=a.styles.borderBottomStyle=a.styles.borderLeftStyle=_i.SOLID,a.styles.backgroundClip=[Qt.BORDER_BOX],a.styles.backgroundOrigin=[0],a.bounds=(t=a.bounds).width>t.height?new Qe(t.left+(t.width-t.height)/2,t.top,t.height,t.height):t.width<t.height?new Qe(t.left,t.top+(t.height-t.width)/2,t.width,t.width):t),a.type){case Es:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=ks;break;case Ts:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=Cs}return a}function he(e){var t=Ya.call(this,e)||this,n=e.options[e.selectedIndex||0];return t.value=n&&n.text||"",t}function pe(e){var t=Va.call(this,e)||this;return t.value=e.value,t}function fe(e){return wn(fn.create(e).parseComponentValue())}function me(e){var t=Ga.call(this,e)||this;t.src=e.src,t.width=parseInt(e.width,10)||0,t.height=parseInt(e.height,10)||0,t.backgroundColor=t.styles.backgroundColor;try{if(e.contentWindow&&e.contentWindow.document&&e.contentWindow.document.documentElement){t.tree=Ks(e.contentWindow.document.documentElement);var n=e.contentWindow.document.documentElement?fe(getComputedStyle(e.contentWindow.document.documentElement).backgroundColor):En.TRANSPARENT,i=e.contentWindow.document.body?fe(getComputedStyle(e.contentWindow.document.body).backgroundColor):En.TRANSPARENT;t.backgroundColor=B(n)?B(i)?t.styles.backgroundColor:i:n}}catch(e){}return t}function ge(e){return"STYLE"===e.tagName}function Ae(){this.counters={}}function ve(i,e,t,a,n,s){return i<e||t<i?so(i,n,0<s.length):a.integers.reduce(function(e,t,n){for(;t<=i;)i-=t,e+=a.values[n];return e},"")+s}function be(e,t,n,i){for(var a="";n||e--,a=i(e)+a,t<=(e/=t)*t;);return a}function ye(e,t,n,i,a){var s=n-t+1;return(e<0?"-":"")+(be(Math.abs(e),s,i,function(e){return We(Math.floor(e%s)+t)})+a)}function $e(e,t,n){void 0===n&&(n=". ");var i=t.length;return be(Math.abs(e),i,!1,function(e){return t[Math.floor(e%i)]})+n}function we(e,t,n,i,a,s){if(e<-9999||9999<e)return so(e,qi.CJK_DECIMAL,0<a.length);var o=Math.abs(e),r=a;if(0===o)return t[0]+r;for(var l=0;0<o&&l<=4;l++){var c=o%10;0==c&&ae(s,1)&&""!==r?r=t[c]+r:1<c||1==c&&0===l||1==c&&1===l&&ae(s,2)||1==c&&1===l&&ae(s,4)&&100<e||1==c&&1<l&&ae(s,8)?r=t[c]+(0<l?n[l-1]:"")+r:1==c&&0<l&&(r=n[l-1]+r),o=Math.floor(o/10)}return(e<0?i:"")+r}function ke(e,t){if(this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Zs,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement)}function Ce(e,n){return e.length===n.length&&e.some(function(e,t){return e===n[t]})}function Ee(e,t){this.type=lo.VECTOR,this.x=e,this.y=t}function Te(e,t,n){return new ko(e.x+(t.x-e.x)*n,e.y+(t.y-e.y)*n)}function xe(e,t,n,i){this.type=lo.BEZIER_CURVE,this.start=e,this.startControl=t,this.endControl=n,this.end=i}function Ie(e){return e.type===lo.BEZIER_CURVE}function De(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]}function Oe(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]}function Se(e,t){if(this.container=e,this.effects=t.slice(0),this.curves=new Eo(e),null!==e.styles.transform){var n=e.bounds.left+e.styles.transformOrigin[0].number,i=e.bounds.top+e.styles.transformOrigin[1].number,a=e.styles.transform;this.effects.push(new xo(n,i,a))}if(e.styles.overflowX!==Vi.VISIBLE){var s=De(this.curves),o=Oe(this.curves);Ce(s,o)?this.effects.push(new Io(s,6)):(this.effects.push(new Io(s,2)),this.effects.push(new Io(o,4)))}}function Re(e){var t=e.bounds,n=e.styles;return t.add(n.borderLeftWidth,n.borderTopWidth,-(n.borderRightWidth+n.borderLeftWidth),-(n.borderTopWidth+n.borderBottomWidth))}function Be(e){var t=e.styles,n=e.bounds,i=bn(t.paddingLeft,n.width),a=bn(t.paddingRight,n.width),s=bn(t.paddingTop,n.width),o=bn(t.paddingBottom,n.width);return n.add(i+t.borderLeftWidth,s+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+i+a),-(t.borderTopWidth+t.borderBottomWidth+s+o))}function Ne(e,t,n){var i,a,s,o,r=(s=Fo(e.styles.backgroundOrigin,t),o=e,0===s?o.bounds:2===s?Be(o):Re(o)),l=(i=Fo(e.styles.backgroundClip,t),a=e,i===Qt.BORDER_BOX?a.bounds:i===Qt.CONTENT_BOX?Be(a):Re(a)),c=No(Fo(e.styles.backgroundSize,t),n,r),d=c[0],u=c[1],_=O(Fo(e.styles.backgroundPosition,t),r.width-d,r.height-u);return[Ko(Fo(e.styles.backgroundRepeat,t),_,c,r,l),Math.round(r.left+_[0]),Math.round(r.top+_[1]),d,u]}function Fe(e){return $(e)&&e.value===li.AUTO}function Ke(e){return"number"==typeof e}function Me(e){this._data={},this._document=e}function je(e){this._activeEffects=[],this.canvas=e.canvas?e.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),(this.options=e).canvas||(this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px"),this.fontMetrics=new jo(document),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x+e.scrollX,-e.y+e.scrollY),this.ctx.textBaseline="bottom",this._activeEffects=[],Mn.getInstance(e.id).debug("Canvas renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+e.scale)}function Le(e){this.canvas=e.canvas?e.canvas:document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.options=e,this.canvas.width=Math.floor(e.width*e.scale),this.canvas.height=Math.floor(e.height*e.scale),this.canvas.style.width=e.width+"px",this.canvas.style.height=e.height+"px",this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-e.x+e.scrollX,-e.y+e.scrollY),Mn.getInstance(e.id).debug("EXPERIMENTAL ForeignObject renderer initialized ("+e.width+"x"+e.height+" at "+e.x+","+e.y+") with scale "+e.scale)}function Pe(e){return wn(fn.create(e).parseComponentValue())}for(var Ue=function(e,t){return(Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},He=function(){return(He=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Qe=(a.prototype.add=function(e,t,n,i){return new a(this.left+e,this.top+t,this.width+n,this.height+i)},a.fromClientRect=function(e){return new a(e.left,e.top,e.width,e.height)},a),ze=function(e){return Qe.fromClientRect(e.getBoundingClientRect())},qe=function(e){for(var t=[],n=0,i=e.length;n<i;){var a=e.charCodeAt(n++);if(55296<=a&&a<=56319&&n<i){var s=e.charCodeAt(n++);56320==(64512&s)?t.push(((1023&a)<<10)+(1023&s)+65536):(t.push(a),n--)}else t.push(a)}return t},We=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var n=e.length;if(!n)return"";for(var i=[],a=-1,s="";++a<n;){var o=e[a];o<=65535?i.push(o):(o-=65536,i.push(55296+(o>>10),o%1024+56320)),(a+1===n||16384<i.length)&&(s+=String.fromCharCode.apply(String,i),i.length=0)}return s},Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ve="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Ge=0;Ge<Ye.length;Ge++)Ve[Ye.charCodeAt(Ge)]=Ge;var Xe,Je,Ze,et,tt,nt,it,at,st,ot,rt=(n.prototype.get=function(e){var t;if(0<=e){if(e<55296||56319<e&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},n),lt=10,ct=13,dt=15,ut=17,_t=18,ht=19,pt=20,ft=21,mt=22,gt=24,At=25,vt=26,bt=27,yt=28,$t=30,wt=32,kt=33,Ct=34,Et=35,Tt=37,xt=38,It=39,Dt=40,Ot=42,St="\xd7",Rt=(Xe=function(e){var t,n,i,a,s,o=.75*e.length,r=e.length,l=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(o):new Array(o),d=Array.isArray(c)?c:new Uint8Array(c);for(t=0;t<r;t+=4)n=Ve[e.charCodeAt(t)],i=Ve[e.charCodeAt(t+1)],a=Ve[e.charCodeAt(t+2)],s=Ve[e.charCodeAt(t+3)],d[l++]=n<<2|i>>4,d[l++]=(15&i)<<4|a>>2,d[l++]=(3&a)<<6|63&s;return c}(
"KwAAAAAAAAAACA4AIDoAAPAfAAACAAAAAAAIABAAGABAAEgAUABYAF4AZgBeAGYAYABoAHAAeABeAGYAfACEAIAAiACQAJgAoACoAK0AtQC9AMUAXgBmAF4AZgBeAGYAzQDVAF4AZgDRANkA3gDmAOwA9AD8AAQBDAEUARoBIgGAAIgAJwEvATcBPwFFAU0BTAFUAVwBZAFsAXMBewGDATAAiwGTAZsBogGkAawBtAG8AcIBygHSAdoB4AHoAfAB+AH+AQYCDgIWAv4BHgImAi4CNgI+AkUCTQJTAlsCYwJrAnECeQKBAk0CiQKRApkCoQKoArACuALAAsQCzAIwANQC3ALkAjAA7AL0AvwCAQMJAxADGAMwACADJgMuAzYDPgOAAEYDSgNSA1IDUgNaA1oDYANiA2IDgACAAGoDgAByA3YDfgOAAIQDgACKA5IDmgOAAIAAogOqA4AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAK8DtwOAAIAAvwPHA88D1wPfAyAD5wPsA/QD/AOAAIAABAQMBBIEgAAWBB4EJgQuBDMEIAM7BEEEXgBJBCADUQRZBGEEaQQwADAAcQQ+AXkEgQSJBJEEgACYBIAAoASoBK8EtwQwAL8ExQSAAIAAgACAAIAAgACgAM0EXgBeAF4AXgBeAF4AXgBeANUEXgDZBOEEXgDpBPEE+QQBBQkFEQUZBSEFKQUxBTUFPQVFBUwFVAVcBV4AYwVeAGsFcwV7BYMFiwWSBV4AmgWgBacFXgBeAF4AXgBeAKsFXgCyBbEFugW7BcIFwgXIBcIFwgXQBdQF3AXkBesF8wX7BQMGCwYTBhsGIwYrBjMGOwZeAD8GRwZNBl4AVAZbBl4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAGMGXgBqBnEGXgBeAF4AXgBeAF4AXgBeAF4AXgB5BoAG4wSGBo4GkwaAAIADHgR5AF4AXgBeAJsGgABGA4AAowarBrMGswagALsGwwbLBjAA0wbaBtoG3QbaBtoG2gbaBtoG2gblBusG8wb7BgMHCwcTBxsHCwcjBysHMAc1BzUHOgdCB9oGSgdSB1oHYAfaBloHaAfaBlIH2gbaBtoG2gbaBtoG2gbaBjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHbQdeAF4ANQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQd1B30HNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B4MH2gaKB68EgACAAIAAgACAAIAAgACAAI8HlwdeAJ8HpweAAIAArwe3B14AXgC/B8UHygcwANAH2AfgB4AA6AfwBz4B+AcACFwBCAgPCBcIogEYAR8IJwiAAC8INwg/CCADRwhPCFcIXwhnCEoDGgSAAIAAgABvCHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIfQh3CHgIeQh6CHsIfAh9CHcIeAh5CHoIewh8CH0Idwh4CHkIegh7CHwIhAiLCI4IMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAANQc1BzUHNQc1BzUHNQc1BzUHNQc1B54INQc1B6II2gaqCLIIugiAAIAAvgjGCIAAgACAAIAAgACAAIAAgACAAIAAywiHAYAA0wiAANkI3QjlCO0I9Aj8CIAAgACAAAIJCgkSCRoJIgknCTYHLwk3CZYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiWCJYIlgiAAIAAAAFAAXgBeAGAAcABeAHwAQACQAKAArQC9AJ4AXgBeAE0A3gBRAN4A7AD8AMwBGgEAAKcBNwEFAUwBXAF4QkhCmEKnArcCgAHHAsABz4LAAcABwAHAAd+C6ABoAG+C/4LAAcABwAHAAc+DF4MAAcAB54M3gweDV4Nng3eDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEeDqABVg6WDqABoQ6gAaABoAHXDvcONw/3DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DvcO9w73DncPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB7cPPwlGCU4JMACAAIAAgABWCV4JYQmAAGkJcAl4CXwJgAkwADAAMAAwAIgJgACLCZMJgACZCZ8JowmrCYAAswkwAF4AXgB8AIAAuwkABMMJyQmAAM4JgADVCTAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAqwYWBNkIMAAwADAAMADdCeAJ6AnuCR4E9gkwAP4JBQoNCjAAMACAABUK0wiAAB0KJAosCjQKgAAwADwKQwqAAEsKvQmdCVMKWwowADAAgACAALcEMACAAGMKgABrCjAAMAAwADAAMAAwADAAMAAwADAAMAAeBDAAMAAwADAAMAAwADAAMAAwADAAMAAwAIkEPQFzCnoKiQSCCooKkAqJBJgKoAqkCokEGAGsCrQKvArBCjAAMADJCtEKFQHZCuEK/gHpCvEKMAAwADAAMACAAIwE+QowAIAAPwEBCzAAMAAwADAAMACAAAkLEQswAIAAPwEZCyELgAAOCCkLMAAxCzkLMAAwADAAMAAwADAAXgBeAEELMAAwADAAMAAwADAAMAAwAEkLTQtVC4AAXAtkC4AAiQkwADAAMAAwADAAMAAwADAAbAtxC3kLgAuFC4sLMAAwAJMLlwufCzAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAApwswADAAMACAAIAAgACvC4AAgACAAIAAgACAALcLMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAvwuAAMcLgACAAIAAgACAAIAAyguAAIAAgACAAIAA0QswADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAANkLgACAAIAA4AswADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACJCR4E6AswADAAhwHwC4AA+AsADAgMEAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMACAAIAAGAwdDCUMMAAwAC0MNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQw1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHPQwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADUHNQc1BzUHNQc1BzUHNQc2BzAAMAA5DDUHNQc1BzUHNQc1BzUHNQc1BzUHNQdFDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAgACAAIAATQxSDFoMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAF4AXgBeAF4AXgBeAF4AYgxeAGoMXgBxDHkMfwxeAIUMXgBeAI0MMAAwADAAMAAwAF4AXgCVDJ0MMAAwADAAMABeAF4ApQxeAKsMswy7DF4Awgy9DMoMXgBeAF4AXgBeAF4AXgBeAF4AXgDRDNkMeQBqCeAM3Ax8AOYM7Az0DPgMXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXgCgAAANoAAHDQ4NFg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAeDSYNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIAAgACAAIAAgACAAC4NMABeAF4ANg0wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAD4NRg1ODVYNXg1mDTAAbQ0wADAAMAAwADAAMAAwADAA2gbaBtoG2gbaBtoG2gbaBnUNeg3CBYANwgWFDdoGjA3aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gaUDZwNpA2oDdoG2gawDbcNvw3HDdoG2gbPDdYN3A3fDeYN2gbsDfMN2gbaBvoN/g3aBgYODg7aBl4AXgBeABYOXgBeACUG2gYeDl4AJA5eACwO2w3aBtoGMQ45DtoG2gbaBtoGQQ7aBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDjUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B1EO2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQdZDjUHNQc1BzUHNQc1B2EONQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHaA41BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B3AO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gY1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1BzUHNQc1B2EO2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gZJDtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBtoG2gbaBkkOeA6gAKAAoAAwADAAMAAwAKAAoACgAKAAoACgAKAAgA4wADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAD//wQABAAEAAQABAAEAAQABAAEAA0AAwABAAEAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAKABMAFwAeABsAGgAeABcAFgASAB4AGwAYAA8AGAAcAEsASwBLAEsASwBLAEsASwBLAEsAGAAYAB4AHgAeABMAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAFgAbABIAHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYADQARAB4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkAFgAaABsAGwAbAB4AHQAdAB4ATwAXAB4ADQAeAB4AGgAbAE8ATwAOAFAAHQAdAB0ATwBPABcATwBPAE8AFgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwArAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAAQABAANAA0ASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAUAArACsAKwArACsAKwArACsABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAGgAaAFAAUABQAFAAUABMAB4AGwBQAB4AKwArACsABAAEAAQAKwBQAFAAUABQAFAAUAArACsAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUAArAFAAUAArACsABAArAAQABAAEAAQABAArACsAKwArAAQABAArACsABAAEAAQAKwArACsABAArACsAKwArACsAKwArAFAAUABQAFAAKwBQACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwAEAAQAUABQAFAABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUAArACsABABQAAQABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQAKwArAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeABsAKwArACsAKwArACsAKwBQAAQABAAEAAQABAAEACsABAAEAAQAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArAAQABAArACsABAAEAAQAKwArACsAKwArACsAKwArAAQABAArACsAKwArAFAAUAArAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwAeAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwAEAFAAKwBQAFAAUABQAFAAUAArACsAKwBQAFAAUAArAFAAUABQAFAAKwArACsAUABQACsAUAArAFAAUAArACsAKwBQAFAAKwArACsAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQAKwArACsABAAEAAQAKwAEAAQABAAEACsAKwBQACsAKwArACsAKwArAAQAKwArACsAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAB4AHgAeAB4AHgAeABsAHgArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArAFAAUABQACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAB4AUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABAArACsAKwArACsAKwArAAQABAArACsAKwArACsAKwArAFAAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwArAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAKwBcAFwAKwBcACsAKwBcACsAKwArACsAKwArAFwAXABcAFwAKwBcAFwAXABcAFwAXABcACsAXABcAFwAKwBcACsAXAArACsAXABcACsAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgArACoAKgBcACsAKwBcAFwAXABcAFwAKwBcACsAKgAqACoAKgAqACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAFwAXABcAFwAUAAOAA4ADgAOAB4ADgAOAAkADgAOAA0ACQATABMAEwATABMACQAeABMAHgAeAB4ABAAEAB4AHgAeAB4AHgAeAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUAANAAQAHgAEAB4ABAAWABEAFgARAAQABABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAAQABAAEAAQABAANAAQABABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsADQANAB4AHgAeAB4AHgAeAAQAHgAeAB4AHgAeAB4AKwAeAB4ADgAOAA0ADgAeAB4AHgAeAB4ACQAJACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgAeAB4AHgBcAFwAXABcAFwAXAAqACoAKgAqAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAKgAqACoAKgAqACoAKgBcAFwAXAAqACoAKgAqAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAXAAqAEsASwBLAEsASwBLAEsASwBLAEsAKgAqACoAKgAqACoAUABQAFAAUABQAFAAKwBQACsAKwArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQACsAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwAEAAQABAAeAA0AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAEQArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAADQANAA0AUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAA0ADQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQACsABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoADQANABUAXAANAB4ADQAbAFwAKgArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAB4AHgATABMADQANAA4AHgATABMAHgAEAAQABAAJACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAUABQAFAAUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwAeACsAKwArABMAEwBLAEsASwBLAEsASwBLAEsASwBLAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwBcAFwAXABcAFwAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcACsAKwArACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwAeAB4AXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsABABLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKgAqACoAKgAqACoAKgBcACoAKgAqACoAKgAqACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAUABQAFAAUABQAFAAUAArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4ADQANAA0ADQAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAHgAeAB4AHgBQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwANAA0ADQANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwBQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsABAAEAAQAHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAABABQAFAAUABQAAQABAAEAFAAUAAEAAQABAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAKwBQACsAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAKwArAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAKwAeAB4AHgAeAB4AHgAeAA4AHgArAA0ADQANAA0ADQANAA0ACQANAA0ADQAIAAQACwAEAAQADQAJAA0ADQAMAB0AHQAeABcAFwAWABcAFwAXABYAFwAdAB0AHgAeABQAFAAUAA0AAQABAAQABAAEAAQABAAJABoAGgAaABoAGgAaABoAGgAeABcAFwAdABUAFQAeAB4AHgAeAB4AHgAYABYAEQAVABUAFQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgANAB4ADQANAA0ADQAeAA0ADQANAAcAHgAeAB4AHgArAAQABAAEAAQABAAEAAQABAAEAAQAUABQACsAKwBPAFAAUABQAFAAUAAeAB4AHgAWABEATwBQAE8ATwBPAE8AUABQAFAAUABQAB4AHgAeABYAEQArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAaABsAGwAbABsAGgAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgBQABoAHgAdAB4AUAAeABoAHgAeAB4AHgAeAB4AHgAeAB4ATwAeAFAAGwAeAB4AUABQAFAAUABQAB4AHgAeAB0AHQAeAFAAHgBQAB4AUAAeAFAATwBQAFAAHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AUABQAFAAUABPAE8AUABQAFAAUABQAE8AUABQAE8AUABPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAE8ATwBPAE8ATwBPAE8ATwBPAE8AUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAATwAeAB4AKwArACsAKwAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB0AHQAeAB4AHgAdAB0AHgAeAB0AHgAeAB4AHQAeAB0AGwAbAB4AHQAeAB4AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB0AHgAdAB4AHQAdAB0AHQAdAB0AHgAdAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAdAB0AHQAdAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAlACUAHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBQAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAeAB4AHgAeAB0AHQAeAB4AHgAeAB0AHQAdAB4AHgAdAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB0AHQAeAB4AHQAeAB4AHgAeAB0AHQAeAB4AHgAeACUAJQAdAB0AJQAeACUAJQAlACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAHgAeAB4AHgAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHQAdAB0AHgAdACUAHQAdAB4AHQAdAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHQAdAB0AHQAlAB4AJQAlACUAHQAlACUAHQAdAB0AJQAlAB0AHQAlAB0AHQAlACUAJQAeAB0AHgAeAB4AHgAdAB0AJQAdAB0AHQAdAB0AHQAlACUAJQAlACUAHQAlACUAIAAlAB0AHQAlACUAJQAlACUAJQAlACUAHgAeAB4AJQAlACAAIAAgACAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeABcAFwAXABcAFwAXAB4AEwATACUAHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACUAJQBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwArACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAE8ATwBPAE8ATwBPAE8ATwAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeACsAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUAArACsAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQBQAFAAUABQACsAKwArACsAUABQAFAAUABQAFAAUABQAA0AUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAABAAEAAQAKwAEAAQAKwArACsAKwArAAQABAAEAAQAUABQAFAAUAArAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsABAAEAAQAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsADQANAA0ADQANAA0ADQANAB4AKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAUABQAFAAUABQAA0ADQANAA0ADQANABQAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwANAA0ADQANAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAeAAQABAAEAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLACsADQArAB4AKwArAAQABAAEAAQAUABQAB4AUAArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwAEAAQABAAEAAQABAAEAAQABAAOAA0ADQATABMAHgAeAB4ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0AUABQAFAAUAAEAAQAKwArAAQADQANAB4AUAArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXABcAA0ADQANACoASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUAArACsAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANACsADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEcARwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQACsAKwAeAAQABAANAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAEAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUAArACsAUAArACsAUABQACsAKwBQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AKwArAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAeAB4ADQANAA0ADQAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAArAAQABAArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAEAAQABAAEAAQABAAEACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAFgAWAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAKwBQACsAKwArACsAKwArAFAAKwArACsAKwBQACsAUAArAFAAKwBQAFAAUAArAFAAUAArAFAAKwArAFAAKwBQACsAUAArAFAAKwBQACsAUABQACsAUAArACsAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAUABQAFAAUAArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUAArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAlACUAJQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeACUAJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeACUAJQAlACUAJQAeACUAJQAlACUAJQAgACAAIAAlACUAIAAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIQAhACEAIQAhACUAJQAgACAAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAIAAlACUAJQAlACAAJQAgACAAIAAgACAAIAAgACAAIAAlACUAJQAgACUAJQAlACUAIAAgACAAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeACUAHgAlAB4AJQAlACUAJQAlACAAJQAlACUAJQAeACUAHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAIAAgACAAIAAgAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFwAXABcAFQAVABUAHgAeAB4AHgAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAIAAgACAAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAlACAAIAAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsA"
),Je=Array.isArray(Xe)?function(e){for(var t=e.length,n=[],i=0;i<t;i+=4)n.push(e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i]);return n}(Xe):new Uint32Array(Xe),et=t(Ze=Array.isArray(Xe)?function(e){for(var t=e.length,n=[],i=0;i<t;i+=2)n.push(e[i+1]<<8|e[i]);return n}(Xe):new Uint16Array(Xe),12,Je[4]/2),tt=2===Je[5]?t(Ze,(24+Je[4])/2):(nt=Je,it=Math.ceil((24+Je[4])/4),nt.slice?nt.slice(it,at):new Uint32Array(Array.prototype.slice.call(nt,it,at))),new rt(Je[0],Je[1],Je[2],Je[3],et,tt)),Bt=[$t,36],Nt=[1,2,3,5],Ft=[lt,8],Kt=[bt,vt],Mt=Nt.concat(Ft),jt=[xt,It,Dt,Ct,Et],Lt=[dt,ct],Pt=(i.prototype.slice=function(){return We.apply(void 0,this.codePoints.slice(this.start,this.end))},i);(ot=st||(st={}))[ot.STRING_TOKEN=0]="STRING_TOKEN",ot[ot.BAD_STRING_TOKEN=1]="BAD_STRING_TOKEN",ot[ot.LEFT_PARENTHESIS_TOKEN=2]="LEFT_PARENTHESIS_TOKEN",ot[ot.RIGHT_PARENTHESIS_TOKEN=3]="RIGHT_PARENTHESIS_TOKEN",ot[ot.COMMA_TOKEN=4]="COMMA_TOKEN",ot[ot.HASH_TOKEN=5]="HASH_TOKEN",ot[ot.DELIM_TOKEN=6]="DELIM_TOKEN",ot[ot.AT_KEYWORD_TOKEN=7]="AT_KEYWORD_TOKEN",ot[ot.PREFIX_MATCH_TOKEN=8]="PREFIX_MATCH_TOKEN",ot[ot.DASH_MATCH_TOKEN=9]="DASH_MATCH_TOKEN",ot[ot.INCLUDE_MATCH_TOKEN=10]="INCLUDE_MATCH_TOKEN",ot[ot.LEFT_CURLY_BRACKET_TOKEN=11]="LEFT_CURLY_BRACKET_TOKEN",ot[ot.RIGHT_CURLY_BRACKET_TOKEN=12]="RIGHT_CURLY_BRACKET_TOKEN",ot[ot.SUFFIX_MATCH_TOKEN=13]="SUFFIX_MATCH_TOKEN",ot[ot.SUBSTRING_MATCH_TOKEN=14]="SUBSTRING_MATCH_TOKEN",ot[ot.DIMENSION_TOKEN=15]="DIMENSION_TOKEN",ot[ot.PERCENTAGE_TOKEN=16]="PERCENTAGE_TOKEN",ot[ot.NUMBER_TOKEN=17]="NUMBER_TOKEN",ot[ot.FUNCTION=18]="FUNCTION",ot[ot.FUNCTION_TOKEN=19]="FUNCTION_TOKEN",ot[ot.IDENT_TOKEN=20]="IDENT_TOKEN",ot[ot.COLUMN_TOKEN=21]="COLUMN_TOKEN",ot[ot.URL_TOKEN=22]="URL_TOKEN",ot[ot.BAD_URL_TOKEN=23]="BAD_URL_TOKEN",ot[ot.CDC_TOKEN=24]="CDC_TOKEN",ot[ot.CDO_TOKEN=25]="CDO_TOKEN",ot[ot.COLON_TOKEN=26]="COLON_TOKEN",ot[ot.SEMICOLON_TOKEN=27]="SEMICOLON_TOKEN",ot[ot.LEFT_SQUARE_BRACKET_TOKEN=28]="LEFT_SQUARE_BRACKET_TOKEN",ot[ot.RIGHT_SQUARE_BRACKET_TOKEN=29]="RIGHT_SQUARE_BRACKET_TOKEN",ot[ot.UNICODE_RANGE_TOKEN=30]="UNICODE_RANGE_TOKEN",ot[ot.WHITESPACE_TOKEN=31]="WHITESPACE_TOKEN",ot[ot.EOF_TOKEN=32]="EOF_TOKEN";var Ut,Ht,Qt,zt,qt={type:st.LEFT_PARENTHESIS_TOKEN},Wt={type:st.RIGHT_PARENTHESIS_TOKEN},Yt={type:st.COMMA_TOKEN},Vt={type:st.SUFFIX_MATCH_TOKEN},Gt={type:st.PREFIX_MATCH_TOKEN},Xt={type:st.COLUMN_TOKEN},Jt={type:st.DASH_MATCH_TOKEN},Zt={type:st.INCLUDE_MATCH_TOKEN},en={type:st.LEFT_CURLY_BRACKET_TOKEN},tn={type:st.RIGHT_CURLY_BRACKET_TOKEN},nn={type:st.SUBSTRING_MATCH_TOKEN},an={type:st.BAD_URL_TOKEN},sn={type:st.BAD_STRING_TOKEN},on={type:st.CDO_TOKEN},rn={type:st.CDC_TOKEN},ln={type:st.COLON_TOKEN},cn={type:st.SEMICOLON_TOKEN},dn={type:st.LEFT_SQUARE_BRACKET_TOKEN},un={type:st.RIGHT_SQUARE_BRACKET_TOKEN},_n={type:st.WHITESPACE_TOKEN},hn={type:st.EOF_TOKEN},pn=(s.prototype.write=function(e){this._value=this._value.concat(qe(e))},s.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==hn;)e.push(t),t=this.consumeToken();return e},s.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),n=this.peekCodePoint(1),i=this.peekCodePoint(2);if(A(t)||v(n,i)){var a=b(t,n,i)?2:1,s=this.consumeName();return{type:st.HASH_TOKEN,value:s,flags:a}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Vt;break;case 39:return this.consumeStringToken(39);case 40:return qt;case 41:return Wt;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),nn;break;case 43:if(y(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return Yt;case 45:var o=e,r=this.peekCodePoint(0),l=this.peekCodePoint(1);if(y(o,r,l))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(b(o,r,l))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(45===r&&62===l)return this.consumeCodePoint(),this.consumeCodePoint(),rn;break;case 46:if(y(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var c=this.consumeCodePoint();if(42===c&&47===(c=this.consumeCodePoint()))return this.consumeToken();if(-1===c)return this.consumeToken()}break;case 58:return ln;case 59:return cn;case 60:if(33===this.peekCodePoint(0)&&45===this.peekCodePoint(1)&&45===this.peekCodePoint(2))return this.consumeCodePoint(),this.consumeCodePoint(),on;break;case 64:if(b(this.peekCodePoint(0),this.peekCodePoint(1),this.peekCodePoint(2)))return s=this.consumeName(),{type:st.AT_KEYWORD_TOKEN,value:s};break;case 91:return dn;case 92:if(v(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return un;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Gt;break;case 123:return en;case 125:return tn;case 117:case 85:var d=this.peekCodePoint(0),u=this.peekCodePoint(1);return 43!==d||!h(u)&&63!==u||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Jt;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),Xt;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Zt;break;case-1:return hn}return p(e)?(this.consumeWhiteSpace(),_n):_(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):g(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:st.DELIM_TOKEN,value:We(e)}},s.prototype.consumeCodePoint=function(){var e=this._value.shift();return void 0===e?-1:e},s.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},s.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},s.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();h(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var n=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),n=!0;if(n){var i=parseInt(We.apply(void 0,e.map(function(e){return 63===e?48:e})),16),a=parseInt(We.apply(void 0,e.map(function(e){return 63===e?70:e})),16);return{type:st.UNICODE_RANGE_TOKEN,start:i,end:a}}var s=parseInt(We.apply(void 0,e),16);if(45===this.peekCodePoint(0)&&h(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var o=[];h(t)&&o.length<6;)o.push(t),t=this.consumeCodePoint();return a=parseInt(We.apply(void 0,o),16),{type:st.UNICODE_RANGE_TOKEN,start:s,end:a}}return{type:st.UNICODE_RANGE_TOKEN,start:s,end:s}},s.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:st.FUNCTION_TOKEN,value:e}):{type:st.IDENT_TOKEN,value:e}},s.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),-1===this.peekCodePoint(0))return{type:st.URL_TOKEN,value:""};var t,n=this.peekCodePoint(0);if(39===n||34===n){var i=this.consumeStringToken(this.consumeCodePoint());return i.type===st.STRING_TOKEN&&(this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:st.URL_TOKEN,value:i.value}):(this.consumeBadUrlRemnants(),an)}for(;;){var a=this.consumeCodePoint();if(-1===a||41===a)return{type:st.URL_TOKEN,value:We.apply(void 0,e)};if(p(a))return this.consumeWhiteSpace(),-1===this.peekCodePoint(0)||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:st.URL_TOKEN,value:We.apply(void 0,e)}):(this.consumeBadUrlRemnants(),an);if(34===a||39===a||40===a||0<=(t=a)&&t<=8||11===t||14<=t&&t<=31||127===t)return this.consumeBadUrlRemnants(),an;if(92===a){if(!v(a,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),an;e.push(this.consumeEscapedCodePoint())}else e.push(a)}},s.prototype.consumeWhiteSpace=function(){for(;p(this.peekCodePoint(0));)this.consumeCodePoint()},s.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||-1===e)return;v(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},s.prototype.consumeStringSlice=function(e){for(var t="";0<e;){var n=Math.min(6e4,e);t+=We.apply(void 0,this._value.splice(0,n)),e-=n}return this._value.shift(),t},s.prototype.consumeStringToken=function(e){for(var t="",n=0;;){var i=this._value[n];if(-1===i||void 0===i||i===e)return t+=this.consumeStringSlice(n),{type:st.STRING_TOKEN,value:t};if(10===i)return this._value.splice(0,n),sn;if(92===i){var a=this._value[n+1];-1!==a&&void 0!==a&&(10===a?(t+=this.consumeStringSlice(n),n=-1,this._value.shift()):v(i,a)&&(t+=this.consumeStringSlice(n),t+=We(this.consumeEscapedCodePoint()),n=-1))}n++}},s.prototype.consumeNumber=function(){var e=[],t=4,n=this.peekCodePoint(0);for(43!==n&&45!==n||e.push(this.consumeCodePoint());_(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(46===n&&_(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;_(this.peekCodePoint(0));)e.push(this.consumeCodePoint());n=this.peekCodePoint(0),i=this.peekCodePoint(1);var a=this.peekCodePoint(2);if((69===n||101===n)&&((43===i||45===i)&&_(a)||_(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;_(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[function(e){var t=0,n=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(n=-1),t++);for(var i=[];_(e[t]);)i.push(e[t++]);var a=i.length?parseInt(We.apply(void 0,i),10):0;46===e[t]&&t++;for(var s=[];_(e[t]);)s.push(e[t++]);var o=s.length,r=o?parseInt(We.apply(void 0,s),10):0;69!==e[t]&&101!==e[t]||t++;var l=1;43!==e[t]&&45!==e[t]||(45===e[t]&&(l=-1),t++);for(var c=[];_(e[t]);)c.push(e[t++]);var d=c.length?parseInt(We.apply(void 0,c),10):0;return n*(a+r*Math.pow(10,-o))*Math.pow(10,l*d)}(e),t]},s.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],n=e[1],i=this.peekCodePoint(0);if(b(i,this.peekCodePoint(1),this.peekCodePoint(2))){var a=this.consumeName();return{type:st.DIMENSION_TOKEN,number:t,flags:n,unit:a}}return 37===i?(this.consumeCodePoint(),{type:st.PERCENTAGE_TOKEN,number:t,flags:n}):{type:st.NUMBER_TOKEN,number:t,flags:n}},s.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(h(e)){for(var t=We(e);h(this.peekCodePoint(0))&&t.length<6;)t+=We(this.consumeCodePoint());p(this.peekCodePoint(0))&&this.consumeCodePoint();var n=parseInt(t,16);return 0===n||55296<=n&&n<=57343||1114111<n?65533:n}return-1===e?65533:e},s.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(A(t))e+=We(t);else{if(!v(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=We(this.consumeEscapedCodePoint())}}},s),fn=(o.create=function(e){var t=new pn;return t.write(e),new o(t.read())},o.parseValue=function(e){return o.create(e).parseComponentValue()},o.parseValues=function(e){return o.create(e).parseComponentValues()},o.prototype.parseComponentValue=function(){for(var e=this.consumeToken();e.type===st.WHITESPACE_TOKEN;)e=this.consumeToken();if(e.type===st.EOF_TOKEN)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);for(var t=this.consumeComponentValue();(e=this.consumeToken()).type===st.WHITESPACE_TOKEN;);if(e.type===st.EOF_TOKEN)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},o.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(t.type===st.EOF_TOKEN)return e;e.push(t),e.push()}},o.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case st.LEFT_CURLY_BRACKET_TOKEN:case st.LEFT_SQUARE_BRACKET_TOKEN:case st.LEFT_PARENTHESIS_TOKEN:return this.consumeSimpleBlock(e.type);case st.FUNCTION_TOKEN:return this.consumeFunction(e)}return e},o.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},n=this.consumeToken();;){if(n.type===st.EOF_TOKEN||mn(n,e))return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue()),n=this.consumeToken()}},o.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:st.FUNCTION};;){var n=this.consumeToken();if(n.type===st.EOF_TOKEN||n.type===st.RIGHT_PARENTHESIS_TOKEN)return t;this.reconsumeToken(n),t.values.push(this.consumeComponentValue())}},o.prototype.consumeToken=function(){var e=this._tokens.shift();return void 0===e?hn:e},o.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},o),mn=function(e,t){return t===st.LEFT_CURLY_BRACKET_TOKEN&&e.type===st.RIGHT_CURLY_BRACKET_TOKEN||t===st.LEFT_SQUARE_BRACKET_TOKEN&&e.type===st.RIGHT_SQUARE_BRACKET_TOKEN||t===st.LEFT_PARENTHESIS_TOKEN&&e.type===st.RIGHT_PARENTHESIS_TOKEN},gn={type:st.NUMBER_TOKEN,number:0,flags:4},An={type:st.PERCENTAGE_TOKEN,number:50,flags:4},vn={type:st.PERCENTAGE_TOKEN,number:100,flags:4},bn=function(e,t){if(e.type===st.PERCENTAGE_TOKEN)return e.number/100*t;if(r(e))switch(e.unit){case"rem":case"em":return 16*e.number;case"px":default:return e.number}return e.number},yn=function(e){if(e.type===st.DIMENSION_TOKEN)switch(e.unit){case"deg":return Math.PI*e.number/180;case"grad":return Math.PI/200*e.number;case"rad":return e.number;case"turn":return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},$n=function(e){return Math.PI*e/180},wn=function(e){if(e.type===st.FUNCTION){var t=Cn[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(e.values)}if(e.type===st.HASH_TOKEN){if(3===e.value.length){var n=e.value.substring(0,1),i=e.value.substring(1,2),a=e.value.substring(2,3);return kn(parseInt(n+n,16),parseInt(i+i,16),parseInt(a+a,16),1)}if(4===e.value.length){n=e.value.substring(0,1),i=e.value.substring(1,2),a=e.value.substring(2,3);var s=e.value.substring(3,4);return kn(parseInt(n+n,16),parseInt(i+i,16),parseInt(a+a,16),parseInt(s+s,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),i=e.value.substring(2,4),a=e.value.substring(4,6),kn(parseInt(n,16),parseInt(i,16),parseInt(a,16),1);if(8===e.value.length)return n=e.value.substring(0,2),i=e.value.substring(2,4),a=e.value.substring(4,6),s=e.value.substring(6,8),kn(parseInt(n,16),parseInt(i,16),parseInt(a,16),parseInt(s,16)/255)}if(e.type===st.IDENT_TOKEN){var o=En[e.value.toUpperCase()];if(void 0!==o)return o}return En.TRANSPARENT},kn=function(e,t,n,i){return(e<<24|t<<16|n<<8|Math.round(255*i)<<0)>>>0},Cn={hsl:L,hsla:L,rgb:M,rgba:M},En={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199};(Ht=Ut||(Ut={}))[Ht.VALUE=0]="VALUE",Ht[Ht.LIST=1]="LIST",Ht[Ht.IDENT_VALUE=2]="IDENT_VALUE",Ht[Ht.TYPE_VALUE=3]="TYPE_VALUE",Ht[Ht.TOKEN_VALUE=4]="TOKEN_VALUE",(zt=Qt||(Qt={}))[zt.BORDER_BOX=0]="BORDER_BOX",zt[zt.PADDING_BOX=1]="PADDING_BOX";var Tn,xn,In,Dn,On,Sn,Rn={name:"background-clip",initialValue:"border-box",prefix:!(zt[zt.CONTENT_BOX=2]="CONTENT_BOX"),type:Ut.LIST,parse:function(e){return e.map(function(e){if($(e))switch(e.value){case"padding-box":return Qt.PADDING_BOX;case"content-box":return Qt.CONTENT_BOX}return Qt.BORDER_BOX})}},Bn={name:"background-color",initialValue:"transparent",prefix:!1,type:Ut.TYPE_VALUE,format:"color"},Nn=function(e,t,n,i,a){var s="http://www.w3.org/2000/svg",o=document.createElementNS(s,"svg"),r=document.createElementNS(s,"foreignObject");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"width","100%"),r.setAttributeNS(null,"height","100%"),r.setAttributeNS(null,"x",n.toString()),r.setAttributeNS(null,"y",i.toString()),r.setAttributeNS(null,"externalResourcesRequired","true"),o.appendChild(r),r.appendChild(a),o},Fn=function(i){return new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(i))})},Kn={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var n=e.createElement("boundtest");n.style.height="123px",n.style.display="block",e.body.appendChild(n),t.selectNode(n);var i=t.getBoundingClientRect(),a=Math.round(i.height);if(e.body.removeChild(n),123===a)return!0}}return!1}(document);return Object.defineProperty(Kn,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,n=e.createElement("canvas"),i=n.getContext("2d");if(!i)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{i.drawImage(t,0,0),n.toDataURL()}catch(e){return!1}return!0}(document);return Object.defineProperty(Kn,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(i){var e=i.createElement("canvas"),a=100;e.width=a,e.height=a;var s=e.getContext("2d");if(!s)return Promise.reject(!1);s.fillStyle="rgb(0, 255, 0)",s.fillRect(0,0,a,a);var t=new Image,o=e.toDataURL();t.src=o;var n=Nn(a,a,0,0,t);return s.fillStyle="red",s.fillRect(0,0,a,a),Fn(n).then(function(e){s.drawImage(e,0,0);var t=s.getImageData(0,0,a,a).data;s.fillStyle="red",s.fillRect(0,0,a,a);var n=i.createElement("div");return n.style.backgroundImage="url("+o+")",n.style.height="100px",W(t)?Fn(Nn(a,a,0,0,n)):Promise.reject(!1)}).then(function(e){return s.drawImage(e,0,0),W(s.getImageData(0,0,a,a).data)})["catch"](function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Kn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=void 0!==(new Image).crossOrigin;return Object.defineProperty(Kn,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Kn,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Kn,"SUPPORT_CORS_XHR",{value:e}),e}},Mn=(Y.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,[this.id,this.getTime()+"ms"].concat(e)):this.info.apply(this,e))},Y.prototype.getTime=function(){return Date.now()-this.start},Y.create=function(e){Y.instances[e.id]=new Y(e)},Y.destroy=function(e){delete Y.instances[e]},Y.getInstance=function(e){var t=Y.instances[e];if(void 0===t)throw new Error("No logger instance found with id "+e);return t},Y.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,[this.id,this.getTime()+"ms"].concat(e))},Y.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,[this.id,this.getTime()+"ms"].concat(e)):this.info.apply(this,e))},Y.instances={},Y),jn=(V.create=function(e,t){return V._caches[e]=new Ln(e,t)},V.destroy=function(e){delete V._caches[e]},V.open=function(e){var t=V._caches[e];if(void 0!==t)return t;throw new Error('Cache with key "'+e+'" not found')},V.getOrigin=function(e){var t=V._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},V.isSameOrigin=function(e){return V.getOrigin(e)===V._origin},V.setContext=function(e){V._link=e.document.createElement("a"),V._origin=V.getOrigin(e.location.href)},V.getInstance=function(){var e=V._current;if(null===e)throw new Error("No cache instance attached");return e},V.attachInstance=function(e){V._current=e},V.detachInstance=function(){V._current=null},V._caches={},V._origin="about:blank",V._current=null,V),Ln=(G.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Wn(e)||Qn(e))&&(this._cache[e]=this.loadImage(e)),t},G.prototype.match=function(e){return this._cache[e]},G.prototype.loadImage=function(o){return c(this,void 0,void 0,function(){var t,i,n,a,s=this;return F(this,function(e){switch(e.label){case 0:return t=jn.isSameOrigin(o),i=!zn(o)&&!0===this._options.useCORS&&Kn.SUPPORT_CORS_IMAGES&&!t,n=!zn(o)&&!t&&"string"==typeof this._options.proxy&&Kn.SUPPORT_CORS_XHR&&!i,t||!1!==this._options.allowTaint||zn(o)||n||i?(a=o,n?[4,this.proxy(a)]:[3,2]):[2];case 1:a=e.sent(),e.label=2;case 2:return Mn.getInstance(this.id).debug("Added image "+o.substring(0,256)),[4,new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,(qn(a)||i)&&(n.crossOrigin="anonymous"),n.src=a,!0===n.complete&&setTimeout(function(){return e(n)},500),0<s._options.imageTimeout&&setTimeout(function(){return t("Timed out ("+s._options.imageTimeout+"ms) loading image")},s._options.imageTimeout)})];case 3:return[2,e.sent()]}})})},G.prototype.has=function(e){return void 0!==this._cache[e]},G.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},G.prototype.proxy=function(s){var o=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var l=s.substring(0,256);return new Promise(function(t,n){var i=Kn.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;if(a.onload=function(){if(200===a.status)if("text"==i)t(a.response);else{var e=new FileReader;e.addEventListener("load",function(){return t(e.result)},!1),e.addEventListener("error",function(e){return n(e)},!1),e.readAsDataURL(a.response)}else n("Failed to proxy resource "+l+" with status code "+a.status)},a.onerror=n,a.open("GET",r+"?url="+encodeURIComponent(s)+"&responseType="+i),"text"!=i&&a instanceof XMLHttpRequest&&(a.responseType=i),o._options.imageTimeout){var e=o._options.imageTimeout;a.timeout=e,a.ontimeout=function(){return n("Timed out ("+e+"ms) proxying "+l)}}a.send()})},G),Pn=/^data:image\/svg\+xml/i,Un=/^data:image\/.*;base64,/i,Hn=/^data:image\/.*/i,Qn=function(e){return Kn.SUPPORT_SVG_DRAWING||!Yn(e)},zn=function(e){return Hn.test(e)},qn=function(e){return Un.test(e)},Wn=function(e){return"blob"===e.substr(0,4)},Yn=function(e){return"svg"===e.substr(-3).toLowerCase()||Pn.test(e)},Vn="closest-side",Gn="farthest-side",Xn="closest-corner",Jn="farthest-corner",Zn="ellipse",ei="contain";(xn=Tn||(Tn={}))[xn.URL=0]="URL",xn[xn.LINEAR_GRADIENT=1]="LINEAR_GRADIENT",xn[xn.RADIAL_GRADIENT=2]="RADIAL_GRADIENT",(Dn=In||(In={}))[Dn.CIRCLE=0]="CIRCLE",Dn[Dn.ELLIPSE=1]="ELLIPSE",(Sn=On||(On={}))[Sn.CLOSEST_SIDE=0]="CLOSEST_SIDE",Sn[Sn.FARTHEST_SIDE=1]="FARTHEST_SIDE",Sn[Sn.CLOSEST_CORNER=2]="CLOSEST_CORNER",Sn[Sn.FARTHEST_CORNER=3]="FARTHEST_CORNER";var ti,ni,ii=function(e){if(e.type===st.URL_TOKEN){var t={url:e.value,type:Tn.URL};return jn.getInstance().addImage(e.value),t}if(e.type!==st.FUNCTION)throw new Error("Unsupported image type");var n=ai[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(e.values)},ai={"linear-gradient":function(e){var a=$n(180),s=[];return T(e).forEach(function(e,t){if(0===t){var n=e[0];if(n.type===st.IDENT_TOKEN&&"to"===n.value)return void(a=R(e));if(S(n))return void(a=yn(n))}var i=P(e);s.push(i)}),{angle:a,stops:s,type:Tn.LINEAR_GRADIENT}},"-moz-linear-gradient":q,"-ms-linear-gradient":q,"-o-linear-gradient":q,"-webkit-linear-gradient":q,"radial-gradient":function(e){var s=In.CIRCLE,o=On.FARTHEST_CORNER,r=[],l=[];return T(e).forEach(function(e,t){var n=!0;if(0===t){var i=!1;n=e.reduce(function(e,t){if(i)if($(t))switch(t.value){case"center":return l.push(An),e;case"top":case"left":return l.push(gn),e;case"right":case"bottom":return l.push(vn),e}else(I(t)||x(t))&&l.push(t);else if($(t))switch(t.value){case"circle":return s=In.CIRCLE,!1;case Zn:return s=In.ELLIPSE,!1;case"at":return!(i=!0);case Vn:return o=On.CLOSEST_SIDE,!1;case"cover":case Gn:return o=On.FARTHEST_SIDE,!1;case ei:case Xn:return o=On.CLOSEST_CORNER,!1;case Jn:return o=On.FARTHEST_CORNER,!1}else if(x(t)||I(t))return Array.isArray(o)||(o=[]),o.push(t),!1;return e},n)}if(n){var a=P(e);r.push(a)}}),{size:o,shape:s,stops:r,position:l,type:Tn.RADIAL_GRADIENT}},"-moz-radial-gradient":X,"-ms-radial-gradient":X,"-o-radial-gradient":X,"-webkit-radial-gradient":X,"-webkit-gradient":function(e){var t=$n(180),o=[],r=Tn.LINEAR_GRADIENT,n=In.CIRCLE,i=On.FARTHEST_CORNER;return T(e).forEach(function(e,t){var n=e[0];if(0===t){if($(n)&&"linear"===n.value)return void(r=Tn.LINEAR_GRADIENT);if($(n)&&"radial"===n.value)return void(r=Tn.RADIAL_GRADIENT)}if(n.type===st.FUNCTION)if("from"===n.name){var i=wn(n.values[0]);o.push({stop:gn,color:i})}else if("to"===n.name)i=wn(n.values[0]),o.push({stop:vn,color:i});else if("color-stop"===n.name){var a=n.values.filter(E);if(2===a.length){i=wn(a[1]);var s=a[0];l(s)&&o.push({stop:{type:st.PERCENTAGE_TOKEN,number:100*s.number,flags:s.flags},color:i})}}}),r===Tn.LINEAR_GRADIENT?{angle:(t+$n(180))%$n(360),stops:o,type:r}:{size:i,shape:n,stops:o,position:[],type:r}}},si={name:"background-image",initialValue:"none",type:Ut.LIST,prefix:!1,parse:function(e){if(0===e.length)return[];var t=e[0];return t.type===st.IDENT_TOKEN&&"none"===t.value?[]:e.filter(function(e){return E(e)&&((t=e).type!==st.FUNCTION||ai[t.name]);var t}).map(ii)}},oi={name:"background-origin",initialValue:"border-box",prefix:!1,type:Ut.LIST,parse:function(e){return e.map(function(e){if($(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},ri={name:"background-position",initialValue:"0% 0%",type:Ut.LIST,prefix:!1,parse:function(e){return T(e).map(function(e){return e.filter(I)}).map(D)}};(ni=ti||(ti={}))[ni.REPEAT=0]="REPEAT",ni[ni.NO_REPEAT=1]="NO_REPEAT",ni[ni.REPEAT_X=2]="REPEAT_X";var li,ci,di={name:"background-repeat",initialValue:"repeat",prefix:!(ni[ni.REPEAT_Y=3]="REPEAT_Y"),type:Ut.LIST,parse:function(e){return T(e).map(function(e){return e.filter($).map(function(e){return e.value}).join(" ")}).map(ui)}},ui=function(e){switch(e){case"no-repeat":return ti.NO_REPEAT;case"repeat-x":case"repeat no-repeat":return ti.REPEAT_X;case"repeat-y":case"no-repeat repeat":return ti.REPEAT_Y;case"repeat":default:return ti.REPEAT}};(ci=li||(li={})).AUTO="auto",ci.CONTAIN="contain";var _i,hi,pi={name:"background-size",initialValue:"0",prefix:!(ci.COVER="cover"),type:Ut.LIST,parse:function(e){return T(e).map(function(e){return e.filter(fi)})}},fi=function(e){return $(e)||I(e)},mi=J("top"),gi=J("right"),Ai=J("bottom"),vi=J("left"),bi=Z("top-left"),yi=Z("top-right"),$i=Z("bottom-right"),wi=Z("bottom-left");(hi=_i||(_i={}))[hi.NONE=0]="NONE",hi[hi.SOLID=1]="SOLID";var ki,Ci,Ei=ee("top"),Ti=ee("right"),xi=ee("bottom"),Ii=ee("left"),Di=te("top"),Oi=te("right"),Si=te("bottom"),Ri=te("left"),Bi={name:"color",initialValue:"transparent",prefix:!1,type:Ut.TYPE_VALUE,format:"color"},Ni={name:"display",initialValue:"inline-block",prefix:!1,type:Ut.LIST,parse:function(e){return e.filter($).reduce(function(e,t){return e|Fi(t.value)},0)}},Fi=function(e){switch(e){case"block":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0};(Ci=ki||(ki={}))[Ci.NONE=0]="NONE",Ci[Ci.LEFT=1]="LEFT",Ci[Ci.RIGHT=2]="RIGHT",Ci[Ci.INLINE_START=3]="INLINE_START";var Ki,Mi,ji,Li,Pi={name:"float",initialValue:"none",prefix:!(Ci[Ci.INLINE_END=4]="INLINE_END"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"left":return ki.LEFT;case"right":return ki.RIGHT;case"inline-start":return ki.INLINE_START;case"inline-end":return ki.INLINE_END}return ki.NONE}},Ui={name:"letter-spacing",initialValue:"0",prefix:!1,type:Ut.VALUE,parse:function(e){return e.type===st.IDENT_TOKEN&&"normal"===e.value?0:e.type===st.NUMBER_TOKEN?e.number:e.type===st.DIMENSION_TOKEN?e.number:0}},Hi={name:"line-break",initialValue:(Mi=Ki||(Ki={})).NORMAL="normal",prefix:!(Mi.STRICT="strict"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"strict":return Ki.STRICT;case"normal":default:return Ki.NORMAL}}},Qi={name:"line-height",initialValue:"normal",prefix:!1,type:Ut.TOKEN_VALUE},zi={name:"list-style-image",initialValue:"none",type:Ut.VALUE,prefix:!1,parse:function(e){return e.type===st.IDENT_TOKEN&&"none"===e.value?null:ii(e)}};(Li=ji||(ji={}))[Li.INSIDE=0]="INSIDE";var qi,Wi,Yi={name:"list-style-position",initialValue:"outside",prefix:!(Li[Li.OUTSIDE=1]="OUTSIDE"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"inside":return ji.INSIDE;case"outside":default:return ji.OUTSIDE}}};(Wi=qi||(qi={}))[Wi.NONE=-1]="NONE",Wi[Wi.DISC=0]="DISC",Wi[Wi.CIRCLE=1]="CIRCLE",Wi[Wi.SQUARE=2]="SQUARE",Wi[Wi.DECIMAL=3]="DECIMAL",Wi[Wi.CJK_DECIMAL=4]="CJK_DECIMAL",Wi[Wi.DECIMAL_LEADING_ZERO=5]="DECIMAL_LEADING_ZERO",Wi[Wi.LOWER_ROMAN=6]="LOWER_ROMAN",Wi[Wi.UPPER_ROMAN=7]="UPPER_ROMAN",Wi[Wi.LOWER_GREEK=8]="LOWER_GREEK",Wi[Wi.LOWER_ALPHA=9]="LOWER_ALPHA",Wi[Wi.UPPER_ALPHA=10]="UPPER_ALPHA",Wi[Wi.ARABIC_INDIC=11]="ARABIC_INDIC",Wi[Wi.ARMENIAN=12]="ARMENIAN",Wi[Wi.BENGALI=13]="BENGALI",Wi[Wi.CAMBODIAN=14]="CAMBODIAN",
Wi[Wi.CJK_EARTHLY_BRANCH=15]="CJK_EARTHLY_BRANCH",Wi[Wi.CJK_HEAVENLY_STEM=16]="CJK_HEAVENLY_STEM",Wi[Wi.CJK_IDEOGRAPHIC=17]="CJK_IDEOGRAPHIC",Wi[Wi.DEVANAGARI=18]="DEVANAGARI",Wi[Wi.ETHIOPIC_NUMERIC=19]="ETHIOPIC_NUMERIC",Wi[Wi.GEORGIAN=20]="GEORGIAN",Wi[Wi.GUJARATI=21]="GUJARATI",Wi[Wi.GURMUKHI=22]="GURMUKHI",Wi[Wi.HEBREW=22]="HEBREW",Wi[Wi.HIRAGANA=23]="HIRAGANA",Wi[Wi.HIRAGANA_IROHA=24]="HIRAGANA_IROHA",Wi[Wi.JAPANESE_FORMAL=25]="JAPANESE_FORMAL",Wi[Wi.JAPANESE_INFORMAL=26]="JAPANESE_INFORMAL",Wi[Wi.KANNADA=27]="KANNADA",Wi[Wi.KATAKANA=28]="KATAKANA",Wi[Wi.KATAKANA_IROHA=29]="KATAKANA_IROHA",Wi[Wi.KHMER=30]="KHMER",Wi[Wi.KOREAN_HANGUL_FORMAL=31]="KOREAN_HANGUL_FORMAL",Wi[Wi.KOREAN_HANJA_FORMAL=32]="KOREAN_HANJA_FORMAL",Wi[Wi.KOREAN_HANJA_INFORMAL=33]="KOREAN_HANJA_INFORMAL",Wi[Wi.LAO=34]="LAO",Wi[Wi.LOWER_ARMENIAN=35]="LOWER_ARMENIAN",Wi[Wi.MALAYALAM=36]="MALAYALAM",Wi[Wi.MONGOLIAN=37]="MONGOLIAN",Wi[Wi.MYANMAR=38]="MYANMAR",Wi[Wi.ORIYA=39]="ORIYA",Wi[Wi.PERSIAN=40]="PERSIAN",Wi[Wi.SIMP_CHINESE_FORMAL=41]="SIMP_CHINESE_FORMAL",Wi[Wi.SIMP_CHINESE_INFORMAL=42]="SIMP_CHINESE_INFORMAL",Wi[Wi.TAMIL=43]="TAMIL",Wi[Wi.TELUGU=44]="TELUGU",Wi[Wi.THAI=45]="THAI",Wi[Wi.TIBETAN=46]="TIBETAN",Wi[Wi.TRAD_CHINESE_FORMAL=47]="TRAD_CHINESE_FORMAL",Wi[Wi.TRAD_CHINESE_INFORMAL=48]="TRAD_CHINESE_INFORMAL",Wi[Wi.UPPER_ARMENIAN=49]="UPPER_ARMENIAN",Wi[Wi.DISCLOSURE_OPEN=50]="DISCLOSURE_OPEN";var Vi,Gi,Xi={name:"list-style-type",initialValue:"none",prefix:!(Wi[Wi.DISCLOSURE_CLOSED=51]="DISCLOSURE_CLOSED"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"disc":return qi.DISC;case"circle":return qi.CIRCLE;case"square":return qi.SQUARE;case"decimal":return qi.DECIMAL;case"cjk-decimal":return qi.CJK_DECIMAL;case"decimal-leading-zero":return qi.DECIMAL_LEADING_ZERO;case"lower-roman":return qi.LOWER_ROMAN;case"upper-roman":return qi.UPPER_ROMAN;case"lower-greek":return qi.LOWER_GREEK;case"lower-alpha":return qi.LOWER_ALPHA;case"upper-alpha":return qi.UPPER_ALPHA;case"arabic-indic":return qi.ARABIC_INDIC;case"armenian":return qi.ARMENIAN;case"bengali":return qi.BENGALI;case"cambodian":return qi.CAMBODIAN;case"cjk-earthly-branch":return qi.CJK_EARTHLY_BRANCH;case"cjk-heavenly-stem":return qi.CJK_HEAVENLY_STEM;case"cjk-ideographic":return qi.CJK_IDEOGRAPHIC;case"devanagari":return qi.DEVANAGARI;case"ethiopic-numeric":return qi.ETHIOPIC_NUMERIC;case"georgian":return qi.GEORGIAN;case"gujarati":return qi.GUJARATI;case"gurmukhi":return qi.GURMUKHI;case"hebrew":return qi.HEBREW;case"hiragana":return qi.HIRAGANA;case"hiragana-iroha":return qi.HIRAGANA_IROHA;case"japanese-formal":return qi.JAPANESE_FORMAL;case"japanese-informal":return qi.JAPANESE_INFORMAL;case"kannada":return qi.KANNADA;case"katakana":return qi.KATAKANA;case"katakana-iroha":return qi.KATAKANA_IROHA;case"khmer":return qi.KHMER;case"korean-hangul-formal":return qi.KOREAN_HANGUL_FORMAL;case"korean-hanja-formal":return qi.KOREAN_HANJA_FORMAL;case"korean-hanja-informal":return qi.KOREAN_HANJA_INFORMAL;case"lao":return qi.LAO;case"lower-armenian":return qi.LOWER_ARMENIAN;case"malayalam":return qi.MALAYALAM;case"mongolian":return qi.MONGOLIAN;case"myanmar":return qi.MYANMAR;case"oriya":return qi.ORIYA;case"persian":return qi.PERSIAN;case"simp-chinese-formal":return qi.SIMP_CHINESE_FORMAL;case"simp-chinese-informal":return qi.SIMP_CHINESE_INFORMAL;case"tamil":return qi.TAMIL;case"telugu":return qi.TELUGU;case"thai":return qi.THAI;case"tibetan":return qi.TIBETAN;case"trad-chinese-formal":return qi.TRAD_CHINESE_FORMAL;case"trad-chinese-informal":return qi.TRAD_CHINESE_INFORMAL;case"upper-armenian":return qi.UPPER_ARMENIAN;case"disclosure-open":return qi.DISCLOSURE_OPEN;case"disclosure-closed":return qi.DISCLOSURE_CLOSED;case"none":default:return qi.NONE}}},Ji=ne("top"),Zi=ne("right"),ea=ne("bottom"),ta=ne("left");(Gi=Vi||(Vi={}))[Gi.VISIBLE=0]="VISIBLE",Gi[Gi.HIDDEN=1]="HIDDEN",Gi[Gi.SCROLL=2]="SCROLL";var na,ia,aa,sa,oa={name:"overflow",initialValue:"visible",prefix:!(Gi[Gi.AUTO=3]="AUTO"),type:Ut.LIST,parse:function(e){return e.filter($).map(function(e){switch(e.value){case"hidden":return Vi.HIDDEN;case"scroll":return Vi.SCROLL;case"auto":return Vi.AUTO;case"visible":default:return Vi.VISIBLE}})}},ra={name:"overflow-wrap",initialValue:(ia=na||(na={})).NORMAL="normal",prefix:!(ia.BREAK_WORD="break-word"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"break-word":return na.BREAK_WORD;case"normal":default:return na.NORMAL}}},la=ie("top"),ca=ie("right"),da=ie("bottom"),ua=ie("left");(sa=aa||(aa={}))[sa.LEFT=0]="LEFT",sa[sa.CENTER=1]="CENTER";var _a,ha,pa={name:"text-align",initialValue:"left",prefix:!(sa[sa.RIGHT=2]="RIGHT"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"right":return aa.RIGHT;case"center":case"justify":return aa.CENTER;case"left":default:return aa.LEFT}}};(ha=_a||(_a={}))[ha.STATIC=0]="STATIC",ha[ha.RELATIVE=1]="RELATIVE",ha[ha.ABSOLUTE=2]="ABSOLUTE",ha[ha.FIXED=3]="FIXED";var fa,ma,ga={name:"position",initialValue:"static",prefix:!(ha[ha.STICKY=4]="STICKY"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"relative":return _a.RELATIVE;case"absolute":return _a.ABSOLUTE;case"fixed":return _a.FIXED;case"sticky":return _a.STICKY}return _a.STATIC}},Aa={name:"text-shadow",initialValue:"none",type:Ut.LIST,prefix:!1,parse:function(e){return 1===e.length&&k(e[0],"none")?[]:T(e).map(function(e){for(var t={color:En.TRANSPARENT,offsetX:gn,offsetY:gn,blur:gn},n=0,i=0;i<e.length;i++){var a=e[i];x(a)?(0===n?t.offsetX=a:1===n?t.offsetY=a:t.blur=a,n++):t.color=wn(a)}return t})}};(ma=fa||(fa={}))[ma.NONE=0]="NONE",ma[ma.LOWERCASE=1]="LOWERCASE",ma[ma.UPPERCASE=2]="UPPERCASE";var va,ba,ya={name:"text-transform",initialValue:"none",prefix:!(ma[ma.CAPITALIZE=3]="CAPITALIZE"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"uppercase":return fa.UPPERCASE;case"lowercase":return fa.LOWERCASE;case"capitalize":return fa.CAPITALIZE}return fa.NONE}},$a={name:"transform",initialValue:"none",prefix:!0,type:Ut.VALUE,parse:function(e){if(e.type===st.IDENT_TOKEN&&"none"===e.value)return null;if(e.type!==st.FUNCTION)return null;var t=wa[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}},wa={matrix:function(e){var t=e.filter(function(e){return e.type===st.NUMBER_TOKEN}).map(function(e){return e.number});return 6===t.length?t:null},matrix3d:function(e){var t=e.filter(function(e){return e.type===st.NUMBER_TOKEN}).map(function(e){return e.number}),n=t[0],i=t[1],a=(t[2],t[3],t[4]),s=t[5],o=(t[6],t[7],t[8],t[9],t[10],t[11],t[12]),r=t[13];return t[14],t[15],16===t.length?[n,i,a,s,o,r]:null}},ka={type:st.PERCENTAGE_TOKEN,number:50,flags:4},Ca=[ka,ka],Ea={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:Ut.LIST,parse:function(e){var t=e.filter(I);return 2!==t.length?Ca:[t[0],t[1]]}};(ba=va||(va={}))[ba.VISIBLE=0]="VISIBLE",ba[ba.HIDDEN=1]="HIDDEN";var Ta,xa,Ia={name:"visible",initialValue:"none",prefix:!(ba[ba.COLLAPSE=2]="COLLAPSE"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"hidden":return va.HIDDEN;case"collapse":return va.COLLAPSE;case"visible":default:return va.VISIBLE}}};(xa=Ta||(Ta={})).NORMAL="normal",xa.BREAK_ALL="break-all";var Da,Oa,Sa={name:"word-break",initialValue:"normal",prefix:!(xa.KEEP_ALL="keep-all"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"break-all":return Ta.BREAK_ALL;case"keep-all":return Ta.KEEP_ALL;case"normal":default:return Ta.NORMAL}}},Ra={name:"z-index",initialValue:"auto",prefix:!1,type:Ut.VALUE,parse:function(e){if(e.type===st.IDENT_TOKEN)return{auto:!0,order:0};if(l(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},Ba={name:"opacity",initialValue:"1",type:Ut.VALUE,prefix:!1,parse:function(e){return l(e)?e.number:1}},Na={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:Ut.TYPE_VALUE,format:"color"},Fa={name:"text-decoration-line",initialValue:"none",prefix:!1,type:Ut.LIST,parse:function(e){return e.filter($).map(function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(e){return 0!==e})}},Ka={name:"font-family",initialValue:"",prefix:!1,type:Ut.LIST,parse:function(e){return e.filter(Ma).map(function(e){return e.value})}},Ma=function(e){return e.type===st.STRING_TOKEN||e.type===st.IDENT_TOKEN},ja={name:"font-size",initialValue:"0",prefix:!1,type:Ut.TYPE_VALUE,format:"length"},La={name:"font-weight",initialValue:"normal",type:Ut.VALUE,prefix:!1,parse:function(e){if(l(e))return e.number;if($(e))switch(e.value){case"bold":return 700;case"normal":default:return 400}return 400}},Pa={name:"font-variant",initialValue:"none",type:Ut.LIST,prefix:!1,parse:function(e){return e.filter($).map(function(e){return e.value})}};(Oa=Da||(Da={})).NORMAL="normal",Oa.ITALIC="italic";var Ua,Ha,Qa,za,qa,Wa,Ya,Va,Ga,Xa,Ja,Za={name:"font-style",initialValue:"normal",prefix:!(Oa.OBLIQUE="oblique"),type:Ut.IDENT_VALUE,parse:function(e){switch(e){case"oblique":return Da.OBLIQUE;case"italic":return Da.ITALIC;case"normal":default:return Da.NORMAL}}},es={name:"content",initialValue:"none",type:Ut.LIST,prefix:!1,parse:function(e){if(0===e.length)return[];var t=e[0];return t.type===st.IDENT_TOKEN&&"none"===t.value?[]:e}},ts={name:"counter-increment",initialValue:"none",prefix:!0,type:Ut.LIST,parse:function(e){if(0===e.length)return null;var t=e[0];if(t.type===st.IDENT_TOKEN&&"none"===t.value)return null;for(var n=[],i=e.filter(C),a=0;a<i.length;a++){var s=i[a],o=i[a+1];if(s.type===st.IDENT_TOKEN){var r=o&&l(o)?o.number:1;n.push({counter:s.value,increment:r})}}return n}},ns={name:"counter-reset",initialValue:"none",prefix:!0,type:Ut.LIST,parse:function(e){if(0===e.length)return[];for(var t=[],n=e.filter(C),i=0;i<n.length;i++){var a=n[i],s=n[i+1];if($(a)&&"none"!==a.value){var o=s&&l(s)?s.number:0;t.push({counter:a.value,reset:o})}}return t}},is={name:"quotes",initialValue:"none",prefix:!0,type:Ut.LIST,parse:function(e){if(0===e.length)return null;var t=e[0];if(t.type===st.IDENT_TOKEN&&"none"===t.value)return null;var n=[],i=e.filter(w);if(i.length%2!=0)return null;for(var a=0;a<i.length;a+=2){var s=i[a].value,o=i[a+1].value;n.push({open:s,close:o})}return n}},as={name:"box-shadow",initialValue:"none",type:Ut.LIST,prefix:!1,parse:function(e){return 1===e.length&&k(e[0],"none")?[]:T(e).map(function(e){for(var t={color:255,offsetX:gn,offsetY:gn,blur:gn,spread:gn,inset:!1},n=0,i=0;i<e.length;i++){var a=e[i];k(a,"inset")?t.inset=!0:x(a)?(0===n?t.offsetX=a:1===n?t.offsetY=a:2===n?t.blur=a:t.spread=a,n++):t.color=wn(a)}return t})}},ss=(oe.prototype.isVisible=function(){return 0<this.display&&0<this.opacity&&this.visibility===va.VISIBLE},oe.prototype.isTransparent=function(){return B(this.backgroundColor)},oe.prototype.isTransformed=function(){return null!==this.transform},oe.prototype.isPositioned=function(){return this.position!==_a.STATIC},oe.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},oe.prototype.isFloating=function(){return this["float"]!==ki.NONE},oe.prototype.isInlineLevel=function(){return ae(this.display,4)||ae(this.display,33554432)||ae(this.display,268435456)||ae(this.display,536870912)||ae(this.display,67108864)||ae(this.display,134217728)},oe),os=function(e){this.content=ls(es,e.content),this.quotes=ls(is,e.quotes)},rs=function(e){this.counterIncrement=ls(ts,e.counterIncrement),this.counterReset=ls(ns,e.counterReset)},ls=function(e,t){var n=new pn,i=null!=t?t.toString():e.initialValue;n.write(i);var a=new fn(n.read());switch(e.type){case Ut.IDENT_VALUE:var s=a.parseComponentValue();return e.parse($(s)?s.value:e.initialValue);case Ut.VALUE:return e.parse(a.parseComponentValue());case Ut.LIST:return e.parse(a.parseComponentValues());case Ut.TOKEN_VALUE:return a.parseComponentValue();case Ut.TYPE_VALUE:switch(e.format){case"angle":return yn(a.parseComponentValue());case"color":return wn(a.parseComponentValue());case"image":return ii(a.parseComponentValue());case"length":var o=a.parseComponentValue();return x(o)?o:gn;case"length-percentage":var r=a.parseComponentValue();return I(r)?r:gn}}throw new Error("Attempting to parse unsupported css format type "+e.format)},cs=function(e){this.styles=new ss(window.getComputedStyle(e,null)),this.textNodes=[],this.elements=[],null!==this.styles.transform&&Us(e)&&(e.style.transform="none"),this.bounds=ze(e),this.flags=0},ds=function(e,t){this.text=e,this.bounds=t},us=function(e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var i=e.parentNode;if(i){i.replaceChild(n,e);var a=ze(n);return n.firstChild&&i.replaceChild(n.firstChild,n),a}}return new Qe(0,0,0,0)},_s=function(e,t,n){var i=e.ownerDocument;if(!i)throw new Error("Node has no owner document");var a=i.createRange();return a.setStart(e,t),a.setEnd(e,t+n),Qe.fromClientRect(a.getBoundingClientRect())},hs=function(e,t){return 0!==t.letterSpacing?qe(e).map(function(e){return We(e)}):ps(e,t)},ps=function(e,t){for(var n,i=function(e,t){var n=qe(e),i=u(n,t),a=i[0],s=i[1],o=i[2],r=n.length,l=0,c=0;return{next:function(){if(r<=c)return{done:!0,value:null};for(var e=St;c<r&&(e=d(n,s,a,++c,o))===St;);if(e===St&&c!==r)return{done:!0,value:null};var t=new Pt(n,e,l,c);return l=c,{value:t,done:!1}}}}(e,{lineBreak:t.lineBreak,wordBreak:t.overflowWrap===na.BREAK_WORD?"break-word":t.wordBreak}),a=[];!(n=i.next()).done;)n.value&&a.push(n.value.slice());return a},fs=function(e,t){var n,i,a,s,o,r;this.text=ms(e.data,t.textTransform),this.textBounds=(n=this.text,a=e,s=hs(n,i=t),o=[],r=0,s.forEach(function(e){if(i.textDecorationLine.length||0<e.trim().length)if(Kn.SUPPORT_RANGE_BOUNDS)o.push(new ds(e,_s(a,r,e.length)));else{var t=a.splitText(e.length);o.push(new ds(e,us(a))),a=t}else Kn.SUPPORT_RANGE_BOUNDS||(a=a.splitText(e.length));r+=e.length}),o)},ms=function(e,t){switch(t){case fa.LOWERCASE:return e.toLowerCase();case fa.CAPITALIZE:return e.replace(gs,As);case fa.UPPERCASE:return e.toUpperCase();default:return e}},gs=/(^|\s|:|-|\(|\))([a-z])/g,As=function(e,t,n){return 0<e.length?t+n.toUpperCase():e},vs=(e(re,Ua=cs),re),bs=(e(le,Ha=cs),le),ys=(e(ce,Qa=cs),ce),$s=(e(de,za=cs),de),ws=(e(ue,qa=cs),ue),ks=[{type:st.DIMENSION_TOKEN,flags:0,unit:"px",number:3}],Cs=[{type:st.PERCENTAGE_TOKEN,flags:0,number:50}],Es="checkbox",Ts="radio",xs="password",Is=707406591,Ds=(e(_e,Wa=cs),_e),Os=(e(he,Ya=cs),he),Ss=(e(pe,Va=cs),pe),Rs=(e(me,Ga=cs),me),Bs=["OL","UL","MENU"],Ns=function(e,t,n){for(var i=e.firstChild,a=void 0;i;i=a)if(a=i.nextSibling,Ls(i)&&0<i.data.trim().length)t.textNodes.push(new fs(i,t.styles));else if(Ps(i)){var s=Fs(i);s.styles.isVisible()&&(Ms(i,s,n)?s.flags|=4:js(s.styles)&&(s.flags|=2),-1!==Bs.indexOf(i.tagName)&&(s.flags|=8),t.elements.push(s),Xs(i)||qs(i)||Js(i)||Ns(i,s,n))}},Fs=function(e){return Vs(e)?new vs(e):Ys(e)?new bs(e):qs(e)?new ys(e):Hs(e)?new $s(e):Qs(e)?new ws(e):zs(e)?new Ds(e):Js(e)?new Os(e):Xs(e)?new Ss(e):Gs(e)?new Rs(e):new cs(e)},Ks=function(e){var t=Fs(e);return t.flags|=4,Ns(e,t,t),t},Ms=function(e,t,n){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||Ws(e)&&n.styles.isTransparent()},js=function(e){return e.isPositioned()||e.isFloating()},Ls=function(e){return e.nodeType===Node.TEXT_NODE},Ps=function(e){return e.nodeType===Node.ELEMENT_NODE},Us=function(e){return void 0!==e.style},Hs=function(e){return"LI"===e.tagName},Qs=function(e){return"OL"===e.tagName},zs=function(e){return"INPUT"===e.tagName},qs=function(e){return"svg"===e.tagName},Ws=function(e){return"BODY"===e.tagName},Ys=function(e){return"CANVAS"===e.tagName},Vs=function(e){return"IMG"===e.tagName},Gs=function(e){return"IFRAME"===e.tagName},Xs=function(e){return"TEXTAREA"===e.tagName},Js=function(e){return"SELECT"===e.tagName},Zs=(Ae.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},Ae.prototype.getCounterValues=function(e){return this.counters[e]||[]},Ae.prototype.pop=function(e){var t=this;e.forEach(function(e){return t.counters[e].pop()})},Ae.prototype.parse=function(e){var n=this,t=e.counterIncrement,i=e.counterReset,a=!0;null!==t&&t.forEach(function(e){var t=n.counters[e.counter];t&&0!==e.increment&&(a=!1,t[Math.max(0,t.length-1)]+=e.increment)});var s=[];return a&&i.forEach(function(e){var t=n.counters[e.counter];s.push(e.counter),t||(t=n.counters[e.counter]=[]),t.push(e.reset)}),s},Ae),eo={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},to={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u0554","\u0553","\u0552","\u0551","\u0550","\u054f","\u054e","\u054d","\u054c","\u054b","\u054a","\u0549","\u0548","\u0547","\u0546","\u0545","\u0544","\u0543","\u0542","\u0541","\u0540","\u053f","\u053e","\u053d","\u053c","\u053b","\u053a","\u0539","\u0538","\u0537","\u0536","\u0535","\u0534","\u0533","\u0532","\u0531"]},no={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["\u05d9\u05f3","\u05d8\u05f3","\u05d7\u05f3","\u05d6\u05f3","\u05d5\u05f3","\u05d4\u05f3","\u05d3\u05f3","\u05d2\u05f3","\u05d1\u05f3","\u05d0\u05f3","\u05ea","\u05e9","\u05e8","\u05e7","\u05e6","\u05e4","\u05e2","\u05e1","\u05e0","\u05de","\u05dc","\u05db","\u05d9\u05d8","\u05d9\u05d7","\u05d9\u05d6","\u05d8\u05d6","\u05d8\u05d5","\u05d9","\u05d8","\u05d7","\u05d6","\u05d5","\u05d4","\u05d3","\u05d2","\u05d1","\u05d0"]},io={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["\u10f5","\u10f0","\u10ef","\u10f4","\u10ee","\u10ed","\u10ec","\u10eb","\u10ea","\u10e9","\u10e8","\u10e7","\u10e6","\u10e5","\u10e4","\u10f3","\u10e2","\u10e1","\u10e0","\u10df","\u10de","\u10dd","\u10f2","\u10dc","\u10db","\u10da","\u10d9","\u10d8","\u10d7","\u10f1","\u10d6","\u10d5","\u10d4","\u10d3","\u10d2","\u10d1","\u10d0"]},ao="\ub9c8\uc774\ub108\uc2a4",so=function(e,t,n){var i=n?". ":"",a=n?"\u3001":"",s=n?", ":"",o=n?" ":"";switch(t){case qi.DISC:return"\u2022"+o;case qi.CIRCLE:return"\u25e6"+o;case qi.SQUARE:return"\u25fe"+o;case qi.DECIMAL_LEADING_ZERO:var r=ye(e,48,57,!0,i);return r.length<4?"0"+r:r;case qi.CJK_DECIMAL:return $e(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d",a);case qi.LOWER_ROMAN:return ve(e,1,3999,eo,qi.DECIMAL,i).toLowerCase();case qi.UPPER_ROMAN:return ve(e,1,3999,eo,qi.DECIMAL,i);case qi.LOWER_GREEK:return ye(e,945,969,!1,i);case qi.LOWER_ALPHA:return ye(e,97,122,!1,i);case qi.UPPER_ALPHA:return ye(e,65,90,!1,i);case qi.ARABIC_INDIC:return ye(e,1632,1641,!0,i);case qi.ARMENIAN:case qi.UPPER_ARMENIAN:return ve(e,1,9999,to,qi.DECIMAL,i);case qi.LOWER_ARMENIAN:return ve(e,1,9999,to,qi.DECIMAL,i).toLowerCase();case qi.BENGALI:return ye(e,2534,2543,!0,i);case qi.CAMBODIAN:case qi.KHMER:return ye(e,6112,6121,!0,i);case qi.CJK_EARTHLY_BRANCH:return $e(e,"\u5b50\u4e11\u5bc5\u536f\u8fb0\u5df3\u5348\u672a\u7533\u9149\u620c\u4ea5",a);case qi.CJK_HEAVENLY_STEM:return $e(e,"\u7532\u4e59\u4e19\u4e01\u620a\u5df1\u5e9a\u8f9b\u58ec\u7678",a);case qi.CJK_IDEOGRAPHIC:case qi.TRAD_CHINESE_INFORMAL:return we(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8ca0",a,14);case qi.TRAD_CHINESE_FORMAL:return we(e,"\u96f6\u58f9\u8cb3\u53c3\u8086\u4f0d\u9678\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8ca0",a,15);case qi.SIMP_CHINESE_INFORMAL:return we(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c","\u8d1f",a,14);case qi.SIMP_CHINESE_FORMAL:return we(e,"\u96f6\u58f9\u8d30\u53c1\u8086\u4f0d\u9646\u67d2\u634c\u7396","\u62fe\u4f70\u4edf\u842c","\u8d1f",a,15);case qi.JAPANESE_INFORMAL:return we(e,"\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",a,0);case qi.JAPANESE_FORMAL:return we(e,"\u96f6\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343\u4e07","\u30de\u30a4\u30ca\u30b9",a,7);case qi.KOREAN_HANGUL_FORMAL:return we(e,"\uc601\uc77c\uc774\uc0bc\uc0ac\uc624\uc721\uce60\ud314\uad6c","\uc2ed\ubc31\ucc9c\ub9cc",ao,s,7);case qi.KOREAN_HANJA_INFORMAL:return we(e,"\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u5341\u767e\u5343\u842c",ao,s,0);case qi.KOREAN_HANJA_FORMAL:return we(e,"\u96f6\u58f9\u8cb3\u53c3\u56db\u4e94\u516d\u4e03\u516b\u4e5d","\u62fe\u767e\u5343",ao,s,7);case qi.DEVANAGARI:return ye(e,2406,2415,!0,i);case qi.GEORGIAN:return ve(e,1,19999,io,qi.DECIMAL,i);case qi.GUJARATI:return ye(e,2790,2799,!0,i);case qi.GURMUKHI:return ye(e,2662,2671,!0,i);case qi.HEBREW:return ve(e,1,10999,no,qi.DECIMAL,i);case qi.HIRAGANA:return $e(e,"\u3042\u3044\u3046\u3048\u304a\u304b\u304d\u304f\u3051\u3053\u3055\u3057\u3059\u305b\u305d\u305f\u3061\u3064\u3066\u3068\u306a\u306b\u306c\u306d\u306e\u306f\u3072\u3075\u3078\u307b\u307e\u307f\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308a\u308b\u308c\u308d\u308f\u3090\u3091\u3092\u3093");case qi.HIRAGANA_IROHA:return $e(e,"\u3044\u308d\u306f\u306b\u307b\u3078\u3068\u3061\u308a\u306c\u308b\u3092\u308f\u304b\u3088\u305f\u308c\u305d\u3064\u306d\u306a\u3089\u3080\u3046\u3090\u306e\u304a\u304f\u3084\u307e\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304d\u3086\u3081\u307f\u3057\u3091\u3072\u3082\u305b\u3059");case qi.KANNADA:return ye(e,3302,3311,!0,i);case qi.KATAKANA:return $e(e,"\u30a2\u30a4\u30a6\u30a8\u30aa\u30ab\u30ad\u30af\u30b1\u30b3\u30b5\u30b7\u30b9\u30bb\u30bd\u30bf\u30c1\u30c4\u30c6\u30c8\u30ca\u30cb\u30cc\u30cd\u30ce\u30cf\u30d2\u30d5\u30d8\u30db\u30de\u30df\u30e0\u30e1\u30e2\u30e4\u30e6\u30e8\u30e9\u30ea\u30eb\u30ec\u30ed\u30ef\u30f0\u30f1\u30f2\u30f3",a);case qi.KATAKANA_IROHA:return $e(e,"\u30a4\u30ed\u30cf\u30cb\u30db\u30d8\u30c8\u30c1\u30ea\u30cc\u30eb\u30f2\u30ef\u30ab\u30e8\u30bf\u30ec\u30bd\u30c4\u30cd\u30ca\u30e9\u30e0\u30a6\u30f0\u30ce\u30aa\u30af\u30e4\u30de\u30b1\u30d5\u30b3\u30a8\u30c6\u30a2\u30b5\u30ad\u30e6\u30e1\u30df\u30b7\u30f1\u30d2\u30e2\u30bb\u30b9",a);case qi.LAO:return ye(e,3792,3801,!0,i);case qi.MONGOLIAN:return ye(e,6160,6169,!0,i);case qi.MYANMAR:return ye(e,4160,4169,!0,i);case qi.ORIYA:return ye(e,2918,2927,!0,i);case qi.PERSIAN:return ye(e,1776,1785,!0,i);case qi.TAMIL:return ye(e,3046,3055,!0,i);case qi.TELUGU:return ye(e,3174,3183,!0,i);case qi.THAI:return ye(e,3664,3673,!0,i);case qi.TIBETAN:return ye(e,3872,3881,!0,i);case qi.DECIMAL:default:return ye(e,48,57,!0,i)}},oo="data-html2canvas-ignore",ro=(ke.prototype.toIFrame=function(e,n){var t=this,i=uo(e,n);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var a=e.defaultView.pageXOffset,s=e.defaultView.pageYOffset,o=i.contentWindow,r=o.document,l=_o(i).then(function(){return c(t,void 0,void 0,function(){var t;return F(this,function(e){switch(e.label){case 0:return this.scrolledElements.forEach(mo),o&&(o.scrollTo(n.left,n.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||o.scrollY===n.top&&o.scrollX===n.left||(r.documentElement.style.top=-n.top+"px",r.documentElement.style.left=-n.left+"px",r.documentElement.style.position="absolute")),t=this.options.onclone,void 0===this.clonedReferenceElement?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:r.fonts&&r.fonts.ready?[4,r.fonts.ready]:[3,2];case 1:e.sent(),e.label=2;case 2:return"function"==typeof t?[2,Promise.resolve().then(function(){return t(r)}).then(function(){return i})]:[2,i]}})})});return r.open(),r.write(po(document.doctype)+"<html></html>"),fo(this.referenceElement.ownerDocument,a,s),r.replaceChild(r.adoptNode(this.documentElement),r.documentElement),r.close(),l},ke.prototype.createElementClone=function(e){return Ys(e)?this.createCanvasClone(e):ge(e)?this.createStyleClone(e):e.cloneNode(!1)},ke.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var n=[].slice.call(t.cssRules,0).reduce(function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e},""),i=e.cloneNode(!1);return i.textContent=n,i}}catch(e){if(Mn.getInstance(this.options.id).error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},ke.prototype.createCanvasClone=function(e){if(this.options.inlineImages&&e.ownerDocument){var t=e.ownerDocument.createElement("img");try{return t.src=e.toDataURL(),t}catch(e){Mn.getInstance(this.options.id).info("Unable to clone canvas contents, canvas is tainted")}}var n=e.cloneNode(!1);try{n.width=e.width,n.height=e.height;var i=e.getContext("2d"),a=n.getContext("2d");return a&&(i?a.putImageData(i.getImageData(0,0,e.width,e.height),0,0):a.drawImage(e,0,0)),n}catch(e){}return n},ke.prototype.cloneNode=function(e){if(Ls(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var t=e.ownerDocument.defaultView;if(Us(e)&&t){var n=this.createElementClone(e),i=t.getComputedStyle(e),a=t.getComputedStyle(e,":before"),s=t.getComputedStyle(e,":after");this.referenceElement===e&&(this.clonedReferenceElement=n),Ws(n)&&bo(n);for(var o=this.counters.parse(new rs(i)),r=this.resolvePseudoContent(e,n,a,Xa.BEFORE),l=e.firstChild;l;l=l.nextSibling)Ps(l)&&("SCRIPT"===l.tagName||l.hasAttribute(oo)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(l))||this.options.copyStyles&&Ps(l)&&ge(l)||n.appendChild(this.cloneNode(l));r&&n.insertBefore(r,n.firstChild);var c=this.resolvePseudoContent(e,n,s,Xa.AFTER);return c&&n.appendChild(c),this.counters.pop(o),i&&this.options.copyStyles&&!Gs(e)&&ho(i,n),0===e.scrollTop&&0===e.scrollLeft||this.scrolledElements.push([n,e.scrollLeft,e.scrollTop]),(Xs(e)||Js(e))&&(Xs(n)||Js(n))&&(n.value=e.value),n}return e.cloneNode(!1)},ke.prototype.resolvePseudoContent=function(p,e,t,n){var f=this;if(t){var i=t.content,m=e.ownerDocument;if(m&&i&&"none"!==i&&"-moz-alt-content"!==i&&"none"!==t.display){this.counters.parse(new rs(t));var g=new os(t),A=m.createElement("html2canvaspseudoelement");return ho(t,A),g.content.forEach(function(e){if(e.type===st.STRING_TOKEN)A.appendChild(m.createTextNode(e.value));else if(e.type===st.URL_TOKEN){var t=m.createElement("img");t.src=e.value,t.style.opacity="1",A.appendChild(t)}else if(e.type===st.FUNCTION){if("attr"===e.name){var n=e.values.filter($);n.length&&A.appendChild(m.createTextNode(p.getAttribute(n[0].value)||""))}else if("counter"===e.name){var i=e.values.filter(E),a=i[0],s=i[1];if(a&&$(a)){var o=f.counters.getCounterValue(a.value),r=s&&$(s)?Xi.parse(s.value):qi.DECIMAL;A.appendChild(m.createTextNode(so(o,r,!1)))}}else if("counters"===e.name){var l=e.values.filter(E),c=(a=l[0],l[1]);if(s=l[2],a&&$(a)){var d=f.counters.getCounterValues(a.value),u=s&&$(s)?Xi.parse(s.value):qi.DECIMAL,_=c&&c.type===st.STRING_TOKEN?c.value:"",h=d.map(function(e){return so(e,u,!1)}).join(_);A.appendChild(m.createTextNode(h))}}}else if(e.type===st.IDENT_TOKEN)switch(e.value){case"open-quote":A.appendChild(m.createTextNode(se(g.quotes,f.quoteDepth++,!0)));break;case"close-quote":A.appendChild(m.createTextNode(se(g.quotes,--f.quoteDepth,!1)));break;default:A.appendChild(m.createTextNode(e.value))}}),A.className=go+" "+Ao,e.className+=n===Xa.BEFORE?" "+go:" "+Ao,A}}},ke.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},ke);(Ja=Xa||(Xa={}))[Ja.BEFORE=0]="BEFORE",Ja[Ja.AFTER=1]="AFTER";var lo,co,uo=function(e,t){var n=e.createElement("iframe");return n.className="html2canvas-container",n.style.visibility="hidden",n.style.position="fixed",n.style.left="-10000px",n.style.top="0px",n.style.border="0",n.width=t.width.toString(),n.height=t.height.toString(),n.scrolling="no",n.setAttribute(oo,"true"),e.body.appendChild(n),n},_o=function(a){return new Promise(function(t,e){var n=a.contentWindow;if(!n)return e("No window assigned for iframe");var i=n.document;n.onload=a.onload=i.onreadystatechange=function(){n.onload=a.onload=i.onreadystatechange=null;var e=setInterval(function(){0<i.body.childNodes.length&&"complete"===i.readyState&&(clearInterval(e),t(a))},50)}})},ho=function(e,t){for(var n=e.length-1;0<=n;n--){var i=e.item(n);"content"!==i&&t.style.setProperty(i,e.getPropertyValue(i))}return t},po=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},fo=function(e,t,n){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||n!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,n)},mo=function(e){var t=e[0],n=e[1],i=e[2];t.scrollLeft=n,t.scrollTop=i},go="___html2canvas___pseudoelement_before",Ao="___html2canvas___pseudoelement_after",vo='{\n    content: "" !important;\n    display: none !important;\n}',bo=function(e){yo(e,"."+go+":before"+vo+"\n         ."+Ao+":after"+vo)},yo=function(e,t){var n=e.ownerDocument;if(n){var i=n.createElement("style");i.textContent=t,e.appendChild(i)}};(co=lo||(lo={}))[co.VECTOR=0]="VECTOR",co[co.BEZIER_CURVE=1]="BEZIER_CURVE";var $o,wo,ko=(Ee.prototype.add=function(e,t){return new Ee(this.x+e,this.y+t)},Ee),Co=(xe.prototype.subdivide=function(e,t){var n=Te(this.start,this.startControl,e),i=Te(this.startControl,this.endControl,e),a=Te(this.endControl,this.end,e),s=Te(n,i,e),o=Te(i,a,e),r=Te(s,o,e);return t?new xe(this.start,n,s,r):new xe(r,o,a,this.end)},xe.prototype.add=function(e,t){return new xe(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},xe.prototype.reverse=function(){return new xe(this.end,this.endControl,this.startControl,this.start)},xe),Eo=function(e){var t=e.styles,n=e.bounds,i=O(t.borderTopLeftRadius,n.width,n.height),a=i[0],s=i[1],o=O(t.borderTopRightRadius,n.width,n.height),r=o[0],l=o[1],c=O(t.borderBottomRightRadius,n.width,n.height),d=c[0],u=c[1],_=O(t.borderBottomLeftRadius,n.width,n.height),h=_[0],p=_[1],f=[];f.push((a+r)/n.width),f.push((h+d)/n.width),f.push((s+p)/n.height),f.push((l+u)/n.height);var m=Math.max.apply(Math,f);1<m&&(a/=m,s/=m,r/=m,l/=m,d/=m,u/=m,h/=m,p/=m);var g=n.width-r,A=n.height-u,v=n.width-d,b=n.height-p,y=t.borderTopWidth,$=t.borderRightWidth,w=t.borderBottomWidth,k=t.borderLeftWidth,C=bn(t.paddingTop,e.bounds.width),E=bn(t.paddingRight,e.bounds.width),T=bn(t.paddingBottom,e.bounds.width),x=bn(t.paddingLeft,e.bounds.width);this.topLeftBorderBox=0<a||0<s?To(n.left,n.top,a,s,$o.TOP_LEFT):new ko(n.left,n.top),this.topRightBorderBox=0<r||0<l?To(n.left+g,n.top,r,l,$o.TOP_RIGHT):new ko(n.left+n.width,n.top),this.bottomRightBorderBox=0<d||0<u?To(n.left+v,n.top+A,d,u,$o.BOTTOM_RIGHT):new ko(n.left+n.width,n.top+n.height),this.bottomLeftBorderBox=0<h||0<p?To(n.left,n.top+b,h,p,$o.BOTTOM_LEFT):new ko(n.left,n.top+n.height),this.topLeftPaddingBox=0<a||0<s?To(n.left+k,n.top+y,Math.max(0,a-k),Math.max(0,s-y),$o.TOP_LEFT):new ko(n.left+k,n.top+y),this.topRightPaddingBox=0<r||0<l?To(n.left+Math.min(g,n.width+k),n.top+y,g>n.width+k?0:r-k,l-y,$o.TOP_RIGHT):new ko(n.left+n.width-$,n.top+y),this.bottomRightPaddingBox=0<d||0<u?To(n.left+Math.min(v,n.width-k),n.top+Math.min(A,n.height+y),Math.max(0,d-$),u-w,$o.BOTTOM_RIGHT):new ko(n.left+n.width-$,n.top+n.height-w),this.bottomLeftPaddingBox=0<h||0<p?To(n.left+k,n.top+b,Math.max(0,h-k),p-w,$o.BOTTOM_LEFT):new ko(n.left+k,n.top+n.height-w),this.topLeftContentBox=0<a||0<s?To(n.left+k+x,n.top+y+C,Math.max(0,a-(k+x)),Math.max(0,s-(y+C)),$o.TOP_LEFT):new ko(n.left+k+x,n.top+y+C),this.topRightContentBox=0<r||0<l?To(n.left+Math.min(g,n.width+k+x),n.top+y+C,g>n.width+k+x?0:r-k+x,l-(y+C),$o.TOP_RIGHT):new ko(n.left+n.width-($+E),n.top+y+C),this.bottomRightContentBox=0<d||0<u?To(n.left+Math.min(v,n.width-(k+x)),n.top+Math.min(A,n.height+y+C),Math.max(0,d-($+E)),u-(w+T),$o.BOTTOM_RIGHT):new ko(n.left+n.width-($+E),n.top+n.height-(w+T)),this.bottomLeftContentBox=0<h||0<p?To(n.left+k+x,n.top+b,Math.max(0,h-(k+x)),p-(w+T),$o.BOTTOM_LEFT):new ko(n.left+k+x,n.top+n.height-(w+T))};(wo=$o||($o={}))[wo.TOP_LEFT=0]="TOP_LEFT",wo[wo.TOP_RIGHT=1]="TOP_RIGHT",wo[wo.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",wo[wo.BOTTOM_LEFT=3]="BOTTOM_LEFT";var To=function(e,t,n,i,a){var s=(Math.sqrt(2)-1)/3*4,o=n*s,r=i*s,l=e+n,c=t+i;switch(a){case $o.TOP_LEFT:return new Co(new ko(e,c),new ko(e,c-r),new ko(l-o,t),new ko(l,t));case $o.TOP_RIGHT:return new Co(new ko(e,t),new ko(e+o,t),new ko(l,c-r),new ko(l,c));case $o.BOTTOM_RIGHT:return new Co(new ko(l,t),new ko(l,t+r),new ko(e+o,c),new ko(e,c));case $o.BOTTOM_LEFT:default:return new Co(new ko(l,c),new ko(l-o,c),new ko(e,t+r),new ko(e,t))}},xo=function(e,t,n){this.type=0,this.offsetX=e,this.offsetY=t,this.matrix=n,this.target=6},Io=function(e,t){this.type=1,this.target=t,this.path=e},Do=function(e){this.element=e,this.inlineLevel=[],
this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Oo=(Se.prototype.getParentEffects=function(){var e=this.effects.slice(0);if(this.container.styles.overflowX!==Vi.VISIBLE){var t=De(this.curves),n=Oe(this.curves);Ce(t,n)||e.push(new Io(n,6))}return e},Se),So=function(d,u,_,h){d.container.elements.forEach(function(e){var t=ae(e.flags,4),n=ae(e.flags,2),i=new Oo(e,d.getParentEffects());ae(e.styles.display,2048)&&h.push(i);var a=ae(e.flags,8)?[]:h;if(t||n){var s=t||e.styles.isPositioned()?_:u,o=new Do(i);if(e.styles.isPositioned()||e.styles.opacity<1||e.styles.isTransformed()){var r=e.styles.zIndex.order;if(r<0){var l=0;s.negativeZIndex.some(function(e,t){return r>e.element.container.styles.zIndex.order?(l=t,!1):0<l}),s.negativeZIndex.splice(l,0,o)}else if(0<r){var c=0;s.positiveZIndex.some(function(e,t){return r>e.element.container.styles.zIndex.order?(c=t+1,!1):0<c}),s.positiveZIndex.splice(c,0,o)}else s.zeroOrAutoZIndexOrTransformedOrOpacity.push(o)}else e.styles.isFloating()?s.nonPositionedFloats.push(o):s.nonPositionedInlineLevel.push(o);So(i,o,t?o:_,a)}else e.styles.isInlineLevel()?u.inlineLevel.push(i):u.nonInlineLevel.push(i),So(i,u,_,a);ae(e.flags,8)&&Ro(e,a)})},Ro=function(e,t){for(var n=e instanceof ws?e.start:1,i=e instanceof ws&&e.reversed,a=0;a<t.length;a++){var s=t[a];s.container instanceof $s&&"number"==typeof s.container.value&&0!==s.container.value&&(n=s.container.value),s.listValue=so(n,s.container.styles.listStyleType,!0),n+=i?-1:1}},Bo=function(e,t,n,i){var a=[];return Ie(e)?a.push(e.subdivide(.5,!1)):a.push(e),Ie(n)?a.push(n.subdivide(.5,!0)):a.push(n),Ie(i)?a.push(i.subdivide(.5,!0).reverse()):a.push(i),Ie(t)?a.push(t.subdivide(.5,!1).reverse()):a.push(t),a},No=function(e,t,n){var i=t[0],a=t[1],s=t[2],o=e[0],r=e[1];if(I(o)&&r&&I(r))return[bn(o,n.width),bn(r,n.height)];var l=Ke(s);if($(o)&&(o.value===li.CONTAIN||o.value===li.COVER))return Ke(s)?n.width/n.height<s!=(o.value===li.COVER)?[n.width,n.width/s]:[n.height*s,n.height]:[n.width,n.height];var c=Ke(i),d=Ke(a),u=c||d;if(Fe(o)&&(!r||Fe(r)))return c&&d?[i,a]:l||u?u&&l?[c?i:a*s,d?a:i/s]:[c?i:n.width,d?a:n.height]:[n.width,n.height];if(l){var _=0,h=0;return I(o)?_=bn(o,n.width):I(r)&&(h=bn(r,n.height)),Fe(o)?_=h*s:r&&!Fe(r)||(h=_/s),[_,h]}var p=null,f=null;if(I(o)?p=bn(o,n.width):r&&I(r)&&(f=bn(r,n.height)),null===p||r&&!Fe(r)||(f=c&&d?p/i*a:n.height),null!==f&&Fe(o)&&(p=c&&d?f/a*i:n.width),null!==p&&null!==f)return[p,f];throw new Error("Unable to calculate background-size for element")},Fo=function(e,t){var n=e[t];return void 0===n?e[0]:n},Ko=function(e,t,n,i,a){var s=t[0],o=t[1],r=n[0],l=n[1];switch(e){case ti.REPEAT_X:return[new ko(Math.round(i.left),Math.round(i.top+o)),new ko(Math.round(i.left+i.width),Math.round(i.top+o)),new ko(Math.round(i.left+i.width),Math.round(l+i.top+o)),new ko(Math.round(i.left),Math.round(l+i.top+o))];case ti.REPEAT_Y:return[new ko(Math.round(i.left+s),Math.round(i.top)),new ko(Math.round(i.left+s+r),Math.round(i.top)),new ko(Math.round(i.left+s+r),Math.round(i.height+i.top)),new ko(Math.round(i.left+s),Math.round(i.height+i.top))];case ti.NO_REPEAT:return[new ko(Math.round(i.left+s),Math.round(i.top+o)),new ko(Math.round(i.left+s+r),Math.round(i.top+o)),new ko(Math.round(i.left+s+r),Math.round(i.top+o+l)),new ko(Math.round(i.left+s),Math.round(i.top+o+l))];default:return[new ko(Math.round(a.left),Math.round(a.top)),new ko(Math.round(a.left+a.width),Math.round(a.top)),new ko(Math.round(a.left+a.width),Math.round(a.height+a.top)),new ko(Math.round(a.left),Math.round(a.height+a.top))]}},Mo="Hidden Text",jo=(Me.prototype.parseMetrics=function(e,t){var n=this._document.createElement("div"),i=this._document.createElement("img"),a=this._document.createElement("span"),s=this._document.body;n.style.visibility="hidden",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",s.appendChild(n),i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",a.style.fontFamily=e,a.style.fontSize=t,a.style.margin="0",a.style.padding="0",a.appendChild(this._document.createTextNode(Mo)),n.appendChild(a),n.appendChild(i);var o=i.offsetTop-a.offsetTop+2;n.removeChild(a),n.appendChild(this._document.createTextNode(Mo)),n.style.lineHeight="normal",i.style.verticalAlign="super";var r=i.offsetTop-n.offsetTop+2;return s.removeChild(n),{baseline:o,middle:r}},Me.prototype.getMetrics=function(e,t){var n=e+" "+t;return void 0===this._data[n]&&(this._data[n]=this.parseMetrics(e,t)),this._data[n]},Me),Lo=(je.prototype.applyEffects=function(e,t){for(var n=this;this._activeEffects.length;)this.popEffect();e.filter(function(e){return ae(e.target,t)}).forEach(function(e){return n.applyEffect(e)})},je.prototype.applyEffect=function(e){this.ctx.save(),0===e.type&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),1===e.type&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},je.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},je.prototype.renderStack=function(n){return c(this,void 0,void 0,function(){var t;return F(this,function(e){switch(e.label){case 0:return(t=n.element.container.styles).isVisible()?(this.ctx.globalAlpha=t.opacity,[4,this.renderStackContent(n)]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},je.prototype.renderNode=function(t){return c(this,void 0,void 0,function(){return F(this,function(e){switch(e.label){case 0:return t.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(t)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(t)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},je.prototype.renderTextWithLetterSpacing=function(n,e){var i=this;0===e?this.ctx.fillText(n.text,n.bounds.left,n.bounds.top+n.bounds.height):qe(n.text).map(function(e){return We(e)}).reduce(function(e,t){return i.ctx.fillText(t,e,n.bounds.top+n.bounds.height),e+i.ctx.measureText(t).width},n.bounds.left)},je.prototype.createFontStyle=function(e){var t=e.fontVariant.filter(function(e){return"normal"===e||"small-caps"===e}).join(""),n=e.fontFamily.join(", "),i=r(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,i,n].join(" "),n,i]},je.prototype.renderTextNode=function(n,r){return c(this,void 0,void 0,function(){var e,t,a,s,o=this;return F(this,function(){return e=this.createFontStyle(r),t=e[0],a=e[1],s=e[2],this.ctx.font=t,n.textBounds.forEach(function(i){o.ctx.fillStyle=K(r.color),o.renderTextWithLetterSpacing(i,r.letterSpacing);var e=r.textShadow;e.length&&i.text.trim().length&&(e.slice(0).reverse().forEach(function(e){o.ctx.shadowColor=K(e.color),o.ctx.shadowOffsetX=e.offsetX.number*o.options.scale,o.ctx.shadowOffsetY=e.offsetY.number*o.options.scale,o.ctx.shadowBlur=e.blur.number,o.ctx.fillText(i.text,i.bounds.left,i.bounds.top+i.bounds.height)}),o.ctx.shadowColor="",o.ctx.shadowOffsetX=0,o.ctx.shadowOffsetY=0,o.ctx.shadowBlur=0),r.textDecorationLine.length&&(o.ctx.fillStyle=K(r.textDecorationColor||r.color),r.textDecorationLine.forEach(function(e){switch(e){case 1:var t=o.fontMetrics.getMetrics(a,s).baseline;o.ctx.fillRect(i.bounds.left,Math.round(i.bounds.top+t),i.bounds.width,1);break;case 2:o.ctx.fillRect(i.bounds.left,Math.round(i.bounds.top),i.bounds.width,1);break;case 3:var n=o.fontMetrics.getMetrics(a,s).middle;o.ctx.fillRect(i.bounds.left,Math.ceil(i.bounds.top+n),i.bounds.width,1)}}))}),[2]})})},je.prototype.renderReplacedElement=function(e,t,n){if(n&&0<e.intrinsicWidth&&0<e.intrinsicHeight){var i=Be(e),a=Oe(t);this.path(a),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(n,0,0,e.intrinsicWidth,e.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},je.prototype.renderNodeContent=function(g){return c(this,void 0,void 0,function(){var i,a,s,o,r,l,c,d,u,_,h,p,f,m;return F(this,function(e){switch(e.label){case 0:this.applyEffects(g.effects,4),i=g.container,a=g.curves,s=i.styles,o=0,r=i.textNodes,e.label=1;case 1:return o<r.length?(l=r[o],[4,this.renderTextNode(l,s)]):[3,4];case 2:e.sent(),e.label=3;case 3:return o++,[3,1];case 4:if(!(i instanceof vs))return[3,8];e.label=5;case 5:return e.trys.push([5,7,,8]),[4,this.options.cache.match(i.src)];case 6:return p=e.sent(),this.renderReplacedElement(i,a,p),[3,8];case 7:return e.sent(),Mn.getInstance(this.options.id).error("Error loading image "+i.src),[3,8];case 8:if(i instanceof bs&&this.renderReplacedElement(i,a,i.canvas),!(i instanceof ys))return[3,12];e.label=9;case 9:return e.trys.push([9,11,,12]),[4,this.options.cache.match(i.svg)];case 10:return p=e.sent(),this.renderReplacedElement(i,a,p),[3,12];case 11:return e.sent(),Mn.getInstance(this.options.id).error("Error loading svg "+i.svg.substring(0,255)),[3,12];case 12:return i instanceof Rs&&i.tree?[4,new je({id:this.options.id,scale:this.options.scale,backgroundColor:i.backgroundColor,x:0,y:0,scrollX:0,scrollY:0,width:i.width,height:i.height,cache:this.options.cache,windowWidth:i.width,windowHeight:i.height}).render(i.tree)]:[3,14];case 13:c=e.sent(),i.width&&i.height&&this.ctx.drawImage(c,0,0,i.width,i.height,i.bounds.left,i.bounds.top,i.bounds.width,i.bounds.height),e.label=14;case 14:if(i instanceof Ds&&(d=Math.min(i.bounds.width,i.bounds.height),i.type===Es?i.checked&&(this.ctx.save(),this.path([new ko(i.bounds.left+.39363*d,i.bounds.top+.79*d),new ko(i.bounds.left+.16*d,i.bounds.top+.5549*d),new ko(i.bounds.left+.27347*d,i.bounds.top+.44071*d),new ko(i.bounds.left+.39694*d,i.bounds.top+.5649*d),new ko(i.bounds.left+.72983*d,i.bounds.top+.23*d),new ko(i.bounds.left+.84*d,i.bounds.top+.34085*d),new ko(i.bounds.left+.39363*d,i.bounds.top+.79*d)]),this.ctx.fillStyle=K(Is),this.ctx.fill(),this.ctx.restore()):i.type===Ts&&i.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(i.bounds.left+d/2,i.bounds.top+d/2,d/4,0,2*Math.PI,!0),this.ctx.fillStyle=K(Is),this.ctx.fill(),this.ctx.restore())),Po(i)&&i.value.length){switch(this.ctx.font=this.createFontStyle(s)[0],this.ctx.fillStyle=K(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign=Ho(i.styles.textAlign),m=Be(i),u=0,i.styles.textAlign){case aa.CENTER:u+=m.width/2;break;case aa.RIGHT:u+=m.width}_=m.add(u,0,0,-m.height/2+1),this.ctx.save(),this.path([new ko(m.left,m.top),new ko(m.left+m.width,m.top),new ko(m.left+m.width,m.top+m.height),new ko(m.left,m.top+m.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new ds(i.value,_),s.letterSpacing),this.ctx.restore(),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"}if(!ae(i.styles.display,2048))return[3,20];if(null===i.styles.listStyleImage)return[3,19];if((h=i.styles.listStyleImage).type!==Tn.URL)return[3,18];p=void 0,f=h.url,e.label=15;case 15:return e.trys.push([15,17,,18]),[4,this.options.cache.match(f)];case 16:return p=e.sent(),this.ctx.drawImage(p,i.bounds.left-(p.width+10),i.bounds.top),[3,18];case 17:return e.sent(),Mn.getInstance(this.options.id).error("Error loading list-style-image "+f),[3,18];case 18:return[3,20];case 19:g.listValue&&i.styles.listStyleType!==qi.NONE&&(this.ctx.font=this.createFontStyle(s)[0],this.ctx.fillStyle=K(s.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",m=new Qe(i.bounds.left,i.bounds.top+bn(i.styles.paddingTop,i.bounds.width),i.bounds.width,(t=s.lineHeight,n=s.fontSize.number,($(t)&&"normal"===t.value?1.2*n:t.type===st.NUMBER_TOKEN?n*t.number:I(t)?bn(t,n):n)/2+1)),this.renderTextWithLetterSpacing(new ds(g.listValue,m),s.letterSpacing),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),e.label=20;case 20:return[2]}var t,n})})},je.prototype.renderStackContent=function(m){return c(this,void 0,void 0,function(){var t,n,i,a,s,o,r,l,c,d,u,_,h,p,f;return F(this,function(e){switch(e.label){case 0:return[4,this.renderNodeBackgroundAndBorders(m.element)];case 1:e.sent(),t=0,n=m.negativeZIndex,e.label=2;case 2:return t<n.length?(f=n[t],[4,this.renderStack(f)]):[3,5];case 3:e.sent(),e.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(m.element)];case 6:e.sent(),i=0,a=m.nonInlineLevel,e.label=7;case 7:return i<a.length?(f=a[i],[4,this.renderNode(f)]):[3,10];case 8:e.sent(),e.label=9;case 9:return i++,[3,7];case 10:s=0,o=m.nonPositionedFloats,e.label=11;case 11:return s<o.length?(f=o[s],[4,this.renderStack(f)]):[3,14];case 12:e.sent(),e.label=13;case 13:return s++,[3,11];case 14:r=0,l=m.nonPositionedInlineLevel,e.label=15;case 15:return r<l.length?(f=l[r],[4,this.renderStack(f)]):[3,18];case 16:e.sent(),e.label=17;case 17:return r++,[3,15];case 18:c=0,d=m.inlineLevel,e.label=19;case 19:return c<d.length?(f=d[c],[4,this.renderNode(f)]):[3,22];case 20:e.sent(),e.label=21;case 21:return c++,[3,19];case 22:u=0,_=m.zeroOrAutoZIndexOrTransformedOrOpacity,e.label=23;case 23:return u<_.length?(f=_[u],[4,this.renderStack(f)]):[3,26];case 24:e.sent(),e.label=25;case 25:return u++,[3,23];case 26:h=0,p=m.positiveZIndex,e.label=27;case 27:return h<p.length?(f=p[h],[4,this.renderStack(f)]):[3,30];case 28:e.sent(),e.label=29;case 29:return h++,[3,27];case 30:return[2]}})})},je.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},je.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},je.prototype.formatPath=function(e){var i=this;e.forEach(function(e,t){var n=Ie(e)?e.start:e;0===t?i.ctx.moveTo(n.x,n.y):i.ctx.lineTo(n.x,n.y),Ie(e)&&i.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)})},je.prototype.renderRepeat=function(e,t,n,i){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(n,i),this.ctx.fill(),this.ctx.translate(-n,-i)},je.prototype.resizeImage=function(e,t,n){if(e.width===t&&e.height===n)return e;var i=this.canvas.ownerDocument.createElement("canvas");return i.width=t,i.height=n,i.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,n),i},je.prototype.renderBackgroundImage=function(N){return c(this,void 0,void 0,function(){var R,t,B,n,i,a;return F(this,function(e){switch(e.label){case 0:R=N.styles.backgroundImage.length-1,t=function(t){var n,i,a,s,o,r,l,c,d,u,_,h,p,f,m,g,A,v,b,y,$,w,k,C,E,T,x,I,D,O,S;return F(this,function(e){switch(e.label){case 0:if(t.type!==Tn.URL)return[3,5];n=void 0,i=t.url,e.label=1;case 1:return e.trys.push([1,3,,4]),[4,B.options.cache.match(i)];case 2:return n=e.sent(),[3,4];case 3:return e.sent(),Mn.getInstance(B.options.id).error("Error loading background-image "+i),[3,4];case 4:return n&&(a=Ne(N,R,[n.width,n.height,n.width/n.height]),g=a[0],w=a[1],k=a[2],b=a[3],y=a[4],f=B.ctx.createPattern(B.resizeImage(n,b,y),"repeat"),B.renderRepeat(g,f,w,k)),[3,6];case 5:t.type!==Tn.LINEAR_GRADIENT?t.type===Tn.RADIAL_GRADIENT&&(m=Ne(N,R,[null,null,null]),g=m[0],A=m[1],v=m[2],b=m[3],y=m[4],$=0===t.position.length?[An]:t.position,w=bn($[0],b),k=bn($[$.length-1],y),C=function(e,t,n,i,a){var s=0,o=0;switch(e.size){case On.CLOSEST_SIDE:e.shape===In.CIRCLE?s=o=Math.min(Math.abs(t),Math.abs(t-i),Math.abs(n),Math.abs(n-a)):e.shape===In.ELLIPSE&&(s=Math.min(Math.abs(t),Math.abs(t-i)),o=Math.min(Math.abs(n),Math.abs(n-a)));break;case On.CLOSEST_CORNER:if(e.shape===In.CIRCLE)s=o=Math.min(Q(t,n),Q(t,n-a),Q(t-i,n),Q(t-i,n-a));else if(e.shape===In.ELLIPSE){var r=Math.min(Math.abs(n),Math.abs(n-a))/Math.min(Math.abs(t),Math.abs(t-i)),l=z(i,a,t,n,!0),c=l[0],d=l[1];o=r*(s=Q(c-t,(d-n)/r))}break;case On.FARTHEST_SIDE:e.shape===In.CIRCLE?s=o=Math.max(Math.abs(t),Math.abs(t-i),Math.abs(n),Math.abs(n-a)):e.shape===In.ELLIPSE&&(s=Math.max(Math.abs(t),Math.abs(t-i)),o=Math.max(Math.abs(n),Math.abs(n-a)));break;case On.FARTHEST_CORNER:if(e.shape===In.CIRCLE)s=o=Math.max(Q(t,n),Q(t,n-a),Q(t-i,n),Q(t-i,n-a));else if(e.shape===In.ELLIPSE){r=Math.max(Math.abs(n),Math.abs(n-a))/Math.max(Math.abs(t),Math.abs(t-i));var u=z(i,a,t,n,!1);o=r*(s=Q((c=u[0])-t,((d=u[1])-n)/r))}}return Array.isArray(e.size)&&(s=bn(e.size[0],i),o=2===e.size.length?bn(e.size[1],a):s),[s,o]}(t,w,k,b,y),E=C[0],T=C[1],0<E&&0<E&&(x=B.ctx.createRadialGradient(A+w,v+k,0,A+w,v+k,E),U(t.stops,2*E).forEach(function(e){return x.addColorStop(e.stop,K(e.color))}),B.path(g),B.ctx.fillStyle=x,E!==T?(I=N.bounds.left+.5*N.bounds.width,D=N.bounds.top+.5*N.bounds.height,S=1/(O=T/E),B.ctx.save(),B.ctx.translate(I,D),B.ctx.transform(1,0,0,O,0,0),B.ctx.translate(-I,-D),B.ctx.fillRect(A,S*(v-D)+D,b,y*S),B.ctx.restore()):B.ctx.fill())):(s=Ne(N,R,[null,null,null]),g=s[0],w=s[1],k=s[2],b=s[3],y=s[4],o=H(t.angle,b,y),r=o[0],l=o[1],c=o[2],d=o[3],u=o[4],(_=document.createElement("canvas")).width=b,_.height=y,h=_.getContext("2d"),p=h.createLinearGradient(l,d,c,u),U(t.stops,r).forEach(function(e){return p.addColorStop(e.stop,K(e.color))}),h.fillStyle=p,h.fillRect(0,0,b,y),0<b&&0<y&&(f=B.ctx.createPattern(_,"repeat"),B.renderRepeat(g,f,w,k))),e.label=6;case 6:return R--,[2]}})},B=this,n=0,i=N.styles.backgroundImage.slice(0).reverse(),e.label=1;case 1:return n<i.length?(a=i[n],[5,t(a)]):[3,4];case 2:e.sent(),e.label=3;case 3:return n++,[3,1];case 4:return[2]}})})},je.prototype.renderBorder=function(e,t,n){return c(this,void 0,void 0,function(){return F(this,function(){return this.path(function(e){switch(t){case 0:return Bo(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return Bo(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return Bo(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);case 3:default:return Bo(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}}(n)),this.ctx.fillStyle=K(e),this.ctx.fill(),[2]})})},je.prototype.renderNodeBackgroundAndBorders=function(d){return c(this,void 0,void 0,function(){var t,n,i,a,s,o,r,l,c=this;return F(this,function(e){switch(e.label){case 0:return this.applyEffects(d.effects,2),t=d.container.styles,n=!B(t.backgroundColor)||t.backgroundImage.length,i=[{style:t.borderTopStyle,color:t.borderTopColor},{style:t.borderRightStyle,color:t.borderRightColor},{style:t.borderBottomStyle,color:t.borderBottomColor},{style:t.borderLeftStyle,color:t.borderLeftColor}],a=Uo(Fo(t.backgroundClip,0),d.curves),n||t.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),B(t.backgroundColor)||(this.ctx.fillStyle=K(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(d.container)]):[3,2];case 1:e.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach(function(e){c.ctx.save();var t,n,i,a,s,o=De(d.curves),r=e.inset?0:1e4,l=(t=o,n=-r+(e.inset?1:-1)*e.spread.number,i=(e.inset?1:-1)*e.spread.number,a=e.spread.number*(e.inset?-2:2),s=e.spread.number*(e.inset?-2:2),t.map(function(e,t){switch(t){case 0:return e.add(n,i);case 1:return e.add(n+a,i);case 2:return e.add(n+a,i+s);case 3:return e.add(n,i+s)}return e}));e.inset?(c.path(o),c.ctx.clip(),c.mask(l)):(c.mask(o),c.ctx.clip(),c.path(l)),c.ctx.shadowOffsetX=e.offsetX.number+r,c.ctx.shadowOffsetY=e.offsetY.number,c.ctx.shadowColor=K(e.color),c.ctx.shadowBlur=e.blur.number,c.ctx.fillStyle=e.inset?K(e.color):"rgba(0,0,0,1)",c.ctx.fill(),c.ctx.restore()}),e.label=2;case 2:o=s=0,r=i,e.label=3;case 3:return o<r.length?(l=r[o]).style===_i.NONE||B(l.color)?[3,5]:[4,this.renderBorder(l.color,s,d.curves)]:[3,7];case 4:e.sent(),e.label=5;case 5:s++,e.label=6;case 6:return o++,[3,3];case 7:return[2]}})})},je.prototype.render=function(s){return c(this,void 0,void 0,function(){var a;return F(this,function(e){switch(e.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=K(this.options.backgroundColor),this.ctx.fillRect(this.options.x-this.options.scrollX,this.options.y-this.options.scrollY,this.options.width,this.options.height)),t=new Oo(s,[]),n=new Do(t),So(t,n,n,i=[]),Ro(t.container,i),a=n,[4,this.renderStack(a)];case 1:return e.sent(),this.applyEffects([],2),[2,this.canvas]}var t,n,i})})},je),Po=function(e){return e instanceof Ss||e instanceof Os||e instanceof Ds&&e.type!==Ts&&e.type!==Es},Uo=function(e,t){switch(e){case Qt.BORDER_BOX:return De(t);case Qt.CONTENT_BOX:return[(n=t).topLeftContentBox,n.topRightContentBox,n.bottomRightContentBox,n.bottomLeftContentBox];case Qt.PADDING_BOX:default:return Oe(t)}var n},Ho=function(e){switch(e){case aa.CENTER:return"center";case aa.RIGHT:return"right";case aa.LEFT:default:return"left"}},Qo=(Le.prototype.render=function(i){return c(this,void 0,void 0,function(){var t,n;return F(this,function(e){switch(e.label){case 0:return t=Nn(Math.max(this.options.windowWidth,this.options.width)*this.options.scale,Math.max(this.options.windowHeight,this.options.height)*this.options.scale,this.options.scrollX*this.options.scale,this.options.scrollY*this.options.scale,i),[4,zo(t)];case 1:return n=e.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=K(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(n,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},Le),zo=function(i){return new Promise(function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(i))})};jn.setContext(window);var qo=function(k,C){return c(void 0,void 0,void 0,function(){var t,n,i,a,s,o,r,l,c,d,u,_,h,p,f,m,g,A,v,b,y,$,w;return F(this,function(e){switch(e.label){case 0:if(!(t=k.ownerDocument))throw new Error("Element is not attached to a Document");if(!(n=t.defaultView))throw new Error("Document is not attached to a Window");return i=(Math.round(1e3*Math.random())+Date.now()).toString(16),a=Ws(k)||"HTML"===k.tagName?function(e){var t=e.body,n=e.documentElement;if(!t||!n)throw new Error("Unable to get document size");var i=Math.max(Math.max(t.scrollWidth,n.scrollWidth),Math.max(t.offsetWidth,n.offsetWidth),Math.max(t.clientWidth,n.clientWidth)),a=Math.max(Math.max(t.scrollHeight,n.scrollHeight),Math.max(t.offsetHeight,n.offsetHeight),Math.max(t.clientHeight,n.clientHeight));return new Qe(0,0,i,a)}(t):ze(k),s=a.width,o=a.height,r=a.left,l=a.top,c=He({},{allowTaint:!1,imageTimeout:15e3,proxy:void 0,useCORS:!1},C),d={backgroundColor:"#ffffff",cache:C.cache?C.cache:jn.create(i,c),logging:!0,removeContainer:!0,foreignObjectRendering:!1,scale:n.devicePixelRatio||1,windowWidth:n.innerWidth,windowHeight:n.innerHeight,scrollX:n.pageXOffset,scrollY:n.pageYOffset,x:r,y:l,width:Math.ceil(s),height:Math.ceil(o),id:i},u=He({},d,c,C),_=new Qe(u.scrollX,u.scrollY,u.windowWidth,u.windowHeight),Mn.create({id:i,enabled:u.logging}),Mn.getInstance(i).debug("Starting document clone"),h=new ro(k,{id:i,onclone:u.onclone,ignoreElements:u.ignoreElements,inlineImages:u.foreignObjectRendering,copyStyles:u.foreignObjectRendering}),(p=h.clonedReferenceElement)?[4,h.toIFrame(t,_)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return f=e.sent(),m=t.documentElement?Pe(getComputedStyle(t.documentElement).backgroundColor):En.TRANSPARENT,g=t.body?Pe(getComputedStyle(t.body).backgroundColor):En.TRANSPARENT,A=C.backgroundColor,v="string"==typeof A?Pe(A):null===A?En.TRANSPARENT:4294967295,b=k===t.documentElement?B(m)?B(g)?v:g:m:v,y={id:i,cache:u.cache,canvas:u.canvas,backgroundColor:b,scale:u.scale,x:u.x,y:u.y,scrollX:u.scrollX,scrollY:u.scrollY,width:u.width,height:u.height,windowWidth:u.windowWidth,windowHeight:u.windowHeight},u.foreignObjectRendering?(Mn.getInstance(i).debug("Document cloned, using foreign object rendering"),[4,new Qo(y).render(p)]):[3,3];case 2:return $=e.sent(),[3,5];case 3:return Mn.getInstance(i).debug("Document cloned, using computed rendering"),jn.attachInstance(u.cache),Mn.getInstance(i).debug("Starting DOM parsing"),w=Ks(p),jn.detachInstance(),b===w.styles.backgroundColor&&(w.styles.backgroundColor=En.TRANSPARENT),Mn.getInstance(i).debug("Starting renderer"),[4,new Lo(y).render(w)];case 4:$=e.sent(),e.label=5;case 5:return!0===u.removeContainer&&(ro.destroy(f)||Mn.getInstance(i).error("Cannot detach cloned iframe as it is not in the DOM anymore")),Mn.getInstance(i).debug("Finished rendering"),Mn.destroy(i),jn.destroy(i),[2,$]}})})};return function(e,t){return void 0===t&&(t={}),qo(e,t)}}),function(h,p,f,i){function o(e,t){this.w=h(f),this.el=h(e),(t=t||n).rootClass!==i&&"dd"!==t.rootClass&&(t.listClass=t.listClass?t.listClass:t.rootClass+"-list",t.itemClass=t.itemClass?t.itemClass:t.rootClass+"-item",t.dragClass=t.dragClass?t.dragClass:t.rootClass+"-dragel",t.handleClass=t.handleClass?t.handleClass:t.rootClass+"-handle",t.collapsedClass=t.collapsedClass?t.collapsedClass:t.rootClass+"-collapsed",t.placeClass=t.placeClass?t.placeClass:t.rootClass+"-placeholder",t.noDragClass=t.noDragClass?t.noDragClass:t.rootClass+"-nodrag",t.noChildrenClass=t.noChildrenClass?t.noChildrenClass:t.rootClass+"-nochildren",t.emptyClass=t.emptyClass?t.emptyClass:t.rootClass+"-empty"),this.options=h.extend({},n,t),this.options.json!==i&&this._build(),this.init()}var r="ontouchstart"in f,m=function(){var e=f.createElement("div"),t=f.documentElement;if(!("pointerEvents"in e.style))return!1;e.style.pointerEvents="auto",e.style.pointerEvents="x",t.appendChild(e);var n=p.getComputedStyle&&"auto"===p.getComputedStyle(e,"").pointerEvents;return t.removeChild(e),!!n}(),n={contentCallback:function(e){return e.content?e.content:e.id},listNodeName:"ol",itemNodeName:"li",handleNodeName:"div",contentNodeName:"span",rootClass:"dd",listClass:"dd-list",itemClass:"dd-item",dragClass:"dd-dragel",handleClass:"dd-handle",contentClass:"dd-content",collapsedClass:"dd-collapsed",placeClass:"dd-placeholder",noDragClass:"dd-nodrag",noChildrenClass:"dd-nochildren",emptyClass:"dd-empty",expandBtnHTML:'<button class="dd-expand" data-action="expand" type="button">Expand</button>',collapseBtnHTML:'<button class="dd-collapse" data-action="collapse" type="button">Collapse</button>',group:0,maxDepth:5,threshold:20,fixedDepth:!1,fixed:!1,includeContent:!1,scroll:!1,scrollSensitivity:1,scrollSpeed:5,scrollTriggers:{top:40,left:40,right:-40,bottom:-40},effect:{animation:"none",time:"slow"},callback:function(){},onDragStart:function(){},beforeDragStop:function(){},listRenderer:function(e,t){var n="<"+t.listNodeName+' class="'+t.listClass+'">';return n+=e,n+="</"+t.listNodeName+">"},itemRenderer:function(e,t,n,i){var a=h.map(e,function(e,t){return" "+t+'="'+e+'"'}).join(" "),s="<"+i.itemNodeName+a+">";return s+="<"+i.handleNodeName+' class="'+i.handleClass+'">',s+="<"+i.contentNodeName+' class="'+i.contentClass+'">',s+=t,s+="</"+i.contentNodeName+">",s+="</"+i.handleNodeName+">",s+=n,s+="</"+i.itemNodeName+">"}};o.prototype={init:function(){var a=this;a.reset(),a.el.data("nestable-group",this.options.group),a.placeEl=h('<div class="'+a.options.placeClass+'"/>');var e=this.el.find(a.options.itemNodeName);h.each(e,function(e,t){var n=h(t),i=n.parent();a.setParent(n),i.hasClass(a.options.collapsedClass)&&a.collapseItem(i.parent())}),e.length||this.appendEmptyElement(this.el),a.el.on("click","button",function(e){if(!a.dragEl){var t=h(e.currentTarget),n=t.data("action"),i=t.parents(a.options.itemNodeName).eq(0);"collapse"===n&&a.collapseItem(i),"expand"===n&&a.expandItem(i)}});var t=function(e){var t=h(e.target);if(!t.hasClass(a.options.handleClass)){if(t.closest("."+a.options.noDragClass).length)return;t=t.closest("."+a.options.handleClass)}t.length&&!a.dragEl&&(a.isTouch=/^touch/.test(e.type),a.isTouch&&1!==e.touches.length||(e.preventDefault(),a.dragStart(e.touches?e.touches[0]:e)))},n=function(e){a.dragEl&&(e.preventDefault(),a.dragMove(e.touches?e.touches[0]:e))},i=function(e){a.dragEl&&(e.preventDefault(),a.dragStop(e.touches?e.changedTouches[0]:e))};r&&(a.el[0].addEventListener("touchstart",t,!1),p.addEventListener("touchmove",n,!1),p.addEventListener("touchend",i,!1),p.addEventListener("touchcancel",i,!1)),a.el.on("mousedown",t),a.w.on("mousemove",n),a.w.on("mouseup",i);var s=function(){r&&(a.el[0].removeEventListener("touchstart",t,!1),p.removeEventListener("touchmove",n,!1),p.removeEventListener("touchend",i,!1),p.removeEventListener("touchcancel",i,!1)),a.el.off("mousedown",t),a.w.off("mousemove",n),a.w.off("mouseup",i),a.el.off("click"),a.el.unbind("destroy-nestable"),a.el.data("nestable",null)};a.el.bind("destroy-nestable",s)},destroy:function(){this.el.trigger("destroy-nestable")},add:function(e){var t="."+this.options.listClass,n=h(this.el).children(t);e.parent_id!==i&&(n=n.find('[data-id="'+e.parent_id+'"]'),delete e.parent_id,0===n.children(t).length&&(n=n.append(this.options.listRenderer("",this.options))),n=n.find(t+":first"),this.setParent(n.parent())),n.append(this._buildItem(e,this.options))},replace:function(e){var t=this._buildItem(e,this.options);this._getItemById(e.id).replaceWith(t)},removeItem:function(e){var t=this.options,n=this.el;(e=e||this).remove();var i="."+t.listClass+" ."+t.listClass+":not(:has(*))";h(n).find(i).remove();var a='[data-action="expand"], [data-action="collapse"]';h(n).find(a).each(function(){0===h(this).siblings("."+t.listClass).length&&h(this).remove()})},remove:function(e,t){var n=this.options,i=this,a=this._getItemById(e),s=n.effect.animation||"fade",o=n.effect.time||"slow";"fade"===s?a.fadeOut(o,function(){i.removeItem(a)}):this.removeItem(a),t&&t()},removeAll:function(e){function t(){s.each(function(){n.removeItem(h(this))}),a.show(),e&&e()}var n=this,i=this.options,a=n.el.find(i.listNodeName).first(),s=a.children(i.itemNodeName),o=i.effect.animation||"fade",r=i.effect.time||"slow";"fade"===o?a.fadeOut(r,t):t()},_getItemById:function(e){return h(this.el).children("."+this.options.listClass).find('[data-id="'+e+'"]')},_build:function(){var e=this.options.json;"string"==typeof e&&(e=JSON.parse(e)),h(this.el).html(this._buildList(e,this.options))},_buildList:function(e,n){if(!e)return"";var i="",a=this;return h.each(e,function(e,t){i+=a._buildItem(t,n)}),n.listRenderer(i,n)},_buildItem:function(e,t){function i(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e+"".replace(/[&<>"']/g,function(e){return t[e]})}function a(e){var t={};for(var n in e)t[e[n]]=e[n];return t}function n(e,t){var n=e.classes||{};"string"==typeof n&&(n=[n]);var i=a(n);return i[t.itemClass]=t.itemClass,h.map(i,function(e){return e}).join(" ")}function s(e){delete(e=h.extend({},e)).children,delete e.classes,delete e.content;var n={};return h.each(e,function(e,t){"object"==typeof t&&(t=JSON.stringify(t)),n["data-"+e]=i(t)}),n}var o=s(e);o["class"]=n(e,t);var r=t.contentCallback(e),l=this._buildList(e.children,t),c=h(t.itemRenderer(o,r,l,t,e));return this.setParent(c),c[0].outerHTML},serialize:function(){var s=this,o=function(e){var a=[];return e.children(s.options.itemNodeName).each(function(){var e=h(this),t=h.extend({},e.data()),n=e.children(s.options.listNodeName);if(s.options.includeContent){var i=e.find("."+s.options.contentClass).html();i&&(t.content=i)}n.length&&(t.children=o(n)),a.push(t)}),a};return o(s.el.find(s.options.listNodeName).first())},asNestedSet:function(){function o(e,t,n){var i,a,s=n+1;return 0<h(e).children(l.listNodeName).children(l.itemNodeName).length&&(t++,h(e).children(l.listNodeName).children(l.itemNodeName).each(function(){s=o(h(this),t,s)}),t--),r(i=h(e).attr("data-id"))&&(i=parseInt(i)),r(a=h(e).parent(l.listNodeName).parent(l.itemNodeName).attr("data-id")||"")&&(a=parseInt(a)),i&&c.push({id:i,parent_id:a,depth:t,lft:n,rgt:s}),n=s+1}function r(e){return h.isNumeric(e)&&Math.floor(e)==e}var e=this,l=e.options,t=-1,c=[],n=1;return e.el.find(l.listNodeName).first().children(l.itemNodeName).each(function(){n=o(this,t+1,n)}),c=c.sort(function(e,t){return e.lft-t.lft})},returnOptions:function(){return this.options},serialise:function(){return this.serialize()},toHierarchy:function(e){function i(e){var t=(h(e).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(t){var n={id:t[2]};return 0<h(e).children(a.listType).children(a.items).length&&(n.children=[],h(e).children(a.listType).children(a.items).each(function(){var e=i(this);n.children.push(e)})),n}}var a=h.extend({},this.options,e),t=[];return h(this.element).children(a.items).each(function(){var e=i(this);t.push(e)}),t},toArray:function(){function o(e,t,n){var i,a,s=n+1;(0<e.children(r.options.listNodeName).children(r.options.itemNodeName).length&&(t++,e.children(r.options.listNodeName).children(r.options.itemNodeName).each(function(){
s=o(h(this),t,s)}),t--),i=e.data().id,t===l+1)?a=r.rootID:a=e.parent(r.options.listNodeName).parent(r.options.itemNodeName).data().id;return i&&c.push({id:i,parent_id:a,depth:t,left:n,right:s}),n=s+1}var r=h.extend({},this.options,this),l=r.startDepthCount||0,c=[],e=2,t=this;return t.el.find(t.options.listNodeName).first().children(t.options.itemNodeName).each(function(){e=o(h(this),l+1,e)}),c=c.sort(function(e,t){return e.left-t.left})},reset:function(){this.mouse={offsetX:0,offsetY:0,startX:0,startY:0,lastX:0,lastY:0,nowX:0,nowY:0,distX:0,distY:0,dirAx:0,dirX:0,dirY:0,lastDirX:0,lastDirY:0,distAxX:0,distAxY:0},this.isTouch=!1,this.moving=!1,this.dragEl=null,this.dragRootEl=null,this.dragDepth=0,this.hasNewRoot=!1,this.pointEl=null},expandItem:function(e){e.removeClass(this.options.collapsedClass)},collapseItem:function(e){e.children(this.options.listNodeName).length&&e.addClass(this.options.collapsedClass)},expandAll:function(){var e=this;e.el.find(e.options.itemNodeName).each(function(){e.expandItem(h(this))})},collapseAll:function(){var e=this;e.el.find(e.options.itemNodeName).each(function(){e.collapseItem(h(this))})},setParent:function(e){e.is(this.options.itemNodeName)&&e.children(this.options.listNodeName).length&&(e.children("[data-action]").remove(),e.prepend(h(this.options.expandBtnHTML)),e.prepend(h(this.options.collapseBtnHTML)))},unsetParent:function(e){e.removeClass(this.options.collapsedClass),e.children("[data-action]").remove(),e.children(this.options.listNodeName).remove()},dragStart:function(e){var t=this.mouse,n=h(e.target).closest(this.options.itemNodeName),i={top:e.pageY,left:e.pageX},a=this.options.onDragStart.call(this,this.el,n,i);if(void 0===a||!1!==a){this.placeEl.css("height",n.height()),t.offsetX=e.pageX-n.offset().left,t.offsetY=e.pageY-n.offset().top,t.startX=t.lastX=e.pageX,t.startY=t.lastY=e.pageY,this.dragRootEl=this.el,this.dragEl=h(f.createElement(this.options.listNodeName)).addClass(this.options.listClass+" "+this.options.dragClass),this.dragEl.css("width",n.outerWidth()),this.setIndexOfItem(n),n.after(this.placeEl),n[0].parentNode.removeChild(n[0]),n.appendTo(this.dragEl),h(f.body).append(this.dragEl),this.dragEl.css({left:e.pageX-t.offsetX,top:e.pageY-t.offsetY});var s,o,r=this.dragEl.find(this.options.itemNodeName);for(s=0;s<r.length;s++)(o=h(r[s]).parents(this.options.listNodeName).length)>this.dragDepth&&(this.dragDepth=o)}},createSubLevel:function(e,t){var n=h("<"+this.options.listNodeName+"/>").addClass(this.options.listClass);return t&&n.append(t),e.append(n),this.setParent(e),n},setIndexOfItem:function(e,t){(t=t||[]).unshift(e.index()),h(e[0].parentNode)[0]!==this.dragRootEl[0]?this.setIndexOfItem(h(e[0].parentNode),t):this.dragEl.data("indexOfItem",t)},restoreItemAtIndex:function(e,n){function t(e,t){0===n[a]?h(e).prepend(t.clone(!0)):h(e.children[n[a]-1]).after(t.clone(!0))}for(var i=this.el,a=n.length-1,s=0;s<n.length;s++){if(a===parseInt(s))return void t(i,e);var o=i[0]?i[0]:i,r=o.children[n[s]];i=r||this.createSubLevel(h(o))}},dragStop:function(e){var t={top:e.pageY,left:e.pageX},n=this.dragEl.data("indexOfItem"),i=this.dragEl.children(this.options.itemNodeName).first();i[0].parentNode.removeChild(i[0]),this.dragEl.remove();var a=this.options.beforeDragStop.call(this,this.el,i,this.placeEl.parent());if(void 0!==a&&!1===a){var s=this.placeEl.parent();return this.placeEl.remove(),s.children().length||this.unsetParent(s.parent()),this.restoreItemAtIndex(i,n),void this.reset()}this.placeEl.replaceWith(i),this.hasNewRoot?(!0===this.options.fixed?this.restoreItemAtIndex(i,n):this.el.trigger("lostItem"),this.dragRootEl.trigger("gainedItem")):this.dragRootEl.trigger("change"),this.options.callback.call(this,this.dragRootEl,i,t),this.reset()},dragMove:function(e){var t,n,i,a=this.options,s=this.mouse;this.dragEl.css({left:e.pageX-s.offsetX,top:e.pageY-s.offsetY}),s.lastX=s.nowX,s.lastY=s.nowY,s.nowX=e.pageX,s.nowY=e.pageY,s.distX=s.nowX-s.lastX,s.distY=s.nowY-s.lastY,s.lastDirX=s.dirX,s.lastDirY=s.dirY,s.dirX=0===s.distX?0:0<s.distX?1:-1,s.dirY=0===s.distY?0:0<s.distY?1:-1;var o=Math.abs(s.distX)>Math.abs(s.distY)?1:0;if(!s.moving)return s.dirAx=o,void(s.moving=!0);if(a.scroll)if("undefined"!=typeof p.jQuery.fn.scrollParent){var r=!1,l=this.el.scrollParent()[0];l!==f&&"HTML"!==l.tagName?(a.scrollTriggers.bottom+l.offsetHeight-e.pageY<a.scrollSensitivity?l.scrollTop=r=l.scrollTop+a.scrollSpeed:e.pageY-a.scrollTriggers.top<a.scrollSensitivity&&(l.scrollTop=r=l.scrollTop-a.scrollSpeed),a.scrollTriggers.right+l.offsetWidth-e.pageX<a.scrollSensitivity?l.scrollLeft=r=l.scrollLeft+a.scrollSpeed:e.pageX-a.scrollTriggers.left<a.scrollSensitivity&&(l.scrollLeft=r=l.scrollLeft-a.scrollSpeed)):(e.pageY-h(f).scrollTop()<a.scrollSensitivity?r=h(f).scrollTop(h(f).scrollTop()-a.scrollSpeed):h(p).height()-(e.pageY-h(f).scrollTop())<a.scrollSensitivity&&(r=h(f).scrollTop(h(f).scrollTop()+a.scrollSpeed)),e.pageX-h(f).scrollLeft()<a.scrollSensitivity?r=h(f).scrollLeft(h(f).scrollLeft()-a.scrollSpeed):h(p).width()-(e.pageX-h(f).scrollLeft())<a.scrollSensitivity&&(r=h(f).scrollLeft(h(f).scrollLeft()+a.scrollSpeed)))}else console.warn("To use scrolling you need to have scrollParent() function, check documentation for more information");this.scrollTimer&&clearTimeout(this.scrollTimer),a.scroll&&r&&(this.scrollTimer=setTimeout(function(){h(p).trigger(e)},10)),s.dirAx!==o?(s.distAxX=0,s.distAxY=0):(s.distAxX+=Math.abs(s.distX),0!==s.dirX&&s.dirX!==s.lastDirX&&(s.distAxX=0),s.distAxY+=Math.abs(s.distY),0!==s.dirY&&s.dirY!==s.lastDirY&&(s.distAxY=0)),s.dirAx=o,s.dirAx&&s.distAxX>=a.threshold&&(s.distAxX=0,i=this.placeEl.prev(a.itemNodeName),0<s.distX&&i.length&&!i.hasClass(a.collapsedClass)&&!i.hasClass(a.noChildrenClass)&&(t=i.find(a.listNodeName).last(),this.placeEl.parents(a.listNodeName).length+this.dragDepth<=a.maxDepth&&(t.length?(t=i.children(a.listNodeName).last()).append(this.placeEl):this.createSubLevel(i,this.placeEl))),s.distX<0&&(this.placeEl.next(a.itemNodeName).length||(n=this.placeEl.parent(),this.placeEl.closest(a.itemNodeName).after(this.placeEl),n.children().length||this.unsetParent(n.parent()))));var c=!1;if(m||(this.dragEl[0].style.visibility="hidden"),this.pointEl=h(f.elementFromPoint(e.pageX-f.body.scrollLeft,e.pageY-(p.pageYOffset||f.documentElement.scrollTop))),m||(this.dragEl[0].style.visibility="visible"),this.pointEl.hasClass(a.handleClass)&&(this.pointEl=this.pointEl.closest(a.itemNodeName)),this.pointEl.hasClass(a.emptyClass))c=!0;else if(!this.pointEl.length||!this.pointEl.hasClass(a.itemClass))return;var d=this.pointEl.closest("."+a.rootClass),u=this.dragRootEl.data("nestable-id")!==d.data("nestable-id");if(!s.dirAx||u||c){if(u&&a.group!==d.data("nestable-group"))return;if(this.options.fixedDepth&&this.dragDepth+1!==this.pointEl.parents(a.listNodeName).length)return;if(this.dragDepth-1+this.pointEl.parents(a.listNodeName).length>a.maxDepth)return;var _=e.pageY<this.pointEl.offset().top+this.pointEl.height()/2;n=this.placeEl.parent(),c?((t=h(f.createElement(a.listNodeName)).addClass(a.listClass)).append(this.placeEl),this.pointEl.replaceWith(t)):_?this.pointEl.before(this.placeEl):this.pointEl.after(this.placeEl),n.children().length||this.unsetParent(n.parent()),this.dragRootEl.find(a.itemNodeName).length||this.appendEmptyElement(this.dragRootEl),this.dragRootEl=d,u&&(this.hasNewRoot=this.el[0]!==this.dragRootEl[0])}},appendEmptyElement:function(e){e.append('<div class="'+this.options.emptyClass+'"/>')}},h.fn.nestable=function(i){var e=this,a=this,s=arguments;return"Nestable"in p||(p.Nestable={},Nestable.counter=0),e.each(function(){var e=h(this).data("nestable");if(e){if("string"==typeof i&&"function"==typeof e[i])if(1<s.length){for(var t=[],n=1;n<s.length;n++)t.push(s[n]);a=e[i].apply(e,t)}else a=e[i]()}else Nestable.counter++,h(this).data("nestable",new o(this,i)),h(this).data("nestable-id",Nestable.counter)}),a||e}}(window.jQuery||window.Zepto,window,document);var ModalUtils=function(){};ModalUtils={maxZIndex:function(){return Math.max.apply(null,$(".modal:visible").map(function(){var e;return isNaN(e=parseInt($(this).css("z-index"),10))?0:e}))}},$.widget("ui.draggable",$.extend({},$.ui.draggable.prototype,{_mouseDrag:function(e,t){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!t){var n=this._uiHash();if(!1===this._trigger("drag",e,n))return this._mouseUp({}),!1;this.position=n.position}return positionCorrentX=document.body.style.left?parseInt(document.body.style.left):0,positionCorrentY=document.body.style.top?parseInt(document.body.style.top):0,this.helper[0].style.left=this.position.left-positionCorrentX+"px",this.helper[0].style.top=this.position.top-positionCorrentY+"px",$.ui.ddmanager&&$.ui.ddmanager.drag(this,e),!1}})),window.Select2["class"]["abstract"].prototype.positionDropdown=function(){function e(e,t){if($.isFunction(e)){var n=Array.prototype.slice.call(arguments,2);return e.apply(t,n)}return e}var t,n,i,a,s,o=this.dropdown,r=this.container,l=r.offset(),c=r.outerHeight(!1),d=r.outerWidth(!1),u=o.outerHeight(!1),_=$(window),h=_.width(),p=_.height(),f=_.scrollLeft()+h,m=_.scrollTop()+p,g=l.top+c,A=l.left,v=g+u<=m,b=l.top-u>=_.scrollTop(),y=o.outerWidth(!1),w=function(){return A+y<=f},k=function(){return l.left+f+r.outerWidth(!1)>y};o.hasClass("select2-drop-above")?(n=!0,!b&&v&&(n=!(i=!0))):(n=!1,!v&&b&&(n=i=!0)),i&&(o.hide(),l=this.container.offset(),c=this.container.outerHeight(!1),d=this.container.outerWidth(!1),u=o.outerHeight(!1),f=_.scrollLeft()+h,m=_.scrollTop()+p,g=l.top+c,A=l.left,y=o.outerWidth(!1),o.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(s=$(".select2-results",o)[0],o.addClass("select2-drop-auto-width"),o.css("width",""),d<(y=o.outerWidth(!1)+(s.scrollHeight===s.clientHeight?0:scrollBarDimensions.width))?d=y:y=d,u=o.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(g-=(t=this.body.offset()).top,A-=t.left),!w()&&k()&&(A=l.left+this.container.outerWidth(!1)-y),a={left:A,width:d},n?(this.container.addClass("select2-drop-above"),o.addClass("select2-drop-above"),positionCorrentY=document.body.style.top?parseInt(document.body.style.top):0,a.top=l.top-u-positionCorrentY,a.bottom="auto"):(a.top=g,a.bottom="auto",this.container.removeClass("select2-drop-above"),o.removeClass("select2-drop-above")),a=$.extend(a,e(this.opts.dropdownCss,this.opts.element)),o.css(a)};var RelationModals=function(){},containerName="relation_modal_container";RelationModals={find_or_create_dom:function(e){var t=$("#"+e);return t.length||(t=$("<div></div>",{id:e,addClass:"modal fade hp-page",data:{backdrop:"static",keyboard:"false"},role:"dialog",tabindex:-1,style:"overflow: auto;"}),$("body").append(t)),t},openModal:function(t,n){var i=this;n.prop("disabled",!0),$.ajax({url:n.data("href"),dataType:"html",data:n.data("params")}).done(function(e){t.html(e),t.find(".hidden-xs").addClass("hidden-xs-on-modal"),t.off("shown.bs.modal"),t.off("hidden.bs.modal"),t.on("shown.bs.modal",function(){t.scrollTop(0),setTimeout(function(){var e=ModalUtils.maxZIndex();t.css("z-index",e+2),$(".modal-backdrop").last().css("z-index",e+1)},0),n.trigger("load_modal",i)}).on("hidden.bs.modal",function(){t.empty(),setTimeout(function(){var e=ModalUtils.maxZIndex();t.css("z-index",t.zIndex()-3),$(".modal-backdrop").last().css("z-index",e-1)},0)}).modal("show")}).always(function(){n.prop("disabled",!1)})},attachForm:function(o,n,r,l){var t=$(".modal-open"),i=!1;n.attr("format","json"),n.data("remote",!0),n.on("submit",function(){$("#modal_error_message").empty(),"json"===n.attr("format")?(i=!0,n.append('<input name="format" type="hidden" value="json">')):i=!1}),n.find(".js_modal_search_users_caller_btn").on("click",function(){$(".modal-backdrop").last().css("z-index",1030)}),n.find(".item_datepicker").datepicker(),o.find(l).off("click"),o.find(l).on("click",function(e){e.preventDefault(),$("#modal_error_message").empty();var t=new FormData($(n).get(0));return t.append("format","json"),$.ajax($(n).attr("action"),{type:"post",processData:!1,contentType:!1,data:t}).done(function(e){if("error"===e.status)""===e.message?$("#js_select_change_display_template option").last().attr("selected","selected").trigger("change"):$("#modal_error_message").html(e.message);else if(o.modal("hide"),"deal"===r){RelationModals.removeTimelineContents();var t=$('[data-target-id="customer_sheets_contents_deals"]').parent();target_id=t.find("a").data("target-id"),$("#"+target_id).remove(),CustomerSheets.force_reload_side_menu_content(t),App.front_inside_sales.reload_ajax_element("#correspondence_history_area"),App.front_inside_sales.reload_summary_and_activity_table(),"#new_submit"===l?App.concerns.destroy_automatically_save("auto_saved_deals_new",$("#current_user_id").val()):"#edit_submit"===l&&App.concerns.destroy_automatically_save("auto_saved_deals_edit",$("#current_user_id").val(),$("#edit_id").val(),null,null)}else if("task"===r){RelationModals.removeTimelineContents();var n=$('[data-target-id="customer_sheets_contents_tasks"]').parent();target_id=n.find("a").data("target-id"),$("#"+target_id).remove(),CustomerSheets.force_reload_side_menu_content(n)}else if("daily_report"===r){RelationModals.removeTimelineContents();var i=$('[data-target-id="customer_sheets_contents_daily_reports"]').parent();target_id=i.find("a").data("target-id"),$("#"+target_id).remove(),CustomerSheets.force_reload_side_menu_content(i),"#new_submit"===l?App.concerns.destroy_automatically_save("auto_saved_daily_reports_new",$("#current_user_id").val()):"#edit_submit"===l&&App.concerns.destroy_automatically_save("auto_saved_daily_reports_edit",$("#current_user_id").val())}else if("client_branch"===r){RelationModals.removeTimelineContents();var a=$('[data-target-id="customer_sheets_contents_client_branches"]').parent();target_id=a.find("a").data("target-id"),localStorage.setItem("check_value",$("#is_checked").val()),$("#"+target_id).remove(),CustomerSheets.force_reload_side_menu_content(a),$("#client_branch_visible_fields_setting_dialog").remove(),"#new_submit"===l?App.concerns.destroy_automatically_save("auto_saved_client_branches_new",$("#current_user_id").val()):"#edit_submit"===l&&App.concerns.destroy_automatically_save("auto_saved_client_branches_edit",$("#current_user_id").val())}else if("client"===r){var s=$('[data-target-id="customer_sheets_contents_base_config"]').parent();target_id=s.find("a").data("target-id"),$("#"+target_id).remove(),CustomerSheets.force_reload_side_menu_content(s)}}),!1});var e=["#modalSearchUsers","#search-associated-resources-modal","#search-overlay-associated-resources-modal","#modalSearchMiddleBusinessCategory","#modalContractPeriod","#modalConfirmDestroyContracts"].join(", "),a=0;$(document).off("shown.bs.modal hidden.bs.modal",e).on({"show.bs.modal":function(){a=ModalUtils.maxZIndex()},"shown.bs.modal":function(){var e=$(this);setTimeout(function(){"modalSearchUsers"!=e.attr("id")&&e.css("z-index",a+2),$(".modal-backdrop").last().css("z-index",a+1)},0)},"hidden.bs.modal":function(){setTimeout(function(){var e=ModalUtils.maxZIndex();$(".modal-backdrop").last().css("z-index",e-1)},0)}},e),n.on("ajax:success",function(e){i&&n.find('input[name="format"]').remove(),e.target!==this&&$(document).off("hidden.bs.modal","#search-associated-resources-modal, #modal_block_for_search_users, #search-overlay-associated-resources-modal, #modalSearchMiddleBusinessCategory").on("hidden.bs.modal","#search-associated-resources-modal, #modal_block_for_search_users, #search-overlay-associated-resources-modal, #modalSearchMiddleBusinessCategory",function(){t.addClass("modal-open"),"client_branch"===r&&"client_list"!=$("#client_list").val()&&"cus_client_branch"!=$("#cus_client_branch").val()&&t.removeClass("modal-open")})})},changeDisplayTemplate:function(n,i){var e=$("#js_form_change_display_template");e.attr("action",i.data("href")),e.data("remote",!0),e.on("ajax:success",function(e,t){n.html(t),n.find(".hidden-xs").addClass("hidden-xs-on-modal"),i.trigger("load_modal")})},resetAssociatedButton:function(){["#open-associated-client","#open-associated-daily-report","#open-associated-deal","#open-associated-lead","#daily_report_client_id","#client_temporary_business_card_id","#leads_multiple_decision","#deals_multiple_decision","#deal_client_id"].forEach(function(e){$(document).off("click",e)})},init:function(){$(document).on("click",'[data-hp-role="add_model"],[data-hp-role="edit_model"]',function(e){e.preventDefault();var t=RelationModals.find_or_create_dom(containerName);return RelationModals.openModal(t,$(this)),!1}),$(document).on("load_modal",'[data-hp-role="add_model"][data-hp-target="daily_report"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName);App.front_daily_reports.init_form_from_another_controller(!1),RelationModals.changeDisplayTemplate(e,$(this)),RelationModals.attachForm(e,$("#new_daily_report"),"daily_report","#new_submit"),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block")}),$(document).on("load_modal",'[data-hp-role="edit_model"][data-hp-target="daily_report"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName),t=$(".edit_daily_report");App.front_daily_reports.init_form_from_another_controller(!0),RelationModals.changeDisplayTemplate(e,$(this)),RelationModals.attachForm(e,t,"daily_report","#edit_submit"),ClientEditForm.init('[name="daily_report[client_id]"]'),ClientEditForm.change('[name="daily_report[client_id]"]',"#daily_report_client_id"),ClientBranchesEditForm.init("#daily_report_client_branch_id"),ClientBranchesEditForm.change('[name="daily_report[client_branch_id]"]',"#client_branch_block")}),$(document).on("load_modal",'[data-hp-role="edit_model"][data-hp-target="client_branch"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName),t=$(".edit_client_branch");App.front_client_branches.init_form_from_another_controller(!0),RelationModals.changeDisplayTemplate(e,$(this)),RelationModals.attachForm(e,t,"client_branch","#edit_submit"),ClientEditForm.init('[name="client_branch[client_id]"]'),ClientEditForm.change('[name="client_branch[client_id]"]',"#client_branch_client_id")}),$(document).on("load_modal",'[data-hp-role="add_model"][data-hp-target="client_branch"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName),t=$(".new_client_branch");App.front_client_branches.init_form_from_another_controller(!0),RelationModals.changeDisplayTemplate(e,$(this)),RelationModals.attachForm(e,t,"client_branch","#new_submit"),ClientEditForm.init('[name="client_branch[client_id]"]'),ClientEditForm.change('[name="client_branch[client_id]"]',"#client_branch_client_id")}),$(document).on("load_modal",'[data-hp-role="add_model"][data-hp-target="deal"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName);RelationModals.changeDisplayTemplate(e,$(this)),App.front_deals.init_form_from_another_controller(!1),RelationModals.attachForm(e,$("#new_deal"),"deal","#new_submit"),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block")}),$(document).on("load_modal",'[data-hp-role="edit_model"][data-hp-target="deal"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName),t=$(".edit_deal");RelationModals.changeDisplayTemplate(e,$(this)),App.front_deals.init_form_from_another_controller(!0),RelationModals.attachForm(e,t,"deal","#edit_submit"),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id"),ClientBranchesEditForm.init("#deal_client_branch_id"),ClientBranchesEditForm.change('[name="deal[client_branch_id]"]',"#client_branch_block"),App.front_deals.sync_height_table_auto_calculate()}),$(document).on("load_modal",'[data-hp-role="add_model"][data-hp-target="task"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName),t=$("#new_task");App.front_tasks.init_form_from_another_controller(!0),e.find('a[href="/tasks/"]').parent().hide(),RelationModals.attachForm(e,t,"task","#new_submit")}),$(document).on("load_modal",'[data-hp-role="edit_model"][data-hp-target="task"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName),t=$(".edit_task");App.front_tasks.init_form_from_another_controller(!0),e.find('a[href="/tasks/"]').parent().hide(),RelationModals.attachForm(e,t,"task","#edit_submit")}),$(document).on("load_modal",'[data-hp-role="edit_model"][data-hp-target="client"]',function(){RelationModals.resetAssociatedButton();var e=RelationModals.find_or_create_dom(containerName),t=$(".edit_client");App.front_clients.edit(),RelationModals.attachForm(e,t,"client","#edit_submit")})},removeTimelineContents:function(){var e=$('[data-target-id="customer_sheets_contents_timelines"]').parent();target_id=e.find("a").data("target-id"),$("#"+target_id).remove()}},App.front_mail_histories={index:function(){function e(e,t){$("#csv_dl_submit").on("click",function(){return App.concerns.set_export_ids(e,t),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_export_type").val(1),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),!1}),$("#csv_dl_url_datails_submit").on("click",function(){return App.concerns.set_export_ids(e,t),$("#csv_export_type").val(2),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),!1}),$("#csv_all_dl_url_datails_submit").on("click",function(){return $("#csv_export_type").val(3),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),!1})}App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_mail_histories",".js-disable-btn"),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_display_number("form_search_mail_histories"),App.concerns.change_order("form_search_mail_histories"),$(document).on("click",".js_resend_btn",function(){$("#open_modal_mail_queue_id").val($(this).data("id"))}),this.change_form("js_form_change_action_mail_histories"),this.datetimepicker(),this.set_select2("#search_mail_category_ids","100%"),this.set_select2("#search_file_path","100%"),App.concerns.select_search_disable_user("search_create_user_ids"),App.concerns.select_search_disable_user("search_update_user_ids"),App.concerns.select_search("search_campaign_ids"),App.front_segments.set_segment_select2("#search_segment_ids"),App.concerns.change_search_type(),App.visible_fields.setup_list_visible_setting(["email_of_sender","title"]),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.all_checked_items(),e("#form_search_mail_histories","checked[mail_queue_ids][]"),App.concerns.focus_to_first_element(),CKEDITOR.on("instanceReady",function(e){e.editor.on("blur",function(){App.front_mails.autoDraftSave()})}),this.set_destination_modal(),App.tooltip.display_tooltip()},show:function(){if($(".js-slide-search-field").on("click",function(){$(this).hasClass("in")?$(this).removeClass("in"):$(this).addClass("in")}),App.concerns.change_order("mail_form_search_mail_queue_summaries","mail_queue_sammaries_table"),App.concerns.change_order_for_abmail("win_mail_form_search_mail_queue_summaries","win_mail_queue_sammaries_table"),App.concerns.change_order_for_abmail("a_mail_form_search_mail_queue_summaries","a_mail_queue_sammaries_table"),App.concerns.change_order_for_abmail("b_mail_form_search_mail_queue_summaries","b_mail_queue_sammaries_table"),$("#leads_display_number").on("change",function(){$("#form_change_display_number").submit()}),$("#leads_target_display_number").on("change",function(){$("#leads_display_number_for_target_tab").val(this.value),$("#form_change_display_number_for_target_tab").submit()}),$("#users_target_display_number").on("change",function(){$("#users_display_number_for_target_tab").val(this.value),$("#form_change_display_number_for_target_tab").submit()}),$("#temporary_business_cards_target_display_number").on("change",function(){$("#temporary_business_cards_display_number_for_target_tab").val(this.value),$("#form_change_display_number_for_target_tab").submit()}),$("#csv_dl_submit, #csv_all_dl_submit").on("click",function(){return"csv_all_dl_submit"===$(this).attr("id")&&$("#csv_all_dl_flg").val(1),action=$("#form_search_mail_histories").attr("action"),$("#form_search_mail_histories").attr("action",action+".csv"),$("#form_search_mail_histories").submit(),$("#form_search_mail_histories").attr("action",action),!1}),0<$("#a_mail_queue_id").size()&&0<$("#b_mail_queue_id").size()){var e=$("#a_mail_queue_id").val(),t=$("#b_mail_queue_id").val();this.mail_editor_read_only_mode_init("mail_body_"+e,e,$("#a_mail_queue_content_type").val()),this.mail_editor_read_only_mode_init("mail_body_"+t,t,$("#b_mail_queue_content_type").val())}else App.concerns.mail_editor_read_only_mode_init("mail_body");$(document).on("click",".js_resend_btn",function(){$("#open_modal_mail_queue_id").val($(this).data("id"))}),this.change_form("js_form_change_action_mail_histories"),App.concerns.change_mail_history_tab_type(),App.concerns.create_mail_history_charts($("#main_mail_queue_id").val()),0<$("#a_mail_queue_id").size()&&0<$("#b_mail_queue_id").size()&&(App.concerns.create_mail_history_charts($("#a_mail_queue_id").val()),App.concerns.create_mail_history_charts($("#b_mail_queue_id").val())),this.loadingDestinationsList("#target_table","#mail_histories_destinations_result"),this.fetchDestinationsList(),App.concerns.change_order_for_target_tab("#mail_histories_form_change_display_number_for_target_tab",".mail_histories_lead_order_head"),App.visible_fields.change_horizontal_scroll=function(n){$("#visible_fields_setting_dialog input[type=checkbox]:checked").each(function(){var e=$(".js_visibility_"+$(this).val()),t=e.data("min-width");n.prop("checked")?e.css("min-width",t+"px"):e.css("min-width","")})},App.visible_fields.setup_list_visible_setting(),this.clearDestinationsSearchForm("#mail_histories_form_filter_for_target_tab"),$('a[name="target-tab-link"]').on("shown.bs.tab",function(e){$("#target_active_tab_type").val($(e.target).data("type"))}),$(document).on("click",".user-button",function(){$(this).css("pointer-events","none")}),$(document).on("hidden.bs.modal",".modal",function(){$(".user-button").css("pointer-events","")}),CKEDITOR.on("instanceReady",function(e){e.editor.on("blur",function(){App.front_mails.autoDraftSave()})}),$(document).on("click",function(){$(".sent-pie-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".opened-pie-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".url-clicked-pie-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".sent-error-bar-chart").each(function(e,t){$(t).highcharts().reflow()}),$(".unsubscribe-bar-chart").each(function(e,t){$(t).highcharts().reflow()})}),App.concerns.open_mailer(),App.concerns.set_mail_lead_link()},mail_editor_read_only_mode_init:function(e,t,n){CKEDITOR.replace(e,{toolbar:[{name:"document",groups:["mode"],items:["Source"]}],enterMode:CKEDITOR.ENTER_BR,readOnly:!0,removePlugins:"elementspath",height:350,language:I18n.locale}),this.show_editor_tab_for_mail_queue_type(t,n)},show_editor_tab_for_mail_queue_type:function(e,t){var n=$("#text-body-tab-"+e),i=$("#html-body-tab-"+e);n.show(),i.show();var a=t||"3";"1"===a?(n.tab("show"),i.hide()):"2"===a?(i.tab("show"),n.hide()):"3"===a&&i.tab("show")},change_form:function(n){$(document).on("click",".checked_submit",function(e){e.preventDefault();var t=$("#"+n);$(t).attr("action",$(this).data("action")),$(this).data("remote")?$(t).attr("data-remote","true"):($(t).removeAttr("data-remote"),$(t).removeData("remote")),$(this).data("method")&&$("#js_set_method").val($(this).data("method")),$(t).submit()})},datetimepicker:function(){$(".datetimepicker").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5})},set_select2:function(e,t,n){$(e).select2({width:t,placeholder:n})},set_destination_modal:function(){App.concerns.set_associate_entities_to_s2("#to_multiple_decision","#search_to_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#to_tbc_multiple_decision","#search_to_ids",'input[name="associate_temporary_business_cards[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#to_user_multiple_decision","#search_to_ids",'input[name="associate_users[]"]',"users"),App.concerns.enable_associattion_search_tab_modal("#open-associated-to","/xhr/leads/search_to","#search_to_ids","#template_to_ids","multiple","#business_card_service_client_id","show","0","post"),App.concerns.set_associate_entities_to_s2("#cc_multiple_decision","#search_cc_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#cc_tbc_multiple_decision","#search_cc_ids",'input[name="associate_temporary_business_cards[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#cc_user_multiple_decision","#search_cc_ids",'input[name="associate_users[]"]',"users"),App.concerns.enable_associattion_search_tab_modal("#open-associated-cc","/xhr/leads/search_cc","#search_cc_ids","#template_cc_ids","multiple","#business_card_service_client_id","show","0","post"),App.concerns.set_associate_entities_to_s2("#bcc_multiple_decision","#search_bcc_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#bcc_tbc_multiple_decision","#search_bcc_ids",'input[name="associate_temporary_business_cards[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#bcc_user_multiple_decision","#search_bcc_ids",'input[name="associate_users[]"]',"users"),App.concerns.enable_associattion_search_tab_modal("#open-associated-bcc","/xhr/leads/search_bcc","#search_bcc_ids","#template_bcc_ids","multiple","#business_card_service_client_id","show","0","post")},clearDestinationsSearchForm:function(e){$(e+" .clear-btn").click(function(){$("form"+e+" :input").each(function(){"checkbox"===$(this).attr("type")?$(this).prop("checked",!1):"radio"===$(this).attr("type")||"submit"===$(this).attr("type")||$(this).val("")})})},fetchDestinationsList:function(){$("#mail_histories_form_change_display_number_for_target_tab").submit()},loadingDestinationsList:function(e,t){$(e).on({"ajax:beforeSend":function(){$(t).html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:error":function(){$(t).html($('<div class="loadError"><span>'+I18n.t("js.application.load_error")+"</span></div>"))}})},fixCurrentPageLink:function(e){$(e+" .pagination li.active a").click(function(){if("#"==$(this).attr("href"))return!1})}},App.front_mail_templates={index:function(){App.concerns.change_display_number("form_search_mail_templates"),App.concerns.change_order("form_search_mail_templates"),App.concerns.all_checked_items(),App.concerns.set_form_action_to_submit("#form_checked_mail_templates",".delete-button",!0),App.concerns.select_search_disable_user("search_update_user_ids"),this.set_select2("#search_mail_category_ids","100%",I18n.t("js.mail_templates.mail_category")),App.front_segments.set_segment_select2("#search_segment_ids"),this.set_select2("#search_template_type","100%",I18n.t("js.mail_templates.template_type"))},show:function(){App.concerns.mail_editor_read_only_mode_init("mail_body")},"new":function(){this.init_form(),this.setting_choose_file(),App.front_segments.set_segment_select2("#mail_queue_segment_id"),App.front_segments.change_segment_icon("#mail_queue_segment_id")},create:function(){this.init_form(),this.setting_choose_file()},edit:function(){this.init_form(),this.setting_choose_file(),App.front_segments.set_segment_select2("#mail_queue_segment_id"),App.front_segments.change_segment_icon("#mail_queue_segment_id")},
update:function(){this.init_form(),this.setting_choose_file()},init_mail_categories:function(){1<=mail_categories.length&&(mail_categories=mail_categories[0].split(",")),0==tagging_operable_flag?$("#mail_categories").select2():$("#mail_categories").select2({tags:mail_categories,tokenSeparators:[","]})},set_select2:function(e,t,n){$(e).select2({width:t,placeholder:n})},on_change_sender:function(){$(document).on("click",'input[name="mail_template[sender_auto_flg]"]:radio',function(){"true"==$(this).val()?($("#mail_template_email_of_sender").addClass("hide"),$("#name_of_sender_row").css("display","none")):($("#mail_template_email_of_sender").removeClass("hide"),$("#name_of_sender_row").css("display",""))})},tag_controll:function(){$("#template_type").on("change",function(){"2"==$(this).val()?$(".btn-report-tag").attr("disabled",!1):$(".btn-report-tag").attr("disabled",!0),"3"==$(this).val()?($(".btn-for-lead-tag").attr("disabled",!0),$(".btn-for-client-tag").attr("disabled",!1),$("#sender_auto_flg_label").text(I18n.t("js.mail_templates.mail_make_client"))):($(".btn-for-lead-tag").attr("disabled",!1),$(".btn-for-client-tag").attr("disabled",!0),$("#sender_auto_flg_label").text(I18n.t("js.mail_templates.mail_make_lead")))}).change()},init_form:function(){App.concerns.set_mail_tag("mail_body"),this.init_mail_categories(),this.on_change_sender(),this.tag_controll(),App.concerns.mail_editor_init("mail_body"),App.front_segments.set_segment_select2("#mail_template_segment_id"),App.front_segments.change_segment_icon("#mail_template_segment_id"),["right","bottom","top"].forEach(function(e){$(".hp-tooltip-"+e).tooltip({container:"body",trigger:"hover",placement:e,html:"true"})})},setting_choose_file:function(){var t,i=null;$("#choose-file").on("click",function(){$("#mail_template_file").click()}),$(".attach-file-name").on("click",function(){$("#mail_template_file").click()}),$("#mail_template_file").on("change",function(){if(attachmentList=$(this).prop("files"),0<attachmentList.length?(i=attachmentList[0],attachment=i.name):i&&(attachment=$("#attach_file_name").val()+$("#attach_file_extension").val(),App.front_mails.setFileUpload(i,$("#mail_template_file"))),attachment){$(".trash-o-button.delete-attach-file").removeClass("hide"),$(".pen-button.edit-file-name").removeClass("hide"),$("#check_choose_file").val(!0),$("#delete_file_flg").val("");var e=App.front_mails.truncateNameFile(attachment);-1==attachment.indexOf(".")||-1!=attachment.indexOf(".")&&!attachment.split(".").at(-1)?($(".attach-file-name").html(e),$("#attach_file_name").val(attachment),$("#attach_file_extension").val(""),App.front_mails.regexFile(attachment)):(arr_file=attachment.split("."),extension_file="."+arr_file.pop(),name_file=arr_file.join("."),$(".attach-file-name").html(e),$("#attach_file_name").val(name_file),$("#attach_file_extension").val(extension_file),App.front_mails.regexFile(name_file,extension_file))}$(".download-attach-file").addClass("hide")}),"true"==$("#check_choose_file").val()&&$(".attach-file-name").html($("#attach_file_name").val()+$("#attach_file_extension").val()),$("#attach_file_name").val()||$("#attach_file_extension").val()?App.front_mails.regexFile($("#attach_file_name").val(),$("#attach_file_extension").val()):$(".attach-file-warning").addClass("hide"),$(".edit-file-name").on("click",function(){if(App.front_mails.checkExistsFileToMail("#mail_template_file","#mail_template_id")){var e=ModalUtils.maxZIndex();$("#modalEditFileName").css("z-index",e+1).modal("show"),t=App.front_mails.ltrim($("#attach_file_name").val()),$("#name_file").val(t),$("#extension_file").html(App.front_mails.truncateExtensionFile($("#attach_file_extension").val())),App.front_mails.regexNameFileInModal(t)}}),$(".rename_exec").on("click",function(){if(size_name=$("#name_file").val().length+$("#attach_file_extension").val().length,255<size_name)alert(I18n.t("js.mails.alert_message_file_name_longest"));else if(0==$("#name_file").val().trim().length)alert(I18n.t("js.mails.alert_message_file_name_shortest"));else{var e=App.front_mails.ltrim($("#name_file").val()),t=App.front_mails.truncateNameFile(e+$("#attach_file_extension").val());if($("#attach_file_name").val(e),$(".attach-file-name").html(t),App.front_mails.regexFile($("#attach_file_name").val(),$("#attach_file_extension").val()),i){var n=new File([i],$(".attach-file-name").html(),{type:i.type,lastModified:i.lastModified,lastModifiedDate:i.lastModifiedDate});App.front_mails.setFileUpload(n,$("#mail_template_file"))}$("#modalEditFileName").modal("hide")}}),$("#name_file").on("keypress",function(e){return 13!==e.which}),$("#name_file").on("focusout",function(){App.front_mails.regexNameFileInModal($(this).val())}),($("#attach_file_name").val()||$("#attach_file_extension").val())&&($(".attach-file-name").html(App.front_mails.truncateNameFile($("#attach_file_name").val()+$("#attach_file_extension").val())),App.front_mails.regexFile($("#attach_file_name").val(),$("#attach_file_extension").val())),$(".download-attach-file").on("click",function(){if(App.front_mails.checkExistsFileToMail("#mail_template_file","#mail_template_id")){var e=$("#attach_file_name").val()+$("#attach_file_extension").val(),t="/mail_templates/download/"+$("#mail_template_id").val();t=t.concat("?file_name="+e),$("#link-download-attach-file").attr("href",t),$("#link-download-attach-file")[0].click()}}),$(".delete-attach-file").on("click",function(){App.front_mails.checkExistsFileToMail("#mail_template_file","#mail_template_id")&&confirm(I18n.t("js.mail_templates.confirm_delete_attach_file"))&&($("#mail_template_file").val(""),$("#delete_file_flg").val(!0),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(this).addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"))}),$("#submit_form_mail_template").on("click",function(e){e.preventDefault();var t=$("#mail_template_file");if(t.val()){var n=URL.createObjectURL(t.get(0).files[0]);fetch(n).then(function(){$("#submit_form_mail_template").closest("form").submit()})["catch"](function(){$("#mail_template_file").val(""),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(".delete-attach-file").addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"),$("#error_not_found").val(!0),$("#submit_form_mail_template").closest("form").submit(),$("#error_not_found").val(!1)})}else $("#submit_form_mail_template").closest("form").submit();return!0})}};var autoDraftSaveFlag=!0;App.front_mails={attach_input_handlers:function(e,t){App.lead_filters.target_extraction_condition_modal(e),App.concerns.attach_select_search_handlers(e),App.concerns.attach_date_time_picker_handlers(e),App.concerns.attach_date_picker_handlers(e),t(e),e.find("[data-hp-role='select2']").select2({minimumResultsForSearch:20})},edit:function(){App.front_deals.all_checked_items_modal_deals_index(),this.settingAbTest(),$("#business_card_service_lead_id").val()&&!$("#search_to_ids").val()&&$("#search_to_ids").val($("#business_card_service_lead_id").val()),$("#search_bcc_ids").val()||$("#search_bcc_ids").val($("#current_user_id").val()),this.setting(),this.setSubmitCaption();var t=this;CKEDITOR.on("instanceReady",function(e){not_set_template_flg||$("#mail_template_id").change(),e.editor.on("blur",function(){t.autoDraftSave()})}),App.concerns.select_search("users"),App.concerns.set_associate_entities_to_s2("#to_multiple_decision","#search_to_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#to_tbc_multiple_decision","#search_to_ids",'input[name="associate_temporary_business_cards[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#to_user_multiple_decision","#search_to_ids",'input[name="associate_users[]"]',"users"),App.concerns.enable_associattion_search_tab_modal("#open-associated-to","/xhr/leads/search_to","#search_to_ids","#template_to_ids","multiple","#business_card_service_client_id","show","0","post"),App.concerns.set_associate_entities_to_s2("#cc_multiple_decision","#search_cc_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#cc_tbc_multiple_decision","#search_cc_ids",'input[name="associate_temporary_business_cards[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#cc_user_multiple_decision","#search_cc_ids",'input[name="associate_users[]"]',"users"),App.concerns.enable_associattion_search_tab_modal("#open-associated-cc","/xhr/leads/search_cc","#search_cc_ids","#template_cc_ids","multiple","#business_card_service_client_id","show","0","post"),App.concerns.set_associate_entities_to_s2("#bcc_multiple_decision","#search_bcc_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#bcc_tbc_multiple_decision","#search_bcc_ids",'input[name="associate_temporary_business_cards[]"]',"leads"),App.concerns.set_associate_entities_to_s2("#bcc_user_multiple_decision","#search_bcc_ids",'input[name="associate_users[]"]',"users"),App.concerns.enable_associattion_search_tab_modal("#open-associated-bcc","/xhr/leads/search_bcc","#search_bcc_ids","#template_bcc_ids","multiple","#business_card_service_client_id","show","0","post"),this.loadingDestinationsList(".action_loading","#destinations_result"),this.fetchDestinationsList(!0),this.clearDestinationsSearchForm("#form_filter_for_target_tab"),this.clearDestinaion(),App.destinations_visible_fields.setup_list_visible_setting(),App.concerns.change_order_for_target_tab("#form_change_display_number_for_target_tab",".lead_order_head"),App.front_mails.attach_input_handlers($(".hp-page"),function(e){App.lead_filters.lead_filter_modal(e)}),this.addDestination(),"ab"==$("#template_mail_type").val()&&$('a[data-toggle="tab"]').on("shown.bs.tab",function(e){"#senderBody"===$(e.target).attr("href")?$("#senderBodyContent").show():$("#senderBodyContent").hide()}),this.callCheckTbcModal("to"),this.callCheckTbcModal("cc"),this.callCheckTbcModal("bcc"),$("#lead_filter_added_lead_ids").val()&&($("input[name='mail_queue[lead_ids]']").val($("#lead_filter_added_lead_ids").val()),$("input[name='another_mail_queue[lead_ids]']").val($("#lead_filter_added_lead_ids").val())),$("#business_card_service_client_id").val()&&$("#business_card_service_client_id").val().length&&$("#search_to_ids").on("change",function(){reg=new RegExp("^lead_"),id=$("#search_to_ids").val().split(",").filter(function(e){return reg.test(e)})[0],id||$("#business_card_service_client_id").val("")})},create:function(){this.setting(),this.setSubmitCaption()},send_test_mail:function(){this.setting(),this.setSubmitCaption()},setting:function(){App.concerns.mail_editor_init("mail_body"),App.concerns.set_mail_tag("mail_body"),App.concerns.submit_when_changed_element("form_set_mail_template","js_change_element","convert"),App.concerns.prevent_submit_pressing_enter(),App.concerns.select_search("search_to_ids"),App.concerns.select_search("search_cc_ids"),App.concerns.select_search("search_bcc_ids"),$("#a_mail_template_id").length?$('#a_mail_template_id option[value=""]').after($("<option>").html(I18n.t("js.mails.mail_template")).val("-1")):$('#mail_template_id option[value=""]').after($("<option>").html(I18n.t("js.mails.mail_template")).val("-1")),$('#another_mail_template_id option[value=""]').after($("<option>").html(I18n.t("js.mails.mail_template")).val("-1")),$.fn.modal.Constructor.prototype.enforceFocus=function(){$(document).off("focusin.bs.modal").on("focusin.bs.modal",$.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||$(e.target).closest(".cke_dialog,.cke").length||this.$element.trigger("focus")},this))},1<=mail_categories.length&&(mail_categories=mail_categories[0].split(",")),0==tagging_operable_flag?$("#mail_categories").select2():$("#mail_categories").select2({tags:mail_categories,tokenSeparators:[","]}),"ab"===$("#mail_queue_mail_type").val()?$(".datetimepicker").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5,showClose:!0}).on("dp.change",function(){App.front_mails.viewSendDate()}):$(".datetimepicker").datetimepicker({format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:5,showClose:!0}),$("#mail_template_id").length?$("#mail_template_id").select2({width:"300px"}):$("#a_mail_template_id").length&&$("#a_mail_template_id").select2({width:"300px"}),App.front_segments.set_segment_select2("#mail_queue_segment_id"),App.front_segments.change_segment_icon("#mail_queue_segment_id"),$(document).on("click",'input[name="mail_queue[sender_auto_flg]"]:radio',function(){"true"==$(this).val()?($("#mail_queue_email_of_sender").addClass("hide"),$("#name_of_sender_row").css("display","none")):($("#mail_queue_email_of_sender").removeClass("hide"),$("#name_of_sender_row").css("display",""))}),$(".checked_submit_button").on("click",function(e){e.preventDefault();var t=$(this),n=$("#form_send_mail");$.ajax({type:"POST",url:"/xhr/mail_queues/check_incorrect_input/",data:{mail_type:$("#mail_queue_mail_type").val(),mail_queue_id:$("#mail_queue_id_substitute").val()||$("#mail_queue_id").val(),a_mail_queue_id:$("#a_mail_queue_id").val(),b_mail_queue_id:$("#b_mail_queue_id").val(),search:{to_ids:$("#search_to_ids").val(),cc_ids:$("#search_cc_ids").val(),bcc_ids:$("#search_bcc_ids").val()},lead_filter_added_lead_ids:$("#lead_filter_added_lead_ids").val()}}).done(function(e){if(e.exist_incorrect_input_flg&&!t.attr("data-action").match(/send_test_mail/))if("standard"==e.mail_type){if(!confirm(e.confirm_str.replaceAll("\\n","\n")))return t.prop("disabled",!1),t.css("pointer-events",""),!1}else if(!confirm(I18n.t("js.common.confirm_business_cards_correct_hotprofile_mail")))return t.prop("disabled",!1),t.css("pointer-events",""),!1;setTimeout(function(){if($(".save_from_button_flg").val("true"),$("#mail_queue_status").val(t.data("status")),$("#another_mail_queue_status").val(t.data("status")),$("#select_segment_id").val($('[name="mail_queue[segment_id]"]').val()),$("#select_mail_template_id").val($("[name=mail_template_id]").val()),$("#select_mail_template_id_another").val($("[name=mail_template_id]#another_mail_template_id").val()),t.data("remote")?n.data("remote",t.data("remote")):n.removeData("remote"),n.attr("action",t.data("action")),n.find('[name="_method"]').val(t.data("method")),"standard"!=$("#template_mail_type").val()||"mail_submit"!=t.attr("id")&&"mail_modal_submit"!=t.attr("id"))"ab"==$("#mail_queue_mail_type").val()?App.front_mails.check_err_file_not_found_ab(n):App.front_mails.check_err_file_not_found(n),$(".tooltip").hide(),"commit"==t.attr("name")&&setTimeout(function(){t.prop("disabled",!1)},1e3);else{var e=($("#search_to_ids").val().replace(/(?:user_|temporary_business_card_)[0-9]+,/g,"")+","+$("#search_cc_ids").val().replace(/(?:user_|temporary_business_card_)[0-9]+,/g,"")+","+$("#search_bcc_ids").val().replace(/(?:user_|temporary_business_card_)[0-9]+,/g,"")).replace(/lead_/g,"");$.ajax({type:"POST",url:"/xhr/mails/modals/get_excluded_destinations_modal",data:{lead_ids:e}}).error(function(){alert(I18n.t("js.common.communication_failed")),t.prop("disabled",!1)})}},1e3),t.prop("disabled",!0)})});var e=this,t=window.navigator.userAgent.toLowerCase();$("s2id_mail_template_id").on("change",function(){e.autoDraftSave()}),$(document).on("mousedown","#modalSendMail .close,#modalAbMail .close",function(e){e.preventDefault()}),$("#form_send_mail table input, textarea").not("input[type=hidden], input[type=file], #js_html_tag_tracking_insert_url").on("blur",function(){-1!=t.indexOf("firefox")&&document.activeElement!=document.body||e.autoDraftSave()}),$("#form_send_mail table input#search_to_ids, input#search_cc_ids, input#search_bcc_ids, input#mail_categories, input#mail_categories_another, select#mail_categories, select#mail_categories_another").on("change",function(){e.autoDraftSave()}),$("input#mail_queue_test_mail_to, input#another_mail_queue_test_mail_to").on("blur",function(){e.autoDraftSave()}),this.toggleSwitchAfterAutoSave(),$(".standard-insert-tag").hide(),$(".insert_tag_enable_button").prop("disabled",!0),$(".insert_tag_enable_button").on("click",function(){$(".insert_enable_flg").val("true"),$("#insert_tag_enable_button_flg").val("true"),e.autoDraftSave(),$("#insert_tag_enable_button_flg").val("false")}),$("#mail_template_id").change(function(){$("#template_to_ids").val($("#search_to_ids").val())}),$("#mail_body_another").length&&(App.concerns.mail_editor_init("mail_body_another"),App.concerns.set_another_mail_tag("mail_body_another"),App.concerns.submit_when_changed_element("another_form_set_mail_template","js_another_change_element","convert"),$("#another_mail_template_id").select2({width:"300px"}),0==tagging_operable_flag?$("#mail_categories_another").select2():$("#mail_categories_another").select2({tags:mail_categories,tokenSeparators:[","]}),$(document).on("click",'input[name="another_mail_queue[sender_auto_flg]"]:radio',function(){"true"==$(this).val()?($("#another_mail_queue_email_of_sender").addClass("hide"),$("#name_of_sender_row_another").css("display","none")):($("#another_mail_queue_email_of_sender").removeClass("hide"),$("#name_of_sender_row_another").css("display",""))})),this.previewModal(),this.previewAbModal(),["right","bottom","top"].forEach(function(e){$(".hp-tooltip-"+e).tooltip({container:"body",trigger:"hover",placement:e,html:"true"})}),-1!=t.indexOf("firefox")&&$("#mail_template_id, #a_mail_template_id, #another_mail_template_id").on("select2-close",function(){$(".tooltip").hide()}),$("#mail_queue_content_type").on("change",this.show_editor_tab),this.createMail(),this.createAbMail()},createMail:function(){var e=$("#form_send_mail #mail_queue_mail_type").val();if("mass"==e||"standard"==e){var t,a=this,i=null;$("#choose-file").on("click",function(){$("#mail_queue_file").click()}),$(".attach-file-name").on("click",function(){$("#mail_queue_file").click()}),$("#mail_queue_file").on("change",function(){attachmentList=$(this).prop("files"),0<attachmentList.length?(i=attachmentList[0],attachment=i.name,$("#check_exists_file").val()!=undefined&&$("#check_exists_file").val(!0)):i&&(attachment=$("#attach_file_name").val()+$("#attach_file_extension").val(),a.setFileUpload(i)),attachment&&($(".trash-o-button.delete-attach-file").removeClass("hide"),$(".pen-button.edit-file-name").removeClass("hide"),$("#check_choose_file").val(!0),$("#delete_file_flg").val(""),$("#choose_save_template").val(""),-1==attachment.indexOf(".")||-1!=attachment.indexOf(".")&&!attachment.split(".").at(-1)?($(".attach-file-name").html(a.truncateNameFile(attachment)),$("#attach_file_name").val(attachment),$("#attach_file_extension").val(""),a.regexFile(attachment)):(arr_file=attachment.split("."),extension_file="."+arr_file.pop(),name_file=arr_file.join("."),$(".attach-file-name").html(a.truncateNameFile(attachment)),$("#attach_file_name").val(name_file),$("#attach_file_extension").val(extension_file),a.regexFile(name_file,extension_file))),$(".download-attach-file").addClass("hide")}),($("#attach_file_name").val()||$("#attach_file_extension").val())&&($(".attach-file-name").html(a.truncateNameFile($("#attach_file_name").val()+$("#attach_file_extension").val())),a.regexFile($("#attach_file_name").val(),$("#attach_file_extension").val())),$(".edit-file-name").on("click",function(){if(a.checkExistsFileToMail()){var e=ModalUtils.maxZIndex();$("#modalEditFileName").css("z-index",e+1).modal("show"),t=a.ltrim($("#attach_file_name").val()),$("#name_file").val(t),$("#extension_file").html(a.truncateExtensionFile($("#attach_file_extension").val())),a.regexNameFileInModal(t)}}),$(".rename_exec").on("click",function(){if(size_name=$("#name_file").val().length+$("#attach_file_extension").val().length,255<size_name)alert(I18n.t("js.mails.alert_message_file_name_longest"));else if(0==$("#name_file").val().trim().length)alert(I18n.t("js.mails.alert_message_file_name_shortest"));else{var e=a.ltrim($("#name_file").val()),t=a.truncateNameFile(e+$("#attach_file_extension").val());if($("#attach_file_name").val(e),$(".attach-file-name").html(t),a.regexFile($("#attach_file_name").val(),$("#attach_file_extension").val()),i){var n=new File([i],$(".attach-file-name").html(),{type:i.type,lastModified:i.lastModified,lastModifiedDate:i.lastModifiedDate});a.setFileUpload(n)}$("#modalEditFileName").modal("hide")}}),$("#name_file").on("keypress",function(e){return 13!==e.which}),$("#name_file").on("focusout",function(){a.regexNameFileInModal($(this).val())}),$(".download-attach-file").on("click",function(){if(a.checkExistsFileToMail()){var e=$("#attach_file_name").val()+$("#attach_file_extension").val(),t=$("#link-download-attach-file").attr("href"),n=t.split("/"),i=n.indexOf("download")+1;t=(t=-1!=$("#link-download-attach-file").attr("href").indexOf("mail_templates")?"/mail_templates/download/"+n[i]:"/mail_histories/download/"+n[i]).concat("?file_name="+e),$("#link-download-attach-file").attr("href",t),$("#link-download-attach-file")[0].click()}}),$(".delete-attach-file").on("click",function(){a.checkExistsFileToMail()&&confirm(I18n.t("js.mails.confirm_delete_attach_file"))&&($("#mail_queue_file").val(""),$("#delete_file_flg").val(!0),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mails.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(this).addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"))})}},createAbMail:function(){var e=$("#form_send_mail #mail_queue_mail_type").val(),t=$("#abSettingModal").css("display"),n=this;"ab"==e&&"none"==t&&(n.handleAbMail("#mailBodyA "),$('.mass-mail-tabs a[data-toggle="tab"]').on("shown.bs.tab",function(){var e=$(this).attr("href")+" ";n.handleAbMail(e)}))},handleAbMail:function(a){var t,s=this,i=null,e=$(a+"#choose-file"),o=$(a+"#attach_file_name"),r=$(a+"#attach_file_extension"),l=$(a+".attach-file-name"),c=$(a+"#mail_queue_file"),n=$(a+".pen-button.edit-file-name"),d=$(a+".download-attach-file"),u=$(a+"#link-download-attach-file"),_=$(a+".trash-o-button.delete-attach-file"),h=$(a+"#delete_file_flg"),p=$(a+"#check_choose_file"),f=$(a+"#check_exists_file"),m=$(a+".attach-file-warning"),g=$(a+"#choose_save_template");"#mailBodyB "==a&&(o=$(a+"#another_attach_file_name"),r=$(a+"#another_attach_file_extension"),c=$(a+"#another_mail_queue_file"),p=$(a+"#check_another_choose_file"),f=$(a+"#check_exists_another_file"),h=$(a+"#another_delete_file_flg"),g=$(a+"#another_choose_save_template")),c.prop("files")&&(i=c.prop("files")[0]),e.off("click"),e.on("click",function(){c.click()}),l.off("click"),l.on("click",function(){c.click()}),c.off("change"),c.on("change",function(){attachmentList=$(this).prop("files"),0<attachmentList.length?(i=attachmentList[0],attachment=i.name,-1==d.attr("class").indexOf("hide")&&f.val(!0)):i&&(attachment=o.val()+r.val(),s.setFileUpload(i,c)),attachment&&(_.removeClass("hide"),n.removeClass("hide"),p.val(!0),h.val(""),g.val(""),-1==attachment.indexOf(".")||-1!=attachment.indexOf(".")&&!attachment.split(".").at(-1)?(l.html(s.truncateNameFile(attachment)),o.val(attachment),r.val(""),s.regexFile(attachment,"",a)):(arr_file=attachment.split("."),extension_file="."+arr_file.pop(),name_file=arr_file.join("."),l.html(s.truncateNameFile(attachment)),o.val(name_file),r.val(extension_file),s.regexFile(name_file,extension_file,a))),d.addClass("hide")}),(o.val()||r.val())&&(l.html(s.truncateNameFile(o.val()+r.val())),s.regexFile(o.val(),r.val(),a)),n.off("click"),n.on("click",function(){if(s.checkExistsFileToMailAb(a)){var e=ModalUtils.maxZIndex();$("#modalEditFileName").css("z-index",e+1).modal("show"),t=s.ltrim(o.val()),$("#name_file").val(t),$("#extension_file").html(s.truncateExtensionFile(r.val())),s.regexNameFileInModal(t,a)}}),$(".rename_exec").off("click"),$(".rename_exec").on("click",function(){if(size_name=$("#name_file").val().length+r.val().length,255<size_name)alert(I18n.t("js.mails.alert_message_file_name_longest"));else if(0==$("#name_file").val().trim().length)alert(I18n.t("js.mails.alert_message_file_name_shortest"));else{var e=s.ltrim($("#name_file").val()),t=s.truncateNameFile(e+r.val());if(o.val(e),l.html(t),s.regexFile(o.val(),r.val(),a),i){var n=new File([i],l.html(),{type:i.type,lastModified:i.lastModified,lastModifiedDate:i.lastModifiedDate});s.setFileUpload(n,c)}$("#modalAbMail").css("overflow-y","auto"),$("#modalEditFileName").modal("hide")}}),$(".rename_cancel").off("click"),$("#modalEditFileName .close").off("click"),$(document).on("click",".rename_cancel, #modalEditFileName .close",function(){$("#modalAbMail").css("overflow-y","auto")}),$("#name_file").off("keypress"),$("#name_file").on("keypress",function(e){return 13!==e.which}),$("#name_file").off("focusout"),$("#name_file").on("focusout",function(){s.regexNameFileInModal($(this).val(),a)}),d.off("click"),d.on("click",function(){if(s.checkExistsFileToMailAb(a)){var e=o.val()+r.val(),t=u.attr("href"),n=t.split("/"),i=n.indexOf("download")+1;t=(t=-1!=u.attr("href").indexOf("mail_templates")?"/mail_templates/download/"+n[i]:"/mail_histories/download/"+n[i]).concat("?file_name="+e),u.attr("href",t),u[0].click()}}),_.off("click"),_.on("click",function(){s.checkExistsFileToMailAb(a)&&confirm(I18n.t("js.mails.confirm_delete_attach_file"))&&(c.val(""),h.val(!0),p.val(!1),o.val(""),r.val(""),l.html(I18n.t("js.mails.not_attach_file")),m.addClass("hide"),d.addClass("hide"),$(this).addClass("hide"),n.addClass("hide"))})},check_err_file_not_found:function(e){var t=$("#mail_queue_file");if(t.val()){var n=URL.createObjectURL(t.get(0).files[0]);fetch(n).then(function(){e.submit()})["catch"](function(){$("#mail_queue_file").val(""),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(".delete-attach-file").addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"),$("#error_not_found").val(!0),e.submit(),$("#error_not_found").val(!1)})}else e.submit()},check_err_file_not_found_ab:function(e){var t=$("#mail_queue_file"),n=$("#another_mail_queue_file");if(t.val()){var i=URL.createObjectURL(t.get(0).files[0]);fetch(i).then(function(){App.front_mails.check_b_not_found(e)})["catch"](function(){$("#mail_queue_file").val(""),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$("#mailBodyA .attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$("#mailBodyA .attach-file-warning").addClass("hide"),$("#mailBodyA .download-attach-file").addClass("hide"),$("#mailBodyA .delete-attach-file").addClass("hide"),$("#mailBodyA .pen-button.edit-file-name").addClass("hide"),$("#error_not_found").val(!0),App.front_mails.check_b_not_found(e,!0)})}else n.val()?App.front_mails.check_b_not_found(e):e.submit()},check_b_not_found:function(e,t){t=!!t;var n=$("#another_mail_queue_file");if(n.val()){var i=URL.createObjectURL(n.get(0).files[0]);fetch(i).then(function(){e.submit(),1==t&&$("#error_not_found").val(!1)})["catch"](function(){$("#another_mail_queue_file").val(""),$("#check_another_choose_file").val(!1),$("#another_attach_file_name").val(""),$("#another_attach_file_extension").val(""),$("#mailBodyB .attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$("#mailBodyB .attach-file-warning").addClass("hide"),$("#mailBodyB .download-attach-file").addClass("hide"),$("#mailBodyB .delete-attach-file").addClass("hide"),$("#mailBodyB .pen-button.edit-file-name").addClass("hide"),$("#another_error_not_found").val(!0),e.submit(),$("#another_error_not_found").val(!1),1==t&&$("#error_not_found").val(!1)})}else e.submit(),1==t&&$("#error_not_found").val(!1)},checkExistsFileToMail:function(t,e){t=t||"#mail_queue_file",e=e||"#mail_queue_id";var n=!0,i=!1;return $(".download-attach-file").attr("class")&&-1==$(".download-attach-file").attr("class").indexOf("hide")&&(i=!0),$.ajax({url:"/xhr/mail_queues/check_exists_file_to_mail/",type:"POST",data:{id:$(e).val()},async:!1}).success(function(e){!e.check_exists_file&&i&&(alert(I18n.t("js.mails.err_file_not_found")),$(t).val(""),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val(""),$(".attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$(".attach-file-warning").addClass("hide"),$(".download-attach-file").addClass("hide"),$(".delete-attach-file").addClass("hide"),$(".pen-button.edit-file-name").addClass("hide"),n=!1)}),n},checkExistsFileToMailAb:function(n){var i=!0,e=n.trim(),a=!1;return-1==$(n+".download-attach-file").attr("class").indexOf("hide")&&(a=!0),$.ajax({url:"/xhr/mail_queues/check_exists_file_to_mail/",type:"POST",data:{id:$("#mail_queue_id").val(),another_id:$("#another_mail_queue_id").val(),type_ab:e},async:!1}).success(function(e){if(!e.check_exists_file&&a){var t="";"#mailBodyA "==n?(t+=I18n.t("js.mails.pattern_a"),t+="\n\u30fb"+I18n.t("js.mails.err_file_not_found")):"#mailBodyB "==n&&(t+=I18n.t("js.mails.pattern_b"),t+="\n\u30fb"+I18n.t("js.mails.err_file_not_found")),alert(t),"#mailBodyA "==n?($("#mail_queue_file").val(""),$("#check_choose_file").val(!1),$("#attach_file_name").val(""),$("#attach_file_extension").val("")):"#mailBodyB "==n&&($("#another_mail_queue_file").val(""),$("#check_another_choose_file").val(!1),$("#another_attach_file_name").val(""),$("#another_attach_file_extension").val("")),$(n+".attach-file-name").html(I18n.t("js.mail_templates.not_attach_file")),$(n+".attach-file-warning").addClass("hide"),$(n+".download-attach-file").addClass("hide"),$(n+".delete-attach-file").addClass("hide"),$(n+".pen-button.edit-file-name").addClass("hide"),i=!1}}),i},regexFile:function(e,t,n){e=e||"",t=t||"",n=n||"";var i=new RegExp("^[a-zA-Z0-9]*.?[a-zA-Z0-9]+$"),a=new RegExp("^[a-zA-Z0-9]*$"),s=e+t;i.test(s)&&""!=t||a.test(s)&&""==t?$(n+".attach-file-warning").addClass("hide"):$(n+".attach-file-warning").removeClass("hide")},truncateNameFile:function(e){var t=e||"";return 22<t.length&&(t=t.slice(0,9)+"..."+t.slice(-12)),t},truncateExtensionFile:function(e){return 11<e.length&&(e=e.slice(0,6)+"..."+e.slice(-5)),e},regexNameFileInModal:function(e,t){var n="#attach_file_name";"#mailBodyB "==t&&(n="#another_attach_file_name"),new RegExp('["*:<>?/\\\\|]').test(e)&&(alert(I18n.t("js.mails.invalid_special_character").replace(/&quot;/g,'"')),$("#name_file").val($(n).val()))},setFileUpload:function(e,t){t=t||$("#mail_queue_file");var n=new DataTransfer;n.items.add(e);var i=n.files;t.prop("files",i)},ltrim:function(e){return e?e.replace(/^\s+/g,""):e},setSubmitCaption:function(){$("[id^='mail_queue_reservation_flg_']").on("click",function(){var e="";$("#mail_queue_reservation_flg_0").prop("checked")?(e=$("#send_caption").val(),$("#mail_queue_reservation_at").prop("disabled",!0)):(e=$("#scheduled_delivery_caption").val(),$("#mail_queue_reservation_at").prop("disabled",!1)),$("#mail_submit").text(e)})},settingAbTest:function(){var e=$("#mail_queue_mail_type").val(),t=$("#mail_queue_status").val();"ab"===e&&(""===t&&$("#abSettingModal").modal("show"),this.setAbReservationCheck(),this.clearAbDestination(),this.setAbPercentage($("#ab_test_mail_setting_percentage_label").html().slice(0,-1)),App.front_mails.attach_input_handlers($(".hp-page"),function(e){App.lead_filters.is_reload_lead_filter_modal=!0,App.lead_filters.lead_filter_modal(e)}),$("#lead_filter_added_lead_ids").change(function(){this.setAbPercentage($("#ab_test_mail_setting_percentage_label").html().slice(0,-1))}.bind(this)),$("#ab_setting_modal_next").click(function(){if(this.validateAbSetting()){if($("#setting_ab_form").submit(),!$("#mail_body_another").length){var e=$("<div />").attr("id","backdrop");e.css({"z-index":"9999",position:"fixed",top:"0px",left:"0px",right:"0px",bottom:"0px","background-color":"#000",opacity:"0.5"}),$("body").append(e)}$("#abSettingModal").modal("hide"),$("#modalAbMail").length&&$("body").addClass("modal-open"),$("#ab_test_mail_setting_reservation_flg_0").prop("checked")&&($(".a_reservation_flg").text(I18n.t("js.mails.immediate_delivery")),$(".b_reservation_flg").text(I18n.t("js.mails.immediate_delivery")),$("#mail_submit").text(I18n.t("js.mails.send")),$("#mail_modal_submit").not(".caption_type_settings").text(
I18n.t("js.mails.send"))),$("#ab_test_mail_setting_reservation_flg_1").prop("checked")&&($(".a_reservation_flg").text(I18n.t("js.mails.scheduled_delivery")),$(".b_reservation_flg").text(I18n.t("js.mails.scheduled_delivery")),$("#mail_submit").text(I18n.t("js.mails.scheduled_delivery")),$("#mail_modal_submit").not(".caption_type_settings").text(I18n.t("js.mails.scheduled_delivery")))}}.bind(this)),$("#ab_test_mail_setting_percentage").slider({orientation:"horizontal",step:2,min:2,max:98,range:"min",value:$("#ab_test_mail_setting_percentage_label").html().slice(0,-1),slide:function(e,t){this.setAbPercentage(t.value)}.bind(this)}),App.lead_filters.apply_leads_count(),(document.getElementById("ab_test_mail_setting_reservation_flg_0").checked||document.getElementById("ab_test_mail_setting_reservation_flg_1").checked)&&App.front_mails.viewSendDate(),$("input[name='ab_test_mail_setting[period]'],input[name='ab_test_mail_setting[reservation_flg]']").change(function(){App.front_mails.viewSendDate()}),setInterval("App.front_mails.showSec()",1e3),App.front_mails.adjustmentTargetAddedLeadIds())},setAbReservationCheck:function(){$("[id^='ab_test_mail_setting_reservation_flg_']").on("click",function(){var e=$("#ab_test_mail_setting_reservation_flg_0").prop("checked");$("#ab_test_mail_setting_reservation_at").prop("disabled",e)})},clearAbDestination:function(){$("[data-target=\"[data-hp-role='lead-filter-clear']\"]").on("click",function(){var e=$(this).data("target"),t=$("[data-hp-role='lead-filter-num']"),n=$(e).find("[data-hp-role='lead-filter-control-nodata']"),i=$(e).find("[data-hp-role='lead-filter-control-show']");if($(this).data("confirmed")){if(!1===confirm(I18n.t("js.target_lists.select_process")))return;n.removeClass("hide"),i.addClass("hide"),$(e).find("[name='lead_filter[added_lead_ids]']").val("").change(),$("#destination_clear_link").click(),t.removeData("leadIdCounts"),$("[data-hp-role='lead-filter-confirm'] [name='lead_filter_confirmed']").val(!1)}else alert(I18n.t("js.target_lists.destination_not_set"))})},setAbPercentage:function(e){var t=$("#lead_filter_added_lead_ids").val(),n=""===t?0:t.split(",").length,i=(e=e,0),a=0;$("#ab_test_mail_setting_percentage_label").html(e+"%"),$("#ab_test_mail_setting_a_percent").html(e/2),$("#ab_test_mail_setting_b_percent").html(e/2),$("#ab_test_mail_setting_win_percent").html(100-e),3<=n&&(a=n-2*(i=(i=n/100*(e/2))<1?1:Math.floor(i))),$("#ab_test_mail_setting_a_count").html(i),$("#ab_test_mail_setting_b_count").html(i),$("#ab_test_mail_setting_win_count").html(a),$("#ab-setting-total-ratio").val(e)},validateAbSetting:function(){var e=[],t=$("#ab_test_mail_setting_period").val(),n=$("input[name='ab_test_mail_setting[reservation_flg]']:checked").val(),i=1,a=999;return""===t?e.push(I18n.t("js.mails.period_not_set")):t<i?e.push(I18n.t("js.mails.period_lower_limit",{num:i})):a<t&&e.push(I18n.t("js.mails.period_upper_limit",{num:a})),n&&""!==n||e.push(I18n.t("js.mails.reservation_flg_not_set")),"1"===n&&isNaN(new Date($("#ab_test_mail_setting_reservation_at").val()))&&e.push(I18n.t("js.mails.not_set_reservation_at")),Number.isInteger(t-0)||e.push(I18n.t("js.mails.not_decimal")),!(0<e.length)||(alert(e.join("\n")),!1)},autoDraftSave:function(){var e=$(".checked_submit_button"),t=$("#form_send_mail"),n=e.data("method");if("post"==n)return!1;$("#mail_queue_status").val(e.data("status")),$("#another_mail_queue_status").val(e.data("status")),$("#select_mail_template_id").val($("[name=mail_template_id]").val()),$("#select_mail_template_id_another").val($("#another_mail_template_id").val()),$("#select_segment_id").val($('[name="mail_queue[segment_id]"]').val()),t.attr("action",e.data("action")),t.find('[name="_method"]').val(n),$("<input>",{type:"hidden",name:"save_type_draft",value:!0,id:"auto-draft-save"}).appendTo(t),!$("#skip-atuo-save").length&&autoDraftSaveFlag&&(data_param=t.serialize(),data_param=data_param.replace(/&mail_queue\%5Bbody\%5D=(.*?)&/,"&mail_queue%5Bbody%5D="+encodeURIComponent(CKEDITOR.instances.mail_body.getData())+"&"),$("#mail_body_another").length&&(data_param=data_param.replace(/&another_mail_queue\%5Bbody\%5D=(.*?)&/,"&another_mail_queue%5Bbody%5D="+encodeURIComponent(CKEDITOR.instances.mail_body_another.getData())+"&")),$.ajax({url:t.attr("action"),type:t.attr("method"),data:data_param,timeout:7e4,beforeSend:function(){$(".auto-draft-msgbox.saving").css("opacity",1),$(".auto-draft-msgbox.saving").css("visibility","visible"),autoDraftSaveFlag=!1},complete:function(){$(".auto-draft-msgbox.saving").css("opacity",0),$(".auto-draft-msgbox.saving").css("visibility","hidden"),setTimeout(function(){autoDraftSaveFlag=!0},0)},success:function(){},error:function(){$(".auto-draft-msgbox.error").css("opacity",1),$(".auto-draft-msgbox.error").css("visibility","visible"),setTimeout(function(){$(".auto-draft-msgbox.error").css("opacity",0),$(".auto-draft-msgbox.error").css("visibility","hidden")},2e3)}})),$("#auto-draft-save").remove(),$("#skip-atuo-save").remove()},toggleSwitchAfterAutoSave:function(){var t=this;[".hp-page > ul.search-nav a",".btn-to-list","a#open-associated-to","a#open-associated-cc","a#open-associated-bcc"].forEach(function(e){$(e).on("mousedown",function(){t.setTempButtonToPreventAutoSave($(this))})})},setTempButtonToPreventAutoSave:function(e){this.autoDraftSave(),$("<input>",{type:"hidden",value:!0,id:"skip-atuo-save"}).appendTo(e),e.click()},setClient:function(e){$("#change_client_select2_flg").val()?$("#search_client_id_on_search_association_modal").val(e):(reg=new RegExp("^lead_"),id=$("#search_to_ids").val().split(",").filter(function(e){return reg.test(e)})[0],id?$.getJSON("/xhr/leads/return_client",{id:id.slice(5)},function(e){$("#search_client_id_on_search_association_modal").val(e.id),App.concerns.select_search("search_client_id_on_search_association_modal"),App.concerns.set_associate_entity_to_s2("#search_client_id_on_search_association_modal",".hp-clients-table button.decision","clients"),$("#business_card_service_client_id").val(e.id)}):$("#business_card_service_client_id").val(""))},previewModal:function(){var o=$("#previewModal");$(document).on("show.bs.modal","#previewModal",function(){if($(document).find(".modal-open")[0]){var e=ModalUtils.maxZIndex();$(".modal-backdrop").last().css("z-index",e+1),o.css("z-index",e+2)}$("#previewTextTab").removeClass("hide"),$("#previewHtmlTab").removeClass("hide");var t=$("#mail_queue_content_type").val(),n=$("input[name='mail_queue[sender_auto_flg]']:checked").val(),i=$("#mail_queue_name_of_sender").val();"true"===n&&(i=I18n.t("js.mails.preview_from_lead"));var a=$("#mail_queue_file").prop("files"),s="";0<a.length?s=a[0].name:($("#attach_file_name").val()||$("#attach_file_extension").val())&&(s=$("#attach_file_name").val()+$("#attach_file_extension").val()),"1"===t?($("#previewHtmlTab").addClass("hide"),$('[href="#previewTextBody"]').tab("show")):"2"===t?($("#previewTextTab").addClass("hide"),$('[href="#previewHtmlBody"]').tab("show")):"3"===t&&$('[href="#previewHtmlBody"]').tab("show"),$("#previewFrom").html(i),$("#previewSubject").html($("#mail_queue_title").val()),$("#previewAttachment").html(s),$("#previewHtmlBody").html(CKEDITOR.instances.mail_body.getData()),$("#previewTextBodyArea").text($("#mail_text_body").val())}).on("hidden.bs.modal","#previewModal, #modal_check_tbc, #relation_lead_client_edit_container, #search-associated-resources-modal, #excluded_destinations_modal",function(){var e=ModalUtils.maxZIndex();$(".modal-backdrop").last().css("z-index",e-1)}),$(document).on("hidden.bs.modal",function(){$("#modalSendMail").addClass("modal-open")})},previewAbModal:function(){var f=$("#previewAbModal"),m=this;$(document).on("show.bs.modal","#previewAbModal",function(){if($(document).find(".modal-open")[0]){var e=ModalUtils.maxZIndex();$(".modal-backdrop").last().css("z-index",e+1),f.css("z-index",e+2)}var t="a",n="b",i=$("#mail_queue_content_type").val(),a=$("#another_content_type").val();$("#mail_queue_content_type_another").length&&(a=$("#mail_queue_content_type_another").val()),"3"===i&&"3"===a?(m.showAbPreviewTabContent(t),m.showAbPreviewTabContent(n),$("#previewTextTab").removeClass("hide")):"3"!==i&&"3"===a?(m.hideAbPreviewTabContent(t),m.showAbPreviewTabContent(n),$("#previewTextTab").removeClass("hide")):"3"===i&&"3"!==a?(m.hideAbPreviewTabContent(n),m.showAbPreviewTabContent(t),$("#previewTextTab").removeClass("hide")):$("#previewTextTab").addClass("hide"),$("#previewHtmlTab").removeClass("hide");var s=$("input[name='mail_queue[sender_auto_flg]']:checked").val(),o=I18n.t("js.mails.preview_from_lead");"false"===s&&(o=$("#mail_queue_name_of_sender").val()||$("#mail_queue_email_of_sender").val());var r=$("input[name='another_mail_queue[sender_auto_flg]']:checked").val(),l=I18n.t("js.mails.preview_from_lead");"false"===r&&(l=$("#another_mail_queue_name_of_sender").val()||$("#another_mail_queue_email_of_sender").val());var c=$("#mail_queue_file").prop("files"),d="";0<c.length?d=c[0].name:($("#mailBodyA #attach_file_name").val()||$("#mailBodyA #attach_file_extension").val())&&(d=$("#mailBodyA #attach_file_name").val()+$("#mailBodyA #attach_file_extension").val());var u=$("#another_mail_queue_file").prop("files"),_="";0<u.length?_=u[0].name:($("#mailBodyB #another_attach_file_name").val()||$("#mailBodyB #another_attach_file_extension").val())&&(_=$("#mailBodyB #another_attach_file_name").val()+$("#mailBodyB #another_attach_file_extension").val());var h=$("a[href='#mailBodyA']").html().slice(-1);$(".previewFrom"+h).html(o),$(".previewSubject"+h).html($("#mail_queue_title").val()),$(".previewAttachment"+h).html(d),$("#previewTextBodyArea"+h).text($("#mail_text_body").val());var p=$("a[href='#mailBodyB']").html().slice(-1);$(".previewFrom"+p).html(l),$(".previewSubject"+p).html($("#another_mail_queue_title").val()),$(".previewAttachment"+p).html(_),$("#previewTextBodyArea"+p).text($("#mail_text_body_another").val())}).on("hidden.bs.modal","#previewAbModal",function(){var e=ModalUtils.maxZIndex();$(".modal-backdrop").last().css("z-index",e-1),$(".td-a").removeClass("border-bottom-none"),$(".td-b").removeClass("border-bottom-none")}),$(document).on("hidden.bs.modal",function(){$("#modalSendMail").addClass("modal-open")})},hideAbPreviewTabContent:function(e){$(".join-target-"+e).addClass("hide"),$("#join-core-"+e).attr("rowSpan",5),$("#join-core-"+e).text().split(" ").length<2&&$("#join-core-"+e).text($("#join-core-"+e).text()+" "+I18n.t("js.mails.no_content"))},showAbPreviewTabContent:function(e){2<=$("#join-core-"+e).text().split(" ").length&&$("#join-core-"+e).text($("#join-core-"+e).text().split(" ")[0]),$(".join-target-"+e).removeClass("hide"),$("#join-core-"+e).removeAttr("rowSpan")},viewSendDate:function(){var e=$("#day_of_the_week").val().split(",");if(document.getElementById("ab_test_mail_setting_reservation_flg_0").checked)$("#period-box").fadeIn(250),$("#test-period-start").text($("#after_send").val()),$("#test-period-tilde").removeAttr("hidden"),App.front_mails.showSec();else if(document.getElementById("ab_test_mail_setting_reservation_flg_1").checked){$("#period-box").fadeIn(250);var t=new Date($("#ab_test_mail_setting_reservation_at").val());if("Invalid Date"!==t.toString()){$("#test-period-start").text(App.concerns.formatDate(t,"yyyy/MM/dd(aaa) HH:mm",e)),$("#test-period-tilde").removeAttr("hidden");var n=new Date(t.getTime()+60*$("#ab_test_mail_setting_period").val()*60*1e3);$("#test-period-end").text(App.concerns.formatDate(n,"yyyy/MM/dd(aaa) HH:mm",e)),$("#win-pattern-date").text(App.concerns.formatDate(n,"yyyy/MM/dd(aaa) HH:mm",e))}}},clearDestinationsSearchForm:function(e){$(e+" .clear-btn").click(function(){$("form"+e+" :input").each(function(){"checkbox"===$(this).attr("type")?$(this).prop("checked",!1):"radio"===$(this).attr("type")||"submit"===$(this).attr("type")||$(this).val("")})})},fetchDestinationsList:function(e){e?($("#check_specific_mark").val(!0),$("#form_change_display_number_for_target_tab").submit(),$("#check_specific_mark").val("")):$("#form_change_display_number_for_target_tab").submit()},loadingDestinationsList:function(e,t){$(e).on({"ajax:beforeSend":function(){$(t).html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:error":function(){$(t).html($('<div class="loadError"><span>'+I18n.t("js.application.load_error")+"</span></div>"))}})},addDestination:function(){$(".mail_lead_filter").on("hidden.bs.modal",function(){"ab"!=$("#template_mail_type").val()&&(App.front_mails.fetchDestinationsList(!0),$("input[name='mail_queue[lead_ids]']").val($("#lead_filter_added_lead_ids").val())),"ab"!=$("#template_mail_type").val()||$("#abSettingModal").hasClass("in")||($("#add_destination_lead_ids").val($("#lead_filter_added_lead_ids").val()),$("#add_ab_destination").submit())}),$("#setting_ab_form,#add_ab_destination").submit(function(){$("#destinations_result").html($('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))})},adjustmentTargetAddedLeadIds:function(){var u=$("#day_of_the_week").val().split(",");$("#abSettingButton").on("click",function(){$("#ab_test_mail_setting_reservation_at").attr("data-value",$("#ab_test_mail_setting_reservation_at").val())}),$("#ab_setting_modal_next").click(function(){$("#add_destination_lead_ids").val($("[name='lead_filter[added_lead_ids]']").val());var e=document.querySelector("#ab_test_mail_setting_evaluation_criteria_open_rate"),t=document.querySelector("#ab_test_mail_setting_evaluation_criteria_url_click");e.dataset.value=e.checked,t.dataset.value=t.checked;var n=document.querySelector("#ab_test_mail_setting_reservation_flg_0"),i=document.querySelector("#ab_test_mail_setting_reservation_flg_1"),a=document.querySelector("#ab_test_mail_setting_reservation_at");if(n.dataset.value=n.checked,i.dataset.value=i.checked,n.checked){var s=new Date,o=s.getMinutes(),r=o;o%5!=0&&(r=o+5-o%5);var l=new Date(s.setMinutes(r));a.dataset.value=App.concerns.formatDate(l,"yyyy/MM/dd HH:mm",u),$(".datetimepicker").datetimepicker().val(App.concerns.formatDate(l,"yyyy/MM/dd HH:mm",u))}else i.checked&&(a.dataset.value=App.concerns.formatDate(new Date(a.value),"yyyy/MM/dd HH:mm",u));var c=document.querySelector("#ab-setting-total-ratio");c.dataset.value=c.value;var d=document.querySelector("#ab_test_mail_setting_period");d.dataset.value=d.value}),$("#settingAbModalCloseButton").click(function(){$("[name='lead_filter[added_lead_ids]']").val($("#add_destination_lead_ids").val()).change(),0<parseInt($("#destination_count").val())?($("#destination_count_show").text($("#destination_count").val()),$("#destination_count_show").parent("[data-hp-role='lead-filter-control-show']").removeClass("hide"),$("#destination_count_no_data").addClass("hide")):(0==parseInt($("#destination_count").val())||$("#destination_count").val().length<=0)&&($("#destination_count_show").parent("[data-hp-role='lead-filter-control-show']").addClass("hide"),$("#destination_count_no_data").removeClass("hide"));var e=document.querySelector("#ab_test_mail_setting_evaluation_criteria_open_rate");"true"===e.dataset.value?e.checked=!0:e.checked=!1;var t=document.querySelector("#ab_test_mail_setting_evaluation_criteria_url_click");"true"===t.dataset.value?t.checked=!0:t.checked=!1;var n=document.querySelector("#ab_test_mail_setting_reservation_flg_0");"true"===n.dataset.value?n.checked=!0:n.checked=!1;var i=document.querySelector("#ab_test_mail_setting_reservation_flg_1");"true"===i.dataset.value?i.checked=!0:i.checked=!1;var a=document.querySelector("#ab_test_mail_setting_reservation_at");n.checked?$("#ab_test_mail_setting_reservation_flg_0").click():i.checked&&$("#ab_test_mail_setting_reservation_flg_1").click(),$(".datetimepicker").datetimepicker().val(App.concerns.formatDate(new Date(a.dataset.value),"yyyy/MM/dd HH:mm",u));var s=document.querySelector("#ab-setting-total-ratio");s.value=s.dataset.value,$("#ab_test_mail_setting_percentage").slider("option","value",s.dataset.value),App.front_mails.setAbPercentage(s.dataset.value);var o=document.querySelector("#ab_test_mail_setting_period");o.value=o.dataset.value}),$("#add_ab_destination").submit(function(){$("#add_destination_lead_ids").val($("[name='lead_filter[added_lead_ids]']").val())}),$("[name='lead_filter[added_lead_ids]']").change(function(){App.lead_filters.is_reload_lead_filter_modal=!0}),$("#setting_ab_form,#add_ab_destination").submit(function(){$("#destination_count").val($("#destination_count_show").text())})},clearDestinaion:function(){$("#clear_destination").click(function(){return $("#form_send_mail input[name='mail_queue[lead_ids]']").val().length<=0?(alert(I18n.t("js.mail.alert_destination_not_set")),!1):!!window.confirm(I18n.t("js.mail.confirm_clear_destination"))&&void 0})},updateMailHistoriesDestination:function(){App.front_mail_histories.fetchDestinationsList(),$("#destinations_visible_fields_setting_dialog .js_list_field").each(function(){$("#visible_fields_setting_dialog input:checkbox[value="+$(this).val()+"]").prop("checked",$(this).prop("checked"))})},updateWhenNotShowAbility:function(){$(".modal-caller").attr("disabled",null),$(".modal-caller").css("pointer-events",""),$("body").addClass("modal-open"),App.front_mails.fetchDestinationsList(!0)},fixCurrentPageLink:function(e){$(e+" .pagination li.active a").click(function(){if("#"==$(this).attr("href"))return!1})},showSec:function(){if($("#ab_test_mail_setting_reservation_flg_0").length&&document.getElementById("ab_test_mail_setting_reservation_flg_0").checked){var e=$("#day_of_the_week").val().split(","),t=new Date((new Date).getTime()+60*$("#ab_test_mail_setting_period").val()*60*1e3);$("#test-period-end").text(App.concerns.formatDate(t,"yyyy/MM/dd(aaa) HH:mm:ss",e)),$("#win-pattern-date").text(App.concerns.formatDate(t,"yyyy/MM/dd(aaa) HH:mm:ss",e))}},rotateZoom:function(){var e=document.getElementById("rotate_left"),t=document.getElementById("rotate_right"),n=0,i=document.getElementById("image_wrapper"),a=document.getElementById("image_area"),s=document.getElementById("front_picture");s.onload=function(){var e=s.width,t=s.height;e<t?(s.style.width="290px",s.style.height="480px"):t<e?(s.style.width="480px",s.style.height="290px"):(s.style.width="320px",s.style.height="320px")},t.addEventListener("click",function(){a.style.transform="rotate("+(n+90)+"deg)",360===(n+=90)&&(n=0),s.classList.contains("zoom")&&(s.classList.remove("zoom"),i.style.cursor="pointer")}),e.addEventListener("click",function(){a.style.transform="rotate("+(n-90)+"deg)",-360===(n-=90)&&(n=0),s.classList.contains("zoom")&&(s.classList.remove("zoom"),i.style.cursor="pointer")}),s.addEventListener("dblclick",function(){s.classList.toggle("zoom"),s.classList.contains("zoom")?(i.style.cursor="-webkit-grab",i.style.cursor="-moz-grab",i.style.cursor="-o-grab",i.style.cursor="grab"):i.style.cursor="pointer",s.width<s.height?0===n||270===n||-90===n?s.style.transformOrigin="top":90!==n&&-270!==n&&180!==n&&-180!==n||(s.style.transformOrigin="bottom"):s.width>s.height&&(0===n||90===n||-270===n?s.style.transformOrigin="left":180!==n&&-180!==n&&270!==n&&-90!==n||(s.style.transformOrigin="right"))})},mousedragscrollable:function(e){var i;$(e).each(function(e,t){$(t).mousedown(function(e){return e.preventDefault(),i=$(t),$(t).data({down:!0,move:!1,x:e.clientX,y:e.clientY,scrollleft:$(t).scrollLeft(),scrolltop:$(t).scrollTop()}),!1}),$(t).click(function(){if($(t).data("move"))return!1})}),$(document).mousemove(function(e){if($(i).data("down")){e.preventDefault();var t=$(i).data("x")-e.clientX,n=$(i).data("y")-e.clientY;if(0===t&&0===n)return;return $(i).data("move",!0),$(i).scrollLeft($(i).data("scrollleft")+t),$(i).scrollTop($(i).data("scrolltop")+n),!1}}).mouseup(function(){return $(i).data("down",!1),!1})},callCheckTbcModal:function(n){$("#search_"+n+"_ids").on("change",function(){var e=$("#search_"+n+"_ids").val().split(",").filter(function(e){return e.startsWith("temporary_business_card")}),t=e.filter(function(e){return-1==$("#tbc_edited_"+n+"_ids").val().split(",").indexOf(e)});t=t.filter(function(e,t,n){return n.indexOf(e)===t}),$("#tbc_edited_"+n+"_ids").val(e),$("#modal_block_for_check_tbc_modal").val(n),t.length&&$.ajax({type:"POST",url:"/xhr/temporary_business_cards/check_tbc_modal",dataType:"script",data:{temporary_business_card_ids:t}})})}},App.front_maps={show:function(){App.front_deals.all_checked_items_modal_deals_index(),mapAreaResize(),$(window).on("resize",mapAreaResize),$('[data-toggle="tab"]').on("shown.bs.tab",function(e){e.target.innerHTML===I18n.t("js.maps.route")?$(".panel-footer").show():$(".panel-footer").hide(),mapAreaResize()})}};var HPMap=function(){function e(e,t,n){this.map=new google.maps.Map(e,t),this.leads=n,this.markers={},this.bounds=new google.maps.LatLngBounds,this.currentIds=[],this.currentMarker=null;var i=[{featureType:"all",elementType:"all",stylers:[{saturation:-40}]}],a=new google.maps.StyledMapType(i);this.map.mapTypes.set("dropSaturation",a),this.map.setMapTypeId("dropSaturation"),this.directionsDisplay=new google.maps.DirectionsRenderer({map:this.map,preserveViewport:!0,suppressMarkers:!0}),this.points=[],this.travelMode=google.maps.TravelMode.DRIVING,this.directionsService=new google.maps.DirectionsService,this.optimizeWaypoints=!1,this.execute=!1,this.event=null;var s=this;$(document).on("click",".js_change_route",function(){var e=$(this),t=e.data("leadId"),n=e.data("routeAction");s[n](t)})}return e.prototype={getBounds:function(){return this.map.getBounds()},on:function(e,t){this.map.addListener(e,t)},onOnce:function(e,t){google.maps.event.addListenerOnce(this.map,e,t)},set:function(e,t){var n=this.markers[e];n?(n.rFlg||n.marker.setIcon(t.icon),n.opts=t):(n={marker:new google.maps.Marker(t),infoWindow:null,opts:t,rFlg:!1},this.markers[e]=n,this.infoWindow(e,n))},show:function(e,t){var n=this.map;for(var i in this.currentMarker&&!e.includes(this.currentMarker.id)&&(this.currentMarker.infoWindow.close(),this.currentMarker=null),this.markers){var a=this.markers[i],s=a.rFlg||e.includes(i)?n:null;s&&(this.currentIds.includes(i)||this.points.includes(i))||a.marker.setMap(s),t&&s&&(this.bounds.extend(a.marker.position),this.map.fitBounds(this.bounds))}this.currentIds=e},infoWindow:function(e,t){var n=this.leads[e],i=t.rFlg?"removeRoute":"addRoute",a=t.rFlg?I18n.t("js.maps.delete_route"):I18n.t("js.maps.add_route"),s='<button class="btn btn-default btn-xs js_change_route" style="margin-bottom: 10px;" data-lead-id="'+e+'" data-route-action="'+i+'">'+a+"</button>",o="";n.address&&(o="<a href='http://maps.google.co.jp/maps?q="+n.lat+","+n.lng+"' target='_blank'>"+n.address+"</a>");var r="<div class='map-info-window'><p>"+(n.not_read_parameter.includes("client")?n.client.name:"<a href='#' data-href='/xhr/customer_sheets/"+n.client.id+"/' data-client-id='"+n.client.id+"' class='js_customer_sheets_show' target='_blank'>"+n.client.name+"</a>")+"</p><p><a href='/leads/"+e+"' target='_blank'>"+n.name+"</a></p>"+s+"<p>"+I18n.t("js.maps.tel")+"\uff1a "+n.tel+"</p><p>"+I18n.t("js.maps.mobile_tel")+"\uff1a "+n.mobile_tel+"</p><p>"+I18n.t("js.maps.address")+"\uff1a "+o+"</p></div>",l=new google.maps.InfoWindow({content:r,position:t.marker.position});if(t.infoWindow)t.infoWindow.close();else{var c=this;t.marker.addListener("click",function(){c.currentMarker&&c.currentMarker.infoWindow.close(),t.infoWindow.open(c.map,t.marker),c.currentMarker={id:e,infoWindow:t.infoWindow}})}t.infoWindow=l},addRoute:function(e){if(25<=this.points.length)alert(I18n.t("js.maps.cant_add_route"));else{this.points.push(e);var t=this.markers[e];t.marker.setIcon(this.getRouteIcon(this.points.length)),t.rFlg=!0,this.infoWindow(e,t),this.routeShow(!1),"function"==typeof this.event&&this.event(this.points,!0)}},removeRoute:function(e){var t=this.points.indexOf(e);-1!==t&&this.points.splice(t,1);var n=this.markers[e];n.marker.setIcon(n.opts.icon),n.rFlg=!1,this.infoWindow(e,n),this.currentIds.includes(String(e))||n.marker.setMap(null),this.sortMarker(),this.routeShow(!1),"function"==typeof this.event&&this.event(this.points,!0)},changeTravelMode:function(e){this.travelMode=google.maps.TravelMode[e],this.routeShow(!1)},changeOptimizeWaypoints:function(e){this.optimizeWaypoints=e,this.optimizeWaypoints&&this.execute&&(this.execute=!1,this.routeShow(!1))},getOrder:function(){return this.points},changeOrder:function(e){this.points=e,this.routeShow(!0)},onChangeOrder:function(e){this.event=e},routeShow:function(n){var i=this,e=this.points;if(1===e.length)this.directionsDisplay.setMap(null);else if(2<=e.length){var t={origin:this.getPosition(e[0]),destination:this.getPosition(e[e.length-1]),waypoints:e.slice(1,e.length-1).map(function(e){return{location:i.getPosition(e)}}),travelMode:this.travelMode,optimizeWaypoints:this.optimizeWaypoints};this.directionsService.route(t,function(e,t){t===google.maps.DirectionsStatus.OK&&(i.directionsDisplay.setMap(i.map),i.directionsDisplay.setDirections(e),(i.sortPoints(e.routes[0].waypoint_order)||n)&&(i.sortMarker(),"function"==typeof i.event&&i.event(i.points,!0)))})}this.execute=!0},getRouteIcon:function(e){return"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld="+e+"|ff7e73|000000"},getPosition:function(e){var t=this.markers[e];return t?t.marker.position:null},sortMarker:function(){for(var e=0,t=this.points.length;e<t;e++){this.markers[this.points[e]].marker.setIcon(this.getRouteIcon(e+1))}},sortPoints:function(e){var t=this.points[0],n=this.points[this.points.length-1],i=this.points.slice(1,this.points.length-1),a=e.map(function(e){return i[e]});return this.points=[].concat(t).concat(a).concat(n),i.toString()!==a.toString()}},e}(),colors=["ba27ff","00f5c7","00b34a","c2abff","e00000","00afc0","ffc900","d0d2d3","0082ff","ffab7a","ff5519","940081","00ff00","bac200","ff3bcc","f19ec2","fffbd1","9a8479","ffff00","00cfff","585858"],back_ground_colors={white:"background_white",hot:"background_hot",cool:"background_cool"};App.front_mypages={edit:function(){this.ajax_load(),App.concerns.departments_modal_selection("#department_selection","#departments",100),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},edit_user:function(){this.ajax_load(),App.concerns.departments_modal_selection("#department_selection","#departments",100),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},edit_my_business_card:function(){function e(){var e=$("#exchange-short-url").val()||"",t=$("#exchange-normal-url").val()||"";$("#use-short-url").prop("checked")?($("#exchange_url").val(e),$("#qr-code-download").attr("href",$("#short-qr-download-url").val())):($("#exchange_url").val(t),$("#qr-code-download").attr("href",$("#qr-download-url").val()))}function t(){var e=$("#user-id").val();$.ajax({url:"/xhr/users/"+e+"/update_use_short_url_flg",type:"POST",dataType:"json",data:{use_short_url_flg:$("#use-short-url").prop("checked"),user_id:e}})}this.ajax_load(),this.add_copy_btn_onclick(),this.addQrCodeDownloadBtnOnclick(),this.addMeetingBgDownloadBtnOnclick(),this.removeModalEffect(),$("a.my-business-card-name.active").on("click",function(){return!1}),$("#my-business-card-modal").on("show.bs.modal",function(e){$("#my_business_card_error_message").empty(),$("#my_business_card_title",this).val($(e.relatedTarget).data("title")),$("form",this).prop("action",$(e.relatedTarget).data("path")),$("#my-business-card-modal-title",this).text($(e.relatedTarget).data("modal-title"))}),$(".hp-tooltip").tooltip({container:"body",trigger:"hover",html:"true"}),$(".hp-tooltip").on("click",function(){$(this).tooltip("destroy")}),$("#use-short-url").on("change",function(){e(),t()}),e()},edit_password:function(){this.ajax_load(),this.copy_setup_key_onclick()},edit_mailer:function(){this.ajax_load()},zapier_integration:function(){App.front_mypages.set_side_menu_status("#edit_external_coordination")},zapier_integration_help:function(){App.front_mypages.set_side_menu_status("#edit_external_coordination")},edit_external_coordination:function(){this.ajax_load()},external_coordination:function(){this.active_link_change("external_coordination"),this.ajax_load()},edit_client_news:function(){this.ajax_load(),this.chatwork_notification_by_check($("#user_chat_work_notification"),$("#user_business_partner_news_chatwork_room_id")),this.teams_notification_by_check($("#user_teams_notification"),$("#user_business_partner_news_teams_channel_id")),this.client_news_click_chatwork_notification($("#user_chat_work_notification"),$("#user_business_partner_news_chatwork_room_id")),this.client_news_click_teams_notification($("#user_teams_notification"),$("#user_business_partner_news_teams_channel_id")),$("#open-associated-client").on("click",function(){var e,t,n="";e=$("#favorite_client_ids").val()?$("#favorite_client_ids").val():"","object"!=typeof(t=$("#favorite_client_ids").val())&&(t=t.split(",")),t&&jQuery.each(t,function(){n+="&exclude_ids[]="+this}),$.ajax({url:"/xhr/clients/search_modal",data:"utf8=\u2713&select_type=multiple&client_id="+e+n})}),App.concerns.select_search_name("favorite_client_ids"),App.concerns.set_tooltip_to_select_search_client("favorite_client_ids"),this.set_associate_entities_to_s2("#favorite_client_ids")},edit_sales_work_news:function(){this.ajax_load(),this.chatwork_notification_by_check($("#user_chat_work_notification"),$("#user_sales_activity_news_chatwork_room_id")),this.sales_news_click_chatwork_notification($("#user_chat_work_notification"),$("#user_sales_activity_news_chatwork_room_id")),this.teams_notification_by_check($("#user_teams_notification"),$("#user_sales_activity_news_teams_channel_id")),this.client_news_click_teams_notification($("#user_teams_notification"),$("#user_sales_activity_news_teams_channel_id")),App.concerns.select_search("favorited_user_ids")},edit_access_authority:function(){this.ajax_load()},edit_data_output:function(){this.ajax_load(),this.set_disabled_export_authority_type()},edit_function_utilization:function(){this.ajax_load()},edit_default_value_setting:function(){this.ajax_load(),this.init_select_roles(),App.concerns.select_search("confirmation_user_ids"),App.concerns.select_search("default_set_task_observer_ids"),App.concerns.select_search("default_incomplete_task_observer_ids"),App.concerns.select_search("common_tag_group_ids"),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection",!0),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags"),$("#user_default_display_dashboard_id").select2({width:"100%",allowClear:!0}),$("#user_thanks_mail_mail_template_id").select2({width:"100%",allowClear:!0}),$("#user_meeting_report_mail_mail_template_id").select2({width:"100%",allowClear:!0}),$("#user_default_exchange_lead_source_id").select2({width:"100%",allowClear:!0}),App.front_segments.set_segment_select2("#user_default_segment_id"),$("#user_users_default_deals_status_kbns").select2({width:"100%",allowClear:!0}),App.front_segments.change_segment_icon("#user_default_segment_id")},edit_external_coordination_setting:function(){this.ajax_load()},edit_my_hot_lead_notification:function(){this.ajax_load(),this.chatwork_notification_by_check($("#user_chat_work_notification"),$("#user_my_hot_lead_notification_chatwork_room_id")),this.my_hot_lead_notification_click_chatwork_notification($("#user_chat_work_notification"),$("#user_my_hot_lead_notification_chatwork_room_id")),this.teams_notification_by_check($("#user_teams_notification"),$("#user_my_hot_lead_notification_teams_channel_id")),this.client_news_click_teams_notification($("#user_teams_notification"),$("#user_my_hot_lead_notification_teams_channel_id")),$("#open_exclude_client").on("click",function(){var e,t,n="";e=$("#exclude_client_ids").val()?$("#exclude_client_ids").val():"","object"!=typeof(t=$("#exclude_client_ids").val())&&(t=t.split(",")),t&&jQuery.each(t,function(){n+="&exclude_ids[]="+this}),$.ajax({url:"/xhr/clients/search_modal",data:"utf8=\u2713&select_type=multiple&client_id="+e+n})}),App.concerns.select_search("page_group_ids"),App.concerns.select_search("exclude_client_ids"),this.set_associate_entities_to_s2("#exclude_client_ids")},password:function(){this.active_link_change("password"),this.ajax_load()},client_news_click_chatwork_notification:function(e,t){e.on("click",function(){App.front_mypages.chatwork_notification_by_check(e,t)})},
sales_news_click_chatwork_notification:function(e,t){e.on("click",function(){App.front_mypages.chatwork_notification_by_check(e,t)})},set_link_menu_inner_move:function(e){e.on("click",function(){App.front_mypages.set_side_menu_status("#edit_external_coordination")})},my_hot_lead_notification_click_chatwork_notification:function(e,t){e.on("click",function(){App.front_mypages.chatwork_notification_by_check(e,t)})},set_disabled_export_authority_type:function(){var e=function(){$("input[name='user[csv_flg]']:eq(1)").prop("checked")?($("input[name='user[export_authority_type]']").prop("disabled",!0),$("input[name='user[export_authority_type]']").prop("checked",!1)):$("input[name='user[export_authority_type]']:eq(0)").prop("checked")||$("input[name='user[export_authority_type]']:eq(1)").prop("checked")||($("input[name='user[export_authority_type]']").prop("disabled",!1),$("input[name='user[export_authority_type]']").val(["owned_data"]))};$("input[name='user[csv_flg]']").on("change",e),e()},edit_notice_by_function:function(){this.ajax_load(),this.chatwork_notification_by_check($("#user_business_card_scanned_chatwork_flg"),$("#user_business_card_scanned_chatwork_room_id")),this.chatwork_notification_by_check($("#user_comment_notification_chatwork_flg"),$("#user_comment_notification_chatwork_room_id")),this.chatwork_notification_by_check($("#user_deals_comment_notification_chatwork_flg"),$("#user_deals_comment_notification_chatwork_room_id")),this.chatwork_notification_by_check($("#user_confirmation_notification_chatwork_flg"),$("#user_confirmation_notification_chatwork_room_id")),this.chatwork_notification_by_check($("#user_set_task_chatwork_flg"),$("#user_set_task_chatwork_room_id")),this.chatwork_notification_by_check($("#user_incomplete_task_chatwork_flg"),$("#user_incomplete_task_chatwork_room_id")),this.chatwork_notification_by_check($("#user_inside_sales_deadline_chatwork_flg"),$("#user_inside_sales_deadline_chatwork_room_id")),this.chatwork_notification_by_check($("#user_inside_sales_re_approach_chatwork_flg"),$("#user_inside_sales_re_approach_chatwork_room_id")),this.chatwork_notification_by_check($("#user_reapproach_deal_chatwork_flg"),$("#user_reapproach_deal_chatwork_room_id")),this.chatwork_notification_by_check($("#user_online_my_business_card_chatwork_flg"),$("#user_online_my_business_card_chatwork_room_id")),this.chatwork_notification_by_check($("#user_next_step_notification_chatwork_flg"),$("#user_next_step_notification_chatwork_room_id")),this.click_chatwork_notification($("#user_business_card_scanned_chatwork_flg"),$("#user_business_card_scanned_chatwork_room_id")),this.click_chatwork_notification($("#user_comment_notification_chatwork_flg"),$("#user_comment_notification_chatwork_room_id")),this.click_chatwork_notification($("#user_deals_comment_notification_chatwork_flg"),$("#user_deals_comment_notification_chatwork_room_id")),this.click_chatwork_notification($("#user_confirmation_notification_chatwork_flg"),$("#user_confirmation_notification_chatwork_room_id")),this.click_chatwork_notification($("#user_set_task_chatwork_flg"),$("#user_set_task_chatwork_room_id")),this.click_chatwork_notification($("#user_incomplete_task_chatwork_flg"),$("#user_incomplete_task_chatwork_room_id")),this.click_chatwork_notification($("#user_inside_sales_deadline_chatwork_flg"),$("#user_inside_sales_deadline_chatwork_room_id")),this.click_chatwork_notification($("#user_inside_sales_re_approach_chatwork_flg"),$("#user_inside_sales_re_approach_chatwork_room_id")),this.click_chatwork_notification($("#user_reapproach_deal_chatwork_flg"),$("#user_reapproach_deal_chatwork_room_id")),this.click_chatwork_notification($("#user_online_my_business_card_chatwork_flg"),$("#user_online_my_business_card_chatwork_room_id")),this.click_chatwork_notification($("#user_next_step_notification_chatwork_flg"),$("#user_next_step_notification_chatwork_room_id")),this.teams_notification_by_check($("#user_business_card_scanned_teams_flg"),$("#user_business_card_scanned_teams_channel_id")),this.teams_notification_by_check($("#user_comment_notification_teams_flg"),$("#user_comment_notification_teams_channel_id")),this.teams_notification_by_check($("#user_confirmation_notification_teams_flg"),$("#user_confirmation_notification_teams_channel_id")),this.teams_notification_by_check($("#user_set_task_teams_flg"),$("#user_set_task_teams_channel_id")),this.teams_notification_by_check($("#user_incomplete_task_teams_flg"),$("#user_incomplete_task_teams_channel_id")),this.teams_notification_by_check($("#user_reapproach_deal_teams_flg"),$("#user_reapproach_deal_teams_channel_id")),this.teams_notification_by_check($("#user_inside_sales_deadline_teams_flg"),$("#user_inside_sales_deadline_teams_channel_id")),this.teams_notification_by_check($("#user_inside_sales_re_approach_teams_flg"),$("#user_inside_sales_re_approach_teams_channel_id")),this.teams_notification_by_check($("#user_online_my_business_card_teams_flg"),$("#user_online_my_business_card_teams_channel_id")),this.teams_notification_by_check($("#user_next_step_notification_teams_flg"),$("#user_next_step_notification_teams_channel_id")),this.client_news_click_teams_notification($("#user_business_card_scanned_teams_flg"),$("#user_business_card_scanned_teams_channel_id")),this.client_news_click_teams_notification($("#user_comment_notification_teams_flg"),$("#user_comment_notification_teams_channel_id")),this.client_news_click_teams_notification($("#user_confirmation_notification_teams_flg"),$("#user_confirmation_notification_teams_channel_id")),this.client_news_click_teams_notification($("#user_set_task_teams_flg"),$("#user_set_task_teams_channel_id")),this.client_news_click_teams_notification($("#user_incomplete_task_teams_flg"),$("#user_incomplete_task_teams_channel_id")),this.client_news_click_teams_notification($("#user_reapproach_deal_teams_flg"),$("#user_reapproach_deal_teams_channel_id")),this.client_news_click_teams_notification($("#user_inside_sales_deadline_teams_flg"),$("#user_inside_sales_deadline_teams_channel_id")),this.client_news_click_teams_notification($("#user_inside_sales_re_approach_teams_flg"),$("#user_inside_sales_re_approach_teams_channel_id")),this.client_news_click_teams_notification($("#user_online_my_business_card_teams_flg"),$("#user_online_my_business_card_teams_channel_id")),this.client_news_click_teams_notification($("#user_next_step_notification_teams_flg"),$("#user_next_step_notification_teams_channel_id")),this.teams_notification_by_check($("#user_deals_comment_notification_teams_flg"),$("#user_deals_comment_notification_teams_channel_id")),this.client_news_click_teams_notification($("#user_deals_comment_notification_teams_flg"),$("#user_deals_comment_notification_teams_channel_id"))},chatwork_notification_by_check:function(e,t){t.prop("disabled",!e.prop("checked"))},click_chatwork_notification:function(e,t){e.on("click",function(){App.front_mypages.chatwork_notification_by_check(e,t),App.front_mypages.mail_or_chatwork_by_check()})},mail_or_chatwork_by_check:function(){$("#user_chat_work_notification").prop("checked")||$("#user_mail_notification").prop("checked")?($("#user_enables").prop("disabled",!1),App.front_mypages.disable_notification_by_check()):($("#user_enables").prop("disabled",!0),$("#favorite_client_ids").addClass("favorite_notification"),$("#favorited_user_ids").addClass("favorite_notification"),$(".favorite_notification").prop("disabled",!0),$("#open-associated-client").addClass("disabled"),$(".js_modal_search_users_caller_btn").addClass("disabled"))},chatwork_notification_by_check:function(e,t){t.prop("disabled",!e.prop("checked"))},ajax_load:function(){load=$("<div>"),inner_load=$("<div>"),load_css={width:"100%",height:"100%","z-index":"9999",position:"fixed","background-color":"#F0F0F0",opacity:"0.6",display:"none"},load.attr("id","loading"),load.css(load_css),inner_load.attr("id","inner_loading"),inner_load.css(load_css),inner_load.css({position:"absolute","z-index":"1000"}),spinner=$("<div>"),inner_spinner=$("<div>"),spinner_css={"font-size":"8px",top:"50%",left:"50%",width:"1em",height:"1em","border-radius":"50%","text-indent":"-9999em","-webkit-animation":"load5 1.1s infinite ease",animation:"load5 1.1s infinite ease","-webkit-transform":"translateZ(0)","-ms-transform":"translateZ(0)",transform:"translateZ(0)",position:"relative"},spinner.attr("id","spinner"),spinner.css(spinner_css),inner_spinner.attr("id","inner_spinner"),inner_spinner.css(spinner_css),load.append(spinner),inner_load.append(inner_spinner),$("#loading").length||$("html").prepend(load),$("#inner_loading").length||$("#edit_main").prepend(inner_load),$("#edit_main").on("ajax:before",function(){$(".btn").prop("disabled",!0),$("#loading").show()}),$("#edit_main").on("ajax:complete",function(){$(".btn").prop("disabled",!1),$("#loading").hide()}),$("#side_menu").on("ajax:before",function(){$("#inner_loading").length||$("#edit_main").prepend(inner_load),$(".btn").prop("disabled",!0),$("#inner_loading").show()}),$("#side_menu").on("ajax:success",function(){$(".btn").prop("disabled",!1),$("#inner_loading").hide()}),$("#side_menu").on("ajax:error",function(){$(".btn").prop("disabled",!1),$("#inner_loading").hide(),$("div#alert-message").html('        <div class="row">          <div class="col-xs-12">            <div class="alert alert-danger alert-error alert-dismissible" role="alert">              <button type="button" class="close" data-dismiss="alert" aria-label="Close">                <span aria-hidden="true">&times;</span>              </button>              <ul>                <li style="word-wrap: break-word;">'+I18n.t("js.common.screen_failed")+"</li>              </ul>            </div>          </div>        </div>")}),$("a.side-menu-items.active").on("click",function(){return!1}),$("#user_client_news_delivery_flg").on("click",function(){$(".client_news_target_kbn_input").prop("disabled",!$("#user_client_news_delivery_flg").is(":checked"))}),$("#user_favorite_client_notification_flg").on("click",function(){$('input[name="user[favorite_client_notification_level]"]').prop("disabled",!$("#user_favorite_client_notification_flg").is(":checked"))}),$("#user_favorite_user_notification_flg").on("click",function(){$(".notification_status").prop("disabled",!$("#user_favorite_user_notification_flg").is(":checked"))})},set_side_menu_status:function(e){$(e).hasClass("active")||($("a.side-menu-items.active").off("click"),$("a.side-menu-items.active").removeClass("active"),$(e).addClass("active"),$("a.side-menu-items.active").on("click",function(){return!1}))},active_link_change:function(e){$("#edit_user").removeClass("active"),$("#edit_"+e).addClass("active")},set_associate_entities_to_s2:function(t){$(document).off("click","#clients_multiple_decision"),$(document).on("click","#clients_multiple_decision",function(){var n=jQuery.map($('input[name="associate_clients[]"]:checked'),function(e){return $(e).val()});if(0==n.length)return alert(I18n.t("js.common.please_select")),!1;n.push.apply(n,jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value})),$.ajax({url:"/xhr/clients/existence/",type:"POST",dataType:"json",data:{ids:n},context:$(this)}).done(function(e){e.does_not_exist_ids.length&&jQuery.each(e.does_not_exist_ids,function(e,t){n=jQuery.grep(n,function(e){return e!=t})}),$(t).val(n).trigger("change"),$(t).select2("open"),$(t).select2("close"),$(this).closest(".modal").modal("hide")})})},add_copy_btn_onclick:function(){$("#copy_exchange_url").on("click",function(){$("#exchange_url").select(),document.execCommand("copy"),$("#alert-message").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-success alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul>        <li>\u30b3\u30d4\u30fc\u3057\u307e\u3057\u305f\u3002</li>      </ul>    </div>  </div></div>')})},copy_setup_key_onclick:function(){$(".copyable-text").tooltip({trigger:"hover",placement:"right"});var e=new Clipboard(".copyable-text"),t=$(".copyable-text").data("original-title");e.on("success",function(e){$(e.trigger).attr("data-original-title",t).tooltip("hide")})},addQrCodeDownloadBtnOnclick:function(){$("#qr-code-download").on("click",function(e){$("[data-web-card-present='false']").length&&(e.preventDefault(),$("#alert-message").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">&times;</span>      </button>      <ul>        <li style="word-wrap: break-word;">QR\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u300cURL\u518d\u767a\u884c\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002</li>      </ul>    </div>  </div></div>'))})},addMeetingBgDownloadBtnOnclick:function(){$("#meeting_bg_download").on("click",function(e){$("[data-web-card-present='false']").length&&(e.preventDefault(),$("#alert-message").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">&times;</span>      </button>      <ul>        <li style="word-wrap: break-word;">QR\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u300cURL\u518d\u767a\u884c\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002</li>      </ul>    </div>  </div></div>'))})},removeModalEffect:function(){$(".modal-backdrop.fade.in").remove(),$("body").removeClass("modal-open").prop("style","")},changeClient:function(){$("#favorite_client_ids").on("change",function(){$(".tooltip").tooltip("hide")})},teams_notification_by_check:function(e,t){t.prop("disabled",!e.prop("checked"))},client_news_click_teams_notification:function(e,t){e.on("click",function(){App.front_mypages.teams_notification_by_check(e,t)})},init_select_roles:function(){$("#role_ids").select2({width:"100%"}),$("#add_user_role").on("click",function(){$.ajax({url:"/xhr/users/user_role_all/",type:"POST",data:{user_role_ids:$("#role_ids").val()},dataType:"json",context:$(this)}).done(function(e){0<e.role_user_ids.length&&($("#role_ids").select2("data",e.role_user_ids),$("#role_ids").select2("open"),$("#role_ids").select2("close"))})})}},App.new_notifications={set_favicon:function(){var i=$("#js_unread_notifications_num").data("unread_notifications_num");if(0<i){var a=document.createElement("canvas");a.width=32,a.height=33;var s=new Image;s.src="/favicon.ico",$.event.add(window,"load",function(){var e=a.getContext("2d");if(e.drawImage(s,0,0),e.fillStyle="#f00",e.font="bold 18px 'helvetica'",9<i){e.fillRect(2,15,29,20);var t=7}else{e.fillRect(14,15,29,20);t=18}e.fillStyle="#fff",e.fillText(i,t,30);var n=a.toDataURL();$(".js_favicon").attr("href",n)})}}},App.next_steps={init_next_step_modal:function(){$("select.select2_form").select2({width:"100%"}),$("select.input_segment_id").select2({width:"320px"}),$(".condtion_row").find("select.input_condition_key").select2({width:"320px"}),$(".condition_key_field").find("select.input_condition_key").select2(),$(".select2-container.condition-key-tooltip").attr("data-html",!0),$(document).off("change",".next_step_tab"),$(document).on("change",".next_step_tab",function(){if($input=$($(this).find("input")[0]),$(".next_step_tab.active").removeClass("active"),$(this).addClass("active"),$(this).hasClass("add_tab"))App.next_steps.add_field_on_ajax($input);else{var e=$input.data().value;$(".fields.active").removeClass("active"),$("#next_step_field_"+e).addClass("active")}}),$(document).off("change",".input_segment_id"),$(document).on("change",".input_segment_id",function(){App.next_steps.get_client_rank_field(this)}),$(document).off("change",".input_condition_key"),$(document).on("change",".input_condition_key",function(){var e=$(this).parents(".condtion_row").find(".condition_notice");"hot"==$(this).val()?(e.find(".condition_notice_delay").addClass("hidden"),e.find(".condition_notice_immediate").removeClass("hidden")):"reaction"==$(this).val()?(e.find(".condition_notice_delay").removeClass("hidden"),e.find(".condition_notice_immediate").addClass("hidden")):""!=$(this).val()?(e.find(".condition_notice_delay").addClass("hidden"),e.find(".condition_notice_immediate").removeClass("hidden")):(e.find(".condition_notice_delay").addClass("hidden"),e.find(".condition_notice_immediate").addClass("hidden"));var t=$(this).parents(".condition_line").find(".input_condition_value"),n=$(this).parents(".condition_line").find(".input_condition_pattern");if(t.length)if($(this).val()){var i=$("option:selected",this).val();App.next_steps.set_field_for_web_form(i,t,$(this))}else t.addClass("hidden"),n.addClass("hidden");$(this).attr("data-original-title",App.next_steps.broken_tooltip_label($("option:selected",this).text())),$(this).parents(".condition_key_field").find(".select2-container.condition-key-tooltip").attr("data-original-title",App.next_steps.broken_tooltip_label($("option:selected",this).text())),$(".select2-container.condition-key-tooltip").attr("data-html",!0),$(".condition-key-tooltip").tooltip("hide"),$(".condition-key-tooltip").tooltip()}),$(document).off("change",".client_rank_condition_check_box"),$(document).on("change",".client_rank_condition_check_box",function(){var e=$(this).parents(".field").find(".client_rank_condition_row");$(this).prop("checked")?e.removeClass("hidden"):e.addClass("hidden"),e.find(".select2_form").val(null).trigger("change"),e.find(".input_client_rank_condition_type>select").val("1")}),$(".mail-flg-tooltip").tooltip("hide"),$(".mail-flg-tooltip").tooltip(),$(".condition-key-tooltip").tooltip("hide"),$(".condition-key-tooltip").tooltip(),$(document).off("change",".to_step_model_select"),$(document).on("change",".to_step_model_select",function(){App.next_steps.get_detail_select_field(this)}),$(document).off("click",".next_step_delete_btn"),$(document).on("click",".next_step_delete_btn",function(){App.next_steps.next_step_delete_btn(this)})},add_condition:function(e){var t=$(e).parents(".input_condition").find(".condition_field .row.hidden");if(t.length)t.removeClass("hidden");else{var n=$(e).data("value"),i=$(e).closest(".input_condition").find(".condition_field");i.find("select").select2("destroy");var a=i.find(".row")[0],s=$(a).clone(),o=s.find(".input_condition_key").attr("id").split("_").slice(0,-1);o.push(n);var r=o.join("_");s.find(".input_condition_key").attr("id",r);var l=s.find(".input_condition_key").attr("name").split("]").slice(0,-2);l.push("["+n+"]");var c=l.join("]");s.find(".input_condition_key").attr("name",c),s.find(".input_condition_key").attr("data-selector-id-index",parseInt(n));var d=s.find(".input_condition_value").attr("id").split("_").slice(0,-1);d.push(n);var u=d.join("_");s.find(".input_condition_value").attr("id",u);var _=s.find(".input_condition_value").attr("name").split("]").slice(0,-3);_.push("["+n+"][]");var h=_.join("]");s.find(".input_condition_value").attr("name",h);var p=s.find(".input_condition_pattern").attr("id").split("_").slice(0,-1);p.push(n);var f=p.join("_");s.find(".input_condition_pattern").attr("id",f);var m=s.find(".input_condition_pattern").attr("name").split("]").slice(0,-2);m.push("["+n+"]");var g=m.join("]");s.find(".input_condition_pattern").attr("name",g),s.find("option").attr("selected",!1),s.find(".input_condition_value").val(""),s.find(".input_condition_value").addClass("hidden"),s.find(".input_condition_pattern").addClass("hidden"),i.append(s),$(".condtion_row").find("select.input_condition_key").select2({width:"320px"}),$(".condition_key_field").find("select.input_condition_key").select2(),$(".input_field_for_web_form").find("select.input_condition_value").select2(),i.find("select").each(function(){$(this).parents(".condition_key_field").find(".select2-container.condition-key-tooltip").attr("data-original-title",App.next_steps.broken_tooltip_label($("option:selected",this).text())),$(this).attr("data-original-title",App.next_steps.broken_tooltip_label($("option:selected",this).text()))}),$(".select2-container.condition-key-tooltip").attr("data-html",!0);var A=parseInt($(e).data("value"))+1;$(e).data("value",A),$(".condition-key-tooltip").tooltip("hide"),$(".condition-key-tooltip").tooltip()}},remove_condition:function(e){1<$(e).closest(".condition_field").find(".row").length?$(e).closest(".row").remove():($row=$(e).closest(".row"),$row.find("select").select2("destroy"),$row.find("option").attr("selected",!1),$row.find("select").select2(),$row.find(".condition-key-tooltip").attr("data-original-title",App.next_steps.broken_tooltip_label($("option:selected",$row.find(".input_condition_key")).text())),$row.find(".input_condition_value").val(""),$row.find(".input_condition_value").addClass("hidden"),$row.find(".input_condition_pattern").addClass("hidden"),$(".condition-key-tooltip").tooltip("hide"),$(".condition-key-tooltip").tooltip(),$row.addClass("hidden"))},get_detail_select_field:function(e){var t=$(".fields.active").data().value;$("#next_step_field_"+t).find(".detail_select_field").html(""),e.value&&($(".to_step_model_select").prop("disabled",!0),$(".next_step_tab").css("pointer-events","none"),$.ajax({url:"/xhr/next_steps/detail_select_field",type:"GET",dataType:"json",data:{from_stepable_type:$("#from_stepable_type").val(),from_stepable_id:$("#from_stepable_id").val(),to_step_model_name:e.value,tab_index:t,segment_id:$("select.input_segment_id").val()}}).done(function(e){e.detail_select_field&&$("#next_step_field_"+e.tab_index).find(".detail_select_field").html(e.detail_select_field),App.next_steps.init_next_step_modal(),App.concerns.attach_select_search_handlers($("#next_step_field_"+e.tab_index).find(".detail_select_field"))}).fail(function(e){console.log(e.status),500===e.status&&alert(I18.t("js.common.occurred_error"))}),$(".to_step_model_select").prop("disabled",!1),$(".next_step_tab").css("pointer-events",""))},get_client_rank_field:function(e){var t=$(".fields.active").data().value;$("#next_step_field_"+t).find(".deals_client_rank_condition_wrapper").html(""),$("#companies_deals_next_step_next_steps_attributes_"+t+"_to_stepable_type option[value='LeadStage']").remove(),$("#companies_deals_next_step_next_steps_attributes_"+t+"_to_stepable_type").val(""),$("#next_step_field_"+t).find(".detail_select_field").html(""),e.value&&($(".to_step_model_select").prop("disabled",!0),$(".next_step_tab").css("pointer-events","none"),$.ajax({url:"/xhr/next_steps/get_client_rank_field",type:"GET",dataType:"json",data:{from_stepable_type:$("#from_stepable_type").val(),from_stepable_id:$("#from_stepable_id").val(),segment_id:e.value,tab_index:t}}).done(function(e){e.client_rank_field&&$("#next_step_field_"+e.tab_index).find(".deals_client_rank_condition_wrapper").html(e.client_rank_field),e.recycle_stage&&$("#companies_deals_next_step_next_steps_attributes_"+e.tab_index+"_to_stepable_type").append("<option value='LeadStage'>"+e.recycle_stage+"</option>"),App.next_steps.init_next_step_modal()}).fail(function(e){console.log(e.status),500===e.status&&alert(I18.t("js.common.occurred_error"))}),$(".to_step_model_select").prop("disabled",!1),$(".next_step_tab").css("pointer-events",""))},activate_first_tab:function(e){e||(e=""),$(".next_step_tab").removeClass("active"),$(".fields").removeClass("active");var t=$($(".next_step_tab"+e)[0]);t.addClass("active");var n=t.find("input").data("value");$("#next_step_field_"+n).addClass("active")},add_field_on_ajax:function(e){$(".add_tab").addClass("disabled");var t=e.data().value,n=e.data().action,i={from_stepable_type:$("#from_stepable_type").val(),from_stepable_id:$("#from_stepable_id").val(),tab_index:t};$.ajax({url:n,type:"GET",dataType:"json",data:i}).done(function(e){e.tab&&e.field&&($("#next_step_modal div.add-tab-li").remove(),$("#next_step_modal div.row.nav-tabs").append(e.tab),$("#next_step_modal .fields").removeClass("active"),$("#next_step_modal #next_step_form_field").append(e.field),20<=$("#next_step_modal .persisted_tab,.new_tab").length&&$("#next_step_modal div.add-tab-li").addClass("hidden")),App.next_steps.init_next_step_modal()}).fail(function(e){console.log(e.status),500===e.status&&alert(I18.t("js.common.occurred_error")),App.next_steps.activate_first_tab()}),$(".add_tab").removeClass("disabled")},next_step_delete_btn:function(e){return $btn=$(e),data=$btn.data(),!!data&&(confirmation=window.confirm(data.confirmation),!!confirmation&&void(data.id?App.next_steps.delete_field_on_ajax($btn):App.next_steps.remove_tab()))},remove_tab:function(){var e=$(".fields.active"),t=e.next("input[type='hidden']");t.length&&t.attr("id")&&(parseInt(e.data().value)==t.attr("id").split("_").slice(-2)[0]&&t.remove());$(".next_step_tab.active").parent("div").remove(),e.remove(),$("#next_step_modal div.add-tab-li.hidden").removeClass("hidden"),$(".next_step_tab").not(".add_tab").length?App.next_steps.activate_first_tab():($input=$(".add_tab input"),App.next_steps.add_field_on_ajax($input))},delete_field_on_ajax:function(e){var t=e.data().action,n=$("#from_stepable_type").val(),i=$("#from_stepable_id").val(),a={from_stepable_type:n,from_stepable_id:i,id:e.data().id};$.ajax({url:t,type:"DELETE",data:a}).done(function(){App.next_steps.reload_workflow_index_field(".workflow_index_to_wrapper",n,i),App.next_steps.remove_tab()}).fail(function(e){console.log(e.status),500===e.status&&alert(I18.t("js.common.occurred_error"))})},set_work_flow_load_more:function(n){$(document).off("click",n),$(n).on("click",function(){for(var e=10;0<e;){var t=$(".work_flow_record_field.hide")[0];if(!t)break;$(t).removeClass("hide"),e--}$(".work_flow_record_field.hide")[0]||$(n).closest(".row").remove()})},reload_workflow_index_field:function(e,t,n){$selector=$(e),$selector.find(".work_flow_to_record_field_wrapper").html('<div class="set_center"><span class="fa fa-spinner fa-pulse fa-lg loading"></span><div>'),$.ajax({url:"/xhr/next_steps/reload_workflow_index_field",type:"GET",dataType:"json",data:{from_stepable_type:t,from_stepable_id:n}}).done(function(e){$selector.html(e.field),$selector.find(".next_steps_edit_button_for_blank").length?$(".next_steps_edit_button").addClass("hidden"):$(".next_steps_edit_button").removeClass("hidden"),$selector.find(".step-user-tooltip").tooltip({container:"body",trigger:"hover"}),App.next_steps.set_work_flow_load_more("#work_flow_load_more_link")})},set_workflow_index_tooltip:function(){$(".step-user-tooltip").tooltip({container:"body",trigger:"hover"})},set_field_for_web_form:function(e,t,n){var i=$(".fields.active").data().value,a=n.parents(".condition_line").find(".input_field_for_web_form");$.ajax({url:"/xhr/next_steps/set_field_for_web_form",type:"GET",dataType:"json",data:{condition_key:e,from_stepable_type:$("#from_stepable_type").val(),from_stepable_id:$("#from_stepable_id").val(),selector_id_index:n.data("selector-id-index"),tab_index:i}}).done(function(e){a.html(e.field),e.choices_flg?(a.find(".input_condition_value").select2(),n.parents(".condition_line").find(".input_condition_pattern").removeClass("hidden"),n.parents(".condition_line").find(".input_condition_pattern").prop("disabled",!1)):(n.parents(".condition_line").find(".input_condition_pattern").addClass("hidden"),n.parents(".condition_line").find(".input_condition_pattern").prop("disabled",!0)),a.find(".input_condition_value").removeClass("hidden")})},broken_tooltip_label:function(e){var t=70,n=Math.floor(e.length/t),i=e;if(0<n){for(var a=[],s=0;s<e.length/t;s++)a.push(e.substr(s*t,t));var o=[];$.each(a,function(e,t){e<n?o.push(t+"<br>"):o.push(t)}),i=o.join("")}return i}},App.front_notifications={index:function(){App.front_deals.all_checked_items_modal_deals_index(),App.concerns.open_mailer();var n=new App.concerns.loading_indicator($(".side-menu-main"),{spin_area:"notification-loading-spinner"}),i={done:function(e){var t=$(".side-menu-items.active").text().trim(),n=new RegExp("<h4>"+t+"</h4>");e.match(n)&&$targetSection.trigger("reload",e)}};this.initialize_side_bar(n,i),$("#notificationFromAdminList").on("reload",function(e,t){$(this).html(t),$(document).off("click",".delete-button"),App.front_notification_from_admins.index(),App.front_notifications.reload_html($(this),n,i)}),$("#notificationList").on("reload",function(e,t){$(this).html(t),$(window).scrollTop(0),App.front_notifications.initialize_notification_list($(this)),App.front_notifications.reload_html($(this),n,i)}),$(document.location.hash||"#recentTopic").tab("show")},initialize_side_bar:function(t,n){$('.side-menu-nav a[data-toggle="tab"]').on("shown.bs.tab",function(e){$targetSection=$($(e.target).attr("href")),t.ajax({url:$targetSection.data("hp-source"),type:"GET",data:{notification_type:$(e.target).attr("id"),display_number:$targetSection.find("#display_number").val()}},n)})},reload_html:function(e,t,n){e.find("[data-hp-role='reloadPage'] a").on("click",function(e){return"#"==$(this).attr("href")||(e.preventDefault(),t.ajax(this.href,n)),!1}),e.find("form[data-hp-role='reloadForm']").on("submit",function(e){return e.preventDefault(),t.ajax({url:this.action,method:this.method,data:$(this).serialize()},n),!1})},initialize_notification_list:function(t){t.find("[data-hp-role='notification_link']").on("click",function(){if($link=$(this),$link.addClass("clicked"),$link.data("hp-notification-type")){var e=$link.data();$.ajax({url:t.data("hp-readed-url"),method:"GET",data:{notification_id:e.hpNotificationId,notification_type:e.hpNotificationType,link_type:e.hpLinkType,link_id:e.hpLinkId}})}}),App.concerns.change_display_number("js_form_checked_notifications"),App.concerns.generate_tooptip(t.find(".hp-tooltip-text")),App.concerns.generate_tooptip(t.find(".hp-tooltip"));new Clipboard(".clipboard-btn");App.concerns.focus_to_first_element()}},App.front_notification_from_admins={index:function(){$("#search_notification_from_admins, #clear_search_conditions").on("keydown",function(e){"Enter"===e.key&&($("#js_form_search_notification_from_admins").data("processing",!0),e.preventDefault())}),$(document).on("keydown","#js_form_search_notification_from_admins",function(e){if(13===e.keyCode){e.preventDefault();var t=$(this);if(t.data("processing"))return;t.data("processing",!0),$("#js_form_search_notification_from_admins").submit()}}),App.concerns.change_display_number_for_notification_from_admin("js_form_search_notification_from_admins"),App.concerns.change_order("js_form_search_notification_from_admins"),App.concerns.all_checked_items(),App.concerns.datepicker(".search_datepicker"),App.concerns.set_form_action_to_submit("#js_form_checked_notification_from_admins",".delete-button",!0),App.concerns.select_search_disable_user("q_to_users_id_in"),App.concerns.focus_to_first_element()},"new":function(){App.concerns.select_search("to_user_ids")},create:function(){App.concerns.select_search("to_user_ids")}},App.front_objectives={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_objectives",".js-disable-btn"),App.concerns.change_order("form_search_objectives"),App.concerns.select_search_disable_user("q_id_in"),App.concerns.get_modal_to_search_save("#form_search_objectives"),App.concerns.get_modal_to_search_call("#form_search_objectives"),App.concerns.all_checked_items(),$("#csv_dl_submit").on("click",function(){return action=$("#form_search_objectives").attr("action"),$("#form_search_objectives").attr("action",$(this).data("action")),$("#form_search_objectives").submit(),$("#form_search_objectives").attr("action",action),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_all_dl_flg").val(1),action=$("#form_search_objectives").attr("action"),$("#form_search_objectives").attr("action",$(this).data("action")),$("#form_search_objectives").submit(),$("#form_search_objectives").attr("action",action),!1}),App.concerns.set_float_table_header("table.table-float-head"),App.concerns.add_class_name_to_tooltip($(".department-span"),"department-tooltip")},edit:function(){App.concerns.prevent_submit_pressing_enter()},update:function(){App.concerns.prevent_submit_pressing_enter()}},App.front_operation_histories={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_operation_histories_search",".js-disable-btn"),App.concerns.change_display_number("form_operation_histories_search"),App.concerns.change_order(
"form_operation_histories_search"),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search("search_user_id"),$("#search_controller").select2({allowClear:!0,width:"100%",placeholder:I18n.t("js.operation_histories.function")}),$("#search_action").select2({allowClear:!0,width:"100%",placeholder:I18n.t("js.operation_histories.processing")}),App.concerns.all_checked_items(),App.concerns.enable_csv_export_event("#form_operation_histories_search","checked[operation_history_ids][]"),this.change_form("form_checked_operation_histories"),this.clear_massage()},change_form:function(n){$(".checked_submit").on("click",function(){var e=$(this);if(confirm(e.data("message"))){var t=$("#"+n);t.attr("action",e.data("action")),t.submit()}})},clear_massage:function(){$("#myModal").on("hidden.bs.modal",function(){$(".alert").remove()})}},App.front_organizations={index:function(){""==$.trim($("#organizations_tree").html())&&$("#organizations_tree").html('<div class="text-center" id="spinner"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#form_search_xhr_organizations").submit(),App.concerns.tree_control_enable(".org-tree-controls"),this.tree_filterable(".org-tree-controls");var e=$("#old_client_ids").val();e&&(e=e.split(" ")),$.each(e,function(e,t){""==$.trim($("#old_organization_tree_"+t).html())&&$("#old_organization_tree_"+t).html('<div class="text-center" id="spinner"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#form_search_xhr_organizations_"+t).submit(),App.concerns.tree_control_show_more("#old_organization_tree_"+t)}),App.concerns.old_tree_control_enable(e),App.front_organizations.old_tree_filterable(e)},"new":function(){this.non_submit_on_enter(),this.submit_new()},create:function(){this.non_submit_on_enter(),this.submit_new()},edit:function(){this.non_submit_on_enter(),this.submit_edit()},update:function(){this.non_submit_on_enter(),this.submit_edit()},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("form#new_organization").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$("form.edit_organization").submit()})},tree_filterable:function(e){var i="#only_active_lead",a="#show_uncontacted_officers_flg",s="#show_having_business_card_flg";$(e+" "+i+", "+e+" "+a+", "+e+" "+s).on("click",function(){$(i).prop("disabled",!0),$(a).prop("disabled",!0),$(s).prop("disabled",!0);var e=$(i).is(":checked")?1:null,t=$(i).val(),n=$(a).is(":checked")?1:null;show_having_business_card_flg=!!$(s).is(":checked"),$.ajax({url:"/xhr/organizations/"+t,type:"post",data:{search:{lead_status:e,show_having_business_card_flg:show_having_business_card_flg},pagination_id:$("#pagination_id").val(),show_uncontacted_officers_flg:n}})}),$(document).ajaxStop(function(){$(i).prop("disabled",!1),$(a).prop("disabled",!1),$(s).prop("disabled",!1)})},old_tree_filterable:function(e,t){if(t){var o="_in_customer_sheet";click_selector_lead="#only_active_lead_old_org"+o,click_selector_officer="#show_uncontacted_officers_flg_old_org"+o,click_selector_business_card="#show_having_business_card_flg_old_org"+o}else{o="";click_selector_lead="#only_active_lead_old_org",click_selector_officer="#show_uncontacted_officers_flg_old_org",click_selector_business_card="#show_having_business_card_flg_old_org"}$(click_selector_lead+", "+click_selector_officer+", "+click_selector_business_card).on("click",function(){$(click_selector_lead).prop("disabled",!0),$(click_selector_officer).prop("disabled",!0),$(click_selector_business_card).prop("disabled",!0),$("#search_xhr_old_organizations_submit").prop("disabled",!0);var a=$(click_selector_lead).is(":checked")?1:null,s=$(click_selector_officer).is(":checked")?1:null;old_org_show_having_business_card_flg=!!$(click_selector_business_card).is(":checked"),deffer_arr=[],$.each(e,function(e,t){var n=new $.Deferred,i=$("#form_search_xhr_organizations"+o+"_"+t);$("#old_org_lead_status"+o+"_"+t).val(a),$("#show_uncontacted_officers_flg_as_search_condition"+o+"_"+t).val(s),$("#show_having_business_card_flg"+o+"_"+t).val(old_org_show_having_business_card_flg),$("#old_org_tree_flg"+o+"_"+t).val(!0),$("#close_tree_flg"+o+"_"+t).val(""),$.ajax({type:i.prop("method"),url:i.prop("action"),data:i.serialize(),timeout:1e4}).always(function(){n.resolve()}),deffer_arr.push(n.promise())}),$.when.apply($,deffer_arr).then(function(){$(click_selector_lead).prop("disabled",!1),$(click_selector_officer).prop("disabled",!1),$(click_selector_business_card).prop("disabled",!1),$("#search_xhr_old_organizations_submit").prop("disabled",!1)})})},non_submit_on_enter:function(){$("#organization_name").on("keypress",function(e){return 13!==e.which})}},App.front_page_groups={edit:function(){this.init_form()},update:function(){this.init_form()},"new":function(){this.init_form()},create:function(){this.init_form()},init_form:function(){$("[data-hp-role='select2']").select2({minimumResultsForSearch:20,width:"250px"}),App.concerns.focus_to_first_element()}},App.front_products={submit_search_products:function(e,t,n,i,a,s){$("#submit_search_product").prop("disabled",!0),$("#clear-product-condition").prop("disabled",!0);var o=$("#form_search_product :input[type!=tel]").serializeArray().filter(function(e){return e.value}),r=[];o.filter(function(t){r.findIndex(function(e){return e.name==t.name&&e.value==t.value})<=-1&&r.push(t)});var l=$("#per_page_product").val(),c=$.parseJSON($("#display_items_default").val()),d="block"==$("#modalContractPeriod").css("display");r.push({name:"display_template_id",value:t}),r.push({name:"page",value:n||1}),r.push({name:"per_page",value:l}),r.push({name:"field_sort",value:i}),r.push({name:"direct_sort",value:a}),r.push({name:"render_with_radio_box",value:d}),r.push({name:"sort_init",value:s}),r.push({name:"display_detail_master_items",value:c}),$.ajax({url:e,type:"POST",dataType:"script",data:r})},reset_form_search_product:function(){$("#form_search_product input").val(""),$("#form_search_product .search_items_select2").select2("val",""),$("#form_search_product .select2-offscreen").select2("val",""),$("#submit_search_product").click()},show_modal_product:function(){$(document).ready(function(){$("#product-all-check").click(function(){$(".product-check-items").prop("checked",$(this).is(":checked"))}),$(".add_nested_fields").on("click",function(){App.front_deals.show_detail_master_area()})}),$(document).ready(function(){$("#modal_use_master_product").click(function(){$("#segment-result-search-product").html(null),$("#modal_search").modal("show"),App.concerns.datepicker(".search_items_datepicker"),$(".form-search-detail-master .search_items_select2").select2(),0<$("#hidden-input-trigger-for-approach").length&&App.front_products.overwrite_action_close_modal_search_detail_master("modal_search")})})},overwrite_action_close_modal_search_detail_master:function(e){$("#selected_option_modal .modal-new-record .modal-new-wrapper-form #"+e+" .modal-header button").attr("data-dismiss",""),$("#selected_option_modal .modal-new-record .modal-new-wrapper-form #"+e+" .modal-footer button[type='button']").attr("data-dismiss",""),$("#selected_option_modal .modal-new-record .modal-new-wrapper-form #"+e+" .modal-header button").click(function(){$("#"+e).modal("hide")}),$("#selected_option_modal .modal-new-record .modal-new-wrapper-form #"+e+" .modal-footer button[type='button']").click(function(){$("#"+e).modal("hide")})}},App.front_recommend={recommendScenarios:function(e,t){e=void 0!==e?e:null,t=void 0!==t?t:null,$.ajax({type:"get",url:"/front/xhr/recommend",data:{screenName:e,deal_id:t},success:function(e){0<e.scenarios.length&&App.front_recommend.generateNotificationsRecommend(e.scenarios,t)}})},generateNotificationsRecommend:function(e,t){$(document).on("click",".close_notification",function(e){e.preventDefault(),$(this).closest(".recommend_notification").remove();var t=$(this).data("id");App.front_recommend.updateScenarioViewHistory(t)}),$(document).on("click",".body-notification",function(){var e=$(this).data("id");App.front_recommend.updateScenarioViewHistory(e)});for(var n=0;n<e.length;n++){var i=e[n],a=$('<div class="d-flex justify-content-between recommend recommend_notification"><a href="/hot_recommends/?scenario_id='+i.id+"&default_scenario_flg="+i.default_scenario_flg+"&scenario_type="+i.scenario_type+(t?"&deal_id="+t:"")+'"><div class="d-flex body-notification" data-id="'+i.id+'"><div class="icon-notification"></div><div class="content-notification">'+i.recommendation_text+'</div></div></a><div class="close-notification"><span class="close_notification" data-id="'+i.id+'"> &times; </span></div></div>');$("#js_notifications_recommends").prepend(a)}},updateScenarioViewHistory:function(e){$.ajax({type:"patch",url:"/front/xhr/recommend/"+e,success:function(){console.log("Updated successfully")},error:function(){console.log("Failed to update")}})}},jQuery(document).on("ready reloadReady",function(){if(!($(".merge").size()<1)){var i=10,t={};t.$table=$("#duplicate_list table"),add_merge_methods(t.$table),t.check_box_selector='.merge input[name="ids[]"]',t.switch_alternative_attr_button_status=function(){var e=$(t.check_box_selector+":checked").length;$("#alternative_attr").prop("disabled",e<2),i<=e?$(t.check_box_selector+":not(:checked)").prop("disabled",!0):$(t.check_box_selector+":not(:checked)").prop("disabled",!1)},$(document).on("change",t.check_box_selector,function(){t.switch_alternative_attr_button_status()}),$(document).on("click","#all-check",function(){var n=$(t.check_box_selector+":checked").length;$(this).is(":checked")?$(".check-items").each(function(e,t){if(num=e+1+n,$(t).is(":checked")&&(n-=1),num>i)return!1;$(t).prop("checked",!0)}):$(".check-items").prop("checked",!1),t.switch_alternative_attr_button_status()}),t.switch_alternative_attr_button_status(),$(".lead_confirm").on("change",function(){checkLeadConfirmed($(this))}),$(".client_confirm").on("change",function(){checkClientConfirmed($(this))})}}),$(document).on("click",".client_check_all",function(){var e=$("#search_type").val();$(".client_check_all").attr("disabled",!0),$(".client_confirm").attr("disabled",!0),setClientAllConfirmed($('input[type="checkbox"]:not(:checked)[class= "client_confirm"]').map(function(){return this.value}).get(),e)}),$(document).on("click",".lead_check_all",function(){var e=$('input[type="checkbox"]:not(:checked)[class= "lead_confirm"]').map(function(){return this.value}).get();$(".lead_check_all").attr("disabled",!0),$(".lead_confirm").attr("disabled",!0);var t=$("#search_type").val();void 0===t&&(t=$("#type_from_client").val()),setLeadAllConfirmed(e,t)}),$(document).on("click",".duplicate_result",function(){keyword=$(this).attr("id"),type=$("#search_type").val(),mode=$("#mode_type").val(),order_key=$("#order_key").val(),order_type=$("#order_type").val(),client_ids=$("#client_ids").val(),client_ids&&(client_ids=client_ids.split(" ")),arr_type=["email_and_name","email","client_and_name","mobile_tel","name"],url="/clients/duplicate";var t=arr_type.includes(type);t||"lead"==mode?(url="/leads/duplicate",$("#dupicate_table").is(":empty")?$("#initial_lead_table").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'):$("#dupicate_table").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>')):$("#dupicate_client_table").is(":empty")?$("#initial_client_table").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'):$("#dupicate_client_table").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$(".duplicate_result").css("background-color",""),$(this).css("background-color","#e0e0e0"),check_flg=$("#check_status").val(),$.ajax({url:url,type:"GET",data:{keyword:keyword,type:type,check_on:check_flg,client_ids:client_ids,show_list:!0,order_key:order_key,order_type:order_type,paginate_flg:1},dataType:"html",timeout:12e4}).done(function(e){t||"lead"==mode?($("#reload_flag").val()&&$("#duplicate_reload_view").removeClass("hidden"),$("#dupicate_table").empty(),$("#dupicate_table").show(),$("#dupicate_table").append(e),$("#initial_lead_table").empty(),$("#duplicate_leads_row").replaceWith($("#dupicate_table")),$(".hp-tooltip").tooltip({container:"body",trigger:"hover"})):($("#reload_flag").val()&&$("#duplicate_reload_view").removeClass("hidden"),$("#dupicate_client_table").empty(),$("#dupicate_client_table").show(),$("#dupicate_client_table").append(e),$("#initial_client_table").empty(),$("#duplicate_clients_row").replaceWith($("#dupicate_client_table"))),$(document).trigger("reloadReady")}).fail(function(e){if($("#js_error_message").empty(),$("#dupicate_client_table").empty(),$("#dupicate_table").empty(),$("#initial_client_table").empty(),$("#initial_lead_table").empty(),"timeout"==e.statusText){var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}})}),$(document).on("click",".close-merge-modal",function(){$(this).closest(".modal").modal("hide")}),App.front_respondents={"new":function(){this.submit_enter("#respondent_form"),this.add_form_initialize(),this.add_enquete_article_form(),this.delete_enquete_article_form(),this.setting_lead_modal(),this.set_associate_client(".hp-clients-table button.decision","respondents"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#respondent_client_id","single","#lead_client_id",1)},edit:function(){this.submit_enter("#respondent_form"),this.add_form_initialize(),this.add_enquete_article_form(),this.delete_enquete_article_form(),this.setting_lead_modal(),this.set_associate_client(".hp-clients-table button.decision","respondents"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#respondent_client_id","single","#lead_client_id",1),$("#search-associated-resources-modal").on("shown.bs.modal",function(){$("#search-associated-resources-modal").find("#LeadModalLabel").text($("#input_lead_info").data("title"))}),App.concerns.open_mailer();new Clipboard(".clipboard-btn");$(".js_submit_send_mail").on("click",function(){$(".open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));return $("#select_lead_id").val($(this).data("lead-id")),e.submit(),!1})},create:function(){this["new"]()},update:function(){this.edit()},show:function(){App.concerns.set_form_action_to_submit("#respondent_related_registration_form",".seminar_tag_modal_submit",!0),App.concerns.set_form_action_to_submit("#respondent_related_registration_form",".checked_submit",!0),App.concerns.set_form_action_to_submit("#respondent_related_registration_form",".seminar_inside_sales_modal_submit",!0),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#update-all-modal-tags","#tags"),App.front_business_card_lead_tags.init_suggest("update-all-modal-tags","update-all-modal-tag-pulldown"),App.concerns.open_mailer();new Clipboard(".clipboard-btn");$(".js_submit_send_mail").on("click",function(){$(".open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));return $("#select_lead_id").val($(this).data("lead-id")),e.submit(),!1})},submit_enter:function(e){$("#respondent_submit").on("click",function(){$(this).attr("disabled",!0),$(e).submit()})},add_form_initialize:function(){App.front_respondents.add_form(),$(".delete_inner_form").css("display","none")},add_form:function(){$(".new_enquete_article_teble_original tr").clone(!0,!0).appendTo("#inner_form_new_enquete_article_area")},add_enquete_article_form:function(){$("#add_new_enquete_article_form").on("click",function(){App.front_respondents.add_form(),1<$("#inner_form_new_enquete_article_area > tr").length&&$(".delete_inner_form").css("display","")})},delete_enquete_article_form:function(){$(".delete_inner_form").on("click",function(){$(this).parents("tr").remove(),$("#inner_form_new_enquete_article_area > tr").length<=1&&$(".delete_inner_form").css("display","none")})},setting_lead_modal:function(){this.set_associate_entities(".hp-leads-table button.decision",'input[name="associate_leads[]"]',"leads"),App.front_seminars.enable_associattion_search_modal(".add_leads_modal","/xhr/leads/search_as_association_modal","single")},set_associate_client:function(e,t){$(document).on("click",e,function(){result=$.ajax({url:"/xhr/"+t+"/existence/",type:"POST",data:{ids:[$(this).data("hp-entity-id")]},context:$(this)}).done(function(e){e.existence;$(this).closest(".modal").modal("hide")})})},set_associate_entities:function(e){$(document).on("click",e,function(){var e=$(this).data("hp-entity-id");$.ajax({url:$("#add_leads_entry_source").data("post"),type:"POST",data:{lead_id:e,add_leads_entry_source:$("#add_leads_entry_source").val(),single_flg:1}})})}},window.risk_clients={search_risk_client_lists:null},App.front_risk_clients={index:function(){App.concerns.disable_duplicate_request_search_form("#form_search_anti_clients",".js-disable-btn"),$(document).on("click",".btn-search",function(){App.concerns.disabled_btn(".js-disable-btn"),$("#form_search_anti_clients").submit()}),this.all_checked_items();new Clipboard(".clipboard-btn");App.concerns.change_display_number("form_search_anti_clients"),App.concerns.change_order("form_search_anti_clients"),App.concerns.enable_csv_export_event("#form_download_risk_clients","checked[client_ids][]"),App.concerns.fetch_remote_list("#form_search_anti_clients","#risk_clients_list_results",window.risk_clients.search_risk_client_lists,!0),$(document).on("change",".search-button","#risk_client_unconfirmed, #risk_client_checking, #risk_client_can_traded, #risk_client_not_traded",function(){$("#form_search_anti_clients").submit()}),$(document).on("click",".checkbox-search",function(){App.concerns.disabled_btn(".js-disable-btn"),$("#form_search_anti_clients").submit()}),$(document).on("click",".evaluation-tab",function(){if(!$(this).hasClass("active")){var e=$(this).data("type");"confirmed"==e?($(".checkbox-search-unconfirmed").addClass("tag-display-none"),$(".checkbox-search-confirmed").removeClass("tag-display-none"),$("#input_unconfirmed_query").addClass("input-display-none"),$("#input_confirmed_query").removeClass("input-display-none"),$("#search_search_type_2").prop("checked",!0),$("#btn_clear_data_search_unconfirmed").addClass("tag-display-none"),$("#btn_clear_data_search_confirmed").removeClass("tag-display-none"),$("#search_type_unconfirmed").addClass("input-display-none"),$("#search_type_confirmed").removeClass("input-display-none")):(e="unconfirmed")&&($(".checkbox-search-confirmed").addClass("tag-display-none"),$(".checkbox-search-unconfirmed").removeClass("tag-display-none"),$("#input_confirmed_query").addClass("input-display-none"),$("#input_unconfirmed_query").removeClass("input-display-none"),$("#search_search_type_1").prop("checked",!0),$("#btn_clear_data_search_confirmed").addClass("tag-display-none"),$("#btn_clear_data_search_unconfirmed").removeClass("tag-display-none"),$("#search_type_confirmed").addClass("input-display-none"),$("#search_type_unconfirmed").removeClass("input-display-none")),$("#form_search_anti_clients").submit()}}),App.concerns.focus_to_first_element(),$(document).on("keydown",".input-query-search",function(e){(46==e.keyCode||27==e.keyCode||e.ctrlKey&&(66===e.keyCode||68<=e.keyCode&&e.keyCode<=85||87===e.keyCode||89===e.keyCode||187===e.keyCode||189===e.keyCode||191===e.keyCode||220===e.keyCode||221===e.keyCode))&&e.preventDefault()}),$(document).on("click",".btn-clear-data-search",function(){App.concerns.disabled_btn(".js-disable-btn"),$(this).hasClass("confirmed")?$("#input_confirmed_query").val(""):$(this).hasClass("unconfirmed")&&$("#input_unconfirmed_query").val(""),$("#form_search_anti_clients").submit()}),$("#risk_client_unconfirmed").val($("#search_unconfirmed_flg").val()),$("#risk_client_checking").val($("#search_checking_flg").val()),$("#risk_client_can_traded").val($("#search_tradable_flg").val()),$("#risk_client_not_traded").val($("#search_untradable_flg").val()),$(document).on("change","#risk_client_unconfirmed",function(){$(this).is(":checked")?$("#search_unconfirmed_flg").val(1):$("#search_unconfirmed_flg").val(0)}),$(document).on("change","#risk_client_checking",function(){$(this).is(":checked")?$("#search_checking_flg").val(4):$("#search_checking_flg").val(0)}),$(document).on("change","#risk_client_can_traded",function(){$(this).is(":checked")?$("#search_tradable_flg").val(2):$("#search_tradable_flg").val(0)}),$(document).on("change","#risk_client_not_traded",function(){$(this).is(":checked")?$("#search_untradable_flg").val(3):$("#search_untradable_flg").val(0)}),App.front_risk_clients.update_rick_clients_ids_field_tags(),$(document).on("submit",".edit_risk_client",function(){$("#submit_evaluation_button").prop("disabled",!0)}),$(document).on("click",".evaluation-modal-show",function(){var e=$(this).data("id");$("#selected_id").val(e)}),$(document).on("hidden.bs.modal",".modal",function(){App.concerns.unfix_background()}),$(document).on("click","#submit_evaluation_button",function(){var e=$("#current_id").val(),t=$("#risk_client_lock_version").val();$("#edit_risk_client_"+e);$.ajax({url:"/xhr/risk_clients/validate_exclusive_control",type:"POST",dataType:"json",data:{id:e,lock_version:t}}).done(function(e){if(e.result)App.front_risk_clients.submit_and_evaluation();else{if(!confirm(I18n.t("js.risk_clients.alert_exclusive_control")))return!1;App.front_risk_clients.submit_and_evaluation()}})}),$(document).on("click","#submit_and_next_evaluation_button",function(){var e=$("#current_id").val(),t=$("#risk_client_lock_version").val();$.ajax({url:"/xhr/risk_clients/validate_exclusive_control",type:"POST",dataType:"json",data:{id:e,lock_version:t}}).done(function(e){if(e.result)App.front_risk_clients.submit_and_next_evaluation();else{if(!confirm(I18n.t("js.risk_clients.alert_exclusive_control")))return!1;App.front_risk_clients.submit_and_next_evaluation()}})})},all_checked_items:function(){$(document).on("click","#all-check, .check-items",function(){$(this).is("#all-check")&&($(this).is(":checked")?$(".check-items").prop("checked",!0):$(".check-items").prop("checked",!1));var e=$(".form-checked-resources .check-items:checked").length;$("#alternative_attr_button_merge_clients").prop("disabled",e<2)})},check_activity_collapsible:function(){for(var e=$(".collapsible"),t=0;t<e.length;t++)e[t].addEventListener("click",function(){this.classList.toggle("active");var e=this.nextElementSibling;"block"===e.style.display?(e.style.display="none",this.classList.remove("fa-chevron-down"),this.classList.add("fa-chevron-right")):(e.style.display="block",this.classList.remove("fa-chevron-right"),this.classList.add("fa-chevron-down"))})},update_pagination_pages:function(){var t=$("#modal_redirect_url").val(),e=$(".pagination > li.active a").text(),n=parseInt(e),i=$(".pagination > li a").map(function(){if(!isNaN($(this).text()))return $(this).text()}).get();$(".pagination > li a").each(function(){var e=$(this).text();parseInt(e);isNaN(e)?"\u2039"===e?data_page=n-1:"\u203a"===e?data_page=n+1:"\xab"===e?data_page=i.shift():"\xbb"===e&&(data_page=i.pop()):data_page=e,$(this).attr("href","/xhr/risk_clients/?"+t+"&page="+data_page)})},update_rick_clients_ids_field_tags:function(){var e=$(".evaluation-modal-show").map(function(){return $(this).data("id")}).get();$("#risk_clients_ids").val(e)},submit_and_evaluation:function(){var e=$("#current_id").val();$("#update_type").val($("#submit_evaluation_button").data("type"));var t=$("#edit_risk_client_"+e).serialize();$("#submit_evaluation_button").prop("disabled",!0),$.ajax({type:"PATCH",url:"/risk_clients/"+e,data:t,dataType:"JSON"}).done(function(e){200==e.status?($("#evaluation_modal").modal("hide"),$("#risk_clients_list_results").fadeOut(),$("#risk_clients_list_results").html(""),$("#risk_clients_list_results").append(e.result_list_html).ready(function(){App.concerns.change_order("form_search_anti_clients"),App.front_risk_clients.update_rick_clients_ids_field_tags(),App.front_risk_clients.update_pagination_pages()}),$("#risk_clients_list_results").fadeIn(),$("#risk_client_lock_version").val(e.lock_version),$("#activity_total_count").html(e.total_count)):location.reload()}).fail(function(){location.reload()})},submit_and_next_evaluation:function(){var a=$("#current_id").val();$("#update_type").val($("#submit_and_next_evaluation_button").data("type"));var e=$("#edit_risk_client_"+a).serialize();$("#submit_and_next_evaluation_button").prop("disabled",!0),$.ajax({type:"PATCH",url:"/risk_clients/"+a,data:e,dataType:"JSON"}).done(function(e){if(200==e.status){"update"==e.type?$("#evaluation_modal").modal("hide"):"update_next"==e.type&&($("#memo").hide(),$("#memo").val(e.memo),$("#memo").fadeIn(),$("#evaluation_kbns").hide(),$("#risk_client_evaluation_kbn_"+e.evaluation_kbn).prop("checked",!0),$("#evaluation_kbns").fadeIn(),$("#risk_client_lock_version").val(e.lock_version),$("#risk_client_info").hide(),$("#risk_client_info").html(e.modal_html),$("#risk_client_info").fadeIn()),$("#risk_clients_list_results").fadeOut(),$("#risk_clients_list_results").html(""),$("#risk_clients_list_results").append(e.result_list_html).ready(function(){App.concerns.change_order("form_search_anti_clients"),App.front_risk_clients.update_rick_clients_ids_field_tags(),App.front_risk_clients.update_pagination_pages()}),$("#risk_clients_list_results").fadeIn(),$("#activity_total_count").html(e.total_count),$("#edit_risk_client_"+a).attr("action","/risk_clients/"+$("#next_id").val()),document.getElementById("edit_risk_client_"+a).id="edit_risk_client_"+$("#next_id").val(),$("#current_id").val($("#next_id").val());var t=$("#risk_clients_ids").val().split(","),n=t.length,i=t.indexOf($("#current_id").val());i<n&&$("#next_id").val(t[i+1]),App.front_risk_clients.check_activity_collapsible(),$("#submit_and_next_evaluation_button").prop("disabled",!1)}else 404==e.status&&location.reload()}).fail(function(){location.reload()})}},App.front_roles={index:function(){App.concerns.change_display_number("form_search_roles"),App.concerns.change_order("form_search_roles"),App.concerns.focus_to_first_element()},"new":function(){this.submit_new()},create:function(){this.submit_new()},edit:function(){this.submit_edit(),App.concerns.change_display_number("form_search_users"),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),$(".select_role_user_admin_flg").change(function(){$.ajax({type:"POST",url:"/xhr/roles/update_role_user",data:{user_id:$(this).data("userId"),role_id:$(this).data("roleId"),admin_flg:"true"==$(this).val()}}).done(function(){})})},update:function(){this.submit_edit()},show:function(){App.concerns.change_display_number("form_search_users"),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},submit_new:function(){$("#new_submit").on("click",function(){$("form.new_role").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$("form.edit_role").submit()})}},window.sale_approaches={xhr:{activity_summary:null,task_summary:null,deal_summary:null,search_sale_approaches_list:null,search_activity_list:null,correspondence_history:null,form:{form_basic_information:null,setting_activity_history:null,form_lead_information:null,show_lead_information:null,edit_lead_information:null},modal:{activity_summary_visible_fields:null,task_summary_visible_fields:null,setting_activity_histories:null,target_lead_filter:null},pagination:{correspondence_history:null},files:{upload_talk_scripts:null}}},App.front_sale_approaches={SALE_APPROACHES_OPEN_STATUS_SELF:3,SALE_APPROACHES_OPEN_STATUS_SELF_AND_DEPARTMENT:5,CONTAINER_NAME:"additional_modal_container",index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#search_clear_sale_approaches"),App.concerns.disable_duplicate_request_search_form("#form_search_sale_approaches",".js-disable-btn"),App.front_sale_approaches.resetAlertNotice(),$("#change_display_number").on("change",function(){$("#display_number").val($("#change_display_number").val());var e=$("<input />").attr("type","hidden").attr("name","page").attr("value","1").appendTo("#form_search_sale_approaches");$("#form_search_sale_approaches").submit(),e.remove()}),App.concerns.change_search_type(),this.get_modal_to_search_save(),App.concerns.get_modal_to_search_call("#form_search_sale_approaches"),App.searches.callForSearchCondition.init(),App.concerns.fetch_remote_list("#form_search_sale_approaches","#sale_approaches_message_area",window.sale_approaches.xhr.search_sale_approaches_list,!0),this.monitor_visible_fields("#frm_visible_fields","#form_search_sale_approaches"),App.front_segments.set_segment_select2("#search_segment_ids"),this.setup_activity_type(),$(document).on("change","#search_activity_type, #search_private_flg, #search_private_correspondence_flg, #search_ing_flg",function(){App.concerns.disabled_btn(".js-disable-btn"),$("#form_search_sale_approaches").submit()}),$("#search_activity_type_ids").select2(),App.concerns.select_search_disable_user("search_owner_user_ids"),App.concerns.select_search_disable_user("search_user_ids"),$(".open_search_user_ids").on("click",function(e){e.preventDefault(),App.front_users.get_modal_to_search_users($(this).data("css-selector"),$(this).data("search-type"),!0)}),$("#csv_dl_submit").on("click",function(){var e="#form_search_sale_approaches",t=$('input[name="export_ids[]"]');0<t.length&&t.remove(),App.concerns.set_export_ids(e,"checked[sale_approach_ids][]"),App.concerns.set_page_parameter(e);var n=$(e),i=n.attr("action");n.attr("action",$(this).data("action")),n.removeAttr("data-remote"),n.removeData("remote"),n.removeAttr("data-loading"),n.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(n),n.submit(),n.attr("action",i),n.attr("data-remote","true"),n.attr("data-loading","true")}),$("#csv_all_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(1);var e=$("#form_search_sale_approaches"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),e.removeAttr("data-loading"),e.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(e),e.submit(),e.attr("action",t),e.attr("data-remote","true"),e.attr("data-loading","true")}),$(".js-open-bulk-update").on("click",function(e){e.preventDefault(),App.front_sale_approaches.resetAlertNotice(),0<$("#form_checked_sale_approaches").find('[name="checked[sale_approach_ids][]"]:checked').length?$("#ba_bulk_update_modal").modal("show"):($("#js_error_message").html($('<div class="row">\n  <div class="col-xs-12">\n    <div class="alert alert-danger alert-error alert-dismissible" role="alert">\n      <button type="button" class="close" data-dismiss="alert" aria-label="Close">\n        <span aria-hidden="true">\xd7</span>\n      </button>\n      <ul>\n        <li style="word-wrap: break-word;">'+I18n.t("js.common.please_select")+"</li>\n      </ul>\n    </div>\n  </div>\n</div>")),e.stopImmediatePropagation())}),App.concerns.datepicker(".search_datepicker"),$("#bulk_select_activity_types").select2(),App.concerns.set_form_action_to_submit("#form_checked_sale_approaches",".js-bulk-update",!0),$("#ba_bulk_update_modal").off("hidden.bs.modal").on("hidden.bs.modal",function(){$(this).find("#bulk_error_message").empty(),$(this).find("input, textarea").not(":button, :submit, :reset, [type='hidden'], .select2-input, [type='radio'], [type='checkbox']").val(""),$(this).find("[type='radio'], [type='checkbox']").prop("checked",!1),$(
this).find("select").prop("selected",!1),$(this).find("input.select2-offscreen, select.select2-offscreen").select2("val",""),$("#ba_bulk-update_submit_btn").prop("disabled",!0)}),$(document).on("click",".all-check,.summary-check-items",function(){var e=$(".summary-check-items:checked"),t=e.length!=e.not(".not_allowed").length;$(".btn-activity-by-department-role").prop({disabled:t});var n=$(".data-original-title-by-activity"),i=n.attr(t?"data-disabled-title":"data-enabled-title");n.attr("data-original-title",i)}),$(document).on("change input","#bulk_update_modal_activity_name,#bulk_update_modal_begin,#bulk_update_modal_end,#bulk_select_activity_types,#sale_approach_status_1,#sale_approach_status_2",function(){var e=$("#bulk_update_modal_activity_name").val(),t=$("#bulk_update_modal_begin").val(),n=$("#bulk_update_modal_end").val(),i=$("#bulk_select_activity_types").val(),a=$('input[name="sale_approach[status]"]:checked').val();0==e.trim().length&&0==t&&0==n&&null==i&&a==undefined?$("#ba_bulk-update_submit_btn").prop("disabled",!0):$("#ba_bulk-update_submit_btn").prop("disabled",!1)}),$("#business_activity_status_1,#business_activity_status_2").on("click",function(){$('input[name="business_activity[status]"]:checked').val()==undefined?$("#ba_bulk-update_submit_btn").prop("disabled",!0):$("#ba_bulk-update_submit_btn").prop("disabled",!1)}),$("#ba_bulk-update_submit_btn").prop("disabled",!0),App.concerns.set_form_action_to_submit("#form_checked_sale_approaches",".js-bulk-destroy",!0),this.table_check_cnt(".summary-check-items.summary-checkbox"),App.tooltip.display_tooltip();var e="sale_approaches";App.front_recommend.recommendScenarios(e)},"new":function(){this.setup_form(),this.setup_talk_script_form(".js-talk-script-input-area",".js-talk-script-upload-btn",".js-talk-script-upload-status"),this.open_inside_departments_modal()},create:function(){this.setup_form(),this.setup_talk_script_form(".js-talk-script-input-area",".js-talk-script-upload-btn",".js-talk-script-upload-status"),this.open_inside_departments_modal()},show:function(){function e(e,t){$("#csv_dl_sa_submit").on("click",function(){return App.front_sale_approaches.resetAlertNotice(),$("#csv_export_type").val(0),0==$("input[name='checked[client_sale_approach_ids][]']:checked").length?$("#js_search_success_message").html($("<div></div>",{"class":"alert alert-danger alert-error alert-dismissible",role:"alert"}).html($("<button></button>",{type:"button","class":"close","data-dismiss":"alert","aria-label":"Close"}).html($("<span></span>",{"aria-hidden":"true"}).text("\xd7")).add($("<ul></ul>",{"class":"list-unstyled"}).html($("<li></li>").text("\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"))))):(App.concerns.set_export_ids(e,t),action=$(e).attr("action"),$(e).attr("action",action.replace("search_hot_approach/","search_hot_approach.csv")),$(e).data("remote",!1),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo($(e)),$(e).submit(),$(e).attr("action",action),$(e).data("remote",!0),App.concerns.remove_export_ids(),$("#page_for_export").remove(),$(".ha-loading").hide()),$(".client-sale-approach_result-list .export-button").click(),!0}),$("#csv_all_dl_sa_submit").on("click",function(){return $("#csv_export_type").val(1),App.front_sale_approaches.resetAlertNotice(),action=$(e).attr("action"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo($(e)),$(e).submit(),$(e).attr("action",action),!0}),$(document).on("click",".page-top",function(){$(".client-sale-approach_result-list").animate({scrollTop:0},100)})}App.front_hot_approaches.index(),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.select_search_disable_user("search_ha_search_owner_user_ids"),$("#form_sale_template_customer_id").select2(),$("#form_sale_template_contact_id").select2(),this.monitor_visible_field_with_js_submit("#frm_visible_fields","#form_search_hot_approaches"),this.change_content_tab(),this.collapse_icon(".js-search-collapse",!0),this.collapse_icon(".js-memo-collapse",!1),App.concerns.fetch_table_list("#sale_approaches_activity_summary",window.sale_approaches.xhr.activity_summary,!0),this.change_order_summary("sale_approach_list_summary"),this.change_order_summary("sale_approaches_activity_summary"),App.concerns.fetch_table_list("#sale_approaches_report_summary",window.sale_approaches.xhr.report_summary,!0),App.concerns.fetch_table_list("#sale_approach_list_summary",window.sale_approaches.xhr.sale_approach_list_summary,!0),App.concerns.fetch_table_list("#sale_approaches_task_summary",window.sale_approaches.xhr.task_summary,!0),$(document).on("click",".js-order-client-sale-approach-list",function(){$(".ha-loading").show(),$("input[id=others_hot_approach_sort_item]").val($(this).data("order-key")),$("input[id=others_hot_approach_sort_order]").val($(this).data("order-type")),$("#js-sale-approach-detail-page").val($(this).data("page")),App.front_hot_approaches.submit_form_search_hot_approaches()}),$.each($(".remote_deals_summary"),function(e,t){var n=$(t).attr("id");App.concerns.fetch_table_list("#"+n,window.sale_approaches.xhr.deal_summary,!0),App.front_sale_approaches.change_order_summary(n)}),App.concerns.ajax_post_once("#form_setting_activity_history",window.sale_approaches.xhr.form.setting_activity_history),App.concerns.fetch_and_duplication_abort(".remote-history-btn",window.sale_approaches.xhr.correspondence_history),App.concerns.fetch_and_duplication_abort(".js-edit-lead-information-btn",window.sale_approaches.xhr.form.edit_lead_information),App.concerns.fetch_and_duplication_abort(".js-show-lead-information-btn",window.sale_approaches.xhr.form.show_lead_information),App.concerns.fetch_and_duplication_abort("#form_correspondence_history_relation_lead",window.sale_approaches.xhr.form.form_lead_information),App.concerns.fetch_and_duplication_abort(".js-edit-information-btn",window.sale_approaches.xhr.form.form_basic_information),App.concerns.fetch_and_duplication_abort(".js-open-activity-fields-modal",window.sale_approaches.xhr.modal.activity_summary_visible_fields),App.concerns.fetch_and_duplication_abort(".js-open-task-fields-modal",window.sale_approaches.xhr.modal.task_summary_visible_fields),App.concerns.fetch_and_duplication_abort(".js-open-setting-history-modal",window.sale_approaches.xhr.modal.setting_activity_histories),App.concerns.fetch_and_duplication_abort(".js-target-lead-filter-btn",window.sale_approaches.xhr.modal.target_lead_filter),App.concerns.set_form_action_to_submit("#form_activity_target_leads","#js_submit_activity_target_leads",!0),App.concerns.datepicker(".modal_datepicker"),$(".modal_datepicker").attr({format:"YYYY-MM-DD hh:mm"}),$(".modal_datepicker").datepicker(Object.assign({orientation:"bottom"},{})),e("#form_search_hot_approaches","checked[client_sale_approach_ids][]"),$(document).on("click","#js-toggle-left-search-form-button",function(){$("#js-left-side-bar-container").toggleClass("active");var e=1e3/12;$("#js-left-side-bar-container").hasClass("active")?($("#js-close-button").removeClass("d-none-important"),$("#js-open-button").addClass("d-none-important"),$("#js-client-sale-approach-list-main-container").css("width",e+"%"),$(".sale-approach-detail-left-menu .select-condition-row").css("overflow-y","scroll")):($("#js-close-button").addClass("d-none-important"),$("#js-open-button").removeClass("d-none-important"),$("#js-client-sale-approach-list-main-container").css("width","calc(100% - 20px)"),$(".sale-approach-detail-left-menu .select-condition-row").css("overflow-y","hidden"))}),$(document).on("hidden.bs.modal",'[data-hp-role="activity-target-modal"]',function(){$(".modal_lead_filter").remove()}),$(document).on("hidden.bs.modal","#modalSendMail",function(){$(".modal_lead_filter").remove()}),$(document).on("show.bs.modal",'[data-hp-role="activity-target-modal"]',function(){$("#modalNewAbMail").remove()}),$(document).on("show.bs.modal","#modalSendMail",function(){$("#modalNewAbMail").remove()}),App.concerns.open_mailer(),new Clipboard(".clipboard-btn"),App.concerns.select_search_disable_user("search_user_ids"),App.concerns.select_search_disable_user("search_history_user_ids"),App.concerns.select_search_disable_user("search_latest_user_ids"),$("#search_state_ids").select2(),$("#search_last_activity_content").select2(),$(".open_search_user_ids").on("click",function(e){e.preventDefault(),App.front_users.get_modal_to_search_users($(this).data("css-selector"),$(this).data("search-type"),!0)}),$("#search_leakage_flg, #search_ing_flg, #search_unassign_flg").on("change",function(){$("#form_search_activity_list").submit()}),$(document).on("click",".js-cancel-information-btn",function(e){window.sale_approaches.xhr.files.upload_talk_scripts&&window.sale_approaches.xhr.files.upload_talk_scripts.abort(),e.preventDefault(),$(".js-edit-information-btn").show(),$("#information-editable-area").empty(),$("#information-viewable-area").show()}),this.editable_cancel(".js-add-history-btn",".js-cancel-history-btn","#history-additional-area",".blank_history"),this.sortable_list(),App.concerns.set_associate_entity_to_s2("#lead_client_id",".hp-clients-table button.decision","clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#lead_client_id","single","#lead_client_id",1),$(document).on("change",".js-bal-check",function(){if($(this).prop("checked")){var e=$(this).data("lead-id");$(this).parent().append($("<input>",{type:"hidden",name:"checked[lead_ids][]",value:e}))}else $(this).parent().find('[type="hidden"]').remove()}),this.table_check_cnt(".summary-check-items.summary-checkbox"),$("#js_submit_checked_mail_business_activities_lead_ids").on("click",function(e){if(0==jQuery.map($('input[name="checked[business_activities_lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1}),$("#js_submit_search_mail_business_activities_lead_ids").on("click",function(e){if(!$("#all_lead_ids").val().trim())return alert(I18n.t("js.common.serch_result_none")),e.stopImmediatePropagation(),!1}),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){if($(".btn-group.open").removeClass("open"),$(".modal-caller").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none"),"js_submit_search_mail"===$(this).attr("id")){var e=$("#form_search_activity_list").attr("action");(t=App.concerns.set_form_action("form_search_activity_list",$(this).data("action"),$(this).data("remote"))).removeAttr("data-loading"),t.removeData("loading"),t.submit(),t.attr("action",e),t.attr("data-loading","true")}else{var t;e=$("#form_checked_business_activities_leads").attr("action");(t=App.concerns.set_form_action("form_checked_business_activities_leads",$(this).data("action"),$(this).data("remote"))).submit(),t.attr("action",e)}return!1}),App.concerns.submit_when_changed_element("form_set_mail_template","js_change_element","convert"),$("#import-btn").on("click",function(){return $("#file_tag").trigger("click"),!1}),$("#file_tag").on("change",function(){var e=$("#form_checked_business_activities_leads"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(e),e.submit(),e.attr("action",t),e.attr("data-remote","true")}),$("#csv_dl_submit").on("click",function(){var e="#form_search_activity_list";App.concerns.remove_export_ids(),App.concerns.set_export_ids(e,"checked[business_activities_lead_ids][]"),App.concerns.set_page_parameter(e);var t=$(e),n=t.attr("action");t.attr("action",$(this).data("action")),t.removeAttr("data-remote"),t.removeData("remote"),t.removeAttr("data-loading"),t.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(t),t.submit(),t.attr("action",n),t.attr("data-remote","true"),t.attr("data-loading","true")}),$("#csv_all_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(1);var e=$("#form_search_activity_list"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-remote"),e.removeData("remote"),e.removeAttr("data-loading"),e.removeData("loading"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(e),e.submit(),e.attr("action",t),e.attr("data-remote","true"),e.attr("data-loading","true")}),$(".js-open-bulk-update").on("click",function(e){App.front_sale_approaches.resetAlertNotice(),e.preventDefault(),0<$("#business_activities_lead_lists_area").find('[name="checked[client_sale_approach_ids][]"]:checked').length?$("#bal_bulk_update_modal").modal("show"):($("#sale_approaches_message_area").html($('<div class="row">\n  <div class="col-xs-12">\n    <div class="alert alert-danger alert-error alert-dismissible" role="alert">\n      <button type="button" class="close" data-dismiss="alert" aria-label="Close">\n        <span aria-hidden="true">\xd7</span>\n      </button>\n      <ul class="list-unstyled">\n        <li style="word-wrap: break-word;">'+I18n.t("js.common.please_select")+"</li>\n      </ul>\n    </div>\n  </div>\n</div>")),e.stopImmediatePropagation())}),App.concerns.select_search("bulk_update_modal_user_id"),App.concerns.set_form_action_to_submit("#form_checked_business_activities_leads",".js-bulk-update",!0),$("#bal_bulk_update_modal").off("hidden.bs.modal").on("hidden.bs.modal",function(){$(this).find("#bulk_error_message").empty(),$(this).find("input, textarea").not(":button, :submit, :reset, [type='hidden'], .select2-input, [type='radio'], [type='checkbox']").val(""),$(this).find("[type='radio'], [type='checkbox']").prop("checked",!1),$(this).find("select").prop("selected",!1),$(this).find("input.select2-offscreen, select.select2-offscreen").select2("val",""),$("#bal_bulk-update_submit_btn").prop("disabled",!0)}),$("#bulk_target_modal_deadline,#bulk_update_modal_user_id,#client_sale_approach_status_unassigned,#client_sale_approach_status_assigned,#client_sale_approach_status_completed").on("change input",function(){var e=$("#bulk_update_modal_user_id").val(),t=$("#bulk_target_modal_deadline").val(),n=!$("#client_sale_approach_status_unassigned").is(":checked"),i=!$("#client_sale_approach_status_assigned").is(":checked"),a=!$("#client_sale_approach_status_completed").is(":checked");console.log(n,i,a,e),0==e.length&&0==t.length&&n&&i&&a?$("#bal_bulk-update_submit_btn").prop("disabled",!0):$("#bal_bulk-update_submit_btn").prop("disabled",!1)}),$(document).ready(function(){$("#modal_block_for_search_users").on("DOMSubtreeModified propertychange",function(){var e=$("#bulk_update_modal_user_id").val(),t=$("#bulk_target_modal_deadline").val();0==e.length&&0==t.length?$("#bal_bulk-update_submit_btn").prop("disabled",!0):$("#bal_bulk-update_submit_btn").prop("disabled",!1)})}),$("#bal_bulk-update_submit_btn").prop("disabled",!0),$(document).on("click","#js-bulk-destroy-btn",function(e){e.preventDefault();var t=$(this);if(App.front_sale_approaches.resetAlertNotice(),$(".btn-group.open").removeClass("open"),0===$("#business_activities_lead_lists_area").find('[name="checked[client_sale_approach_ids][]"]:checked').length)return $("#sale_approaches_message_area").html($('<div class="row">\n  <div class="col-xs-12">\n    <div class="alert alert-danger alert-error alert-dismissible" role="alert">\n      <button type="button" class="close" data-dismiss="alert" aria-label="Close">\n        <span aria-hidden="true">\xd7</span>\n      </button>\n      <ul class="list-unstyled">\n        <li style="word-wrap: break-word;">'+I18n.t("js.common.please_select")+"</li>\n      </ul>\n    </div>\n  </div>\n</div>")),void e.stopImmediatePropagation();if(!t.data("confirm-msg")||confirm(t.data("confirm-msg"))){var n=$("#form_checked_business_activities_leads");t.data("action")&&n.attr("action",t.data("action")),t.data("remote")?n.attr("data-remote","true"):(n.removeAttr("data-remote"),n.removeData("remote"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo(n)),n.submit()}}),$(document).on("click","#js-create-checked-mails, #js-create-all-mails",function(e){e.preventDefault(),$(".btn-group.open").removeClass("open");var t=$(this).attr("id"),n=$("#sale_approach_id").val(),i=$("#total_client_sale_count").val();if("js-create-checked-mails"===t)var a=jQuery.map($('input[name="checked[client_sale_approach_ids][]"]:checked'),function(e){return $(e).data("client_id")});else a=$("#all_client_ids").val()||[];if(!a.length)return $("#sale_approaches_message_area").html($('<div class="row">\n  <div class="col-xs-12">\n    <div class="alert alert-danger alert-error alert-dismissible" role="alert">\n      <button type="button" class="close" data-dismiss="alert" aria-label="Close">\n        <span aria-hidden="true">\xd7</span>\n      </button>\n      <ul>\n        <li style="word-wrap: break-word;">'+I18n.t("js.common.please_select")+"</li>\n      </ul>\n    </div>\n  </div>\n</div>")),void e.stopImmediatePropagation();$.ajax({url:"/xhr/hot_approach_mail_queues/get_modal_to_send_mail/",type:"POST",dataType:"script",data:{checked:{client_ids:a},sale_approach_id:n,total_sale_count:i},timeout:12e4}).fail(function(e){if($("#js_error_message").empty(),"timeout"==e.statusText){var t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.timeout_error")+"</li></ul></div>";$("#js_error_message").append(t)}else{t='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">\xd7</a><ul><li>'+I18n.t("js.common.duplicate_error")+"</li></ul></div>";$("#js_error_message").append(t)}})}),this.xhr_change_display_template_for_deal(),$(document).on("click",".modal_top_for_sale_approaches",function(){$(this).parents(".modal-overflow-scroll").animate({scrollTop:0},100)}),App.next_steps.set_workflow_index_tooltip(),$(document).on("click",".check-pagination-close-link-activity-history-modal",function(e){e.preventDefault(),window.sale_approaches.xhr.pagination.correspondence_history&&window.sale_approaches.xhr.pagination.correspondence_history.abort(),window.sale_approaches.xhr.pagination.correspondence_history=$.ajax({url:$(this).attr("href"),dataType:"json"}).done(function(e){window.sale_approaches.xhr.pagination.correspondence_history=$.ajax({type:"GET",url:e.path,dataType:"script"}).fail(function(e,t){"abort"!==t&&console.log("fail",e.status)})}).fail(function(e,t){"abort"!==t&&console.log("fail",e.status)})}),$("#checked-leads-link").on("click",function(){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),!1}),App.concerns.mail_type_select_modal_submit("form_checked_business_activities_leads"),$(".stepable-record-field-modal-link").on("click",function(){$(".stepable_record_field_modal").find(".user_information").attr("stepable-record-field-page-scroll-top",$(document).scrollTop())}),null!=window.__INITIAL_STATE__.sale_approaches.shown_history_path?$.ajax({type:"GET",url:window.__INITIAL_STATE__.sale_approaches.shown_history_path,dataType:"script"}):window.__INITIAL_STATE__.sale_approaches.shown_target_flg&&$(".js-target-lead-filter-btn").trigger("click"),$("body").on("click",".close-form-sale-template-modal-btn",function(){$("#form_sale_template_modal").modal("hide"),$("#form_sales_implementation_wizard").modal("show")}),$("body").on("change",".steps3 #form_sale_template_customer_id",function(){App.front_sale_approaches.reset_step3_wizard(this)}),$("body").on("change",".steps4 #form_sale_template_contact_id",function(){App.front_sale_approaches.reset_step4_wizard(this)}),$(".select-condition-row").scroll(function(){$(".datepicker").css("top",(801.141-parseFloat($(this).scrollTop())).toString()+"px")}),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},show_loading_wizard:function(){var e=$("#form_sales_implementation_wizard .modal-header").height()+$("#form_sales_implementation_wizard .modal-body").height()+64;$("#form_sales_implementation_wizard .ha-loading").css("height",e+$("fieldset:visible").height()),$("#form_sales_implementation_wizard .ha-loading").show()},reset_step3_wizard:function(e){App.front_sale_approaches.show_loading_wizard(),$.ajax({type:"GET",url:"/xhr/form_sale_templates/reset_step_info",data:{form_sale_template_id:$(e).val(),template_type:"customer"}})},reset_step4_wizard:function(e){App.front_sale_approaches.show_loading_wizard(),$.ajax({type:"GET",url:"/xhr/form_sale_templates/reset_step_info",data:{form_sale_template_id:$(e).val(),template_type:"contact"}})},setup_form:function(){App.concerns.select_search("sale_approach_owner_user_id"),App.concerns.datepicker(".search_datepicker"),this.display_switch_roles_select(),$("#sale_approach_activity_type_ids").select2()},display_switch_roles_select:function(){var e=this,t=$("#js_open_status"),n=$("#js_open_status_edit");t.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF&&($("#js_select_role_ids").show(),$("#js_select_role_ids select").select2({width:"100%"})),t.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF_AND_DEPARTMENT&&($("#js_select_department_role_ids").show(),$("#js_select_department_caller").show(),$("#js_select_department_role_ids select").select2({width:"100%"})),t.on("change",function(){t.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF?($("#js_user_id").val($("#sale_approach_owner_user_id").val()),$("#js_form_set_select_roles").submit()):($("#js_select_role_ids select").select2("val",""),$("#js_select_role_ids").hide())}),t.on("change",function(){t.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF_AND_DEPARTMENT?($("#js_select_department_caller").show(),$("#js_select_department_role_ids").show()):($("#js_select_department_role_ids select").select2("val",""),$("#js_select_department_role_ids").hide(),$("#js_select_department_caller").hide())}),n.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF&&($("#js_select_role_ids").show(),$("#js_select_role_ids select").select2({width:"100%"})),n.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF_AND_DEPARTMENT&&($("#js_select_department_role_ids").show(),$("#js_select_department_caller").show(),$("#js_select_department_role_ids select").select2({width:"100%"})),n.on("change",function(){n.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF?0==$("#sale_approach_roles_cnt").val()?($("#js_user_id").val($("#sale_approach_owner_user_id").val()),$("#js_form_set_select_roles").submit()):($("#js_select_role_ids").show(),$("#js_select_role_ids select").select2({width:"100%"})):$("#js_select_role_ids").hide()}),n.on("change",function(){n.val()==e.SALE_APPROACHES_OPEN_STATUS_SELF_AND_DEPARTMENT?($("#js_select_department_caller").show(),$("#js_select_department_role_ids").show()):($("#js_select_department_role_ids").hide(),$("#js_select_department_caller").hide())})},open_inside_departments_modal:function(){App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},change_content_tab:function(){var e=$("#content_tab_1"),t=$("#content_tab_2"),n=$("#content_tab_3");$(document).on("change",".content_tab",function(){e.is(":checked")?($(".content_summary").show(),$(".content_activity_list").hide(),$(".content_workflow").hide(),$(".checkbox-search").hide()):t.is(":checked")?($(".content_summary").hide(),$(".content_activity_list").show(),$(".content_workflow").hide(),$(".checkbox-search").show()):n.is(":checked")&&($(".content_summary").hide(),$(".content_activity_list").hide(),$(".content_workflow").show(),$(".checkbox-search").hide())})},collapse_icon:function(e,t){$(document).on({"shown.bs.collapse":function(){$(this).hasClass("in")&&(t?$(this).prev(".activity-collapse-link").addClass("in"):$(this).parent().find(".activity-collapse-link").addClass("in"))},"hidden.bs.collapse":function(){$(this).hasClass("in")||(t?$(this).prev(".activity-collapse-link").removeClass("in"):$(this).parent().find(".activity-collapse-link").removeClass("in"))}},e)},editable_cancel:function(t,e,n,i){$(document).on("click",e,function(e){e.preventDefault(),$(t).show(),$(n).empty(),void 0!==i&&$(i).show()})},get_modal_to_search_save:function(){$(document).on("click","#search_save",function(){if("disabled"==$(this).attr("disabled"))return!1;$(this).attr("disabled",!0);var e=$("#form_search_sale_approaches"),t=e.attr("action");e.attr("action",$(this).data("action")),e.removeAttr("data-loading"),e.removeData("loading"),e.submit(),e.attr("action",t),e.attr("data-loading","true")})},monitor_visible_fields:function(e,t){$(e).on("ajax:complete",function(){$(t).trigger("submit.rails")})},monitor_visible_field_with_js_submit:function(e,t){$(e).on("submit",function(){$(".ha-loading").show()}),$(e).on("ajax:complete",function(){$(t).trigger("submit.rails")})},check_limit_add_fields:function(e){return 5===$(e).parent().find("li").filter(function(){return"none"!==$(this).css("display")}).length&&(alert(I18n.t("js.sale_approaches.sort_limited")),!0)},sortable_list:function(){var e=$(".sortable");e.sortable({cursor:"move",opacity:.7,items:"li.fields",update:function(){$(this).find(".sort_order").val($(this).sortable("toArray"))}}),e.disableSelection(),e.find('input[type="text"], textarea').off("mousedown.ui-disableSelection selectstart.ui-disableSelection").on("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(e){e.stopImmediatePropagation()})},search_lead_form:function(){App.concerns.change_display_number("form_search_activity_list"),App.concerns.change_order("form_search_activity_list"),$("#search_lead_pref_ids").select2(),App.front_business_card_lead_tags.init_suggest("advanced-search-tags","advanced-search-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search","#search_lead_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search","#advanced-search-tags","#search_lead_tag_ids"),$("#search_lead_interest_product_type_ids").select2(),App.concerns.select_search("search_client_id"),App.concerns.select_search_disable_user("search_lead_owner_user_ids"),App.concerns.select_search_disable_user("search_lead_user_ids"),App.concerns.select_search("search_lead_campaign_ids"),App.concerns.select_search("search_lead_target_list_ids"),App.concerns.select_search("search_lead_web_form_ids"),App.concerns.select_search("search_lead_sale_approaches_ids"),$("#search_lead_lead_source_kbn_ids").select2({width:"100%",placeholder:I18n.t("js.common.lead_source")}),$("#search_lead_lead_status").select2({width:"100%",placeholder:I18n.t("js.common.lead_status")}),App.concerns.set_item_id(),$("#search_lead_important_customer_flg").select2({width:"100%",placeholder:I18n.t("js.common.important_customer")}),$("#search_lead_end_user_flg").select2({width:"100%",placeholder:I18n.t("js.common.end_user")}),$("#search_lead_store_flg").select2({width:"100%",placeholder:I18n.t("js.common.store")}),$("#search_lead_competitor_flg").select2({width:"100%",placeholder:I18n.t("js.common.competitor")}),$("#search_lead_error_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.mail_error")}),$("#search_lead_error_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.tel_error")}),$("#search_lead_error_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.fax_error")}),$("#search_lead_error_address_flg").select2({width:"100%",placeholder:I18n.t("js.common.address_error")}),$("#search_lead_not_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_mail")}),$("#search_lead_not_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_tel")}),$("#search_lead_not_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_fax")}),$("#search_lead_not_dm_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_dm")}),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_datepicker"),App.concerns.datepicker(".search_items_datepicker")},reload_summary_and_activity_table:function(){$("#sale_approaches_activity_summary").trigger("reload"),$("#sale_approaches_report_summary").trigger("reload"),$("#sale_approach_list_summary").trigger("reload"),$("#sale_approaches_task_summary").trigger("reload"),$(".remote_deals_summary").trigger("reload"),$("#form_search_activity_list").trigger("submit.rails")},reload_ajax_element:function(e){$.ajax({type:"GET",url:$(e).data("remote-url"),dataType:"script"})},setup_activity_type:function(){function e(e){$(".btn").prop("disabled",!0);var t=$(e).closest("li"),n=$(e).closest("div").find(".edit-name").val();t.data("depth");if($(e).hasClass("add_decision")||$(e).hasClass("add_decision_input")){var i=$(e).closest("ul").closest("li").data("activity-type-id"),a=$(e).closest("ul").children("li").length,s=$(e).closest("li").data("depth");$("#activity_type_name").val(n),$("#activity_type_parent_activity_type_id").val(i),$("#activity_type_sort").val(a),$("#activity_type_depth").val(s),$("#activity_type_activity_type_list_id").val(t.attr("id")),$("#activity_type_edit_form").attr("method","post"),$("#activity_type_edit_form").attr("action","/xhr/sale_approaches/activity_types/create"),$("#activity_type_edit_form").submit()}else{var o=I18n.t("js.common.confirm_save"),r=$(e).closest("li").data("activity-type-id");confirm(o)&&($("#activity_type_id").val(r),$("#activity_type_name").val(n),$("#activity_type_activity_type_list_id").val(t.attr("id")),$("#activity_type_edit_form").attr("method","patch"),$("#activity_type_edit_form").attr("action","/xhr/sale_approaches/activity_types/update"),$("#activity_type_edit_form").submit())}}function t(e){e.find(".edit-name").val(e.children("span").eq(1).text()),e.children("span").addClass("none"),e.children("span").eq(2).removeClass("none"),e.children("span").eq(3).removeClass("none"),e.children("span").eq(4).removeClass("none")}$("#activity_type_setting_dialog").off("show.bs.modal").off("hidden.bs.modal").on("show.bs.modal",function(){$.ajax({type:"GET",url:"/xhr/sale_approaches/activity_types/editable_form/",dataType:"script",beforeSend:function(){$("#activity_type_form_area").html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))}}).fail(function(){$("#activity_type_form_area").html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.sale_approaches.load_error")+"</span></div>"))}).always(function(){$("#activity_type_form_area").find(".loading").remove()})}).on("hidden.bs.modal",function(){$("#loading-area").css("display","none"),$("#activity_type_form_error_area").empty(),$.ajax({type:"GET",url:"/xhr/sale_approaches/activity_types/get_select_box/",dataType:"script"}).fail(function(e){console.log(e)})}),$(document).on("click","#js_sortable_all",function(){if(0===$("ul.activity_type_tree li").length)return alert(I18n.t("js.sale_approaches.no_activity_type")),!1;$.ajax({type:"GET",url:$(this).data("remote-url"),dataType:"script",beforeSend:function(){$("#activity_type_form_error_area").empty(),$("#activity_type_form_area").html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))}}).fail(function(){$("#activity_type_form_area").html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.sale_approaches.load_error")+"</span></div>"))}).always(function(){$("#activity_type_form_area").find(".loading").remove()})}),$(document).on({"ajax:beforeSend":function(){$("#activity_type_form_error_area").empty(),$("#activity_type_form_area").html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))},"ajax:error":function(){$(
"#activity_type_form_area").html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.sale_approaches.load_error")+"</span></div>"))},"ajax:complete":function(){$("#activity_type_form_area").find(".loading").remove()}},"#js_cancel_sortable"),App.front_sale_approaches.folding(),$(document).on("click",".add_top",function(){0==$("#activity_type_setting_dialog").find("#parent").children("ul").length&&$("#activity_type_setting_dialog").find("#parent").append('<ul class="dd-list" id="activity_type_tree"></ul>');var e=$("#activity_type_setting_dialog").find("#activity_type_tree");e.data("routes-depth-size")>e.children("li").length?App.front_sale_approaches.activity_type_display_all("add_top"):App.front_sale_approaches.node_add_top()}),$(document).on("click",".add",function(){function e(){t.children("ul").append("<li data-depth="+(parseInt(t.data("depth"))+1)+' data-activity-type-id = "" id="new_activity_type_list">'+App.front_sale_approaches.create_text()+"</li>"),t.children("ul").find("li").last().addClass("dd-item"),App.front_sale_approaches.disabled_by_add_or_edit(),t.children("ul:last").find(".edit-name").focus()}var t=$(this).closest("li"),n=t.children("button");if(0==t.children("ul").length)t.append('<ul class="dd-list"></ul>'),e();else if(n.nextAll(".dd-list").find(".dd-item").length)n.attr("data-action","collapse"),n.nextAll("ul").show(),e();else{App.front_sale_approaches.children_list_show(n).done(function(){e()})}}),$(document).on("click",".edit",function(){var e=$(this).closest("li");t(e.children("div:first")),e.find(".edit-name").focus(),e.find(".edit-name").select(),App.front_sale_approaches.disabled_by_add_or_edit()}),$(document).on("click",".cancel",function(){var e=$(this).closest("li");$(this).hasClass("add_cancel")?(1==$(this).closest("ul").find("li").length&&$(this).closest("ul").remove(),e.remove()):App.front_sale_approaches.edit_cancel(e.children("div:first")),App.front_sale_approaches.remove_disabled()}),$(document).on("click",".decision",function(){e($(this))}),$(document).on("click",".delete",function(){var e=I18n.t("js.common.confirm_delete",{name:$(this).closest("li").find(".de_tip").first().text()});if(confirm(e)){$(".btn").prop("disabled",!0);var t=$(this).closest("li"),n=$(this).closest("li").data("activity-type-id");$("#activity_type_id").val(n),$("#activity_type_activity_type_list_id").val(t.attr("id")),$("#activity_type_edit_form").attr("method","delete"),$("#activity_type_edit_form").attr("action","/xhr/sale_approaches/activity_types/destroy"),$("#activity_type_edit_form").submit()}}),$(document).on("click",".default_link",function(){if(!$(this).hasClass("add-disabled")){var e=$(this),t=e.parents("li").data("activity-type-id");$(this).hasClass("selected")?$.ajax({url:"/xhr/sale_approaches/activity_types/unset_default/",type:"POST",dataType:"json",data:{id:t},context:e}).done(function(){$(".default_link.selected").removeClass("selected")}):$.ajax({url:"/xhr/sale_approaches/activity_types/set_default/",type:"POST",dataType:"json",data:{id:t},context:e}).done(function(){$(".default_link.selected").removeClass("selected"),e.addClass("selected")})}})},setup_talk_script_form:function(e,t,n){var i=$(e),a=$(t),s=$(n);a.on("change",function(){if(this.value){for(var e=Array.prototype.slice.call(this.files,0,this.files.length),t=0,n=0;n<e.length;n++)t+=e[n].size;31457280<t?alert(I18n.t("js.sale_approaches.file_size_below")):App.front_sale_approaches.upload_talk_script(this.files,s)}}),$(document).on("dragover drop",function(e){e.preventDefault()}),i.on({dragover:function(){$(this).addClass("file-dragover")},dragleave:function(){$(this).removeClass("file-dragover")},drop:function(e){if($(this).removeClass("file-dragover"),!$(this).hasClass("disabled")){var t=e.originalEvent.dataTransfer.files;if(t)if(0<$.grep(t,function(e){return""===e.type}).length||t.length<=0)alert(I18n.t("js.sale_approaches.drop_file"));else{for(var n=Array.prototype.slice.call(t,0,t.length),i=0,a=0;a<n.length;a++)i+=n[a].size;31457280<i?alert(I18n.t("js.sale_approaches.file_size_below")):App.front_sale_approaches.upload_talk_script(t,s)}}}}),$(document).on("click",".js-talk-script-uploaded-delete",function(){var e=$(this).parent("li"),t=e.data("uploaded-id");if(""!=t){if(0!==$("[name=delete_talk_script_id]").length){var n=$("[name=delete_talk_script_id]"),i=""!=n.val()?n.val().split(","):[];return i.push(t),n.val(i.join(",")),void e.remove()}$.ajax({url:"/xhr/sale_approaches/talk_script/destroy",type:"POST",dataType:"json",data:{id:t}}).done(function(){e.remove()}).fail(function(e){console.log(e)})}else e.remove()})},upload_talk_script:function(e,t){var n,i=$(".js-disabled-target"),a=t.children("li").length,s=e.length,o=new FormData;for(i.prop("disabled",!0),i.addClass("disabled"),n=0;n<s;n++){var r=a+n;t.append('<li data-upload-index="'+r+'" data-uploaded-id=""><span class="text-muted js-talk-script-file-name">'+e[n].name+'</span><div class="progress progress-striped active"><div class="progress-bar" style="width: 0%"></div></div></li>'),o.append("files["+r+"]",e[n])}o.append("uploaded_file_id",$("[name=talk_script_id]").val()),window.sale_approaches.xhr.files.upload_talk_scripts=$.ajax({url:"/xhr/sale_approaches/talk_script/create",type:"POST",dataType:"script",processData:!1,contentType:!1,cache:!1,data:o,xhr:function(){var e=$.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=parseInt(e.loaded/e.total*100);$(".progress .progress-bar").css("width",t+"%")},!1),e}}).done(function(){i.removeClass("disabled"),i.prop("disabled",!1)}).fail(function(e){console.log(e)})},activity_type_display_all:function(n){$.ajax({url:"/xhr/sale_approaches/activity_types/activity_types_tree_index_html",type:"GET",data:{btn_name:n},dataType:"html"}).done(function(e){var t=$("#activity_type_tree");t.empty(),t.append(e).find(".hp-tooltip").tooltip({trigger:"hover"}),$(".forbid-add, .forbid-delete").prop("disabled",!0),t.find("li").each(function(){var e=$(this).data("activity-type-id"),t="App.front_sale_approaches.get_modal_to_related_activities('#sale_approach_relation"+e+"',"+e+");";$(this).find(".activity_link").first().attr("onclick",t)}),$("#activity_type_tree .dd-list").show(),$("#activity_type_size").val(t.children("li").length),"add_top"===n&&App.front_sale_approaches.node_add_top(),"all_open"===n&&t.find(".hp-tooltip").tooltip({trigger:"hover"})}).fail(function(e){console.log(e)}).always(function(){$("#loading-area").css("display","none")})},node_add_top:function(){$("#activity_type_setting_dialog").find("#parent ul:first").append('<li class="dd-item" data-depth="1" data-activity-type-id = "" id="new_activity_type_list">'+App.front_sale_approaches.create_text()+"</li>"),$(".edit-name").last().focus(),App.front_sale_approaches.disabled_by_add_or_edit()},create_text:function(){return'<div class="row-span">\n<span class="none"></span>\n<span class="input row-span"><input type="text" name="name" class="edit-name add_decision_input" value=""></span>\n<span class="ml10 row-span"><a href="javascript:void(0)" class="sub-bnt decision add_decision task-button" tabindex="-1">'+I18n.t("js.common.save")+'</a></span>\n<span class="ml15 row-span"><span class="sub-bnt cancel add_cancel delete-button">'+I18n.t("js.common.cancel")+'</span></span>\n<span class="none"></span>\n<span class="none"></span>\n<span class="none"></span>\n<span class="none"></span>\n</div>'},disabled_by_add_or_edit:function(){$(".add,.edit,.delete,.activity_link,.add_top,.sortable_all,.default_link,.folding,#all_open,#all_close").addClass("add-disabled hp-tooltip"),$(".activity_link").removeAttr("onclick","target"),$(".add-disabled").prop("disabled",!0),$(window).off("scroll")},remove_disabled:function(){$(".add-disabled,.btn").prop("disabled",!1),$(".add,.edit,.delete,.activity_link,.add_top,.sortable_all,.default_link,.folding,#all_open,#all_close").removeClass("add-disabled hp-tooltip"),$("#activity_type_tree").find("li").each(function(){var e=$(this).data("activity-type-id"),t="App.front_sale_approaches.get_modal_to_related_activities('#sale_approach_relation"+e+"',"+e+");";$(this).find(".activity_link").first().attr("onclick",t)}),$(".forbid-add, .add-disabled").prop("title",""),$(".forbid-add, .forbid-delete,.limit-activity-type").prop("disabled",!0)},children_list_show:function(t){if(!$(t).nextAll(".dd-list").find(".dd-item").length){parent_id=$(t).parent("li").data("activity-type-id");var e=new $.Deferred;return $.ajax({url:"/xhr/sale_approaches/activity_types/append_children/",type:"GET",dataType:"html",data:{parent_id:parent_id},context:$(t)}).done(function(e){$(t).attr("data-action","collapse"),$(t).nextAll(".dd-list").empty(),$(t).nextAll(".dd-list").append(e).find(".hp-tooltip").tooltip({trigger:"hover"}),$(t).nextAll("ul").show(),$(".forbid-delete,.forbid-add").prop("disabled",!0)}).fail(function(e){console.log(e)}).always(function(){e.resolve()}),e}$(t).hasClass("dd-expand")||$(t).attr("data-action","collapse"),$(t).nextAll("ul").show()},edit_cancel:function(e){e.children("span").removeClass("none"),e.children("span").eq(2).addClass("none"),e.children("span").eq(3).addClass("none"),e.children("span").eq(4).addClass("none")},confirm_text:function(e,t,n){e='<div class="row-span">\n<span class="row-span"><span class="default_link"><i class="fa fa-star"></i></span></span>\n<span class="text de_tip" data-html="true">'+e+'</span>\n<span class="input none row-span"><input type="text" name="name" class="edit-name" value=""></span>\n<span class="ml10 none row-span"><a href="javascript:void(0)" class="sub-bnt decision task-button" tabindex="-1">'+I18n.t("js.common.save")+'</a></span>\n<span class="ml15 none row-span"><span class="sub-bnt cancel delete-button">'+I18n.t("js.common.cancel")+"</span></span>\n";return e+=t<5?'<span class="ml10 row-span"><span class="sub-bnt add"><i class="fa fa-plus-circle"></i></span></span>\n':'<span class="ml10 row-span"><span class="sub-bnt add forbid-add hp-tooltip" title="'+I18n.t("js.sale_approaches.max_hierarchy")+'"><i class="fa fa-plus-circle"></i></span></span>\n',e+='<span class="ml15 row-span"><span class="sub-bnt edit"><i class="fa fa-pencil"></i></span></span>\n<span class="ml15 row-span"><span class="sub-bnt delete" title=""><i class="fa fa-trash"></i></span></span>\n',e+='<span class="ml15 row-span"><a class="sub-bnt activity_link hp-tooltip" href="javascript:void(0)" tabindex="-1" title="'+I18n.t("js.sale_approaches.activity_link")+'"><i class="fa fa-link"></i></a>\n<input type="hidden" id="sale_approach_relation'+n+'" data-activity-type-id="'+n+'" data-relation-flg="false"></span>\n</div>'},add_collapse:function(e){0==e.children("button").length&&0==e.children("#activity_type_tree").length&&e.prepend('<button class="folding" data-action="collapse">Expand></button>')},folding:function(){$(document).on("click",".dd-item button",function(){"expand"==$(this).attr("data-action")?App.front_sale_approaches.children_list_show(this):($(this).hasClass("dd-collapse")||$(this).attr("data-action","expand"),$(this).nextAll("ul").hide())}),$(document).on("click","#all_open",function(){$("#loading-area").css("display","block"),App.front_sale_approaches.activity_type_display_all("all_open"),$(btn).nextAll(".dd-list").append(data).find(".hp-tooltip").tooltip({trigger:"hover"})}),$(document).on("click","#all_close",function(){$("#activity_type_tree .dd-list").hide(),$("#activity_type_tree .folding").attr("data-action","expand")})},table_check_cnt:function(t){$(document).on("click",t,function(){var e=0;$(t).each(function(){this.checked&&e++}),$("[data-selected-number]").text("\uff08"+e+"\uff09")})},get_modal_to_search_activity_types:function(e){$(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_selected_activity_type_ids").val($(e).select2("data").map(function(e){return e.id})),$("#js_get_modal_to_search_activity_types").submit()},get_modal_to_related_activities:function(e,t){$(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_selected_activity_ids").val($(e).val()),$("#js_activity_type_id").val(t),$("#js_activity_type_size").val($("#activity_type_tree").children("li").length),$("#js_get_modal_to_related_activities").submit()},add_fields_for_sale_approaches:function(e,t,n){if(10<=$(e).parent().find("li").filter(function(){return"none"!==$(this).css("display")}).length)return alert(I18n.t("js.sale_approaches.item_set")),!1;add_fields(e,t,n),$(".sortable").find('input[type="text"], textarea').off("mousedown.ui-disableSelection selectstart.ui-disableSelection").on("mousedown.ui-disableSelection selectstart.ui-disableSelection",function(e){e.stopImmediatePropagation()})},change_order_summary:function(e){var t=$("#"+e);$(document).on("click","#"+e+" .order_head_summary",function(){$.ajax({type:"GET",url:t.data("remote-url"),dataType:"script",data:{order_key:$(this).data("order-key"),order_type:$(this).data("order-type"),order_flg:!0},beforeSend:function(){t.html($('<div style="padding: 30px 0;text-align: center;color: #bf0000;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'))}}).fail(function(){t.html($('<div class="text-muted" style="padding: 30px 0;text-align: center;"><span>'+I18n.t("js.sale_approaches.load_error")+"</span></div>"))}).always(function(){t.find(".loading").remove()})})},xhr_change_display_template_for_deal:function(){$(document).on("change","#js_select_change_display_template",function(){if($("#js_select_change_display_template").hasClass("action_for_xhr_deals")){var e=$("#js_form_change_display_template");e.attr("action","/xhr/deals/new_modal"),e.data("remote",!0),e.on("ajax:success",function(e,t){var n=RelationModals.find_or_create_dom("history_relation_deal_container");n.html(t),n.find(".hidden-xs").addClass("hidden-xs-on-modal"),RelationModals.resetAssociatedButton(),RelationModals.changeDisplayTemplate(n,$(this)),App.front_deals.init_form_from_another_controller(!1),RelationModals.attachForm(n,$("#new_deal"),"deal","#new_submit"),$("#js_select_change_display_template").addClass("action_for_xhr_deals"),ClientEditForm.init('[name="deal[client_id]"]'),ClientEditForm.change('[name="deal[client_id]"]',"#deal_client_id")})}else $("#js_select_change_display_template").removeClass("action_for_xhr_deals")})},clear_sale_approaches_search_modal:function(e,t,n){e.stopPropagation(),t=t||"#form_xhr_sale_approaches_search",n=n||"#status, #start_contract_at, #end_contract_at, #activity_type, #search_segment_id",$Modal=$(t),$Modal.find("#start_contract_at").val(""),$Modal.find("#end_contract_at").val(""),$Modal.find("#status").val(""),$Modal.find("#activity_type").val(""),$Modal.find("#search_segment_id").val(""),$Modal.find("input").not("input[name='_method']").not("input[name='authenticity_token']").not("input[name^='segment-icon']").not(":checkbox").not(".non_clear").val(""),$(n).trigger("change")},set_associate_entities_to_s2_with_new_option:function(e,a,t,n){$(document).on("click",e,function(){var i=jQuery.map($(t+":checked"),function(e){return $(e).val()});return 0==i.length?(alert(I18n.t("js.common.please_select")),!1):jQuery.map($(t+":checked"),function(e){return $(e).data("check-permission")}).some(function(e){return e})?(alert(I18n.t("js.common.can_not_add_private_item")),!1):(i.push.apply(i,jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value})),$('input[name="another_controller_type"]').val()==CONST_ANOTHER_CONTROLLER_TYPE_SALE_APPROACHES&&(i=i.filter(function(e){return e!=$('input[name="exclude_sale_approach_id"]').val()})),void $.ajax({url:"/xhr/"+n+"/existence/",type:"POST",dataType:"json",data:{ids:i},context:$(this)}).done(function(n){n.does_not_exist_ids.length&&jQuery.each(n.does_not_exist_ids,function(e,t){i=jQuery.grep(i,function(e){return e!=t})}),$.each(i,function(e,t){option_slector='option[value="'+t+'"]',0==$(a).find(option_slector).length&&(activity_name=n.exist_activities[t],activity_name&&(option_dom='<option value="'+t+'">'+activity_name+"</option>",$(a).append(option_dom)))}),$(a).val(i).trigger("change"),$(a).select2("open"),$(a).select2("close"),$(this).closest(".modal").modal("hide")}))})},attach_new_activity_lists_form:function(n){var i=$("#new_activity_lists");i.data("remote",!0),i.on("submit",function(){$("#modal_error_message").empty()}),n.find("#new_submit").off("click"),n.find("#new_submit").on("click",function(e){e.preventDefault(),$("#modal_error_message").empty();var t=new FormData($(i).get(0));return t.append("format","json"),$.ajax($(i).attr("action"),{type:"post",processData:!1,contentType:!1,data:t}).done(function(e){e.message?$("#modal_error_message").html(e.message):(App.front_sale_approaches.reload_ajax_element("#correspondence_history_area"),n.modal("hide"))}),!1})},init_form_sales_implementation_wizard:function(e){if("all"==e&&1e4<$("#js-client-sale-approach-count").data("sale-approach-count"))error_message="\u691c\u7d22\u7d50\u679c\u304c10,000\u4ef6\u4ee5\u4e0b\u306b\u306a\u308b\u3088\u3046\u306b\u691c\u7d22\u6761\u4ef6\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \uff0a\u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u306f\u4e00\u5ea6\u306b10,000\u4ef6\u307e\u3067\u9001\u4fe1\u3067\u304d\u307e\u3059\u3002",$("#sale_approaches_message_area").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul class="list-unstyled">        <li>'+error_message+"</li>      </ul>    </div>  </div></div>"),$(".ha-loading").hide();else{$(".js-open-modal-errors-messages button.close").click(),$(".ha_exclusion_id").val(null),$("#ha_exclusion").val(null),$("#ha_exclusion").select2("val",""),$("#form_sale_template_customer_id").val(""),$("#form_sale_template_customer_id").select2("val",""),App.front_sale_approaches.reset_step3_wizard($("#form_sale_template_customer_id")),$("#form_sale_template_contact_id").val(""),$("#form_sale_template_contact_id").select2("val",""),App.front_sale_approaches.reset_step4_wizard($("#form_sale_template_contact_id")),(n=$("#sale_approaches_searches_register_form").parent("form")).find("input[name='company_basic_infomation_ids[]']").remove();var t=$("#business_activities_lead_lists_area input[name='checked[client_sale_approach_ids][]']:checked"),n=[];$.each(t,function(e,t){n.push($(t).data("company_basic_information_id"))}),$(".company_basic_infomation_ids").val(n.join(",")),$(".ha-exclusion-css").attr("style","display: none !important"),$("#js_ha_delete_exclusion").attr("disabled",!0),$(".register_form_type").val(e),current_fs=$("fieldset").eq($("#progressbar li").index($("#progressbar li.active").last())),next_fs=$("fieldset").eq(0),current_clicked_element=$("#progressbar li").eq(0),$(".js-form-sale-queues-errors").html(""),current_fs.hide(),next_fs.show(),current_clicked_element.hasClass("active")?App.front_form_sale_wizard.removeActiveClass(current_clicked_element.next()):App.front_form_sale_wizard.addActiveClass(current_clicked_element),$("#ha_exclusion").trigger("change")}},sendClientCsv:function(e){$(".ha-loading").show();var t=new FormData;try{var n=$(e)[0].files[0];if(t.append("file",n),!n)return;var i=$(e).data("href");$.ajax({url:i,type:"POST",dataType:"json",data:t,contentType:!1,processData:!1,success:function a(e){App.front_sale_approaches.resetAlertNotice(),e.job_created?e.old_clients.length?$("#js_search_success_message").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-success alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul class="list-unstyled">        <li>'+I18n.t("js.content_activity_list.notice_import_succeed")+"</li>        <li>"+I18n.t("js.content_activity_list.notice_import_include_old_client",{old_clients_count:e.old_clients.length})+"</li>      </ul>    </div>  </div></div>"):$("#js_search_success_message").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-success alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul class="list-unstyled">        <li>'+I18n.t("js.content_activity_list.notice_import_succeed")+"</li>      </ul>    </div>  </div></div>"):$("#js_error_message").html('<div class="row">  <div class="col-xs-12">    <div class="alert alert-danger alert-error alert-dismissible" role="alert">      <button type="button" class="close" data-dismiss="alert" aria-label="Close">        <span aria-hidden="true">\xd7</span>      </button>      <ul class="list-unstyled">        <li>'+I18n.t("js.content_activity_list.notice_import_failed")+"</li>      </ul>    </div>  </div></div>"),$(".ha-loading").hide(),$("#myInput").val("")}})}catch(s){return void $(".ha-loading").hide()}},resetAlertNotice:function(){$("#js_error_message span").click(),$("#js_search_success_message span").click(),$("#sale_approaches_message_area .alert span").click()}},App.front_saml_settings={"new":function(){this.submit_new(),this.toggle_event(),this.user_agent_event()},create:function(){this.submit_new(),this.toggle_event(),this.user_agent_event()},edit:function(){this.submit_edit(),this.submit_edit_from_modal(),this.toggle_event(),this.user_agent_event()},update:function(){this.submit_edit(),this.submit_edit_from_modal(),this.toggle_event(),this.user_agent_event()},submit_new:function(){$("#new_submit").on("click",function(){$("form.new_saml_setting").submit()})},submit_edit:function(){user_agent=$("#smartphone-user-agent-was").data("smartphone-user-agent-was"),$("#new_submit").on("click",function(){if(input_user_agent=$("#saml_setting_smartphone_user_agent").val(),user_agent!=input_user_agent)return $("#alert-user-agent-changes").modal("show"),!1;$("form.edit_saml_setting").submit()})},submit_edit_from_modal:function(){$("#edit_submit_from_modal").on("click",function(){$("form.edit_saml_setting").submit()})},toggle_event:function(){this.toggle_field(),_this=this,$("input[class=saml-setting]").change(function(){_this.toggle_field()})},toggle_field:function(){"true"==$("input[class=saml-setting]:checked").val()?$(".saml-field").toggle(!0):$(".saml-field").toggle(!1)},user_agent_event:function(){this.user_agent_field(),_this=this,$("input[class=user-agent]").change(function(){_this.user_agent_field()})},user_agent_field:function(){"smart_phone_app"==$("input[class=user-agent]:checked").val()?$(".smartphone_user_agent").prop("disabled",!1):$(".smartphone_user_agent").prop("disabled",!0)}},App.front_scores={attach_event_handlers:function(e){e=e||"#campaign-scoring-condition",$(e).on("nested:fieldRemoved",function(e){e.stopPropagation()})}},App.search_visible_fields={setup_list_search_visible_setting:function(){$("#search_visible_fields_setting_dialog").find(".js_search_list_field").change(function(){App.search_visible_fields.change_search_visibility($(this)),$(document).trigger("floatTableUpdate")})},show_list_fields_setting:function(e,t,n){void 0===e&&(e=I18n.t("js.search_visible_fields.advanced_search")),void 0===t&&(t=I18n.t("js.common.close")),void 0===n&&(n=I18n.t("js.common.select_item"));$("#search_visible_fields_setting_dialog").removeClass("hide").dialog({modal:!0,title:e,width:400,title_html:!0,draggable:!0,buttons:[{text:t,"class":"btn btn-primary btn-xs",click:function(){$(this).dialog("close")}}],beforeClose:function(){if(0==$(this).find("input[name=search_visible_fields\\[\\]]:checked").length)return alert(n),!1},close:function(){var e=[];$(this).find("input[type=checkbox]:checked").each(function(){e.push($(this).val())}),App.search_visible_fields.save_search_visible_fields(e.join(","))}})},change_search_visibility:function(e){var t=$(".js_search_visibility_"+e.val());if(t.is(":visible")){t.hide(),t.find(":input").val(null).trigger("change");var n=t.siblings(),i=n.filter(function(){return"none"===this.style.display}).length;n.length===i&&t.parent(".row").hide()}else t.show(),t.parent().show()},save_search_visible_fields:function(){$("#frm_search_visible_fields").submit()}},App.searches={callForSearchCondition:{init:function(){var t=this;$(".call-for-search-condtion-content [data-hp-role='select_searches']").each(function(){var e=$(this).select2(t.select2Config($(this))).data("select2");e.onSelect=t.select2OnSelect(e.onSelect),$(this).on("select2-loaded",function(){$(".search-select .hp-tooltip").tooltip({container:"body",template:$("#searchSelect2TooltipContenair").html(),trigger:"hover"})})})},select2Config:function(e){return{width:e.data("width"),minimumInputLength:e.data("minlen"),placeholder:e.data("prompt"),ajax:{url:function(e){return $(this).data("action")+"&name_cont="+encodeURIComponent(e)},results:function(e){return{results:e}},cache:!0},initSelection:function(e,t){var n=e.val();null!=n&&$.ajax({type:"get",url:e.data("action"),data:{id_eq:n}}).done(function(e){t(e[0])})},formatResult:function(e){var n=$("#selectSearchesContentTemplate").html();return $.each(e,function(e,t){n=n.replace("{{"+e+"}}",t)}),n},formatSelection:function(e){return e.name}}},select2OnSelect:function(r){return function(e,t){if(null==t)return $.get(e.link),r.apply(this,arguments);var n=$(t.target);switch(n.trigger("mouseleave"),n.data("hpRole")){case"delete-link":window.confirm(n.data("confirm"))&&($.ajax({url:n.data("action"),type:"DELETE"}).done(function(){$(".call-for-search-condtion-content [data-hp-role='select_searches']").each(function(){$(this).select2("val","")})}),this.close());break;case"share-link":case"default-search-star":""!==n.data("action")&&($.get(n.data("action")),this.close());break;default:r.apply(this,arguments);var i=this.container.closest("form"),a=i.attr("action"),s=i.attr("method"),o=i.data("local-url");$("#portlet_id").val(""),$("#chart_segment_type").val(""),$("#chart_segment_ids").val(""),$("#is_others").val(""),$("#is_nil_segment_value_included").val(""),o&&(i.attr("action",o),i.attr("method","GET"),i.removeAttr("data-remote"),i.removeData("remote")),$(".search-form-clear").prop("disabled",!0),i.submit(),o&&(i.attr("method",s),i.attr("data-remote","true"),i.attr("action",a))}}}}},App.front_segments={index:function(){App.concerns.change_display_number("hp-form_search_segments"),App.concerns.change_order("hp-form_search_segments"),App.visible_fields.setup_list_visible_setting(),App.search_visible_fields.setup_list_search_visible_setting(),$(".hp-page [data-hp-role='table-config']").on("click",function(){App.visible_fields.show_list_fields_setting()}),$(".hp-page [data-hp-role='search-config']").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.concerns.switch_search_form($(".hp-page [data-hp-role='form-switch']")),App.front_segments.set_segment_select2("#search_segment_ids"),$(".hp-page [data-hp-role='select2']").select2({minimumResultsForSearch:20})},show:function(){$(".tab-menu-items").click(function(){if($(this).hasClass("active"))return!1;$(".tab-menu-items").removeClass("active"),$(this).addClass("active")}),$(document).on("click",".relation-tab-menu-items",function(){if($(this).hasClass("relation-tab-active"))return!1;$(".relation-tab-menu-items").removeClass("relation-tab-active"),$(this).addClass("relation-tab-active"),$(".relation-tabs").removeClass("active-tab"),$(this).parent().addClass("active-tab")}),this.ajax_load()},"new":function(){this.ajax_load(),this.submit_new(),this.original_icon_radio(),this.display_switch(),this.previewFile()},create:function(){this.display_switch(),this.submit_new(),this.original_icon_radio(),this.previewFile()},edit:function(){this.lead_stage_modal(),this.client_rank_modal(),$('input[name="current_window"]').val("basic_info"),$('input[name="target_window"]').val("basic_info"),$(".tab-menu-items").click(function(){return!$(this).hasClass("active")&&(!$(basic_info_tab).hasClass("active")||"1"!=$('input[name="image_change_flg"]').val()&&$('input[name="segment_name"]').val()==$('input[name="segment[name]"]').val()&&$('input[name="segment_status"]').val()==$('input[name="segment[status]"]:checked').val()&&$('input[name="segment_memo"]').val()==$('textarea[name="segment[memo]"]').val()?$(report_tab).hasClass("active")&&("true"==$("#init_aggregation_point_setting").val()!=!$("#segment_aggregation_point_setting").prop("checked")||$("#init_aggregation_point_setting_unit").val()!=$("#segment_aggregation_point_setting_unit").val()||"1"==$("#segment_aggregation_point_setting_unit").val()&&$("#init_aggregation_point_setting_details").val()!=$("#segment_aggregation_point_setting_details_date").val()||"2"==$("#segment_aggregation_point_setting_unit").val()&&$("#init_aggregation_point_setting_details").val()!=$("#segment_aggregation_point_setting_details_day").val())?(confirm($('input[name="confirm_message"]').val())&&($('input[name="target_window"]').val($(this)[0].name),$("#edit_submit").click(),$(".tab-menu-items").removeClass("active"),$(this).addClass("active")),!1):($(".tab-menu-items").removeClass("active"),void $(this).addClass("active")):(confirm($('input[name="confirm_message"]').val())&&($('input[name="target_window"]').val($(this)[0].name),$("#edit_submit").click(),$(".tab-menu-items").removeClass("active"),$(this).addClass("active")),!1))}),$(document).on("click",".relation-tab-menu-items",function(){if($(this).hasClass("relation-tab-active"))return!1;$(".relation-tab-menu-items").removeClass("relation-tab-active"),$(this).addClass("relation-tab-active"),$(".relation-tabs").removeClass("active-tab"),$(this).parent().addClass("active-tab")}),active=$(".active-tab"),$(document).on("mouseover","#relation_data_navigation li",function(){$("#slide-line").css({left:$(this).position().left+25})}).on("mouseout","#relation_data_navigation li",function(){$("#slide-line").css({left:$(".active-tab").position().left+25})}),$("#edit_submit").show(),this.ajax_load(),this.submit_edit(),this.original_icon_radio(),this.display_switch(),this.previewFile()},update:function(){this.ajax_load(),this.submit_edit(),this.original_icon_radio(),this.display_switch(),this.previewFile()},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("form#new_segment").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$("#edit_submit").prop("disabled",!0),$(".tab-menu-items").prop("disabled",!0),$("form.edit_segment").submit()})},submit_report_edit:function(){$("#report_edit_submit").on("click",function(){$(this).attr("disabled",!0),$(".tab-menu-items").prop("disabled",!0),$("form.edit_segment").submit()})},original_icon_radio:function(){$('input[name="segment[original_flg]"]').on("change",function(){App.front_segments.display_switch(),"1"==$('input[name="image_change_flg"]').val()?$('input[name="image_change_flg"]').val("0"):$('input[name="image_change_flg"]').val("1")})},display_switch:function(){$("#segment_original_flg_1").is(":checked")?($('td[name="file_select"]').show(),$('img[name="segment[image_data]"]').show(),$('img[name="segment[default_image]"]').hide()):($('td[name="file_select"]').hide(),$('img[name="segment[image_data]"]').hide(),$('img[name="segment[default_image]"]').show())},previewFile:function(){$('input[name="segment[image_data]"]').on("change",function(){document.querySelector("img");var e=document.querySelector("input[type=file]").files[0],t=new FileReader,n=2097152;e.size>n?(alert("\u9078\u629e\u3059\u308b\u753b\u50cf\u306f2MB\u4ee5\u4e0b\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002"),$('input[type="file"]').val(null)):(t.addEventListener("load",function(){$('img[name="segment[image_data]"]').attr("src",t.result)},!1),e&&(t.readAsDataURL(e),$('input[name="image_change_flg"]').val("1")))})},basic_info:function(){$(".tab-menu-items").removeClass("active"),$(basic_info_tab).addClass("active"),this.ajax_load(),this.original_icon_radio(),this.previewFile(),this.display_switch(),$("#edit_submit").show(),$("#edit_submit").prop("disabled",!1),$(".tab-menu-items").prop("disabled",!1)},lead_stage:function(){this.ajax_load(),this.disabled_area(),this.set_display_area(),$("#edit_submit").hide(),App.concerns.set_tooltip(),this.arrow_height(),$(".tab-menu-items").prop("disabled",!1)},client_rank:function(){this.ajax_load(),this.disabled_area(),this.set_display_area(),$("#edit_submit").hide(),App.concerns.set_tooltip(),this.arrow_height(),$(".tab-menu-items").prop("disabled",!1)},report:function(){$(".tab-menu-items").removeClass("active"),$(report_tab).addClass("active"),App.concerns.set_tooltip(),this.select_box_value(),this.select_box_disabled(),
this.submit_report_edit(),this.ajax_load(),$("#edit_submit").hide(),$(".tab-menu-items").prop("disabled",!1)},select_box_disabled:function(){$("#segment_aggregation_point_setting").on("change",function(){$("#segment_aggregation_point_setting").is(":checked")?($("#segment_aggregation_point_setting_unit").attr("disabled",!0),$("#segment_aggregation_point_setting_details_date").attr("disabled",!0),$("#segment_aggregation_point_setting_details_day").attr("disabled",!0)):($("#segment_aggregation_point_setting_unit").attr("disabled",!1),$("#segment_aggregation_point_setting_details_date").attr("disabled",!1),$("#segment_aggregation_point_setting_details_day").attr("disabled",!1))})},arrow_height:function(){var e=$(lead_table).height()-20;$(arrow_up).height(e/2),$(arrow_down).height(e/2)},select_box_value:function(){$("#segment_aggregation_point_setting_unit").on("change",function(){"1"==$("#segment_aggregation_point_setting_unit").val()?($("#segment_aggregation_point_setting_details_date").show(),$("#segment_aggregation_point_setting_details_day").hide(),$("#segment_aggregation_point_setting_details_date").val(1)):($("#segment_aggregation_point_setting_details_date").hide(),$("#segment_aggregation_point_setting_details_day").show(),$("#segment_aggregation_point_setting_details_day").val(1))})},relation_data:function(){this.relation_data_campaign(),$(document).on("click",".hp-page [data-hp-role='table-config']",function(){App.visible_fields.show_list_fields_setting()})},relation_data_campaign:function(){this.relation_data_common_action(),App.visible_fields.setup_list_visible_setting(),App.concerns.change_order("hp-form_search_campaigns"),App.concerns.change_display_number("hp-form_search_campaigns"),App.concerns.set_form_action_to_submit("#form_checked_campaigns","#js_remove_submit",!0),this.set_column_span(".js_leads_detail_parent",["hot_lead_cnt","reaction_lead_cnt","no_reaction_lead_cnt"]),this.set_column_span(".js_notification_parent",["hot_notification_flg","hot_lead_notification_flg","weekly_summary_flg","hot_notification_mail_to_user_ids"]),this.set_associate_entities_add_action("#campaigns_multiple_decision",'input[name="associate_campaigns[]"]',"campaign"),this.enable_segment_associattion_search_modal("#open_campaign","/xhr/campaigns/search_as_association_modal","multiple")},relation_data_seminar:function(){this.relation_data_common_action(),App.visible_fields.setup_list_visible_setting(),App.concerns.change_order("hp-form_search_seminars"),App.concerns.change_display_number("hp-form_search_seminars"),App.concerns.set_form_action_to_submit("#form_checked_seminars","#js_remove_submit",!0),this.set_associate_entities_add_action("#seminars_multiple_decision",'input[name="associate_seminars[]"]',"seminar"),this.enable_segment_associattion_search_modal("#open_seminar","/xhr/seminars/search_as_association_modal","multiple")},relation_data_web_form:function(){this.relation_data_common_action(),App.visible_fields.setup_list_visible_setting(["site_name","name","public_url"]),App.concerns.change_order("hp-form_search_web_forms"),App.concerns.change_display_number("hp-form_search_web_forms"),App.concerns.set_form_action_to_submit("#form_checked_web_forms","#js_remove_submit",!0),this.set_associate_entities_add_action("#web_forms_multiple_decision",'input[name="associate_web_forms[]"]',"web_form"),this.enable_segment_associattion_search_modal("#open_web_form","/xhr/web_forms/search_as_association_modal","multiple")},relation_data_business_activity:function(){this.relation_data_common_action(),App.visible_fields.setup_list_visible_setting(),this.change_search_activity_type(),App.concerns.change_display_number("hp-form_search_inside_sales"),App.concerns.change_order("hp-form_search_inside_sales"),App.concerns.all_checked_summary_items(),this.table_check_cnt(".summary-check-items.summary-checkbox"),this.set_column_span(".js_re_approach_parent",["approach_today","approach_leakage"]),this.set_column_span(".js_corresponding_period_parent",["period_today","period_expired"]),App.concerns.set_form_action_to_submit("#form_checked_inside_sales","#js_remove_submit",!0),this.set_associate_entities_add_action("#inside_sales_multiple_decision",'input[name="associate_business_activities[]"]',"business_activity"),this.enable_segment_associattion_search_modal("#open_business_activities","/xhr/inside_sales/search_as_association_modal","multiple")},relation_data_deal:function(){this.relation_data_common_action(),App.visible_fields.setup_list_visible_setting(),this.change_display_template(),App.concerns.change_order("hp-form_search_deals"),App.concerns.change_display_number("hp-form_search_deals"),App.concerns.set_form_action_to_submit("#form_checked_deals","#js_remove_submit",!0),this.set_associate_entities_add_action("#deals_multiple_decision",'input[name="associate_deals[]"]',"deal"),this.enable_segment_associattion_search_modal("#open_deal","/xhr/deals/search_modal","multiple")},relation_data_daily_report:function(){this.relation_data_common_action(),App.visible_fields.setup_list_visible_setting(),this.change_display_template(),App.concerns.change_order("hp-form_search_daily_reports"),App.concerns.change_display_number("hp-form_search_daily_reports"),App.concerns.set_form_action_to_submit("#form_checked_daily_reports","#js_remove_submit",!0),this.set_associate_entities_add_action("#daily_reports_multiple_decision",'input[name="associate_daily_reports[]"]',"daily_report"),this.enable_segment_associattion_search_modal("#open_daily_report","/xhr/daily_reports/search_modal","multiple")},relation_data_common_action:function(){this.ajax_load(),$("#edit_submit").hide(),App.concerns.set_tooltip();new Clipboard(".clipboard-btn");App.concerns.all_checked_items(),$(document).off("click","#js_remove_submit"),$("search-associated-resources-modal").remove(),$("search-overlay-associated-resources-modal").remove(),$(".btn").prop("disabled",!1),$(".tab-menu-items").prop("disabled",!1)},disabled_area:function(){area=$("<div>"),inner_area=$("<div>"),area_css={width:"100%",height:"100%","z-index":"9999",position:"fixed","background-color":"#F0F0F0",opacity:"0.6",display:"none"},area.attr("id","display_area"),area.css(area_css),inner_area.attr("id","inner_display_area"),inner_area.css(load_css),inner_area.css({position:"absolute","z-index":"1000"}),$("#inner_display_area").length||$("#disabled_area").prepend(inner_area),$("#segment_lead_stage_status").on("change",function(){App.front_segments.set_display_area(),$("#segment_lead_stage_status").prop("checked")?$("#status_label").text($("#display_status").val()):$("#status_label").text($("#wait_status").val()),$("form.edit_segment").submit()}),$("#segment_client_rank_status").on("change",function(){App.front_segments.set_display_area(),$("#segment_client_rank_status").prop("checked")?$("#status_label").text($("#display_status").val()):$("#status_label").text($("#wait_status").val()),$("form.edit_segment").submit()})},set_display_area:function(){$("#segment_lead_stage_status").prop("checked")?($("#inner_display_area").show(),$("#edit").attr("disabled",!0)):$("#segment_client_rank_status").prop("checked")?($("#inner_display_area").show(),$("#edit").attr("disabled",!0)):($("#inner_display_area").hide(),$("#edit").attr("disabled",!1))},ajax_load:function(){load=$("<div>"),inner_load=$("<div>"),load_css={width:"100%",height:"100%","z-index":"9999",position:"fixed","background-color":"#F0F0F0",opacity:"0.6",display:"none"},load.attr("id","loading"),load.css(load_css),inner_load.attr("id","inner_loading"),inner_load.css(load_css),inner_load.css({position:"absolute","z-index":"1000"}),spinner=$("<div>"),inner_spinner=$("<div>"),spinner_css={"font-size":"8px",top:"50%",left:"50%",width:"1em",height:"1em","border-radius":"50%","text-indent":"-9999em","-webkit-animation":"load5 1.1s infinite ease",animation:"load5 1.1s infinite ease","-webkit-transform":"translateZ(0)","-ms-transform":"translateZ(0)",transform:"translateZ(0)",position:"relative"},spinner.attr("id","spinner"),spinner.css(spinner_css),inner_spinner.attr("id","inner_spinner"),inner_spinner.css(spinner_css),load.append(spinner),inner_load.append(inner_spinner),$("#segment_tab_group").on("ajax:before",function(){$("#inner_loading").length||$("#info_area").prepend(inner_load),$(".btn").prop("disabled",!0),$("#inner_loading").show()}),$("#segment_tab_group").on("ajax:success",function(){$(".btn").prop("disabled",!1),$("#inner_loading").hide()}),$("#segment_tab_group").on("ajax:error",function(){$(".btn").prop("disabled",!1),$("#inner_loading").hide(),$("div#alert-message").html('        <div class="row">          <div class="col-xs-12">            <div class="alert alert-danger alert-error alert-dismissible" role="alert">              <button type="button" class="close" data-dismiss="alert" aria-label="Close">                <span aria-hidden="true">&times;</span>              </button>              <ul>                <li style="word-wrap: break-word;">'+I18n.t("js.common.screen_failed")+"</li>              </ul>            </div>          </div>        </div>")}),$("#relation_data_tab_group").on("ajax:before",function(){$("#inner_loading").length||$("#relation_data_area").prepend(inner_load),$(".btn").prop("disabled",!0),$("#inner_loading").show()}),$("#relation_data_tab_group").on("ajax:success",function(){$(".btn").prop("disabled",!1),$("#inner_loading").hide()}),$("#relation_data_tab_group").on("ajax:error",function(){$(".btn").prop("disabled",!1),$("#inner_loading").hide(),$("div#alert-message").html('        <div class="row">          <div class="col-xs-12">            <div class="alert alert-danger alert-error alert-dismissible" role="alert">              <button type="button" class="close" data-dismiss="alert" aria-label="Close">                <span aria-hidden="true">&times;</span>              </button>              <ul>                <li style="word-wrap: break-word;">'+I18n.t("js.common.screen_failed")+"</li>              </ul>            </div>          </div>        </div>")}),$(".hp-form_search_form").on("submit",function(){$("#inner_loading").length||$("#relation_data_area").prepend(inner_load),$(".btn").prop("disabled",!0),$("#inner_loading").show()}),$(".form_checked").on("submit",function(){$("#inner_loading").length||$("#relation_data_area").prepend(inner_load),$(".btn").prop("disabled",!0),$("#inner_loading").show()})},set_segment_select2:function(e){$(e).select2({allowClear:!0,formatResult:App.front_segments.formatOptionsIcon,formatSelection:App.front_segments.formatOptionsIcon}),$(".segment_hidden_icons").attr("disabled",!0)},change_segment_icon:function(t){$(document).on("change.segment_id",t,function(){var e=$(t).val();$(".segment_icon_area_edit").children("img").attr("src","/xhr/segments/show_icon/?id="+e)}),$(".segment_hidden_icons").attr("disabled",!0)},formatOptionsIcon:function(e){return e.id?(icon=$("#segment-icon-"+e.id).val(),icon?(image='<img class="segment_icon" src="'+icon+'" width="20" height="20" style="position: relative; top: -2px;">',e="<span>"+image+" "+e.text+"</span>"):e.text):e.text},set_life_cycle_funnel_modal:function(e){App.front_segments.initialize_lcf_modal(e.portlet_id,e.aggregation_point_id,e.client_rank,e.lead_stages),$("#portlet_form_search_segment_ids").on("change",{portlet_id:e.portlet_id},function(e){App.front_segments.set_segment_changed_event(e.data.portlet_id)}),$("#portlet_portlet_form_aggregation_point_id").on("change",{portlet_id:e.portlet_id},function(e){App.front_segments.set_aggregation_point_changed_event(e.data.portlet_id)}),$("#aggregation_point__1i, #aggregation_point__2i").on("change",function(){App.front_segments.set_aggregation_point_filter_event()}),$('input[name="portlet_portlet_form[aggregation_point]"]').change(function(){App.front_segments.set_aggregation_point_radio_event(),App.front_segments.switch_display_mode_for_aggregated_date()}),$("#portletEditModal").one("hidden.bs.modal",function(){removeClientRankSession()})},initialize_lcf_modal:function(e,i,a,s){removeClientRankSession(),removeLeadStageSession(),sessionStorage.setItem("client_ranks_at_this","[]"),sessionStorage.setItem("client_ranks_at_that","[]"),sessionStorage.setItem("lead_stages_at_this","[]"),sessionStorage.setItem("lead_stages_at_that","[]");var t=$("#portlet_form_search_segment_ids").val(),o=$("#portlet_portlet_form_client_rank"),r=$("#portlet_portlet_form_lead_stages");if(t){var n=$("#aggregation_point__1i"),l=$("#aggregation_point__2i"),c=$("#portlet_portlet_form_aggregation_point_id");n.children().remove(),l.children().remove(),$.ajax({url:"/xhr/portlets/life_cycle_funnels/init_lcf_configuration/",type:"POST",data:{id:e,segment_id:t,aggregation_point_id:i},remote:!0}).done(function(e){setDateOptions(e.years),e.aggregation_points.forEach(function(e){e.id==i?c.append($("<option selected>").html(e.date).val(e.id)):c.append($("<option>").html(e.date).val(e.id))}),sessionStorage.setItem("client_ranks_at_this",JSON.stringify(e.client_ranks_at_this)),sessionStorage.setItem("client_ranks_at_that",JSON.stringify(e.client_ranks_at_that)),sessionStorage.setItem("lead_stages_at_this",JSON.stringify(e.lead_stages_at_this)),sessionStorage.setItem("lead_stages_at_that",JSON.stringify(e.lead_stages_at_that)),radio=$("#portlet_portlet_form_aggregation_point_0");var t=radio.is(":checked")?e.client_ranks_at_this:e.client_ranks_at_that,n=radio.is(":checked")?e.lead_stages_at_this:e.lead_stages_at_that;all_client_names=t.map(function(e){return e.name}),o.append($("<option>").html(I18n.t("js.life_cycle_funnel.all_client_ranks")).val(all_client_names)),t.forEach(function(e){e.name==a?o.append($("<option selected>").html(e.name).val(e.id)):o.append($("<option>").html(e.name).val(e.id))}),n.forEach(function(e){r.append($("<option>").html(e.name).val(e.id))}),r.val(s).trigger("change"),App.front_segments.switch_display_mode_for_segment(),App.front_segments.switch_display_mode_for_aggregated_date()})}else App.front_segments.switch_display_mode_for_segment()},set_segment_changed_event:function(e){var t=$("#portlet_form_search_segment_ids").val(),n=$("#aggregation_point__1i"),i=$("#aggregation_point__2i"),a=$("#portlet_portlet_form_aggregation_point_id"),s=$("#portlet_portlet_form_client_rank"),o=$("#portlet_portlet_form_lead_stages");if(n.val(""),i.val(""),a.val(""),n.children().remove(),i.children().remove(),a.children().remove(),s.children().remove(),o.children().remove(),o.val([]).trigger("change"),removeClientRankSession(),removeLeadStageSession(),sessionStorage.setItem("client_ranks_at_this","[]"),sessionStorage.setItem("client_ranks_at_that","[]"),sessionStorage.setItem("lead_stages_at_this","[]"),sessionStorage.setItem("lead_stages_at_that","[]"),!t)return $('input:radio[name="portlet_portlet_form[aggregation_point]"]').val(["0"]),n.append($("<option>").html(I18n.t("js.life_cycle_funnel.year")).val("")),a.append($("<option>").html(I18n.t("js.life_cycle_funnel.please_select")).val("")),void App.front_segments.switch_display_mode_for_segment();$.ajax({url:"/xhr/portlets/life_cycle_funnels/reset_lcf_configuration/",type:"POST",data:{id:e,segment_id:t},remote:!0}).done(function(e){setDateOptions(e.years),a.append($("<option>").html(I18n.t("js.life_cycle_funnel.please_select")).val("")),e.aggregation_points.forEach(function(e){a.append($("<option>").html(e.date).val(e.id))}),sessionStorage.setItem("client_ranks_at_this",JSON.stringify(e.client_ranks)),sessionStorage.setItem("lead_stages_at_this",JSON.stringify(e.lead_stages)),$('input:radio[name="portlet_portlet_form[aggregation_point]"]').val(["0"]),all_client_names=e.client_ranks.map(function(e){return e.name}),s.append($("<option>").html(I18n.t("js.life_cycle_funnel.all_client_ranks")).val(all_client_names)),e.client_ranks.forEach(function(e){s.append($("<option>").html(e.name).val(e.id))}),e.lead_stages.forEach(function(e){o.append($("<option>").html(e.name).val(e.id))}),lss=e.lead_stages.map(function(e){return e.id}),o.val(lss).trigger("change"),App.front_segments.switch_display_mode_for_segment(),App.front_segments.switch_display_mode_for_aggregated_date()})},set_aggregation_point_filter_event:function(){var i=$("#aggregation_point__1i").find("option:selected").val(),e=$("#aggregation_point__2i").find("option:selected").val(),a=!!e&&("0"+e).slice(-2),t=$("#portlet_portlet_form_aggregation_point_id");t.find("option").removeClass("hidden"),t[0].selectedIndex=0,t.find("option").each(function(){if($(this).val()){var e=$(this).html().split("/"),t=i&&e[0]!=i,n=a&&e[1]!=a;(t||n)&&$(this).addClass("hidden")}})},set_aggregation_point_changed_event:function(e){var t=$("#portlet_form_search_segment_ids").val(),n=$("#portlet_portlet_form_client_rank"),i=$("#portlet_portlet_form_lead_stages"),a=$("#portlet_portlet_form_aggregation_point_id");n.children().remove(),i.children().remove(),i.val([]).trigger("change"),sessionStorage.removeItem("client_ranks_at_that"),sessionStorage.removeItem("lead_stages_at_that"),$.ajax({url:"/xhr/portlets/life_cycle_funnels/reset_client_ranks_and_lead_stages/",type:"POST",data:{id:e,segment_id:t,aggregation_point_id:a.val()},remote:!0}).done(function(e){all_client_names=e.client_ranks.map(function(e){return e.name}),n.append($("<option>").html(I18n.t("js.life_cycle_funnel.all_client_ranks")).val(all_client_names)),e.client_ranks.forEach(function(e){n.append($("<option>").html(e.name).val(e.id))}),e.lead_stages.forEach(function(e){i.append($("<option>").html(e.name).val(e.id))}),lss=e.lead_stages.map(function(e){return e.id}),i.val(lss).trigger("change"),sessionStorage.setItem("client_ranks_at_that",JSON.stringify(e.client_ranks)),sessionStorage.setItem("lead_stages_at_that",JSON.stringify(e.lead_stages)),App.front_segments.switch_display_mode_for_aggregated_date()})},set_aggregation_point_radio_event:function(){var e;e="0"==$('input:radio[name="portlet_portlet_form[aggregation_point]"]:checked').val();var t=$("#portlet_portlet_form_client_rank"),n=$("#portlet_portlet_form_lead_stages");t.children().remove(),n.children().remove(),n.val([]).trigger("change"),e?(client_ranks=JSON.parse(sessionStorage.getItem("client_ranks_at_this")),lead_stages=JSON.parse(sessionStorage.getItem("lead_stages_at_this"))):(client_ranks=JSON.parse(sessionStorage.getItem("client_ranks_at_that")),lead_stages=JSON.parse(sessionStorage.getItem("lead_stages_at_that"))),all_client_names=client_ranks.map(function(e){return e.name}),t.append($("<option>").html(I18n.t("js.life_cycle_funnel.all_client_ranks")).val(all_client_names)),client_ranks.forEach(function(e){t.append($("<option>").html(e.name).val(e.id))}),lead_stages.forEach(function(e){n.append($("<option>").html(e.name).val(e.id))}),lss=lead_stages.map(function(e){return e.id}),n.val(lss).trigger("change")},switch_display_mode_for_segment:function(){var e=$("#portlet_form_search_segment_ids"),t=$('input:radio[name="portlet_portlet_form[aggregation_point]"]'),n=$(".segment-data-select"),i=$("#portlet_portlet_form_client_rank"),a=$("#portlet_portlet_form_lead_stages");e.val()?t.prop("disabled",!1):t.prop("disabled",!0),n.prop("disabled",!0),i.prop("disabled",!0),a.prop("disabled",!0)},switch_display_mode_for_aggregated_date:function(){var e=$("#portlet_form_search_segment_ids").val(),t=$('input:radio[name="portlet_portlet_form[aggregation_point]"]:checked').val(),n=$("#portlet_portlet_form_aggregation_point_id").val(),i=$(".segment-data-select"),a=$("#portlet_portlet_form_client_rank"),s=$("#portlet_portlet_form_lead_stages");"0"==t?(i.prop("disabled",!0),e?(a.prop("disabled",!1),s.prop("disabled",!1)):(a.prop("disabled",!0),s.prop("disabled",!0))):(i.prop("disabled",!1),n?(a.prop("disabled",!1),s.prop("disabled",!1)):(a.prop("disabled",!0),s.prop("disabled",!0)))},remove_segment_relation:function(target_element_selector){var target=$("#"+target_element_selector);$.ajax({url:"/xhr/segments/remove_relation",type:"POST",dataType:"html",data:{id:target.data("id"),segment_id:$("#segment_id").val(),model:target.data("relation")},context:target}).done(function(data){eval(data)})},set_column_span:function(e,t){$(document).on("click","#frm_visible_fields label",function(){var n=0;$.each(t,function(e,t){$("#frm_visible_fields label [value="+t+"]").prop("checked")&&(n+=1)}),$(e).attr("colspan",n),0==n?$(e).hide():$(e).show()})},enable_segment_associattion_search_modal:function(e,t,n){$(document).off("click",e).on("click",e,function(){$(".tab-menu-items").prop("disabled",!0),$.ajax({url:t,data:"utf8=\u2713&exclude_segment=true&select_type="+n}).done(function(){$(".tab-menu-items").prop("disabled",!1)})})},set_associate_entities_add_action:function(trigger_selector,entity_checkbox_selector,resource){$(document).off("click",trigger_selector),$(document).on("click",trigger_selector,function(){var entity_ids=jQuery.map($(entity_checkbox_selector+":checked"),function(e){return $(e).val()});if(0==entity_ids.length)return alert(I18n.t("js.common.please_select")),!1;var permmision_check_arr=jQuery.map($(entity_checkbox_selector+":checked"),function(e){return $(e).data("check-permission")}),permmision_check_flg=permmision_check_arr.some(function(e){return e});if(permmision_check_flg)return alert(I18n.t("js.common.can_not_add_private_item")),!1;entity_ids.push.apply(entity_ids,jQuery.map($('input[name="exclude_ids[]"]'),function(e){if(e.value)return e.value})),segment_id=$("#segment_id").val(),$.ajax({url:"/xhr//segments/add_relation_"+resource,type:"POST",dataType:"html",data:{ids:entity_ids,segment_id:segment_id},context:$(this)}).fail(function(e,t,n){console.log(e.status),console.log(t),console.log(n)}).done(function(data){eval(data),$(this).closest(".modal").modal("hide"),$("div.modal-backdrop.in").remove()})})},lead_stage_modal:function(){$(document).on("click","[data-hp-role='edit_lead_stage']",function(){App.front_display_templates.modal_open($(this)),$(".tab-menu-items").prop("disabled",!0)}),$(document).on("load_modal","[data-hp-role='edit_lead_stage']",function(){function e(){$("#regist_message_area").empty(),$.ajax({type:"POST",url:"/xhr/segments/"+$setup_wizard.data("segment-id")+"/lead_stages/preview",data:$("#lead_stages_form").serialize()}).done(function(e){$("#regist_message_area").html(e)})}function t(e){$("#deals_sheet_form [data-hp-role='selected'] option").prop("selected",!1),$("#deals_sheet_form [data-hp-role='un_selected'] option").prop("selected",!1),$('a[data-toggle="tab"][href="#step'+e+'"]').tab("show")}function n(e){$("#popup-YouTube-player")[0].contentWindow.postMessage('{"event":"command","func":"'+e+'","args":""}',"*")}function i(e){var t=$(e).parent("li");t.addClass("passed"),t.prevAll("li").addClass("passed"),t.nextAll("li").removeClass("passed")}$setup_wizard=$(".setup-wizard"),$(".sortable-container").sortable({update:function(){$("#sort_order_array").val($(this).sortable("toArray").join(","));var t=[],n=[];$(this).sortable("toArray").forEach(function(e){t.push($("#"+e.replace("lead-stage-contents","lead-stage-condition-contents")).remove()),n.push($("#"+e.replace("lead-stage-contents","lead-stage-condition-contents-preview")).remove())}),t.forEach(function(e){$(".sortable-container-list").append(e)}),n.forEach(function(e){$(".preview-list").append(e)})}}),$(".sortable-container-list").sortable({update:function(){$("#sort_order_array").val($(this).sortable("toArray").join(","));var t=[],n=[];$(this).sortable("toArray").forEach(function(e){t.push($("#"+e.replace("lead-stage-condition-contents","lead-stage-contents")).remove()),n.push($("#"+e.replace("lead-stage-condition-contents","lead-stage-condition-contents-preview")).remove())}),t.forEach(function(e){$(".sortable-container").append(e)}),n.forEach(function(e){$(".preview-list").append(e)})}}),$(document).off("click","[data-hp-role='move_step']"),$(document).on("click","[data-hp-role='move_step']",function(){n("pauseVideo"),t($(this).data("step"),$(this).data("cur-step")),3==$(this).data("step")||4==$(this).data("step")?App.front_segments.fixModalWidth("lead-stage",!0):App.front_segments.fixModalWidth("lead-stage",!1),4==$(this).data("step")?($("#complete_btn").prop("disabled",!0),e()):3==$(this).data("step")&&App.front_segments.back_condition_list("lead-stage")}),$(window).on("click",function(e){!e.target.classList.contains("color-circle")&&0<!$(e.target).closest(".color-select-show").length&&"block"===$(".color-select-show").css("display")&&$(".color-select-show").hide()}),$(document).on("click",".color-circle",function(e){App.front_segments.openColorSelectDialog(e,this)}),$('a[data-toggle="tab"]').on("shown.bs.tab",function(e){i(e.target)}),$(document).on("change",".lead-stage-condition-item",function(){App.front_segments.build_condition_list("lead_stage",$(this).data("number")),App.front_segments.wizard_annotation_margin()}),$(document).off("click","#complete_btn"),$(document).on("click","#complete_btn",function(){$("#complete_btn").prop("disabled",!0),$.ajax({type:"POST",url:"/xhr/segments/"+$setup_wizard.data("segment-id")+"/lead_stages/update_lead_stage",data:$("#lead_stages_form").serialize()}).done(function(e){$("#regist_message_area").html(e)})}),App.front_segments.count_settings("lead_stage"),$("div.tab-pane:first").addClass("active"),App.front_segments.initialize_input_data("lead_stage"),leadStageCount=Number($("#current_lead_stage_number").val())+1;for(var a=0;a<leadStageCount;a++)App.front_segments.build_condition_list("lead_stage",a);$("#sort_order_array").val($(".sortable-container").sortable("toArray").join(",")),$(".tab-menu-items").prop("disabled",!1)})},client_rank_modal:function(){$(document).on("click","[data-hp-role='edit_client_rank']",function(){App.front_display_templates.modal_open($(this)),$(".tab-menu-items").prop("disabled",!0)}),$(document).on("load_modal","[data-hp-role='edit_client_rank']",function(){function e(){$("#regist_message_area").empty(),$.ajax({type:"POST",url:"/xhr/segments/"+$setup_wizard.data("segment-id")+"/client_ranks/preview",data:$("#client_ranks_form").serialize()}).done(function(e){$("#regist_message_area").html(e)})}function t(e){$("#deals_sheet_form [data-hp-role='selected'] option").prop("selected",!1),$("#deals_sheet_form [data-hp-role='un_selected'] option").prop("selected",!1),$('a[data-toggle="tab"][href="#step'+e+'"]').tab("show")}function n(e){$("#popup-YouTube-player")[0].contentWindow.postMessage('{"event":"command","func":"'+e+'","args":""}',"*")}function i(e){var t=$(e).parent("li");t.addClass("passed"),t.prevAll("li").addClass("passed"),t.nextAll("li").removeClass("passed")}$setup_wizard=$(".setup-wizard"),$(".sortable-container").sortable({update:function(){$("#sort_order_array").val($(this).sortable("toArray").join(","));var t=[],n=[];$(this).sortable("toArray").forEach(function(e){t.push($("#"+e.replace("client-rank-contents","client-rank-condition-contents")).remove()),n.push($("#"+e.replace("client-rank-contents","client-rank-condition-contents-preview")).remove())}),t.forEach(function(e){$(".sortable-container-list").append(e)}),n.forEach(function(e){$(".preview-list").append(e)})}}),$(".sortable-container-list").sortable({update:function(){$("#sort_order_array").val($(this).sortable("toArray").join(","));var t=[],n=[];$(this).sortable("toArray").forEach(function(e){t.push($("#"+e.replace("client-rank-condition-contents","client-rank-contents")).remove()),n.push($("#"+e.replace("client-rank-condition-contents","client-rank-condition-contents-preview")).remove())}),t.forEach(function(e){$(".sortable-container").append(e)}),n.forEach(function(e){$(".preview-list").append(e)})}}),$(document).off("click","[data-hp-role='move_step']"),$(document).on("click","[data-hp-role='move_step']",function(){n("pauseVideo"),t($(this).data("step"),$(this).data("cur-step")),App.front_segments.fixModalWidth("client-rank",!1),4==$(this).data("step")?($("#complete_btn").prop("disabled",!0),e()):3==$(this).data("step")&&App.front_segments.back_condition_list("client-rank")}),$(window).on("click",function(e){!e.target.classList.contains("color-circle")&&0<!$(e.target).closest(".color-select-show").length&&"block"===$(".color-select-show").css("display")&&$(".color-select-show").hide()}),$(document).on("click",".color-circle",function(e){App.front_segments.openColorSelectDialog(e,this)}),leadStageCount=Number($("#current_client_rank_number").val())+1;for(var a=0;a<leadStageCount;a++)App.front_segments.build_condition_list("client_rank",a);$(document).on("change",".client-rank-condition-item",function(){App.front_segments.build_condition_list("client_rank",$(this).data("number")),App.front_segments.wizard_annotation_margin()}),$(document).off("click","#complete_btn"),$(document).on("click","#complete_btn",function(){$("#complete_btn").prop("disabled",!0),$.ajax({type:"POST",url:"/xhr/segments/"+$setup_wizard.data("segment-id")+"/client_ranks/update_client_rank",data:$("#client_ranks_form").serialize()}).done(function(e){$("#regist_message_area").html(e)})}),$('a[data-toggle="tab"]').on("shown.bs.tab",function(e){i(e.target)}),App.front_segments.count_settings("client_rank"),$("div.tab-pane:first").addClass("active"),App.front_segments.initialize_input_data("client_rank"),App.concerns.datepicker(".search_datepicker"),$("#sort_order_array").val($(".sortable-container").sortable("toArray").join(",")),$(".tab-menu-items").prop("disabled",!1)})},close_modal:function(){$("#modalContainer").modal("hide")},initialize_input_data:function(e){for(var t=$("#current_"+e+"_number").val(),n=0;n<=t;n++)App.front_segments.change_name(e,n),App.front_segments.count_word(e,n)},change_name:function(e,t){var n=$("#"+e+"_name_"+t).val();$("#name_preview_"+t).text(n),$("#name_preview_condition_list_"+t).text(n),$("#name_preview_condition_list_preview"+t).text(n),$("#name_preview_condition_"+t).text(n)},count_settings:function(e){count=$(".sortable-container li").length+$(".fixed-container li").length,$("#"+e+"_count").text("("+count+")"),$("#"+e+"_count_condition_list").text("("+count+")")},count_word:function(e,t){$("#word_count_"+t).text($("#"+e+"_memo_"+t).val().length)},select_color:function(e){number=$("#target_number").val(),$("#color_pattern_id_"+number).val(e),$(".color-target"+number).removeClass("color-pattern1 color-pattern2 color-pattern3 color-pattern4 color-pattern5 color-pattern6 color-pattern7 color-pattern8 color-pattern9 color-pattern10"),$(".color-target"+number).addClass("color-pattern"+e),$(".color-select-show").hide()},add_lead_stage:function(){if(!$(".lead_stage_add").data("disabled")){$(".lead_stage_add").data("disabled",!0),nextNumber=Number($("#current_lead_stage_number").val())+1,nextColorNumber=1;for(var colorNumber=1;colorNumber<=10;colorNumber++)if(0==$(".color-circle.color-pattern"+colorNumber).length){nextColorNumber=colorNumber;break}$.ajax({url:"/xhr/segments/lead_stages/add_lead_stage",type:"POST",dataType:"html",data:{nextNumber:nextNumber,nextColorNumber:nextColorNumber}}).done(function(data){eval(data),$(".lead_stage_add").data("disabled",!1),App.front_segments.build_condition_list("lead_stage",nextNumber);var conditionArray=$(".sortable-container").sortable("toArray");$("#sort_order_array").val(conditionArray.join(",")),conditionArray.length+2>=Number($("#lead_stage_max_count").val())&&$(".lead_stage_add").hide()})}},remove_lead_stage:function(e){confirm(I18n.t("js.lead_stages.delete_confirm"))&&($("#lead-stage-contents"+e).remove(),$("#lead-stage-condition-contents"+e).remove(),$("#lead-stage-condition-contents-preview"+e).remove(),$("#lead-stage-condition-area"+e).remove(),App.front_segments.count_settings("lead_stage"),$("#sort_order_array").val($(".sortable-container").sortable("toArray").join(",")),$(".lead_stage_add").show())},add_client_rank:function(){if(!$(".client_rank_add").data("disabled")){$(".client_rank_add").data("disabled",!0),nextNumber=Number($("#current_client_rank_number").val())+1,nextColorNumber=1;for(var colorNumber=1;colorNumber<=10;colorNumber++)if(0==$(".color-circle.color-pattern"+colorNumber).length){nextColorNumber=colorNumber;break}$.ajax({url:"/xhr/segments/client_ranks/add_client_rank",type:"POST",dataType:"html",data:{nextNumber:nextNumber,nextColorNumber:nextColorNumber}}).done(function(data){eval(data),$(".client_rank_add").data("disabled",!1),App.front_segments.build_condition_list("client_rank",nextNumber);var conditionArray=$(".sortable-container").sortable("toArray");$("#sort_order_array").val(conditionArray.join(",")),conditionArray.length+1>=Number($("#client_rank_max_count").val())&&$(".client_rank_add").hide()})}},remove_client_rank:function(e){confirm(I18n.t("js.client_ranks.delete_confirm"))&&($("#client-rank-contents"+e).remove(),$("#client-rank-condition-contents"+e).remove(),$("#client-rank-condition-contents-preview"+e).remove(),$("#client-rank-condition-area"+e).remove(),
App.front_segments.count_settings("client_rank"),$("#sort_order_array").val($(".sortable-container").sortable("toArray").join(",")),$(".client_rank_add").show())},openColorSelectDialog:function(e,t){targetNumber=$(t).data("number"),$("#target_number").val(targetNumber);var n=$(t).offset().top-$(".color_select_modal_container").offset().top,i=21;$(".color-select-show").css("top",n),$(".color-select-show").css("left",i),$(".color-select-show").show()},change_target_condition:function(t,n,i,e){select_element=$("#condition_target_table"+n+"_"+i),select_val=select_element.val(),segment_id=$("#segment_id").val(),""!=select_val?($.ajax({url:e,type:"POST",dataType:"html",data:{select_val:select_val,number:n,child_number:i,segment_id:segment_id}}).done(function(e){$("#condition_target_item_"+n+"_"+i).empty(),$("#condition_target_item_"+n+"_"+i).append(e),"lead_stage"==t&&($("#condition_target_item_individual"+n+"_"+i).hide(),$("#condition_target_item_select_"+n+"_"+i).val("0"),5==select_val?$("#condition_target_item_select_"+n+"_"+i).prop("disabled",!0):$("#condition_target_item_select_"+n+"_"+i).prop("disabled",!1),$("#condition_target_item_select_"+n+"_"+i).show(),$("#condition_target_status_"+n+"_"+i).show()),App.front_segments.build_condition_list(t,n),App.front_segments.wizard_annotation_margin()}),select_element.removeClass("wizard_require_invalid")):($("#condition_target_item_"+n+"_"+i).empty(),"lead_stage"==t&&($("#condition_target_item_individual_"+n+"_"+i).hide(),$("#condition_target_status_"+n+"_"+i).hide()),App.front_segments.build_condition_list(t,n),App.front_segments.wizard_annotation_margin(),select_element.addClass("wizard_require_invalid"))},add_condition_fields:function(t,n,e){$(".condition_add_btn").data("disabled")||($(".condition_add_btn").data("disabled",!0),next_number=Number($("#next_child_number"+n).val()),$("#next_child_number"+n).val(next_number+1),$.ajax({url:e,type:"POST",dataType:"html",data:{number:n,child_number:next_number}}).done(function(e){$(".condition_add_btn").data("disabled",!1),e!=undefined&&""!=e&&($("#condition_target_area_"+n).append(e),$(".condition_group_"+n).length>=Number($("#"+t+"_condition_max_count").val())&&$("#condition_add_btn_"+n).hide(),App.front_segments.build_condition_list(t,n),child_number_array=$("#child_number_array"+n).val(),$("#child_number_array"+n).val(child_number_array+","+next_number),App.front_segments.wizard_annotation_margin())}))},remove_condition_fields:function(e,t,n){$(".condition_"+t+"_"+n).remove(),child_number_array_wk="",arrayVal=$("#child_number_array"+t).val(),""!=arrayVal&&arrayVal.split(",").forEach(function(e){e!=n&&(""!=child_number_array_wk&&(child_number_array_wk+=","),child_number_array_wk+=e)}),$("#child_number_array"+t).val(child_number_array_wk),App.front_segments.build_condition_list(e,t),$("#condition_add_btn_"+t).show(),App.front_segments.wizard_annotation_margin()},setting_condition:function(e,t){$(".condition-list-area").hide(),$("."+e+"-condition-areas").hide(),$("#"+e+"-condition-area"+t).show(),"client-rank"==e&&App.front_segments.fixModalWidth(e,!0),App.front_segments.wizard_annotation_margin()},back_condition_list:function(e){$("."+e+"-condition-areas").hide(),$(".condition-list-area").show(),"client-rank"==e&&App.front_segments.fixModalWidth(e,!1)},build_condition_list:function(e,t,n,i){$(".condition-list"+t).empty(),$(".condition-list-preview"+t).empty(),matchWord="condition_target_table"+t+"_",targetSelector=$('select[id^="'+matchWord+'"]');var a=!1;if("lead_stage"==e)for(var s=0;s<targetSelector.length;s++)targetTable=$("#"+targetSelector[s].id+" option:selected"),targetItem=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item")+" option:selected"),""!=targetTable.val()&&(targetItemArray=$("#"+targetSelector[s].id.replace("condition_target_table","s2id_condition_target_item")+" ul .select2-search-choice div"),targetItemValue="",targetItemSelect=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_select_")+" option:selected"),0==targetItemSelect.val()?targetItemValue="<span class='preview_item preview_item_value'>"+targetItemSelect.text()+"</span>":targetItemArray.each(function(){targetItemValue+="<span class='preview_item preview_item_value'>"+this.innerText+"</span>"}),condition="<span class='preview_item_target' style='margin-right: 10px;'>"+targetTable.text()+"</span><span style='margin-right: 10px;'>"+targetItemValue+"</span>",targetStatusArray=$("#"+targetSelector[s].id.replace("condition_target_table","s2id_condition_target_status")+" ul .select2-search-choice div"),0<targetStatusArray.length?(condition+="<span style='margin-right: 5px;'>"+$("#target_of_text").val()+"</span>",targetStatusArray.each(function(){condition+="<span class='preview_item preview_item_value'>"+this.innerText+"</span>"}),condition+="<span style='margin-left: 5px;margin-right: 10px;'>"+$("#target_parson_text").val()+"</span>"):condition+="<span style='margin-right: 10px;'>"+$("#target_parson_text").val()+"</span>",s<targetSelector.length-1&&(condition+="<span class='color-target"+t+" name-preview-condition-join color-pattern"+$("#color_pattern_id_"+t).val()+"'>"+$("#condition_join_str").val()+"</span>"),$(".condition-list"+t).append("<li class='condition-summary'>"+condition+"</li>"),$(".condition-list-preview"+t).append("<li class='condition-summary'>"+condition+"</li>"),a=!0);else if("client_rank"==e)for(s=0;s<targetSelector.length;s++)if(targetTable=$("#"+targetSelector[s].id+" option:selected"),targetItemType=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_type")),targetCheckCondition=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_check_condition")+" option:selected"),""!=targetTable.val()){switch(targetItemValue="",targetItemType.val()){case"select":case"select_middle_business":case"user":n==undefined||targetSelector[s].id.replace("condition_target_table","")!=t+"_"+n?(targetItemArray=$("#"+targetSelector[s].id.replace("condition_target_table","s2id_condition_target_item")+" ul .select2-search-choice div"),targetItemArray.each(function(){targetItemValue+="<span class='preview_item preview_item_value'>"+this.innerText+"</span>"})):i.forEach(function(e){var t="<span class='preview_item preview_item_value'>"+e.text+"</span>";targetItemValue+=t});break;case"date":0==$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_date_pattern")+" option:selected").val()?(item_val=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item")).val(),daysWithin=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_days_within_label")).text(),targetItemValue+="<span class='preview_item preview_item_value'>"+item_val+"</span><span>"+daysWithin+"</span>"):(fromVal=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_from")).val(),targetItemValue+="<span class='preview_item preview_item_value'>"+fromVal+"</span>",targetItemValue+="<span class='date_period'>~</span>",toVal=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_to")).val(),targetItemValue+="<span class='preview_item preview_item_value'>"+toVal+"</span>");break;case"numeric":fromVal=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_from")).val(),targetItemValue+="<span class='preview_item preview_item_value'>"+fromVal+"</span>",targetItemValue+="<span class='date_period'>~</span>",toVal=$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_to")).val(),targetItemValue+="<span class='preview_item preview_item_value'>"+toVal+"</span>";break;case"text":$("#"+targetSelector[s].id.replace("condition_target_table","condition_target_item_text_container")+" li").each(function(){targetItemValue+="<span class='preview_item preview_item_value'>"+this.innerText+"</span>"})}condition="<span class='preview_item_target' style='margin-right: 10px;'>"+targetTable.text()+"</span><span style='margin-right: 10px;'>"+targetItemValue+"</span><span class='preview_item preview_item_target'>"+targetCheckCondition.text()+"</span>",s<targetSelector.length-1&&(condition+="<span class='color-target"+t+" name-preview-condition-join color-pattern"+$("#color_pattern_id_"+t).val()+"'  style='margin-left: 10px;'>"+$("#condition_join_str").val()+"</span>"),$(".condition-list"+t).append("<li>"+condition+"</li>"),$(".condition-list-preview"+t).append("<li>"+condition+"</li>"),a=!0}a||($(".condition-list"+t).append("<li>"+$("#no_condition_text").val()+"</li>"),$(".condition-list-preview"+t).append("<li>"+$("#no_condition_text").val()+"</li>"))},change_date_pattern:function(e,t){"0"==$("#condition_target_item_date_pattern"+e+"_"+t).val()?($("#condition_target_item_date_period_area"+e+"_"+t).hide(),$("#condition_target_item_date_elapsed_date"+e+"_"+t).show()):($("#condition_target_item_date_elapsed_date"+e+"_"+t).hide(),$("#condition_target_item_date_period_area"+e+"_"+t).show()),App.front_segments.build_condition_list("client_rank",e)},add_text_value:function(e,t){text=$("#condition_target_item_text_input"+e+"_"+t).val().replace(",","&#44;"),$("#condition_target_item_text_input"+e+"_"+t).val(""),""!=text&&(all_text_value_array=$("#condition_target_item"+e+"_"+t).val().split(","),all_text_value_array.includes(text)||($("#condition_target_item_text_container"+e+"_"+t).append('<li class="text-value-search-choice"><div>'+text+'</div><a href="#" class="text-value-search-choice-close" tabindex="-1" onclick="App.front_segments.remove_text_value(this,'+e+","+t+');return false;"></a></li>'),App.front_segments.reset_text_value(e,t),App.front_segments.build_condition_list("client_rank",e)))},remove_text_value:function(e,t,n){$(e).parent().remove(),App.front_segments.reset_text_value(t,n),App.front_segments.build_condition_list("client_rank",t)},reset_text_value:function(e,t){all_text_value="",$("#condition_target_item_text_container"+e+"_"+t+" li").each(function(){""!=all_text_value&&(all_text_value+=","),all_text_value+=this.innerText.replace(",","&#44;")}),$("#condition_target_item"+e+"_"+t).val(all_text_value),App.front_segments.require_check_addtext(e,t)},fixModalWidth:function(e,t){var n=t?"90%":"950px";$("#"+e+"-modal-dialog").animate({width:n},"slow")},select_search_on_wizard:function(a,s,o,r,l){var c=$("#"+a);"hidden"!==c.attr("type")&&c.select2({width:c.data("width"),minimumInputLength:c.data("minlen"),placeholder:c.data("prompt"),multiple:c.data("multiple"),allowClear:!0,formatResult:function(e){return e.text},formatSelection:function(e){return e.hasOwnProperty("enable_flg")&&!0!==e.enable_flg?'<i class = "fa fa-user-times" style="color:#bf0000"/> <span style="color:#bf0000">'+e.text+" \uff08"+I18n.t("js.users.disabled_user")+"\uff09</span>":e.text},ajax:{url:c.data("action"),type:"post",dataType:"json",data:function(e){return{search:e,authenticity_token:c.data("token"),client_id:$("#"+a).data("clientId"),client_name:$("#"+a).data("clientName"),controller_name:$("#"+a).data("controllerName"),daily_report_flg:$("#"+a).data("dailyReportFlg"),task_flg:$("#"+a).data("taskFlg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),selected_department_ids:$("#"+a).data("selected-department-ids"),search_type:$("#"+a).data("search-type"),self_id:$("#"+a).data("self-id"),another_object_id:$("#"+a).data("another_object_id"),segment_id:$("#segment_id").val(),selected_table_id:$("#condition_target_table"+r+"_"+l).val()}},results:function(e){return{results:e.results}}},initSelection:function(e,t){var n=$(e).val();if(null!=n){var i={};$(".department-checked").each(function(){i[$(this).val()]=$(this).prop("checked")}),$.ajax({type:"post",url:c.data("action"),data:{id:n,client_id:c.data("clientId"),client_name:c.data("clientName"),controller_name:c.data("controllerName"),authenticity_token:c.data("token"),user_position_flg:$("#"+a).data("user-position-flg"),open_status:$("#"+a).data("open-status"),user_id:$("#"+a).data("user-id"),selected_role_ids:$("#"+a).data("selected-role-ids"),search_type:$("#"+a).data("search-type"),selected_departments:i,another_object_id:$("#"+a).data("another_object_id"),segment_id:$("#segment_id").val(),selected_table_id:$("#condition_target_table"+r+"_"+l).val()},success:function(e){0===e.results.length?(c.val(""),t("")):(1<e.results.length?t(e.results):t(e.results[0]),App.front_segments.build_condition_list(o,r)),s&&$("#"+s).prop("disabled",!1),$("#modalselectParentTagId").modal("show")},error:function(){s&&$("#"+s).prop("disabled",!1)}})}}})},change_search_activity_type:function(){$(document).off("change","#search_activity_type"),$(document).on("change","#search_activity_type",function(){$("#hp-form_search_inside_sales").submit()})},table_check_cnt:function(t){$(document).on("click",t,function(){var e=0;$(t).each(function(){this.checked&&e++}),$("[data-selected-number]").text("\uff08"+e+"\uff09")})},change_display_template:function(){$(document).off("change.display_template","#js_select_change_display_template"),$(document).on("change.display_template","#js_select_change_display_template",function(){var e=$("#js_form_change_display_template");$("#js_page_header_display_template_id").val(this.value),$("#js_page_header_search_id").val(""),e.submit()})},require_check:function(e,t){element=$("#condition_target_item"+e+"_"+t),""==element.val()?element.addClass("wizard_require_invalid"):element.removeClass("wizard_require_invalid")},require_check_range:function(e,t){fromElement=$("#condition_target_item_from"+e+"_"+t),toElement=$("#condition_target_item_to"+e+"_"+t),""==fromElement.val()&&""==toElement.val()?(fromElement.addClass("wizard_require_invalid"),toElement.addClass("wizard_require_invalid")):(fromElement.removeClass("wizard_require_invalid"),toElement.removeClass("wizard_require_invalid"))},require_check_addtext:function(e,t){element=$("#condition_target_item"+e+"_"+t),display_element=$("#condition_target_item_text_container"+e+"_"+t),""==element.val()?display_element.addClass("wizard_require_invalid"):display_element.removeClass("wizard_require_invalid")},require_check_select:function(e,t){element=$("#condition_target_item"+e+"_"+t),display_element=$("#s2id_condition_target_item"+e+"_"+t),null==element.val()||""==element.val()?display_element.addClass("wizard_require_invalid"):display_element.removeClass("wizard_require_invalid")},change_target_item_select:function(e,t){display_element=$("#condition_target_item_individual_"+e+"_"+t),"1"==$("#condition_target_item_select_"+e+"_"+t).val()?display_element.show():display_element.hide(),App.front_segments.build_condition_list("lead_stage",e)},parent_redraw:function(){var segment_id=$("#segment_id").val(),target_window=$('input[name="target_window"]').val();App.front_segments.ajax_load(),$("#inner_loading").length||$("#info_area").prepend(inner_load),$(".btn").prop("disabled",!0),$("#inner_loading").show(),App.front_segments.disabled_area(),$.ajax({url:"/xhr/segments/"+target_window,type:"GET",dataType:"html",data:{segment_id:segment_id,target_window:target_window}}).done(function(data){eval(data),$(".btn").prop("disabled",!1),$("#inner_loading").hide()})},wizard_annotation_margin:function(){var e=$("#condition_area").height()-$("#condition_setting_area").height()-2*$("#annotation").height()-1;e<0&&(e=0),$("#annotation").css("margin-top",e+"px")}},App.select_parent_tag_id={init_tags:function(){App.concerns.select_search("parent_tag_tag_id"),$(document).on("click",".modal-save-tags",function(){$("#tag_id").val($("#parent_tag_tag_id").data("self-id")),$("#tag_parent_tag_id").val($("#parent_tag_tag_id").val()),$("#"+$("#parent_tag_tag_id").data("self-id")).children("div").eq(0).children("span").eq(1).text()===I18n.t("js.select_parent_tag_id.without_owner")?$("#tag_user_tags_lock_version").val($("#parent_my_tag_user_lock_version").val()):$("#tag_user_tags_lock_version").val($("#"+$("#parent_tag_tag_id").data("self-id")).find(".lock_version").val()),$("#tag_edit_form").attr("method","patch"),$("#tag_edit_form").attr("action","/xhr/business_card_lead_tags/update_parent_tag_id/"),$("#tag_edit_form").submit(),$(".modal-save-tags").addClass("disabled"),$("#loading").show()}),$(document).on("click",".btn-close, #btn-close-modal-select-parent-tag-id",function(){$(".select2-search-choice-close").trigger("mousedown"),App.front_business_card_lead_tags.inifinite_scroll(),$("#modalselectParentTagId").modal("hide")})}};var checkCancel=!1,checkSave=!1,inputElems=document.getElementsByClassName("countrylist"),allcountry=document.getElementsByClassName("allcountry"),countrymap=new Map,countrychkAllMap=new Map;App.front_seminars={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn-advanced","#search-clear-seminars-advanced"),App.concerns.disable_buttons_submit_custom(".js-disable-btn-simple","#search-clear-seminars-simple"),App.concerns.disable_duplicate_request_search_form("#hp-form_search_seminars",".js-disable-btn-advanced, js-disable-btn-simple"),App.concerns.change_order("hp-form_search_seminars"),App.concerns.change_display_number("hp-form_search_seminars"),App.concerns.change_search_type(),App.visible_fields.setup_list_visible_setting(),App.concerns.datepicker(".search_datepicker"),App.concerns.select_search_disable_user("seminar_user_search"),App.concerns.select_search("search_user_ids"),App.concerns.select_search("search_campaign"),App.concerns.switch_search_form($(".hp-page [data-hp-role='form-switch']")),App.concerns.select_search("wf"),App.front_segments.set_segment_select2("#search_segment_ids"),App.concerns.select_search("ewf"),App.concerns.all_checked_items(),App.concerns.enable_csv_export_event("#hp-form_search_seminars","checked[seminar_ids][]"),App.concerns.select_search("seminars_mail_users_user_ids"),App.concerns.select_search("seminars_users_user_ids"),App.concerns.select_search("seminar_web_form_id"),App.concerns.select_search("seminar_enquete_web_form_id"),App.concerns.set_associate_entities_to_s2("#campaigns_multiple_decision","#search_campaign",'input[name="associate_campaigns[]"]',"campaigns"),App.concerns.enable_associattion_search_modal("#open_campaign","/xhr/campaigns/search_as_association_modal","#search_campaign","multiple"),App.concerns.attach_select_search_handlers_once($(".hp-page")),$("#myModal").on("show.bs.modal",function(){$("#mail_notification_not_update").prop("checked",!0),$("#mail_notification_not_update").attr("checked","checked")}),$("#modal_block_for_search_users").on("hidden.bs.modal",function(){var e=$("#s2id_seminars_users_user_ids .select2-search-choice").length,t=$("#s2id_seminars_mail_users_user_ids .select2-search-choice").length;(0<e||0<t)&&$("#bulk_update").prop("disabled",!1)}),$("#myModal").on("mouseup",function(){$(this).trigger("keyup")}),$(".hp-page [data-hp-role='table-config']").on("click",function(){App.visible_fields.show_list_fields_setting()}),App.concerns.set_form_action_to_submit("#form_checked_seminars",".checked_submit",!0,!0),App.concerns.set_form_action_to_submit("#form_checked_seminars",".js_open_modal_update_all",!0),$(".hp-page [data-hp-role='select2']").select2({minimumResultsForSearch:20}),App.concerns.check_form_input("#myModal","#bulk_update",[],!0);new Clipboard(".clipboard-btn");App.concerns.open_mailer(),App.tooltip.display_tooltip()},"new":function(){App.front_deals.all_checked_items_modal_deals_index(),App.concerns.select_search("seminar_mail_user_ids"),App.concerns.select_search("seminar_user_ids"),App.concerns.select_search("seminar_web_form_id"),App.concerns.select_search("seminar_enquete_web_form_id"),App.concerns.datepicker(".input-date"),this.datetimepicker(),window.onload=function(){"0"==$('[data-hp-role="lead-filter-num"]').text()?($('[data-hp-role="lead-filter-control-nodata"]').removeClass("hide"),$('[data-hp-role="lead-filter-control-show"]').addClass("hide")):($('[data-hp-role="lead-filter-control-nodata"]').addClass("hide"),$('[data-hp-role="lead-filter-control-show"]').removeClass("hide"))},App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("tag-field","my-tag-dropdown"),App.front_target_lists.attach_input_handlers($(".hp-page")),App.concerns.prevent_submit_pressing_enter(),App.lead_filters.all_checked_items(),App.lead_filters.apply_leads_count(),App.lead_filters.seminars_mail_reject_edit(),App.front_target_lists.optional_item_modal($(".hp-page form")),$("[data-target=\"[data-hp-role='lead-filter-clear']\"]").on("click",function(){var e=$("[data-hp-role='lead-filter-num']"),t=$("[data-hp-role='lead-filter-control-nodata']"),n=$("[data-hp-role='lead-filter-control-show']");if($(this).data("confirmed")){if(!1===confirm(I18n.t("js.target_lists.select_process")))return;t.removeClass("hide"),n.addClass("hide"),$("[name='lead_filter[added_lead_ids]']").val(""),$("[data-hp-role='search']").trigger("click"),e.removeData("leadIdCounts"),$("[data-hp-role='lead-filter-confirm'] [name='lead_filter_confirmed']").val(!1)}else alert(I18n.t("js.seminars.target_not_set"))}),$("#seminar-mail-reject-setting-edit").find("[data-hp-role='select2']").select2({minimumResultsForSearch:20});var e=$("#seminar-mail-reject-condition");e.find("[data-hp-custom-role='custom_search_model_select']").select2().on("select2-close",function(){App.lead_filters.custom_lead_filter_model_change($(this))}),e.find('select option[value="not_mail_flg"]').remove(),e.find('select option[value="error_mail_flg"]').remove(),App.concerns.focus_to_first_element(),App.front_segments.set_segment_select2("#seminar_segment_id"),App.front_segments.change_segment_icon("#seminar_segment_id")},create:function(){this["new"]()},edit:function(){this["new"](),App.front_segments.set_segment_select2("#seminar_segment_id")},update:function(){this["new"]()},show:function(){App.front_deals.all_checked_items_modal_deals_index(),$(".new_webinar").on("click",function(){var e=this.href,t=e.indexOf("&");if(-1!=t){var n=e.slice(0,t);this.href=n+"&mode=new&tab_type="+$("#tab_type").val()}else this.href=e+"&mode=new&tab_type="+$("#tab_type").val()}),$(".setting_webinar").on("click",function(){var e=this.href,t=e.indexOf("&");if(-1!=t){var n=e.slice(0,t);this.href=n+"&tab_type="+$("#tab_type").val()}else this.href=e+"&tab_type="+$("#tab_type").val()}),this.set_associate_entities("#leads_multiple_decision",'input[name="associate_leads[]"]',"leads"),this.enable_associattion_search_modal(".add_leads_modal","/xhr/leads/search_as_association_modal","multiple"),$(".js_copy_seminar").on("click",function(){"seminar_with_leads"==this.id&&$("#leads_copy").val("true"),$("#js_copy_seminar_submit").submit()}),$(document).on("change",".seminar_tab_label",function(){var e=$("#resume").length?$("#resume"):$("#suspend"),t=e.attr("href");$(".seminar_tab_label").attr("disabled",!0),$("#applicants_tab, #summary_tab, #apply_tab, #enquetes_tab").empty(),$("#workflow_tab").hide(),$(".seminar-show-common-content").show(),$("#seminar_tab_summary").is(":checked")?($("#tab_type").val("summary"),App.front_seminars.tab_change(),$("#form_seminar_show").removeClass("do_not_submit"),$("#form_change_leads_status").addClass("do_not_submit"),$("#summary_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#js_summary_form").submit(),$("#seminar_tab").val($("#seminar_tab_applicants").val()),e.attr("href",t+"?tab_type=summary")):$("#seminar_tab_applicants").is(":checked")?($("#tab_type").val("applicants"),App.front_seminars.tab_change(),$("#form_seminar_show").addClass("do_not_submit"),$("#form_change_leads_status").removeClass("do_not_submit"),$("#workflow_tab").hide(),$("#applicants_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#js_applicants_form").submit(),e.attr("href",t+"?tab_type=applicants")):$("#seminar_tab_apply").is(":checked")?($("#tab_type").val("apply"),App.front_seminars.tab_change(),$("#form_seminar_show").addClass("do_not_submit"),$("#form_change_leads_status").removeClass("do_not_submit"),$("#apply_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#js_apply_form").submit(),e.attr("href",t+"?tab_type=apply")):$("#seminar_tab_enquetes").is(":checked")?($("#tab_type").val("enquetes"),App.front_seminars.tab_change(),$("#form_seminar_show").addClass("do_not_submit"),$("#form_change_leads_status").removeClass("do_not_submit"),$("#enquetes_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#js_enquetes_form").submit(),e.attr("href",t+"?tab_type=enquetes")):$("#seminar_tab_workflow").is(":checked")&&($("#form_seminar_show").addClass("do_not_submit"),$("#form_change_leads_status").addClass("do_not_submit"),$(".seminar_tab_label").attr("disabled",!1),$(".seminar-show-common-content").hide(),$("#workflow_tab").show(),e.attr("href",t+"?tab_type=workflow"))}),$(document).on("click",".update-webinar",function(){$("#seminar_tab_summary").is(":checked")?$("#summary_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'):$("#seminar_tab_applicants").is(":checked")?$("#applicants_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'):$("#seminar_tab_apply").is(":checked")?$("#applicants_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'):$("#seminar_tab_enquetes").is(":checked")&&$("#applicants_tab").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$(this).attr("disabled",!0)}),$(document).on("click",".modal-caller",function(){$(".seminar_tab_label, #edit_menu").attr("disabled",!0),$(".order_head").css("pointer-events","none"),$("#modal_block_for_add_inside_sales").on("show.bs.modal",function(){$(document).off("click","#leads_multiple_decision")}),$("#modal_block_for_add_inside_sales").on("hidden.bs.modal",function(){$(document).off("click","#leads_multiple_decision"),App.front_seminars.set_associate_entities("#leads_multiple_decision",'input[name="associate_leads[]"]',"leads")})}),$(document).on("hidden.bs.modal",".modal",function(){$(".seminar_tab_label, #edit_menu").attr("disabled",!1),$(".order_head").css("pointer-events","")}),$(document).on("click",".ui-button",function(){$(".modal-caller, .seminar_tab_label, #edit_menu").attr("disabled",!1),$(".modal-caller, .order_head").css("pointer-events","")}),App.concerns.set_form_action_to_submit("#form_change_leads_status",".seminar_tag_modal_submit",!0),App.concerns.set_form_action_to_submit("#form_change_leads_status",".checked_submit",!0),App.concerns.set_form_action_to_submit("#form_change_leads_status",".seminar_inside_sales_checked_modal_submit",!0),App.concerns.set_form_action_to_submit("#form_change_leads_status",".seminar_inside_sales_all_modal_submit",!0);new Clipboard(".clipboard-btn");App.concerns.mail_type_select_modal_submit("form_seminar_show"),App.concerns.mail_type_select_modal_submit("form_change_leads_status"),App.lead_filters.modal_seminars_mail_reject($(".seminars_mail_reject_modal")),this.summary(),this.any_tab(),$(document).on("click",".js_status_button",function(){$(".btn-group").removeClass("open"),$(".js_status_parent_button").attr("disabled",!0)}),$(document).on("click",".js_change_result_button",function(){$(".btn-group").removeClass("open"),$(".js_status_parent_button").attr("disabled",!0)}),App.concerns.set_mail_lead_link(),App.webinars.polls(),$("#webinar_id").val()&&$.ajax({url:"/xhr/seminars/check_webinar/"+$("#tab_type").val(),method:"GET",timeout:6e4,error:function(){$(".news-area").find(".loading").fadeOut(500,function(){$(".loading").remove(),$(".news-area").html($('<div><span style="color:#ff0000;">'+I18n.t("js.seminars.access_denied")+"</span></div>"))})}}).done(function(e){$(".news-area").html(e),$(".news-area").find(".hp-tooltip").tooltip({container:"body",trigger:"hover"})}),$(document).on("click","#enquete_csv_import",function(e){return e.preventDefault(),$("#enquete_csv_file_field").click(),!1}),$(document).on("input","#enquete_csv_file_field",function(){$("#enquete_button").click()}),$(document).on("click","#zoom_enquete_csv_import",function(e){return e.preventDefault(),$("#zoom_enquete_csv_file_field").click(),!1}),$(document).on("input","#zoom_enquete_csv_file_field",function(){$("#zoom_enquete_button").click()}),$("#seminar_tab_apply").is(":checked")&&$(".open_modal_lead_capture").on("click",function(){$("#apply_open_modal_lead_capture_id").val($(this).data("id"))}),$("#seminar_tab_enquetes").is(":checked")&&$(".open_modal_lead_capture").on("click",function(){$("#enquetes_open_modal_lead_capture_id").val($(this).data("id"))}),App.next_steps.set_workflow_index_tooltip(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),$(document).on("click",".js_submit_send_mail",function(){$(".open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));return $("#select_lead_id").val($(this).data("lead-id")),e.submit(),!1}),$(".stepable-record-field-modal-link").on("click",function(){$(".stepable_record_field_modal").find(".user_information").attr("stepable-record-field-page-scroll-top",$(document).scrollTop())})},summary:function(){$('input[name="mail_queue_id"]').each(function(e,t){App.concerns.create_mail_history_charts($(t).val())}),Highcharts.setOptions({colors:["#bf0000","#ddd"]}),$(".tooltip.fade.right.in").remove(),$(".hp-tooltip").tooltip({container:"body",trigger:"hover"}),this.summary_mail_submit()},any_tab:function(){App.visible_fields.setup_list_visible_setting(["name","client_id","post","organization_id"]),$(".show_list_fields").on("click",function(){App.visible_fields.show_list_fields_setting($(this).data("title"),$(this).data("close-text"),$(this).data("alert-text"))}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.change_order("form_search_seminars_leads"),this.change_order_item("form_search_seminars_leads"),App.concerns.all_checked_items(),this.attach_select_handlers($(".hp-page")),$(".add_leads_modal").on("click",function(e){$("#add_leads_entry_source").val(e.target.id),$("#mod_modal_title").val(e.target.text)}),$("#search-associated-resources-modal").on("show.bs.modal",function(){$("#mod_modal_title").val()&&$("#search-associated-resources-modal #LeadModalLabel").html($("#mod_modal_title").val())}),$("#search-associated-resources-modal").on("hidden.bs.modal",function(){$("#mod_modal_title").val("")}),$(".mail_submit").on("click",function(){$("#mod_modal_title").val(I18n.t("js.seminars.client_modal_title"))}),$("#change_display_number").on("click",function(){$("#display_number").val($("#change_display_number option:selected").val()),App.concerns.change_display_number("form_search_seminars_leads")}),$(".js_seminar_applicants_button").attr("disabled",!1),$("#form_search_seminars_leads").on("submit",function(){$(".js_seminar_applicants_button, .export-button").attr("disabled",!0),-1==$(this).attr("action").indexOf("applicants_search")&&-1==$(this).attr("action").indexOf("apply_search")&&-1==$(this).attr("action").indexOf("enquetes_search")||$("#applicants_table").html('<div class="loading text-center" style="margin-top: 30px;"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>')}),$(".js-slide-search-field").on("click",function(){$("#slide-target").slideToggle(),$(this).hasClass("in")?$(this).removeClass("in"):$(this).addClass("in")}),$(".js-slide-detail-search-field").on("click",function(){$("#slide-detail-search-target").slideToggle(),$(this).hasClass("in")?$(this).removeClass("in"):$(this).addClass("in")}),$(".js_open_modal_update_checked").on("click",function(){$("#lead_tags_update_type").val("checked")}),$(".js_open_modal_update_all").on("click",function(){$("#lead_tags_update_type").val("all")}),$("#js_submit_checked_mail").on("click",function(e){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){var t=$(e).val();if(t.length)return t}).length)return"applicants"==$("#tab_type").val()?msg=I18n.t("js.common.please_select"):msg=I18n.t("js.common.please_select_lead"),$("#seminars-alert-notice").html(
'<div class="row"><div class="col-xs-12"><div class="alert alert-danger alert-error" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><ul><li>'+msg+"</li></ul></div></div></div>"),$("html,body").animate({scrollTop:0},100),e.stopImmediatePropagation(),!1}),$("#checked-leads-link").on("click",function(){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),!1}),$("#js_submit_search_mail").on("click",function(e){if(!$("#all_lead_ids").val().trim())return msg=I18n.t("js.common.serch_result_none"),$("#seminars-alert-notice").html('<div class="row"><div class="col-xs-12"><div class="alert alert-danger alert-error" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button><ul><li>'+msg+"</li></ul></div></div></div>"),$("html,body").animate({scrollTop:0},100),e.stopImmediatePropagation(),!1}),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#update-all-modal-tags","#tags"),this.applicants_export("#form_search_seminars_leads","checked[lead_ids][]"),this.set_checked_seminars_lead_id("#form_change_leads_status","checked[lead_ids][]"),App.front_business_card_lead_tags.init_suggest("update-all-modal-tags","update-all-modal-tag-pulldown"),$("#modalsearchBusinessCardsLeadTags").on("hidden.bs.modal",function(){($("#myModal").is("[aria-hidden=false]")||$("#modaltagsBulkDeletionVisibleFields").is("[aria-hidden=false]"))&&$("body").addClass("modal-open")}),$("#modalsearchBusinessCardsLeadTags").on("shown.bs.modal",function(){$(".modal-backdrop").last().css("z-index",9998)}),$("#bulk_update").on("click",function(){var e=$("#myModal .select2-search-choice div");if(0==e.length)return alert(I18n.t("js.seminars.tag_not_set")),!1;var n=I18n.t("js.seminars.add_tag_confirm");if(e.each(function(e,t){n=n+"\n\u3000"+$(t).text()}),!confirm(n))return!1;$("#form_change_leads_status").submit()}),$(".js_submit_change_status").on("click",function(){$("#change_status_type").val(this.id),$("#add_leads_entry_source").val($(this).data("addLeadsEntrySource")),$("#form_change_leads_status").attr("action",$("#original_url").val()),$("#form_change_leads_status").submit()}),$("#invisible_number").on("click",function(){var e=this.dataset.value,t=$("<textarea></textarea>");t.text(e),$(this).append(t),t.select(),document.execCommand("copy"),t.remove()}),$(".tooltip.fade.top.in").remove(),$(".hp-tooltip").tooltip({container:"body",trigger:"hover"}),$("ul.pagination li a").on("click",function(){if($(this).parent().hasClass("active"))return!1;var e=$(this).attr("href").indexOf("page"),t=$(this).attr("href").substr(e+5);return $("#page").val(t),$("#paginate_flg").val("1"),$("#form_search_seminars_leads").submit(),$("#page").val(null),$("#paginate_flg").val("0"),!1}),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){$(this).data("confirm-flg")&&!confirm($(this).data("confirm-message"))||($(".btn-group.open").removeClass("open"),$(".modal-caller, .seminar_tab_label, #edit_menu").not(".modal .modal-caller").attr("disabled","disabled"),$(".modal-caller").not(".modal .modal-caller").css("pointer-events","none"),"js_submit_search_mail"===$(this).attr("id")?$("#js_search_mail").prop("disabled",!1):($("#js_search_mail").prop("disabled",!0),$("#all_checked_lead_id").prop("disabled",!0))),App.front_seminars.reset_disable_modal_button()}),App.concerns.open_mailer(),$("#search_pref_ids").select2(),$("#search_interest_product_type_ids").select2(),$("div#search_multiple").remove(),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids"),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),App.concerns.select_search_disable_user("search_owner_user_ids"),App.concerns.select_search_disable_user("search_user_ids"),App.concerns.select_search("campaign_ids"),App.concerns.select_search("target_list_ids"),App.concerns.select_search("web_form_ids"),App.concerns.select_search("inside_sales_ids");var e=$("#seminar_show_items_type_user_ids").val().split(" ");$.each(e,function(e,t){App.concerns.select_search_disable_user("search_items__"+t+"_item_user_ids")}),$("#search_lead_source_kbn_ids").select2({width:"100%",placeholder:I18n.t("js.common.lead_source")}),$("#search_lead_status").select2({width:"100%",placeholder:I18n.t("js.common.lead_status")}),App.concerns.datepicker(".search_datepicker"),App.concerns.set_item_id(),$("#search_important_customer_flg").select2({width:"100%",placeholder:I18n.t("js.common.important_customer")}),$("#search_end_user_flg").select2({width:"100%",placeholder:I18n.t("js.common.end_user")}),$("#search_store_flg").select2({width:"100%",placeholder:I18n.t("js.common.store")}),$("#search_competitor_flg").select2({width:"100%",placeholder:I18n.t("js.common.competitor")}),$("#search_error_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.mail_error")}),$("#search_error_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.tel_error")}),$("#search_error_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.fax_error")}),$("#search_error_address_flg").select2({width:"100%",placeholder:I18n.t("js.common.address_error")}),$("#search_not_mail_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_mail")}),$("#search_not_tel_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_tel")}),$("#search_not_fax_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_fax")}),$("#search_not_dm_flg").select2({width:"100%",placeholder:I18n.t("js.common.not_dm")}),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),$(".seminar_inside_sales_all_modal_submit").on("click",function(){$("#all_lead_ids").prop("disabled",!1)}),App.front_business_card_lead_tags.init_suggest("advanced-search-tags","advanced-search-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search","#search_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search","#advanced-search-tags","#search_tag_ids"),App.front_business_card_lead_tags.init_suggest("advanced-search-remove-tags","advanced-search-pulldown-remove-tags"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search-remove-tags","#search_remove_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search-remove-tags"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search-remove-tags","#advanced-search-remove-tags","#search_remove_tag_ids"),App.tooltip.display_tooltip()},applicants:function(){this.any_tab()},apply:function(){this.any_tab(),$(".open_modal_lead_capture").on("click",function(){$("#apply_open_modal_lead_capture_id").val($(this).data("id"))})},enquetes:function(){this.any_tab(),$(".open_modal_lead_capture").on("click",function(){$("#enquetes_open_modal_lead_capture_id").val($(this).data("id"))})},attach_select_handlers:function(e){App.concerns.attach_select_search_handlers(e),e.find("[data-hp-role='select2']").select2({minimumResultsForSearch:20})},datetimepicker:function(){$(".datetimepicker").datetimepicker({widgetPositioning:{horizontal:"left",vertical:"bottom"},format:"HH:mm",stepping:1})},reset_check:function(){$("#all-check").prop("checked",!1),$(".check-items").prop("checked",!1),$(".js_status_parent_button").removeAttr("disabled")},applicants_export:function(e,t){$("#csv_dl_submit").on("click",function(){return App.front_seminars.set_export_ids(e,t),App.concerns.set_page_parameter(e),action=$(e).attr("action"),mod_action=action.replace("xhr/","").replace(/applicants_search/g,"").replace(/apply_search/g,"").replace(/enquetes_search/g,"").replace("//","/")+"index.csv",$(e).attr("action",mod_action),$(e).removeAttr("data-remote"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo($(e)),$(e).submit(),$(".js_seminar_applicants_button, .export-button").attr("disabled",!1),$(e).attr("action",action),$(e).attr("data-remote",!0),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_all_dl_flg").val(1),action=$(e).attr("action"),mod_action=action.replace("xhr/","").replace(/applicants_search/g,"").replace(/apply_search/g,"").replace(/enquetes_search/g,"").replace("//","/")+"index.csv",$(e).attr("action",mod_action),$(e).removeAttr("data-remote"),$("input[name='authenticity_token']").val()&&$("<input>").attr({type:"hidden",name:"authenticity_token",value:$("input[name='authenticity_token']").val()}).appendTo($(e)),$(e).submit(),$(e).attr("action",action),$(e).attr("data-remote",!0),$("#csv_all_dl_flg").val(0),!1})},enable_associattion_search_modal:function(e,n,i){$(document).off("click",e).on("click",e,function(){var e="",t="";$("#add_leads_entry_source").val($(this).attr("id")),$.ajax({url:n,data:"utf8=\u2713&client_id="+t+e+"&select_type="+i+"&unlink_clients_flg=0"})})},set_associate_entities:function(e,t){$(document).on("click",e,function(){var e=jQuery.map($(t+":checked"),function(e){return $(e).val()});return 0==e.length?(alert(I18n.t("js.common.please_select")),!1):jQuery.map($(t+":checked"),function(e){return $(e).data("check-permission")}).some(function(e){return e})?(alert(I18n.t("js.common.can_not_add_private_item")),!1):void $.ajax({url:$("#add_leads_entry_source").data("post"),type:"POST",data:{lead_ids:e,add_leads_entry_source:$("#add_leads_entry_source").val(),single_flg:1,call_type:$("#call_type").val()}})})},toggle_mail_detail:function(e){$($(e).data("target")).slideToggle(),$(e).hasClass("in")?$(e).removeClass("in"):$(e).addClass("in")},reset_disable_modal_button:function(){$(".modal-caller, .seminar_tab_label, #edit_menu").attr("disabled",!1),$(".modal-caller").css("pointer-events","")},clear_seminar_search_modal:function(e,t,n){e.stopPropagation(),t=t||"#form_xhr_seminars_search",n=n||"#wf, #ewf, #es, #search_user_ids_on_search_association_modal, #search_segment_id",$seminarModal=$(t),$seminarModal[0].reset(),$seminarModal.find("input").not("input[name='_method']").not("input[name='authenticity_token']").not("input[name^='segment-icon']").not(":checkbox").not(".non_clear").val(""),$seminarModal.find("#search_segment_id").val(""),$(n).val(null).trigger("change")},summary_mail_submit:function(){$(".summary_mail").on("click",function(){var e=$(this).data().seminarMail;if(e.alert_flg)return alert(e.alert_message),!1;if(e.confirm_flg&&!confirm(e.confirm_message))return!1;"js_submit_invite_guests_mail"===$(this).attr("id")?($("#js_lead_ids").val($("#invite_guests_lead_ids").val()),$("#js_condition").val("0")):"js_submit_attendees_mail"===$(this).attr("id")?($("#js_lead_ids").val($("#attendees_lead_ids").val()),$("#js_condition").val("1")):"js_submit_absentees_mail"===$(this).attr("id")?($("#js_lead_ids").val($("#absentees_lead_ids").val()),$("#js_condition").val("2")):"js_submit_not_invite_mail"===$(this).attr("id")?($("#js_lead_ids").val($("#not_invite_lead_ids").val()),$("#js_condition").val("3")):"js_submit_no_response_set_invite_mail"===$(this).attr("id")?($("#js_lead_ids").val($("#no_response_set_invite_mail_lead_ids").val()),$("#js_condition").val("4")):"js_submit_no_response_not_set_invite_mail"===$(this).attr("id")&&($("#js_lead_ids").val($("#no_response_not_set_invite_mail_lead_ids").val()),$("#js_condition").val("5")),App.concerns.change_action_checked_mass_mail(this);var t=$(this).data().target;$(t).show(),$(t).modal(["backdrop","static"])})},set_export_ids:function(e,t){$('input:checked[name="'+t+'"]').each(function(){$("<input>").attr({type:"hidden",name:"export_ids[]",value:$(this).data("seminarsLeadIds")}).appendTo(e)})},set_checked_seminars_lead_id:function(e,t){$(e).submit(function(){$(".checked_seminars_lead_ids").remove(),$('input:checked[name="'+t+'"]').each(function(){$("<input>").attr({type:"hidden",name:"checked[seminars_lead_ids][]",value:$(this).data("seminarsLeadIds"),"class":"checked_seminars_lead_ids"}).appendTo(e)})})},set_seatch_form_action:function(e,t){$("#form_search_seminars_leads").attr("action","/xhr/seminars/"+t+"/"+e+"_search/")},change_order_item:function(e){$(".item_order_head").on("click",function(){$("#order_key").val($(this).data("order-key")),$("#order_type").val($(this).data("order-type")),$("#order_item_id").val($(this).data("order-item_id")),$("#order_flg").val(1),$("#"+e).submit()})},copy_clipboard_detailed:function(){data=$("#webinar_join_url").val();var e=$("#copy_clipboard");e.html(""),e.addClass("fa fa-check");var t=function(){e.attr({"data-original-title":I18n.t("js.seminars.copied")}),e.tooltip("show")};(function(e){var t=document.createElement("textarea");t.textContent=e;var n=document.getElementsByTagName("body")[0];n.appendChild(t),t.select();var i=document.execCommand("copy");n.removeChild(t)})(data);var n=function(){e.removeClass("fa fa-check"),e.html(I18n.t("js.seminars.copy_invitation_link")),e.tooltip("hide"),e.attr({"data-original-title":I18n.t("js.seminars.copy_clipboard")})};setTimeout(t,500),setTimeout(n,1500)},copy_clipboard_list:function(e){data=$("#webinar_join_url"+e).val();var t=$("#copy_clipboard_"+e);t.html(""),t.addClass("fa fa-check");var n=function(){t.attr({"data-original-title":I18n.t("js.seminars.copied")}),t.tooltip("show")};(function(e){var t=document.createElement("textarea");t.textContent=e;var n=document.getElementsByTagName("body")[0];n.appendChild(t),t.select();var i=document.execCommand("copy");n.removeChild(t)})(data);var i=function(){t.removeClass("fa fa-check"),t.html(I18n.t("js.seminars.copy_invitation_link")),t.tooltip("hide"),t.attr({"data-original-title":I18n.t("js.seminars.copy_clipboard")})};setTimeout(n,500),setTimeout(i,1500)},tab_change:function(){$(".news-area").html('<div class="loading text-center"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>'),$("#webinar_id").val()&&$.ajax({url:"/xhr/seminars/check_webinar/"+$("#tab_type").val(),method:"GET",timeout:6e4,error:function(){$(".news-area").find(".loading").fadeOut(500,function(){$(".loading").remove(),$(".news-area").html($('<div><span style="color:#ff0000;">'+I18n.t("js.seminars.access_denied")+"</span></div>"))})}}).done(function(e){$(".news-area").html(e),$(".news-area").find(".hp-tooltip").tooltip({container:"body",trigger:"hover"})})},select_webinar:function(e){function t(){$("#webinar_list").html(""),webinar_holder_change=$("#webinar-holder").val().replace(/\\\#/g,"#");var e=JSON.parse(webinar_holder_change),t="";if(10<e.length)for(var n=0;n<10;n++){var i=e[n][0];t+="<option value='"+e[n][1]+"'>"+i+"</option>"}else for(n=0;n<e.length;n++){i=e[n][0];t+="<option value='"+e[n][1]+"'>"+i+"</option>"}$("#webinar_list").append("<option></option>"),$("#webinar_list").append(t),$("#webinar_list").trigger("change")}$("#webinar_list").select2(),$("#webinar_id").val(""),$(".webinar-no-selected-warning").hide();$("#webinar_list").children();$("#webinars-modal").on("hidden.bs.modal",function(){$("#webinars-modal").html("")}),$("#webinars-modal").on("show.bs.modal",function(){$(this).focus()}),$("#create_webinar").click(function(){return""!=$("#webinar_id").val()?(this.href=this.href+"&webinar_id="+$("#webinar_id").val()+"&tab_type="+e,!0):($(".webinar-no-selected-warning").show(),!1)}),$(".webinar-no-selected-close-btn").click(function(){$(".webinar-no-selected-warning").hide()}),$("#webinar_list").on("change",function(){var e=$("#webinar_list").val();$("#webinar_id").val(e)}),$("#webinar_list").on("select2-opening",function(){$(".webinar-no-selected-warning").hide(),t()}),$(".select2-input").keydown(function(){$("#webinar_list").html(""),webinar_holder_change=$("#webinar-holder").val().replace(/\\\#/g,"#");for(var e=JSON.parse(webinar_holder_change),t=0;t<e.length;t++){var n=e[t][0],i=e[t][1];$("#webinar_list").append("<option value='"+i+"'>"+n+"</option>")}}),$(".select2-input").keyup(function(){""==$(this).val()&&t()})},saveCountry:function(){count=0;var e="";checkSave=!0;for(var t=0;t<countrymap.size;t++)key_array=Array.from(countrymap.keys()),e+=key_array[t]+",",count++;document.getElementById("selcountry").value=e.substring(0,e.length-1),count-=1,0==count?document.getElementById("check_value").innerHTML=I18n.t("js.seminars.dial")+default_value():document.getElementById("check_value").innerHTML=I18n.t("js.seminars.dial")+default_value()+I18n.t("js.seminars.other")+count+I18n.t("js.seminars.country")},cancelCountry:function(){var e=document.getElementById("selcountry").value.split(",");countrymap.clear();for(var t=0;t<e.length;t++)for(var n=0;n<allcountry.length;n++)allcountry[n].value==e[t]&&countrymap.set(allcountry[n].value,inputElems[n].value)},searchCountry:function(){$(".filter").keyup(function(){var e=document.getElementsByClassName("countrylist"),t=Array.from(document.querySelectorAll("#display_country"));if(input_value=document.getElementById("filter").value,""==input_value)for(var n=0;n<e.length;n++)t[n].style.display="block";else{var i="";for(n=0;n<e.length;n++)e[n].value.toLowerCase().includes(input_value.toLowerCase())?(i=e[n].value,t[n].style.display="block",$("#select-all").attr("disabled",!1)):(t[n].style.display="none",document.getElementById("warning-message").innerHTML=I18n.t("js.seminars.search_country"),$("#select-all").attr("disabled",!0));""!=i&&(document.getElementById("warning-message").innerHTML="",$("#select-all").attr("disabled",!1))}if(""==input_value){document.getElementById("warning-message").innerHTML="",$("#select-all").attr("disabled",!1);for(n=0;n<e.length;n++)0==e[n].checked&&(document.getElementById("select-all").checked=!1)}})},showPop:function(){$("#Modal").find(".hp-tooltip").tooltip({container:"body",trigger:"hover"}),$("#Modal").on("shown.bs.modal",function(){$("#Modal").data("bs.modal").options.backdrop="static"}),$("#details-modal").scroll(function(){$(".input-date").datepicker("place")});var e=document.getElementsByClassName("countrylist"),t=document.getElementById("selcountry").value,n=t.split(","),i=document.getElementById("webformid").value;document.getElementById("select-all").checked=!1;for(var a=0;a<allcountry.length;a++)e[a].checked=!1;for(a=0;a<n.length;a++)for(var s=0;s<allcountry.length;s++)allcountry[s].value==n[a]&&(e[s].checked=!0);for(a=0;a<allcountry.length;a++)e[a].checked;if(""==i&&(document.getElementById("webFormOn").disabled=!0,document.getElementById("webFormOff").disabled=!0),""==t?form_load():cardListAction(this),$("#select-all").click(function(){var e=document.getElementsByClassName("countrylist");if(input_value=document.getElementById("filter").value,countrychkAllMap.clear(),""==input_value)for(var t=this.checked,n=0;n<e.length;n++)e[n].checked=t,countrychkAllMap.set(allcountry[n].value,e[n].value);else for(t=this.checked,n=0;n<e.length;n++)e[n].value.toLowerCase().includes(input_value.toLowerCase())&&(e[n].checked=t,countrychkAllMap.set(allcountry[n].value,e[n].value));var i=countrychkAllMap.size;if(0<i)for(n=0;n<i;n++)1==this.checked?(key_array=Array.from(countrychkAllMap.keys()),value_array=Array.from(countrychkAllMap.values()),countrymap.set(key_array[n],value_array[n])):countrymap["delete"](key_array[n]);cardListAction(this)}),$("button[data-dismiss-modal=modal2]").click(function(){$("#Modal").modal("hide")}),$(".checkpass").click(function(){1==document.querySelector(".checkpass").checked?(document.querySelector(".passcode").style.display="block",document.getElementById("req_pc_description").style.display="block"):(document.querySelector(".passcode").style.display="none",document.getElementById("req_pc_description").style.display="none")}),$(".clickrecord").click(function(){1==document.querySelector(".clickrecord").checked?document.querySelector(".recordcheck").style.visibility="visible":document.querySelector(".recordcheck").style.visibility="hidden"}),$(".showedit").click(function(){var e=document.querySelector(".editlink");$(e).show();var t=document.querySelector(".check_value");$(t).show()}),$(".hideedit").click(function(){var e=document.querySelector(".editlink");$(e).hide();var t=document.querySelector(".check_value");$(t).hide()}),$(window).keydown(function(e){27==e.keyCode&&(clearResult(),$("#Modal").is(":visible")?$("#Modal").modal("hide"):($("#details-modal").modal("hide"),$("#details-modal").html("")))}),1==document.querySelector(".checkpass").checked?(document.querySelector(".passcode").style.display="block",document.getElementById("req_pc_description").style.display="block"):(document.querySelector(".passcode").style.display="none",document.getElementById("req_pc_description").style.display="none"),$("#voip").is(":checked")){var o=document.querySelector(".editlink");$(o).hide();var r=document.querySelector(".check_value");$(r).hide()}1==document.querySelector(".clickrecord").checked?document.querySelector(".recordcheck").style.visibility="visible":document.querySelector(".recordcheck").style.visibility="hidden"},showDialog:function(e,t){confirm(I18n.t("js.seminars.delete_message"))&&$.ajax({url:"/seminars/webinar_destroy_on_hotprofile/"+e+"/"+t,method:"GET"})},set_country_params:function(e){if("edit"==e){countries=$("#selcountry").val(),country=countries.split(","),dial_coutries_str=$("#countries").val(),dial_countries=dial_coutries_str.slice(18,dial_coutries_str.length-1),dial_country=dial_countries.split(",");for(var t="",n=0;n<dial_country.length;n++){var i=dial_country[n].split("=")[0].replace(/"/g,""),a=dial_country[n].split("=")[1].replace(/\\/g,"").replace(/"/g,"");" "==i.charAt(0)&&(i=i.substring(1)),i==country[0]&&(t=a,n=dial_country.length)}if(1==country.length)document.getElementById("check_value").innerHTML=I18n.t("js.seminars.dial")+t;else{var s=country.length-1;document.getElementById("check_value").innerHTML=I18n.t("js.seminars.dial")+t+I18n.t("js.seminars.other")+s+I18n.t("js.seminars.country"),document.querySelector("#countrycount").innerHTML=country.length}countrymap.clear();document.getElementsByClassName("countrylist");document.getElementById("resultlist").innerHTML="";for(var o=0;o<country.length;o++)for(var r=0;r<dial_country.length;r++){i=dial_country[r].split("=")[0].replace(/"/g,""),a=dial_country[r].split("=")[1].replace(/\\/g,"").replace(/"/g,"");" "==i.charAt(0)&&(i=i.substring(1)),country[o]===i&&countrymap.set(i,a)}}}};var dragging=null;document.addEventListener("dragstart",function(e){var t=getLI(e.target);dragging=t,e.dataTransfer.setData("text/plain",null),e.dataTransfer.setDragImage(self.dragging,0,0)}),document.addEventListener("dragover",function(e){e.preventDefault();var t=getLI(e.target),n=t.getBoundingClientRect(),i=n.y+n.height/2;0<e.clientY-i?t.style["border-top"]="":t.style["border-bottom"]=""}),document.addEventListener("dragleave",function(e){var t=getLI(e.target);t.style["border-bottom"]="",t.style["border-top"]=""}),document.addEventListener("drop",function(e){e.preventDefault();var t=getLI(e.target);""!==t.style["border-bottom"]?(t.style["border-bottom"]="",t.parentNode.insertBefore(dragging,e.target.nextSibling)):(t.style["border-top"]="",t.parentNode.insertBefore(dragging,e.target));var n=document.getElementById("resultlist").getElementsByTagName("input");countrymap.clear();for(var i=0;i<=n.length-1;i++)for(var a=0;a<allcountry.length;a++)allcountry[a].value==n[i].value&&countrymap.set(allcountry[a].value,inputElems[a].value)}),App.front_service_conjugation_status_notifications={index:function(){App.concerns.change_display_number("form_search_service_conjugation_status_notifications"),App.concerns.change_order("form_search_service_conjugation_status_notifications"),App.concerns.set_form_action_to_submit("#form_checked_service_conjugation_status_notifications","#js_destroys_submit",!0),App.concerns.all_checked_items(),this.set_index(),this.service_conjugation_status_notification_modal(),this.tweak_department_modal(),this.show_service_conjugation_status_notification_modal();new Clipboard(".clipboard-btn")},set_index:function(){var e=function(){if("block"===$(".user-information-show").css("display"))return $(".user-information-show").hide(),!1;var e=$(this).data("user-id"),t=$(this).offset().top,n=$(this).offset().left+$(this).width()/2;$("#position_top").val(t),$("#position_left").val(n),$("#user-information-form").attr("action","/xhr/user_communications/user_information_show/"+e),$("#user-information-form").submit()};$(document).on("click",".user_information",e),$("a.new, a.edit").on("click",function(){var e=$(this).attr("data-id");$("#new-or-edit-selected-id").html(e||"")}),$("a.show").on("click",function(){var e=$(this).attr("data-id");$("#show-selected-id").html(e||"")})},service_conjugation_status_notification_modal:function(){var a=$("#service_conjugation_status_notification_modal");a.on("show.bs.modal",function(e){var t=e.relatedTarget;if(t&&"#service_conjugation_status_notification_modal"==t.getAttribute("data-target")||$("#from-show").html()){$("#from-show").html(!1),a.find("#error_message").empty(),a.find(".loading-indicator").show(),a.find(".checked_submit").prop("disabled",!0);var n=$("#new-or-edit-selected-id").html(),i=n?n+"/edit":"new";$.ajax({url:"/xhr/service_conjugation_status_notifications/"+i,type:"GET",dataType:"html"}).done(function(e){var t=$("#service_conjugation_status_notification_modal_content");t.html(e),App.concerns.select_search_disable_user("users"),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal-service_conjugation_status_notification","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),$(".hp-tooltip").tooltip({container:"body",trigger:"hover"}),a.find("#s2id_users").css("width","100%"),a.find(".loading-indicator").hide(),a.find(".checked_submit").prop("disabled",!1),a.find("input[type='submit']").off("click"),a.find("input[type='submit']").on("click",function(){$(".loading-indicator").show(),$form=t.find("form"),$form.off("ajax:success"),$form.off("ajax:error"),$form.on("ajax:success",function(e){var t=e.target.action;t&&-1!==t.indexOf("service_conjugation_status_notifications")&&window.location.reload()}),$form.on("ajax:error",function(e,t){var n=$("#error_message");422===t.status?n.html(t.responseText):alert(I18n.t("js.common.communication_failed")),$(".loading-indicator").hide()}),$form.submit()})}).fail(function(){a.modal("hide"),window.location.reload()})}})},tweak_department_modal:function(){var n=$("#service_conjugation_status_notification_modal_content"),i=new MutationObserver(function(){var e=$("#modalsearchDepartments .modal-header");0<e.length&&(element="<span class='no-accordingly-unopen-in-the-opened' id='conjugation-department-clickjack'></span>",e.append(element),$("#conjugation-department-clickjack").on("click",function(){$("#modalsearchDepartments").modal("hide"),i.observe(n[0],{childList:!0,subtree:!0})}),i.disconnect())});i.observe(n[0],{childList:!0,subtree:!0}),new MutationObserver(function(){if("none"==$("#modalsearchDepartments").css("display")&&i.observe(n[0],{childList:!0,subtree:!0}),0<$("#loading-list").length){var e=n.height(),t=n.children("modal-header").height();$("#loading-list").height(e-t)}}).observe(n[0],{childList:!0,subtree:!0})},show_service_conjugation_status_notification_modal:function(){var i=$("#show_service_conjugation_status_notification_modal");i.on("show.bs.modal",function(e){var t=e.relatedTarget;if(t&&"#show_service_conjugation_status_notification_modal"==t.getAttribute("data-target")){i.find("#error_message").empty(),i.find(".loading-indicator").show(),i.find(".checked_submit").prop("disabled",!0);var n=$("#show-selected-id").html();$.ajax({url:"/xhr/service_conjugation_status_notifications/"+n,type:"GET",dataType:"html"}).done(function(e){$("#show_service_conjugation_status_notification_modal_content").html(e),App.concerns.set_tooltip(),i.find(".loading-indicator").hide(),i.find("#show-to-edit-btn").on("click",function(){i.modal("hide"),$("#new-or-edit-selected-id").html(n),$("#from-show").html(!0),$("#service_conjugation_status_notification_modal").modal("show")})}).fail(function(){i.modal("hide"),window.location.reload()})}})}},App.front_service_conjugation_statuses={index:function(){this.prepareDatePicker(),this.searchAjax()},prepareDatePicker:function(){var e=this;$(".search_datepicker").datepicker({startDate:$("#deploy_start_year").text(),minViewMode:"months",format:"yyyy/mm",orientation:"bottom"}),$("#datepicker_clear").on("click",function(){$(".search_datepicker").datepicker("setDate",e.getYearMonth()),$("#form_search_aggregate_conjugations").find(".search-button").click()})},getYearMonth:function(){var e=new Date,t=String(e.getMonth()+1),n=String(e.getFullYear());return 1==t.length&&(t="0"+t),n+"/"+t},folding:function(e,t){t.find(".access_department button.folding").on("click",function(){if("expand"==$(this).attr("data-action"))App.front_department_roles.children_list_show(this);else{var e=$(this).parent("th").data("department-id");$(this).attr("data-action","expand");var t=$(this).parents("tr").nextAll("tr[data-parent-id="+e+"]");t.hide(),App.front_department_roles.children_list_hide(t)}}),e.on("click","#all_open",function(){t.find(".access_department button").attr("data-action","collapse"),t.find("tr").show()}),e.on("click","#all_close",function(){t.find(".access_department button.folding").attr("data-action","expand"),t.find("tbody tr").not("[data-depth=1]").hide()})},searchAjax:function(){var i=this,e=$("#form_search_aggregate_conjugations"),a=$("#service_conjugation_status_form_container");$(".search_datepicker").datepicker({startDate:$("#deploy_start_year").text(),minViewMode:"months",format:"yyyy/mm",orientation:"bottom"}),$("#datepicker_clear").on("click",function(){$(".search_datepicker").datepicker("setDate",i.getYearMonth()),$("#aggregate_conjugation_data").hide()}),e.on("ajax:success",function(e,t){App.concerns.remove_disabled_btn(".js-disable-btn");var n=$("#aggregate_conjugation_data");n.html(t),n.show(),a.find(".loading-indicator").hide(),i.folding(a,n)}),e.on("ajax:error",function(e,t){var n=$("#period_error_messege");422===t.status?n.html(t.responseText):alert(I18n.t("js.common.communication_failed")),a.find(".loading-indicator").hide()}),e.find("[data-hp-role='export']").on("click",function(){e.data("remote",!1),e.find("[name='format']").val("csv"),e.submit(),setTimeout(function(){e.data("remote",!0),e.find("[name='format']").val("html")},100)}),e.find(".search-button").on("click",function(){App.concerns.disabled_btn(".js-disable-btn"),$("#aggregate_conjugation_data").hide(),e.data("remote",!0),e.find("[name='format']").val("html"),$("#period_error_messege").empty(),a.find(".loading-indicator").show(),e.submit()}),e.find(".search-button").click()}},App.front_service_statuses={index:function(){this.select_key(),this.remaining_alert(),this.remaining_number(),this.aggregate_by_department_modal(),this.business_card_request_allocation_number_modal()},select_key:function(){$(".box").not(".this_month").hide(),$(".this_month").show(),$(".detail_box").hide(),$("#key").on("change",function(){return"this_month"==$(this).val()?($(".box").not(".this_month").hide(),$(".this_month").show()):"last_month"==$(this).val()?($(".box").not(".last_month").hide(),$(".last_month").show()):"month_before_last"==$(this).val()&&($(".box").not(".month_before_last").hide(),$(".month_before_last").show()),!1}),$("#view_detail_login_user").on("click",function(){return $(".easy_box.login_user").hide(),$(".detail_box.login_user").show(),!1}),$("#view_easy_login_user").on("click",function(){return $(".detail_box.login_user").hide(),$(".easy_box.login_user").show(),!1}),$("#view_detail_all_user").on("click",function(){return $(".easy_box.all_user").hide(),$(".detail_box.all_user").show(),!1}),$("#view_easy_all_user").on("click",function(){return $(".detail_box.all_user").hide(),$(".easy_box.all_user").show(),!1}),$(".show-details").on("click",function(){$downArrow=$(this).children(".fa-angle-down"),$upArrow=$(this
).children(".fa-angle-up"),$downArrow.removeClass("fa-angle-down"),$downArrow.addClass("fa-angle-up"),$upArrow.removeClass("fa-angle-up"),$upArrow.addClass("fa-angle-down"),$(this).next().slideToggle()})},remaining_alert:function(){var e=$("#user_request_pack_threshold").text().replace(",",""),t=$(".remaining_display .number").text().replace(",","");Number(e)<Number(t)?$("#business_card_request_alert").css("display","none"):$("#business_card_request_alert").css("display","")},remaining_number:function(){var e=$(".remaining_display .number"),t=$(".remaining_display .number").text().replace(",","");Number(t)<0?e.css("color","#FF0000"):e.css("color","")},getYearMonth:function(){var e=new Date,t=String(e.getMonth()+1),n=String(e.getFullYear());return 1==t.length&&(t="0"+t),n+"/"+t},aggregate_by_department_modal:function(){var i=this,a=$("#aggregate_by_department_modal");a.one("show.bs.modal",function(){var e=$("#form_search_aggregates");$(".search_datepicker").datepicker({startDate:$("#deploy_start_year").text(),minViewMode:"months",format:"yyyy/mm",orientation:"bottom"}),$(".search_datepicker").datepicker().on("show.bs.modal",function(e){e.stopPropagation()}),$("#datepicker_clear").on("click",function(){$(".search_datepicker").datepicker("setDate",i.getYearMonth()),$("#form_search_aggregates").find(".search-button").click()}),e.on("ajax:success",function(e,t){var n=$("#aggregate_data");n.html(t),a.find(".loading-indicator").hide(),i.folding(a,n),App.concerns.remove_disabled_btn(".js-disable-btn")}),e.on("ajax:error",function(e,t){var n=$("#period_error_messege");422===t.status?n.html(t.responseText):alert(I18n.t("js.common.communication_failed")),App.concerns.remove_disabled_btn(".js-disable-btn"),a.find(".loading-indicator").hide()}),e.find("[data-hp-role='export']").on("click",function(){$.ajax({url:"/xhr/service_statuses/search_check",type:"GET",dataType:"json",data:{search:{from_trade_on:$("#start_year_month").val(),to_trade_on:$("#end_year_month").val()}}}).done(function(){e.data("remote",!1),e.find("[name='format']").val("csv"),e.submit(),setTimeout(function(){e.data("remote",!0),e.find("[name='format']").val("html")},100)}).fail(function(e){var t=$("#period_error_messege");422===e.status?t.html(e.responseText):alert(I18n.t("js.common.communication_failed")),a.find(".loading-indicator").hide()})}),e.find(".search-button").on("click",function(){App.concerns.disabled_btn(".js-disable-btn"),e.data("remote",!0),e.find("[name='format']").val("html"),$("#period_error_messege").empty(),a.find(".loading-indicator").show(),e.submit()}),e.find(".search-button").click()}),a.on("hide.bs.modal",function(){$("#period_error_messege").empty()})},sum_business_card_request_allocation:function(){var i=0;$('input[data-sum-target="true"]').each(function(e,t){var n=parseInt($(t).val().replace(",",""));n&&(i+=n)}),$("#sum_business_card_request_allocation").text(App.concerns.number_with_delimiter(i))},sum_express_business_card_request_allocation:function(){var i=0;$('input[data-sum-express-target="true"]').each(function(e,t){var n=parseInt($(t).val().replace(",",""));n&&(i+=n)}),$("#sum_express_business_card_request_allocation").text(App.concerns.number_with_delimiter(i))},business_card_request_allocation_number_modal:function(){var n=this,i=$("#business_card_request_allocation_number_modal");i.on("hidden.bs.modal",function(){$(".modal-backdrop:first").css("z-index",""),$("#form_search_aggregates").submit()}),i.on("show.bs.modal",function(){$(".modal-backdrop:first").css("z-index",1051),i.css("z-index",1052),i.find("#error_message").empty(),i.find(".loading-indicator").show(),i.find(".checked_submit").prop("disabled",!0),$.ajax({url:"/xhr/service_statuses/departments/edit",type:"GET",dataType:"html"}).done(function(e){var t=$("#business_card_request_allocation_number_modal_department_tree");t.html(e),i.find(".loading-indicator").hide(),i.find(".checked_submit").prop("disabled",!1),i.find("input[type='submit']").off("click"),i.find("input[type='submit']").on("click",function(){$("#loading").show(),$form=t.find("form"),$form.on("ajax:success",function(){i.modal("hide")}),$form.on("ajax:error",function(e,t){var n=$("#error_message");422===t.status?n.html(t.responseText):alert(I18n.t("js.common.communication_failed")),$("#loading").hide()}),$form.submit()}),n.sum_business_card_request_allocation(),n.sum_express_business_card_request_allocation(),t.find('input[data-sum-target="true"]').on("keyup.autoNumeric",function(){n.sum_business_card_request_allocation()}),t.find('input[data-sum-express-target="true"]').on("keyup.autoNumeric",function(){n.sum_express_business_card_request_allocation()}),n.folding(i,t)})})},folding:function(e,t){t.find(".access_department button.folding").on("click",function(){if("expand"==$(this).attr("data-action"))App.front_department_roles.children_list_show(this);else{var e=$(this).parent("th").data("department-id");$(this).attr("data-action","expand");var t=$(this).parents("tr").nextAll("tr[data-parent-id="+e+"]");t.hide(),App.front_department_roles.children_list_hide(t)}}),e.on("click","#all_open",function(){t.find(".access_department button").attr("data-action","collapse"),t.find("tr").show()}),e.on("click","#all_close",function(){t.find(".access_department button.folding").attr("data-action","expand"),t.find("tbody tr").not("[data-depth=1]").hide()})}},App.front_settings={show:function(){App.concerns.change_display_number("form_search_page_groups"),App.concerns.change_order("form_search_page_groups"),App.concerns.all_checked_items(),this.change_form("form_checked_page_groups")},edit:function(){this.set_datepicker(),this.submit_edit(),this.change_index(),this.no_disp_prefix_field()},update:function(){this.set_datepicker(),this.submit_edit(),this.change_index(),this.no_disp_prefix_field()},submit_edit:function(){$("#edit_submit").on("click",function(){var e=$("#two_factor_auth_flg_select").val(),t=$("#company_tfa_flg").data("companyTfaFlg");if(e!==undefined&&"true"===e){var n=$("#two_factor_start_date").val(),i=(new Date).toISOString().split("T")[0];if(new Date(n)<=new Date(i))return $("#confirm_tfa_start_date").modal("show"),!1}if(t!==undefined&&!0===t&&e!==undefined&&"false"===e)return $("#confirm_reset_tfa_flg").modal("show"),!1;$("form.edit_company").submit(),$("#edit_submit").prop("disabled",!0)}),$("#confirm_tfa_start_date #exec").on("click",function(){$(this).attr("disabled",!0),$("form.edit_company").submit()}),$("#confirm_reset_tfa_flg #exec").on("click",function(){$(this).attr("disabled",!0),$("form.edit_company").submit()})},change_form:function(e){$(".checked_submit").on("click",function(){form=$("#"+e),$(form).attr("action",$(this).data("action")),$(this).data("remote")?$(form).attr("data-remote","true"):($(form).removeAttr("data-remote"),$(form).removeData("remote"))})},change_index:function(){$(".sortable").sortable({cursor:"move",opacity:.7,items:"li.fields",update:function(){$("[name=sort_order]").val($(".sortable").sortable("toArray"))}}),$(".sortable").disableSelection()},no_disp_prefix_field:function(){$(".fields").each(function(){"true"==$(this).children("[class^='delete_field_']").val()&&$(this).hide()})},set_datepicker:function(){var e=this;App.concerns.datepicker(".datepicker"),$(document).ready(function(){e.toggle_datepicker()})},toggle_datepicker:function(){var e=$("#two_factor_auth_flg_select").val(),t=$("#start_date_picker");"true"===e?t.show():t.hide()}},App.sort_settings={show_sort_setting:function(){$("html, body").scrollLeft(0);var e=$("#sort_setting_dialog").removeClass("hide").dialog({modal:!0,title:I18n.t("js.sort_settings.title"),width:400,title_html:!0,draggable:!0,buttons:[{text:I18n.t("js.common.close"),"class":"btn btn-primary btn-xs",click:function(){$(this).dialog("close")}}],open:function(){$("body, html").css({overflowX:"hidden","word-wrap":"break-word"}),$(document).trigger("floatTableUpdate")},close:function(){$("#form_sort_setting").submit(),$("body,html").css("overflowX",""),$(document).trigger("floatTableUpdate")}});$("select.js-force-scroll-order-key").select2({dropdownParent:$(e),minimumResultsForSearch:-1,dropdownCssClass:"custom-dropdown-order-key"}),$("select.js-force-scroll-order-type").select2({dropdownParent:$(e),minimumResultsForSearch:-1,dropdownCssClass:"custom-dropdown-order-type"})},show_sort_setting_on_modal:function(){$("html, body").scrollLeft(0);var e=$("#sort_setting_dialog_on_modal").removeClass("hide").dialog({modal:!0,title:I18n.t("js.sort_settings.title"),width:400,title_html:!0,draggable:!0,buttons:[{text:I18n.t("js.common.close"),"class":"btn btn-primary btn-xs",click:function(){$(this).dialog("close")}}],open:function(){$("body, html").css({"word-wrap":"break-word"}),$(document).trigger("floatTableUpdate"),$(".ui-widget-overlay").css("z-index",1081),$("#sort_setting_dialog_on_modal").parent(".ui-dialog").css({"z-index":1082})},close:function(){$("#form_sort_setting_on_modal").submit(),$(document).trigger("floatTableUpdate"),$("#sort_setting_dialog_on_modal").addClass("hide")}});$("select.js-force-scroll-order-key").select2({dropdownParent:$(e),minimumResultsForSearch:-1,dropdownCssClass:"custom-dropdown-order-key"}),$("select.js-force-scroll-order-type").select2({dropdownParent:$(e),minimumResultsForSearch:-1,dropdownCssClass:"custom-dropdown-order-type"})},show_sort_setting_on_sale_approaches:function(){$("html, body").scrollLeft(0);var e=$("#sort_setting_dialog").removeClass("hide").dialog({modal:!0,title:I18n.t("js.sort_settings.title"),width:400,title_html:!0,draggable:!0,buttons:[{text:I18n.t("js.common.close"),"class":"btn btn-primary btn-xs",click:function(){$(this).dialog("close")}}],open:function(){$("body, html").css({overflowX:"hidden","word-wrap":"break-word"}),$(document).trigger("floatTableUpdate")},close:function(){$("#form_sort_setting").submit(),$("body,html").css("overflowX",""),$(document).trigger("floatTableUpdate"),$(".ha-loading").show(),$("input[id=others_hot_approach_sort_item]").val($("select.js-force-scroll-order-key").select2("data").id),$("input[id=others_hot_approach_sort_order]").val($("select.js-force-scroll-order-type").select2("data").id),App.front_hot_approaches.submit_form_search_hot_approaches()}});$("select.js-force-scroll-order-key").select2({dropdownParent:$(e),minimumResultsForSearch:-1,dropdownCssClass:"custom-dropdown-order-key"}),$("select.js-force-scroll-order-type").select2({dropdownParent:$(e),minimumResultsForSearch:-1,dropdownCssClass:"custom-dropdown-order-type"})}},App.front_stories={load:function(){function a(e){var i=$("#story-mail-target-extraction-modal-wrapper");if(!(e=e))return!1;i.html(e);var t=i.find("[data-hp-role='copy-button']"),a=window.getSelection();t.on("click",function(){var e=i.find("[data-hp-role='story-mail-target-extraction-condition-modal']");0<a.rangeCount&&a.removeAllRanges();var t=document.createRange(),n=e.find("[data-hp-role='copy']").get(0);t.selectNode(n),a.addRange(t)}),$(".hp-page [data-hp-role='story-mail-target-extraction-condition-modal']").modal("show")}function l(e,n){return result=null,$.each(e,function(e,t){t[0]==n&&(result=t)}),result}storyFunctions={storyData:{},actions:[],selectableMail:[],seminars:[],webForms:[],selectedSeminarIds:[],selectedWebFormIds:[],timeoutID:null,timoutMinutes:29,campaignId:null,getRandomId:function(){for(var e=20,t="abcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n},initialScenarioJson:function(){return{name:null,description:null,enabled:!0,started_at:$("#story_started_at").val(),finished_at:$("#story_finished_at").val(),saved:!1,deletable_flg:!0,first_action:this.defaultActionJson(1,1)}},defaultActionJson:function(e,t,n){return{step:e,priority:t,action_type:"not_set",score:null,reaction_flg:!1,auto_add_campaign_flg:!0,reserve_send_at:null,send_interval_days:null,send_interval_hours:null,send_interval_minutes:null,mail_queue_id:null,seminar_id:null,web_form_id:null,child_actions:[],saved:!1,locked:!1,actionKey:this.getRandomId(),parentActionKey:n,mailTargetExtractCondition:"",mailTargetExtractParameter:{},mailTargetLeadsNum:0,mail_confirmed_flg:!1}},setStoryInfoToJson:function(){this.storyData.name=$("input[name=story_name]").val(),this.storyData.enable_flg=$("input[name=enable_flg]:checked").val(),this.storyData.description=$("textarea[name=story_description]").val(),this.storyData.started_at=$("#story_started_at").val(),this.storyData.finished_at=$("#story_finished_at").val()},resetSelectedIds:function(e){e.seminar_id=null,e.web_form_id=null},addNewScenario:function(){storyFunctions.canAddScenario()&&(storyFunctions.storyData.scenarios.push(storyFunctions.initialScenarioJson()),storyFunctions.draw())},actionSelector:function(n,e){var t=storyFunctions.lockCondition(n),i=$("<select>",{name:"actionSelect","class":"form-control input-sm",disabled:t&&1==e,on:{change:function(e){n.action_type=e.target.value,"not_set"!=e.target.value&&"score"!=e.target.value||(n.child_actions=[],n.reaction_flg=!1),"seminar"!=e.target.value&&"web_form"!=e.target.value||(n.auto_add_campaign_flg=!0),storyFunctions.resetSelectedIds(n),storyFunctions.draw()}}});return $.each(this.selectableActions(n,e),function(e,t){i.append($("<option>",{val:t[0],text:t[1],selected:t[0]==n.action_type}))}),i},selectableActions:function(e,t){var n,i=!!e.locked,a=e.old_action_type||e.action_type,s="true"==$("#js_storty_user_mail_flg").val(),o="true"==$("#js_storty_user_ab_test_mail_flg").val(),r="true"==$("#js_storty_web_form_flg").val();return full_option_list=[["not_set",I18n.t("js.stories.please_select")],["trigger_mail",I18n.t("js.stories.action.trigger_mail_action")],["seminar",I18n.t("js.stories.action.seminar_action")],["web_form",I18n.t("js.stories.action.webform_action")],["mail",I18n.t("js.stories.action.mail_action")],["score_mail",I18n.t("js.stories.action.score_mail_action")],["score",I18n.t("js.stories.action.score_action")]],1==t?((n=[]).push(["not_set",I18n.t("js.stories.please_select")]),(s||o)&&n.push(["trigger_mail",I18n.t("js.stories.action.trigger_mail_action")]),n.push(["seminar",I18n.t("js.stories.action.seminar_action")]),r&&n.push(["web_form",I18n.t("js.stories.action.webform_action")]),selected_option=l(full_option_list,e.action_type),exist_flg=!1,$.each(n,function(e,t){t[0]==selected_option[0]&&(exist_flg=!0)})):i?(t<6?"not_set"==a?n=s?[["not_set",I18n.t("js.stories.please_select")],["mail",I18n.t("js.stories.action.mail_action")],["score_mail",I18n.t("js.stories.action.score_mail_action")],["score",I18n.t("js.stories.action.score_action")]]:[["not_set",I18n.t("js.stories.please_select")],["score",I18n.t("js.stories.action.score_action")]]:"score"==a?n=s?[["mail",I18n.t("js.stories.action.mail_action")],["score_mail",I18n.t("js.stories.action.score_mail_action")],["score",I18n.t("js.stories.action.score_action")]]:[["score",I18n.t("js.stories.action.score_action")]]:"mail"==a?n=s?[["mail",I18n.t("js.stories.action.mail_action")],["score_mail",I18n.t("js.stories.action.score_mail_action")]]:[]:"score_mail"==a&&(n=s?[["mail",I18n.t("js.stories.action.mail_action")],["score_mail",I18n.t("js.stories.action.score_mail_action")]]:[]):6==t&&("not_set"==a?n=[["not_set",I18n.t("js.stories.please_select")],["score",I18n.t("js.stories.action.score_action")]]:"score"==a&&(n=[["score",I18n.t("js.stories.action.score_action")]])),selected_option=l(full_option_list,e.action_type),exist_flg=!1,$.each(n,function(e,t){t[0]==selected_option[0]&&(exist_flg=!0)})):(n=t<6&&s?[["not_set",I18n.t("js.stories.please_select")],["mail",I18n.t("js.stories.action.mail_action")],["score_mail",I18n.t("js.stories.action.score_mail_action")],["score",I18n.t("js.stories.action.score_action")]]:[["not_set",I18n.t("js.stories.please_select")],["score",I18n.t("js.stories.action.score_action")]],selected_option=l(full_option_list,e.action_type),exist_flg=!1,$.each(n,function(e,t){t[0]==selected_option[0]&&(exist_flg=!0)})),exist_flg||n.push(selected_option),n},selectableSeminars:function(t){return this.seminars.filter(function(e){return e[0]==t||!(0<=$.inArray(String(e[0]),storyFunctions.selectedSeminarIds))})},selectableWebForms:function(t){return this.webForms.filter(function(e){return e[0]==t||!(0<=$.inArray(e[0],storyFunctions.selectedWebFormIds))})},canAddScenario:function(){return storyFunctions.storyData.scenarios.length<10},actionClass:function(e){var t="";return"trigger_mail"==e?t="step1-mail":"seminar"==e?t="seminar":"web_form"==e?t="webform":"mail"==e?t="action-mail":"score_mail"==e?t="action-score-mail":"score"==e?t="score":"not_set"==e&&(t="no-action"),t},errorClass:function(e){return e.errors&&0<e.errors.length?"error":""},createScenarioDom:function(t,e){var n=$("<div>",{"class":"scenario-area"});return n.append($("<div>",{"class":"scenario-header"}).append($("<div>",{"class":"scenario-basic-data"}).append($("<div>",{"class":"scenario-input"}).append($("<div>",{"class":"input-header",text:I18n.t("js.stories.scenario.name")})).append($("<div>",{"class":"input-value"}).append($("<input>",{type:"text",value:t.name,"class":"form-control input-sm",on:{change:function(e){t.name=e.target.value}}})))).append($("<div>",{"class":"scenario-input"}).append($("<div>",{"class":"input-header",text:I18n.t("js.stories.scenario.status")})).append($("<div>",{"class":"input-value"}).append($("<input>",{type:"radio",name:"status"+e,checked:t.enabled,on:{click:function(){t.enabled=!0}}})).append(I18n.t("js.stories.scenario.enable")).append($("<input>",{type:"radio",name:"status"+e,checked:!t.enabled,on:{click:function(){t.enabled=!1}}})).append(I18n.t("js.stories.scenario.disable")))).append($("<div>",{"class":"scenario-input"}).append($("<div>",{"class":"input-header",text:I18n.t("js.stories.scenario.period")})).append($("<div>",{"class":"input-value"}).append($("<input>",{type:"text",val:t.started_at,"data-hp-role":"datepicker","class":"form-control input-sm scenario-date",disabled:t.started,on:{change:function(e){t.started_at=e.target.value}}})).append("<span class=term-tilda>\u301c</span>").append($("<input>",{type:"text",val:t.finished_at,"data-hp-role":"datepicker","class":"form-control input-sm scenario-date",on:{change:function(e){t.finished_at=e.target.value}}})))).append($("<div>",{"class":"scenario-input"}).append($("<div>",{"class":"input-header",text:I18n.t("js.stories.scenario.description")})).append($("<div>",{"class":"input-value"}).append($("<textarea>",{val:t.description,"class":"form-control input-sm",on:{change:function(e){t.description=e.target.value}}}))))).append($("<div>",{"class":"scenario-window-button"}).append($("<span>",{"class":"delete-scenario",text:t.deletable_flg?"\xd7":" ",on:{click:function(){t.deletable_flg&&confirm(I18n.t("js.stories.scenario.confirm_delete"))&&(storyFunctions.storyData.scenarios.splice(e,1),storyFunctions.draw())}}})).append($("<span>",{text:t.windowHideStatus?"\u25bc":"\u25b2","class":"close-scenario",on:{click:function(e){t.windowHideStatus?(t.windowHideStatus=!1,$(e.target).closest(".scenario-area").find(".scenario-flow").show(),$(e.target).closest(".scenario-area").find(".close-scenario").text("\u25b2")):(t.windowHideStatus=!0,$(e.target).closest(".scenario-area").find(".scenario-flow").hide(),$(e.target).closest(".scenario-area").find(".close-scenario").text("\u25bc"))}}}))).append($("<div>",{"class":"clearfix"}))),n},createActionDom:function(e,t){var n=$("<div>",{"class":"action shadow "+this.errorClass(e)+" "+this.actionClass(e.action_type)});return n.append($("<div>",{"class":"step-title",text:"STEP"+t})),n.append($("<div>",{"class":"select-action"}).append($("<span>",{text:I18n.t("js.stories.action.action_colon")})).append(this.actionSelector(e,t))),"not_set"!=e.action_type&&n.append($("<hr>")),"trigger_mail"==e.action_type&&n.append(this.createTriggerMailDom(e,t)),"seminar"==e.action_type&&n.append(this.createSeminarDom(e,t)),"web_form"==e.action_type&&n.append(this.createWebFormDom(e,t)),"mail"==e.action_type&&n.append(this.createStepMailDom(e,t)),"score_mail"==e.action_type&&n.append(this.createScoreDom(e,t)).append($("<hr>")).append(this.createStepMailDom(e,t)),"score"==e.action_type&&n.append(this.createScoreDom(e,t)),n.append(storyFunctions.addReactionButton(e,t)),n.append(storyFunctions.removeReactionButton(e)),n},spaceAction:function(){return $("<div>",{"class":"action space"})},lockCondition:function(e){var t=e.old_action_type||e.action_type;return"not_set"!=t&&"score"!=t&&!!e.locked},selectMailDom:function(a,n){var i="true"==$("#js_storty_user_mail_flg").val(),s="true"==$("#js_storty_user_ab_test_mail_flg").val(),e=storyFunctions.lockCondition(a),o=$("<select>",{name:"actionSelect","class":"form-control input-sm",disabled:e,on:{change:function(n){var i;a.mail_queue_id=n.target.value,a.mail_confirmed_flg=!1,storyFunctions.draw(),$.each(storyFunctions.selectableMail,function(e,t){t[0]==n.target.value&&(i=t)}),"ab"==i[2]&&alert(I18n.t("js.stories.set_ab_test_mail_notice_message")),alert(I18n.t("js.stories.mail_target_not_use"))}}});o.append($("<option>",{val:"",text:I18n.t("js.stories.please_select")})),$.each(this.selectableMail,function(e,t){if(a.mail_queue_id!=t[0]){if(!i&&"mass"==t[2])return!0;if(!s&&"ab"==t[2])return!0}if(1!=n&&"ab"==t[2])return!0;o.append($("<option>",{val:t[0],text:t[1],selected:t[0]==a.mail_queue_id}))});var t=$("<div class='select-option-area'>").append(o);return a.mail_queue_id&&t.append($("<a>",{text:I18n.t("js.stories.action.mail.detail"),href:"/mail_histories/"+a.mail_queue_id,target:"_blank","class":"mail-link",rel:"noopener noreferrer"})),t.append($("<div class='mail-confirm-area'>").append($("<input>",{type:"checkbox",checked:a.mail_confirmed_flg,disabled:e||!a.mail_queue_id,on:{change:function(e){a.mail_confirmed_flg=e.target.checked}}})).append(I18n.t("js.stories.action.mail.confirmed")).append($("<i>",{"class":"fa fa-question-circle fa-lg hp-tooltip","aria-hidden":"true","data-html":"true","data-placement":"right",title:I18n.t("js.stories.draft_mail_info")}))),t},openMailModal:function(e){$.post("/xhr/mail_queues/get_modal_to_send_mail/",{scenairo_action_id:e})},createTriggerMailDom:function(t,e){var n=storyFunctions.lockCondition(t),i=$("<div>",{"class":"action-setting"});$add_mail_link=$("#add_story_mail_action").clone(),$add_mail_link.click(function(){$(".js_scenairo_action_id").val(t.actionKey)}),n?$add_mail_link.css("display","none"):$add_mail_link.css("display",""),i.append($("<div>",{"class":"select-message"}).append($("<span>",{text:I18n.t("js.stories.action.mail.please_select_mail")})).append(n?$add_mail_link.css("display","none"):$add_mail_link.css("display",""))),i.append(this.selectMailDom(t,e)),i.append($("<div>",{"class":"send-schedule inner"}).append($("<input>",{type:"text","class":"date form-control input-sm",disabled:n,value:t.reserve_send_at}).datetimepicker({widgetPositioning:{vertical:"bottom"},format:"YYYY/MM/DD HH:mm",dayViewHeaderFormat:I18n.t("js.common.date",{year:"YYYY",month:"MMMM"}),stepping:1,showClose:!0}).on("dp.change",function(e){t.reserve_send_at=e.target.value})).append(I18n.t("js.stories.action.trigger_mail.reserve_send_at")));this.getRandomId();return i.append($("<div>",{"class":"mail-target"}).append($("<p>",{text:I18n.t("js.stories.action.mail.please_select_target")}).append($("<i>",{"class":"fa fa-question-circle fa-lg hp-tooltip","aria-hidden":"true","data-html":"true","data-placement":"right",title:I18n.t("js.stories.mail_target_info")}))).append($("<div>",{"class":"inner hp-page"}).append($("<span>",{id:"scenario_action_count_no_data","class":t.mailTargetExtractCondition?"hide":"",text:I18n.t("js.stories.action.trigger_mail.not_set"),"data-hp-role":"lead-filter-control-nodata"})).append($("<span>",{id:"scenario_action_count","class":t.mailTargetExtractCondition?"":"hide","data-hp-role":"lead-filter-control-show"}).append($("<a>",{"class":"modal-caller",href:"javascript:void(0)",on:{click:function(){a(t.mailTargetExtractCondition)}}}).append($("<a>",{text:Number(t.mailTargetLeadsNum).toLocaleString()+I18n.t("js.stories.action.trigger_mail.count"),id:"scenario_action_lead_filter_num","data-hp-role":"lead-filter-num"})))).append($("<button>",{"class":"get-story-mail-target-extraction"+(n?"":" modal-caller"),text:I18n.t("js.stories.action.trigger_mail.target_setting"),disabled:n,on:{click:function(e){e.preventDefault(),storyFunctions.story_mail_lead_filter_modal(t)}}})))),i},createSeminarDom:function(n){var e=storyFunctions.lockCondition(n),t=$("<div>",{"class":"action-setting"});t.append($("<div>",{"class":"select-message",text:I18n.t("js.stories.action.seminar.please_select_seminar")}));var i=$("<select>",{name:"actionSelect","class":"form-control input-sm seminar-select",disabled:e,on:{change:function(e){n.seminar_id=e.target.value,storyFunctions.draw()}}});return i.append($("<option>",{val:"",text:I18n.t("js.stories.please_select")})),$.each(this.selectableSeminars(n.seminar_id),function(e,t){i.append($("<option>",{val:t[0],text:t[1],selected:t[0]==n.seminar_id}))}),t.append($("<div class='select-option-area'>").append(i)),n.seminar_id&&t.append($("<div>",{"class":"inner",text:this.seminarDate(n.seminar_id)+I18n.t("js.stories.action.seminar.open_date")})),t.append($("<div>",{"class":"add-target inner"}).append($("<input>",{type:"checkbox",checked:n.auto_add_campaign_flg,on:{change:function(e){n.auto_add_campaign_flg=e.target.checked}}})).append($("<span>",{text:I18n.t("js.stories.action.seminar.auto_add_campaign")})).append($("<span>",{text:I18n.t("js.stories.action.seminar.end_seminar")}))),t},createWebFormDom:function(n){var e=storyFunctions.lockCondition(n),t=$("<div>",{"class":"action-setting"});t.append($("<div>",{"class":"select-message",text:I18n.t("js.stories.action.webform.please_select_webform")}));var i=$("<select>",{name:"actionSelect","class":"form-control input-sm webform-select",disabled:e,on:{change:function(e){n.web_form_id=e.target.value,storyFunctions.draw()}}});return i.append($("<option>",{val:"",text:I18n.t("js.stories.please_select")})),$.each(this.selectableWebForms(n.web_form_id),function(e,t){i.append($("<option>",{val:t[0],text:t[1],selected:t[0]==n.web_form_id}))}),t.append($("<div class='select-option-area'>").append(i)),t.append($("<div>",{"class":"add-target inner"}).append($("<input>",{type:"checkbox",checked:n.auto_add_campaign_flg,on:{change:function(e){n.auto_add_campaign_flg=e.target.checked}}})).append($("<span>",{text:I18n.t("js.stories.action.webform.auto_add_campaign")}))),t},createScoreDom:function(t){var e=$("<div>",{"class":"action-setting"});return e.append($("<div>",{"class":"select-message",text:I18n.t("js.stories.action.score.please_input_score")})),e.append($("<div>",{"class":"score-input inner"}).append(I18n.t("js.stories.action.score.score")).append($("<input>",{type:"number","class":"form-control input-sm",value:t.score,on:{change:function(e){t.score=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(I18n.t("js.stories.action.score.point"))),e},createStepMailDom:function(t){var e=storyFunctions.lockCondition(t),n=$("<div>",{"class":"action-setting"});return $add_mail_link_step2=$("#add_story_mail_action_step2").clone(),e?$add_mail_link_step2.css("display","none"):$add_mail_link_step2.css("display",""),n.append($("<div>",{"class":"select-message"}).append($("<span>",{text:I18n.t("js.stories.action.mail.please_select_mail")})).append($add_mail_link_step2.click(function(){0==$("#link_click").val()&&storyFunctions.openMailModal(t.actionKey),$("#link_click").val("1")}))),n.append(this.selectMailDom(t)),n.append($("<div>",{"class":"send-delay inner"}).append($("<p>",{text:I18n.t("js.stories.action.mail.after_before_process")})).append($("<input>",{type:"number",min:1,max:365,"class":"days form-control input-sm",value:t.send_interval_days,disabled:e,on:{change:function(e){t.send_interval_days=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(I18n.t("js.stories.action.mail.after_day_in")).append($("<input>",{type:"number",min:0,max:23,"class":"hour form-control input-sm",value:t.send_interval_hours,disabled:e,on:{change:function(e){t.send_interval_hours=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(":").append($("<input>",{type:"number",min:0,max:59,"class":"min form-control input-sm",value:t.send_interval_minutes,disabled:e,on:{change:function(e){t.send_interval_minutes=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(I18n.t("js.stories.action.mail.send_delay_at"))),n},setMailToAction:function(n,i){$.each(storyFunctions.actions,function(e,t){t.actionKey==n&&(t.mail_queue_id=i)}),$.ajax({url:"/campaigns/"+storyFunctions.campaignId+"/stories/load_mail",data:{story_id:$("#js_story_id").val()},contentType:"application/json"}).then(function(e){$("#modalSendMail").modal("hide"),$("#modalAbMail").modal("hide"),storyFunctions.selectableMail=e,storyFunctions.draw()})},hideModalSendMail:function(){$("#modalSendMail").modal("hide"),$("#modalAbMail").modal("hide"),storyFunctions.draw()},seminarDate:function(n){var i;return n&&$.each(this.selectableSeminars(n),function(e,t){t[0]==n&&(i=t[2])}),i},addReactionButton:function(n,i){if(!(6==i||"score"==n.action_type||"not_set"==n.action_type||n.reaction_flg||0<n.child_actions.length))return $("<div>",{"class":"reaction-area",on:{click:function(){var e=i+1,t=n.actionKey;n.child_actions.push(storyFunctions.defaultActionJson(e,1,t)),n.child_actions.push(storyFunctions.defaultActionJson(e,2,t)),n.child_actions.push(storyFunctions.defaultActionJson(e,3,t)),n.reaction_flg=!0,storyFunctions.draw()}}}).append($("<img>",{src:"/assets/hotprofile/stories/plusmark-c0edc4536563a3f6530456ecebcb7d02cf5bc24867253af325e3e4a256797ce3.png"})).append($("<span>",{text:I18n.t("js.stories.reaction.add_reaction")}))},removeReactionButton:function(e){if(e.reaction_flg&&!e.locked_reaction)return $("<img>",{"class":"remove-reaction",src:"/assets/hotprofile/stories/icon_minus-51e413e007ea8912a5d1f4adf504cc1f772c2bd89cd0d141053fe88f416296e1.png",on:{click:function(){confirm(I18n.t("js.stories.reaction.confirm_delete"))&&(e.child_actions=[],e.reaction_flg=!1,storyFunctions.draw())}}})},blankActionNum:function(e){function n(e){child_actions=e.child_actions,child_actions&&0<child_actions.length&&(t+=1,$.each(child_actions,function(e,t){n(t)}))}var t=0;return n(e),2*t},getActionData:function(e){function i(e,n,t){s[n+1]=t,child_actions=e.child_actions,$.each(child_actions,function(e,t){a[n+1][s[n+1]]=t,storyFunctions.actions.push(t),i(t,n+1,s[n+1]),s[n+1]+=storyFunctions.blankActionNum(t)+1})}var a=[[],[],[],[],[],[]],s=[0,0,0,0,0,0];return storyFunctions.actions.push(e),i(a[0][0]=e,0,0),a},createLineData:function(a){var s=[[],[],[],[],[],[]];return $.each(a,function(t,e){$.each(e,function(e,n){if(n&&a[t+1]){var i=[];$.each(a[t+1],function(e,t){t&&n.actionKey==t.parentActionKey&&i.push(e)}),0<i.length&&s[t].push([e,i,n.action_type])}})}),s},actionColor:function(e){var t="";switch(e){case"trigger_mail":t="#3f60B7";break;case"seminar":t="#e87233";break;case"web_form":t="#2894a8";break;case"mail":t="#3f60B7";break;case"score_mail":t="#4f9a33"}return t},labelNameAndColor:function(e,t){return"seminar"==e?0==t?["#333333",I18n.t("js.stories.reaction_disp.attend")]:1==t?["#777777",I18n.t("js.stories.reaction_disp.absence")]:["#bbbbbb",I18n.t("js.stories.reaction_disp.no_reaction")]:"web_form"==e?0==t?["#333333",I18n.t("js.stories.reaction_disp.with_reply")]:1==t?["#777777",I18n.t("js.stories.reaction_disp.with_access")]:["#bbbbbb",I18n.t("js.stories.reaction_disp.without_access")]:0==t?["#333333",I18n.t("js.stories.reaction_disp.url_click")]:1==t?["#777777",I18n.t("js.stories.reaction_disp.open_mail")]:["#bbbbbb",I18n.t("js.stories.reaction_disp.un_open_mail")]},lineDrawCanvas:function(e,t){var g=310,A=210,v=130,b=150,n=0,y=100*g;$.each(e,function(e,t){$.each(t[1],function(e,t){n<t&&(n=t)})});for(var i=g*(n+1),a=$("<div>",{width:i}),s=0,o=1,w=[];s<=i;){var r=i-s,l=Math.min(r,y),c=$("<canvas>",{id:"editCanvas"+t+"-"+o,attr:{width:l,height:A}});w.push(c.get(0).getContext("2d")),s+=y,o+=1,a.append(c)}return $.each(e,function(e,p){var t=p[0],f=t,m=storyFunctions.actionColor(p[2]);$.each(p[1],function(e,t){f<t&&(f=t);var n=b+g*t,i=0==e?0:v,a=A-15,s=7;verticalLineX=n%y;var o=Math.floor(n/y);0==verticalLineX&&(o-=1);var r=w[o];r.strokeStyle=m,r.fillStyle=m,r.lineWidth=4,r.beginPath(),r.moveTo(verticalLineX,i),r.lineTo(verticalLineX,a),r.stroke(),r.beginPath(),r.moveTo(verticalLineX,A),r.lineTo(verticalLineX-s,a),r.lineTo(verticalLineX+s,a),r.fill();var l=storyFunctions.labelNameAndColor(p[2],e),c=80+verticalLineX-b,d=150,u=140,_=25,h=l[0];r.beginPath(),r.lineWidtlabelH=1,
r.strokeStyle=h,r.fillStyle=h,r.moveTo(c,d+10),r.arc(c+10,d+_-10,10,Math.PI,.5*Math.PI,!0),r.arc(c+u-10,d+_-10,10,.5*Math.PI,0,1),r.arc(c+u-10,d+10,10,0,1.5*Math.PI,1),r.arc(c+10,d+10,10,1.5*Math.PI,Math.PI,1),r.closePath(),r.stroke(),r.fill(),r.font="9pt bold",r.textAlign="center",r.fillStyle="#ffffff",r.fillText(l[1],verticalLineX,d+17,u-10)});var o=b+g*t,r=b+g*f+2,l=v;$.each(w,function(e,t){var n,i,a=y*e,s=y*(e+1);a<o&&o<s?n=o-a:o<a&&a<r&&(n=0),a<r&&r<s?i=r-a:o<s&&s<r&&(i=y),Number.isInteger(n)&&Number.isInteger(i)&&(t.strokeStyle=m,t.fillStyle=m,t.lineWidth=4,t.beginPath(),t.moveTo(n,l),t.lineTo(i,l),t.stroke())})}),a.append(c),a},connectLine:function(e){var t=$("<canvas>",{attr:{width:150,height:30}}),n=t.get(0).getContext("2d");return n.strokeStyle=e,n.fillStyle=e,n.lineWidth=5,n.beginPath(),n.moveTo(75,0),n.lineTo(75,15),n.stroke(),n.beginPath(),n.moveTo(75,30),n.lineTo(66,15),n.lineTo(84,15),n.fill(),t},draw:function(){var e=$(".scenario-flow").scrollLeft(),u="#story-area";storyFunctions.actions=[],storyFunctions.selectedSeminarIds=$(".seminar-select").map(function(e,t){return t.value}).toArray(),storyFunctions.selectedWebFormIds=$(".webform-select").map(function(e,t){return t.value}).toArray(),$(u).html(""),$(u).append($("<div>",{"class":"start-label",text:I18n.t("js.stories.scenario.start")})),$(u).append(storyFunctions.connectLine("#bb1224")),$.each(storyFunctions.storyData.scenarios,function(e,t){0<e&&$(u).append(storyFunctions.connectLine("#666666"));for(var n,i=$("<div>",{"class":"scenario-flow",css:{display:t.windowHideStatus?"none":"block"}}),a=storyFunctions.getActionData(t.first_action,1),s=storyFunctions.createLineData(a),o=0;o<=5;o++){var r="step"+o+1;if(a[o]&&0==a[o].length)break;var l=$("<div>",{"class":"step-action "+r,width:n});if($.each(a[o],function(e,t){t?l.append(storyFunctions.createActionDom(t,o+1)):l.append(storyFunctions.spaceAction())}),l.append($("<div>",{"class":"clearfix"})),i.append(l),0<s[o].length){var c=storyFunctions.lineDrawCanvas(s[o],o);n=c.width(),i.append(c)}}var d=storyFunctions.createScenarioDom(t,e);d.append(i),$(u).append(d)}),storyFunctions.canAddScenario()&&$(u).append($("<button>",{id:"add_scenario",text:I18n.t("js.stories.scenario.add_scenario"),on:{click:storyFunctions.addNewScenario}}));var t=$("#story-edit-modal").find("[data-hp-role='datepicker']");t.attr({format:"YYYY-MM-DD hh:mm"}),t.datepicker().on("show.bs.modal",function(e){e.stopPropagation()}),$(".tooltip").tooltip("hide"),App.concerns.set_tooltip(),$("[name='actionSelect']").select2(),$(".scenario-flow").scrollLeft(e)},initialize_new:function(e){function t(){return $.ajax({url:"/campaigns/"+e+"/stories/load_initial_story_data",contentType:"application/json"})}function n(){return $.ajax({url:"/campaigns/"+e+"/stories/load_mail",contentType:"application/json"})}function i(){return $.ajax({url:"/campaigns/"+e+"/stories/load_seminar",contentType:"application/json"})}function a(){return $.ajax({url:"/campaigns/"+e+"/stories/load_web_form",contentType:"application/json"})}storyFunctions.campaignId=e,storyFunctions.setSessionTimeoutMessage(),$.when(n(),i(),a(),t()).done(function(e,t,n,i){$("body").css("top",0),storyFunctions.selectableMail=e[0],storyFunctions.seminars=t[0],storyFunctions.webForms=n[0],storyFunctions.storyData=i[0],storyFunctions.draw()})},initialize_edit:function(e,t){function n(){return $.ajax({url:"/campaigns/"+e+"/stories/"+t+"/load_story_data",contentType:"application/json"})}function i(){return $.ajax({url:"/campaigns/"+e+"/stories/load_mail",data:{story_id:t},contentType:"application/json"})}function a(){return $.ajax({url:"/campaigns/"+e+"/stories/load_seminar",data:{story_id:t},contentType:"application/json"})}function s(){return $.ajax({url:"/campaigns/"+e+"/stories/load_web_form",data:{story_id:t},contentType:"application/json"})}storyFunctions.campaignId=e,storyFunctions.setSessionTimeoutMessage(),$.when(i(),a(),s(),n()).done(function(e,t,n,i){$("body").css("top",0),storyFunctions.selectableMail=e[0],storyFunctions.seminars=t[0],storyFunctions.webForms=n[0],storyFunctions.storyData=i[0],storyFunctions.setIdToAction(),storyFunctions.draw()})},loadTemplate:function(e){storyFunctions.showLoader(),$.ajax({url:"/story_templates/"+e+"/load_story_template_data",contentType:"application/json"}).done(function(e){storyFunctions.storyData=storyFunctions.convertfirstActionData(e),storyFunctions.setIdToAction(),storyFunctions.draw(),storyFunctions.convertTemplateToStory()}).fail(function(){})},showLoader:function(){$("#story-area").html('<div class="loading"><span><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></span></div>')},updateStory:function(n,e){$("#error-message-box").html(""),storyFunctions.setStoryInfoToJson(),$.ajax({url:e,method:"post",contentType:"application/json",data:JSON.stringify({story:storyFunctions.storyData,save_mode:n}),dataType:"json"}).done(function(e){if("error"==e.status){if(null!==e.story){storyFunctions.storyData=e.story;var t=e.story.all_error_messages;e.mail&&e.mail.error_messages&&(t=t.concat(e.mail.error_messages)),storyFunctions.showError(t),storyFunctions.setIdToAction(),storyFunctions.draw()}else null!==e.err_msg&&storyFunctions.showError(e.err_msg);$("#saveButton").prop("disabled",!1),$("#closeButton").prop("disabled",!1),$("#draftSaveButton").prop("disabled",!1)}else reloadStoryIndex(),"save_status_draft"===storyFunctions.storyData.edit_mode?"save"===n?storyFunctions.showNotice(I18n.t("js.stories.register_successful")):storyFunctions.showNotice(I18n.t("js.stories.draft_register_successful")):storyFunctions.showNotice(I18n.t("js.stories.update_successful")),$("#story-edit-modal").modal("hide")})},createStory:function(n,e){$("#error-message-box").html(""),storyFunctions.setStoryInfoToJson(),$.ajax({url:e,method:"post",contentType:"application/json",data:JSON.stringify({story:storyFunctions.storyData,save_mode:n}),dataType:"json"}).done(function(e){if("error"==e.status){storyFunctions.storyData=e.story;var t=e.story.all_error_messages;e.mail&&e.mail.error_messages&&(t=t.concat(e.mail.error_messages)),storyFunctions.showError(t),storyFunctions.draw(),$("#saveButton").prop("disabled",!1),$("#closeButton").prop("disabled",!1),$("#draftSaveButton").prop("disabled",!1)}else reloadStoryIndex(),"save"==n?storyFunctions.showNotice(I18n.t("js.stories.register_successful")):storyFunctions.showNotice(I18n.t("js.stories.draft_register_successful")),$("#story-edit-modal").modal("hide")})},showError:function(e){if(0!=e.length){var n=$("<ul>");$.each(e,function(e,t){n.append($("<li>",{style:"word-wrap: break-word;",text:t}))}),$("#story-edit-modal #error-message-box").append($('<div class="alert alert-danger alert-error alert-dismissible" role="alert">').append($('<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">\xd7</span></button>')).append(n))}},showNotice:function(e){$("#js_error_message").html($('<div class="row">').append($('<div class="col-xs-12">').append($('<div class="alert alert-success alert-error alert-dismissible" role="alert">').append('<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">\xd7</span></button>').append($('<ul class="list-unstyled">').append($("<li>",{style:"word-wrap: break-word;",text:e}))))))},setIdToAction:function(){function i(n){n.actionKey=storyFunctions.getRandomId(),$.each(n.child_actions,function(e,t){t.parentActionKey=n.actionKey,i(t)})}$.each(this.storyData.scenarios,function(e,t){var n=t.first_action;n&&i(n)})},story_mail_lead_filter_modal:function(e){var n=$("#story-mail-target-extraction-modal"),t=$("#story_campaign_id").val(),i=e.mailTargetExtractParameter,a=Object.assign({},{dataType:"html",campaign_id:t,action_key:e.actionKey,lead_filter_id:e.lead_filter_id},i);$.ajax({url:"/xhr/stories/target_extraction",dataType:"html",data:a}).done(function(e){$("#story-mail-target-modal").html(e);var t=$(".hp-story-mail-target-modal");App.lead_filters.target_extraction_condition_modal(t),App.concerns.attach_select_search_handlers(t),App.concerns.attach_date_time_picker_handlers(t),App.concerns.attach_date_picker_handlers(t),App.lead_filters.scenario_mail_lead_filter_modal(t),t.find('[data-hp-role="select2"]').select2({minimumResultsForSearch:20}),$("#new_lead_filter").length?(App.concerns.get_modal_to_lead_search_save("#new_lead_filter"),App.concerns.get_modal_to_lead_search_call("#new_lead_filter")):$("#edit_lead_filter").length&&(App.concerns.get_modal_to_lead_search_save("#edit_lead_filter"),App.concerns.get_modal_to_lead_search_call("#edit_lead_filter")),(n=$("#story-mail-target-extraction-modal")).on("show.bs.modal",function(){$("body").addClass("hp-story-mail-body")}),n.on("hidden.bs.modal",function(){$("body").removeClass("hp-story-mail-body")}),n.modal("show")})},get_trigger_mail_actions:function(){return storyFunctions.storyData.scenarios.map(function(e){return e.first_action}).filter(function(e){return"trigger_mail"===e.action_type})},get_trigger_mail_action:function(n){return this.get_trigger_mail_actions().reduce(function(e,t){return t.actionKey===n?t:e},{})},update_trigger_mail_target_extract_condition:function(e,t,n,i){if(!(e&&t&&n&&0<=i))return!1;var a=this.get_trigger_mail_action(e);a&&(a.mailTargetExtractParameter=t,a.mailTargetExtractCondition=n,a.mailTargetLeadsNum=i)},setSessionTimeoutMessage:function(){storyFunctions.timeoutID&&storyFunctions.stopSessionTimeoutMessage(),$("#story-edit-modal").on("hide.bs.modal",function(){storyFunctions.stopSessionTimeoutMessage()}),storyFunctions.timeoutID=window.setTimeout(function(){alert(I18n.t("js.stories.remind.timeout"))},60*storyFunctions.timoutMinutes*1e3)},stopSessionTimeoutMessage:function(){window.clearTimeout(storyFunctions.timeoutID),storyFunctions.timeoutID=undefined},convertTemplateToStory:function(){storyFunctions.storyData.id=null,storyFunctions.storyData.scenarios.forEach(function(e){e.id=null}),storyFunctions.actions.forEach(function(e){e.id=null})},convertfirstActionData:function(e){var t="true"==$("#js_storty_user_mail_flg").val(),n="true"==$("#js_storty_user_ab_test_mail_flg").val();return e.scenarios=$.map(e.scenarios,function(e){return t||n||"trigger_mail"==e.first_action.action_type&&(e.first_action.action_type="not_set",e.first_action.child_actions=[],e.first_action.reaction_flg=!1),t||(e.first_action.child_actions=storyFunctions.convertChildActionData(e.first_action.child_actions)),e}),e},convertChildActionData:function(e){return 0<e.length&&(e=$.map(e,function(e){return"mail"==e.action_type&&(e.action_type="not_set",e.child_actions=[],e.reaction_flg=!1),"score_mail"==e.action_type&&(e.action_type="not_set",e.child_actions=[],e.reaction_flg=!1),e.child_actions=storyFunctions.convertChildActionData(e.child_actions),e})),e}},storyShowFunctions={storyData:{},scrollTargetScenarioId:null,getRandomId:function(){for(var e=20,t="abcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n},actionClass:function(e){var t="";return"trigger_mail"==e?t="step1-mail":"seminar"==e?t="seminar":"web_form"==e?t="webform":"mail"==e?t="action-mail":"score_mail"==e?t="action-score-mail":"score"==e?t="score":"not_set"==e&&(t="no-action"),t},createScenarioDom:function(e){var t=$("<div>",{id:"scenario-"+e.id,"class":"scenario-area"+(e.enabled?"":" dimgray")});return t.append($("<div>",{"class":"scenario-header clearfix"+(e.enabled?"":" dimgray")}).append($("<span>",{"class":"scenario-folder",text:"\u25b2",on:{click:function(e){"\u25b2"==e.target.innerText?e.target.innerText="\u25bc":e.target.innerText="\u25b2",$(e.target).closest(".scenario-area").find(".scenario-flow").toggle()}}})).append($("<h4>",{text:e.name||"","class":"word-break-all"})).append($("<hr>")).append($("<table class=scenario-table>").append($("<tr>").append($("<td>",{text:e.description||"",colspan:4,"class":"word-break-all"}))).append($("<tr>").append($("<td>",{"class":"col",text:I18n.t("js.stories.scenario.period")})).append($("<td>",{"class":"value",text:e.disp_term||"    "})).append($("<td>",{"class":"col",text:I18n.t("js.stories.scenario.status")})).append($("<td>",{"class":"last",text:e.disp_status||"    "}))))),t},createActionDom:function(e,t){var n=$("<div>",{"class":"show-action"});return n.append(this.reactionLink(e)),"trigger_mail"==e.action_type&&n.append(this.createTriggerMailDom(e,t)),"seminar"==e.action_type&&n.append(this.createSeminarDom(e,t)),"web_form"==e.action_type&&n.append(this.createWebFormDom(e,t)),"mail"==e.action_type&&n.append(this.createStepMailDom(e,t)),"score_mail"==e.action_type&&n.append(this.createScoreMailDom(e,t)),"score"==e.action_type&&n.append(this.createScoreDom(e,t)),"not_set"==e.action_type&&n.append(this.createUnSetActionDom(e,t)),n},spaceAction:function(){return $("<div>",{"class":"action space"})},displayEvantNameDom:function(e){return e.target_action_selected?$("<a>",{text:e.target_action_name,href:e.action_link_path,target:"_blank","class":e.seminar_suspend_flg?"invalid-event":"",rel:"noopener noreferrer"}):$("<span>",{"class":"invalid-event",text:e.target_action_name})},createTriggerMailDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label step1-mail-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_mail-678a09b2876fc6a4a131257ae439690e441a3494e0439ae579ebfaaa82376626.png"})).append("<span>MAIL</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.mail.send_mail")+"]"})).append($("<div>",{"class":"main-field"}).append(this.displayEvantNameDom(t))).append($("<hr>")).append(t.event_date?$("<div>",{"class":"sub-field",text:t.event_date+I18n.t("js.stories.action.trigger_mail.reserve_send_at")}):null).append($("<div>",{"class":"sub-field"}).append(this.displayMailConfirmedFlg(t.mail_confirmed_flg))).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.mail.target_colon")}).append(e.mailTargetExtractCondition?$("<a>",{text:Number(e.mailTargetLeadsNum).toLocaleString()+I18n.t("js.stories.action.trigger_mail.count"),href:"javascript:void(0)",on:{click:function(){a(e.mailTargetExtractCondition)}}}):$("<span>",{text:I18n.t("js.stories.action.trigger_mail.not_set")})))),n},createSeminarDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label seminar-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_seminar-45d26c16e4c82ab00a9955fc853f995d5c46c80986783893c7fb9e96e9340ca9.png"})).append("<span>SEMINAR</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.seminar.seminar_open")+"]"})).append($("<div>",{"class":"main-field"}).append(this.displayEvantNameDom(t))).append($("<hr>")).append(t.event_date?$("<div>",{"class":"sub-field",text:t.event_date+I18n.t("js.stories.action.seminar.open_date")}):null).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.seminar.auto_add_campaign_flg_colon")+(e.auto_add_campaign_flg?"ON":"OFF")}))),n},createWebFormDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label webform-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_webform-70a6eec1380e29e9e62396190b06bd31ac3d1639766d7778b41c6e7baf4360de.png"})).append("<span>WEB<br>FORM</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.webform_action")+"]"})).append($("<div>",{"class":"main-field-webform"}).append(this.displayEvantNameDom(t))).append($("<hr>")).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.webform.auto_add_campaign_flg_colon")+(e.auto_add_campaign_flg?"ON":"OFF")}))),n},createScoreDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label score-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_score-d48a60bf997db4b9b46bc2466ecb68c61f554b02d4c6e761d9888e0ef1f8dfcd.png"})).append("<span>SCORE</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"score-font",text:I18n.t("js.stories.action.score_action")+t.score+I18n.t("js.stories.action.score.point")}))),n},createStepMailDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label action-mail-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_mail-678a09b2876fc6a4a131257ae439690e441a3494e0439ae579ebfaaa82376626.png"})).append("<span>MAIL</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.mail.send_mail")+"]"})).append($("<div>",{"class":"main-field"}).append(this.displayEvantNameDom(t))).append($("<hr>")).append($("<div>",{"class":"sub-field"}).append(this.displayMailConfirmedFlg(t.mail_confirmed_flg))).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.mail.after_before_process")})).append($("<div>",{"class":"sub-field",text:t.interval_text}))),n},createScoreMailDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label action-score-mail-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_mail-678a09b2876fc6a4a131257ae439690e441a3494e0439ae579ebfaaa82376626.png"})).append("<span>SCORE<br>&<br>MAIL</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"score-font",text:I18n.t("js.stories.action.score_action")+t.score+I18n.t("js.stories.action.score.point")})).append($("<div>",{"class":"score-joint-font",text:"+"})).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.mail.send_mail")+"]"})).append($("<div>",{"class":"main-field"}).append(this.displayEvantNameDom(t))).append($("<hr>")).append($("<div>",{"class":"sub-field"}).append(this.displayMailConfirmedFlg(t.mail_confirmed_flg))).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.mail.after_before_process")})).append($("<div>",{"class":"sub-field",text:t.interval_text}))),n},createUnSetActionDom:function(){var e=$("<div>");return e.append($("<div>",{"class":"icon-label"}).append($('<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7">')).append("<span></span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"main-field",text:I18n.t("js.stories.action.not_set")}))),e},blankActionNum:function(e){function n(e){child_actions=e.child_actions,child_actions&&0<child_actions.length&&(t+=1,$.each(child_actions,function(e,t){n(t)}))}var t=0;return n(e),2*t},reactionLink:function(e){var t=e.display_data;if("save_status_saved"==this.storyData.edit_mode){var n=1==e.step?"target-link":"reaction-link";(i=$("<a>",{"class":n,href:t.target_link_path,target:"_blank",rel:"noopener noreferrer"})).append($("<p>",{text:this.reactionName(e)})),i.append($("<p>",{text:t.label}))}else{if(1==e.step)return;var i;(i=$("<a>",{"class":"reaction-link"})).append($("<p>",{text:this.reactionName(e)}))}return i},getActionData:function(e){function i(e,n,t){s[n+1]=t,child_actions=e.child_actions,$.each(child_actions,function(e,t){i(a[n+1][s[n+1]]=t,n+1,s[n+1]),s[n+1]+=storyShowFunctions.blankActionNum(t)+1})}var a=[[],[],[],[],[],[]],s=[0,0,0,0,0,0];return i(a[0][0]=e,0,0),a},createLineData:function(a){var s=[[],[],[],[],[],[]];return $.each(a,function(t,e){$.each(e,function(e,n){if(n&&a[t+1]){var i=[];$.each(a[t+1],function(e,t){t&&n.actionKey==t.parentActionKey&&i.push(e)}),0<i.length&&s[t].push([e,i,n.action_type])}})}),s},actionColor:function(e){var t="";switch(e){case"trigger_mail":t="#3f60B7";break;case"seminar":t="#e87233";break;case"web_form":t="#2894a8";break;case"mail":t="#3f60B7";break;case"score_mail":t="#4f9a33"}return t},reactionName:function(e){return 1==e.step?"trigger_mail"==e.action_type?I18n.t("js.stories.action.mail.send_mail"):I18n.t("js.stories.action.target"):"seminar"==e.parent_action_type?1==e.priority?I18n.t("js.stories.reaction_disp.attend"):2==e.priority?I18n.t("js.stories.reaction_disp.absence"):I18n.t("js.stories.reaction_disp.no_reaction"):"web_form"==e.parent_action_type?1==e.priority?I18n.t("js.stories.reaction_disp.with_reply"):2==e.priority?I18n.t("js.stories.reaction_disp.with_access"):I18n.t("js.stories.reaction_disp.without_access"):1==e.priority?I18n.t("js.stories.reaction_disp.url_click"):2==e.priority?I18n.t("js.stories.reaction_disp.open_mail"):I18n.t("js.stories.reaction_disp.un_open_mail")},lineDrawCanvas:function(e,t){var u=310,_=170,h=90,p=120,n=0,f=100*u;$.each(e,function(e,t){$.each(t[1],function(e,t){n<t&&(n=t)})});for(var i=u*(n+1),a=$("<div>",{width:i}),s=0,o=1,m=[];s<=i;){var r=i-s,l=Math.min(r,f),c=$("<canvas>",{id:"editCanvas"+t+"-"+o,"class":"show-canvas",attr:{width:l,height:_}});m.push(c.get(0).getContext("2d")),s+=f,o+=1,a.append(c)}return $.each(e,function(e,t){var n=t[0],l=n,c=storyFunctions.actionColor(t[2]);$.each(t[1],function(e,t){l<t&&(l=t);var n=p+u*t,i=0==e?0:h,a=_-15,s=7;verticalLineX=n%f;var o=Math.floor(n/f);0==verticalLineX&&(o-=1);var r=m[o];r.strokeStyle=c,r.fillStyle=c,r.lineWidth=4,r.beginPath(),r.moveTo(verticalLineX,i),r.lineTo(verticalLineX,a),r.stroke(),r.beginPath(),r.moveTo(verticalLineX,_),r.lineTo(verticalLineX-s,a),r.lineTo(verticalLineX+s,a),r.fill()});var o=p+u*n,r=p+u*l+2,d=h;$.each(m,function(e,t){var n,i,a=f*e,s=f*(e+1);a<o&&o<s?n=o-a:o<a&&a<r&&(n=0),a<r&&r<s?i=r-a:o<s&&s<r&&(i=f),Number.isInteger(n)&&Number.isInteger(i)&&(t.strokeStyle=c,t.fillStyle=c,t.lineWidth=4,t.beginPath(),t.moveTo(n,d),t.lineTo(i,d),t.stroke())})}),a.append(c),a},connectLine:function(e){var t=$("<canvas>",{attr:{width:150,height:30}}),n=t.get(0).getContext("2d");return n.strokeStyle=e,n.fillStyle=e,n.lineWidth=5,n.beginPath(),n.moveTo(75,0),n.lineTo(75,15),n.stroke(),n.beginPath(),n.moveTo(75,30),n.lineTo(66,15),n.lineTo(84,15),n.fill(),t},draw:function(){var u="#show-story-area";storyShowFunctions.selectedSeminarIds=$(".seminar-select").map(function(e,t){return t.value}).toArray(),storyShowFunctions.selectedWebFormIds=$(".webform-select").map(function(e,t){return t.value}).toArray(),$(u).html(""),0<storyShowFunctions.storyData.scenarios.length?($(u).append($("<div>",{"class":"start-label",text:I18n.t("js.stories.scenario.start")})),$(u).append(storyShowFunctions.connectLine("#bb1224"))):$(u).append($("<div>",{text:I18n.t("js.stories.scenario.none")})),$.each(storyShowFunctions.storyData.scenarios,function(e,t){0<e&&$(u).append(storyShowFunctions.connectLine("#666666"));for(var n,i=$("<div>",{"class":"scenario-flow",css:{display:t.windowHideStatus?"none":"block"}}),a=storyShowFunctions.getActionData(t.first_action,1),s=storyShowFunctions.createLineData(a),o=0;o<=5;o++){var r="step"+o+1;if(a[o]&&0==a[o].length)break;var l=$("<div>",{"class":"step-action "+r,width:n});if($.each(a[o],function(e,t){t?l.append(storyShowFunctions.createActionDom(t,o+1)):l.append(storyShowFunctions.spaceAction())}),l.append($("<div>",{"class":"clearfix"})),i.append(l),0<s[o].length){var c=storyShowFunctions.lineDrawCanvas(s[o],o);n=c.width(),i.append(c)}}var d=storyShowFunctions.createScenarioDom(t,e);d.append(i),$(u).append(d)})},initialize_show:function(e,t){function n(){return $.ajax({url:"/campaigns/"+e+"/stories/"+t+"/load_story_data",contentType:"application/json"})}$.when(n()).done(function(e){storyShowFunctions.storyData=e,storyShowFunctions.setIdToAction(),storyShowFunctions.draw(),storyShowFunctions.scrollToScenario(),$("#saveAsImage").prop("disabled",!1)})},setIdToAction:function(){function i(n){n.actionKey=storyShowFunctions.getRandomId(),$.each(n.child_actions,function(e,t){t.parentActionKey=n.actionKey,i(t)})}$.each(this.storyData.scenarios,function(e,t){var n=t.first_action;n&&i(n)})},scrollToScenario:function(){if(this.scrollTargetScenarioId){var e="#scenario-"+this.scrollTargetScenarioId;$("#story-show-modal").animate({scrollTop:$(e).offset().top-50},"slow")}this.scrollTargetScenarioId=null},displayMailConfirmedFlg:function(e){return e?I18n.t("js.stories.action.mail.confirmed"):I18n.t("js.stories.action.mail.unconfirmed")}},$(function(){$(document).on("click","#story-edit-modal .add-mail",function(){alert()}),$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")}),$(document).on("click","#saveAsImage",function(){$("#storyToImageOverlay").show();var i=$("#story-show-modal > .modal-dialog").outerWidth();$("#story-show-modal > .modal-dialog").css("width","min-content");var e=$(window).width()<$("#story-show-modal > .modal-dialog").outerWidth()?$("#story-show-modal > .modal-dialog").outerWidth():$(window).width(),t=$(window).height()<$("#story-show-modal > .modal-dialog").outerHeight()?$("#story-show-modal > .modal-dialog").outerHeight():$(window).height(),n=1,a=15e3;a<e&&(n=Math.round(a/e*100)/100);var s={width:$("#story-show-modal > .modal-dialog").outerWidth(),height:$("#story-show-modal > .modal-dialog").outerHeight(),windowWidth:e,windowHeight:t,ignoreElements:function(e){return"BUTTON"==e.tagName},scrollX:0,scrollY:-1*($("#story-show-modal").scrollTop()-10),scale:n,removeContainer:!0,foreignObjectRendering:!1,allowTaint:!0,imageTimeout:0};$(".info-area").removeClass("shadow");var o=document.querySelector("#story-show-modal > .modal-dialog > .modal-content > .modal-body");html2canvas(o,s).then(function(e){$("#story-show-modal > .modal-dialog").css("width",i+"px"),$(".info-area").addClass("shadow");var t=$("body"),n=$("<body>",{id:"tmpBody"});n.append(e),t.after(n),e.style.width=null,e.style.height=null,$("#storyToImageOverlay").hide(),t.hide(),window.print()})}),window.onafterprint=function(){$("body").show(),$("#tmpBody").remove()}}),App.concerns.adjustment_modal_z_index("#story-mail-target-extraction-modal"),App.concerns.adjustment_modal_z_index("#abSettingModal"),App.concerns.adjustment_modal_z_index("#modalNewAbMail"),App.concerns.adjustment_modal_z_index("#modalAbMail"),App.concerns.adjustment_modal_z_index("#story-edit-modal"),App.concerns.adjustment_modal_z_index("#mail-types-checked-leads-modal"),App.concerns.adjustment_modal_z_index("#mail-types-all-leads-modal")}},App.front_story_template_modal={load:function(){storyTemplateFunctions={storyTemplateData:{},actions:[],timeoutID:null,timoutMinutes:29,getRandomId:function(){for(var e=20,t="abcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n},initialScenarioJson:function(){return{name:null,description:null,enabled:!0,started_at:$("#story_started_at").val(),finished_at:$("#story_finished_at").val(),saved:!1,deletable_flg:!0,first_action:this.defaultActionJson(1,1)}},defaultActionJson:function(e,t,n){return{step:e,priority:t,action_type:"not_set",score:null,reaction_flg:!1,auto_add_campaign_flg:!0,reserve_send_at:null,send_interval_days:null,send_interval_hours:null,send_interval_minutes:null,mail_queue_id:null,seminar_id:null,web_form_id:null,child_actions:[],saved:!1,locked:!1,actionKey:this.getRandomId(),parentActionKey:n,mailTargetExtractCondition:"",mailTargetExtractParameter:{},mailTargetLeadsNum:0}},setStoryTemplateInfoToJson:function(){this.storyTemplateData.name=$("input[name=story_template_name]").val(),this.storyTemplateData.enable_flg=$("input[name=enable_flg]:checked").val(),this.storyTemplateData.description=$("textarea[name=story_template_description]").val()},addNewScenario:function(){storyTemplateFunctions.canAddScenario()&&(storyTemplateFunctions.storyTemplateData.scenarios.push(storyTemplateFunctions.initialScenarioJson()),storyTemplateFunctions.draw())},actionSelector:function(n,e){var i=$("<select>",{name:"actionSelect","class":"form-control input-sm",on:{change:function(e){n.action_type=e.target.value,"not_set"!=e.target.value&&"score"!=e.target.value||(n.child_actions=[],n.reaction_flg=!1),"seminar"!=e.target.value&&"web_form"!=e.target.value||(n.auto_add_campaign_flg=!0),storyTemplateFunctions.draw()}}});return $.each(this.selectableActions(n,e),function(e,t){i.append($("<option>",{val:t[0],text:t[1],selected:t[0]==n.action_type}))}),i},selectableActions:function(e,t){return 1==t?[["not_set",I18n.t("js.stories.please_select")],["trigger_mail",I18n.t("js.stories.action.trigger_mail_action")],["seminar",I18n.t("js.stories.action.seminar_action")],["web_form",I18n.t("js.stories.action.webform_action")]]:t<6?[["not_set",I18n.t("js.stories.please_select")],["mail",I18n.t("js.stories.action.mail_action")],["score_mail",I18n.t("js.stories.action.score_mail_action")],["score",I18n.t("js.stories.action.score_action")]]:[["not_set",I18n.t("js.stories.please_select")],["score",I18n.t("js.stories.action.score_action")]]},canAddScenario:function(){return storyTemplateFunctions.storyTemplateData.scenarios.length<10},actionClass:function(e){var t="";return"trigger_mail"==e?t="step1-mail":"seminar"==e?t="seminar":"web_form"==e?t="webform":"mail"==e?t="action-mail":"score_mail"==e?t="action-score-mail":"score"==e?t="score":"not_set"==e&&(t="no-action"),t},errorClass:function(e){return e.errors&&0<e.errors.length?"error":""},createScenarioDom:function(t,e){var n=$("<div>",{"class":"scenario-area"});return n.append($("<div>",{"class":"scenario-header"}).append($("<div>",{"class":"scenario-basic-data"}).append($("<div>",{"class":"scenario-input"}).append($("<div>",{"class":"input-header",text:I18n.t("js.stories.scenario.name")})).append($("<div>",{"class":"input-value"}).append($("<input>",{type:"text",value:t.name,"class":"form-control input-sm",on:{change:function(e){t.name=e.target.value}}})))).append($("<div>",{"class":"scenario-input"}).append($("<div>",{"class":"input-header",text:I18n.t("js.stories.scenario.description")})).append($("<div>",{"class":"input-value"}).append($("<textarea>",{val:t.description,"class":"form-control input-sm",on:{change:function(e){t.description=e.target.value}}}))))).append($("<div>",{"class":"scenario-window-button"}).append($("<span>",{"class":"delete-scenario",text:"\xd7",on:{click:function(){confirm(I18n.t("js.stories.scenario.confirm_delete"))&&(storyTemplateFunctions.storyTemplateData.scenarios.splice(e,1),storyTemplateFunctions.draw())}}})).append($("<span>",{text:t.windowHideStatus?"\u25bc":"\u25b2","class":"close-scenario",on:{click:function(e){t.windowHideStatus?(t.windowHideStatus=!1,$(e.target).closest(".scenario-area").find(".scenario-flow").show(),$(e.target).closest(".scenario-area").find(".close-scenario").text("\u25b2")):(t.windowHideStatus=!0,$(e.target).closest(".scenario-area").find(".scenario-flow").hide(),$(e.target).closest(".scenario-area").find(".close-scenario").text("\u25bc"))}}}))).append($("<div>",{"class":"clearfix"}))),n},createActionDom:function(e,t){var n=$("<div>",{"class":"action shadow "+this.errorClass(e)+" "+this.actionClass(e.action_type)});return n.append($("<div>",{"class":"step-title",text:"STEP"+t})),n.append($("<div>",{"class":"select-action"}).append($("<span>",{text:I18n.t("js.stories.action.action_colon")})).append(this.actionSelector(e,t))),"not_set"!=e.action_type&&"trigger_mail"!=e.action_type&&n.append($("<hr>")),"trigger_mail"==e.action_type&&n.append(this.createTriggerMailDom(e,t)),"seminar"==e.action_type&&n.append(this.createSeminarDom(e,t)),"web_form"==e.action_type&&n.append(this.createWebFormDom(e,t)),"mail"==e.action_type&&n.append(this.createStepMailDom(e,t)),"score_mail"==e.action_type&&n.append(this.createScoreDom(e,t)).append($("<hr>")).append(this.createStepMailDom(e,t)),"score"==e.action_type&&n.append(this.createScoreDom(e,t)),n.append(storyTemplateFunctions.addReactionButton(e,t)),n.append(storyTemplateFunctions.removeReactionButton(e)),n},spaceAction:function(){return $("<div>",{"class":"action space"})},createTriggerMailDom:function(){return $("<div>",{"class":"action-setting"})},createSeminarDom:function(t){var e=$("<div>",{"class":"action-setting"});return e.append($("<div>",{"class":"add-target inner"}).append($("<input>",{type:"checkbox",checked:t.auto_add_campaign_flg,on:{change:function(e){t.auto_add_campaign_flg=e.target.checked}}})).append($("<span>",{text:I18n.t("js.stories.action.seminar.auto_add_campaign")}))),e},createWebFormDom:function(t){var e=$("<div>",{"class":"action-setting"});return e.append($("<div>",{"class":"add-target inner"}).append($("<input>",{type:"checkbox",checked:t.auto_add_campaign_flg,on:{change:function(e){t.auto_add_campaign_flg=e.target.checked}}})).append($("<span>",{text:I18n.t("js.stories.action.webform.auto_add_campaign")}))),e},createScoreDom:function(t){var e=$("<div>",{"class":"action-setting"});return e.append($("<div>",{"class":"select-message",text:I18n.t("js.stories.action.score.please_input_score")})),e.append($("<div>",{"class":"score-input inner"}).append(I18n.t(
"js.stories.action.score.score")).append($("<input>",{type:"number","class":"form-control input-sm",value:t.score,on:{change:function(e){t.score=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(I18n.t("js.stories.action.score.point"))),e},createStepMailDom:function(t){var e=$("<div>",{"class":"action-setting"});return e.append($("<div>",{"class":"send-delay inner"}).append($("<p>",{text:I18n.t("js.stories.action.mail.after_before_process")})).append($("<input>",{type:"number",min:1,max:365,"class":"days form-control input-sm",value:t.send_interval_days,on:{change:function(e){t.send_interval_days=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(I18n.t("js.stories.action.mail.after_day_in")).append($("<input>",{type:"number",min:0,max:23,"class":"hour form-control input-sm",value:t.send_interval_hours,on:{change:function(e){t.send_interval_hours=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(":").append($("<input>",{type:"number",min:0,max:59,"class":"min form-control input-sm",value:t.send_interval_minutes,on:{change:function(e){t.send_interval_minutes=e.target.value},keydown:function(){return-1==$.inArray(event.keyCode,[69,187,189,190])}}})).append(I18n.t("js.stories.action.mail.send_delay_at"))),e},addReactionButton:function(n,i){if(!(6==i||"score"==n.action_type||"not_set"==n.action_type||n.reaction_flg||0<n.child_actions.length))return $("<div>",{"class":"reaction-area",on:{click:function(){var e=i+1,t=n.actionKey;n.child_actions.push(storyTemplateFunctions.defaultActionJson(e,1,t)),n.child_actions.push(storyTemplateFunctions.defaultActionJson(e,2,t)),n.child_actions.push(storyTemplateFunctions.defaultActionJson(e,3,t)),n.reaction_flg=!0,storyTemplateFunctions.draw()}}}).append($("<img>",{src:"/assets/hotprofile/stories/plusmark-c0edc4536563a3f6530456ecebcb7d02cf5bc24867253af325e3e4a256797ce3.png"})).append($("<span>",{text:I18n.t("js.stories.reaction.add_reaction")}))},removeReactionButton:function(e){if(e.reaction_flg&&!e.locked_reaction)return $("<img>",{"class":"remove-reaction",src:"/assets/hotprofile/stories/icon_minus-51e413e007ea8912a5d1f4adf504cc1f772c2bd89cd0d141053fe88f416296e1.png",on:{click:function(){confirm(I18n.t("js.stories.reaction.confirm_delete"))&&(e.child_actions=[],e.reaction_flg=!1,storyTemplateFunctions.draw())}}})},blankActionNum:function(e){function n(e){child_actions=e.child_actions,child_actions&&0<child_actions.length&&(t+=1,$.each(child_actions,function(e,t){n(t)}))}var t=0;return n(e),2*t},getActionData:function(e){function i(e,n,t){s[n+1]=t,child_actions=e.child_actions,$.each(child_actions,function(e,t){a[n+1][s[n+1]]=t,storyTemplateFunctions.actions.push(t),i(t,n+1,s[n+1]),s[n+1]+=storyTemplateFunctions.blankActionNum(t)+1})}var a=[[],[],[],[],[],[]];storyTemplateFunctions.actions=[];var s=[0,0,0,0,0,0];return storyTemplateFunctions.actions.push(e),i(a[0][0]=e,0,0),a},createLineData:function(a){var s=[[],[],[],[],[],[]];return $.each(a,function(t,e){$.each(e,function(e,n){if(n&&a[t+1]){var i=[];$.each(a[t+1],function(e,t){t&&n.actionKey==t.parentActionKey&&i.push(e)}),0<i.length&&s[t].push([e,i,n.action_type])}})}),s},actionColor:function(e){var t="";switch(e){case"trigger_mail":t="#ef454a";break;case"seminar":t="#00b050";break;case"web_form":t="#c55a11";break;case"mail":t="#ef454a";break;case"score_mail":t="#ff9900"}return t},labelNameAndColor:function(e,t){return"seminar"==e?0==t?["#333333",I18n.t("js.stories.reaction_disp.attend")]:1==t?["#777777",I18n.t("js.stories.reaction_disp.absence")]:["#bbbbbb",I18n.t("js.stories.reaction_disp.no_reaction")]:"web_form"==e?0==t?["#333333",I18n.t("js.stories.reaction_disp.with_reply")]:1==t?["#777777",I18n.t("js.stories.reaction_disp.with_access")]:["#bbbbbb",I18n.t("js.stories.reaction_disp.without_access")]:0==t?["#333333",I18n.t("js.stories.reaction_disp.url_click")]:1==t?["#777777",I18n.t("js.stories.reaction_disp.open_mail")]:["#bbbbbb",I18n.t("js.stories.reaction_disp.un_open_mail")]},lineDrawCanvas:function(e,t){var g=310,A=220,v=140,b=150,n=0,y=100*g;$.each(e,function(e,t){$.each(t[1],function(e,t){n<t&&(n=t)})});for(var i=g*(n+1),a=$("<div>",{width:i}),s=0,o=1,w=[];s<=i;){var r=i-s,l=Math.min(r,y),c=$("<canvas>",{id:"editCanvas"+t+"-"+o,"class":"template-canvas",attr:{width:l,height:A}});w.push(c.get(0).getContext("2d")),s+=y,o+=1,a.append(c)}return $.each(e,function(e,p){var t=p[0],f=t,m=storyTemplateFunctions.actionColor(p[2]);$.each(p[1],function(e,t){f<t&&(f=t);var n=b+g*t,i=0==e?0:v,a=A-15,s=7;verticalLineX=n%y;var o=Math.floor(n/y);0==verticalLineX&&(o-=1);var r=w[o];r.strokeStyle=m,r.fillStyle=m,r.lineWidth=4,r.beginPath(),r.moveTo(verticalLineX,i),r.lineTo(verticalLineX,a),r.stroke(),r.beginPath(),r.moveTo(verticalLineX,A),r.lineTo(verticalLineX-s,a),r.lineTo(verticalLineX+s,a),r.fill();var l=storyTemplateFunctions.labelNameAndColor(p[2],e),c=110+verticalLineX-b,d=160,u=80,_=25,h=l[0];r.beginPath(),r.lineWidtlabelH=1,r.strokeStyle=h,r.fillStyle=h,r.moveTo(c,d+10),r.arc(c+10,d+_-10,10,Math.PI,.5*Math.PI,!0),r.arc(c+u-10,d+_-10,10,.5*Math.PI,0,1),r.arc(c+u-10,d+10,10,0,1.5*Math.PI,1),r.arc(c+10,d+10,10,1.5*Math.PI,Math.PI,1),r.closePath(),r.stroke(),r.fill(),r.font="9pt bold",r.textAlign="center",r.fillStyle="#ffffff",r.fillText(l[1],verticalLineX,d+17,u-10)});var o=b+g*t,r=b+g*f+2,l=v;$.each(w,function(e,t){var n,i,a=y*e,s=y*(e+1);a<o&&o<s?n=o-a:o<a&&a<r&&(n=0),a<r&&r<s?i=r-a:o<s&&s<r&&(i=y),Number.isInteger(n)&&Number.isInteger(i)&&(t.strokeStyle=m,t.fillStyle=m,t.lineWidth=4,t.beginPath(),t.moveTo(n,l),t.lineTo(i,l),t.stroke())})}),a.append(c),a},connectLine:function(e){var t=$("<canvas>",{attr:{width:150,height:30}}),n=t.get(0).getContext("2d");return n.strokeStyle=e,n.fillStyle=e,n.lineWidth=5,n.beginPath(),n.moveTo(75,0),n.lineTo(75,15),n.stroke(),n.beginPath(),n.moveTo(75,30),n.lineTo(66,15),n.lineTo(84,15),n.fill(),t},draw:function(){var u="#story-area";$(u).html(""),$(u).append($("<div>",{"class":"start-label",text:I18n.t("js.stories.scenario.start")})),$(u).append(storyTemplateFunctions.connectLine("#bb1224")),$.each(storyTemplateFunctions.storyTemplateData.scenarios,function(e,t){0<e&&$(u).append(storyTemplateFunctions.connectLine("#666666"));for(var n,i=$("<div>",{"class":"scenario-flow",css:{display:t.windowHideStatus?"none":"block"}}),a=storyTemplateFunctions.getActionData(t.first_action,1),s=storyTemplateFunctions.createLineData(a),o=0;o<=5;o++){var r="step"+o+1;if(a[o]&&0==a[o].length)break;var l=$("<div>",{"class":"step-action "+r,width:n});if($.each(a[o],function(e,t){t?l.append(storyTemplateFunctions.createActionDom(t,o+1)):l.append(storyTemplateFunctions.spaceAction())}),l.append($("<div>",{"class":"clearfix"})),i.append(l),0<s[o].length){var c=storyTemplateFunctions.lineDrawCanvas(s[o],o);n=c.width(),i.append(c)}}var d=storyTemplateFunctions.createScenarioDom(t,e);d.append(i),$(u).append(d)}),storyTemplateFunctions.canAddScenario()&&$(u).append($("<button>",{id:"add_scenario",text:I18n.t("js.stories.scenario.add_scenario"),on:{click:storyTemplateFunctions.addNewScenario}}));var e=$("#story-template-edit-modal").find("[data-hp-role='datepicker']");e.attr({format:"YYYY-MM-DD hh:mm"}),e.datepicker().on("show.bs.modal",function(e){e.stopPropagation()})},initialize_new:function(){function e(){return $.ajax({url:"/story_templates/load_initial_story_template_data",contentType:"application/json"})}storyTemplateFunctions.setSessionTimeoutMessage(),$.when(e()).done(function(e){$("body").css("top",0),storyTemplateFunctions.storyTemplateData=e,storyTemplateFunctions.draw()})},initialize_edit:function(e){function t(){return $.ajax({url:"/story_templates/"+e+"/load_story_template_data",contentType:"application/json"})}storyTemplateFunctions.setSessionTimeoutMessage(),$.when(t()).done(function(e){$("body").css("top",0),storyTemplateFunctions.storyTemplateData=e,storyTemplateFunctions.setIdToAction(),storyTemplateFunctions.draw()})},updateStoryTemplate:function(e,t){$("#error-message-box").html(""),storyTemplateFunctions.setStoryTemplateInfoToJson(),$.ajax({url:t,method:"post",contentType:"application/json",data:JSON.stringify({story_template:storyTemplateFunctions.storyTemplateData,save_mode:e}),dataType:"json"}).done(function(e){"error"==e.status?null!==e.story_template?(storyTemplateFunctions.storyTemplateData=e.story_template,storyTemplateFunctions.showError(e.story_template.all_error_messages),storyTemplateFunctions.draw(),$("#saveButton").prop("disabled",!1),$("#closeButton").prop("disabled",!1)):null!==e.err_msg&&storyTemplateFunctions.showError(e.err_msg):reloadStoryTemplateIndex()})},createStoryTemplate:function(e,t){$("#error-message-box").html(""),storyTemplateFunctions.setStoryTemplateInfoToJson(),$.ajax({url:t,method:"post",contentType:"application/json",data:JSON.stringify({story_template:storyTemplateFunctions.storyTemplateData,save_mode:e}),dataType:"json"}).done(function(e){"error"==e.status?(storyTemplateFunctions.storyTemplateData=e.story_template,storyTemplateFunctions.showError(e.story_template.all_error_messages),storyTemplateFunctions.draw(),$("#saveButton").prop("disabled",!1),$("#closeButton").prop("disabled",!1)):reloadStoryTemplateIndex()})},showError:function(e){if(0!=e.length){var n=$("<ul>");$.each(e,function(e,t){n.append($("<li>",{style:"word-wrap: break-word;",text:t}))}),$("#story-template-edit-modal #error-message-box").append($('<div class="alert alert-danger alert-error alert-dismissible" role="alert">').append($('<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">\xd7</span></button>')).append(n))}},setIdToAction:function(){function i(n){n.actionKey=storyTemplateFunctions.getRandomId(),$.each(n.child_actions,function(e,t){t.parentActionKey=n.actionKey,i(t)})}$.each(this.storyTemplateData.scenarios,function(e,t){var n=t.first_action;n&&i(n)})},setSessionTimeoutMessage:function(){storyTemplateFunctions.timeoutID&&storyTemplateFunctions.stopSessionTimeoutMessage(),$("#story-edit-modal").on("hide.bs.modal",function(){storyTemplateFunctions.stopSessionTimeoutMessage()}),storyTemplateFunctions.timeoutID=window.setTimeout(function(){alert(I18n.t("js.stories.remind.timeout"))},60*storyTemplateFunctions.timoutMinutes*1e3)},stopSessionTimeoutMessage:function(){window.clearTimeout(storyTemplateFunctions.timeoutID),storyTemplateFunctions.timeoutID=undefined}},storyTemplateShowFunctions={storyTemplateData:{},getRandomId:function(){for(var e=20,t="abcdefghijklmnopqrstuvwxyz0123456789",n="",i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n},actionClass:function(e){var t="";return"trigger_mail"==e?t="step1-mail":"seminar"==e?t="seminar":"web_form"==e?t="webform":"mail"==e?t="action-mail":"score_mail"==e?t="action-score-mail":"score"==e?t="score":"not_set"==e&&(t="no-action"),t},createScenarioDom:function(e){var t=$("<div>",{id:"scenario-"+e.id,"class":"scenario-area"+(e.enabled?"":" dimgray")});return t.append($("<div>",{"class":"scenario-header clearfix"+(e.enabled?"":" dimgray")}).append($("<span>",{"class":"scenario-folder",text:"\u25b2",on:{click:function(e){"\u25b2"==e.target.innerText?e.target.innerText="\u25bc":e.target.innerText="\u25b2",$(e.target).closest(".scenario-area").find(".scenario-flow").toggle()}}})).append($("<h4>",{text:e.name||"","class":"word-break-all"})).append($("<hr>")).append($("<table class=scenario-table>").append($("<tr>").append($("<td>",{text:e.description||"",colspan:4,"class":"word-break-all"}))))),t},createActionDom:function(e,t){var n=$("<div>",{"class":"show-action"});return n.append(this.reactionLink(e)),"trigger_mail"==e.action_type&&n.append(this.createTriggerMailDom(e,t)),"seminar"==e.action_type&&n.append(this.createSeminarDom(e,t)),"web_form"==e.action_type&&n.append(this.createWebFormDom(e,t)),"mail"==e.action_type&&n.append(this.createStepMailDom(e,t)),"score_mail"==e.action_type&&n.append(this.createScoreMailDom(e,t)),"score"==e.action_type&&n.append(this.createScoreDom(e,t)),"not_set"==e.action_type&&n.append(this.createUnSetActionDom(e,t)),n},spaceAction:function(){return $("<div>",{"class":"action space"})},createTriggerMailDom:function(e){e.display_data;var t=$("<div>");return t.append($("<div>",{"class":"icon-label step1-mail-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_mail-678a09b2876fc6a4a131257ae439690e441a3494e0439ae579ebfaaa82376626.png"})).append("<span>MAIL</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.mail.send_mail")+"]"}))),t},createSeminarDom:function(e){e.display_data;var t=$("<div>");return t.append($("<div>",{"class":"icon-label seminar-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_seminar-45d26c16e4c82ab00a9955fc853f995d5c46c80986783893c7fb9e96e9340ca9.png"})).append("<span>SEMINAR</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.seminar.seminar_open")+"]"})).append($("<div>",{"class":"main-field"})).append($("<hr>")).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.seminar.auto_add_campaign_flg_colon")+(e.auto_add_campaign_flg?"ON":"OFF")}))),t},createWebFormDom:function(e){e.display_data;var t=$("<div>");return t.append($("<div>",{"class":"icon-label webform-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_webform-70a6eec1380e29e9e62396190b06bd31ac3d1639766d7778b41c6e7baf4360de.png"})).append("<span>WEB<br>FORM</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.webform_action")+"]"})).append($("<div>",{"class":"main-field-webform"})).append($("<hr>")).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.webform.auto_add_campaign_flg_colon")+(e.auto_add_campaign_flg?"ON":"OFF")}))),t},createScoreDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label score-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_score-d48a60bf997db4b9b46bc2466ecb68c61f554b02d4c6e761d9888e0ef1f8dfcd.png"})).append("<span>SCORE</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"score-font",text:I18n.t("js.stories.action.score_action")+t.score+I18n.t("js.stories.action.score.point")}))),n},createStepMailDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label action-mail-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_mail-678a09b2876fc6a4a131257ae439690e441a3494e0439ae579ebfaaa82376626.png"})).append("<span>MAIL</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.mail.send_mail")+"]"})).append($("<div>",{"class":"main-field"})).append($("<hr>")).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.mail.after_before_process")})).append($("<div>",{"class":"sub-field",text:t.interval_text}))),n},createScoreMailDom:function(e){var t=e.display_data,n=$("<div>");return n.append($("<div>",{"class":"icon-label action-score-mail-color"}).append($("<img>",{src:"/assets/hotprofile/stories/icon_mail-678a09b2876fc6a4a131257ae439690e441a3494e0439ae579ebfaaa82376626.png"})).append("<span>SCORE<br>&<br>MAIL</span>")).append($("<div>",{"class":"info-area shadow"}).append($("<div>",{"class":"score-font",text:I18n.t("js.stories.action.score_action")+t.score+I18n.t("js.stories.action.score.point")})).append($("<div>",{"class":"score-joint-font",text:"+"})).append($("<div>",{"class":"title",text:"["+I18n.t("js.stories.action.mail.send_mail")+"]"})).append($("<div>",{"class":"main-field"})).append($("<hr>")).append($("<div>",{"class":"sub-field",text:I18n.t("js.stories.action.mail.after_before_process")})).append($("<div>",{"class":"sub-field",text:t.interval_text}))),n},createUnSetActionDom:function(){var e=$("<div>");return e.append($("<div>",{"class":"icon-label"}).append($("<img>")).append("<span></span>")).append($("<div>",{"class":"info-area"}).append($("<div>",{"class":"main-field",text:I18n.t("js.stories.action.not_set")}))),e},blankActionNum:function(e){function n(e){child_actions=e.child_actions,child_actions&&0<child_actions.length&&(t+=1,$.each(child_actions,function(e,t){n(t)}))}var t=0;return n(e),2*t},reactionLink:function(e){if(1!=e.step){var t=$("<span>",{"class":"reaction-link"});return t.append($("<p>",{text:this.reactionName(e)})),t}},getActionData:function(e){function i(e,n,t){s[n+1]=t,child_actions=e.child_actions,$.each(child_actions,function(e,t){i(a[n+1][s[n+1]]=t,n+1,s[n+1]),s[n+1]+=storyTemplateShowFunctions.blankActionNum(t)+1})}var a=[[],[],[],[],[],[]],s=[0,0,0,0,0,0];return i(a[0][0]=e,0,0),a},createLineData:function(a){var s=[[],[],[],[],[],[]];return $.each(a,function(t,e){$.each(e,function(e,n){if(n&&a[t+1]){var i=[];$.each(a[t+1],function(e,t){t&&n.actionKey==t.parentActionKey&&i.push(e)}),0<i.length&&s[t].push([e,i,n.action_type])}})}),s},actionColor:function(e){var t="";switch(e){case"trigger_mail":t="#ef454a";break;case"seminar":t="#00b050";break;case"web_form":t="#c55a11";break;case"mail":t="#ef454a";break;case"score_mail":t="#ff9900"}return t},reactionName:function(e){return 1==e.step?"trigger_mail"==e.action_type?I18n.t("js.stories.action.mail.send_mail"):I18n.t("js.stories.action.target"):"seminar"==e.parent_action_type?1==e.priority?I18n.t("js.stories.reaction_disp.attend"):2==e.priority?I18n.t("js.stories.reaction_disp.absence"):I18n.t("js.stories.reaction_disp.no_reaction"):"web_form"==e.parent_action_type?1==e.priority?I18n.t("js.stories.reaction_disp.with_reply"):2==e.priority?I18n.t("js.stories.reaction_disp.with_access"):I18n.t("js.stories.reaction_disp.without_access"):1==e.priority?I18n.t("js.stories.reaction_disp.url_click"):2==e.priority?I18n.t("js.stories.reaction_disp.open_mail"):I18n.t("js.stories.reaction_disp.un_open_mail")},lineDrawCanvas:function(e,t){var u=310,_=170,h=90,p=120,n=0,f=100*u;$.each(e,function(e,t){$.each(t[1],function(e,t){n<t&&(n=t)})});for(var i=u*(n+1),a=$("<div>",{width:i}),s=0,o=1,m=[];s<=i;){var r=i-s,l=Math.min(r,f),c=$("<canvas>",{id:"editCanvas"+t+"-"+o,"class":"template-show-canvas",attr:{width:l,height:_}});m.push(c.get(0).getContext("2d")),s+=f,o+=1,a.append(c)}return $.each(e,function(e,t){var n=t[0],l=n,c="#6e6e6e";$.each(t[1],function(e,t){l<t&&(l=t);var n=p+u*t,i=0==e?0:h,a=_-15,s=7;verticalLineX=n%f;var o=Math.floor(n/f);0==verticalLineX&&(o-=1);var r=m[o];r.strokeStyle=c,r.fillStyle=c,r.lineWidth=4,r.beginPath(),r.moveTo(verticalLineX,i),r.lineTo(verticalLineX,a),r.stroke(),r.beginPath(),r.moveTo(verticalLineX,_),r.lineTo(verticalLineX-s,a),r.lineTo(verticalLineX+s,a),r.fill()});var o=p+u*n,r=p+u*l+2,d=h;$.each(m,function(e,t){var n,i,a=f*e,s=f*(e+1);a<o&&o<s?n=o-a:o<a&&a<r&&(n=0),a<r&&r<s?i=r-a:o<s&&s<r&&(i=f),Number.isInteger(n)&&Number.isInteger(i)&&(t.strokeStyle=c,t.fillStyle=c,t.lineWidth=4,t.beginPath(),t.moveTo(n,d),t.lineTo(i,d),t.stroke())})}),a.append(c),a},connectLine:function(e){var t=$("<canvas>",{attr:{width:150,height:30}}),n=t.get(0).getContext("2d");return n.strokeStyle=e,n.fillStyle=e,n.lineWidth=5,n.beginPath(),n.moveTo(75,0),n.lineTo(75,15),n.stroke(),n.beginPath(),n.moveTo(75,30),n.lineTo(66,15),n.lineTo(84,15),n.fill(),t},draw:function(){var u="#show-story-area";$(u).html(""),0<storyTemplateShowFunctions.storyTemplateData.scenarios.length?($(u).append($("<div>",{"class":"start-label",text:I18n.t("js.stories.scenario.start")})),$(u).append(storyTemplateShowFunctions.connectLine("#bb1224"))):$(u).append($("<div>",{text:I18n.t("js.stories.scenario.none")})),$.each(storyTemplateShowFunctions.storyTemplateData.scenarios,function(e,t){0<e&&$(u).append(storyTemplateShowFunctions.connectLine("#666666"));for(var n,i=$("<div>",{"class":"scenario-flow",css:{display:t.windowHideStatus?"none":"block"}}),a=storyTemplateShowFunctions.getActionData(t.first_action,1),s=storyTemplateShowFunctions.createLineData(a),o=0;o<=5;o++){var r="step"+o+1;if(a[o]&&0==a[o].length)break;var l=$("<div>",{"class":"step-action "+r,width:n});if($.each(a[o],function(e,t){t?l.append(storyTemplateShowFunctions.createActionDom(t,o+1)):l.append(storyTemplateShowFunctions.spaceAction())}),l.append($("<div>",{"class":"clearfix"})),i.append(l),0<s[o].length){var c=storyTemplateShowFunctions.lineDrawCanvas(s[o],o);n=c.width(),i.append(c)}}var d=storyTemplateShowFunctions.createScenarioDom(t,e);d.append(i),$(u).append(d)})},initialize_show:function(e){function t(){return $.ajax({url:"/story_templates/"+e+"/load_story_template_data",contentType:"application/json"})}$.when(t()).done(function(e){storyTemplateShowFunctions.storyTemplateData=e,storyTemplateShowFunctions.setIdToAction(),storyTemplateShowFunctions.draw()})},setIdToAction:function(){function i(n){n.actionKey=storyTemplateShowFunctions.getRandomId(),$.each(n.child_actions,function(e,t){t.parentActionKey=n.actionKey,i(t)})}$.each(this.storyTemplateData.scenarios,function(e,t){var n=t.first_action;n&&i(n)})}},$(function(){$(document).on("hidden.bs.modal",".modal",function(){$(".modal:visible").length&&$(document.body).addClass("modal-open")})})}},App.front_story_templates={index:function(){App.concerns.change_order("form_story_templates_index"),App.concerns.change_display_number("form_story_templates_index"),App.front_story_template_modal.load()}},App.summary_visible_fields={setup_list_visible_setting:function(e,t){var n=App.concerns.set_float_table_header(t);return $("#summary_visible_fields_setting_dialog").find(".js_list_field").change(function(){n.floatTheadOff(),App.summary_visible_fields.change_visibility($(this)),n.floatTheadOn()}),$("#summary_visible_fields_setting_dialog").find("#enable_horizontal_scroll_flg").change(function(){App.summary_visible_fields.change_horizontal_scroll($(this),e)}),n},show_list_fields_setting:function(e,t,n){$("html,body").scrollLeft(0);$("#summary_visible_fields_setting_dialog").removeClass("hide").dialog({modal:!0,title:e,width:400,title_html:!0,draggable:!0,buttons:[{text:t,"class":"btn btn-primary btn-xs",click:function(){$(this).dialog("close")}}],open:function(){$("body,html").css({overflowX:"hidden","word-wrap":"break-word"}),$(document).trigger("floatTableUpdate")},beforeClose:function(){if(0==$(this).find("input[name=summary_visible_fields\\[\\]]:checked").length)return alert(n),!1},close:function(){var e=[];$(this).find("input[type=checkbox]:checked").each(function(){e.push($(this).val())}),App.summary_visible_fields.save_summary_visible_fields(e.join(",")),$("body,html").css("overflowX",""),$(document).trigger("floatTableUpdate")}})},change_visibility:function(e){var t=$(".js_visibility_summary_"+e.val());t.is(":visible")?t.hide():t.show()},change_horizontal_scroll:function(e,t){for(var n=0;n<t.length;n++){var i=$(".js_visibility_summary_"+t[n]);e.prop("checked")?i.css("min-width","150px"):i.css("min-width","")}},save_summary_visible_fields:function(){$("#frm_summary_visible_fields").submit()}},App.front_tags={index:function(){App.concerns.change_display_number("form_search_tags"),App.concerns.change_order("form_search_tags"),App.concerns.all_checked_items(),App.concerns.focus_to_first_element()}},App.tags_bulk_deletion_visible_fields={init_tags:function(e){function s(){$("#my-tag-dropdown_modal ul.my-tag-results li").removeClass("select2-highlighted"),n(),$("#my-tag-dropdown_modal").css("display","none"),$("#s2id_tags_modal #s2id_autogen3").val(""),$("#s2id_tags_modal #s2id_autogen3").css("width","20px"),t(),$("#s2id_tags_modal").removeClass("select2-dropdown-open")}function t(){$("#my-tag-dropdown_modal li.category_tags").remove(),$("#my-tag-dropdown_modal li.select_tags").remove(),$("#my-tag-dropdown_modal li.selected_tags").remove()}function n(){c=0,$("#my-tag-dropdown_modal ul.my-tag-results").scrollTop(0)}function o(){$("#my-tag-dropdown_modal ul.my-tag-results").get(0).offsetTop+c>$("#my-tag-dropdown_modal ul.my-tag-results li.select2-highlighted").get(0).offsetTop?(c=$("#my-tag-dropdown_modal ul.my-tag-results li.select2-highlighted").get(0).offsetTop-$("#my-tag-dropdown_modal ul.my-tag-results").get(0).offsetTop,$("#my-tag-dropdown_modal ul.my-tag-results").scrollTop(c)):$("#my-tag-dropdown_modal ul.my-tag-results").height()+$("#my-tag-dropdown_modal ul.my-tag-results").get(0).offsetTop+c<$("#my-tag-dropdown_modal ul.my-tag-results li.select2-highlighted").height()+$("#my-tag-dropdown_modal ul.my-tag-results li.select2-highlighted").get(0).offsetTop&&(c=$("#my-tag-dropdown_modal ul.my-tag-results li.select2-highlighted").height()+$("#my-tag-dropdown_modal ul.my-tag-results li.select2-highlighted").get(0).offsetTop-($("#my-tag-dropdown_modal ul.my-tag-results").height()+$("#my-tag-dropdown_modal ul.my-tag-results").get(0).offsetTop),$("#my-tag-dropdown_modal ul.my-tag-results").scrollTop(c))}function i(){0<$("#s2id_tags_modal ul.select2-choices").find("li.select2-search-choice").length?$(".modal-delete-tags").removeClass("disabled"):$(".modal-delete-tags").addClass("disabled")}function a(){$("#my-tag-dropdown_modal").css("top",$("#s2id_tags_modal").get(0).offsetTop+$("#s2id_tags_modal").height()),$("#my-tag-dropdown_modal").css("left",$("#s2id_tags_modal").position().left),$("#my-tag-dropdown_modal").css("width",$("#s2id_tags_modal").get(0).getBoundingClientRect().width),$("#my-tag-dropdown_modal").css("min-height",$("#s2id_tags_modal").css("min-height"))}function r(){$("#verification_search_word_modal").html($("#s2id_tags_modal #s2id_autogen3").val()),$("#s2id_tags_modal #s2id_autogen3").width()<=$("#verification_search_word_modal").width()&&$("#s2id_tags_modal #s2id_autogen3").css("width",$("#s2id_tags_modal ul.select2-choices").width()-5+"px"),a(),l()}function l(){var e=parseInt($("#tags_bulk_deletion_visible_fields_setting_dialog").css("min-height").replace("px","")),t=parseInt($("#tags_bulk_deletion_visible_fields_setting_dialog table").css("height").replace("px",""));e<t?$("#tags_bulk_deletion_visible_fields_setting_dialog").css("height",t+10):$("#tags_bulk_deletion_visible_fields_setting_dialog").css("height",e)}var c=0;$(".modal-delete-tags").attr("data-target-form",e),$(".modal-delete-tags").addClass("disabled"),$(document).on("click",".modal-delete-tags",function(){var e=[];if(0==$("#s2id_tags_modal ul.select2-choices").find("li.select2-search-choice").length)return alert($(this).attr("data-alert")),!1;$("#s2id_tags_modal ul.select2-choices").find("li.select2-search-choice").each(function(){e.push($(this).attr("data-tag-id"))}),$("#tag_ids").val(e.join(",")),$("#"+$(this).attr("data-target-form")).attr("action",$(".checked_delete_submit").attr("data-action")),$("#"+$(this).attr("data-target-form")).attr("data-remote",!0),$("#"+$(this).attr("data-target-form")).submit(),$(".modal-delete-tags").addClass("disabled")}),$(document).on("click",".btn-close, #btn-close-modal-tags-bulk-deletion",function(){$("#s2id_tags_modal ul.select2-choices").find("li.select2-search-choice").remove()}),$(document).on("click","#s2id_tags_modal",function(){$("#s2id_tags_modal #s2id_autogen3").trigger("focus")}),$(document).on("focus","#s2id_tags_modal #s2id_autogen3",function(){var e=0,t=$("#s2id_tags_modal ul.select2-choices").width();$("#s2id_tags_modal ul.select2-choices").find("li.select2-search-choice").each(function(){e+=$(this).outerWidth(!0)}),t-e-5<=20&&(e=0),$(this).css("width",t-e-5+"px"),a(),l(),$("#my-tag-dropdown_modal li").length<=1&&($("#my-tag-dropdown_modal li.message-area").show(),$("#my-tag-dropdown_modal li.message-area").removeClass("select2-ajax-error"),$("#my-tag-dropdown_modal li.message-area").find("div").html($("#my-tag-dropdown_modal li.message-area").attr("data-prompt")),$("#my-tag-dropdown_modal li.message-area").addClass("select2-no-results"),$("#my-tag-dropdown_modal").css("display","block")),$("#s2id_tags_modal").addClass("select2-dropdown-open")}),$(document).on("input","#s2id_tags_modal #s2id_autogen3",function(n){""===$(n.target).val()&&($("#my-tag-dropdown_modal li.message-area").find("div").html($("#my-tag-dropdown_modal li.message-area").attr("data-prompt")),$("#my-tag-dropdown_modal li.message-area").removeClass("select2-ajax-error"),$("#my-tag-dropdown_modal li.message-area").addClass("select2-no-results"),$("#my-tag-dropdown_modal li.message-area").show(),t()),"20px"===$("#s2id_tags_modal #s2id_autogen3").css("width")&&$("#s2id_tags_modal #s2id_autogen3").trigger("focus"),r(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){if(""===$(n.target).val())return!1;var e=[];$("#s2id_tags_modal li[data-tag-id]").each(function(){e.push($(this).attr("data-tag-id"))}),$(n.target).addClass("select2-active"),$("#my-tag-dropdown_modal li.message-area").find("div").html($("#my-tag-dropdown_modal li.message-area").attr("data-searching")),$("#my-tag-dropdown_modal li.message-area").removeClass("select2-ajax-error"),$("#my-tag-dropdown_modal li.message-area").addClass("select2-no-results");$(n.target).attr("data-result-area-name");var t=$(n.target).val();App.front_business_card_lead_tags.suggest_search(t,e.join(","),"my-tag-dropdown_modal","s2id_tags_modal")},500)}),$(document).on("keydown","html",function(e){if($("#s2id_tags_modal #s2id_autogen3").hasClass("select2-active"))return!1;if($("#s2id_tags_modal #s2id_autogen3").is(":focus")){var t=$("#my-tag-dropdown_modal li.select2-highlighted"),n=$("#s2id_tags_modal li.select2-search-choice-focus");switch(n.removeClass("select2-search-choice-focus"),e.which){case 8:if(0===$("#s2id_tags_modal #s2id_autogen3").val().length)if(0===n.length)$("#s2id_tags_modal li.select2-search-choice").last().addClass("select2-search-choice-focus"),s();else if(0<n.prevAll("li.select2-search-choice").length){var i=n.prevAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),i.addClass("select2-search-choice-focus")}else if(0<n.nextAll("li.select2-search-choice").length){var a=n.nextAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),a.addClass("select2-search-choice-focus")}else $(n).find(".select2-search-choice-close").trigger("mousedown");break;case 46:if(0===$("#s2id_tags_modal #s2id_autogen3").val().length)if(0<n.nextAll("li.select2-search-choice").length){a=n.nextAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),a.addClass("select2-search-choice-focus")}else $(n).find(".select2-search-choice-close").trigger("mousedown");break;case 37:0===$("#s2id_tags_modal #s2id_autogen3").get(0).selectionStart&&(0===n.length?($("li.select2-search-choice").last().addClass("select2-search-choice-focus"),s()):0<n.prevAll("li.select2-search-choice").length&&n.prevAll("li.select2-search-choice").eq(0).addClass("select2-search-choice-focus"));break;case 38:e.preventDefault(),"none"===$("#my-tag-dropdown_modal").css("display")?$("#s2id_tags_modal #s2id_autogen3").is(":focus")&&$("#s2id_tags_modal #s2id_autogen3").trigger("focus"):(0<t.prevAll("li.select_tags").length&&(t.removeClass("select2-highlighted"),t.prevAll("li.select_tags").eq(0).addClass("select2-highlighted")),o());break;case 39:0===$("#s2id_tags_modal #s2id_autogen3").val().length&&(0===n.nextAll("li.select2-search-choice").length?$("#s2id_tags_modal #s2id_autogen3").trigger("focus"):n.nextAll("li.select2-search-choice").eq(0).addClass("select2-search-choice-focus"));break;case 40:e.preventDefault(),"none"===$("#my-tag-dropdown_modal").css("display")?$("#s2id_tags_modal #s2id_autogen3").is(":focus")&&$("#s2id_tags_modal #s2id_autogen3").trigger("focus"):(0<t.nextAll("li.select_tags").length&&(t.removeClass("select2-highlighted"),t.nextAll("li.select_tags").eq(0).addClass("select2-highlighted")),o());break;case 13:e.preventDefault(),"none"===$("#my-tag-dropdown_modal").css("display")?$("#s2id_tags_modal #s2id_autogen3").is(":focus")&&$("#s2id_tags_modal #s2id_autogen3").trigger("focus"):($("#my-tag-dropdown_modal li.select2-highlighted").trigger("mousedown"),s())}}}),$(document).on("blur","#s2id_tags_modal #s2id_autogen3",function(){var e=["my-tag-dropdown_modal"];if(0<=$.inArray(document.activeElement.id,e))return $("#s2id_tags_modal #s2id_autogen3").focus(),!0;s(),$("#s2id_tags_modal li.select2-search-choice-focus").removeClass("select2-search-choice-focus"),$("#verification_search_word_modal").html(""),l()}),$(document).on("click","#s2id_tags_modal li.select2-search-choice",function(){$("#s2id_tags_modal li.select2-search-choice").removeClass("select2-search-choice-focus"),$(this).addClass("select2-search-choice-focus"),s()}),$(document).on("mouseover","#my-tag-dropdown_modal li.select_tags",function(){$(
"#my-tag-dropdown_modal ul.my-tag-results li").removeClass("select2-highlighted"),$(this).addClass("select2-highlighted")}),$(document).on("mousedown","#my-tag-dropdown_modal li.select_tags",function(){var e=$(this).hasClass("select2-results-dept-1")?"["+$(this).prevAll(".select2-results-dept-0:first").find("span.select2-tag").html()+"]":"",t=$(this).find("span.tag-owner").html()||"";$("#s2id_tags_modal .select2-search-field").before('<li class="select2-search-choice" data-tag-id="'+$(this).attr("data-tag-id")+'"><div>'+$(this).find("span.select2-tag").html()+e+t+'</div><a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>'),i()}),$(document).on("mousedown","#s2id_tags_modal .select2-search-choice-close",function(e){e.preventDefault(),$(this).parent("li.select2-search-choice").remove(),i(),l()}),$(document).on("scroll","#my-tag-dropdown_modal ul.my-tag-results",function(){c=$(this).scrollTop()}),$(window).on("resize",function(){a()})}},App.target_list_tags_search={init_suggest:function(s,o){function r(){$("#"+o+" li").removeClass("select2-highlighted"),t(),$("#"+o).css("display","none"),$("#"+s+" #s2id_autogen3").val(""),$("#"+s+" #s2id_autogen3").css("width","20px"),e(),$("#"+s).removeClass("select2-dropdown-open")}function e(){$("#"+o+" li.category_tags").remove(),$("#"+o+" li.select_tags").remove(),$("#"+o+" li.selected_tags").remove()}function t(){u=0,$("#"+o+" ul.my-tag-results").scrollTop(0)}function l(){$("#"+o+" ul.my-tag-results").get(0).offsetTop+u>$("#"+o+" li.select2-highlighted").get(0).offsetTop?(u=$("#"+o+" li.select2-highlighted").get(0).offsetTop-$("#"+o+" ul.my-tag-results").get(0).offsetTop,$("#"+o+" ul.my-tag-results").scrollTop(u)):$("#"+o+" ul.my-tag-results").height()+$("#"+o+" ul.my-tag-results").get(0).offsetTop+u<$("#"+o+" li.select2-highlighted").height()+$("#"+o+" li.select2-highlighted").get(0).offsetTop&&(u=$("#"+o+" li.select2-highlighted").height()+$("#"+o+" li.select2-highlighted").get(0).offsetTop-($("#"+o+" ul.my-tag-results").height()+$("#"+o+" ul.my-tag-results").get(0).offsetTop),$("#"+o+" ul.my-tag-results").scrollTop(u))}function n(){var e=0<$("#"+s).parents(".hp-drag-down-sm").length?".hp-drag-down-sm":".col-xs-8";$("#"+o).css("top",$("#"+s).parents(e).get(0).offsetTop+$("#"+s).height()),$("#"+s).hasClass("custom_lead_filter")?$("#"+o).css("left",$("#"+s).parents(e).position().left+$("#"+s).position().left):$("#"+o).css("left",$("#"+s).parents(e).position().left),$("#"+o).css("width",$("#"+s).get(0).getBoundingClientRect().width),$("#"+o).css("min-height",$("#"+s).css("min-height"))}function a(){$("#verification_search_word_target").html($("#"+s+" #s2id_autogen3").val()),$("#"+s+" #s2id_autogen3").width()<=$("#verification_search_word_target").width()&&$("#"+s+" #s2id_autogen3").css("width",$("#"+s+" ul.select2-choices").width()-5+"px"),n()}function i(e){var t=$("#"+s+" #s2id_autogen3").next();if(""!==t.val()){var n=t.val().split(",");n.push(e),t.val(n.join(","))}else t.val(e)}function c(e){var t=$("#"+s+" #s2id_autogen3").next(),n=t.val();n=1<n.split(",").length&&0===$.inArray(e,n.split(","))?n.replace(e+",",""):1<n.split(",").length&&0<$.inArray(e,n.split(","))?n.replace(","+e,""):"",t.val(n)}function d(){0===$("#"+s+" li.select2-search-choice").length&&$("#"+s+" .select2-search-field span").removeClass("place-holder-hide")}$("#"+s).off("click"),$("#"+s+" #s2id_autogen3").off("focus"),$("#"+s+" #s2id_autogen3").off("input"),$("#"+s+" #s2id_autogen3").off("keydown"),$("#"+s+" #s2id_autogen3").off("blur"),$(document).off("click","#"+s+" li.select2-search-choice"),$(document).off("mouseover","#"+o+" li.select_tags"),$(document).off("mousedown","#"+o+" li.select_tags"),$(document).off("mousedown","#"+s+" .select2-search-choice-close"),$("#"+o+" ul.my-tag-results").off("scroll");var u=0;$("#"+s).on("click",function(){$("#"+s+" #s2id_autogen3").trigger("focus")}),$("#"+s+" #s2id_autogen3").on("focus",function(){"inline-block"===$("#"+s+" .select2-search-field span").css("display")&&$("#"+s+" .select2-search-field span").addClass("place-holder-hide");var e=0,t=$("#"+s+" ul.select2-choices").width();$("#"+s+" li.select2-search-choice").each(function(){t<=e+$(this).outerWidth(!0)&&(e=0),e+=$(this).outerWidth(!0)}),t-e-5<=20&&(e=0),$(this).css("width",t-e-5+"px"),n(),$("#"+o+" li").length<=1&&($("#"+o+" li.message-area").show(),$("#"+o+" li.message-area").removeClass("select2-ajax-error"),$("#"+o+" li.message-area").find("div").html($("#"+o+" li.message-area").attr("data-prompt")),$("#"+o+" li.message-area").addClass("select2-no-results"),$("#"+o).css("display","block")),$("#"+s).addClass("select2-dropdown-open")}),$("#"+s+" #s2id_autogen3").on("input",function(i){""===$(i.target).val()&&($("#"+o+" li.message-area").find("div").html($("#"+o+" li.message-area").attr("data-prompt")),$("#"+o+" li.message-area").removeClass("select2-ajax-error"),$("#"+o+" li.message-area").addClass("select2-no-results"),$("#"+o+" li.message-area").show(),e()),"none"===$("#"+o).css("display")&&$("#"+s+" #s2id_autogen3").trigger("focus"),a(),this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){if(""===$(i.target).val())return!1;var e=[];$("#"+s+" li[data-tag-id]").each(function(){e.push($(this).attr("data-tag-id"))}),$(i.target).addClass("select2-active"),$("#"+o+" li.message-area").find("div").html($("#"+o+" li.message-area").attr("data-searching")),$("#"+o+" li.message-area").removeClass("select2-ajax-error"),$("#"+o+" li.message-area").addClass("select2-no-results");var t=$(i.target).attr("data-result-area-name"),n=$(i.target).val();App.front_business_card_lead_tags.suggest_search(n,e.join(","),t,s)},500)}),$("#"+s+" #s2id_autogen3").on("keydown",function(e){if($("#"+s+" #s2id_autogen3").hasClass("select2-active"))return!1;var t=$("#"+o+" li.select2-highlighted"),n=$("#"+s+" li.select2-search-choice-focus");switch(n.removeClass("select2-search-choice-focus"),e.which){case 8:if(0===$("#"+s+" #s2id_autogen3").val().length)if(0===n.length)$("#"+s+" li.select2-search-choice").last().addClass("select2-search-choice-focus"),r();else if(0<n.prevAll("li.select2-search-choice").length){var i=n.prevAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),i.addClass("select2-search-choice-focus")}else if(0<n.nextAll("li.select2-search-choice").length){var a=n.nextAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),a.addClass("select2-search-choice-focus")}else $(n).find(".select2-search-choice-close").trigger("mousedown"),$("#"+s+" #s2id_autogen3").trigger("focus");break;case 46:if(0===$("#"+s+" #s2id_autogen3").val().length)if(0===n.length)$("#"+s+" #s2id_autogen3").trigger("focus");else if(0<n.nextAll("li.select2-search-choice").length){a=n.nextAll("li.select2-search-choice").eq(0);$(n).find(".select2-search-choice-close").trigger("mousedown"),a.addClass("select2-search-choice-focus")}else $(n).find(".select2-search-choice-close").trigger("mousedown"),$("#"+s+" #s2id_autogen3").trigger("focus");break;case 37:0===$("#"+s+" #s2id_autogen3").get(0).selectionStart&&(0===n.length?($("#"+s+" li.select2-search-choice").last().addClass("select2-search-choice-focus"),r()):0<n.prevAll("li.select2-search-choice").length&&n.prevAll("li.select2-search-choice").eq(0).addClass("select2-search-choice-focus"));break;case 38:e.preventDefault(),"none"===$("#"+o).css("display")?$("#"+s+" #s2id_autogen3").is(":focus")&&$("#"+s+" #s2id_autogen3").trigger("focus"):(0<t.prevAll("li.select_tags").length&&(t.removeClass("select2-highlighted"),t.prevAll("li.select_tags").eq(0).addClass("select2-highlighted")),l());break;case 39:0===$("#"+s+" #s2id_autogen3").val().length&&(0===n.nextAll("li.select2-search-choice").length?$("#"+s+" #s2id_autogen3").trigger("focus"):n.nextAll("li.select2-search-choice").eq(0).addClass("select2-search-choice-focus"));break;case 40:e.preventDefault(),"none"===$("#"+o).css("display")?$("#"+s+" #s2id_autogen3").is(":focus")&&$("#"+s+" #s2id_autogen3").trigger("focus"):(0<t.nextAll("li.select_tags").length&&(t.removeClass("select2-highlighted"),t.nextAll("li.select_tags").eq(0).addClass("select2-highlighted")),l());break;case 13:e.preventDefault(),"none"===$("#"+o).css("display")?$("#"+s+" #s2id_autogen3").is(":focus")&&$("#"+s+" #s2id_autogen3").trigger("focus"):($("#"+o+" li.select2-highlighted").trigger("mousedown"),$("#"+o+" li.select2-highlighted").hasClass("select_tags")&&r())}}),$("#"+s+" #s2id_autogen3").on("blur",function(){var e=["target-search-tags-pulldown0","target-search-tags-pulldown-basic"];if(0<=$.inArray(document.activeElement.id,e))return $("#"+s+" #s2id_autogen3").focus(),!0;r(),d(),$("#"+s+" li.select2-search-choice-focus").removeClass("select2-search-choice-focus"),$("#verification_search_word_target").html("")}),$(document).on("click","#"+s+" li.select2-search-choice",function(){$("#"+s+" li.select2-search-choice").removeClass("select2-search-choice-focus"),$(this).addClass("select2-search-choice-focus"),r()}),$(document).on("mouseover","#"+o+" li.select_tags",function(){$("#"+o+" li").removeClass("select2-highlighted"),$(this).addClass("select2-highlighted")}),$(document).on("mousedown","#"+o+" li.select_tags",function(){var e=$(this).find("span.select2-tag").html(),t=$(this).find("span.tag-owner").text(),n="";0<$(this).find("i").length&&(n=$(this).find("i").prop("outerHTML")),$("#"+s+" .select2-search-field").before('<li class="select2-search-choice" data-tag-id="'+$(this).attr("data-tag-id")+'"><div><span>'+e+"</span>"+App.concerns.xss_step(t)+n+'</div><a href="#" class="select2-search-choice-close" tabindex="-1"></a></li>'),i($(this).attr("data-tag-id"))}),$(document).on("mousedown","#"+s+" .select2-search-choice-close",function(e){e.preventDefault(),c($(this).parents("li").attr("data-tag-id")),$(this).parent("li.select2-search-choice").remove(),d()}),$("#"+o+" ul.my-tag-results").on("scroll",function(){u=$(this).scrollTop()}),$(window).on("resize",function(){n()})},bind_suggest_events:function(){0<$(".target-tag-select-modal").length&&$(".target-tag-select-modal").each(function(){App.target_list_tags_search.init_suggest($(this).attr("id"),$(this).parents(".col-xs-8").next().attr("id"))})}},App.front_target_lists={TARGET_LIST_OPEN_STATUS_DEPARTMENT_ROLE:5,TARGET_LIST_PERSON_IN_CHARGE_SELECT:4,TARGET_LIST_OPEN_STATUS_SELF:3,index:function(){App.concerns.disabled_with_link_clear("#btn-clear-custom-simple","#btn-search-target-lists-simple","link-clear-target-lists-simple"),App.concerns.disabled_with_link_clear("#btn-clear-custom-advanced","#btn-search-target-lists-advanced","link-clear-target-lists-advanced");var e=$(".hp-page");App.concerns.switch_search_form($(".hp-page [data-hp-role='form-switch']")),App.concerns.attach_date_picker_handlers(e),App.concerns.attach_select_search_handlers(e),$(".hp-page [data-hp-role='search-config']").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.visible_fields.setup_list_visible_setting(),App.concerns.select_search_disable_user("q_owner_user_id_in"),$("#q_status_in").select2(),$("#q_open_status_in").select2(),App.concerns.change_order("hp-form_search_target_lists"),App.concerns.change_display_number("hp-form_search_target_lists"),$(".hp-page [data-hp-role='table-config']").on("click",function(){App.visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),$(document).on("click",'[data-hp-role="paginate"]',function(e){e.preventDefault();var t=$("<input />").attr("name","page").attr("value",$(this).data("page")).attr("type","hidden");$("#hp-form_search_target_lists").append(t),$("#hp-form_search_target_lists").submit()}),App.concerns.focus_to_first_element();var t="target_lists";App.front_recommend.recommendScenarios(t)},show:function(){App.front_deals.all_checked_items_modal_deals_index();var e=$(".hp-page");this.colorful_table($(".hp-page table.table-colorful")),App.concerns.attach_date_picker_handlers($(".hp-page")),App.concerns.open_mailer(),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),App.concerns.all_checked_items(),App.concerns.set_form_action_to_submit("#form_checked_targets",".checked_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_targets","#js_get_modal_submit",!0),App.concerns.datepicker(".search_datepicker"),App.concerns.open_mailer();new Clipboard(".clipboard-btn");$("#csv_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(0);var e="#new_target_search",t=$(e).attr("action");return App.concerns.set_export_ids(e,"checked[target_ids][]"),$(e).attr("action",$(this).data("action")),$(e).submit(),$(e).attr("action",t),App.concerns.remove_export_ids(),!1}),$("#csv_all_dl_submit").on("click",function(){$("#csv_all_dl_flg").val(1);var e=$("#new_target_search").attr("action");return $("#new_target_search").attr("action",$(this).data("action")),$("#new_target_search").submit(),$("#new_target_search").attr("action",e),!1}),App.concerns.switch_search_form($(".hp-page [data-hp-role='form-switch']")),App.concerns.attach_date_picker_handlers(e),App.concerns.select_search_disable_user("target_list_user_ids"),$(".hp-page [data-hp-role='search-config']").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),$(".hp-page [data-hp-role='table-config']").on("click",function(){App.visible_fields.show_list_fields_setting()}),App.visible_fields.setup_list_visible_setting(undefined,"table.table-float-head"),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.select_search_name("search_client_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids",null,null,null,!0),App.concerns.change_order("hp-form_search_target_lists"),App.concerns.change_display_number("hp-form_search_target_lists"),App.concerns.switch_search_form($(".hp-page [data-hp-role='form-switch']")),$(".hp-page [data-hp-role='toggle-visibility']").on("click",function(){$($(this).data("target")).slideToggle(100)});var i=$("#new_target_search"),a=new App.concerns.loading_indicator($(".hp-page"));i.find("[data-hp-role='submit_search']").on("click",function(e){e.preventDefault();var t=$(this).data("type-form");$("#btn-custom-search-"+t).prop("disabled",!0),$("#btn-custom-clear-"+t).prop("disabled",!0);var n=$(this);n.data("processing")||(n.data("processing",!0),a.begin(),$.ajax({url:i.prop("action"),type:i.attr("method"),data:i.serialize(),timeout:6e4,dataType:"script"}).done(function(){}).fail(function(e,t){"timeout"==t?a.timeout():a.error()}).always(function(){$("#btn-custom-search-"+t).prop("disabled",!1),$("#btn-custom-clear-"+t).prop("disabled",!1),n.data("processing",!1),a.finish()}))}),i.find("[data-hp-role='clear_search']").on("click",function(e){e.preventDefault();var t=$(this).data("type-form");$("#btn-custom-search-"+t).prop("disabled",!0),$("#btn-custom-clear-"+t).prop("disabled",!0),$(this).data("processing")||($("#advanced-search-tags").find(".select2-search-choice").remove(),$("#advanced-search-tags .select2-search-field span").removeClass("place-holder-hide"),i.find(":input").not("input[name='authenticity_token']").not(":radio").not(".non_clear").val(""),i.find(":checked").prop("checked",!1),$("#target_search_search_type_s").prop("checked",!0),i.find("[data-hp-role='form-switch']").change(),i.find("[data-hp-role='select2'], [data-hp-role='select-search']").change(),i.find("[data-hp-role='submit_search']:first").trigger("click"))}),$("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),$(".hp-target_list-chart-toggle").find(".dropdown-menu li a").click(function(){$(this).parents(".dropdown").find(".dropdown-toggle").html($(this).text()+' <span class="caret"></span>'),$(this).parents(".dropdown").removeClass("open")}),$("#js_submit_checked_map").on("click",function(e){e.preventDefault(),$("#js_error_message").empty();var t=$("#form_checked_targets");if(0!==t.find("input:checkbox:checked").length){var n=$(this).data("action");t.attr("action",n),t.attr("target","_blank"),t.removeAttr("data-remote"),t.removeData("remote"),t.submit(),t.removeAttr("target")}else{var i='<div class="alert alert-danger alert-error"><a class="close" data-dismiss="alert">x</a> <ul><li>'+I18n.t("js.common.please_select")+"</li></ul></div>";$("#js_error_message").append(i)}}),App.front_business_card_lead_tags.init_suggest("advanced-search-tags","advanced-search-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search","#target_search_lead_filter_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search","#advanced-search-tags","#target_search_lead_filter_tag_ids"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id"),App.concerns.attach_select_search_handlers_once($(".hp-page"))},"new":function(){App.front_target_lists.attach_input_handlers($(".hp-page")),App.concerns.attach_select_search_handlers($(".hp-page")),App.concerns.prevent_submit_pressing_enter(),App.lead_filters.all_checked_items(),App.lead_filters.apply_leads_count(),App.front_deals.all_checked_items_modal_deals_index(),this.display_parameter($(".hp-page form [data-hp-role='display-parameter']")),this.optional_item_modal($(".hp-page form")),this.load_departments_modal(),this.display_swith_roles_select(),this.display_switch_person_in_charge(),$("#js_select_role_ids select").select2({width:"100%"}),$("#js_select_user_id select").select2({width:"100%"}),$("#js_open_status").select2({width:"100%"}),$("[data-target=\"[data-hp-role='lead-filter-clear']\"]").on("click",function(){var e=$(this).data("target"),t=$("[data-hp-role='lead-filter-num']"),n=$(e).find("[data-hp-role='lead-filter-control-nodata']"),i=$(e).find("[data-hp-role='lead-filter-control-show']");if($(this).data("confirmed")){if(!1===confirm(I18n.t("js.target_lists.select_process")))return;n.removeClass("hide"),i.addClass("hide"),$(e).find("[name='lead_filter[added_lead_ids]']").val(""),$(e).find("[data-hp-role='search']").trigger("click"),t.removeData("leadIdCounts"),$("[data-hp-role='lead-filter-confirm'] [name='lead_filter_confirmed']").val(!1)}else alert(I18n.t("js.target_lists.target_not_set"))}),App.concerns.focus_to_first_element(),App.tooltip.display_tooltip()},create:function(){this["new"]()},edit:function(){this["new"](),App.front_deals.all_checked_items_modal_deals_index()},update:function(){this["new"]()},colorful_table:function(e){$(e).find(".color-palette [data-hp-color]").click(function(){var e={back_ground_color:$(this).data("hp-color")},t=$(this).closest("tr"),n=t.attr("class");$.ajax({url:$(this).data("action"),type:$(this).data("method"),data:e,timeout:5e3,dataType:"json"}).done(function(e){t.removeClass(n),t.addClass(e.back_ground_color)}).fail(function(){alert(I18n.t("js.target_lists.failed"))})})},display_parameter:function(e){function t(i,a){return function(){var e=$(i),t=$(a),n=e.find("option:selected");"invisible-fields"!==t.data("hp-role")||0==n.filter(function(){return $(this).data("hide-impossible")}).size()?(t.append(n.clone()),n.remove()):alert(I18n.t("js.target_lists.not_hidden_item"))}}var n=e.find('[data-hp-role="visible-fields"]'),i=e.find('[data-hp-role="invisible-fields"]');e.find('[data-hp-role="right-btn"]').on("click",t(n,i)),e.find('[data-hp-role="left-btn"]').on("click",t(i,n)),e.find('[data-hp-role="top-btn"]').on("click",App.front_deals_details_display_items.comboMoveOne(function(e){e.prevAll().last().before(e)})),e.find('[data-hp-role="bottom-btn"]').on("click",App.front_deals_details_display_items.comboMoveOne(function(e){e.nextAll().last().after(e)})),e.find('[data-hp-role="up-btn"]').on("click",App.front_deals_details_display_items.comboMoveOne(function(e){e.prevAll().first().before(e)})),e.find('[data-hp-role="down-btn"]').on("click",App.front_deals_details_display_items.comboMoveOne(function(e){e.nextAll().first().after(e)})),e.closest("form").on("submit",function(){n.find("option").prop("selected",!0)})},optional_item_modal:function(o){var r=o.find("[name='decision_optional_item_key']");o.on("reload",function(){$(this).find("[data-hp-item-key!='']").each(function(){var e=$(this).data("hp-item-key"),t=o.find("[data-hp-modal-item-key='"+e+"'] [name$='[name]']").val();$(this).text(t)})}),o.find('[data-hp-role="target-list-modal"]').each(function(){var n=$(this),e=n.find("button[data-hp-role='decision']"),i=n.find("[name$='[name]']"),a=n.find(".alert-error"),s=a.find("ul");a.hide(),n.on("hidden.bs.modal",function(){a.hide(),i.val(i.attr("value")),n.find(".target-list-optional-item-data-field > div.fields").each(function(){var e=$(this).find("[name$='[value]']");e.attr("value")&&!$(this).data("decistionDelete")?(e.val(e.attr("value")),$(this).find("[name$='[_destroy]']").val(!1),$(this).find(".fields").show()):($(this).find("[name$='[_destroy]']").val("1"),$(this).find(".fields").hide())})}),e.on("click",function(){$(this).data("item-id");var t=i.val();r.val(n.data("hp-modal-item-key")),$.ajax({url:$(this).attr("action"),type:"POST",data:o.serialize(),timeout:6e4,dataType:"json"}).done(function(e){0==e.error_msgs.length?(a.hide(),i.attr("value",t),n.find(".target-list-optional-item-data-field > div.fields:visible").each(function(){var e=$(this).find("[name$='[value]']");"1"==$(this).find("[name$='[_destroy]']").val()&&$(this).data("decistionDelete",!0),e.attr("value",e.val())}),o.trigger("reload"),n.modal("hide")):(a.show(),s.empty(),e.error_msgs.forEach(function(e){s.append("<li>"+e+"</li>")}))})})}),o.trigger("reload")},attach_input_handlers:function(e){App.lead_filters.target_extraction_condition_modal(e),App.concerns.attach_date_picker_handlers(e),App.concerns.attach_date_time_picker_handlers(e),App.lead_filters.lead_filter_modal(e),e.find("[data-hp-role='select2']").select2({minimumResultsForSearch:20})},create:function(){this["new"]()},display_switch_person_in_charge:function(){var e=this;$("input[name='target_list[person_in_charge]']").on("change",function(){$(this).val()==e.TARGET_LIST_PERSON_IN_CHARGE_SELECT?$("#js_select_user_id").show():$("#js_select_user_id").hide()})},display_swith_roles_select:function(){var e=this;3==$("#js_open_status").val()&&$("#js_select_role_ids").show(),$("#js_open_status").val()==e.TARGET_LIST_OPEN_STATUS_DEPARTMENT_ROLE&&($("#js_select_department_role_ids").show(),$("#js_select_department_caller").show(),$("#js_select_department_role_ids select").select2({width:"100%"})),$("#js_open_status").on("change",function(){$("#js_open_status").val()==e.TARGET_LIST_OPEN_STATUS_SELF?($("#js_select_role_ids").show(),$("#js_user_id").val($("#owner_user_id_on_new_target_list").val()),$("#js_form_set_select_roles").submit()):($("#js_select_role_ids select").select2("val",""),$("#js_select_role_ids").hide())}),$("#js_open_status").on("change",function(){$("#js_open_status").val()==e.TARGET_LIST_OPEN_STATUS_DEPARTMENT_ROLE?($("#js_select_department_role_ids").show(),$("#js_select_department_caller").show()):($("#js_select_department_role_ids").hide(),$("#js_select_department_caller").hide())})},load_departments_modal:function(){App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments")},init_form:function(){App.concerns.datepicker(),App.concerns.attach_date_picker_handlers($(".hp-page")),App.concerns.select_search("target_user_id")}},App.front_targets={show:function(){App.concerns.open_mailer()},edit:function(){App.front_targets.init_form(),App.concerns.open_mailer()},update:function(){App.front_targets.init_form()},init_form:function(){App.concerns.attach_date_picker_handlers($(".hp-page")),$("[data-hp-role='select2']").select2({minimumResultsForSearch:20}),App.concerns.select_search($("#target_id").val()+"_target_user_id")}},App.front_tasks={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#btn-clear-form"),App.concerns.disable_duplicate_request_search_form("#form_search_tasks",".js-disable-btn"),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_display_number("form_search_tasks"),App.concerns.change_order("form_search_tasks"),App.concerns.set_form_action_to_submit("#form_checked_tasks","#js_destroys_submit",!0),App.concerns.set_form_action_to_submit("#form_checked_tasks","#js_get_modal_submit",!0),App.concerns.all_checked_items(),App.concerns.select_search_disable_user("q_user_id_in"),$("#q_priority_kbn_id_in").select2(),$("#q_task_categories_id_in").select2(),$("#q_status_in").select2(),App.concerns.select_search("q_leads_id_in"),App.concerns.select_search("q_deal_id_in"),App.concerns.select_search("q_daily_report_id_in"),App.concerns.select_search_disable_user("q_update_user_id_in"),App.concerns.select_search_disable_user("q_create_user_id_in"),App.concerns.select_search_disable_user("q_set_task_observers_id_in"),App.concerns.select_search_disable_user("q_incomplete_task_observers_id_in"),App.concerns.select_search("q_business_activity_id_in"),App.concerns.select_search("q_sale_approach_id_in"),App.concerns.select_search("q_campaign_id_in"),App.concerns.select_search("q_web_form_id_in"),App.concerns.select_search_name("q_client_id_in"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#q_client_id_in",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#q_client_id_in","multiple","#q_client_id_in","","","",!0),App.concerns.set_tooltip_to_select_search_client("q_client_id_in"),App.concerns.set_item_id_for_ransack(),App.concerns.datepicker(".search_datepicker"),$(document).on("click",".js_clear_submit",function(e){e.preventDefault(),$(this).prop("disabled",!0);var t=$(this).data("search-clear-flg");$("#search_clear_flg").val(t),$("#form_search_tasks").submit()}),App.concerns.change_search_type(),App.visible_fields.setup_list_visible_setting(["user_id","title","expiration_on","status, client_id, lead_ids"]),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),$("#csv_dl_submit").on("click",function(){var e="#form_search_tasks";return App.concerns.set_export_ids(e,"checked[task_ids][]"),App.concerns.set_page_parameter(e),action=$(e).attr("action"),$(e).attr("action",$(this).data("action")),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_all_dl_flg").val(1),action=$("#form_search_tasks").attr("action"),$("#form_search_tasks").attr("action",$(this).data("action")),$("#form_search_tasks").submit(),$("#form_search_tasks").attr("action",action),!1}),$(".search_items_select2").select2({width:"23%"}),App.concerns.datepicker(".search_items_datepicker"),App.concerns.prevent_submit_pressing_enter(),App.concerns.get_modal_to_search_save("#form_search_tasks"),App.concerns.get_modal_to_search_call("#form_search_tasks"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#q_leads_id_in",'input[name="associate_leads[]"]',"leads"),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#q_leads_id_in","multiple",$("#unlink_clients_flg").val()),App.concerns.set_associate_entities_to_s2("#daily_reports_multiple_decision","#q_daily_report_id_in",'input[name="associate_daily_reports[]"]',"daily_reports"),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#q_daily_report_id_in","multiple",$("#unlink_clients_flg").val()),App.concerns.set_associate_entities_to_s2("#deals_multiple_decision","#q_deal_id_in",'input[name="associate_deals[]"]',"deals"),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#q_deal_id_in","multiple",$("#unlink_clients_flg").val()),App.searches.callForSearchCondition.init(),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.focus_to_first_element(),App.tooltip.display_tooltip(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},show:function(){App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},"new":function(){this.init_form(),App.concerns.set_associate_entity_to_s2("#task_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entity_to_s2("#task_deal_id",".hp-deals-table button.decision","deals"),App.concerns.set_associate_entity_to_s2("#task_daily_report_id",".hp-daily-reports-table button.decision","daily_reports"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#task_client_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","multiple","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#task_deal_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#task_daily_report_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("set_task_observer_ids"),App.concerns.select_search("incomplete_task_observer_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search_name("task_client_id"),App.concerns.set_tooltip_to_select_search_client("task_client_id"),this.submit_enter("form.new_task"),this.submit_enter_next("form.new_task"),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.focus_to_first_element(),App.front_deals.all_checked_items_modal_deals_index()},create:function(){this.init_form(),App.front_tasks.change_user_id_type(),App.concerns.set_associate_entity_to_s2("#task_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entity_to_s2("#task_deal_id",".hp-deals-table button.decision","deals"),App.concerns.set_associate_entity_to_s2("#task_daily_report_id",".hp-daily-reports-table button.decision","daily_reports"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#task_client_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","multiple","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#task_deal_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#task_daily_report_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("set_task_observer_ids"),App.concerns.select_search("incomplete_task_observer_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search_name("task_client_id"),App.concerns.set_tooltip_to_select_search_client("task_client_id"),this.submit_enter("form.new_task"),this.submit_enter_next("form.new_task"),App.concerns.focus_to_first_element()},edit:function(){this.init_form(),
App.concerns.hide_item_file_options(),App.concerns.set_associate_entity_to_s2("#task_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entity_to_s2("#task_deal_id",".hp-deals-table button.decision","deals"),App.concerns.set_associate_entity_to_s2("#task_daily_report_id",".hp-daily-reports-table button.decision","daily_reports"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#task_client_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","multiple","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#task_deal_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#task_daily_report_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("set_task_observer_ids"),App.concerns.select_search("incomplete_task_observer_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search_name("task_client_id"),App.concerns.set_tooltip_to_select_search_client("task_client_id"),this.submit_enter("form.edit_task"),this.submit_enter_next("form.edit_task"),App.front_deals.all_checked_items_modal_deals_index()},update:function(){this.init_form(),App.concerns.hide_item_file_options(),App.concerns.set_associate_entity_to_s2("#task_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entity_to_s2("#task_deal_id",".hp-deals-table button.decision","deals"),App.concerns.set_associate_entity_to_s2("#task_daily_report_id",".hp-daily-reports-table button.decision","daily_reports",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#task_client_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","multiple","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#task_deal_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#task_daily_report_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("set_task_observer_ids"),App.concerns.select_search("incomplete_task_observer_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search_name("task_client_id"),App.concerns.set_tooltip_to_select_search_client("task_client_id"),this.submit_enter("form.edit_task"),this.submit_enter_next("form.edit_task")},new_from_another_controller:function(){App.front_deals.all_checked_items_modal_deals_index(),this.init_form(),App.concerns.set_associate_entity_to_s2("#task_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entity_to_s2("#task_deal_id",".hp-deals-table button.decision","deals"),App.concerns.set_associate_entity_to_s2("#task_daily_report_id",".hp-daily-reports-table button.decision","daily_reports"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#task_client_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","multiple","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#task_deal_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#task_daily_report_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("set_task_observer_ids"),App.concerns.select_search("incomplete_task_observer_ids"),App.concerns.select_search("lead_ids"),App.concerns.select_search_name("task_client_id"),App.concerns.set_tooltip_to_select_search_client("task_client_id"),this.submit_enter("form.new_task"),this.submit_enter_next("form.new_task"),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.concerns.focus_to_first_element()},ajax_leads_select_options:function(){$.ajax({type:"POST",url:"/xhr/leads/select_options/",data:"utf8=\u2713&client_id="+$("#js_client_id_leads_select_options").val()+"&lead_ids="+$("#js_lead_ids_leads_select_options").val()}).done(function(){$("#lead_ids").select2({width:"100%"})})},set_client_id_when_changing_client:function(){$("#task_client_id").on("change",function(){var e=$(this).val();$("#js_client_id_leads_select_options").val(e),App.front_tasks.ajax_leads_select_options(),$("#task_deal_id").data("clientId",e),$("#task_daily_report_id").data("clientId",e),$(".tooltip").tooltip("hide")})},init_task_categories:function(){1<=task_categories.length&&(task_categories=task_categories[0].split(",")),0==tagging_operable_flag?(task_categories=task_categories.map(function(e){return{id:e,text:e}}),$("#task_categories").select2({tags:!1,tokenSeparators:[","],data:task_categories})):$("#task_categories").select2({tags:task_categories,tokenSeparators:[","]})},init_form:function(){App.concerns.select_search("task_user_id"),App.concerns.select_search("task_client_id"),App.concerns.datepicker(".search_datepicker"),App.front_tasks.init_task_categories(),App.concerns.select_search("task_deal_id"),App.concerns.select_search("task_daily_report_id"),App.concerns.select_search("task_business_activity_id"),App.concerns.select_search("task_campaign_id"),this.set_client_id()},attach_associate_search_handlers:function(){App.concerns.set_associate_entity_to_s2("#task_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entity_to_s2("#task_deal_id",".hp-deals-table button.decision","deals"),App.concerns.set_associate_entity_to_s2("#task_daily_report_id",".hp-daily-reports-table button.decision","daily_reports"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#task_client_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","multiple","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#task_deal_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#task_daily_report_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("task_client_id"),App.concerns.select_search("lead_ids"),App.concerns.select_search("task_deal_id"),App.concerns.select_search("task_daily_report_id")},init_form_from_another_controller:function(e){App.concerns.select_search("task_user_id"),App.concerns.datepicker(".search_datepicker"),App.front_tasks.init_task_categories(),App.front_tasks.change_user_id_type(),App.concerns.select_search("task_business_activity_id"),App.concerns.select_search("task_campaign_id"),App.concerns.select_search("set_task_observer_ids"),App.concerns.select_search("incomplete_task_observer_ids"),e&&(App.concerns.select_search_name("task_client_id"),App.concerns.set_tooltip_to_select_search_client("task_client_id"),App.concerns.select_search("task_deal_id"),App.concerns.select_search("task_daily_report_id"),App.concerns.set_associate_entity_to_s2("#task_client_id","#search-associated-resources-modal .hp-clients-table button.decision","clients"),App.concerns.set_associate_entities_to_s2("#leads_multiple_decision","#lead_ids",'input[name="associate_leads[]"]',"leads"),App.concerns.set_associate_entity_to_s2("#task_deal_id",".hp-deals-table button.decision","deals"),App.concerns.set_associate_entity_to_s2("#task_daily_report_id",".hp-daily-reports-table button.decision","daily_reports"),$(document).off("click","#open-associated-client"),$(document).off("click","#open-associated-lead"),$(document).off("click","#open-associated-deal"),$(document).off("click","#open-associated-daily-report"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#task_client_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-lead","/xhr/leads/search_as_association_modal","#lead_ids","multiple","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-deal","/xhr/deals/search_modal","#task_deal_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.enable_associattion_search_modal("#open-associated-daily-report","/xhr/daily_reports/search_modal","#task_daily_report_id","single","#task_client_id",$("#unlink_clients_flg").val()),App.concerns.select_search("lead_ids"),this.set_client_id())},change_user_id_type:function(){$(document).on("change",".js_change_user",function(){$("#js_radio_user_id_type_search_user").is(":checked")?$("#js_user_id_type").show():($("#js_user_id_type").hide(),$("#task_user_id").val(null).trigger("change"))})},set_client_id:function(){$("#lead_ids").data("clientId",$("#task_client_id").val()),$("#task_client_id").on("change",function(){$("#lead_ids").data("clientId",$(this).val())})},submit_enter:function(e){$("#enter_submit").on("click",function(){$(this).attr("disabled",!0),$("#enter_next_submit").attr("disabled",!0),$(e).submit()})},submit_enter_next:function(e){$("#enter_next_submit").on("click",function(){$(this).attr("disabled",!0),$("#enter_submit").attr("disabled",!0),$("<input>").attr({type:"hidden",name:"enter_next_flg",value:!0}).appendTo($(e)),$(e).submit()})}},App.front_temporary_business_cards={index:function(){App.concerns.load_objects(this),$(document).on("click",".js_submit_send_mail",function(){var e=$(this).data("temporary-business-card-id");$(".btn-group.open").removeClass("open");var t=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));$("#select_temporary_business_card_id").val(e),t.submit();var n=[];n.push(e),App.front_temporary_business_cards.show_tbc_modal(n)}),App.concerns.change_display_number("form_search_temporary_business_cards"),App.concerns.change_order("form_search_temporary_business_cards"),$("#search_pref_ids").select2(),$("#search_open_status").select2(),$("#search_request_express_mode").select2(),App.concerns.select_search_disable_user("search_owner_user_ids"),$("#search_lead_source_kbn_ids").select2({width:"100%"}),App.visible_fields.setup_list_visible_setting(),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.change_search_type(),App.concerns.datepicker(".search_datepicker"),$(".js_submit_temporary_business_card_id").on("click",function(e){e.preventDefault();var t=$(this).data("temporary-business-card-id");$("#temporary_business_card_id").val(t);var n=$("#form_checked_temporary_business_card");n.attr("action",$(this).data("action")),n.submit()}),App.concerns.all_checked_items(),$(".js_submit_temporary_business_card_ids").on("click",function(){if(0===$('input[name="checked[temporary_business_card_ids][]"]:checked').length)return $(".js-checked-select-error").css("display","block"),!1;$(".js-checked-select-error").css("display","none")}),App.concerns.set_form_action_to_submit("#form_checked_temporary_business_cards",".js_submit_temporary_business_card_ids",!0),App.concerns.focus_to_first_element(),$("#js_submit_checked_mail").on("click",function(e){if(0==jQuery.map($('input[name="checked[temporary_business_card_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1}),$("#js_submit_search_mail").on("click",function(e){if(0==$('[name="checked[temporary_business_card_ids][]"]').length)return alert(I18n.t("js.common.serch_result_none")),e.stopImmediatePropagation(),!1}),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){$(".btn-group.open").removeClass("open");var e=App.concerns.set_form_action("form_checked_temporary_business_cards",$(this).data("action"),$(this).data("remote")),t=[];if("js_submit_search_mail"===$(this).attr("id")){$("#js_search_mail").prop("disabled",!1);var n=$.ajax({url:"/xhr/temporary_business_cards/get_search_all_ids",type:"GET",dataType:"html",data:e.serialize(),async:!1}).responseText;n&&(t=n.split(","))}else $("#js_search_mail").prop("disabled",!0),t=jQuery.map($('input[name="checked[temporary_business_card_ids][]"]:checked'),function(e){return $(e).val()});return e.submit(),App.front_temporary_business_cards.show_tbc_modal(t),!1}),App.concerns.open_mailer();new Clipboard(".clipboard-btn");App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("advanced-search-tags","advanced-search-pulldown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal-advanced-search","#search_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection_advanced_search"),App.concerns.lead_tags_modal_selection("#lead_tag_selection_advanced_search","#advanced-search-tags","#search_tag_ids")},show:function(){App.concerns.open_mailer(),$(".js_submit_send_mail").on("click",function(){$(".btn-group.open").removeClass("open");var e=App.concerns.set_form_action("form_open_send_mail",$(this).data("action"),$(this).data("remote"));$("#select_temporary_business_card_id").val($(this).data("temporary-business-card-id")),e.submit();var t=$(this).data("temporary-business-card-id"),n=[];return n.push(t),App.front_temporary_business_cards.show_tbc_modal(n),!1});new Clipboard(".clipboard-btn")},load_split_index:function(e){rowIndex++;var t=rows[rowIndex],n=$("#pagination_id").val();xhrTemporaryBusinessCardIds=$(t).data("xhr-temporary_business-card-ids"),$.ajax({url:"/xhr/temporary_business_cards/load_split_index",type:"GET",dataType:"html",data:{ids:xhrTemporaryBusinessCardIds,pagination_id:n}}).done(function(e){$(t).replaceWith(e),$(document).trigger("floatTableUpdate")}).fail(function(){$(t).html("")}).always(function(){rowIndex<rows.length-2?App.front_temporary_business_cards.load_split_index(e):e.resolve()})},show_tbc_modal:function(e){$(document).on("shown.bs.modal","#modal_block_for_send_mail",function(){return $(document).on("show.bs.modal","#modal_check_tbc",function(){var e=Math.max.apply(null,Array.prototype.map.call(document.querySelectorAll("*"),function(e){return+e.style.zIndex}))+10;$(this).css("z-index",e),setTimeout(function(){$(".modal-backdrop").not(".modal-stack").css("z-index",e-1).addClass("modal-stack")},0),$(document).off("shown.bs.modal","#modal_check_tbc")}),$.ajax({type:"POST",url:"/xhr/temporary_business_cards/check_tbc_modal",dataType:"script",data:{temporary_business_card_ids:e}}),$(document).off("shown.bs.modal","#modal_block_for_send_mail"),!1})},date_check:function(){$("#search_expiration_on_gteq").val()&&$("#search_expiration_on_lteq_end_of_day").val()&&Date.parse($("#search_expiration_on_gteq").val())>Date.parse($("#search_expiration_on_lteq_end_of_day").val())&&alert(I18n.t("js.temporary_business_card.invalid_term"))}},App.tooltip={display_tooltip:function(){var e,t;$(".tooltip_area .select2-container").each(function(e,t){$(t).attr("data-toggle")||($(t).attr("data-toggle","tooltip"),$(t).attr("data-placement","top"))}),$('[data-toggle="tooltip"]').tooltip({trigger:"manual"}),$('[data-toggle="tooltip"]').hover(function(){t=$(this),e=setTimeout(function(){!t.attr("data-original-title")&&t.attr("placeholder")?t.attr("title",t.attr("placeholder")).tooltip("fixTitle"):t.attr("data-original-title")||t.attr("placeholder")||!t.hasClass("tooltip-for-tag")?t.attr("data-original-title")||t.attr("placeholder")||!t.hasClass("tooltip-for-remove-tag")?t.attr("data-original-title")||t.attr("placeholder")||!t.next("input")[0]?t.attr("data-original-title")||t.attr("placeholder")||!t.next("select")[0]||t.attr("title",t.next("select").attr("placeholder")).tooltip("fixTitle"):t.attr("title",t.next("input").attr("data-placeholder")).tooltip("fixTitle"):t.attr("title",t.find(".remove-tag-placeholder").text()).tooltip("fixTitle"):t.attr("title",t.find(".tag-placeholder").text()).tooltip("fixTitle"),t.tooltip("show")},500)},function(){t.tooltip("hide"),clearTimeout(e)})}},App.front_transfer_tools={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_transfer_tools_search",".js-disable-btn"),App.concerns.all_checked_items(),App.concerns.change_display_number("form_transfer_tools_search"),App.concerns.change_order("form_transfer_tools_search"),App.concerns.enable_csv_export_event("#form_transfer_tools_search","checked[transfer_tools][]"),App.concerns.select_search("search_departments"),$(function(){$("#file_tag").change(function(){$("#transfer_tool_csv").submit()})}),$("#import-btn").click(function(){return $("#file_tag").click(),!1})},edit:function(){App.front_transfer_tools.inifinite_scroll(),App.front_departments.ajax_load(),App.front_transfer_tools.folding(),App.front_transfer_tools.all_check(),App.front_transfer_tools.children_all_check(),App.front_transfer_tools.load_descendants_by_check(),App.front_transfer_tools.disable_flg_by_check_box_blank(),App.front_transfer_tools.input_by_name_blank(),App.front_transfer_tools.checked_department_ids=$("#entried_department_ids").val().split(" "),App.front_transfer_tools.submit_disable()},update:function(){App.front_transfer_tools.edit()},"new":function(){App.front_transfer_tools.edit(),App.front_transfer_tools.checked_department_ids=[]},create:function(){App.front_transfer_tools.edit()},all_check:function(){$(document).on("click","#all_check",function(){if($(window).off("scroll"),$("#all_check").prop("checked"))if(App.front_transfer_tools.children_dom_check($("#department_tree").children("li"),!0)&&$("#department_tree").data("routes-depth-size")<=$("#department_tree").children("li").length)$("#department_tree .dd-list").show(),$("#department_tree .folding").attr("data-action","collapse"),$(".department-checked").prop("checked",!0),App.front_transfer_tools.checked_department_ids=[],$("#department_tree").find("li").each(function(){App.front_transfer_tools.checked_department_ids.push($(this).attr("data-department-id"))}),App.front_transfer_tools.submit_disable();else{var e={};$(".department-checked").each(function(){e[$(this).closest("li").data("department-id")]=$(this).prop("checked")}),$("#loading").show();e={};$(".department-checked").each(function(){e[$(this).val()]=$(this).prop("checked")}),$.ajax({url:"/xhr/transfer_tools/departments_list_html",type:"GET",dataType:"html",data:{transfer_tool_id:$("#manage_transfer_tool_id").val(),selected_departments:e,department_ids:$("#transfer_tool_department_ids").val()}}).done(function(e){$("#department_tree").empty(),$("#department_tree").append(e),$("#department_tree .dd-list").show(),$("#department_tree .folding").attr("data-action","collapse"),$("#department_tree .department-checked").prop("checked",!0),App.front_transfer_tools.checked_department_ids=[],$("#department_tree").find("li").each(function(){App.front_transfer_tools.checked_department_ids.push($(this).attr("data-department-id"))})}).fail(function(){App.front_transfer_tools.ajax_error_message()}).always(function(){$("#loading").hide(),App.front_transfer_tools.submit_disable()})}})},children_all_check:function(){$("ul input:checkbox").change(function(){$(this).prop("checked")?$(this).closest(".dd-item input:checkbox").prop("checked",!0):$("#all_check").prop("checked",!1)})},folding:function(){$(document).on("click",".dd-item button",function(){var t=$(this);"expand"==t.attr("data-action")?0==t.nextAll(".dd-list").children().length?(App.front_transfer_tools.load_list(t.parent("li").data("department-id")),$.ajax({url:"/xhr/transfer_tools/children_list_html",type:"GET",dataType:"html",data:{parent_id:t.parent("li").data("department-id"),level:t.parent("li").data("level"),transfer_tool_id:$("#manage_transfer_tool_id").val(),department_ids:$("#transfer_tool_department_ids").val()}}).done(function(e){t.attr("data-action","collapse"),t.nextAll(".dd-list").empty(),t.nextAll(".dd-list").append(e),t.nextAll("ul").show()}).fail(function(){App.front_transfer_tools.ajax_error_message()}).always(function(){$("#loading-list").remove()})):(t.attr("data-action","collapse"),t.nextAll("ul").show()):(t.attr("data-action","expand"),t.nextAll("ul").hide())}),$("#all_close").on("click",function(){$(".dd ul ul").hide(),$(".dd .folding").attr("data-action","expand")}),$(document).on("click","#all_open",function(){if($(window).off("scroll"),App.front_transfer_tools.children_dom_check($("#department_tree").children("li"),!0)&&$("#department_tree").data("routes-depth-size")<=$("#department_tree").children("li").length)$("#department_tree .dd-list").show(),$("#department_tree .folding").attr("data-action","collapse");else{var e={};$(".department-checked").each(function(){e[$(this).closest("li").data("department-id")]=$(this).prop("checked")}),$("#loading").show(),$.ajax({url:"/xhr/transfer_tools/departments_list_html",type:"GET",dataType:"html",data:{transfer_tool_id:$("#manage_transfer_tool_id").val(),selected_departments:e,department_ids:$("#transfer_tool_department_ids").val()}}).done(function(e){$("#department_tree").empty(),$("#department_tree").append(e),$("#department_tree .dd-list").show(),$("#department_tree .folding").attr("data-action","collapse")}).fail(function(){App.front_transfer_tools.ajax_error_message()}).always(function(){$("#loading").hide()})}})},ajax_error_message:function(){$("#loading").hide(),$("div#alert-message").html('      <div class="row">        <div class="col-xs-12">          <div class="alert alert-danger alert-error alert-dismissible" role="alert">            <button type="button" class="close" data-dismiss="alert" aria-label="Close">              <span aria-hidden="true">&times;</span>            </button>            <ul>              <li style="word-wrap: break-word;">'+I18n.t("js.transfer_tools.communication_failed")+"</li>            </ul>          </div>        </div>      </div>")},load_descendants_by_check:function(){$(document).on("change",".department-checked",function(){var t=$(this);t.prop("checked")?App.front_transfer_tools.children_dom_check(t.closest("li"),!0)?(t.closest("li").find(".dd-list").show(),t.closest("li").find(".folding").attr("data-action","collapse"),t.closest("li").find(".department-checked").prop("checked",!0),t.closest("li").find("li").each(function(){App.front_transfer_tools.checked_department_ids.indexOf($(this).attr("data-department-id"))<0&&App.front_transfer_tools.checked_department_ids.push($(this).attr("data-department-id"))})):(App.front_transfer_tools.load_list(t.parents("li").data("department-id")),$.ajax({url:"/xhr/transfer_tools/descendants_list_html",type:"GET",dataType:"html",data:{parent_id:t.closest("li").data("department-id"),level:t.closest("li").data("level")},context:t.closest("li")}).done(function(e){$(this).children(".dd-list").empty(),$(this).children(".dd-list").append(e),$(this).find(".dd-list").show(),$(this).find(".folding").attr("data-action","collapse"),$(this).find(".department-checked").prop("checked",!0),t.closest("li").find("li").each(function(){App.front_transfer_tools.checked_department_ids.indexOf($(this).attr("data-department-id"))<0&&App.front_transfer_tools.checked_department_ids.push($(this).attr("data-department-id"))})}).fail(function(){App.front_transfer_tools.ajax_error_message()}).always(function(){$("#loading-list").remove()})):$("#all_check").prop("checked",!1)})},children_dom_check:function(e,n){return e.each(function(e,t){return 0==$(t).children(".dd-list").length||(n=0!=$(t).children(".dd-list").children().length&&App.front_transfer_tools.children_dom_check($(t).children(".dd-list").children(".dd-item"),n))}),n},inifinite_scroll:function(){20<$("#department_tree").data("routes-depth-size")&&$(window).on("scroll",function(){var e=$(document).height()-($(window).height()+$(window).scrollTop());-3<e&&e<3&&($("#loading").show(),$(window).off("scroll"),$("#transfer_remote_form").submit())})},load_list:function(e){var t=$("<div>");t.attr("id","loading-list");var n=$('<i class="fa fa-spinner fa-pulse fa-3x loading"></i>');n.attr("id","spinner-list"),t.append(n),$('li[data-department-id="'+e+'"]').before(t),$("#loading-list").show()},disable_flg_by_name_blank:function(){return 0===$("#manage_transfer_tool_name").val().length},input_by_name_blank:function(){$("#manage_transfer_tool_name").keyup(function(){App.front_transfer_tools.submit_disable()})},disable_flg_by_check_box_blank:function(){$(document).on("change",".department-checked",function(){App.front_transfer_tools.array_delete_or_add_value(App.front_transfer_tools.checked_department_ids,$(this)),App.front_transfer_tools.submit_disable()})},submit_disable:function(){0==App.front_transfer_tools.checked_department_ids.length||App.front_transfer_tools.disable_flg_by_name_blank()?($("#edit_submit").prop("disabled",!0),$("#new_submit").prop("disabled",!0)):($("#edit_submit").prop("disabled",!1),$("#new_submit").prop("disabled",!1))},array_delete_or_add_value:function(e,t){if(t.closest("li").data("department-id")){var n=t.closest("li").data("department-id").toString();t.prop("checked")?e.push(n):(index=-1,$.each(e,function(e,t){t==n&&(index=e)}),-1!=index&&e.splice(index,1))}}},App.front_use_restrictions={show:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_smartphone_devices",".js-disable-btn"),App.concerns.change_display_number("form_search_smartphone_devices"),App.concerns.change_order("form_search_smartphone_devices"),App.concerns.all_checked_items(),App.concerns.prevent_submit_pressing_enter(),App.concerns.enable_csv_export_event("#form_search_smartphone_devices","checked[smartphone_device_ids][]"),App.concerns.set_form_action_to_submit("#form_checked_smartphone_devices",".checked_submit",!0),this.set_user_ids(),App.concerns.select_search_disable_user("search_user_ids"),App.concerns.check_form_input("#myModal","#bulk_update"),App.concerns.set_form_action_to_submit("#form_checked_smartphone_devices",".js_open_modal_update_all",!0),$("#search_status").select2({allowClear:!0});new Clipboard(".clipboard-btn");App.visible_fields.setup_list_visible_setting(["device_id","user_name","user_id","department"]),App.concerns.add_class_name_to_tooltip($(".department-span"),"department-tooltip")},change_form:function(e){$(".checked_submit").on("click",function(){form=$("#"+e),$(form).attr("action",$(this).data("action")),$(this).data("remote")?$(form).attr("data-remote","true"):($(form).removeAttr("data-remote"),$(form).removeData("remote"))})},set_user_ids:function(){$("#search").data("userIds",$("#search_user_ids").val()),$("#search_user_ids").on("change",function(){$("#search").data("userIds",$(this).val())})}},App.front_users={index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_users",".js-disable-btn"),App.concerns.change_display_number("form_search_users"),App.concerns.change_order("form_search_users"),App.concerns.all_checked_items(),App.concerns.prevent_submit_pressing_enter(),App.concerns.enable_csv_export_event("#form_search_users","checked[user_ids][]"),this.change_form("form_checked_users"),this.clear_massage(),this.modal_confirm_delete("#delete_checked"),App.concerns.departments_modal_selection("#department_selection","#departments"),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),App.concerns.select_search("js-search-user"),App.concerns.focus_to_first_element(),App.concerns.add_class_name_to_tooltip($(".department-span"),"department-tooltip")},show:function(){this.modal_confirm_delete("#delete_user")},"new":function(){this.submit_new(),this.set_data_to_confirmation_users(),$("#role_ids").select2({width:"100%"}),$("#role_ids").on("select2-removing",function(){$("#confirmation_user_ids").val()&&$("#role_ids").prop("disabled",!0)}),this.set_disabled_export_authority_type(),App.concerns.select_search("favorited_user_ids"),App.concerns.select_search("confirmation_user_ids","role_ids"),App.concerns.select_search("default_set_task_observer_ids"),App.concerns.select_search("default_incomplete_task_observer_ids"),App.concerns.select_search("common_tag_group_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#favorite_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#favorite_client_ids","multiple","#favorite_client_ids"),App.concerns.select_search_name("favorite_client_ids"),App.concerns.set_tooltip_to_select_search_client("favorite_client_ids"),App.concerns.departments_modal_selection("#department_selection","#departments",100),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags"),App.concerns.attach_radio_toggle_handlers($("#samlAuthenticationFlg")),this.set_default_display_dashoboard_select2(),this.set_thanks_mail_mail_template_select2(),this.set_meeting_report_mail_mail_template_select2(),this.init_menu_set(),this.init_ab_test_mail_flg(),this.init_user_setting(),this.init_client_news_delivery_setting(),this.init_favorite_client_notification_setting(),this.user_setting_control(),this.ab_test_mail_flg_control(),this.change_client(),this.show_setting_param(),this.campaign_authority(),this.reach_status_change(),this.reach_status_force_disable_notice(),this.client_news_delivery_authority(),this.favorite_client_notification_flg_authority(),App.front_segments.set_segment_select2("#user_default_segment_id"),App.front_segments.change_segment_icon("#user_default_segment_id"),document.getElementById("col-wrapper").classList.add("custom-overflow")},create:function(){this.submit_new(),this.set_data_to_confirmation_users(),$("#role_ids").select2({width:"100%"}),$("#role_ids").on("select2-removing",function(){$("#confirmation_user_ids").val()&&$("#role_ids").prop("disabled",!0)}),this.set_disabled_export_authority_type(),App.concerns.select_search("favorited_user_ids"),App.concerns.select_search("confirmation_user_ids","role_ids"),App.concerns.select_search("default_set_task_observer_ids"),App.concerns.select_search("default_incomplete_task_observer_ids"),App.concerns.select_search("common_tag_group_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#favorite_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#favorite_client_ids","multiple","#favorite_client_ids"),App.concerns.select_search_name("favorite_client_ids"),App.concerns.set_tooltip_to_select_search_client("favorite_client_ids"),
App.concerns.departments_modal_selection("#department_selection","#departments",100),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags"),App.concerns.attach_radio_toggle_handlers($("#samlAuthenticationFlg")),this.set_default_display_dashoboard_select2(),this.set_thanks_mail_mail_template_select2(),this.set_meeting_report_mail_mail_template_select2(),this.init_tag_operation_by_authority(),this.init_display_template_flg_operation_by_authority(),this.init_menu_set(),this.init_ab_test_mail_flg(),this.init_user_setting(),this.user_setting_control(),this.ab_test_mail_flg_control(),this.init_authority_kbn(),this.init_client_news_delivery_setting(),this.init_favorite_client_notification_setting(),this.change_client(),this.show_setting_param(),this.campaign_authority(),this.reach_status_change(),this.reach_status_force_disable_notice(),this.client_news_delivery_authority(),this.favorite_client_notification_flg_authority(),App.front_segments.set_segment_select2("#user_default_segment_id"),App.front_segments.change_segment_icon("#user_default_segment_id"),document.getElementById("col-wrapper").classList.add("custom-overflow")},edit:function(){this.submit_edit(),this.set_data_to_confirmation_users(),$("#role_ids").select2({width:"100%"}),$("#role_ids").on("select2-removing",function(){$("#confirmation_user_ids").val()&&$("#role_ids").prop("disabled",!0)}),this.set_disabled_export_authority_type(),App.concerns.select_search("favorited_user_ids"),App.concerns.select_search("confirmation_user_ids","role_ids"),App.concerns.select_search("default_set_task_observer_ids"),App.concerns.select_search("default_incomplete_task_observer_ids"),App.concerns.select_search("common_tag_group_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#favorite_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#favorite_client_ids","multiple","#favorite_client_ids"),App.concerns.select_search_name("favorite_client_ids"),App.concerns.set_tooltip_to_select_search_client("favorite_client_ids"),App.concerns.departments_modal_selection("#department_selection","#departments",100),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags"),App.concerns.attach_radio_toggle_handlers($("#samlAuthenticationFlg")),this.change_disable_rest_api_key(),this.set_default_display_dashoboard_select2(),this.set_thanks_mail_mail_template_select2(),this.set_meeting_report_mail_mail_template_select2(),this.init_tag_operation_by_authority(),this.init_menu_set(),this.init_ab_test_mail_flg(),this.init_user_setting(),this.user_setting_control(),this.ab_test_mail_flg_control(),this.init_authority_kbn(),this.init_display_template_flg_operation_by_authority(),this.init_client_news_delivery_setting(),this.init_favorite_client_notification_setting(),this.change_client(),this.show_setting_param(),this.campaign_authority(),this.reach_status_change(),this.reach_status_force_disable_notice(),this.client_news_delivery_authority(),this.favorite_client_notification_flg_authority(),App.front_segments.set_segment_select2("#user_default_segment_id"),App.front_segments.change_segment_icon("#user_default_segment_id"),document.getElementById("col-wrapper").classList.add("custom-overflow")},update:function(){this.submit_edit(),this.set_data_to_confirmation_users(),$("#role_ids").select2({width:"100%"}),$("#role_ids").on("select2-removing",function(){$("#confirmation_user_ids").val()&&$("#role_ids").prop("disabled",!0)}),this.set_disabled_export_authority_type(),App.concerns.select_search("favorited_user_ids"),App.concerns.select_search("confirmation_user_ids","role_ids"),App.concerns.select_search("default_set_task_observer_ids","role_ids"),App.concerns.select_search("default_incomplete_task_observer_ids","role_ids"),App.concerns.select_search("common_tag_group_ids"),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#favorite_client_ids",'input[name="associate_clients[]"]',"clients"),App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#favorite_client_ids","multiple","#favorite_client_ids"),App.concerns.select_search_name("favorite_client_ids"),App.concerns.set_tooltip_to_select_search_client("favorite_client_ids"),App.concerns.departments_modal_selection("#department_selection","#departments",100),App.concerns.departments_modal("#open-departments-modal","/xhr/departments_search/departments_search_modal","#departments"),App.concerns.select_search("departments"),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#tags"),App.concerns.attach_radio_toggle_handlers($("#samlAuthenticationFlg")),this.change_disable_rest_api_key(),this.set_default_display_dashoboard_select2(),this.set_thanks_mail_mail_template_select2(),this.set_meeting_report_mail_mail_template_select2(),this.init_tag_operation_by_authority(),this.init_menu_set(),this.init_ab_test_mail_flg(),this.init_user_setting(),this.user_setting_control(),this.ab_test_mail_flg_control(),this.init_authority_kbn(),this.show_setting_param(),this.campaign_authority(),this.reach_status_change(),this.reach_status_force_disable_notice(),this.change_client(),this.client_news_delivery_authority(),this.favorite_client_notification_flg_authority(),App.front_segments.set_segment_select2("#user_default_segment_id"),App.front_segments.change_segment_icon("#user_default_segment_id")},submit_new:function(){$("#new_submit").on("click",function(){$(this).attr("disabled",!0),$("form.new_user").submit()})},submit_edit:function(){$("#edit_submit").on("click",function(){$(this).attr("disabled",!0),api_key_flg=$("#user_api_key_flg_false"),api_key_flg.prop("checked")&&api_key_flg.data("confirm")?confirm(api_key_flg.data("confirm"))&&$("form.edit_user").submit():$("form.edit_user").submit()})},change_form:function(e){$(".checked_submit").on("click",function(){form=$("#"+e),$(form).attr("action",$(this).data("action")),$(this).data("remote")?$(form).attr("data-remote","true"):($(form).removeAttr("data-remote"),$(form).removeData("remote"))})},clear_massage:function(){$("#myModal").on("hidden.bs.modal",function(){$(".alert").remove()})},get_modal_to_search_users:function(e,t,n,i,a,s){$(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_selected_user_ids").val($(e).val()),$("#js_search_type").val(t),$("#js_disabled_user_search_flg").val(i),$("#js_segment_client_rank_condition_number").val(a),$("#js_segment_client_rank_condition_child_number").val(s),$("#js_without_move_button").val(n),$("#js_search_users_role_ids").val($("#role_ids").val()),$("#js_search_users_daily_report_open_status").val($("#js_open_status").val()),$("#js_search_users_daily_report_user_id").val($("#daily_report_user_id").val()),$("#js_get_modal_to_search_users").submit(),$(".modal-backdrop").last().css("z-index",9998)},get_modal_to_search_users_not_change_data:function(e,t,n,i){$(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_selected_user_ids").val($(e).val()),$("#js_search_type").val(t),$("#js_disabled_user_search_flg").val(i),$("#js_without_move_button").val(n),$("#js_search_users_role_ids").val($(e).data("selected-role-ids")),$("#js_search_users_daily_report_open_status").val($(e).data("open-status")),$("#js_search_users_daily_report_user_id").val($(e).data("user-id")),$("#js_get_modal_to_search_users").submit()},set_data_to_confirmation_users:function(){$(document).on("change","#role_ids",function(){$("#confirmation_user_ids").data("selected-role-ids",$(this).select2("val")).trigger("change"),$("#confirmation_user_ids").val("")})},set_disabled_export_authority_type:function(){var e=function(){$("input[name='user[csv_flg]']:eq(1)").prop("checked")?$("input[name='user[export_authority_type]']").prop("disabled",!0):$("input[name='user[export_authority_type]']").prop("disabled",!1)};$("input[name='user[csv_flg]']").on("change",e),e()},change_disable_rest_api_key:function(){$(document).on("change","form input[name='user[api_key_flg]']",function(){"true"===$(this).val()?$(".rest_api_key_labal").removeClass("text-muted"):$(".rest_api_key_labal").addClass("text-muted")})},get_modal_to_related_users:function(e,t,n,i){0==ie_click_flag&&($(e).data("caller-select-flg",!0),$(e).attr("data-caller-select-flg",!0),$("#js_related_users_selected_user_ids").val($(e).val()),$("#js_related_users_search_type").val(t),$("#js_related_users_department_id").val(n),$("#js_related_users_department_size").val($("#department_tree").children("li").length),$("#js_disabled_user_search_flg").val(i),$("#js_get_modal_to_related_users").submit(),$(".modal-backdrop").last().css("z-index",9998))},set_default_display_dashoboard_select2:function(){$("#user_default_display_dashboard_id").select2({width:"100%",placeholder:I18n.t("js.users.select_dashboard"),allowClear:!0})},set_thanks_mail_mail_template_select2:function(){$("#user_thanks_mail_mail_template_id").select2({width:"100%",allowClear:!0})},set_meeting_report_mail_mail_template_select2:function(){$("#user_meeting_report_mail_mail_template_id").select2({width:"100%",allowClear:!0})},init_tag_operation_by_authority:function(){1==$("#user_authority_kbn").val()&&($('checked[name="user[tagging_operable_flag]"]').val(["true"]),$('input[name="user[tagging_operable_flag]"]').prop("disabled",!0))},init_display_template_flg_operation_by_authority:function(){1!=$("#user_authority_kbn").val()&&1!=$('input[name="user[default_user_flg]"]')||($('input[name="user[display_template_flg]"]').val(["true"]),$('input[name="user[display_template_flg]"]').prop("disabled",!0))},init_authority_kbn:function(){3==$("#user_authority_kbn").val()&&$("#user_chat_flg_false").prop("disabled",!0)},init_menu_set:function(){1!=$("#user_authority_kbn").val()&&$("#user_authority_kbn").val()!==undefined||($('select[name="user[menu_set_id]"]').val(null),$('select[name="user[menu_set_id]"]').prop("disabled",!0))},init_ab_test_mail_flg:function(){"false"==$('input[name="user[seminar_flg]"]:checked').val()&&($('input[name="user[ab_test_mail_flg]"]').val(["false"]),$('input[name="user[ab_test_mail_flg]"]').prop("disabled",!0))},init_user_setting:function(){""==$("#select_user_setting").val()&&$("#submit_user_setting").prop("disabled",!0)},init_client_news_delivery_setting:function(){$(".client_news_target_kbn_input").prop("disabled",$("#client_news_delivery_flg_input_disable").is(":checked"))},init_favorite_client_notification_setting:function(){$(".favorite_client_notification_level").prop("disabled",$("#favorite_client_notification_flg_disable").is(":checked"))},user_setting_control:function(){$("#select_user_setting").on("change",function(){""==$("#select_user_setting").val()?$("#submit_user_setting").prop("disabled",!0):$("#submit_user_setting").prop("disabled",!1)})},ab_test_mail_flg_control:function(){$('input[name="user[campaign_flg]"]').on("change",function(){$('input[name="user[seminar_flg]"]:checked').val(),$('input[name="user[ab_test_mail_flg]"]').prop("disabled",!1)}),$('input[name="user[seminar_flg]"]').on("change",function(){"false"==$('input[name="user[seminar_flg]"]:checked').val()?($('input[name="user[ab_test_mail_flg]"]').val(["false"]),$('input[name="user[ab_test_mail_flg]"]').prop("disabled",!0)):$('input[name="user[ab_test_mail_flg]"]').prop("disabled",!1)})},show_setting_param:function(){$("#submit_user_setting").on("click",function(){setting_template_id=$("#select_user_setting").val(),$("#user_setting_id").val(setting_template_id),$("#show_user_setting_form").submit()})},campaign_authority:function(){$("input[name='user[campaign_flg]']").on("change",function(){"true"===$("input[name='user[campaign_flg]']:checked").val()?($("#user_seminar_flg_true").prop("checked",!0),$("input[name='user[seminar_flg]']").prop("disabled",!0)):$("input[name='user[seminar_flg]']").prop("disabled",!1)})},reach_status_change:function(){$(".js_reach_enable").on("click",function(){if("true"!=$("#reach_auth_pending").val()){$(".reach_input").prop("disabled",!1);var e=$("input[name='user[email]']").val();$("input[name='user[reach_user][email]']").val(e);var t=$("input[name='user[name]']").val();$("input[name='user[reach_user][first_name]']").val(t)}$(".reach_input_tr").show()}),$(".js_reach_disable").on("click",function(){$(".reach_input_tr").hide(),"true"!=$("#reach_auth_pending").val()&&$(".reach_input").val(""),$(".reach_input").prop("disabled",!0)})},reach_status_force_disable_notice:function(){$(document).ready(function(){var e=$("#user_enable_flg_false").prop("checked"),t="3"==$("#user_authority_kbn").val(),n=$("#user_password_authentication_flg_false").prop("checked");(e||t||n)&&($(".js_reach_disable_btn").prop("disabled",!1),$(".js_reach_disable").prop("checked",!0),$(".reach_input_tr").hide(),"true"!=$("#reach_auth_pending").val()&&$(".reach_input").val(""),$(".reach_input").prop("disabled",!0),$(".js_reach_enable").css("pointer-events","none"),$(".js_reach_disable").css("pointer-events","none"),$(".js_reach_enable_btn").prop("disabled",!0),$(".js_reach_disable_btn").prop("disabled",!0))}),inputs=["#user_enable_flg_true","#user_enable_flg_false","#user_authority_kbn","#user_password_authentication_flg_true","#user_password_authentication_flg_false"],$.each(inputs,function(e,t){$(t).on("change",function(){var e=$("#user_enable_flg_false").prop("checked"),t="3"==$("#user_authority_kbn").val(),n=$("#user_password_authentication_flg_false").prop("checked");e||t||n?($(".js_reach_disable_btn").prop("disabled",!1),$(".js_reach_disable_btn").prop("checked",!0),$(".reach_input_tr").hide(),"true"!=$("#reach_auth_pending").val()&&$(".reach_input").val(""),$(".reach_input").prop("disabled",!0),$(".js_reach_enable").css("pointer-events","none"),$(".js_reach_disable").css("pointer-events","none"),$(".js_reach_enable_btn").prop("disabled",!0),$(".js_reach_disable_btn").prop("disabled",!0)):($(".js_reach_enable").css("pointer-events",""),$(".js_reach_disable").css("pointer-events",""),$(".js_reach_enable_btn").prop("disabled",!1),$(".js_reach_disable_btn").prop("disabled",!1))})})},change_client:function(){$("#favorite_client_ids").on("change",function(){$(".tooltip").tooltip("hide")})},client_news_delivery_authority:function(){$(".client_news_delivery_flg").on("change",function(){$(".client_news_target_kbn_input").prop("disabled",$("#client_news_delivery_flg_input_disable").is(":checked"))})},favorite_client_notification_flg_authority:function(){$(".favorite_client_notification_flg").on("change",function(){$(".favorite_client_notification_level").prop("disabled",$("#favorite_client_notification_flg_disable").is(":checked"))})},modal_confirm_delete:function(e){$(e).on("click",function(){$("#confirm_delete_user").modal("show")}),$("#confirm_delete_user #exec").on("click",function(){form=$("#form_checked_users"),form.attr("action",$(this).data("action")),form.submit(),$(this).attr("disabled",!0),$("#confirm_delete_user #cancel").attr("disabled",!0),$("#checkbox_confirm_delete_user").parent().css("pointer-events","none"),$("#confirm_delete_user li a").css("pointer-events","none")}),$("#checkbox_confirm_delete_user").on("change",function(){$("#confirm_delete_user #exec").attr("disabled",!$(this).prop("checked"))}),$("#confirm_delete_user").on("show.bs.modal",function(){$("#checkbox_confirm_delete_user").prop("checked",!1).trigger("change")})}},$(document).on("change","form#new_user select#user_authority_kbn",function(){var n=1,e=2,t=["ability[lead][merge]","ability[lead][edit]","ability[lead][delete]","ability[client][merge]","ability[client][edit]","ability[client][delete]"],i=$(this).val();return $('input[name="user[tagging_operable_flag]"]').val([i==e?"false":"true"]),$.each(t,function(e,t){$('input[name="'+t+'"]').val([i!=n&&t.match(/\[merge\]$/)?"false":"true"])}),!1}),$(document).on("change","select#user_authority_kbn",function(){var e=1,t=$(this).val();return $('input[name="user[tagging_operable_flag]"]').val([t==e?"true":"false"]),t==e?$('input[name="user[tagging_operable_flag]"]').prop("disabled",!0):$('input[name="user[tagging_operable_flag]"]').prop("disabled",!1),t==e?($('input[name="user[display_template_flg]"]').val(["true"]),$('input[name="user[display_template_flg]"]').prop("disabled",!0)):$('input[name="user[display_template_flg]"]').prop("disabled",!1),!1}),$(document).on("change","select#user_authority_kbn",function(){var e=3;return $(this).val()==e?($("#user_chat_flg_false").prop("disabled",!0),$("#user_chat_flg_false").prop("checked",!1),$("#user_chat_flg_true").prop("checked",!0)):$("#user_chat_flg_false").prop("disabled",!1),!1}),$(document).on("change","select#user_authority_kbn",function(){var e=1;return $(this).val()==e?($('select[name="user[menu_set_id]"]').val(null),$('select[name="user[menu_set_id]"]').prop("disabled",!0)):$('select[name="user[menu_set_id]"]').prop("disabled",!1),!1}),App.visible_fields={setup_list_visible_setting:function(e,t){var n=App.concerns.set_float_table_header(t);return $("#visible_fields_setting_dialog").find(".js_list_field").change(function(){n.floatTheadOff(),App.visible_fields.change_visibility($(this)),n.floatTheadOn()}),$("#visible_fields_setting_dialog").find("#enable_horizontal_scroll_flg").change(function(){App.visible_fields.change_horizontal_scroll($(this),e)}),n},show_list_fields_setting:function(e,t,n){void 0===e&&(e=I18n.t("js.visible_fields.set_search")),void 0===t&&(t=I18n.t("js.common.close")),void 0===n&&(n=I18n.t("js.common.select_item")),$("html,body").scrollLeft(0);$("#visible_fields_setting_dialog").removeClass("hide").dialog({modal:!0,title:e,width:400,title_html:!0,draggable:!0,buttons:[{text:t,"class":"btn btn-primary btn-xs",click:function(){$(this).dialog("close")}}],open:function(){$("body,html").css({overflowX:"hidden","word-wrap":"break-word"}),$(document).trigger("floatTableUpdate")},beforeClose:function(){if(0==$(this).find("input[name=visible_fields\\[\\]]:checked, input[name=visible_question_fields\\[\\]]:checked").length)return alert(n),!1},close:function(){var e=[];$(this).find("input[type=checkbox]:checked").each(function(){e.push($(this).val())}),$("#frm_visible_fields").find("input[type=checkbox]").each(function(){$(this).prop("checked",e.includes($(this).val()))}),App.visible_fields.save_visible_fields(e.join(",")),$("body,html").css("overflowX",""),$(document).trigger("floatTableUpdate")}})},change_visibility:function(e){if(!(t=$(".js_visibility_"+e.val())).length)var t=$(".js_visibility_question_"+e.val());t.is(":visible")?t.hide():t.show()},change_horizontal_scroll:function(e,t){for(var n=0;n<t.length;n++){var i=$(".js_visibility_"+t[n]);e.prop("checked")?i.css("min-width","150px"):i.css("min-width","")}},save_visible_fields:function(){$("#frm_visible_fields").submit()}},App.front_web_cards_requests={index:function(){App.concerns.change_display_number("reload"),App.concerns.change_order("form_order_web_card_requests"),App.concerns.all_checked_summary_items(),App.concerns.set_form_action_to_submit("#form_checked_web_cards_requests",".checked_submit",!0,!0),this.disable_when_submit(".btn-reject"),$('input[id*="js-web-card-request-ids"]:enabled').change(function(){checkAll=$('input[id*="js-web-card-request-ids"]:checked:enabled').length==$('input[id*="js-web-card-request-ids"]:enabled').length,$("#js-check-all-web-card-request").prop("checked",checkAll)})},show:function(){App.concerns.datepicker(".search_datepicker"),App.front_business_card_lead_tags.init_suggest("s2id_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#temporary_business_card_tag_ids","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#s2id_tags","#temporary_business_card_tag_ids"),this.disable_when_submit("#btn-reject"),$("#create_mcenter_tbc_form").on("ajax:before",function(){$(".btn").prop("disabled",!0),$(".loading").show()}),$("#create_mcenter_tbc_form").on("ajax:complete",function(){$(".loading").hide()});var e=document.getElementById("request_express_mode_show");"Operator"==$("#temporary_business_card_request_type").val()&&"Japanese"==$("#temporary_business_card_priority_language").val()||null!=e&&(e.checked=!1,e.setAttribute("disabled",!0)),$("#temporary_business_card_request_type").on("change",function(){null!=e&&("Operator"==$(this).val()&&"Japanese"==$("#temporary_business_card_priority_language").val()?e.removeAttribute("disabled",!0):(e.checked=!1,e.setAttribute("disabled",!0)))}),$("#temporary_business_card_priority_language").on("change",function(){null!=e&&("Japanese"==$(this).val()&&"Operator"==$("#temporary_business_card_request_type").val()?e.removeAttribute("disabled",!0):(e.checked=!1,e.setAttribute("disabled",!0)))})},disable_when_submit:function(e){$(e).on("click",function(){$(this).attr("disabled",!0)})}},App.front_web_forms={index:function(){function e(e,t){$("#csv_dl_submit").on("click",function(){return App.concerns.set_export_ids(e,t),App.concerns.set_page_parameter(e),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_submit").on("click",function(){return $("#csv_all_dl_flg").val(1),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),$("#csv_all_dl_flg").val(0),!1}),$("#csv_all_dl_inquiry_this_page").on("click",function(){return $("#csv_all_dl_inquiry_flg").val(1),$("#csv_all_dl_inquiry_this_page_flg").val(1),App.concerns.set_export_ids(e,t),App.concerns.set_page_parameter(e),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),$("#csv_all_dl_inquiry_flg").val(0),$("#csv_all_dl_inquiry_this_page_flg").val(0),App.concerns.remove_export_ids(),$("#page_for_export").remove(),!1}),$("#csv_all_dl_inquiry").on("click",function(){return $("#csv_all_dl_inquiry_flg").val(1),action=$(e).attr("action"),$(e).attr("action",action+"index.csv"),$(e).submit(),$(e).attr("action",action),$("#csv_all_dl_flg").val(0),!1})}App.concerns.change_display_number("form_search_web_forms"),App.concerns.change_order("form_search_web_forms"),App.concerns.datepicker(".search_datepicker",{language:"ja"}),$("#q_status_in").select2(),App.concerns.select_search("q_campaign_id_in"),App.concerns.select_search_disable_user("q_update_user_id_in"),App.front_segments.set_segment_select2("#search_segment_ids"),App.concerns.set_value("click",".js_clear_submit","#search_clear_flg","search-clear-flg"),App.concerns.change_search_type("#search_type_1","#search_type_2"),App.visible_fields.setup_list_visible_setting(["site_name","name","public_url"]),$(".show_list_fields").on("click",function(){App.search_visible_fields.show_list_fields_setting()}),App.search_visible_fields.setup_list_search_visible_setting(),App.concerns.focus_to_first_element(),e("#form_search_web_forms","checked[web_form_ids][]"),App.concerns.all_checked_items()},edit:function(){App.concerns.select_search("web_form_campaign_id"),App.concerns.select_search("mail_user_ids"),App.front_segments.set_segment_select2("#web_form_segment_id"),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("web_form_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#web_form_tags","#tags"),App.front_segments.change_segment_icon("#web_form_segment_id")},update:function(){App.concerns.select_search("web_form_campaign_id"),App.concerns.select_search("mail_user_ids"),App.front_segments.set_segment_select2("#web_form_segment_id"),App.front_business_card_lead_tags.ajax_load(),App.front_business_card_lead_tags.init_suggest("web_form_tags","my-tag-dropdown"),App.concerns.lead_tags_modal("#open-business-card-lead-tags-modal","#tags","/xhr/business_card_lead_tags_search/business_card_lead_tags_search_modal","lead_tag_selection"),App.concerns.lead_tags_modal_selection("#lead_tag_selection","#web_form_tags","#tags"),App.front_segments.change_segment_icon("#web_form_segment_id")},datepicker:function(){var t={format:"YYYY-MM-DD hh:mm"};$(function(){var e=$(".search_datepicker");e.attr(t),e.datepicker({language:"ja"})})},clear_web_form_search_modal:function(e,t,n){e.stopPropagation(),t=t||"#form_xhr_web_forms_search",n=n||"#q_status_in",$webFormModal=$(t),$webFormModal[0].reset(),$webFormModal.find("#q_inquiries_count_gteq_val").val(""),$webFormModal.find("#q_inquiries_count_lteq_val").val(""),$(n).trigger("change")},clear_web_form_segment_search_modal:function(e,t,n){e.stopPropagation(),t=t||"#form_xhr_web_forms_search",n=n||"#q_status_in, #search_segment_id",$webFormModal=$(t),$webFormModal[0].reset(),$webFormModal.find("#q_inquiries_count_gteq_val").val(""),$webFormModal.find("#q_inquiries_count_lteq_val").val(""),$webFormModal.find("#search_segment_id").val(""),$(n).trigger("change")}},App.front_web_trackings={readers:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_readers",".js-disable-btn"),App.front_deals.all_checked_items_modal_deals_index(),App.concerns.change_display_number("form_search_readers"),App.concerns.change_order("form_search_readers"),this.csv_dl("form_search_readers"),App.concerns.set_form_action_to_submit("#form_checked_web_trackings",".checked_submit",!0),this.common(),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){$(".check-items").each(function(){$(this).next().prop("disabled",!0)}),$(".btn-group.open").removeClass("open"),"js_submit_search_mail"===$(this).attr("id")?($("#js_search_mail").prop("disabled",!1),$(".checked_lead_id").prop("disabled",!0)):($("#js_search_mail").prop("disabled",!0),$("#all_checked_lead_id").prop("disabled",!0),$(".check-items:checked").each(function(){$(this).next().prop("disabled",!1)}))}),$("#js_submit_checked_mail").on("click",function(e){var t=jQuery.map($('input[name="checked[web_tracking_ids][]"]:checked'),function(e){return $(e).val()}),n=jQuery.map($('input[name="checked[web_tracking_ids][]"]:checked').next(),function(e){return $(e).val()});return 0==t.length?(alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1):0==n.filter(function(e){return""!==e}).length?(alert(I18n.t("js.common.alert_found_leads_select")),e.stopImmediatePropagation(),!1):void 0}),$("#js_submit_search_mail").on("click",function(t){if(0==$('[name="checked[web_tracking_ids][]"]').length)return alert(I18n.t("js.common.serch_result_none")),t.stopImmediatePropagation(),!1;$.ajax({url:"/xhr/web_trackings/check_lead_id_exists?",type:"POST",dataType:"json",async:!1,data:{search:$("#js_search_mail").val()}}).done(function(e){if(!e.result)return alert(I18n.t("js.common.serch_result_lead_none")),t.stopImmediatePropagation(),!1})}),$(document).on("change",".js-bal-check",function(){if($(this).prop("checked")){var e=$(this).data("lead-id");$(this).parent().append($("<input>",{type:"hidden",name:"checked[lead_ids][]",value:e}))}else $(this).parent().find('[type="hidden"]').remove()}),$("#checked-leads-link").on("click",function(){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),!1}),App.concerns.mail_type_select_modal_submit("form_checked_web_trackings"),App.tooltip.display_tooltip(),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},index:function(){App.concerns.disable_buttons_submit_custom(".js-disable-btn","#clear_submit"),App.concerns.disable_duplicate_request_search_form("#form_search_readers",".js-disable-btn"),App.concerns.change_display_number("form_search_web_trackings"),App.concerns.change_order("form_search_web_trackings"),this.csv_dl("form_search_web_trackings"),App.concerns.set_form_action_to_submit("#form_checked_web_trackings",".checked_submit",!0),this.common(),$("#js_submit_checked_mail, #js_submit_search_mail").on("click",function(){$(".check-items").each(function(){$(this).next().prop("disabled",!0)}),$(".btn-group.open").removeClass("open"),"js_submit_search_mail"===$(this).attr("id")?($("#js_search_mail").prop("disabled",!1),$(".checked_lead_id").prop("disabled",!0)):($("#js_search_mail").prop("disabled",!0),$("#all_checked_lead_id").prop("disabled",!0),$(".check-items:checked").each(function(){$(this).next().prop("disabled",!1)}))}),$("#js_submit_checked_mail").on("click",function(e){var t=jQuery.map($('input[name="checked[web_tracking_ids][]"]:checked'),function(e){return $(e).val()}),n=jQuery.map($('input[name="checked[web_tracking_ids][]"]:checked').next(),function(e){return $(e).val()});return 0==t.length?(alert(I18n.t("js.common.please_select")),e.stopImmediatePropagation(),!1):0==n.filter(function(e){return""!==e}).length?(alert(I18n.t("js.common.alert_found_leads_select")),e.stopImmediatePropagation(),!1):void 0}),$("#js_submit_search_mail").on("click",function(t){if(0==$('[name="checked[web_tracking_ids][]"]').length)return alert(I18n.t("js.common.serch_result_none")),t.stopImmediatePropagation(),!1;$.ajax({url:"/xhr/web_trackings/check_lead_id_exists?",type:"POST",dataType:"json",async:!1,data:{search:$("#js_search_mail").val()}}).done(function(e){if(!e.result)return alert(I18n.t("js.common.serch_result_lead_none")),t.stopImmediatePropagation(),!1})}),$(document).on("change",".js-bal-check",function(){if($(this).prop("checked")){var e=$(this).data("lead-id");$(this).parent().append($("<input>",{type:"hidden",name:"checked[lead_ids][]",value:e}))}else $(this).parent().find('[type="hidden"]').remove()}),$("#checked-leads-link").on("click",function(){if(0==jQuery.map($('input[name="checked[lead_ids][]"]:checked'),function(e){return $(e).val()}).length)return alert(I18n.t("js.common.please_select")),!1}),App.concerns.mail_type_select_modal_submit("form_checked_web_trackings"),App.tooltip.display_tooltip(),App.front_deals.all_checked_items_modal_deals_index();var e="web_trackings";App.front_recommend.recommendScenarios(e),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","deal_client_id"),App.concerns.show_modal_simple_business_card("lead_ids_open_modal_simple_business_card","lead_ids","daily_report_client_id")},association_index:function(){App.concerns.change_display_number("form_search_web_trackings"),App.concerns.change_order("form_search_web_trackings"),App.concerns.select_search("search_client_id")},csv_dl:function(e){App.concerns.enable_csv_export_event("#"+e,"checked[web_tracking_ids][]")},common:function(){App.concerns.all_checked_items(),App.concerns.datepicker(".search_datepicker"),App.concerns.set_item_id(),App.concerns.select_search("lead_ids"),App.concerns.select_search_name("search_client_ids"),App.concerns.set_tooltip_to_select_search_client("search_client_ids"),App.concerns.select_search_disable_user("search_owner_user_ids"),$("#search_pref_ids").select2(),$("#search_important_customer_flg").select2(),$("#search_end_user_flg").select2(),$("#search_store_flg").select2(),App.concerns.set_associate_entities_to_s2("#clients_multiple_decision","#search_client_ids",'input[name="associate_clients[]"]',"clients"),
App.concerns.enable_associattion_search_modal("#open-associated-client","/xhr/clients/search_modal","#search_client_ids","multiple","#search_client_ids","","","",!0)}},App.webinars={polls:function(){this.update_poll(),this.delete_poll(),this.create_poll(),App.concerns.adjustment_modal_z_index("#poll-index-modal"),App.concerns.adjustment_modal_z_index("#poll-add-modal")},open_question_area:function(){$(".question_area.active").addClass("hidden"),$(".question_area.deactive").removeClass("hidden"),$(".question-panel").each(function(){var e=$(this).find(".question_area.active").find("#poll_questions_name_").val();0==e.length&&(e=I18n.t("js.webinar_polls.please_input_question")),$(this).find(".question_area.deactive").find(".question_name").text(e);var t="",n=$(this).find(".question_area.deactive .question-status");$(this).find(".question_form .require").each(function(){var e=!1;0==$(this).val().length&&(e=!0),e&&(t="("+I18n.t("js.webinar_polls.no_complete")+")")}),n.text(t)})},add_index_question_form_type:function(){var e=$(".question_form_type_1"),a=$(".question_form_type_2");e.each(function(e,t){var n=e+1;$(t).attr("name","poll[questions][type_"+n+"]");var i=$(a[e]);i.attr("name","poll[questions][type_"+n+"]"),!0===$(t).prop("checked")?$(t).prop("checked",!0):i.prop("checked",!0)})},create_poll:function(){$(document).on("click","#poll_submit",function(){$(".question_area.active:not(:hidden)").find("span.has-error > input, span.has-error > textarea").unwrap();var n=!1;$(".question_area.active:not(:hidden)").find(".require").each(function(e,t){$(t).val().length<=0&&($(t).wrap('<span class="has-error"></span>'),n=!0)}),$(".question_area.active.hidden").find(".require").each(function(e,t){$(t).val().length<=0&&(n=!0)}),n||($("#poll_submit").attr("disabled",!0),$("#question_count").val($(".question-panel").length),$("#poll_form").submit())})},update_poll:function(){$(document).on("click","#edit_question",function(){App.webinars.open_question_area(),$(this).parents(".question-panel").find(".question_area.active").removeClass("hidden"),$(this).parents(".question-panel").find(".question_area.deactive").addClass("hidden")})},delete_poll:function(){$(document).on("click","#delete_question",function(){$(this).parents(".question-panel").remove(),$(".question-panel").length<10&&$("#add_question").removeClass("hidden")})}},function(e,t){"object"==typeof module&&module.exports?module.exports=e.document?t(e):t:e.Highcharts=t(e)}("undefined"!=typeof window?window:this,function(l){function y(e,t){var n="Highcharts error #"+e+": www.highcharts.com/errors/"+e;if(t)throw Error(n);l.console&&console.log(n)}function c(e,t,n){this.options=t,this.elem=e,this.prop=n}function I(){var e,t,n=arguments,i={},a=function(e,t){var n,i;for(i in"object"!=typeof e&&(e={}),t)t.hasOwnProperty(i)&&(n=t[i],e[i]=n&&"object"==typeof n&&"[object Array]"!==Object.prototype.toString.call(n)&&"renderTo"!==i&&"number"!=typeof n.nodeType?a(e[i]||{},n):t[i]);return e};for(!0===n[0]&&(i=n[1],n=Array.prototype.slice.call(n,2)),t=n.length,e=0;e<t;e++)i=a(i,n[e]);return i}function f(e,t){return parseInt(e,t||10)}function g(e){return"string"==typeof e}function _(e){return e&&"object"==typeof e}function A(e){return"[object Array]"===Object.prototype.toString.call(e)}function $(e){return"number"==typeof e}function b(e){return de.log(e)/de.LN10}function w(e){return de.pow(10,e)}function d(e,t){for(var n=e.length;n--;)if(e[n]===t){e.splice(n,1);break}}function D(e){return e!==P&&null!==e}function x(e,t,n){var i,a;if(g(t))D(n)?e.setAttribute(t,n):e&&e.getAttribute&&(a=e.getAttribute(t));else if(D(t)&&_(t))for(i in t)e.setAttribute(i,t[i]);return a}function h(e){return A(e)?e:[e]}function k(e,t,n){if(t)return setTimeout(e,t,n);e.call(0,n)}function O(e,t){we&&!xe&&t&&t.opacity!==P&&(t.filter="alpha(opacity="+100*t.opacity+")"),Xe(e.style,t)}function S(e,t,n,i,a){return e=ce.createElement(e),t&&Xe(e,t),a&&O(e,{padding:0,border:"none",margin:0}),n&&O(e,n),i&&i.appendChild(e),e}function e(e,t){var n=function(){};return n.prototype=new e,Xe(n.prototype,t),n}function p(e,t){return Array((t||2)+1-String(e).length).join(0)+e}function m(e){return 6e4*(Y&&Y(e)||W||0)}function v(e,t){for(var n,i,a,s,o,r="{",l=!1,c=[];-1!==(r=e.indexOf(r));){if(n=e.slice(0,r),l){for(o=(a=(i=n.split(":")).shift().split(".")).length,n=t,s=0;s<o;s++)n=n[a[s]];i.length&&(i=i.join(":"),a=/\.([0-9])/,s=H.lang,o=void 0,/f$/.test(i)?(o=(o=i.match(a))?o[1]:-1,null!==n&&(n=le.numberFormat(n,o,s.decimalPoint,-1<i.indexOf(",")?s.thousandsSep:""))):n=u(i,n))}c.push(n),e=e.slice(r+1),r=(l=!l)?"}":"{"}return c.push(e),c.join("")}function C(e){return de.pow(10,_e(de.log(e)/de.LN10))}function E(e,t,n,i,a){var s,o=e;for(s=e/(n=Je(n,1)),t||!(t=[1,2,2.5,5,10])===i&&(1===n?t=[1,2,5,10]:n<=.1&&(t=[1/n])),i=0;i<t.length&&(o=t[i],!(a&&e<=o*n||!a&&s<=(t[i]+(t[i+1]||t[i]))/2));i++);return o*=n}function T(e,n){var i,t,a=e.length;for(t=0;t<a;t++)e[t].safeI=t;for(e.sort(function(e,t){return 0===(i=n(e,t))?e.safeI-t.safeI:i}),t=0;t<a;t++)delete e[t].safeI}function R(e){for(var t=e.length,n=e[0];t--;)e[t]<n&&(n=e[t]);return n}function N(e){for(var t=e.length,n=e[0];t--;)e[t]>n&&(n=e[t]);return n}function s(e,t){for(var n in e)e[n]&&e[n]!==t&&e[n].destroy&&e[n].destroy(),delete e[n]}function o(e){n||(n=S(Ne)),e&&n.appendChild(e),n.innerHTML=""}function B(e,t){return parseFloat(e.toPrecision(t||14))}function F(e,t){t.renderer.globalAnimation=Je(e,t.animation)}function t(){var e=H.global,r=e.useUTC,t=r?"getUTC":"get",n=r?"setUTC":"set";z=e.Date||l.Date,W=r&&e.timezoneOffset,Y=r&&e.getTimezoneOffset,q=function(e,t,n,i,a,s){var o;return r?(o=z.UTC.apply(0,arguments),o+=m(o)):o=new z(e,t,Je(n,1),Je(i,0),Je(a,0),Je(s,0)).getTime(),o},V=t+"Minutes",G=t+"Hours",X=t+"Day",J=t+"Date",Z=t+"Month",ee=t+"FullYear",te=n+"Milliseconds",ne=n+"Seconds",ie=n+"Minutes",ae=n+"Hours",se=n+"Date",oe=n+"Month",re=n+"FullYear"}function K(e){if(!(this instanceof K))return new K(e);this.init(e)}function M(){}function j(e,t,n,i){this.axis=e,this.pos=t,this.type=n||"",this.isNew=!0,!n&&!i&&this.addLabel()}function L(e,t,n,i,a){var s=e.chart.inverted;this.axis=e,this.isNegative=n,this.options=t,this.x=i,this.total=null,this.points={},this.stack=a,this.rightCliff=this.leftCliff=0,this.alignOptions={align:t.align||(s?n?"left":"right":"center"),verticalAlign:t.verticalAlign||(s?"middle":n?"bottom":"top"),y:Je(t.y,s?4:n?14:-6),x:Je(t.x,s?n?-6:6:0)},this.textAlign=t.textAlign||(s?n?"right":"left":"center")}var P,r,U,n,H,u,Q,z,q,W,Y,V,G,X,J,Z,ee,te,ne,ie,ae,se,oe,re,le,ce=l.document,de=Math,ue=de.round,_e=de.floor,he=de.ceil,pe=de.max,fe=de.min,me=de.abs,ge=de.cos,Ae=de.sin,ve=de.PI,be=2*ve/360,ye=l.navigator&&l.navigator.userAgent||"",$e=l.opera,we=/(msie|trident|edge)/i.test(ye)&&!$e,ke=ce&&8===ce.documentMode,Ce=!we&&/AppleWebKit/.test(ye),Ee=/Firefox/.test(ye),i=/(Mobile|Android|Windows Phone)/.test(ye),Te="http://www.w3.org/2000/svg",xe=ce&&ce.createElementNS&&!!ce.createElementNS(Te,"svg").createSVGRect,a=Ee&&parseInt(ye.split("Firefox/")[1],10)<4,Ie=ce&&!xe&&!we&&!!ce.createElement("canvas").getContext,De={},Oe=0,Se=function(){},Re=[],Be=0,Ne="div",Fe=/^[0-9]+$/,Ke=["plotTop","marginRight","marginBottom","plotLeft"],Me={};(le=l.Highcharts?y(16,!0):{win:l}).seriesTypes=Me;var je,Le,Pe,Ue,He,Qe,ze,qe,We,Ye,Ve,Ge=[];c.prototype={dSetter:function(){var e,t=this.paths[0],n=this.paths[1],i=[],a=this.now,s=t.length;if(1===a)i=this.toD;else if(s===n.length&&a<1)for(;s--;)e=parseFloat(t[s]),i[s]=isNaN(e)?t[s]:a*parseFloat(n[s]-e)+e;else i=n;this.elem.attr("d",i)},update:function(){var e=this.elem,t=this.prop,n=this.now,i=this.options.step;this[t+"Setter"]?this[t+"Setter"]():e.attr?e.element&&e.attr(t,n):e.style[t]=n+this.unit,i&&i.call(e,n,this)},run:function(e,t,n){var i,a=this,s=function(e){return!s.stopped&&a.step(e)};this.startTime=+new z,this.start=e,this.end=t,this.unit=n,this.now=this.start,this.pos=0,s.elem=this.elem,s()&&1===Ge.push(s)&&(s.timerId=setInterval(function(){for(i=0;i<Ge.length;i++)Ge[i]()||Ge.splice(i--,1);Ge.length||clearInterval(s.timerId)},13))},step:function(e){var t,n=+new z,i=this.options;t=this.elem;var a,s=i.complete,o=i.duration,r=i.curAnim;if(t.attr&&!t.element)t=!1;else if(e||n>=o+this.startTime){for(a in this.now=this.end,this.pos=1,this.update(),e=r[this.prop]=!0,r)!0!==r[a]&&(e=!1);e&&s&&s.call(t),t=!1}else this.pos=i.easing((n-this.startTime)/o),this.now=this.start+(this.end-this.start)*this.pos,this.update(),t=!0;return t},initPath:function(e,t,n){t=t||"";var i,a=e.shift,s=-1<t.indexOf("C"),o=s?7:3,r=(t=t.split(" "),n=[].concat(n),e.isArea),l=r?2:1,c=function(e){for(i=e.length;i--;)("M"===e[i]||"L"===e[i])&&e.splice(i+1,0,e[i+1],e[i+2],e[i+1],e[i+2])};if(s&&(c(t),c(n)),a<=n.length/o&&t.length===n.length)for(;a--;)n=n.slice(0,o).concat(n),r&&(n=n.concat(n.slice(n.length-o)));if(e.shift=0,t.length)for(e=n.length;t.length<e;)a=t.slice().splice(t.length/l-o,o*l),s&&(a[o-6]=a[o-2],a[o-5]=a[o-1]),[].splice.apply(t,[t.length/l,0].concat(a));return[t,n]}};var Xe=le.extend=function(e,t){var n;for(n in e||(e={}),t)e[n]=t[n];return e},Je=le.pick=function(){var e,t,n=arguments,i=n.length;for(e=0;e<i;e++)if((t=n[e])!==P&&null!==t)return t},Ze=le.wrap=function(e,t,n){var i=e[t];e[t]=function(){var e=Array.prototype.slice.call(arguments);return e.unshift(i),n.apply(this,e)}};u=function(e,t,n){if(!D(t)||isNaN(t))return H.lang.invalidDate||"";e=Je(e,"%Y-%m-%d %H:%M:%S");var i,a=(u=new z(t-m(t)))[G](),s=u[X](),o=u[J](),r=u[Z](),l=u[ee](),c=H.lang,d=c.weekdays,u=Xe({a:d[s].substr(0,3),A:d[s],d:p(o),e:o,w:s,b:c.shortMonths[r],B:c.months[r],m:p(r+1),y:l.toString().substr(2,2),Y:l,H:p(a),k:a,I:p(a%12||12),l:a%12||12,M:p(u[V]()),p:a<12?"AM":"PM",P:a<12?"am":"pm",S:p(u.getSeconds()),L:p(ue(t%1e3),3)},le.dateFormats);for(i in u)for(;-1!==e.indexOf("%"+i);)e=e.replace("%"+i,"function"==typeof u[i]?u[i](t):u[i]);return n?e.substr(0,1).toUpperCase()+e.substr(1):e},Q={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},le.numberFormat=function(e,t,n,i){e=+e||0;var a,s,o=H.lang,r=(e.toString().split(".")[1]||"").length,l=Math.abs(e);return-1===t?t=Math.min(r,20):isNaN(t)&&(t=2),s=3<(a=String(f(l.toFixed(t)))).length?a.length%3:0,n=Je(n,o.decimalPoint),i=Je(i,o.thousandsSep),e=e<0?"-":"",e+=s?a.substr(0,s)+i:"",e+=a.substr(s).replace(/(\d{3})(?=\d)/g,"$1"+i),+t&&(e+=n+(i=Math.abs(l-a+Math.pow(10,-Math.max(t,r)-1))).toFixed(t).slice(2)),e},Math.easeInOutSine=function(e){return-.5*(Math.cos(Math.PI*e)-1)},je=function(e,t){var n;return"width"===t?Math.min(e.offsetWidth,e.scrollWidth)-je(e,"padding-left")-je(e,"padding-right"):"height"===t?Math.min(e.offsetHeight,e.scrollHeight)-je(e,"padding-top")-je(e,"padding-bottom"):(n=l.getComputedStyle(e,void 0))&&f(n.getPropertyValue(t))},Le=function(e,t){return t.indexOf?t.indexOf(e):[].indexOf.call(t,e)},Ue=function(e,t){return[].filter.call(e,t)},Qe=function(e,t){for(var n=[],i=0,a=e.length;i<a;i++)n[i]=t.call(e[i],e[i],i,e);return n},He=function(e){var t=ce.documentElement;return{top:(e=e.getBoundingClientRect()).top+(l.pageYOffset||t.scrollTop)-(t.clientTop||0),left:e.left+(l.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}},Ve=function(e){for(var t=Ge.length;t--;)Ge[t].elem===e&&(Ge[t].stopped=!0)},Pe=function(e,t){return Array.prototype.forEach.call(e,t)},ze=function(t,e,n){function i(e){e.target=e.srcElement||l,n.call(t,e)}var a=t.hcEvents=t.hcEvents||{};t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&(t.hcEventsIE||(t.hcEventsIE={}),t.hcEventsIE[n.toString()]=i,t.attachEvent("on"+e,i)),a[e]||(a[e]=[]),a[e].push(n)},qe=function(i,a,e){function s(e,t){i.removeEventListener?i.removeEventListener(e,t,!1):i.attachEvent&&(t=i.hcEventsIE[t.toString()],i.detachEvent("on"+e,t))}function t(){var e,t,n;if(i.nodeName)for(n in a?(e={})[a]=!0:e=r,e)if(r[n])for(t=r[n].length;t--;)s(n,r[n][t])}var n,o,r=i.hcEvents;r&&(a?(n=r[a]||[],e?(-1<(o=Le(e,n))&&(n.splice(o,1),r[a]=n),s(a,e)):(t(),r[a]=[])):(t(),i.hcEvents={}))},We=function(e,t,n,i){var a;a=e.hcEvents;var s,o,r,l;n=n||{};if(ce.createEvent&&(e.dispatchEvent||e.fireEvent))(a=ce.createEvent("Events")).initEvent(t,!0,!0),a.target=e,Xe(a,n),e.dispatchEvent?e.dispatchEvent(a):e.fireEvent(t,a);else if(a)for(s=(a=a[t]||[]).length,r=function(){n.defaultPrevented=!0},o=0;o<s;o++){if(l=a[o],n.stopped)return;n.preventDefault=r,n.target=e,n.type||(n.type=t),!1===l.call(e,n)&&n.preventDefault()}i&&!n.defaultPrevented&&i(n)},Ye=function(e,t,n){var i,a,s,o,r="";for(o in _(n)||(n={duration:(i=arguments)[2],easing:i[3],complete:i[4]}),$(n.duration)||(n.duration=400),n.easing=Math[n.easing]||Math.easeInOutSine,n.curAnim=I(t),t)s=new c(e,n,o),a=null,"d"===o?(s.paths=s.initPath(e,e.d,t.d),s.toD=t.d,i=0,a=1):e.attr?i=e.attr(o):(i=parseFloat(je(e,o))||0,"opacity"!==o&&(r="px")),a||(a=t[o]),a.match&&a.match("px")&&(a=a.replace(/px/g,"")),s.run(i,a,r)},l.jQuery&&(l.jQuery.fn.highcharts=function(){var e=[].slice.call(arguments);if(this[0])return e[0]?(new(le[g(e[0])?e.shift():"Chart"])(this[0],e[0],e[1]),this):Re[x(this[0],"data-highcharts-chart")]}),ce&&!ce.defaultView&&(je=function(e,t){var n;return n={width:"clientWidth",height:"clientHeight"}[t],e.style[t]?f(e.style[t]):("opacity"===t&&(t="filter"),n?(e.style.zoom=1,e[n]-2*je(e,"padding")):(n=e.currentStyle[t.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})],"filter"===t&&(n=n.replace(/alpha\(opacity=([0-9]+)\)/,function(e,t){return t/100})),""===n?1:f(n)))}),Array.prototype.forEach||(Pe=function(e,t){for(var n=0,i=e.length;n<i;n++)if(!1===t.call(e[n],e[n],n,e))return n}),Array.prototype.indexOf||(Le=function(e,t){var n,i=0;if(t)for(n=t.length;i<n;i++)if(t[i]===e)return i;return-1}),Array.prototype.filter||(Ue=function(e,t){for(var n=[],i=0,a=e.length;i<a;i++)t(e[i],i)&&n.push(e[i]);return n}),le.Fx=c,le.inArray=Le,le.each=Pe,le.grep=Ue,le.offset=He,le.map=Qe,le.addEvent=ze,le.removeEvent=qe,le.fireEvent=We,le.animate=Ye,le.stop=Ve;var et=(H={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#2b908f,#f45b5b,#91e8e1".split(","),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),shortMonths:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{useUTC:!0,canvasToolsURL:"http://code.highcharts.com/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/4.2.2/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1e3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0,lineWidthPlus:1,radiusPlus:2},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":le.numberFormat(this.y,-1)},style:{color:"contrast",fontSize:"11px",fontWeight:"bold",textShadow:"0 0 6px contrast, 0 0 3px contrast"},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1e3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"white",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:xe,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:i?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",fontSize:"9px"}}}).plotOptions,tt=et.line;t(),K.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(e){return[f(e[1]),f(e[2]),f(e[3]),parseFloat(e[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(e){return[f(e[1],16),f(e[2],16),f(e[3],16),1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(e){return[f(e[1]),f(e[2]),f(e[3]),1]}}],init:function(e){var t,n,i,a;if((this.input=e)&&e.stops)this.stops=Qe(e.stops,function(e){return new K(e[1])});else for(i=this.parsers.length;i--&&!n;)(t=(a=this.parsers[i]).regex.exec(e))&&(n=a.parse(t));this.rgba=n||[]},get:function(n){var i,e=this.input,t=this.rgba;return this.stops?((i=I(e)).stops=[].concat(i.stops),Pe(this.stops,function(e,t){i.stops[t]=[i.stops[t][0],e.get(n)]})):i=t&&!isNaN(t[0])?"rgb"===n||!n&&1===t[3]?"rgb("+t[0]+","+t[1]+","+t[2]+")":"a"===n?t[3]:"rgba("+t.join(",")+")":e,i},brighten:function(t){var e,n=this.rgba;if(this.stops)Pe(this.stops,function(e){e.brighten(t)});else if($(t)&&0!==t)for(e=0;e<3;e++)n[e]+=f(255*t),n[e]<0&&(n[e]=0),255<n[e]&&(n[e]=255);return this},setOpacity:function(e){return this.rgba[3]=e,this}},M.prototype={opacity:1,textProps:"direction,fontSize,fontWeight,fontFamily,fontStyle,color,lineHeight,width,textDecoration,textOverflow,textShadow".split(","),init:function(e,t){this.element="span"===t?S(t):ce.createElementNS(Te,t),this.renderer=e},animate:function(e,t,n){return t=Je(t,this.renderer.globalAnimation,!0),Ve(this),t?(t=I(t,{}),n&&(t.complete=n),Ye(this,e,t)):this.attr(e,null,n),this},colorGradient:function(e,t,n){var i,a,s,o,r,l,c,d,u,_,h,p,f=this.renderer,m=[];if(e.linearGradient?a="linearGradient":e.radialGradient&&(a="radialGradient"),a){for(h in s=e[a],r=f.gradients,c=e.stops,_=n.radialReference,A(s)&&(e[a]=s={x1:s[0],y1:s[1],x2:s[2],y2:s[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===a&&_&&!D(s.gradientUnits)&&(s=I(o=s,f.getRadialAttr(_,o),{gradientUnits:"userSpaceOnUse"})),s)"id"!==h&&m.push(h,s[h]);for(h in c)m.push(c[h]);r[m=m.join(",")]?_=r[m].attr("id"):(s.id=_="highcharts-"+Oe++,r[m]=l=f.createElement(a).attr(s).add(f.defs),l.radAttr=o,l.stops=[],Pe(c,function(e){0===e[1].indexOf("rgba")?(i=K(e[1]),d=i.get("rgb"),u=i.get("a")):(d=e[1],u=1),e=f.createElement("stop").attr({offset:e[0],"stop-color":d,"stop-opacity":u}).add(l),l.stops.push(e)})),p="url("+f.url+"#"+_+")",n.setAttribute(t,p),n.gradient=m,e.toString=function(){return p}}},applyTextShadow:function(e){var t,o=this.element,n=-1!==e.indexOf("contrast"),i={},a=this.renderer.forExport,s=a||o.style.textShadow!==P&&!we;n&&(i.textShadow=e=e.replace(/contrast/g,this.renderer.getContrast(o.style.fill))),(Ce||a)&&(i.textRendering="geometricPrecision"),s?this.css(i):(this.fakeTS=!0,this.ySetter=this.xSetter,t=[].slice.call(o.getElementsByTagName("tspan")),Pe(e.split(/\s?,\s?/g),function(e){var i,a,s=o.firstChild;e=e.split(" ");i=e[e.length-1],(a=e[e.length-2])&&Pe(t,function(e,t){var n;0===t&&(e.setAttribute("x",o.getAttribute("x")),t=o.getAttribute("y"),e.setAttribute("y",t||0),null===t&&o.setAttribute("y",0)),x(n=e.cloneNode(1),{"class":"highcharts-text-shadow",fill:i,stroke:i,"stroke-opacity":1/pe(f(a),3),"stroke-width":a,"stroke-linejoin":"round"}),o.insertBefore(n,s)})}))},attr:function(e,t,n){var i,a,s,o=this.element,r=this;if("string"==typeof e&&t!==P&&(i=e,(e={})[i]=t),"string"==typeof e)r=(this[e+"Getter"]||this._defaultGetter).call(this,e,o);else{for(i in e)t=e[i],s=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(i)&&(a||(this.symbolAttr(e),a=!0),s=!0),!this.rotation||"x"!==i&&"y"!==i||(this.doTransform=!0),s||((s=this[i+"Setter"]||this._defaultSetter).call(this,t,i,o),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(i)&&this.updateShadows(i,t,s));this.doTransform&&(this.updateTransform(),this.doTransform=!1)}return n&&n(),r},updateShadows:function(e,t,n){for(var i=this.shadows,a=i.length;a--;)n.call(null,"height"===e?Math.max(t-(i[a].cutHeight||0),0):"d"===e?this.d:t,e,i[a])},addClass:function(e){var t=this.element,n=x(t,"class")||"";return-1===n.indexOf(e)&&x(t,"class",n+" "+e),this},symbolAttr:function(t){var n=this;Pe("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(e){n[e]=Je(t[e],n[e])}),n.attr({d:n.renderer.symbols[n.symbolName](n.x,n.y,n.width,n.height,n)})},clip:function(e){return this.attr("clip-path",e?"url("+this.renderer.url+"#"+e.id+")":"none")},crisp:function(e){var t,n,i={},a=e.strokeWidth||this.strokeWidth||0;for(t in n=ue(a)%2/2,e.x=_e(e.x||this.x||0)+n,e.y=_e(e.y||this.y||0)+n,e.width=_e((e.width||this.width||0)-2*n),e.height=_e((e.height||this.height||0)-2*n),e.strokeWidth=a,e)this[t]!==e[t]&&(this[t]=i[t]=e[t]);return i},css:function(e){var t,n,i=this.styles,a={},s=this.element,o="";if(t=!i,e&&e.color&&(e.fill=e.color),i)for(n in e)e[n]!==i[n]&&(a[n]=e[n],t=!0);if(t){if(t=this.textWidth=e&&e.width&&"text"===s.nodeName.toLowerCase()&&f(e.width)||this.textWidth,i&&(e=Xe(i,a)),this.styles=e,t&&(Ie||!xe&&this.renderer.forExport)&&delete e.width,we&&!xe)O(this.element,e);else{for(n in i=function(e,t){return"-"+t.toLowerCase()},e)o+=n.replace(/([A-Z])/g,i)+":"+e[n]+";";x(s,"style",o)}t&&this.added&&this.renderer.buildText(this)}return this},on:function(e,t){var n=this,i=n.element;return U&&"click"===e?(i.ontouchstart=function(e){n.touchEventFired=z.now(),e.preventDefault(),t.call(i,e)},i.onclick=function(e){(-1===ye.indexOf("Android")||1100<z.now()-(n.touchEventFired||0))&&t.call(i,e)}):i["on"+e]=t,this},setRadialReference:function(e){var t=this.renderer.gradients[this.element.gradient];return this.element.radialReference=e,t&&t.radAttr&&t.animate(this.renderer.getRadialAttr(e,t.radAttr)),this},translate:function(e,t){return this.attr({translateX:e,translateY:t})},invert:function(){return this.inverted=!0,this.updateTransform(),this},updateTransform:function(){var e=this.translateX||0,t=this.translateY||0,n=this.scaleX,i=this.scaleY,a=this.inverted,s=this.rotation,o=this.element;a&&(e+=this.attr("width"),t+=this.attr("height")),e=["translate("+e+","+t+")"],a?e.push("rotate(90) scale(-1,1)"):s&&e.push("rotate("+s+" "+(o.getAttribute("x")||0)+" "+(o.getAttribute("y")||0)+")"),(D(n)||D(i))&&e.push("scale("+Je(n,1)+" "+Je(i,1)+")"),e.length&&o.setAttribute("transform",e.join(" "))},toFront:function(){var e=this.element;return e.parentNode.appendChild(e),this},align:function(e,t,n){var i,a,s,o,r={};return s=(a=this.renderer).alignedObjects,e?(this.alignOptions=e,this.alignByTranslate=t,(!n||g(n))&&(this.alignTo=i=n||"renderer",d(s,this),s.push(this),n=null)):(e=this.alignOptions,t=this.alignByTranslate,i=this.alignTo),n=Je(n,a[i],a),i=e.align,a=e.verticalAlign,s=(n.x||0)+(e.x||0),o=(n.y||0)+(e.y||0),"right"!==i&&"center"!==i||(s+=(n.width-(e.width||0))/{right:1,center:2}[i]),r[t?"translateX":"x"]=ue(s),"bottom"!==a&&"middle"!==a||(o+=(n.height-(e.height||0))/({bottom:1,middle:2}[a]||1)),r[t?"translateY":"y"]=ue(o),this[this.placed?"animate":"attr"](r),this.placed=!0,this.alignAttr=r,this},getBBox:function(e,t){var n,i,a,s,o=this.renderer,r=this.element,l=this.styles;i=this.textStr;var c,d,u,_=r.style,h=o.cache,p=o.cacheKeys;if(s=(a=Je(t,this.rotation))*be,i!==P&&(u=["",a||0,l&&l.fontSize,r.style.width].join(","),u=""===i||Fe.test(i)?"num:"+i.toString().length+u:i+u),u&&!e&&(n=h[u]),!n){if(r.namespaceURI===Te||o.forExport){try{d=this.fakeTS&&function(t){Pe(r.querySelectorAll(".highcharts-text-shadow"),function(e){e.style.display=t})},Ee&&_.textShadow?(c=_.textShadow,_.textShadow=""):d&&d("none"),n=r.getBBox?Xe({},r.getBBox()):{width:r.offsetWidth,height:r.offsetHeight},c?_.textShadow=c:d&&d("")}catch(f){}(!n||n.width<0)&&(n={width:0,height:0})}else n=this.htmlGetBBox();if(o.isSVG&&(o=n.width,i=n.height,we&&l&&"11px"===l.fontSize&&"16.9"===i.toPrecision(3)&&(n.height=i=14),a&&(n.width=me(i*Ae(s))+me(o*ge(s)),n.height=me(i*ge(s))+me(o*Ae(s)))),u){for(;250<p.length;)delete h[p.shift()];h[u]||p.push(u),h[u]=n}}return n},show:function(e){return this.attr({visibility:e?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(e){var t=this;t.animate({opacity:0},{duration:e||150,complete:function(){t.attr({y:-9999})}})},add:function(e){var t,n=this.renderer,i=this.element;return e&&(this.parentGroup=e),this.parentInverted=e&&e.inverted,void 0!==this.textStr&&n.buildText(this),this.added=!0,(!e||e.handleZ||this.zIndex)&&(t=this.zIndexSetter()),t||(e?e.element:n.box).appendChild(i),this.onAdd&&this.onAdd(),this},safeRemoveChild:function(e){var t=e.parentNode;t&&t.removeChild(e)},destroy:function(){var e,t,n=this,i=n.element||{},a=n.shadows,s=n.renderer.isSVG&&"SPAN"===i.nodeName&&n.parentGroup;if(i.onclick=i.onmouseout=i.onmouseover=i.onmousemove=i.point=null,Ve(n),n.clipPath&&(n.clipPath=n.clipPath.destroy()),n.stops){for(t=0;t<n.stops.length;t++)n.stops[t]=n.stops[t].destroy();n.stops=null}for(n.safeRemoveChild(i),a&&Pe(a,function(e){n.safeRemoveChild(e)});s&&s.div&&0===s.div.childNodes.length;)i=s.parentGroup,n.safeRemoveChild(s.div),delete s.div,s=i;for(e in n.alignTo&&d(n.renderer.alignedObjects,n),n)delete n[e];return null},shadow:function(e,t,n){var i,a,s,o,r,l,c=[],d=this.element;if(e){for(o=Je(e.width,3),r=(e.opacity||.15)/o,l=this.parentInverted?"(-1,-1)":"("+Je(e.offsetX,1)+", "+Je(e.offsetY,1)+")",i=1;i<=o;i++)s=2*o+1-2*i,x(a=d.cloneNode(0),{isShadow:"true",stroke:e.color||"black","stroke-opacity":r*i,"stroke-width":s,transform:"translate"+l,fill:"none"}),n&&(x(a,"height",pe(x(a,"height")-s,0)),a.cutHeight=s),t?t.element.appendChild(a):d.parentNode.insertBefore(a,d),c.push(a);this.shadows=c}return this},xGetter:function(e){return"circle"===this.element.nodeName&&(e={x:"cx",y:"cy"}[e]||e),this._defaultGetter(e)},_defaultGetter:function(e){return e=Je(this[e],this.element?this.element.getAttribute(e):null,0),/^[\-0-9\.]+$/.test(e)&&(e=parseFloat(e)),e},dSetter:function(e,t,n){e&&e.join&&(e=e.join(" ")),/(NaN| {2}|^$)/.test(e)&&(e="M 0 0"),n.setAttribute(t,e),this[t]=e},dashstyleSetter:function(e){var t;if(e=e&&e.toLowerCase()){for(t=(e=e.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",")).length;t--;)e[t]=f(e[t])*this["stroke-width"];e=e.join(",").replace("NaN","none"),this.element.setAttribute("stroke-dasharray",e)}},alignSetter:function(e){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[e])},opacitySetter:function(e,t,n){this[t]=e,n.setAttribute(t,e)},titleSetter:function(e){var t=this.element.getElementsByTagName("title")[0];t||(t=ce.createElementNS(Te,"title"),this.element.appendChild(t)),t.appendChild(ce.createTextNode(String(Je(e),"").replace(/<[^>]*>/g,"")))},textSetter:function(e){e!==this.textStr&&(delete this.bBox,this.textStr=e,this.added&&this.renderer.buildText(this))},fillSetter:function(e,t,n){"string"==typeof e?n.setAttribute(t,e):e&&this.colorGradient(e,t,n)},visibilitySetter:function(e,t,n){"inherit"===e?n.removeAttribute(t):n.setAttribute(t,e)},zIndexSetter:function(e,t){var n,i,a,s,o=this.renderer,r=this.parentGroup,l=(o=(r||o).element||o.box,this.element);if(n=this.added,D(e)&&(l.setAttribute(t,e),e=+e,this[t]===e&&(n=!1),this[t]=e),n){for((e=this.zIndex)&&r&&(r.handleZ=!0),r=o.childNodes,s=0;s<r.length&&!a;s++)i=x(n=r[s],"zIndex"),n!==l&&(f(i)>e||!D(e)&&D(i))&&(o.insertBefore(l,n),a=!0);a||o.appendChild(l)}return a},_defaultSetter:function(e,t,n){n.setAttribute(t,e)}},M.prototype.yGetter=M.prototype.xGetter,M.prototype.translateXSetter=M.prototype.translateYSetter=M.prototype.rotationSetter=M.prototype.verticalAlignSetter=M.prototype.scaleXSetter=M.prototype.scaleYSetter=function(e,t){this[t]=e,this.doTransform=!0},M.prototype["stroke-widthSetter"]=M.prototype.strokeSetter=function(e,t,n){this[t]=e,this.stroke&&this["stroke-width"]?(this.strokeWidth=this["stroke-width"],M.prototype.fillSetter.call(this,this.stroke,"stroke",n),n.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===t&&0===e&&this.hasStroke&&(n.removeAttribute("stroke"),this.hasStroke=!1)};var nt,it,at=function(){this.init.apply(this,arguments)};if(at.prototype={Element:M,init:function(e,t,n,i,a,s){var o,r;o=(i=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(i))).element,e.appendChild(o),-1===e.innerHTML.indexOf("xmlns")&&x(o,"xmlns",Te),this.isSVG=!0,this.box=o,this.boxWrapper=i,this.alignedObjects=[],this.url=(Ee||Ce)&&ce.getElementsByTagName("base").length?l.location.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"",this.createElement("desc").add().element.appendChild(ce.createTextNode("Created with Highcharts 4.2.2")),this.defs=this.createElement("defs").add(),this.allowHTML=s,this.forExport=a,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(t,n,!1),Ee&&e.getBoundingClientRect&&(this.subPixelFix=t=function(){O(e,{left:0,top:0}),r=e.getBoundingClientRect(),O(e,{left:he(r.left)-r.left+"px",top:he(r.top)-r.top+"px"})},t(),ze(l,"resize",t))},getStyle:function(e){return this.style=Xe({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},e)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var e=this.defs;return this.box=null,this.boxWrapper=this.boxWrapper.destroy(),s(this.gradients||{}),this.gradients=null,e&&(this.defs=e.destroy()),this.subPixelFix&&qe(l,"resize",this.subPixelFix),this.alignedObjects=null},createElement:function(e){var t=new this.Element;return t.init(this,e),t},draw:function(){},getRadialAttr:function(e,t){return{cx:e[0]-e[2]/2+t.cx*e[2],cy:e[1]-e[2]/2+t.cy*e[2],r:t.r*e[2]}},buildText:function(m){for(var g,A,v=m.element,b=this,y=b.forExport,e=Je(m.textStr,"").toString(),t=-1!==e.indexOf("<"),n=v.childNodes,$=x(v,"x"),w=m.styles,k=m.textWidth,i=w&&w.lineHeight,a=w&&w.textShadow,C=w&&"ellipsis"===w.textOverflow,s=n.length,o=k&&!m.added&&this.box,E=function(e){return i?f(i):b.fontMetrics(/(px|em)$/.test(e&&e.style.fontSize)?e.style.fontSize:w&&w.fontSize||b.style.fontSize||12,e).h},T=function(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">")};s--;)v.removeChild(n[s]);t||a||C||-1!==e.indexOf(" ")?(g=/<.*style="([^"]+)".*>/,A=/<.*href="(http[^"]+)".*>/,o&&o.appendChild(v),""===(e=t?e.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[e])[e.length-1]&&e.pop(),Pe(e,function(e,h){var p,f=0;e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");p=e.split("|||"),Pe(p,function(e){if(""!==e||1===p.length){var t,n={},i=ce.createElementNS(Te,"tspan");if(g.test(e)&&x(i,"style",t=e.match(g)[1].replace(/(;| |^)color([ :])/,"$1fill$2")),A.test(e)&&!y&&(x(i,"onclick",'location.href="'+e.match(A)[1]+'"'),O(i,{cursor:"pointer"}))," "!==(e=T(e.replace(/<(.|\n)*?>/g,"")||" "))){if(i.appendChild(ce.createTextNode(e)),f?n.dx=0:h&&null!==$&&(n.x=$),x(i,n),v.appendChild(i),!f&&h&&(!xe&&y&&O(i,{display:"block"}),x(i,"dy",E(i))),k){n=e.replace(/([^\^])-/g,"$1- ").split(" ");for(var a,s,o,r=1<p.length||h||1<n.length&&"nowrap"!==w.whiteSpace,l=[],c=E(i),d=m.rotation,u=e,_=u.length;(r||C)&&(n.length||l.length);
)m.rotation=0,o=(a=m.getBBox(!0)).width,!xe&&b.forExport&&(o=b.measureSpanWidth(i.firstChild.data,m.styles)),a=k<o,void 0===s&&(s=a),C&&s?(_/=2,""===u||!a&&_<.5?n=[]:(a&&(s=!0),n=[(u=e.substring(0,u.length+(a?-1:1)*he(_)))+(3<k?"\u2026":"")],i.removeChild(i.firstChild))):a&&1!==n.length?(i.removeChild(i.firstChild),l.unshift(n.pop())):(n=l,l=[],n.length&&(0,x(i=ce.createElementNS(Te,"tspan"),{dy:c,x:$}),t&&x(i,"style",t),v.appendChild(i)),k<o&&(k=o)),n.length&&i.appendChild(ce.createTextNode(n.join(" ").replace(/- /g,"-")));s&&m.attr("title",m.textStr),m.rotation=d}f++}}})}),o&&o.removeChild(v),a&&m.applyTextShadow&&m.applyTextShadow(a)):v.appendChild(ce.createTextNode(T(e)))},getContrast:function(e){return 384<(e=K(e).rgba)[0]+e[1]+e[2]?"#000000":"#FFFFFF"},button:function(e,t,n,i,a,s,o,r,l){var c,d,u,_,h,p,f=this.label(e,t,n,l,null,null,null,null,"button"),m=0;a=I({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:e={x1:0,y1:0,x2:0,y2:1},stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},a);return u=a.style,delete a.style,s=I(a,{stroke:"#68A",fill:{linearGradient:e,stops:[[0,"#FFF"],[1,"#ACF"]]}},s),_=s.style,delete s.style,o=I(a,{stroke:"#68A",fill:{linearGradient:e,stops:[[0,"#9BD"],[1,"#CDF"]]}},o),h=o.style,delete o.style,r=I(a,{style:{color:"#CCC"}},r),p=r.style,delete r.style,ze(f.element,we?"mouseover":"mouseenter",function(){3!==m&&f.attr(s).css(_)}),ze(f.element,we?"mouseout":"mouseleave",function(){3!==m&&(c=[a,s,o][m],d=[u,_,h][m],f.attr(c).css(d))}),f.setState=function(e){(f.state=m=e)?2===e?f.attr(o).css(h):3===e&&f.attr(r).css(p):f.attr(a).css(u)},f.on("click",function(e){3!==m&&i.call(f,e)}).attr(a).css(Xe({cursor:"default"},u))},crispLine:function(e,t){return e[1]===e[4]&&(e[1]=e[4]=ue(e[1])-t%2/2),e[2]===e[5]&&(e[2]=e[5]=ue(e[2])+t%2/2),e},path:function(e){var t={fill:"none"};return A(e)?t.d=e:_(e)&&Xe(t,e),this.createElement("path").attr(t)},circle:function(e,t,n){return e=_(e)?e:{x:e,y:t,r:n},(t=this.createElement("circle")).xSetter=t.ySetter=function(e,t,n){n.setAttribute("c"+t,e)},t.attr(e)},arc:function(e,t,n,i,a,s){return _(e)&&(t=e.y,n=e.r,i=e.innerR,a=e.start,s=e.end,e=e.x),(e=this.symbol("arc",e||0,t||0,n||0,n||0,{innerR:i||0,start:a||0,end:s||0})).r=n,e},rect:function(e,t,n,i,a,s){a=_(e)?e.r:a;var o=this.createElement("rect");e=_(e)?e:e===P?{}:{x:e,y:t,width:pe(n,0),height:pe(i,0)};return s!==P&&(e.strokeWidth=s,e=o.crisp(e)),a&&(e.r=a),o.rSetter=function(e){x(this.element,{rx:e,ry:e})},o.attr(e)},setSize:function(e,t,n){var i=this.alignedObjects,a=i.length;for(this.width=e,this.height=t,this.boxWrapper[Je(n,!0)?"animate":"attr"]({width:e,height:t});a--;)i[a].align()},g:function(e){var t=this.createElement("g");return D(e)?t.attr({"class":"highcharts-"+e}):t},image:function(e,t,n,i,a){var s={preserveAspectRatio:"none"};return 1<arguments.length&&Xe(s,{x:t,y:n,width:i,height:a}),(s=this.createElement("image").attr(s)).element.setAttributeNS?s.element.setAttributeNS("http://www.w3.org/1999/xlink","href",e):s.element.setAttribute("hc-svg-href",e),s},symbol:function(e,t,n,i,a,s){var o,r,l,c,d=this,u=/^url\((.*?)\)$/;return(r=(r=this.symbols[e])&&r(ue(t),ue(n),i,a,s))?(o=this.path(r),Xe(o,{symbolName:e,x:t,y:n,width:i,height:a}),s&&Xe(o,s)):u.test(e)&&(c=function(e,t){e.element&&(e.attr({width:t[0],height:t[1]}),e.alignByTranslate||e.translate(ue((i-t[0])/2),ue((a-t[1])/2)))},l=e.match(u)[1],e=De[l]||s&&s.width&&s.height&&[s.width,s.height],(o=this.image(l).attr({x:t,y:n})).isImg=!0,e?c(o,e):(o.attr({width:0,height:0}),S("img",{onload:function(){0===this.width&&(O(this,{position:"absolute",top:"-999em"}),ce.body.appendChild(this)),c(o,De[l]=[this.width,this.height]),this.parentNode&&this.parentNode.removeChild(this),d.imgCount--,d.imgCount||Re[d.chartIndex].onload()},src:l})),this.imgCount++),o},symbols:{circle:function(e,t,n,i){var a=.166*n;return["M",e+n/2,t,"C",e+n+a,t,e+n+a,t+i,e+n/2,t+i,"C",e-a,t+i,e-a,t,e+n/2,t,"Z"]},square:function(e,t,n,i){return["M",e,t,"L",e+n,t,e+n,t+i,e,t+i,"Z"]},triangle:function(e,t,n,i){return["M",e+n/2,t,"L",e+n,t+i,e,t+i,"Z"]},"triangle-down":function(e,t,n,i){return["M",e,t,"L",e+n,t,e+n/2,t+i,"Z"]},diamond:function(e,t,n,i){return["M",e+n/2,t,"L",e+n,t+i/2,e+n/2,t+i,e,t+i/2,"Z"]},arc:function(e,t,n,i,a){var s=a.start,o=(n=a.r||n||i,a.end-.001),r=(i=a.innerR,a.open),l=ge(s),c=Ae(s),d=ge(o);o=Ae(o);return["M",e+n*l,t+n*c,"A",n,n,0,a=a.end-s<ve?0:1,1,e+n*d,t+n*o,r?"M":"L",e+i*d,t+i*o,"A",i,i,0,a,0,e+i*l,t+i*c,r?"":"Z"]},callout:function(e,t,n,i,a){var s,o=fe(a&&a.r||0,n,i),r=o+6,l=a&&a.anchorX;a=a&&a.anchorY;return s=["M",e+o,t,"L",e+n-o,t,"C",e+n,t,e+n,t,e+n,t+o,"L",e+n,t+i-o,"C",e+n,t+i,e+n,t+i,e+n-o,t+i,"L",e+o,t+i,"C",e,t+i,e,t+i,e,t+i-o,"L",e,t+o,"C",e,t,e,t,e+o,t],l&&n<l&&t+r<a&&a<t+i-r?s.splice(13,3,"L",e+n,a-6,e+n+6,a,e+n,a+6,e+n,t+i-o):l&&l<0&&t+r<a&&a<t+i-r?s.splice(33,3,"L",e,a+6,e-6,a,e,a-6,e,t+o):a&&i<a&&e+r<l&&l<e+n-r?s.splice(23,3,"L",l+6,t+i,l,t+i+6,l-6,t+i,e+o,t+i):a&&a<0&&e+r<l&&l<e+n-r&&s.splice(3,3,"L",l-6,t,l,t-6,l+6,t,n-o,t),s}},clipRect:function(e,t,n,i){var a="highcharts-"+Oe++,s=this.createElement("clipPath").attr({id:a}).add(this.defs);return(e=this.rect(e,t,n,i,0).add(s)).id=a,e.clipPath=s,e.count=0,e},text:function(e,t,n,i){var a=Ie||!xe&&this.forExport,s={};return!i||!this.allowHTML&&this.forExport?(s.x=Math.round(t||0),n&&(s.y=Math.round(n)),(e||0===e)&&(s.text=e),e=this.createElement("text").attr(s),a&&e.css({position:"absolute"}),i||(e.xSetter=function(e,t,n){var i,a,s=n.getElementsByTagName("tspan"),o=n.getAttribute(t);for(a=0;a<s.length;a++)(i=s[a]).getAttribute(t)===o&&i.setAttribute(t,e);n.setAttribute(t,e)}),e):this.html(e,t,n)},fontMetrics:function(e,t){var n;return!(e=e||this.style.fontSize)&&t&&l.getComputedStyle&&(t=t.element||t,e=(n=l.getComputedStyle(t,""))&&n.fontSize),{h:n=(e=/px/.test(e)?f(e):/em/.test(e)?12*parseFloat(e):12)<24?e+3:ue(1.2*e),b:ue(.8*n),f:e}},rotCorr:function(e,t,n){var i=e;return t&&n&&(i=pe(i*ge(t*be),4)),{x:-e/3*Ae(t*be),y:i}},label:function(e,t,n,i,a,s,o,r,l){var c,d,u,_,h,p,f,m,g,A,v,b=this,y=b.g(l),$=b.text("",0,0,o).attr({zIndex:1}),w=0,k=3,C=0,E=0,T={};g=function(){var e,t;e=$.element.style,d=(void 0===u||void 0===_||y.styles.textAlign)&&D($.textStr)&&$.getBBox(),y.width=(u||d.width||0)+2*k+C,y.height=(_||d.height||0)+2*k,f=k+b.fontMetrics(e&&e.fontSize,$).b,m&&(c||(t=(r?-f:0)+(e=E),y.box=c=i?b.symbol(i,e,t,y.width,y.height,T):b.rect(e,t,y.width,y.height,0,T["stroke-width"]),c.isImg||c.attr("fill","none"),c.add(y)),c.isImg||c.attr(Xe({width:ue(y.width),height:ue(y.height)},T)),T=null)},A=function(){var e,t=(t=y.styles)&&t.textAlign,n=C+k;e=r?0:f,D(u)&&d&&("center"===t||"right"===t)&&(n+={center:.5,right:1}[t]*(u-d.width)),n===$.x&&e===$.y||($.attr("x",n),e!==P&&$.attr("y",e)),$.x=n,$.y=e},v=function(e,t){c?c.attr(e,t):T[e]=t},y.onAdd=function(){$.add(y),y.attr({text:e||0===e?e:"",x:t,y:n}),c&&D(a)&&y.attr({anchorX:a,anchorY:s})},y.widthSetter=function(e){u=e},y.heightSetter=function(e){_=e},y.paddingSetter=function(e){D(e)&&e!==k&&(k=y.padding=e,A())},y.paddingLeftSetter=function(e){D(e)&&e!==C&&(C=e,A())},y.alignSetter=function(e){(e={left:0,center:.5,right:1}[e])!==w&&(w=e,d&&y.attr({x:t}))},y.textSetter=function(e){e!==P&&$.textSetter(e),g(),A()},y["stroke-widthSetter"]=function(e,t){e&&(m=!0),E=e%2/2,v(t,e)},y.strokeSetter=y.fillSetter=y.rSetter=function(e,t){"fill"===t&&e&&(m=!0),v(t,e)},y.anchorXSetter=function(e,t){v(t,ue(a=e)-E-h)},y.anchorYSetter=function(e,t){v(t,(s=e)-p)},y.xSetter=function(e){y.x=e,w&&(e-=w*((u||d.width)+2*k)),h=ue(e),y.attr("translateX",h)},y.ySetter=function(e){p=y.y=ue(e),y.attr("translateY",p)};var x=y.css;return Xe(y,{css:function(t){if(t){var n={};t=I(t);Pe(y.textProps,function(e){t[e]!==P&&(n[e]=t[e],delete t[e])}),$.css(n)}return x.call(y,t)},getBBox:function(){return{width:d.width+2*k,height:d.height+2*k,x:d.x-k,y:d.y-k}},shadow:function(e){return c&&c.shadow(e),y},destroy:function(){qe(y.element,"mouseenter"),qe(y.element,"mouseleave"),$&&($=$.destroy()),c&&(c=c.destroy()),M.prototype.destroy.call(y),y=b=g=A=v=null}})}},r=at,Xe(M.prototype,{htmlCss:function(e){var t=this.element;return(t=e&&"SPAN"===t.tagName&&e.width)&&(delete e.width,this.textWidth=t,this.updateTransform()),e&&"ellipsis"===e.textOverflow&&(e.whiteSpace="nowrap",e.overflow="hidden"),this.styles=Xe(this.styles,e),O(this.element,e),this},htmlGetBBox:function(){var e=this.element;return"text"===e.nodeName&&(e.style.position="absolute"),{x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var t=this.renderer,n=this.element,i=this.translateX||0,a=this.translateY||0,e=this.x||0,s=this.y||0,o=this.textAlign||"left",r={left:0,center:.5,right:1}[o],l=this.shadows,c=this.styles;if(O(n,{marginLeft:i,marginTop:a}),l&&Pe(l,function(e){O(e,{marginLeft:i+1,marginTop:a+1})}),this.inverted&&Pe(n.childNodes,function(e){t.invertChild(e,n)}),"SPAN"===n.tagName){l=this.rotation;var d=f(this.textWidth),u=c&&c.whiteSpace,_=[l,o,n.innerHTML,this.textWidth,this.textAlign].join(",");_!==this.cTT&&(c=t.fontMetrics(n.style.fontSize).b,D(l)&&this.setSpanRotation(l,r,c),n.offsetWidth>d&&/[ \-]/.test(n.textContent||n.innerText)?(O(n,{width:d+"px",display:"block",whiteSpace:u||"normal"}),this.hasTextWidth=!0):this.hasTextWidth&&(O(n,{width:"",display:"",whiteSpace:u||"nowrap"}),this.hasTextWidth=!1),this.getSpanCorrection(this.hasTextWidth?d:n.offsetWidth,c,r,l,o)),O(n,{left:e+(this.xCorr||0)+"px",top:s+(this.yCorr||0)+"px"}),Ce&&(c=n.offsetHeight),this.cTT=_}}else this.alignOnAdd=!0},setSpanRotation:function(e,t,n){var i={},a=we?"-ms-transform":Ce?"-webkit-transform":Ee?"MozTransform":$e?"-o-transform":"";i[a]=i.transform="rotate("+e+"deg)",i[a+(Ee?"Origin":"-origin")]=i.transformOrigin=100*t+"% "+n+"px",O(this.element,i)},getSpanCorrection:function(e,t,n){this.xCorr=-e*n,this.yCorr=-t}}),Xe(at.prototype,{html:function(e,t,n){var i=this.createElement("span"),s=i.element,o=i.renderer,r=function(t,a){Pe(["opacity","visibility"],function(e){Ze(t,e+"Setter",function(e,t,n,i){e.call(this,t,n,i),a[n]=t})})};return i.textSetter=function(e){e!==s.innerHTML&&delete this.bBox,s.innerHTML=this.textStr=e,i.htmlUpdateTransform()},r(i,i.element.style),i.xSetter=i.ySetter=i.alignSetter=i.rotationSetter=function(e,t){"align"===t&&(t="textAlign"),i[t]=e,i.htmlUpdateTransform()},i.attr({text:e,x:ue(t),y:ue(n)}).css({position:"absolute",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize}),s.style.whiteSpace="nowrap",i.css=i.htmlCss,o.isSVG&&(i.add=function(e){var t,a=o.box.parentNode,n=[];if(this.parentGroup=e){if(!(t=e.div)){for(;e;)n.push(e),e=e.parentGroup;Pe(n.reverse(),function(n){var i,e=x(n.element,"class");e&&(e={className:e}),t=n.div=n.div||S(Ne,e,{position:"absolute",left:(n.translateX||0)+"px",top:(n.translateY||0)+"px"},t||a),i=t.style,Xe(n,{translateXSetter:function(e,t){i.left=e+"px",n[t]=e,n.doTransform=!0},translateYSetter:function(e,t){i.top=e+"px",n[t]=e,n.doTransform=!0}}),r(n,i)})}}else t=a;return t.appendChild(s),i.added=!0,i.alignOnAdd&&i.htmlUpdateTransform(),i}),i}}),!xe&&!Ie){(nt={init:function(e,t){var n=["<",t,' filled="f" stroked="f"'],i=["position: ","absolute",";"],a=t===Ne;("shape"===t||a)&&i.push("left:0;top:0;width:1px;height:1px;"),i.push("visibility: ",a?"hidden":"visible"),n.push(' style="',i.join(""),'"/>'),t&&(n=a||"span"===t||"img"===t?n.join(""):e.prepVML(n),this.element=S(n)),this.renderer=e},add:function(e){var t=this.renderer,n=this.element,i=t.box,a=e&&e.inverted;i=e?e.element||e:i;return e&&(this.parentGroup=e),a&&t.invertChild(n,i),i.appendChild(n),this.added=!0,this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform(),this.onAdd&&this.onAdd(),this},updateTransform:M.prototype.htmlUpdateTransform,setSpanRotation:function(){var e=this.rotation,t=ge(e*be),n=Ae(e*be);O(this.element,{filter:e?["progid:DXImageTransform.Microsoft.Matrix(M11=",t,", M12=",-n,", M21=",n,", M22=",t,", sizingMethod='auto expand')"].join(""):"none"})},getSpanCorrection:function(e,t,n,i,a){var s,o=i?ge(i*be):1,r=i?Ae(i*be):0,l=Je(this.elemHeight,this.element.offsetHeight);this.xCorr=o<0&&-e,this.yCorr=r<0&&-l,s=o*r<0,this.xCorr+=r*t*(s?1-n:n),this.yCorr-=o*t*(i?s?n:1-n:1),a&&"left"!==a&&(this.xCorr-=e*n*(o<0?-1:1),i&&(this.yCorr-=l*n*(r<0?-1:1)),O(this.element,{textAlign:a}))},pathToVML:function(e){for(var t=e.length,n=[];t--;)$(e[t])?n[t]=ue(10*e[t])-5:"Z"===e[t]?n[t]="x":(n[t]=e[t],!e.isArc||"wa"!==e[t]&&"at"!==e[t]||(n[t+5]===n[t+7]&&(n[t+7]+=e[t+7]>e[t+5]?1:-1),n[t+6]===n[t+8]&&(n[t+8]+=e[t+8]>e[t+6]?1:-1)));return n.join(" ")||"x"},clip:function(e){var t,n=this;return e?(d(t=e.members,n),t.push(n),n.destroyClip=function(){d(t,n)},e=e.getCSS(n)):(n.destroyClip&&n.destroyClip(),e={clip:ke?"inherit":"rect(auto)"}),n.css(e)},css:M.prototype.htmlCss,safeRemoveChild:function(e){e.parentNode&&o(e)},destroy:function(){return this.destroyClip&&this.destroyClip(),M.prototype.destroy.apply(this)},on:function(e,t){return this.element["on"+e]=function(){var e=l.event;e.target=e.srcElement,t(e)},this},cutOffPath:function(e,t){var n;return 9!==(n=(e=e.split(/[ ,]/)).length)&&11!==n||(e[n-4]=e[n-2]=f(e[n-2])-10*t),e.join(" ")},shadow:function(e,t,n){var i,a,s,o,r,l,c,d=[],u=this.element,_=this.renderer,h=u.style,p=u.path;if(p&&"string"!=typeof p.value&&(p="x"),r=p,e){for(l=Je(e.width,3),c=(e.opacity||.15)/l,i=1;i<=3;i++)o=2*l+1-2*i,n&&(r=this.cutOffPath(p.value,o+.5)),s=['<shape isShadow="true" strokeweight="',o,'" filled="false" path="',r,'" coordsize="10 10" style="',u.style.cssText,'" />'],a=S(_.prepVML(s),null,{left:f(h.left)+Je(e.offsetX,1),top:f(h.top)+Je(e.offsetY,1)}),n&&(a.cutOff=o+1),s=['<stroke color="',e.color||"black",'" opacity="',c*i,'"/>'],S(_.prepVML(s),null,null,a),t?t.element.appendChild(a):u.parentNode.insertBefore(a,u),d.push(a);this.shadows=d}return this},updateShadows:Se,setAttr:function(e,t){ke?this.element[e]=t:this.element.setAttribute(e,t)},classSetter:function(e){this.element.className=e},dashstyleSetter:function(e,t,n){(n.getElementsByTagName("stroke")[0]||S(this.renderer.prepVML(["<stroke/>"]),null,null,n))[t]=e||"solid",this[t]=e},dSetter:function(e,t,n){var i=this.shadows;e=e||[];if(this.d=e.join&&e.join(" "),n.path=e=this.pathToVML(e),i)for(n=i.length;n--;)i[n].path=i[n].cutOff?this.cutOffPath(e,i[n].cutOff):e;this.setAttr(t,e)},fillSetter:function(e,t,n){var i=n.nodeName;"SPAN"===i?n.style.color=e:"IMG"!==i&&(n.filled="none"!==e,this.setAttr("fillcolor",this.renderer.color(e,n,t,this)))},"fill-opacitySetter":function(e,t,n){S(this.renderer.prepVML(["<",t.split("-")[0],' opacity="',e,'"/>']),null,null,n)},opacitySetter:Se,rotationSetter:function(e,t,n){n=n.style,this[t]=n[t]=e,n.left=-ue(Ae(e*be)+1)+"px",n.top=ue(ge(e*be))+"px"},strokeSetter:function(e,t,n){this.setAttr("strokecolor",this.renderer.color(e,n,t,this))},"stroke-widthSetter":function(e,t,n){n.stroked=!!e,$(this[t]=e)&&(e+="px"),this.setAttr("strokeweight",e)},titleSetter:function(e,t){this.setAttr(t,e)},visibilitySetter:function(t,n,e){"inherit"===t&&(t="visible"),this.shadows&&Pe(this.shadows,function(e){e.style[n]=t}),"DIV"===e.nodeName&&(t="hidden"===t?"-999em":0,ke||(e.style[n]=t?"visible":"hidden"),n="top"),e.style[n]=t},xSetter:function(e,t,n){this[t]=e,"x"===t?t="left":"y"===t&&(t="top"),this.updateClipping?(this[t]=e,this.updateClipping()):n.style[t]=e},zIndexSetter:function(e,t,n){n.style[t]=e}})["stroke-opacitySetter"]=nt["fill-opacitySetter"],le.VMLElement=nt=e(M,nt),nt.prototype.ySetter=nt.prototype.widthSetter=nt.prototype.heightSetter=nt.prototype.xSetter;var st={Element:nt,isIE8:-1<ye.indexOf("MSIE 8.0"),init:function(e,t,n,i){var a;if(this.alignedObjects=[],a=(i=this.createElement(Ne).css(Xe(this.getStyle(i),{position:"relative"}))).element,e.appendChild(i.element),this.isVML=!0,this.box=a,this.boxWrapper=i,this.gradients={},this.cache={},this.cacheKeys=[],this.imgCount=0,this.setSize(t,n,!1),!ce.namespaces.hcv){ce.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{ce.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(s){ce.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(e,t,n,i){var a=this.createElement(),s=_(e);return Xe(a,{members:[],count:0,left:(s?e.x:e)+1,top:(s?e.y:t)+1,width:(s?e.width:n)-1,height:(s?e.height:i)-1,getCSS:function(e){var t=(a=e.element).nodeName,n=(e=e.inverted,this.top-("shape"===t?a.offsetTop:0)),i=this.left,a=i+this.width,s=n+this.height;n={clip:"rect("+ue(e?i:n)+"px,"+ue(e?s:a)+"px,"+ue(e?a:s)+"px,"+ue(e?n:i)+"px)"};return!e&&ke&&"DIV"===t&&Xe(n,{width:a+"px",height:s+"px"}),n},updateClipping:function(){Pe(a.members,function(e){e.element&&e.css(a.getCSS(e))})}})},color:function(e,t,n,i){var a,s,o,r=this,l=/^rgba/,c="none";if(e&&e.linearGradient?o="gradient":e&&e.radialGradient&&(o="pattern"),o){var d,u,_,h,p,f,m,g,A=e.linearGradient||e.radialGradient,v="",b=(e=e.stops,[]),y=function(){s=['<fill colors="'+b.join(",")+'" opacity="',p,'" o:opacity2="',h,'" type="',o,'" ',v,'focus="100%" method="any" />'],S(r.prepVML(s),null,null,t)};if(_=e[0],g=e[e.length-1],0<_[0]&&e.unshift([0,_[1]]),g[0]<1&&e.push([1,g[1]]),Pe(e,function(e,t){l.test(e[1])?(a=K(e[1]),d=a.get("rgb"),u=a.get("a")):(d=e[1],u=1),b.push(100*e[0]+"% "+d),t?(p=u,f=d):(h=u,m=d)}),"fill"===n)if("gradient"===o)n=A.x1||A[0]||0,e=A.y1||A[1]||0,_=A.x2||A[2]||0,A=A.y2||A[3]||0,v='angle="'+(90-180*de.atan((A-e)/(_-n))/ve)+'"',y();else{var $,w=2*(c=A.r),k=2*c,C=A.cx,E=A.cy,T=t.radialReference;c=function(){T&&($=i.getBBox(),C+=(T[0]-$.x)/$.width-.5,E+=(T[1]-$.y)/$.height-.5,w*=T[2]/$.width,k*=T[2]/$.height),v='src="'+H.global.VMLRadialGradientURL+'" size="'+w+","+k+'" origin="0.5,0.5" position="'+C+","+E+'" color2="'+m+'" ',y()};i.added?c():i.onAdd=c,c=f}else c=d}else l.test(e)&&"IMG"!==t.tagName?(a=K(e),i[n+"-opacitySetter"](a.get("a"),n,t),c=a.get("rgb")):((c=t.getElementsByTagName(n)).length&&(c[0].opacity=1,c[0].type="solid"),c=e);return c},prepVML:function(e){var t=this.isIE8;e=e.join("");return t?e=-1===(e=e.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />')).indexOf('style="')?e.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):e.replace('style="','style="display:inline-block;behavior:url(#default#VML);'):e=e.replace("<","<hcv:"),e},text:at.prototype.html,path:function(e){var t={coordsize:"10 10"};return A(e)?t.d=e:_(e)&&Xe(t,e),this.createElement("shape").attr(t)},circle:function(e,t,n){var i=this.symbol("circle");return _(e)&&(n=e.r,t=e.y,e=e.x),i.isCircle=!0,i.r=n,i.attr({x:e,y:t})},g:function(e){var t;return e&&(t={className:"highcharts-"+e,"class":"highcharts-"+e}),this.createElement(Ne).attr(t)},image:function(e,t,n,i,a){var s=this.createElement("img").attr({src:e});return 1<arguments.length&&s.attr({x:t,y:n,width:i,height:a}),s},createElement:function(e){return"rect"===e?this.symbol(e):at.prototype.createElement.call(this,e)},invertChild:function(t,e){var n=this,i=e.style,a="IMG"===t.tagName&&t.style;O(t,{flip:"x",left:f(i.width)-(a?f(a.top):1),top:f(i.height)-(a?f(a.left):1),rotation:-90}),Pe(t.childNodes,function(e){n.invertChild(e,t)})},symbols:{arc:function(e,t,n,i,a){var s=a.start,o=a.end,r=a.r||n||i,l=(n=a.innerR,i=ge(s),Ae(s)),c=ge(o),d=Ae(o);return o-s==0?["x"]:(s=["wa",e-r,t-r,e+r,t+r,e+r*i,t+r*l,e+r*c,t+r*d],a.open&&!n&&s.push("e","M",e,t),s.push("at",e-n,t-n,e+n,t+n,e+n*c,t+n*d,e+n*i,t+n*l,"x","e"),s.isArc=!0,s)},circle:function(e,t,n,i,a){return a&&(n=i=2*a.r),a&&a.isCircle&&(e-=n/2,t-=i/2),["wa",e,t,e+n,t+i,e+n,t+i/2,e+n,t+i/2,"e"]},rect:function(e,t,n,i,a){return at.prototype.symbols[D(a)&&a.r?"callout":"square"].call(0,e,t,n,i,a)}}};le.VMLRenderer=nt=function(){this.init.apply(this,arguments)},nt.prototype=I(at.prototype,st),r=nt}at.prototype.measureSpanWidth=function(e,t){var n,i=ce.createElement("span");return n=ce.createTextNode(e),i.appendChild(n),O(i,t),this.box.appendChild(i),n=i.offsetWidth,o(i),n},Ie&&(le.CanVGRenderer=nt=function(){Te="http://www.w3.org/1999/xhtml"},nt.prototype.symbols={},it=function(){function a(){var e,t=s.length;for(e=0;e<t;e++)s[e]();s=[]}var s=[];return{push:function(e,t){if(0===s.length){var n=ce.getElementsByTagName("head")[0],i=ce.createElement("script");i.type="text/javascript",i.src=t,i.onload=a,n.appendChild(i)}s.push(e)}}}(),r=nt),j.prototype={addLabel:function(){var e,t=this.axis,n=t.options,i=t.chart,a=t.categories,s=t.names,o=this.pos,r=n.labels,l=o===(d=t.tickPositions)[0],c=o===d[d.length-1],d=(s=a?Je(a[o],s[o],o):o,a=this.label,d.info);t.isDatetimeAxis&&d&&(e=n.dateTimeLabelFormats[d.higherRanks[o]||d.unitName]),this.isFirst=l,this.isLast=c,n=t.labelFormatter.call({axis:t,chart:i,isFirst:l,isLast:c,dateTimeLabelFormat:e,value:t.isLog?B(w(s)):s}),D(a)?a&&a.attr({text:n}):(this.labelLength=(this.label=a=D(n)&&r.enabled?i.renderer.text(n,0,0,r.useHTML).css(I(r.style)).add(t.labelGroup):null)&&a.getBBox().width,this.rotation=0)},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(e){var t,n=this.axis,i=e.x,a=n.chart.chartWidth,s=n.chart.spacing,o=Je(n.labelLeft,fe(n.pos,s[3])),r=(s=Je(n.labelRight,pe(n.pos+n.len,a-s[1])),this.label),l=this.rotation,c={left:0,center:.5,right:1}[n.labelAlign],d=r.getBBox().width,u=n.slotWidth,_=1,h={};l?l<0&&i-c*d<o?t=ue(i/ge(l*be)-o):0<l&&s<i+c*d&&(t=ue((a-i)/ge(l*be))):(a=i+(1-c)*d,i-c*d<o?u=e.x+u*(1-c)-o:s<a&&(u=s-e.x+u*c,_=-1),(u=fe(n.slotWidth,u))<n.slotWidth&&"center"===n.labelAlign&&(e.x+=_*(n.slotWidth-u-c*(n.slotWidth-fe(d,u)))),(u<d||n.autoRotation&&r.styles.width)&&(t=u)),t&&(h.width=t,n.options.labels.style.textOverflow||(h.textOverflow="ellipsis"),r.css(h))},getPosition:function(e,t,n,i){var a=this.axis,s=a.chart,o=i&&s.oldChartHeight||s.chartHeight;return{x:e?a.translate(t+n,null,null,i)+a.transB:a.left+a.offset+(a.opposite?(i&&s.oldChartWidth||s.chartWidth)-a.right-a.left:0),y:e?o-a.bottom+a.offset-(a.opposite?a.height:0):o-a.translate(t+n,null,null,i)-a.transB}},getLabelPosition:function(e,t,n,i,a,s,o,r){var l=this.axis,c=l.transA,d=l.reversed,u=l.staggerLines,_=l.tickRotCorr||{x:0,y:0},h=a.y;return D(h)||(h=2===l.side?_.y+8:h=ge(n.rotation*be)*(_.y-n.getBBox(!1,0).height/2)),e=e+a.x+_.x-(s&&i?s*c*(d?-1:1):0),t=t+h-(s&&!i?s*c*(d?1:-1):0),u&&(n=o/(r||1)%u,l.opposite&&(n=u-n-1),t+=n*(l.labelOffset/u)),{x:e,y:ue(t)}},getMarkPath:function(e,t,n,i,a,s){return s.crispLine(["M",e,t,"L",e+(a?0:-n),t+(a?n:0)],i)},render:function(e,t,n){var i=this.axis,a=i.options,s=i.chart.renderer,o=i.horiz,r=this.type,l=this.label,c=this.pos,d=a.labels,u=this.gridLine,_=r?r+"Tick":"tick",h=a[(g=r?r+"Grid":"grid")+"LineWidth"],p=a[g+"LineColor"],f=a[g+"LineDashStyle"],m=a[_+"Length"],g=Je(a[_+"Width"],!r&&i.isXAxis?1:0),A=a[_+"Color"],v=a[_+"Position"],b=(_=this.mark,d.step),y=!0,$=i.tickmarkOffset,w=(k=this.getPosition(o,c,$,t)).x,k=k.y,C=o&&w===i.pos+i.len||!o&&k===i.pos?-1:1;n=Je(n,1);this.isActive=!0,h&&(c=i.getPlotLinePath(c+$,h*C,t,!0),u===P&&(u={stroke:p,"stroke-width":h},f&&(u.dashstyle=f),r||(u.zIndex=1),t&&(u.opacity=0),this.gridLine=u=h?s.path(c).attr(u).add(i.gridGroup):null),!t&&u&&c&&u[this.isNew?"attr":"animate"]({d:c,opacity:n})),g&&m&&("inside"===v&&(m=-m),i.opposite&&(m=-m),r=this.getMarkPath(w,k,m,g*C,o,s),_?_.animate({d:r,opacity:n}):this.mark=s.path(r).attr({stroke:A,"stroke-width":g,opacity:n}).add(i.axisGroup)),l&&!isNaN(w)&&(l.xy=k=this.getLabelPosition(w,k,l,o,d,$,e,b),this.isFirst&&!this.isLast&&!Je(a.showFirstLabel,1)||this.isLast&&!this.isFirst&&!Je(a.showLastLabel,1)?y=!1:o&&!i.isRadial&&!d.step&&!d.rotation&&!t&&0!==n&&this.handleOverflow(k),b&&e%b&&(y=!1),y&&!isNaN(k.y)?(k.opacity=n,l[this.isNew?"attr":"animate"](k),this.isNew=!1):l.attr("y",-9999))},destroy:function(){s(this,this.axis)}},le.PlotLineOrBand=function(e,t){this.axis=e,t&&(this.options=t,this.id=t.id)},le.PlotLineOrBand.prototype={render:function(){var e,n=this,t=n.axis,i=t.horiz,a=n.options,s=a.label,o=n.label,r=a.width,l=a.to,c=a.from,d=D(c)&&D(l),u=a.value,_=a.dashStyle,h=n.svgElem,p=[],f=a.color,m=Je(a.zIndex,0),g=a.events,A={},v=t.chart.renderer;if(t.isLog&&(c=b(c),l=b(l),u=b(u)),r)p=t.getPlotLinePath(u,r),A={stroke:f,"stroke-width":r},_&&(A.dashstyle=_);else{if(!d)return;p=t.getPlotBandPath(c,l,a),f&&(A.fill=f),a.borderWidth&&(A.stroke=a.borderColor,A["stroke-width"]=a.borderWidth)}if(A.zIndex=m,h)p?(h.show(),h.animate({d:p})):(h.hide(),o&&(n.label=o=o.destroy()));else if(p&&p.length&&(n.svgElem=h=v.path(p).attr(A).add(),g))for(e in a=function(t){h.on(t,function(e){g[t].apply(n,[e])})},g)a(e);return s&&D(s.text)&&p&&p.length&&0<t.width&&0<t.height&&!p.flat?(s=I({align:i&&d&&"center",x:i?!d&&4:10,verticalAlign:!i&&d&&"middle",y:i?d?16:10:d?6:-4,rotation:i&&!d&&90},s),this.renderLabel(s,p,d,m)):o&&o.hide(),n},renderLabel:function(e,t,n,i){var a=this.label,s=this.axis.chart.renderer;a||((a={align:e.textAlign||e.align,rotation:e.rotation}).zIndex=i,this.label=a=s.text(e.text,0,0,e.useHTML).attr(a).css(e.style).add()),i=[t[1],t[4],n?t[6]:t[1]],t=[t[2],t[5],n?t[7]:t[2]],n=R(i),s=R(t),a.align(e,!1,{x:n,y:s,width:N(i)-n,height:N(t)-s}),a.show()},destroy:function(){d(this.axis.plotLinesAndBands,this),delete this.axis,s(this)}};var ot=le.Axis=function(){this.init.apply(this,arguments)};ot.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#D8D8D8",labels:{enabled:!0,style:{color:"#606060",cursor:"default",fontSize:"11px"},x:0,y:15},lineColor:"#C0D0E0",lineWidth:1,minPadding:.01,maxPadding:.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return le.numberFormat(this.total,-1)},style:I(et.line.dataLabels.style,{color:"#000000"})}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0,y:-15},title:{rotation:0}},init:function(e,t){var n=t.isX;this.chart=e,this.horiz=e.inverted?!n:n,this.coll=(this.isXAxis=n)?"xAxis":"yAxis",this.opposite=t.opposite,this.side=t.side||(this.horiz?this.opposite?0:2:this.opposite?1:3),this.setOptions(t);var i=(s=this.options).type;this.labelFormatter=s.labels.formatter||this.defaultLabelFormatter,this.userOptions=t,this.minPixelPadding=0,this.reversed=s.reversed,this.visible=!1!==s.visible,this.zoomEnabled=!1!==s.zoomEnabled,this.categories=s.categories||"category"===i,this.names=this.names||[],this.isLog="logarithmic"===i,this.isDatetimeAxis="datetime"===i,this.isLinked=D(s.linkedTo),this.ticks={},this.labelEdge=[],this.minorTicks={},this.plotLinesAndBands=[],this.alternateBands={},this.len=0,this.minRange=this.userMinRange=s.minRange||s.maxZoom,this.range=s.range,this.offset=s.offset||0,this.stacks={},this.oldStacks={},this.stacksTouched=0,this.min=this.max=null,this.crosshair=Je(s.crosshair,h(e.options.tooltip.crosshairs)[n?0:1],!1);var a,s=this.options.events;for(a in-1===Le(this,e.axes)&&(n&&!this.isColorAxis?e.axes.splice(e.xAxis.length,0,this):e.axes.push(this),e[this.coll].push(this)),this.series=this.series||[],e.inverted&&n&&this.reversed===P&&(this.reversed=!0),this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine,s)ze(this,a,s[a]);this.isLog&&(this.val2lin=b,this.lin2val=w)},setOptions:function(e){this.options=I(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],I(H[this.coll],e))},defaultLabelFormatter:function(){var e,t=this.axis,n=this.value,i=t.categories,a=this.dateTimeLabelFormat,s=H.lang.numericSymbols,o=s&&s.length,r=t.options.labels.format;t=t.isLog?n:t.tickInterval;if(r)e=v(r,this);else if(i)e=n;else if(a)e=u(a,n);else if(o&&1e3<=t)for(;o--&&e===P;)(i=Math.pow(1e3,o+1))<=t&&10*n%i==0&&null!==s[o]&&(e=le.numberFormat(n/i,-1)+s[o]);return e===P&&(e=1e4<=me(n)?le.numberFormat(n,-1):le.numberFormat(n,-1,P,"")),e},getSeriesExtremes:function(){var a=this,s=a.chart;a.hasVisibleSeries=!1,a.dataMin=a.dataMax=a.threshold=null,a.softThreshold=!a.isXAxis,a.buildStacks&&a.buildStacks(),Pe(a.series,function(e){if(e.visible||!s.options.chart.ignoreHiddenSeries){var t,n=e.options,i=n.threshold;a.hasVisibleSeries=!0,a.isLog&&i<=0&&(i=null),a.isXAxis?(n=e.xData).length&&(a.dataMin=fe(Je(a.dataMin,n[0]),R(n)),a.dataMax=pe(Je(a.dataMax,n[0]),N(n))):(e.getExtremes(),t=e.dataMax,D(e=e.dataMin)&&D(t)&&(a.dataMin=fe(Je(a.dataMin,e),e),a.dataMax=pe(Je(a.dataMax,t),t)),D(i)&&(a.threshold=i),n.softThreshold&&!a.isLog||(a.softThreshold=!1))}})},translate:function(e,t,n,i,a,s){var o=this.linkedParent||this,r=1,l=0,c=i?o.oldTransA:o.transA,d=(i=i?o.oldMin:o.min,o.minPixelPadding);a=(o.isOrdinal||o.isBroken||o.isLog&&a)&&o.lin2val;return c||(c=o.transA),n&&(r*=-1,l=o.len),o.reversed&&(l-=(r*=-1)*(o.sector||o.len)),t?(e=e*r+l,e=(e-=d)/c+i,a&&(e=o.lin2val(e))):(a&&(e=o.val2lin(e)),"between"===s&&(s=.5),e=r*(e-i)*c+l+r*d+($(s)?c*s*o.pointRange:0)),e},toPixels:function(e,t){return this.translate(e,!1,!this.horiz,null,!0)+(t?0:this.pos)},toValue:function(e,t){return this.translate(e-(t?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(e,t,n,i,a){var s,o,r,l=this.chart,c=this.left,d=this.top,u=n&&l.oldChartHeight||l.chartHeight,_=n&&l.oldChartWidth||l.chartWidth;s=this.transB;var h=function(e,t,n){return(e<t||n<e)&&(i?e=fe(pe(t,e),n):r=!0),e};a=Je(a,this.translate(e,null,null,n)),e=n=ue(a+s);return s=o=ue(u-a-s),isNaN(a)?r=!0:this.horiz?(s=d,o=u-this.bottom,e=n=h(e,c,c+this.width)):(e=c,n=_-this.right,s=o=h(s,d,d+this.height)),r&&!i?null:l.renderer.crispLine(["M",e,s,"L",n,o],t||1)},getLinearTickPositions:function(e,t,n){var i,a=B(_e(t/e)*e),s=B(he(n/e)*e),o=[];if(t===n&&$(t))return[t];for(t=a;t<=s&&(o.push(t),(t=B(t+e))!==i);)i=t;return o},getMinorTickPositions:function(){var e,t=this.options,n=this.tickPositions,i=this.minorTickInterval,a=[],s=this.pointRangePadding||0;e=this.min-s;var o=(s=this.max+s)-e;if(o&&o/i<this.len/3)if(this.isLog)for(s=n.length,e=1;e<s;e++)a=a.concat(this.getLogTickPositions(i,n[e-1],n[e],!0));else if(this.isDatetimeAxis&&"auto"===t.minorTickInterval)a=a.concat(this.getTimeTicks(this.normalizeTimeTickInterval(i),e,s,t.startOfWeek));else for(n=e+(n[0]-e)%i;n<=s;n+=i)a.push(n);return 0!==a.length&&this.trimTicks(a,t.startOnTick,t.endOnTick),a},adjustForMinRange:function(){var e,t,n,i,a,s,o=this.options,r=this.min,l=this.max,c=this.dataMax-this.dataMin>=this.minRange;this.isXAxis&&this.minRange===P&&!this.isLog&&(D(o.min)||D(o.max)?this.minRange=null:(Pe(this.series,function(e){for(a=e.xData,n=e.xIncrement?1:a.length-1;0<n;n--)i=a[n]-a[n-1],(t===P||i<t)&&(t=i)}),this.minRange=fe(5*t,this.dataMax-this.dataMin))),l-r<this.minRange&&(e=[r-(e=((s=this.minRange)-l+r)/2),Je(o.min,r-e)],c&&(e[2]=this.dataMin),l=[(r=N(e))+s,Je(o.max,r+s)],c&&(l[2]=this.dataMax),(l=R(l))-r<s&&(e[0]=l-s,e[1]=Je(o.min,l-s),r=N(e))),this.min=r,this.max=l},setAxisTranslation:function(e){var n,i=this,t=i.max-i.min,a=i.axisPointRange||0,s=0,o=0,r=i.linkedParent,l=!!i.categories,c=i.transA,d=i.isXAxis;(d||l||a)&&(r?(s=r.minPointOffset,o=r.pointRangePadding):(Pe(i.series,function(e){var t=e.closestPointRange;!e.noSharedTooltip&&D(t)&&(n=D(n)?fe(n,t):t)}),Pe(i.series,function(e){var t=l?1:d?Je(e.options.pointRange,n,0):i.axisPointRange||0;e=e.options.pointPlacement;a=pe(a,t),i.single||(s=pe(s,g(e)?0:t/2),o=pe(o,"on"===e?0:t))})),r=i.ordinalSlope&&n?i.ordinalSlope/n:1,i.minPointOffset=s*=r,i.pointRangePadding=o*=r,i.pointRange=fe(a,t),d&&(i.closestPointRange=n)),e&&(i.oldTransA=c),i.translationSlope=i.transA=c=i.len/(t+o||1),i.transB=i.horiz?i.left:i.bottom,i.minPixelPadding=c*s},minFromRange:function(){return this.max-this.range},setTickInterval:function(e){var t,n,i,a,s=this,o=s.chart,r=s.options,l=s.isLog,c=s.isDatetimeAxis,d=s.isXAxis,u=s.isLinked,_=r.maxPadding,h=r.minPadding,p=r.tickInterval,f=r.tickPixelInterval,m=s.categories,g=s.threshold,A=s.softThreshold
;!c&&!m&&!u&&this.getTickAmount(),i=Je(s.userMin,r.min),a=Je(s.userMax,r.max),u?(s.linkedParent=o[s.coll][r.linkedTo],o=s.linkedParent.getExtremes(),s.min=Je(o.min,o.dataMin),s.max=Je(o.max,o.dataMax),r.type!==s.linkedParent.options.type&&y(11,1)):(!A&&D(g)&&(s.dataMin>=g?(t=g,h=0):s.dataMax<=g&&(n=g,_=0)),s.min=Je(i,t,s.dataMin),s.max=Je(a,n,s.dataMax)),l&&(!e&&fe(s.min,Je(s.dataMin,s.min))<=0&&y(10,1),s.min=B(b(s.min),15),s.max=B(b(s.max),15)),s.range&&D(s.max)&&(s.userMin=s.min=i=pe(s.min,s.minFromRange()),s.userMax=a=s.max,s.range=null),s.beforePadding&&s.beforePadding(),s.adjustForMinRange(),m||s.axisPointRange||s.usePercentage||u||!D(s.min)||!D(s.max)||!(o=s.max-s.min)||(!D(i)&&h&&(s.min-=o*h),!D(a)&&_&&(s.max+=o*_)),$(r.floor)&&(s.min=pe(s.min,r.floor)),$(r.ceiling)&&(s.max=fe(s.max,r.ceiling)),A&&D(s.dataMin)&&(g=g||0,!D(i)&&s.min<g&&s.dataMin>=g?s.min=g:!D(a)&&s.max>g&&s.dataMax<=g&&(s.max=g)),s.tickInterval=s.min===s.max||void 0===s.min||void 0===s.max?1:u&&!p&&f===s.linkedParent.options.tickPixelInterval?p=s.linkedParent.tickInterval:Je(p,this.tickAmount?(s.max-s.min)/pe(this.tickAmount-1,1):void 0,m?1:(s.max-s.min)*f/pe(s.len,f)),d&&!e&&Pe(s.series,function(e){e.processData(s.min!==s.oldMin||s.max!==s.oldMax)}),s.setAxisTranslation(!0),s.beforeSetTickPositions&&s.beforeSetTickPositions(),s.postProcessTickInterval&&(s.tickInterval=s.postProcessTickInterval(s.tickInterval)),s.pointRange&&!p&&(s.tickInterval=pe(s.pointRange,s.tickInterval)),e=Je(r.minTickInterval,s.isDatetimeAxis&&s.closestPointRange),!p&&s.tickInterval<e&&(s.tickInterval=e),c||l||p||(s.tickInterval=E(s.tickInterval,null,C(s.tickInterval),Je(r.allowDecimals,!(.5<s.tickInterval&&s.tickInterval<5&&1e3<s.max&&s.max<9999)),!!this.tickAmount)),!this.tickAmount&&this.len&&(s.tickInterval=s.unsquish()),this.setTickPositions()},setTickPositions:function(){var e,t,n=this.options,i=n.tickPositions,a=n.tickPositioner,s=n.startOnTick,o=n.endOnTick;this.tickmarkOffset=this.categories&&"between"===n.tickmarkPlacement&&1===this.tickInterval?.5:0,this.minorTickInterval="auto"===n.minorTickInterval&&this.tickInterval?this.tickInterval/5:n.minorTickInterval,this.tickPositions=e=i&&i.slice(),!e&&((e=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,n.units),this.min,this.max,n.startOfWeek,this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max)).length>this.len&&(e=[e[0],e.pop()]),this.tickPositions=e,a&&(a=a.apply(this,[this.min,this.max])))&&(this.tickPositions=e=a),this.isLinked||(this.trimTicks(e,s,o),this.min===this.max&&D(this.min)&&!this.tickAmount&&(t=!0,this.min-=.5,this.max+=.5),this.single=t,!i&&!a&&this.adjustTickAmount())},trimTicks:function(e,t,n){var i=e[0],a=e[e.length-1],s=this.minPointOffset||0;if(t)this.min=i;else for(;this.min-s>e[0];)e.shift();if(n)this.max=a;else for(;this.max+s<e[e.length-1];)e.pop();0===e.length&&D(i)&&e.push((a+i)/2)},alignToOthers:function(){var n,i={},e=this.options;return!1!==this.chart.options.chart.alignTicks&&!1!==e.alignTicks&&Pe(this.chart[this.coll],function(e){var t=e.options;t=[e.horiz?t.left:t.top,t.width,t.height,t.pane].join(",");e.series.length&&(i[t]?n=!0:i[t]=1)}),n},getTickAmount:function(){var e=this.options,t=e.tickAmount,n=e.tickPixelInterval;!D(e.tickInterval)&&this.len<n&&!this.isRadial&&!this.isLog&&e.startOnTick&&e.endOnTick&&(t=2),!t&&this.alignToOthers()&&(t=he(this.len/n)+1),t<4&&(this.finalTickAmt=t,t=5),this.tickAmount=t},adjustTickAmount:function(){var e=this.tickInterval,t=this.tickPositions,n=this.tickAmount,i=this.finalTickAmt,a=t&&t.length;if(a<n){for(;t.length<n;)t.push(B(t[t.length-1]+e));this.transA*=(a-1)/(n-1),this.max=t[t.length-1]}else n<a&&(this.tickInterval*=2,this.setTickPositions());if(D(i)){for(e=n=t.length;e--;)(3===i&&e%2==1||i<=2&&0<e&&e<n-1)&&t.splice(e,1);this.finalTickAmt=P}},setScale:function(){var t,e;this.oldMin=this.min,this.oldMax=this.max,this.oldAxisLength=this.len,this.setAxisSize(),e=this.len!==this.oldAxisLength,Pe(this.series,function(e){(e.isDirtyData||e.isDirty||e.xAxis.isDirty)&&(t=!0)}),e||t||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?(this.resetStacks&&this.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks()},setExtremes:function(e,t,n,i,a){var s=this,o=s.chart;n=Je(n,!0);Pe(s.series,function(e){delete e.kdTree}),a=Xe(a,{min:e,max:t}),We(s,"setExtremes",a,function(){s.userMin=e,s.userMax=t,s.eventArgs=a,n&&o.redraw(i)})},zoom:function(e,t){var n=this.dataMin,i=this.dataMax,a=this.options,s=fe(n,Je(a.min,n));a=pe(i,Je(a.max,i));return this.allowZoomOutside||(D(n)&&e<=s&&(e=s),D(i)&&a<=t&&(t=a)),this.displayBtn=e!==P||t!==P,this.setExtremes(e,t,!1,P,{trigger:"zoom"}),!0},setAxisSize:function(){var e=this.chart,t=(o=this.options).offsetLeft||0,n=this.horiz,i=Je(o.width,e.plotWidth-t+(o.offsetRight||0)),a=Je(o.height,e.plotHeight),s=Je(o.top,e.plotTop),o=Je(o.left,e.plotLeft+t);(t=/%$/).test(a)&&(a=Math.round(parseFloat(a)/100*e.plotHeight)),t.test(s)&&(s=Math.round(parseFloat(s)/100*e.plotHeight+e.plotTop)),this.left=o,this.top=s,this.width=i,this.height=a,this.bottom=e.chartHeight-a-s,this.right=e.chartWidth-i-o,this.len=pe(n?i:a,0),this.pos=n?o:s},getExtremes:function(){var e=this.isLog;return{min:e?B(w(this.min)):this.min,max:e?B(w(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(e){var t=(n=this.isLog)?w(this.min):this.min,n=n?w(this.max):this.max;return null===e?e=n<0?n:t:e<t?e=t:n<e&&(e=n),this.translate(e,0,1,0,1)},autoLabelAlign:function(e){return 15<(e=(Je(e,0)-90*this.side+720)%360)&&e<165?"right":195<e&&e<345?"left":"center"},unsquish:function(){var n,i,e,t=this.ticks,a=this.options.labels,s=this.horiz,o=this.tickInterval,r=o,l=this.len/(((this.categories?1:0)+this.max-this.min)/o),c=a.rotation,d=this.chart.renderer.fontMetrics(a.style.fontSize,t[0]&&t[0].label),u=Number.MAX_VALUE,_=function(e){return(e=1<(e/=l||1)?he(e):1)*o};return s?(e=!a.staggerLines&&!a.step&&(D(c)?[c]:l<Je(a.autoRotationLimit,80)&&a.autoRotation))&&Pe(e,function(e){var t;(e===c||e&&-90<=e&&e<=90)&&((t=(i=_(me(d.h/Ae(be*e))))+me(e/360))<u&&(u=t,n=e,r=i))}):a.step||(r=_(d.h)),this.autoRotation=e,this.labelRotation=Je(n,c),r},renderUnsquish:function(){var n,e,t,i=this.chart,a=i.renderer,s=this.tickPositions,o=this.ticks,r=this.options.labels,l=this.horiz,c=i.margin,d=this.categories?s.length:s.length-1,u=(c=this.slotWidth=l&&(r.step||0)<2&&!r.rotation&&(this.staggerLines||1)*i.plotWidth/d||!l&&(c[3]&&c[3]-i.spacing[3]||.33*i.chartWidth),pe(1,ue(c-2*(r.padding||5)))),_={},h=(d=a.fontMetrics(r.style.fontSize,o[0]&&o[0].label),r.style.textOverflow),p=0;if(g(r.rotation)||(_.rotation=r.rotation||0),this.autoRotation)Pe(s,function(e){(e=o[e])&&e.labelLength>p&&(p=e.labelLength)}),u<p&&p>d.h?_.rotation=this.labelRotation:this.labelRotation=0;else if(c&&(n={width:u+"px"},!h))for(n.textOverflow="clip",e=s.length;!l&&e--;)t=s[e],(u=o[t].label)&&("ellipsis"===u.styles.textOverflow&&u.css({textOverflow:"clip"}),(u.getBBox().height>this.len/s.length-(d.h-d.f)||o[t].labelLength>c)&&(u.specCss={textOverflow:"ellipsis"}));_.rotation&&(n={width:(p>.5*i.chartHeight?.33*i.chartHeight:i.chartHeight)+"px"},!h)&&(n.textOverflow="ellipsis"),(this.labelAlign=r.align||this.autoLabelAlign(this.labelRotation))&&(_.align=this.labelAlign),Pe(s,function(e){var t=(e=o[e])&&e.label;t&&(t.attr(_),n&&t.css(I(n,t.specCss)),delete t.specCss,e.rotation=_.rotation)}),this.tickRotCorr=a.rotCorr(d.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||D(this.min)&&D(this.max)&&!!this.tickPositions},getOffset:function(){var e,t,n,i,a=this,s=(v=a.chart).renderer,o=a.options,r=a.tickPositions,l=a.ticks,c=a.horiz,d=a.side,u=v.inverted?[1,0,3,2][d]:d,_=0,h=0,p=o.title,f=o.labels,m=0,g=a.opposite,A=v.axisOffset,v=v.clipOffset,b=[-1,1,1,-1][d],y=a.axisParent;if(e=a.hasData(),a.showAxis=t=e||Je(o.showEmpty,!0),a.staggerLines=a.horiz&&f.staggerLines,a.axisGroup||(a.gridGroup=s.g("grid").attr({zIndex:o.gridZIndex||1}).add(y),a.axisGroup=s.g("axis").attr({zIndex:o.zIndex||2}).add(y),a.labelGroup=s.g("axis-labels").attr({zIndex:f.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add(y)),e||a.isLinked)Pe(r,function(e){l[e]?l[e].addLabel():l[e]=new j(a,e)}),a.renderUnsquish(),!1!==f.reserveSpace&&(0===d||2===d||{1:"left",3:"right"}[d]===a.labelAlign||"center"===a.labelAlign)&&Pe(r,function(e){m=pe(l[e].getLabelSize(),m)}),a.staggerLines&&(m*=a.staggerLines,a.labelOffset=m*(a.opposite?-1:1));else for(i in l)l[i].destroy(),delete l[i];p&&p.text&&!1!==p.enabled&&(a.axisTitle||(a.axisTitle=s.text(p.text,0,0,p.useHTML).attr({zIndex:7,rotation:p.rotation||0,align:p.textAlign||{low:g?"right":"left",middle:"center",high:g?"left":"right"}[p.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(p.style).add(a.axisGroup),a.axisTitle.isNew=!0),t&&(_=a.axisTitle.getBBox()[c?"height":"width"],h=D(n=p.offset)?0:Je(p.margin,c?5:10)),a.axisTitle[t?"show":"hide"](!0)),a.offset=b*Je(o.offset,A[d]),a.tickRotCorr=a.tickRotCorr||{x:0,y:0},s=2===d?a.tickRotCorr.y:0,c=Math.abs(m)+h+(m&&b*(c?Je(f.y,a.tickRotCorr.y+8):f.x)-s),a.axisTitleMargin=Je(n,c),A[d]=pe(A[d],a.axisTitleMargin+_+b*a.offset,c),o=o.offset?0:2*_e(o.lineWidth/2),v[u]=pe(v[u],o)},getLinePath:function(e){var t=this.chart,n=this.opposite,i=this.offset,a=this.horiz,s=this.left+(n?this.width:0)+i;i=t.chartHeight-this.bottom-(n?this.height:0)+i;return n&&(e*=-1),t.renderer.crispLine(["M",a?this.left:s,a?i:this.top,"L",a?t.chartWidth-this.right:s,a?i:t.chartHeight-this.bottom],e)},getTitlePosition:function(){var e=this.horiz,t=this.left,n=this.top,i=this.len,a=this.options.title,s=e?t:n,o=this.opposite,r=this.offset,l=a.x||0,c=a.y||0,d=f(a.style.fontSize||12);i={low:s+(e?0:i),middle:s+i/2,high:s+(e?i:0)}[a.align],t=(e?n+this.height:t)+(e?1:-1)*(o?-1:1)*this.axisTitleMargin+(2===this.side?d:0);return{x:e?i+l:t+(o?this.width:0)+r+l,y:e?t+c-(o?this.height:0)+r:i+c}},render:function(){var e,n,i,a=this,s=a.chart,t=s.renderer,o=a.options,r=a.isLog,l=a.isLinked,c=a.tickPositions,d=a.axisTitle,u=a.ticks,_=a.minorTicks,h=a.alternateBands,p=o.stackLabels,f=o.alternateGridColor,m=a.tickmarkOffset,g=o.lineWidth,A=s.hasRendered&&D(a.oldMin)&&!isNaN(a.oldMin),v=a.showAxis,b=t.globalAnimation;a.labelEdge.length=0,a.overlap=!1,Pe([u,_,h],function(e){for(var t in e)e[t].isActive=!1}),(a.hasData()||l)&&(a.minorTickInterval&&!a.categories&&Pe(a.getMinorTickPositions(),function(e){_[e]||(_[e]=new j(a,e,"minor")),A&&_[e].isNew&&_[e].render(null,!0),_[e].render(null,!1,1)}),c.length&&(Pe(c,function(e,t){(!l||e>=a.min&&e<=a.max)&&(u[e]||(u[e]=new j(a,e)),A&&u[e].isNew&&u[e].render(t,!0,.1),u[e].render(t))}),m&&(0===a.min||a.single))&&(u[-1]||(u[-1]=new j(a,-1,null,!0)),u[-1].render(-1)),f&&Pe(c,function(e,t){i=c[t+1]!==P?c[t+1]+m:a.max-m,t%2==0&&e<a.max&&i<=a.max+(s.polar?-m:m)&&(h[e]||(h[e]=new le.PlotLineOrBand(a)),n=e+m,h[e].options={from:r?w(n):n,to:r?w(i):i,color:f},h[e].render(),h[e].isActive=!0)}),a._addedPlotLB||(Pe((o.plotLines||[]).concat(o.plotBands||[]),function(e){a.addPlotBandOrLine(e)}),a._addedPlotLB=!0)),Pe([u,_,h],function(e){var t,n,i=[],a=b?b.duration||500:0;for(t in e)e[t].isActive||(e[t].render(t,!1,0),e[t].isActive=!1,i.push(t));k(function(){for(n=i.length;n--;)e[i[n]]&&!e[i[n]].isActive&&(e[i[n]].destroy(),delete e[i[n]])},e!==h&&s.hasRendered&&a?a:0)}),g&&(e=a.getLinePath(g),a.axisLine?a.axisLine.animate({d:e}):a.axisLine=t.path(e).attr({stroke:o.lineColor,"stroke-width":g,zIndex:7}).add(a.axisGroup),a.axisLine[v?"show":"hide"](!0)),d&&v&&(d[d.isNew?"attr":"animate"](a.getTitlePosition()),d.isNew=!1),p&&p.enabled&&a.renderStackTotals(),a.isDirty=!1},redraw:function(){this.visible&&(this.render(),Pe(this.plotLinesAndBands,function(e){e.render()})),Pe(this.series,function(e){e.isDirty=!0})},destroy:function(e){var t,n=this,i=n.stacks,a=n.plotLinesAndBands;for(t in e||qe(n),i)s(i[t]),i[t]=null;for(Pe([n.ticks,n.minorTicks,n.alternateBands],function(e){s(e)}),e=a.length;e--;)a[e].destroy();Pe("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(e){n[e]&&(n[e]=n[e].destroy())}),this.cross&&this.cross.destroy()},drawCrosshair:function(e,t){var n,i,a,s=this.crosshair;this.crosshair&&!1!==(D(t)||!Je(s.snap,!0))?(Je(s.snap,!0)?D(t)&&(n=this.isXAxis?t.plotX:this.len-t.plotY):n=this.horiz?e.chartX-this.pos:this.len-e.chartY+this.pos,null===(n=this.isRadial?this.getPlotLinePath(this.isXAxis?t.x:Je(t.stackY,t.y))||null:this.getPlotLinePath(null,null,null,null,n)||null)?this.hideCrosshair():(i=this.categories&&!this.isRadial,a=Je(s.width,i?this.transA:1),this.cross?this.cross.attr({d:n,visibility:"visible","stroke-width":a}):(i={"stroke-width":a,stroke:s.color||(i?"rgba(155,200,255,0.2)":"#C0C0C0"),zIndex:Je(s.zIndex,2)},s.dashStyle&&(i.dashstyle=s.dashStyle),this.cross=this.chart.renderer.path(n).attr(i).add()))):this.hideCrosshair()},hideCrosshair:function(){this.cross&&this.cross.hide()}},Xe(ot.prototype,{getPlotBandPath:function(e,t){var n=this.getPlotLinePath(t,null,null,!0),i=this.getPlotLinePath(e,null,null,!0);return i&&n?(i.flat=i.toString()===n.toString(),i.push(n[4],n[5],n[1],n[2])):i=null,i},addPlotBand:function(e){return this.addPlotBandOrLine(e,"plotBands")},addPlotLine:function(e){return this.addPlotBandOrLine(e,"plotLines")},addPlotBandOrLine:function(e,t){var n=new le.PlotLineOrBand(this,e).render(),i=this.userOptions;return n&&(t&&(i[t]=i[t]||[],i[t].push(e)),this.plotLinesAndBands.push(n)),n},removePlotBandOrLine:function(t){for(var e=this.plotLinesAndBands,n=this.options,i=this.userOptions,a=e.length;a--;)e[a].id===t&&e[a].destroy();Pe([n.plotLines||[],i.plotLines||[],n.plotBands||[],i.plotBands||[]],function(e){for(a=e.length;a--;)e[a].id===t&&d(e,e[a])})}}),ot.prototype.getTimeTicks=function(e,t,n,i){var a,s=[],o={},r=H.global.useUTC,l=new z(t-m(t)),c=e.unitRange,d=e.count;if(D(t)){l[te](c>=Q.second?0:d*_e(l.getMilliseconds()/d)),c>=Q.second&&l[ne](c>=Q.minute?0:d*_e(l.getSeconds()/d)),c>=Q.minute&&l[ie](c>=Q.hour?0:d*_e(l[V]()/d)),c>=Q.hour&&l[ae](c>=Q.day?0:d*_e(l[G]()/d)),c>=Q.day&&l[se](c>=Q.month?1:d*_e(l[J]()/d)),c>=Q.month&&(l[oe](c>=Q.year?0:d*_e(l[Z]()/d)),a=l[ee]()),c>=Q.year&&(a-=a%d,l[re](a)),c===Q.week&&l[se](l[J]()-l[X]()+Je(i,1)),t=1,(W||Y)&&(l=l.getTime(),l=new z(l+m(l))),a=l[ee]();i=l.getTime();for(var u=l[Z](),_=l[J](),h=!r||!!Y,p=(Q.day+(r?m(l):6e4*l.getTimezoneOffset()))%Q.day;i<n;)s.push(i),c===Q.year?i=q(a+t*d,0):c===Q.month?i=q(a,u+t*d):!h||c!==Q.day&&c!==Q.week?i+=c*d:i=q(a,u,_+t*d*(c===Q.day?1:7)),t++;s.push(i),Pe(Ue(s,function(e){return c<=Q.hour&&e%Q.day===p}),function(e){o[e]="day"})}return s.info=Xe(e,{higherRanks:o,totalRange:c*d}),s},ot.prototype.normalizeTimeTickInterval=function(e,t){var n,i=t||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],a=i[i.length-1],s=Q[a[0]],o=a[1];for(n=0;n<i.length&&(a=i[n],s=Q[a[0]],o=a[1],!(i[n+1]&&e<=(s*o[o.length-1]+Q[i[n+1][0]])/2));n++);return s===Q.year&&e<5*s&&(o=[1,2,5]),{unitRange:s,count:i=E(e/s,o,"year"===a[0]?pe(C(e/s),1):1),unitName:a[0]}},ot.prototype.getLogTickPositions=function(e,t,n,i){var a=this.options,s=this.len,o=[];if(i||(this._minorAutoInterval=null),.5<=e)e=ue(e),o=this.getLinearTickPositions(e,t,n);else if(.08<=e){var r,l,c,d,u;for(s=_e(t),a=.3<e?[1,2,4]:.15<e?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];s<n+1&&!u;s++)for(l=a.length,r=0;r<l&&!u;r++)t<(c=b(w(s)*a[r]))&&(!i||d<=n)&&d!==P&&o.push(d),n<d&&(u=!0),d=c}else t=w(t),n=w(n),e=a[i?"minorTickInterval":"tickInterval"],e=E(e=Je("auto"===e?null:e,this._minorAutoInterval,(n-t)*(a.tickPixelInterval/(i?5:1))/((i?s/this.tickPositions.length:s)||1)),null,C(e)),o=Qe(this.getLinearTickPositions(e,t,n),b),i||(this._minorAutoInterval=e/5);return i||(this.tickInterval=e),o};var rt,lt=le.Tooltip=function(){this.init.apply(this,arguments)};lt.prototype={init:function(e,t){var n=t.borderWidth,i=t.style,a=f(i.padding);this.chart=e,this.options=t,this.crosshairs=[],this.now={x:0,y:0},this.isHidden=!0,this.label=e.renderer.label("",0,0,t.shape||"callout",null,null,t.useHTML,null,"tooltip").attr({padding:a,fill:t.backgroundColor,"stroke-width":n,r:t.borderRadius,zIndex:8}).css(i).css({padding:0}).add().attr({y:-9999}),Ie||this.label.shadow(t.shadow),this.shared=t.shared},destroy:function(){this.label&&(this.label=this.label.destroy()),clearTimeout(this.hideTimer),clearTimeout(this.tooltipTimeout)},move:function(e,t,n,i){var a=this,s=a.now,o=!1!==a.options.animation&&!a.isHidden&&(1<me(e-s.x)||1<me(t-s.y)),r=a.followPointer||1<a.len;Xe(s,{x:o?(2*s.x+e)/3:e,y:o?(s.y+t)/2:t,anchorX:r?P:o?(2*s.anchorX+n)/3:n,anchorY:r?P:o?(s.anchorY+i)/2:i}),a.label.attr(s),o&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){a&&a.move(e,t,n,i)},32))},hide:function(e){var t=this;clearTimeout(this.hideTimer),e=Je(e,this.options.hideDelay,500),this.isHidden||(this.hideTimer=k(function(){t.label[e?"fadeOut":"hide"](),t.isHidden=!0},e))},getAnchor:function(e,t){var n,i,a,s=this.chart,o=s.inverted,r=s.plotTop,l=s.plotLeft,c=0,d=0;return n=(e=h(e))[0].tooltipPos,this.followPointer&&t&&(t.chartX===P&&(t=s.pointer.normalize(t)),n=[t.chartX-s.plotLeft,t.chartY-r]),n||(Pe(e,function(e){i=e.series.yAxis,a=e.series.xAxis,c+=e.plotX+(!o&&a?a.left-l:0),d+=(e.plotLow?(e.plotLow+e.plotHigh)/2:e.plotY)+(!o&&i?i.top-r:0)}),c/=e.length,d/=e.length,n=[o?s.plotWidth-d:c,this.shared&&!o&&1<e.length&&t?t.chartY-r:o?s.plotHeight-c:d]),Qe(n,ue)},getPosition:function(e,t,n){var i,a=this.chart,c=this.distance,d={},u=n.h||0,s=["y",a.chartHeight,t,n.plotY+a.plotTop,a.plotTop,a.plotTop+a.plotHeight],o=["x",a.chartWidth,e,n.plotX+a.plotLeft,a.plotLeft,a.plotLeft+a.plotWidth],_=Je(n.ttBelow,a.inverted&&!n.negative||!a.inverted&&n.negative),r=function(e,t,n,i,a,s){var o=n<i-c,r=i+c+n<t,l=i-c-n;if(i+=c,_&&r)d[e]=i;else if(!_&&o)d[e]=l;else if(o)d[e]=fe(s-n,l-u<0?l:l-u);else{if(!r)return!1;d[e]=pe(a,t<i+u+n?i:i+u)}},l=function(e,t,n,i){var a;return i<c||t-c<i?a=!1:d[e]=i<n/2?1:t-n/2<i?t-n-2:i-n/2,a},h=function(e){var t=s;s=o,o=t,i=e},p=function(){!1!==r.apply(0,s)?!1===l.apply(0,o)&&!i&&(h(!0),p()):i?d.x=d.y=0:(h(!0),p())};return(a.inverted||1<this.len)&&h(),p(),d},defaultFormatter:function(e){var t,n=this.points||h(this);return(t=(t=[e.tooltipFooterHeaderFormatter(n[0])]).concat(e.bodyFormatter(n))).push(e.tooltipFooterHeaderFormatter(n[0],!0)),t.join("")},refresh:function(e,t){var n,i,a,s,o=this.chart,r=this.label,l=this.options,c={},d=[];s=l.formatter||this.defaultFormatter;c=o.hoverPoints;var u,_=this.shared;clearTimeout(this.hideTimer),this.followPointer=h(e)[0].series.tooltipOptions.followPointer,n=(a=this.getAnchor(e,t))[0],i=a[1],!_||e.series&&e.series.noSharedTooltip?c=e.getLabelConfig():(o.hoverPoints=e,c&&Pe(c,function(e){e.setState()}),Pe(e,function(e){e.setState("hover"),d.push(e.getLabelConfig())}),(c={x:e[0].category,y:e[0].y}).points=d,this.len=d.length,e=e[0]),s=s.call(c,this),c=e.series,this.distance=Je(c.tooltipOptions.distance,16),!1===s?this.hide():(this.isHidden&&(Ve(r),r.attr("opacity",1).show()),r.attr({text:s}),u=l.borderColor||e.color||c.color||"#606060",r.attr({stroke:u}),this.updatePosition({plotX:n,plotY:i,negative:e.negative,ttBelow:e.ttBelow,h:a[2]||0}),this.isHidden=!1),We(o,"tooltipRefresh",{text:s,x:n+o.plotLeft,y:i+o.plotTop,borderColor:u})},updatePosition:function(e){var t=this.chart,n=this.label;n=(this.options.positioner||this.getPosition).call(this,n.width,n.height,e);this.move(ue(n.x),ue(n.y||0),e.plotX+t.plotLeft,e.plotY+t.plotTop)},getXDateFormat:function(e,t,n){t=t.dateTimeLabelFormats;var i,a,s,o=n&&n.closestPointRange,r={millisecond:15,second:12,minute:9,hour:6,day:3},l="millisecond";if(o){for(a in s=u("%m-%d %H:%M:%S.%L",e.x),Q){if(o===Q.week&&+u("%w",e.x)===n.options.startOfWeek&&"00:00:00.000"===s.substr(6)){a="week";break}if(Q[a]>o){a=l;break}if(r[a]&&s.substr(r[a])!=="01-01 00:00:00.000".substr(r[a]))break;"week"!==a&&(l=a)}a&&(i=t[a])}else i=t.day;return i||t.year},tooltipFooterHeaderFormatter:function(e,t){var n=t?"footer":"header",i=e.series,a=i.tooltipOptions,s=a.xDateFormat,o=i.xAxis,r=o&&"datetime"===o.options.type&&$(e.key);n=a[n+"Format"];return r&&!s&&(s=this.getXDateFormat(e,a,o)),r&&s&&(n=n.replace("{point.key}","{point.key:"+s+"}")),v(n,{point:e,series:i})},bodyFormatter:function(e){return Qe(e,function(e){var t=e.series.tooltipOptions;return(t.pointFormatter||e.point.tooltipFormatter).call(e.point,t.pointFormat)})}},U=ce&&ce.documentElement.ontouchstart!==P;var ct=le.Pointer=function(e,t){this.init(e,t)};if(ct.prototype={init:function(e,t){var n,i=(s=t.chart).events,a=Ie?"":s.zoomType,s=e.inverted;this.options=t,this.chart=e,this.zoomX=n=/x/.test(a),this.zoomY=a=/y/.test(a),this.zoomHor=n&&!s||a&&s,this.zoomVert=a&&!s||n&&s,this.hasZoom=n||a,this.runChartClick=i&&!!i.click,this.pinchDown=[],this.lastValidTouch={},le.Tooltip&&t.tooltip.enabled&&(e.tooltip=new lt(e,t.tooltip),this.followTouchMove=Je(t.tooltip.followTouchMove,!0)),this.setDOMEvents()},normalize:function(e,t){var n,i;return(e=e||l.event).target||(e.target=e.srcElement),i=e.touches?e.touches.length?e.touches.item(0):e.changedTouches[0]:e,t||(this.chartPosition=t=He(this.chart.container)),i.pageX===P?(n=pe(e.x,e.clientX-t.left),i=e.y):(n=i.pageX-t.left,i=i.pageY-t.top),Xe(e,{chartX:ue(n),chartY:ue(i)})},getCoordinates:function(t){var n={xAxis:[],yAxis:[]};return Pe(this.chart.axes,function(e){n[e.isXAxis?"xAxis":"yAxis"].push({axis:e,value:e.toValue(t[e.horiz?"chartX":"chartY"])})}),n},runPointActions:function(i){var t,n,a,e=this.chart,s=e.series,o=e.tooltip,r=!!o&&o.shared,l=e.hoverPoint,c=e.hoverSeries,d=[Number.MAX_VALUE,Number.MAX_VALUE],u=[],_=[];if(!r&&!c)for(e=0;e<s.length;e++)!s[e].directTouch&&s[e].options.stickyTracking||(s=[]);if(c&&(r?c.noSharedTooltip:c.directTouch)&&l?_=[l]:(Pe(s,function(e){t=e.noSharedTooltip&&r,n=!r&&e.directTouch,e.visible&&!t&&!n&&Je(e.options.enableMouseTracking,!0)&&(a=e.searchPoint(i,!t&&1===e.kdDimensions))&&u.push(a)}),Pe(u,function(n){n&&Pe(["dist","distX"],function(e,t){"number"==typeof n[e]&&n[e]<d[t]&&(d[t]=n[e],_[t]=n)})})),r)for(e=u.length;e--;)(u[e].clientX!==_[1].clientX||u[e].series.noSharedTooltip)&&u.splice(e,1);_[0]&&(_[0]!==this.prevKDPoint||o&&o.isHidden)?r&&!_[0].series.noSharedTooltip?(u.length&&o&&o.refresh(u,i),Pe(u,function(e){e.onMouseOver(i,e!==(c&&c.directTouch&&l||_[0]))}),this.prevKDPoint=_[1]):(o&&o.refresh(_[0],i),c&&c.directTouch||_[0].onMouseOver(i),this.prevKDPoint=_[0]):(s=c&&c.tooltipOptions.followPointer,o&&s&&!o.isHidden&&(s=o.getAnchor([{}],i),o.updatePosition({plotX:s[0],plotY:s[1]}))),this._onDocumentMouseMove||(this._onDocumentMouseMove=function(e){Re[rt]&&Re[rt].pointer.onDocumentMouseMove(e)},ze(ce,"mousemove",this._onDocumentMouseMove)),Pe(r?u:[Je(_[1],l)],function(t){var n=t&&t.series;n&&Pe(["xAxis","yAxis","colorAxis"],function(e){n[e]&&n[e].drawCrosshair(i,t)})})},reset:function(t,e){var n=this.chart,i=n.hoverSeries,a=n.hoverPoint,s=n.hoverPoints,o=n.tooltip,r=o&&o.shared?s:a;(t=t&&o&&r)&&Pe(h(r),function(e){void 0===e.plotX&&(t=!1)}),t?(o.refresh(r),a&&(a.setState(a.state,!0),Pe(n.axes,function(e){Je(e.options.crosshair&&e.options.crosshair.snap,!0)?e.drawCrosshair(null,a):e.hideCrosshair()}))):(a&&a.onMouseOut(),s&&Pe(s,function(e){e.setState()}),i&&i.onMouseOut(),o&&o.hide(e),this._onDocumentMouseMove&&(qe(ce,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null),Pe(n.axes,function(e){e.hideCrosshair()}),this.hoverX=n.hoverPoints=n.hoverPoint=null)},scaleGroups:function(t,n){var i,a=this.chart;Pe(a.series,function(e){i=t||e.getPlotBox(),e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(i),e.markerGroup&&(e.markerGroup.attr(i),e.markerGroup.clip(n?a.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(i))}),a.clipRect.attr(n||a.clipBox)},dragStart:function(e){var t=this.chart;t.mouseIsDown=e.type,t.cancelClick=!1,t.mouseDownX=this.mouseDownX=e.chartX,t.mouseDownY=this.mouseDownY=e.chartY},drag:function(e){var t,n=this.chart,i=n.options.chart,a=e.chartX,s=e.chartY,o=this.zoomHor,r=this.zoomVert,l=n.plotLeft,c=n.plotTop,d=n.plotWidth,u=n.plotHeight,_=this.selectionMarker,h=this.mouseDownX,p=this.mouseDownY,f=i.panKey&&e[i.panKey+"Key"];_&&_.touch||(a<l?a=l:l+d<a&&(a=l+d),s<c?s=c:c+u<s&&(s=c+u),this.hasDragged=Math.sqrt(Math.pow(h-a,2)+Math.pow(p-s,2)),10<this.hasDragged&&(t=n.isInsidePlot(h-l,p-c),n.hasCartesianSeries&&(this.zoomX||this.zoomY)&&t&&!f&&!_&&(this.selectionMarker=_=n.renderer.rect(l,c,o?1:d,r?1:u,0).attr({fill:i.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add()),_&&o&&(a-=h,_.attr({width:me(a),x:(0<a?0:a)+h})),_&&r&&(a=s-p,_.attr({height:me(a),y:(0<a?0:a)+p})),t&&!_&&i.panning&&n.pan(e,i.panning)))},drop:function(a){var s=this,t=this.chart,o=this.hasPinched;if(this.selectionMarker){var r,l={originalEvent:a,xAxis:[],yAxis:[]},e=this.selectionMarker,c=e.attr?e.attr("x"):e.x,d=e.attr?e.attr("y"):e.y,u=e.attr?e.attr("width"):e.width,_=e.attr?e.attr("height"):e.height;(this.hasDragged||o)&&(Pe(t.axes,function(e){if(e.zoomEnabled&&D(e.min)&&(o||s[{xAxis:"zoomX",yAxis:"zoomY"}[e.coll]])){var t=e.horiz,n="touchend"===a.type?e.minPixelPadding:0,i=e.toValue((t?c:d)+n);t=e.toValue((t?c+u:d+_)-n);l[e.coll].push({axis:e,min:fe(i,t),max:pe(i,t)}),r=!0}}),r&&We(t,"selection",l,function(e){t.zoom(Xe(e,o?{animation:!1}:null))})),this.selectionMarker=this.selectionMarker.destroy(),o&&this.scaleGroups()}t&&(O(t.container,{cursor:t._cursor}),t.cancelClick=10<this.hasDragged,t.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(e){(e=this.normalize(e)).preventDefault&&e.preventDefault(),this.dragStart(e)},onDocumentMouseUp:function(e){Re[rt]&&Re[rt].pointer.drop(e)},onDocumentMouseMove:function(e){var t=this.chart,n=this.chartPosition;e=this.normalize(e,n);n&&!this.inClass(e.target,"highcharts-tracker")&&!t.isInsidePlot(e.chartX-t.plotLeft,e.chartY-t.plotTop)&&this.reset()},onContainerMouseLeave:function(e){var t=Re[rt];t&&(e.relatedTarget||e.toElement)&&(t.pointer.reset(),t.pointer.chartPosition=null)},onContainerMouseMove:function(e){var t=this.chart;D(rt)&&Re[rt].mouseIsDown||(rt=t.index),(e=this.normalize(e)).returnValue=!1,"mousedown"===t.mouseIsDown&&this.drag(e),(this.inClass(e.target,"highcharts-tracker")||t.isInsidePlot(e.chartX-t.plotLeft,e.chartY-t.plotTop))&&!t.openMenu&&this.runPointActions(e)},inClass:function(e,t){for(var n;e;){if(n=x(e,"class")){if(-1!==n.indexOf(t))return!0;if(-1!==n.indexOf("highcharts-container"))return!1}e=e.parentNode}},onTrackerMouseOut:function(e){var t=this.chart.hoverSeries;e=e.relatedTarget||e.toElement;!t||!e||t.options.stickyTracking||this.inClass(e,"highcharts-tooltip")||this.inClass(e,"highcharts-series-"+t.index)||t.onMouseOut()},onContainerClick:function(e){var t=this.chart,n=t.hoverPoint,i=t.plotLeft,a=t.plotTop;e=this.normalize(e);t.cancelClick||(n&&this.inClass(e.target,"highcharts-tracker")?(We(n.series,"click",Xe(e,{point:n})),t.hoverPoint&&n.firePointEvent("click",e)):(Xe(e,this.getCoordinates(e)),t.isInsidePlot(e.chartX-i,e.chartY-a)&&We(t,"click",e)))},setDOMEvents:function(){var t=this,e=t.chart.container;e.onmousedown=function(e){t.onContainerMouseDown(e)},e.onmousemove=function(e){t.onContainerMouseMove(e)},e.onclick=function(e){t.onContainerClick(e)},ze(e,"mouseleave",t.onContainerMouseLeave),1===Be&&ze(ce,"mouseup",t.onDocumentMouseUp),U&&(e.ontouchstart=function(e){t.onContainerTouchStart(e)},e.ontouchmove=function(e){t.onContainerTouchMove(e)},1===Be&&ze(ce,"touchend",t.onDocumentTouchEnd))},destroy:function(){var e;for(e in qe(this.chart.container,"mouseleave",this.onContainerMouseLeave),Be||(qe(ce,"mouseup",this.onDocumentMouseUp),qe(ce,"touchend",this.onDocumentTouchEnd)),clearInterval(this.tooltipTimeout),this)this[e]=null}},Xe(le.Pointer.prototype,{pinchTranslate:function(e,t,n,i,a,s){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,e,t,n,i,a,s),(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,e,t,n,i,a,s)},pinchTranslateDirection:function(e,t,n,i,a,s,o,r){var l,c,d,u=this.chart,_=e?"x":"y",h=e?"X":"Y",p="chart"+h,f=e?"width":"height",m=u["plot"+(e?"Left":"Top")],g=r||1,A=u.inverted,v=u.bounds[e?"h":"v"],b=1===t.length,y=t[0][p],$=n[0][p],w=!b&&t[1][p],k=!b&&n[1][p];(n=function(){!b&&20<me(y-w)&&(g=r||me($-k)/me(y-w)),c=(m-$)/g+y,l=u["plot"+(e?"Width":"Height")]/g})(),(t=c)<v.min?(t=v.min,d=!0):t+l>v.max&&(t=v.max-l,d=!0),d?($-=.8*($-o[_][0]),b||(k-=.8*(k-o[_][1])),n()):o[_]=[$,k],A||(s[_]=c-m,s[f]=l),s=A?1/g:g,a[f]=l,a[_]=t,i[A?e?"scaleY":"scaleX":"scale"+h]=g,i["translate"+h]=s*m+($-s*y)},pinch:function(e){var t=this,o=t.chart,n=t.pinchDown,i=e.touches,a=i.length,s=t.lastValidTouch,r=t.hasZoom,l=t.selectionMarker,c={},d=1===a&&(t.inClass(e.target,"highcharts-tracker")&&o.runTrackerClick||t.runChartClick),u={};1<a&&(t.initiated=!0),r&&t.initiated&&!d&&e.preventDefault(),Qe(i,function(e){return t.normalize(e)}),"touchstart"===e.type?(Pe(i,function(e,t){n[t]={chartX:e.chartX,chartY:e.chartY}}),s.x=[n[0].chartX,n[1]&&n[1].chartX],s.y=[n[0].chartY,n[1]&&n[1].chartY],Pe(o.axes,function(e){if(e.zoomEnabled){var t=o.bounds[e.horiz?"h":"v"],n=e.minPixelPadding,i=e.toPixels(Je(e.options.min,e.dataMin)),a=e.toPixels(Je(e.options.max,e.dataMax)),s=fe(i,a);i=pe(i,a);t.min=fe(e.pos,s-n),t.max=pe(e.pos+e.len,i+n)}}),t.res=!0):n.length&&(l||(t.selectionMarker=l=Xe({destroy:Se,touch:!0},o.plotBox)),t.pinchTranslate(n,i,c,l,u,s),t.hasPinched=r,t.scaleGroups(c,u),!r&&t.followTouchMove&&1===a?this.runPointActions(t.normalize(e)):t.res&&(t.res=!1,this.reset(!1,0)))},touch:function(e,t){var n=this.chart;rt=n.index,1===e.touches.length?(e=this.normalize(e),n.isInsidePlot(e.chartX-n.plotLeft,e.chartY-n.plotTop)&&!n.openMenu?(t&&this.runPointActions(e),this.pinch(e)):t&&this.reset()):2===e.touches.length&&this.pinch(e)},onContainerTouchStart:function(e){this.touch(e,!0)},onContainerTouchMove:function(e){this.touch(e)},onDocumentTouchEnd:function(e){Re[rt]&&Re[rt].pointer.drop(e)}}),l.PointerEvent||l.MSPointerEvent){var dt={},ut=!!l.PointerEvent,_t=function(){var e,t=[];for(e in t.item=function(e){return this[e]},dt)dt.hasOwnProperty(e)&&t.push({pageX:dt[e].pageX,pageY:dt[e].pageY,target:dt[e].target});return t},ht=function(e,t,n,i){"touch"!==e.pointerType&&e.pointerType!==e.MSPOINTER_TYPE_TOUCH||!Re[rt]||(i(e),(i=Re[rt].pointer)[t]({type:n,target:e.currentTarget,preventDefault:Se,touches:_t()}))};Xe(ct.prototype,{onContainerPointerDown:function(e){ht(e,"onContainerTouchStart","touchstart",function(e){dt[e.pointerId]={pageX:e.pageX,pageY:e.pageY,target:e.currentTarget}})},onContainerPointerMove:function(e){ht(e,"onContainerTouchMove","touchmove",function(e){dt[e.pointerId]={pageX:e.pageX,pageY:e.pageY},dt[e.pointerId].target||(dt[e.pointerId].target=e.currentTarget)})},onDocumentPointerUp:function(e){ht(e,"onDocumentTouchEnd","touchend",function(e){delete dt[e.pointerId]})},batchMSEvents:function(e){e(this.chart.container,ut?"pointerdown":"MSPointerDown",this.onContainerPointerDown),e(this.chart.container,ut?"pointermove":"MSPointerMove",this.onContainerPointerMove),e(ce,ut?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}}),Ze(ct.prototype,"init",function(e,t,n){e.call(this,t,n),this.hasZoom&&O(t.container,{"-ms-touch-action":"none","touch-action":"none"})}),Ze(ct.prototype,"setDOMEvents",function(e){e.apply(this),(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(ze)}),Ze(ct.prototype,"destroy",function(e){this.batchMSEvents(qe),e.call(this)})}var pt=le.Legend=function(e,t){this.init(e,t)};pt.prototype={init:function(e,t){var n=this,i=t.itemStyle,a=t.itemMarginTop||0;(this.options=t).enabled&&(n.itemStyle=i,n.itemHiddenStyle=I(i,t.itemHiddenStyle),n.itemMarginTop=a,n.padding=i=Je(t.padding,8),n.initialItemX=i,n.initialItemY=i-5,n.maxItemWidth=0,n.chart=e,n.itemHeight=0,n.symbolWidth=Je(t.symbolWidth,16),n.pages=[],n.render(),ze(n.chart,"endResize",function(){n.positionCheckboxes()}))},colorizeItem:function(e,t){var n,i=this.options,a=e.legendItem,s=e.legendLine,o=e.legendSymbol,r=this.itemHiddenStyle.color,l=(i=t?i.itemStyle.color:r,t?e.legendColor||e.color||"#CCC":r),c=(r=e.options&&e.options.marker,{fill:l});if(a&&a.css({fill:i,color:i}),s&&s.attr({stroke:l}),o){if(r&&o.isMarker)for(
n in c.stroke=l,r=e.convertAttribs(r))(a=r[n])!==P&&(c[n]=a);o.attr(c)}},positionItem:function(e){var t=(n=this.options).symbolPadding,n=!n.rtl,i=(a=e._legendItemPos)[0],a=a[1],s=e.checkbox;(e=e.legendGroup)&&e.element&&e.translate(n?i:this.legendWidth-i-2*t-4,a),s&&(s.x=i,s.y=a)},destroyItem:function(t){var e=t.checkbox;Pe(["legendItem","legendLine","legendSymbol","legendGroup"],function(e){t[e]&&(t[e]=t[e].destroy())}),e&&o(t.checkbox)},destroy:function(){var e=this.group,t=this.box;t&&(this.box=t.destroy()),e&&(this.group=e.destroy())},positionCheckboxes:function(i){var a,s=this.group.alignAttr,o=this.clipHeight||this.legendHeight,r=this.titleHeight;s&&(a=s.translateY,Pe(this.allItems,function(e){var t,n=e.checkbox;n&&(t=a+r+n.y+(i||0)+3,O(n,{left:s.translateX+e.checkboxOffset+n.x-20+"px",top:t+"px",display:a-6<t&&t<a+o-6?"":"none"}))}))},renderTitle:function(){var e=this.padding,t=this.options.title,n=0;t.text&&(this.title||(this.title=this.chart.renderer.label(t.text,e-3,e-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(t.style).add(this.group)),n=(e=this.title.getBBox()).height,this.offsetWidth=e.width,this.contentGroup.attr({translateY:n})),this.titleHeight=n},setText:function(e){var t=this.options;e.legendItem.attr({text:t.labelFormat?v(t.labelFormat,e):t.labelFormatter.call(e)})},renderItem:function(e){var t=this.chart,n=t.renderer,i=this.options,a="horizontal"===i.layout,s=this.symbolWidth,o=i.symbolPadding,r=this.itemStyle,l=this.itemHiddenStyle,c=this.padding,d=a?Je(i.itemDistance,20):0,u=!i.rtl,_=i.width,h=i.itemMarginBottom||0,p=this.itemMarginTop,f=this.initialItemX,m=e.legendItem,g=e.series&&e.series.drawLegendSymbol?e.series:e,A=g.options,v=(A=this.createCheckboxForItem&&A&&A.showCheckbox,i.useHTML);m||(e.legendGroup=n.g("legend-item").attr({zIndex:1}).add(this.scrollGroup),e.legendItem=m=n.text("",u?s+o:-o,this.baseline||0,v).css(I(e.visible?r:l)).attr({align:u?"left":"right",zIndex:2}).add(e.legendGroup),this.baseline||(this.fontMetrics=n.fontMetrics(r.fontSize,m),this.baseline=this.fontMetrics.f+3+p,m.attr("y",this.baseline)),g.drawLegendSymbol(this,e),this.setItemEvents&&this.setItemEvents(e,m,v,r,l),A&&this.createCheckboxForItem(e)),this.colorizeItem(e,e.visible),this.setText(e),n=m.getBBox(),s=e.checkboxOffset=i.itemWidth||e.legendItemWidth||s+o+n.width+d+(A?20:0),this.itemHeight=o=ue(e.legendItemHeight||n.height),a&&this.itemX-f+s>(_||t.chartWidth-2*c-f-i.x)&&(this.itemX=f,this.itemY+=p+this.lastLineHeight+h,this.lastLineHeight=0),this.maxItemWidth=pe(this.maxItemWidth,s),this.lastItemY=p+this.itemY+h,this.lastLineHeight=pe(o,this.lastLineHeight),e._legendItemPos=[this.itemX,this.itemY],a?this.itemX+=s:(this.itemY+=p+o+h,this.lastLineHeight=o),this.offsetWidth=_||pe((a?this.itemX-f-d:s)+c,this.offsetWidth)},getAllItems:function(){var n=[];return Pe(this.chart.series,function(e){var t=e.options;Je(t.showInLegend,!D(t.linkedTo)&&P,!0)&&(n=n.concat(e.legendItems||("point"===t.legendType?e.data:e)))}),n},adjustMargins:function(n,i){var a=this.chart,s=this.options,o=s.align.charAt(0)+s.verticalAlign.charAt(0)+s.layout.charAt(0);this.display&&!s.floating&&Pe([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(e,t){e.test(o)&&!D(n[t])&&(a[Ke[t]]=pe(a[Ke[t]],a.legend[(t+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][t]*s[t%2?"x":"y"]+Je(s.margin,12)+i[t]))})},render:function(){var e,t,n,i,a=this,s=a.chart,o=s.renderer,r=a.group,l=a.box,c=a.options,d=a.padding,u=c.borderWidth,_=c.backgroundColor;a.itemX=a.initialItemX,a.itemY=a.initialItemY,a.offsetWidth=0,a.lastItemY=0,r||(a.group=r=o.g("legend").attr({zIndex:7}).add(),a.contentGroup=o.g().attr({zIndex:1}).add(r),a.scrollGroup=o.g().add(a.contentGroup)),a.renderTitle(),T(e=a.getAllItems(),function(e,t){return(e.options&&e.options.legendIndex||0)-(t.options&&t.options.legendIndex||0)}),c.reversed&&e.reverse(),a.allItems=e,a.display=t=!!e.length,a.lastLineHeight=0,Pe(e,function(e){a.renderItem(e)}),n=(c.width||a.offsetWidth)+d,i=a.lastItemY+a.lastLineHeight+a.titleHeight,i=a.handleOverflow(i),i+=d,(u||_)&&(l?0<n&&0<i&&(l[l.isNew?"attr":"animate"](l.crisp({width:n,height:i})),l.isNew=!1):(a.box=l=o.rect(0,0,n,i,c.borderRadius,u||0).attr({stroke:c.borderColor,"stroke-width":u||0,fill:_||"none"}).add(r).shadow(c.shadow),l.isNew=!0),l[t?"show":"hide"]()),a.legendWidth=n,a.legendHeight=i,Pe(e,function(e){a.positionItem(e)}),t&&r.align(Xe({width:n,height:i},c),!0,"spacingBox"),s.isResizing||this.positionCheckboxes()},handleOverflow:function(e){var s,o,t=this,n=this.chart,i=n.renderer,a=this.options,r=a.y,l=(r=n.spacingBox.height+("top"===a.verticalAlign?-r:r)-this.padding,a.maxHeight),c=this.clipRect,d=a.navigation,u=Je(d.animation,!0),_=d.arrowSize||12,h=this.nav,p=this.pages,f=this.padding,m=this.allItems,g=function(e){c.attr({height:e}),t.contentGroup.div&&(t.contentGroup.div.style.clip="rect("+f+"px,9999px,"+(f+e)+"px,0)")};return"horizontal"===a.layout&&(r/=2),l&&(r=fe(r,l)),p.length=0,r<e?(this.clipHeight=s=pe(r-20-this.titleHeight-f,0),this.currentPage=Je(this.currentPage,1),this.fullHeight=e,Pe(m,function(e,t){var n=e._legendItemPos[1],i=ue(e.legendItem.getBBox().height),a=p.length;(!a||n-p[a-1]>s&&(o||n)!==p[a-1])&&(p.push(o||n),a++),t===m.length-1&&n+i-p[a-1]>s&&p.push(n),n!==o&&(o=n)}),c||(c=t.clipRect=i.clipRect(0,f,9999,0),t.contentGroup.clip(c)),g(s),h||(this.nav=h=i.g().attr({zIndex:1}).add(this.group),this.up=i.symbol("triangle",0,0,_,_).on("click",function(){t.scroll(-1,u)}).add(h),this.pager=i.text("",15,10).css(d.style).add(h),this.down=i.symbol("triangle-down",0,0,_,_).on("click",function(){t.scroll(1,u)}).add(h)),t.scroll(0),e=r):h&&(g(n.chartHeight),h.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0),e},scroll:function(e,t){var n=this.pages,i=n.length,a=this.currentPage+e,s=this.clipHeight,o=(r=this.options.navigation).activeColor,r=r.inactiveColor,l=this.pager,c=this.padding;i<a&&(a=i),0<a&&(t!==P&&F(t,this.chart),this.nav.attr({translateX:c,translateY:s+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:1===a?r:o}).css({cursor:1===a?"default":"pointer"}),l.attr({text:a+"/"+i}),this.down.attr({x:18+this.pager.getBBox().width,fill:a===i?r:o}).css({cursor:a===i?"default":"pointer"}),n=-n[a-1]+this.initialItemY,this.scrollGroup.animate({translateY:n}),this.currentPage=a,this.positionCheckboxes(n))}},nt=le.LegendSymbolMixin={drawRectangle:function(e,t){var n=e.options.symbolHeight||e.fontMetrics.f;t.legendSymbol=this.chart.renderer.rect(0,e.baseline-n+1,e.symbolWidth,n,e.options.symbolRadius||0).attr({zIndex:3}).add(t.legendGroup)},drawLineMarker:function(e){var t,n=this.options,i=n.marker,a=e.symbolWidth,s=this.chart.renderer,o=this.legendGroup;e=e.baseline-ue(.3*e.fontMetrics.b);n.lineWidth&&(t={"stroke-width":n.lineWidth},n.dashStyle&&(t.dashstyle=n.dashStyle),this.legendLine=s.path(["M",0,e,"L",a,e]).attr(t).add(o)),i&&!1!==i.enabled&&(n=i.radius,this.legendSymbol=i=s.symbol(this.symbol,a/2-n,e-n,2*n,2*n,i).add(o),i.isMarker=!0)}},(/Trident\/7\.0/.test(ye)||Ee)&&Ze(pt.prototype,"positionItem",function(e,t){var n=this,i=function(){t._legendItemPos&&e.call(n,t)};i(),setTimeout(i)});var ft=le.Chart=function(){this.getArgs.apply(this,arguments)};le.chart=function(e,t,n){return new ft(e,t,n)},ft.prototype={callbacks:[],getArgs:function(){var e=[].slice.call(arguments);(g(e[0])||e[0].nodeName)&&(this.renderTo=e.shift()),this.init(e[0],e[1])},init:function(e,t){var n,i=e.series;e.series=null,(n=I(H,e)).series=e.series=i,this.userOptions=e,i=n.chart,this.margin=this.splashArray("margin",i),this.spacing=this.splashArray("spacing",i);var a=i.events;this.bounds={h:{},v:{}},this.callback=t,this.isResizing=0,this.options=n,this.axes=[],this.series=[],this.hasCartesianSeries=i.showAxes;var s,o=this;if(o.index=Re.length,Re.push(o),Be++,!1!==i.reflow&&ze(o,"load",function(){o.initReflow()}),a)for(s in a)ze(o,s,a[s]);o.xAxis=[],o.yAxis=[],o.animation=!Ie&&Je(i.animation,!0),o.pointCount=o.colorCounter=o.symbolCounter=0,o.firstRender()},initSeries:function(e){var t=this.options.chart;return(t=Me[e.type||t.type||t.defaultSeriesType])||y(17,!0),(t=new t).init(this,e),t},isInsidePlot:function(e,t,n){var i=n?t:e;e=n?e:t;return 0<=i&&i<=this.plotWidth&&0<=e&&e<=this.plotHeight},redraw:function(e){var n,t,i=this.axes,a=this.series,s=this.pointer,o=this.legend,r=this.isDirtyLegend,l=this.hasCartesianSeries,c=this.isDirtyBox,d=a.length,u=d,_=this.renderer,h=_.isHidden(),p=[];for(F(e,this),h&&this.cloneRenderTo(),this.layOutTitles();u--;)if((e=a[u]).options.stacking&&(n=!0,e.isDirty)){t=!0;break}if(t)for(u=d;u--;)(e=a[u]).options.stacking&&(e.isDirty=!0);Pe(a,function(e){e.isDirty&&"point"===e.options.legendType&&(e.updateTotals&&e.updateTotals(),r=!0)}),r&&o.options.enabled&&(o.render(),this.isDirtyLegend=!1),n&&this.getStacks(),l&&!this.isResizing&&(this.maxTicks=null,Pe(i,function(e){e.setScale()})),this.getMargins(),l&&(Pe(i,function(e){e.isDirty&&(c=!0)}),Pe(i,function(e){var t=e.min+","+e.max;e.extKey!==t&&(e.extKey=t,p.push(function(){We(e,"afterSetExtremes",Xe(e.eventArgs,e.getExtremes())),delete e.eventArgs})),(c||n)&&e.redraw()})),c&&this.drawChartBox(),Pe(a,function(e){e.isDirty&&e.visible&&(!e.isCartesian||e.xAxis)&&e.redraw()}),s&&s.reset(!0),_.draw(),We(this,"redraw"),h&&this.cloneRenderTo(!0),Pe(p,function(e){e.call()})},get:function(e){var t,n,i=this.axes,a=this.series;for(t=0;t<i.length;t++)if(i[t].options.id===e)return i[t];for(t=0;t<a.length;t++)if(a[t].options.id===e)return a[t];for(t=0;t<a.length;t++)for(n=a[t].points||[],i=0;i<n.length;i++)if(n[i].id===e)return n[i];return null},getAxes:function(){var t=this,e=(n=this.options).xAxis=h(n.xAxis||{}),n=n.yAxis=h(n.yAxis||{});Pe(e,function(e,t){e.index=t,e.isX=!0}),Pe(n,function(e,t){e.index=t}),e=e.concat(n),Pe(e,function(e){new ot(t,e)})},getSelectedPoints:function(){var t=[];return Pe(this.series,function(e){t=t.concat(Ue(e.points||[],function(e){return e.selected}))}),t},getSelectedSeries:function(){return Ue(this.series,function(e){return e.selected})},setTitle:function(e,t,n){var i,a,s=this,o=s.options;a=o.title=I(o.title,e),i=o.subtitle=I(o.subtitle,t),Pe([["title",e,a],["subtitle",t,o=i]],function(e){var t=e[0],n=s[t],i=e[1];e=e[2];n&&i&&(s[t]=n=n.destroy()),e&&e.text&&!n&&(s[t]=s.renderer.text(e.text,0,0,e.useHTML).attr({align:e.align,"class":"highcharts-"+t,zIndex:e.zIndex||4}).css(e.style).add())}),s.layOutTitles(n)},layOutTitles:function(e){var t=0,n=this.title,i=this.subtitle,a=(s=this.options).title,s=s.subtitle,o=this.renderer,r=this.spacingBox.width-44;!n||(n.css({width:(a.width||r)+"px"}).align(Xe({y:o.fontMetrics(a.style.fontSize,n).b-3},a),!1,"spacingBox"),a.floating||a.verticalAlign)||(t=n.getBBox().height),i&&(i.css({width:(s.width||r)+"px"}).align(Xe({y:t+(a.margin-13)+o.fontMetrics(s.style.fontSize,n).b},s),!1,"spacingBox"),!s.floating&&!s.verticalAlign&&(t=he(t+i.getBBox().height))),n=this.titleOffset!==t,this.titleOffset=t,!this.isDirtyBox&&n&&(this.isDirtyBox=n,this.hasRendered&&Je(e,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var e=(t=this.options.chart).width,t=t.height,n=this.renderToClone||this.renderTo;D(e)||(this.containerWidth=je(n,"width")),D(t)||(this.containerHeight=je(n,"height")),this.chartWidth=pe(0,e||this.containerWidth||600),this.chartHeight=pe(0,Je(t,19<this.containerHeight?this.containerHeight:400))},cloneRenderTo:function(e){var t=this.renderToClone,n=this.container;e?t&&(this.renderTo.appendChild(n),o(t),delete this.renderToClone):(n&&n.parentNode===this.renderTo&&this.renderTo.removeChild(n),this.renderToClone=t=this.renderTo.cloneNode(0),O(t,{position:"absolute",top:"-9999px",display:"block"}),t.style.setProperty&&t.style.setProperty("display","block","important"),ce.body.appendChild(t),n&&t.appendChild(n))},getContainer:function(){var e,t,n,i=this.options,a=i.chart;e=this.renderTo;var s="highcharts-"+Oe++;e||(this.renderTo=e=a.renderTo),g(e)&&(this.renderTo=e=ce.getElementById(e)),e||y(13,!0),t=f(x(e,"data-highcharts-chart")),!isNaN(t)&&Re[t]&&Re[t].hasRendered&&Re[t].destroy(),x(e,"data-highcharts-chart",this.index),e.innerHTML="",!a.skipClone&&!e.offsetWidth&&this.cloneRenderTo(),this.getChartSize(),t=this.chartWidth,n=this.chartHeight,this.container=e=S(Ne,{className:"highcharts-container"+(a.className?" "+a.className:""),id:s},Xe({position:"relative",overflow:"hidden",width:t+"px",height:n+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},a.style),this.renderToClone||e),this._cursor=e.style.cursor,this.renderer=new(le[a.renderer]||r)(e,t,n,a.style,a.forExport,i.exporting&&i.exporting.allowHTML),Ie&&this.renderer.create(this,e,t,n),this.renderer.chartIndex=this.index},getMargins:function(e){var t=this.spacing,n=this.margin,i=this.titleOffset;this.resetMargins(),i&&!D(n[0])&&(this.plotTop=pe(this.plotTop,i+this.options.title.margin+t[0])),this.legend.adjustMargins(n,t),this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin),this.extraTopMargin&&(this.plotTop+=this.extraTopMargin),e||this.getAxisMargins()},getAxisMargins:function(){var n=this,i=n.axisOffset=[0,0,0,0],a=n.margin;n.hasCartesianSeries&&Pe(n.axes,function(e){e.visible&&e.getOffset()}),Pe(Ke,function(e,t){D(a[t])||(n[e]+=i[t])}),n.setChartSize()},reflow:function(e){var t=this,n=t.options.chart,i=t.renderTo,a=n.width||je(i,"width"),s=n.height||je(i,"height");n=e?e.target:l;t.hasUserSize||t.isPrinting||!a||!s||n!==l&&n!==ce||(a===t.containerWidth&&s===t.containerHeight||(clearTimeout(t.reflowTimeout),t.reflowTimeout=k(function(){t.container&&(t.setSize(a,s,!1),t.hasUserSize=null)},e?100:0)),t.containerWidth=a,t.containerHeight=s)},initReflow:function(){var t=this,e=function(e){t.reflow(e)};ze(l,"resize",e),ze(t,"destroy",function(){qe(l,"resize",e)})},setSize:function(e,t,n){var i,a,s=this,o=s.renderer;s.isResizing+=1,F(n,s),s.oldChartHeight=s.chartHeight,s.oldChartWidth=s.chartWidth,D(e)&&(s.chartWidth=i=pe(0,ue(e)),s.hasUserSize=!!i),D(t)&&(s.chartHeight=a=pe(0,ue(t))),((e=o.globalAnimation)?Ye:O)(s.container,{width:i+"px",height:a+"px"},e),s.setChartSize(!0),o.setSize(i,a,n),s.maxTicks=null,Pe(s.axes,function(e){e.isDirty=!0,e.setScale()}),Pe(s.series,function(e){e.isDirty=!0}),s.isDirtyLegend=!0,s.isDirtyBox=!0,s.layOutTitles(),s.getMargins(),s.redraw(n),s.oldChartHeight=null,We(s,"resize"),k(function(){s&&We(s,"endResize",null,function(){s.isResizing-=1})},!1===(e=o.globalAnimation)?0:e&&e.duration||500)},setChartSize:function(e){var t,n,i,a,s=this.inverted,o=this.renderer,r=this.chartWidth,l=this.chartHeight,c=this.options.chart,d=this.spacing,u=this.clipOffset;this.plotLeft=t=ue(this.plotLeft),this.plotTop=n=ue(this.plotTop),this.plotWidth=i=pe(0,ue(r-t-this.marginRight)),this.plotHeight=a=pe(0,ue(l-n-this.marginBottom)),this.plotSizeX=s?a:i,this.plotSizeY=s?i:a,this.plotBorderWidth=c.plotBorderWidth||0,this.spacingBox=o.spacingBox={x:d[3],y:d[0],width:r-d[3]-d[1],height:l-d[0]-d[2]},this.plotBox=o.plotBox={x:t,y:n,width:i,height:a},r=2*_e(this.plotBorderWidth/2),s=he(pe(r,u[3])/2),o=he(pe(r,u[0])/2),this.clipBox={x:s,y:o,width:_e(this.plotSizeX-pe(r,u[1])/2-s),height:pe(0,_e(this.plotSizeY-pe(r,u[2])/2-o))},e||Pe(this.axes,function(e){e.setAxisSize(),e.setAxisTranslation()})},resetMargins:function(){var n=this;Pe(Ke,function(e,t){n[e]=Je(n.margin[t],n.spacing[t])}),n.axisOffset=[0,0,0,0],n.clipOffset=[0,0,0,0]},drawChartBox:function(){var e,t=this.options.chart,n=this.renderer,i=this.chartWidth,a=this.chartHeight,s=this.chartBackground,o=this.plotBackground,r=this.plotBorder,l=this.plotBGImage,c=t.borderWidth||0,d=t.backgroundColor,u=t.plotBackgroundColor,_=t.plotBackgroundImage,h=t.plotBorderWidth||0,p=this.plotLeft,f=this.plotTop,m=this.plotWidth,g=this.plotHeight,A=this.plotBox,v=this.clipRect,b=this.clipBox;e=c+(t.shadow?8:0),(c||d)&&(s?s.animate(s.crisp({width:i-e,height:a-e})):(s={fill:d||"none"},c&&(s.stroke=t.borderColor,s["stroke-width"]=c),this.chartBackground=n.rect(e/2,e/2,i-e,a-e,t.borderRadius,c).attr(s).addClass("highcharts-background").add().shadow(t.shadow))),u&&(o?o.animate(A):this.plotBackground=n.rect(p,f,m,g,0).attr({fill:u}).add().shadow(t.plotShadow)),_&&(l?l.animate(A):this.plotBGImage=n.image(_,p,f,m,g).add()),v?v.animate({width:b.width,height:b.height}):this.clipRect=n.clipRect(b),h&&(r?r.animate(r.crisp({x:p,y:f,width:m,height:g,strokeWidth:-h})):this.plotBorder=n.rect(p,f,m,g,0,-h).attr({stroke:t.plotBorderColor,"stroke-width":h,fill:"none",zIndex:1}).add()),this.isDirtyBox=!1},propFromSeries:function(){var t,n,i,a=this,s=a.options.chart,o=a.options.series;Pe(["inverted","angular","polar"],function(e){for(t=Me[s.type||s.defaultSeriesType],i=a[e]||s[e]||t&&t.prototype[e],n=o&&o.length;!i&&n--;)(t=Me[o[n].type])&&t.prototype[e]&&(i=!0);a[e]=i})},linkSeries:function(){var n=this,e=n.series;Pe(e,function(e){e.linkedSeries.length=0}),Pe(e,function(e){var t=e.options.linkedTo;g(t)&&(t=":previous"===t?n.series[e.index-1]:n.get(t))&&(t.linkedSeries.push(e),e.linkedParent=t,e.visible=Je(e.options.visible,t.options.visible,e.visible))})},renderSeries:function(){Pe(this.series,function(e){e.translate(),e.render()})},renderLabels:function(){var a=this,s=a.options.labels;s.items&&Pe(s.items,function(e){var t=Xe(s.style,e.style),n=f(t.left)+a.plotLeft,i=f(t.top)+a.plotTop+12;delete t.left,delete t.top,a.renderer.text(e.html,n,i).attr({zIndex:2}).css(t).add()})},render:function(){var e,t,n,i,a=this.axes,s=this.renderer,o=this.options;this.setTitle(),this.legend=new pt(this,o.legend),this.getStacks&&this.getStacks(),this.getMargins(!0),this.setChartSize(),e=this.plotWidth,t=this.plotHeight-=21,Pe(a,function(e){e.setScale()}),this.getAxisMargins(),n=1.1<e/this.plotWidth,i=1.05<t/this.plotHeight,(n||i)&&(this.maxTicks=null,Pe(a,function(e){(e.horiz&&n||!e.horiz&&i)&&e.setTickInterval(!0)}),this.getMargins()),this.drawChartBox(),this.hasCartesianSeries&&Pe(a,function(e){e.visible&&e.render()}),this.seriesGroup||(this.seriesGroup=s.g("series-group").attr({zIndex:3}).add()),this.renderSeries(),this.renderLabels(),this.showCredits(o.credits),this.hasRendered=!0},showCredits:function(e){e.enabled&&!this.credits&&(this.credits=this.renderer.text(e.text,0,0).on("click",function(){e.href&&(l.location.href=e.href)}).attr({align:e.position.align,zIndex:8}).css(e.style).add().align(e.position))},destroy:function(){var e,n=this,t=n.axes,i=n.series,a=n.container,s=a&&a.parentNode;for(We(n,"destroy"),Re[n.index]=P,Be--,n.renderTo.removeAttribute("data-highcharts-chart"),qe(n),e=t.length;e--;)t[e]=t[e].destroy();for(e=i.length;e--;)i[e]=i[e].destroy();for(e in Pe("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(e){var t=n[e];t&&t.destroy&&(n[e]=t.destroy())}),a&&(a.innerHTML="",qe(a),s&&o(a)),n)delete n[e]},isReadyToRender:function(){var e=this;return!(!xe&&l==l.top&&"complete"!==ce.readyState||Ie&&!l.canvg)||(Ie?it.push(function(){e.firstRender()},e.options.global.canvasToolsURL):ce.attachEvent("onreadystatechange",function(){ce.detachEvent("onreadystatechange",e.firstRender),"complete"===ce.readyState&&e.firstRender()}),!1)},firstRender:function(){var t=this,e=t.options;t.isReadyToRender()&&(t.getContainer(),We(t,"init"),t.resetMargins(),t.setChartSize(),t.propFromSeries(),t.getAxes(),Pe(e.series||[],function(e){t.initSeries(e)}),t.linkSeries(),We(t,"beforeRender"),le.Pointer&&(t.pointer=new ct(t,e)),t.render(),t.renderer.draw(),t.renderer.imgCount||t.onload(),t.cloneRenderTo(!0))},onload:function(){var t=this;Pe([this.callback].concat(this.callbacks),function(e){e&&void 0!==t.index&&e.apply(t,[t])}),t.renderer.imgCount||We(t,"load")},splashArray:function(e,t){var n=_(n=t[e])?n:[n,n,n,n];return[Je(t[e+"Top"],n[0]),Je(t[e+"Right"],n[1]),Je(t[e+"Bottom"],n[2]),Je(t[e+"Left"],n[3])]}};st=le.CenteredSeriesMixin={getCenter:function(){var e,t,n=this.options,i=this.chart,a=2*(n.slicedOffset||0),s=i.plotWidth-2*a,o=(i=i.plotHeight-2*a,n.center),r=(o=[Je(o[0],"50%"),Je(o[1],"50%"),n.size||"100%",n.innerSize||0],fe(s,i));for(e=0;e<4;++e)t=o[e],n=e<2||2===e&&/%$/.test(t),o[e]=(/%$/.test(t)?[s,i,r,o[2]][e]*parseFloat(t)/100:parseFloat(t))+(n?a:0);return o[3]>o[2]&&(o[3]=o[2]),o}};var mt=function(){};mt.prototype={init:function(e,t,n){return this.series=e,this.color=e.color,this.applyOptions(t,n),this.pointAttr={},e.options.colorByPoint&&(t=e.options.colors||e.chart.options.colors,this.color=this.color||t[e.colorCounter++],e.colorCounter===t.length)&&(e.colorCounter=0),e.chart.pointCount++,this},applyOptions:function(e,t){var n=this.series,i=n.options.pointValKey||n.pointValKey;e=mt.prototype.optionsToObject.call(this,e);return Xe(this,e),this.options=this.options?Xe(this.options,e):e,i&&(this.y=this[i]),this.isNull=null===this.y,this.x===P&&n&&(this.x=t===P?n.autoIncrement():t),this},optionsToObject:function(e){var t={},n=this.series,i=n.options.keys,a=i||n.pointArrayMap||["y"],s=a.length,o=0,r=0;if("number"==typeof e||null===e)t[a[0]]=e;else if(A(e))for(!i&&e.length>s&&("string"===(n=typeof e[0])?t.name=e[0]:"number"===n&&(t.x=e[0]),o++);r<s;)i&&void 0===e[o]||(t[a[r]]=e[o]),o++,r++;else"object"==typeof e&&((t=e).dataLabels&&(n._hasPointLabels=!0),e.marker&&(n._hasPointMarkers=!0));return t},destroy:function(){var e,t=this.series.chart,n=t.hoverPoints;for(e in t.pointCount--,n&&(this.setState(),d(n,this),!n.length)&&(t.hoverPoints=null),this===t.hoverPoint&&this.onMouseOut(),(this.graphic||this.dataLabel)&&(qe(this),this.destroyElements()),this.legendItem&&t.legend.destroyItem(this),this)this[e]=null},destroyElements:function(){for(var e,t=["graphic","dataLabel","dataLabelUpper","connector","shadowGroup"],n=6;n--;)this[e=t[n]]&&(this[e]=this[e].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(t){var e=this.series,n=e.tooltipOptions,i=Je(n.valueDecimals,""),a=n.valuePrefix||"",s=n.valueSuffix||"";return Pe(e.pointArrayMap||["y"],function(e){e="{point."+e,(a||s)&&(t=t.replace(e+"}",a+e+"}"+s)),t=t.replace(e+"}",e+":,."+i+"f}")}),v(t,{point:this,series:this.series})},firePointEvent:function(e,t,n){var i=this,a=this.series.options;(a.point.events[e]||i.options&&i.options.events&&i.options.events[e])&&this.importEvents(),"click"===e&&a.allowPointSelect&&(n=function(e){i.select&&i.select(null,e.ctrlKey||e.metaKey||e.shiftKey)}),We(this,e,t,n)},visible:!0};var gt=le.Series=function(){};gt.prototype={isCartesian:!0,type:"line",pointClass:mt,sorted:!0,requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(e,t){var n,i,a=this,s=e.series,o=function(e,t){return Je(e.options.index,e._i)-Je(t.options.index,t._i)};for(n in a.chart=e,a.options=t=a.setOptions(t),a.linkedSeries=[],a.bindAxes(),Xe(a,{name:t.name,state:"",pointAttr:{},visible:!1!==t.visible,selected:!0===t.selected}),Ie&&(t.animation=!1),i=t.events)ze(a,n,i[n]);(i&&i.click||t.point&&t.point.events&&t.point.events.click||t.allowPointSelect)&&(e.runTrackerClick=!0),a.getColor(),a.getSymbol(),Pe(a.parallelArrays,function(e){a[e+"Data"]=[]}),a.setData(t.data,!1),a.isCartesian&&(e.hasCartesianSeries=!0),s.push(a),a._i=s.length-1,T(s,o),this.yAxis&&T(this.yAxis.series,o),Pe(s,function(e,t){e.index=t,e.name=e.name||"Series "+(t+1)})},bindAxes:function(){var n,i=this,a=i.options,e=i.chart;Pe(i.axisTypes||[],function(t){Pe(e[t],function(e){n=e.options,(a[t]===n.index||a[t]!==P&&a[t]===n.id||a[t]===P&&0===n.index)&&(e.series.push(i),(i[t]=e).isDirty=!0)}),!i[t]&&i.optionalAxis!==t&&y(18,!0)})},updateParallelArrays:function(n,i){var a=n.series,t=arguments;Pe(a.parallelArrays,"number"==typeof i?function(e){var t="y"===e&&a.toYData?a.toYData(n):n[e];a[e+"Data"][i]=t}:function(e){Array.prototype[i].apply(a[e+"Data"],Array.prototype.slice.call(t,2))})},autoIncrement:function(){var e,t=this.options,n=this.xIncrement,i=t.pointIntervalUnit;n=Je(n,t.pointStart,0);return this.pointInterval=e=Je(this.pointInterval,t.pointInterval,1),"month"!==i&&"year"!==i||(t=new z(n),e=(t="month"===i?+t[oe](t[Z]()+e):+t[re](t[ee]()+e))-n),this.xIncrement=n+e,n},setOptions:function(e){var t,n=(t=this.chart).options.plotOptions,i=(t=t.userOptions||{}).plotOptions||{},a=n[this.type];return this.userOptions=e,n=I(a,n.series,e),this.tooltipOptions=I(H.tooltip,H.plotOptions[this.type].tooltip,t.tooltip,i.series&&i.series.tooltip,i[this.type]&&i[this.type].tooltip,e.tooltip),null===a.marker&&delete n.marker,this.zoneAxis=n.zoneAxis,e=this.zones=(n.zones||[]).slice(),!n.negativeColor&&!n.negativeFillColor||n.zones||e.push({value:n[this.zoneAxis+"Threshold"]||n.threshold||0,color:n.negativeColor,fillColor:n.negativeFillColor}),e.length&&D(e[e.length-1].value)&&e.push({color:this.color,fillColor:this.fillColor}),n},getCyclic:function(e,t,n){var i=this.userOptions,a="_"+e+"Index",s=e+"Counter";t||(D(i[a])?t=i[a]:(i[a]=t=this.chart[s]%n.length,this.chart[s]+=1),t=n[t]),this[e]=t},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||et[this.type].color,this.chart.options.colors)},getSymbol:function(){var e=this.options.marker;this.getCyclic("symbol",e.symbol,this.chart.options.symbols),/^url/.test(this.symbol)&&(e.radius=0)},drawLegendSymbol:nt.drawLineMarker,setData:function(e,t,n,i){var a,s=this,o=s.points,r=o&&o.length||0,l=s.options,c=s.chart,d=null,u=s.xAxis,_=u&&!!u.categories,h=l.turboThreshold,p=this.xData,f=this.yData,m=(a=s.pointArrayMap)&&a.length;if(a=(e=e||[]).length,t=Je(t,!0),!1!==i&&a&&r===a&&!s.cropped&&!s.hasGroupedData&&s.visible)Pe(e,function(e,t){o[t].update&&e!==l.data[t]&&o[t].update(e,!1,null,!1)});else{if(s.xIncrement=null,s.colorCounter=0,Pe(this.parallelArrays,function(e){s[e+"Data"].length=0}),h&&h<a){for(n=0;null===d&&n<a;)d=e[n],n++;if($(d)){for(_=Je(l.pointStart,0),d=Je(l.pointInterval,1),n=0;n<a;n++)p[n]=_,f[n]=e[n],_+=d;s.xIncrement=_}else if(A(d))if(m)for(n=0;n<a;n++)d=e[n],p[n]=d[0],f[n]=d.slice(1,m+1);else for(n=0;n<a;n++)d=e[n],p[n]=d[0],f[n]=d[1];else y(12)}else for(n=0;n<a;n++)e[n]!==P&&(d={series:s},s.pointClass.prototype.applyOptions.apply(d,[e[n]]),s.updateParallelArrays(d,n),_&&D(d.name))&&(u.names[d.x]=d.name);for(g(f[0])&&y(14,!0),s.data=[],s.options.data=s.userOptions.data=e,n=r;n--;)o[n]&&o[n].destroy&&o[n].destroy();u&&(u.minRange=u.userMinRange),s.isDirty=s.isDirtyData=c.isDirtyBox=!0,n=!1}"point"===l.legendType&&(this.processData(),this.generatePoints()),t&&c.redraw(n)},processData:function(e){var t,n=this.xData,i=this.yData,a=n.length;t=0;var s,o,r,l=this.xAxis;r=(h=this.options).cropThreshold;var c,d,u=this.getExtremesFromAll||h.getExtremesFromAll,_=this.isCartesian,h=l&&l.val2lin,p=l&&l.isLog;if(_&&!this.isDirty&&!l.isDirty&&!this.yAxis.isDirty&&!e)return!1;for(l&&(c=(e=l.getExtremes()).min,d=e.max),_&&this.sorted&&!u&&(!r||r<a||this.forceCrop)&&(n[a-1]<c||n[0]>d?(n=[],i=[]):(n[0]<c||n[a-1]>d)&&(n=(t=this.cropData(this.xData,this.yData,c,d)).xData,i=t.yData,t=t.start,s=!0)),r=n.length||1;--r;)0<(a=p?h(n[r])-h(n[r-1]):n[r]-n[r-1])&&(o===P||a<o)?o=a:a<0&&this.requireSorting&&y(15);this.cropped=s,this.cropStart=t,this.processedXData=n,this.processedYData=i,this.closestPointRange=o},cropData:function(e,t,n,i){var a,s=e.length,o=0,r=s,l=Je(this.cropShoulder,1);for(a=0;a<s;a++)if(e[a]>=n){o=pe(0,a-l);break}for(n=a;n<s;n++)if(e[n]>i){r=n+l;break}return{xData:e.slice(o,r),yData:t.slice(o,r),start:o,end:r}},generatePoints:function(){var e,t,n,i,a=this.options.data,s=this.data,o=this.processedXData,r=this.processedYData,l=this.pointClass,c=o.length,d=this.cropStart||0,u=this.hasGroupedData,_=[];for(s||u||((s=[]).length=a.length,s=this.data=s),i=0;i<c;i++)t=d+i,u?_[i]=(new l).init(this,[o[i]].concat(h(r[i]))):(s[t]?n=s[t]:a[t]!==P&&(s[t]=n=(new l).init(this,a[t],o[i])),_[i]=n),_[i].index=t;if(s&&(c!==(e=s.length)||u))for(i=0;i<e;i++)i===d&&!u&&(i+=c),s[i]&&(s[i].destroyElements(),s[i].plotX=P);this.data=s,this.points=_},getExtremes:function(e){var t,n,i,a,s,o=this.yAxis,r=this.processedXData,l=[],c=0,d=(t=this.xAxis.getExtremes()).min,u=t.max;for(t=(e=e||this.stackedYData||this.processedYData).length,s=0;s<t;s++)if(i=r[s],n=null!==(a=e[s])&&a!==P&&(!o.isLog||a.length||0<a),i=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(r[s+1]||i)>=d&&(r[s-1]||i)<=u,n&&i)if(n=a.length)for(;n--;)null!==a[n]&&(l[c++]=a[n]);else l[c++]=a;this.dataMin=R(l),this.dataMax=N(l)},translate:function(){this.processedXData||this.processData(),this.generatePoints();for(var e,t,n,i,a=(m=this.options).stacking,s=this.xAxis,o=s.categories,r=this.yAxis,l=this.points,c=l.length,d=!!this.modifyValue,u=m.pointPlacement,_="between"===u||$(u),h=m.threshold,p=m.startFromThreshold?h:0,f=Number.MAX_VALUE,m=0;m<c;m++){var g=l[m],A=g.x,v=g.y;t=g.low;var b=a&&r.stacks[(this.negStacks&&v<(p?0:h)?"-":"")+this.stackKey];r.isLog&&null!==v&&v<=0&&(g.y=v=null,y(10)),g.plotX=e=fe(pe(-1e5,s.translate(A,0,0,0,1,u,"flags"===this.type)),1e5),a&&this.visible&&!g.isNull&&b&&b[A]&&(i=this.getStackIndicator(i,A,this.index),t=(v=(b=b[A]).points[i.key])[0],v=v[1],t===p&&(t=Je(h,r.min)),r.isLog&&t<=0&&(t=null),g.total=g.stackTotal=b.total,g.percentage=b.total&&g.y/b.total*100,g.stackY=v,b.setOffset(this.pointXOffset||0,this.barW||0)),g.yBottom=D(t)?r.translate(t,0,1,0,1):null,d&&(v=this.modifyValue(v,g)),g.plotY=t="number"==typeof v&&v!==Infinity?fe(pe(-1e5,r.translate(v,0,1,0,1)),1e5):P,g.isInside=t!==P&&0<=t&&t<=r.len&&0<=e&&e<=s.len,g.clientX=_?s.translate(A,0,0,0,1):e,g.negative=g.y<(h||0),g.category=o&&o[g.x]!==P?o[g.x]:g.x,m&&(f=fe(f,me(e-n))),n=e}this.closestPointRangePx=f},getValidPoints:function(){return Ue(this.points,function(e){return!e.isNull})},setClip:function(e){var t=this.chart,n=this.options,i=t.renderer,a=t.inverted,s=this.clipBox,o=s||t.clipBox,r=this.sharedClipKey||["_sharedClip",e&&e.duration,e&&e.easing,o.height,n.xAxis,n.yAxis].join(","),l=t[r],c=t[r+"m"];l||(e&&(o.width=0,t[r+"m"]=c=i.clipRect(-99,a?-t.plotLeft:-t.plotTop,99,a?t.chartWidth:t.chartHeight)),t[r]=l=i.clipRect(o)),e&&(l.count+=1),!1!==n.clip&&(this.group.clip(e||s?l:t.clipRect),this.markerGroup.clip(c),this.sharedClipKey=r),e||(l.count-=1,l.count<=0&&r&&t[r]&&(s||(t[r]=t[r].destroy()),t[r+"m"]&&(t[r+"m"]=t[r+"m"].destroy())))},animate:function(e){var t,n=this.chart,i=this.options.animation;i&&!_(i)&&(i=et[this.type].animation),e?this.setClip(i):((e=n[t=this.sharedClipKey])&&e.animate({width:n.plotSizeX},i),n[t+"m"]&&n[t+"m"].animate({width:n.plotSizeX+99},i),this.animate=null)},afterAnimate:function(){this.setClip(),We(this,"afterAnimate")},drawPoints:function(){var e,t,n,i,a,s,o,r,l,c,d,u,_=this.points,h=this.chart,p=this.options.marker,f=this.pointAttr[""],m=this.markerGroup,g=Je(p.enabled,this.xAxis.isRadial,this.closestPointRangePx>2*p.radius);if(!1!==p.enabled||this._hasPointMarkers)for(i=_.length;i--;)a=_[i],t=_e(a.plotX),n=a.plotY,l=a.graphic,c=a.marker||{},d=!!a.marker,e=g&&c.enabled===P||c.enabled,u=a.isInside,e&&n!==P&&!isNaN(n)&&null!==a.y?(s=(e=a.pointAttr[a.selected?"select":""]||f).r,r=0===(o=Je(c.symbol,this.symbol)).indexOf("url"),l?l[u?"show":"hide"](!0).attr(e).animate(Xe({x:t-s,y:n-s},l.symbolName?{width:2*s,height:2*s}:{})):u&&(0<s||r)&&(a.graphic=h.renderer.symbol(o,t-s,n-s,2*s,2*s,d?c:p).attr(e).add(m))):l&&(a.graphic=l.destroy())},convertAttribs:function(e,t,n,i){var a,s,o=this.pointAttrToOptions,r={};e=e||{},t=t||{},n=n||{},i=i||{};for(a in o)s=o[a],r[a]=Je(e[s],t[a],n[a],i[a]);return r},getAttribs:function(){var e,t=this,n=t.options,i=et[t.type].marker?n.marker:n,a=i.states,s=a.hover,o=t.color,r=t.options.negativeColor;e={stroke:o,fill:o};var l,c,d=t.points||[],u=[],_=t.pointAttrToOptions;l=t.hasPointSpecificOptions;var h=i.lineColor,p=i.fillColor;c=n.turboThreshold;var f,m=t.zones,g=t.zoneAxis||"y";if(n.marker?(s.radius=s.radius||i.radius+s.radiusPlus,s.lineWidth=s.lineWidth||i.lineWidth+s.lineWidthPlus):(s.color=s.color||K(s.color||o).brighten(s.brightness).get(),s.negativeColor=s.negativeColor||K(s.negativeColor||r).brighten(s.brightness).get()),u[""]=t.convertAttribs(i,e),Pe(["hover","select"],function(e){u[e]=t.convertAttribs(a[e],u[""])}),t.pointAttr=u,o=d.length,!c||o<c||l)for(;o--;){if((i=(c=d[o]).options&&c.options.marker||c.options)&&!1===i.enabled&&(i.radius=0),m.length){for(e=m[l=0];c[g]>=e.value;)e=m[++l];c.color=c.fillColor=Je(e.color,t.color)}if(l=n.colorByPoint||c.color,c.options)for(f in _)D(i[_[f]])&&(l=!0);l?(l=[],e=(a=(i=i||{}).states||{}).hover=a.hover||{},n.marker&&(
!c.negative||e.fillColor||s.fillColor)||(e[t.pointAttrToOptions.fill]=e.color||!c.options.color&&s[c.negative&&r?"negativeColor":"color"]||K(c.color).brighten(e.brightness||s.brightness).get()),e={color:c.color},p||(e.fillColor=c.color),h||(e.lineColor=c.color),i.hasOwnProperty("color")&&!i.color&&delete i.color,l[""]=t.convertAttribs(Xe(e,i),u[""]),l.hover=t.convertAttribs(a.hover,u.hover,l[""]),l.select=t.convertAttribs(a.select,u.select,l[""])):l=u,c.pointAttr=l}},destroy:function(){var e,t,n,i,a=this,s=a.chart,o=/AppleWebKit\/533/.test(ye),r=a.data||[];for(We(a,"destroy"),qe(a),Pe(a.axisTypes||[],function(e){(i=a[e])&&(d(i.series,a),i.isDirty=i.forceRedraw=!0)}),a.legendItem&&a.chart.legend.destroyItem(a),e=r.length;e--;)(t=r[e])&&t.destroy&&t.destroy();for(n in a.points=null,clearTimeout(a.animationTimeout),a)a[n]instanceof M&&!a[n].survive&&(e=o&&"group"===n?"hide":"destroy",a[n][e]());for(n in s.hoverSeries===a&&(s.hoverSeries=null),d(s.series,a),a)delete a[n]},getGraphPath:function(s,o,r){var l,c=this,d=c.options,u=d.step,_=[];s=s||c.points;return Pe(s,function(e,t){var n=e.plotX,i=e.plotY,a=s[t-1];(e.leftCliff||a&&a.rightCliff)&&!r&&(l=!0),e.isNull&&!D(o)&&0<t?l=!d.connectNulls:e.isNull&&!o?l=!0:(0===t||l?a=["M",e.plotX,e.plotY]:c.getPointSpline?a=c.getPointSpline(s,e,t):u?(a="right"===u?["L",a.plotX,i]:"center"===u?["L",(a.plotX+n)/2,a.plotY,"L",(a.plotX+n)/2,i]:["L",n,a.plotY]).push("L",n,i):a=["L",n,i],_.push.apply(_,a),l=!1)}),c.graphPath=_},drawGraph:function(){var a=this,s=this.options,n=[["graph",s.lineColor||this.color,s.dashStyle]],o=s.lineWidth,r="square"!==s.linecap,l=(this.gappedPath||this.getGraphPath).call(this),c=this.fillGraph&&this.color||"none";Pe(this.zones,function(e,t){n.push(["zoneGraph"+t,e.color||a.color,e.dashStyle||s.dashStyle])}),Pe(n,function(e,t){var n=e[0],i=a[n];i?i.animate({d:l}):(o||c)&&l.length&&(i={stroke:e[1],"stroke-width":o,fill:c,zIndex:1},e[2]?i.dashstyle=e[2]:r&&(i["stroke-linecap"]=i["stroke-linejoin"]="round"),a[n]=a.chart.renderer.path(l).attr(i).add(a.group).shadow(t<2&&s.shadow))})},applyZones:function(){var n,i,a,s,o,r,l,c=this,d=this.chart,u=d.renderer,e=this.zones,_=this.clips||[],h=this.graph,p=this.area,f=pe(d.chartWidth,d.chartHeight),m=this[(this.zoneAxis||"y")+"Axis"],g=m.reversed,A=d.inverted,v=m.horiz,b=!1;e.length&&(h||p)&&m.min!==P&&(h&&h.hide(),p&&p.hide(),s=m.getExtremes(),Pe(e,function(e,t){n=g?v?d.plotWidth:0:v?0:m.toPixels(s.min),n=fe(pe(Je(i,n),0),f),i=fe(pe(ue(m.toPixels(Je(e.value,s.max),!0)),0),f),b&&(n=i=m.toPixels(s.max)),o=Math.abs(n-i),r=fe(n,i),l=pe(n,i),m.isXAxis?(a={x:A?l:r,y:0,width:o,height:f},v||(a.x=d.plotHeight-a.x)):(a={x:0,y:A?l:r,width:f,height:o},v&&(a.y=d.plotWidth-a.y)),d.inverted&&u.isVML&&(a=m.isXAxis?{x:0,y:g?r:l,height:a.width,width:d.chartWidth}:{x:a.y-d.plotLeft-d.spacingBox.x,y:0,width:a.height,height:d.chartHeight}),_[t]?_[t].animate(a):(_[t]=u.clipRect(a),h&&c["zoneGraph"+t].clip(_[t]),p&&c["zoneArea"+t].clip(_[t])),b=e.value>s.max}),this.clips=_)},invertGroups:function(){function e(){var t={width:n.yAxis.len,height:n.xAxis.len};Pe(["group","markerGroup"],function(e){n[e]&&n[e].attr(t).invert()})}var n=this,t=n.chart;n.xAxis&&(ze(t,"resize",e),ze(n,"destroy",function(){qe(t,"resize",e)}),e(),n.invertGroups=e)},plotGroup:function(e,t,n,i,a){var s=this[e],o=!s;return o&&(this[e]=s=this.chart.renderer.g(t).attr({zIndex:i||.1}).add(a),s.addClass("highcharts-series-"+this.index)),s.attr({visibility:n})[o?"attr":"animate"](this.getPlotBox()),s},getPlotBox:function(){var e=this.chart,t=this.xAxis,n=this.yAxis;return e.inverted&&(t=n,n=this.xAxis),{translateX:t?t.left:e.plotLeft,translateY:n?n.top:e.plotTop,scaleX:1,scaleY:1}},render:function(){var e,t=this,n=t.chart,i=t.options,a=(e=i.animation)&&!!t.animate&&n.renderer.isSVG&&Je(e.duration,500)||0,s=t.visible?"inherit":"hidden",o=i.zIndex,r=t.hasRendered,l=n.seriesGroup;e=t.plotGroup("group","series",s,o,l),t.markerGroup=t.plotGroup("markerGroup","markers",s,o,l),a&&t.animate(!0),t.getAttribs(),e.inverted=!!t.isCartesian&&n.inverted,t.drawGraph&&(t.drawGraph(),t.applyZones()),Pe(t.points,function(e){e.redraw&&e.redraw()}),t.drawDataLabels&&t.drawDataLabels(),t.visible&&t.drawPoints(),t.drawTracker&&!1!==t.options.enableMouseTracking&&t.drawTracker(),n.inverted&&t.invertGroups(),!1!==i.clip&&!t.sharedClipKey&&!r&&e.clip(n.clipRect),a&&t.animate(),r||(t.animationTimeout=k(function(){t.afterAnimate()},a)),t.isDirty=t.isDirtyData=!1,t.hasRendered=!0},redraw:function(){var e=this.chart,t=this.isDirtyData,n=this.isDirty,i=this.group,a=this.xAxis,s=this.yAxis;i&&(e.inverted&&i.attr({width:e.plotWidth,height:e.plotHeight}),i.animate({translateX:Je(a&&a.left,e.plotLeft),translateY:Je(s&&s.top,e.plotTop)})),this.translate(),this.render(),t&&We(this,"updatedData"),(n||t)&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(e,t){var n=this.xAxis,i=this.yAxis,a=this.chart.inverted;return this.searchKDTree({clientX:a?n.len-e.chartY+n.pos:e.chartX-n.pos,plotY:a?i.len-e.chartX+i.pos:e.chartY-i.pos},t)},buildKDTree:function(){function s(e,t,n){var i,a;if(a=e&&e.length)return i=o.kdAxisArray[t%n],e.sort(function(e,t){return e[i]-t[i]}),{point:e[a=Math.floor(a/2)],left:s(e.slice(0,a),t+1,n),right:s(e.slice(a+1),t+1,n)}}var o=this,t=o.kdDimensions;delete o.kdTree,k(function(){var e=Ue(o.points||[],function(e){return null!==e.y});o.kdTree=s(e,t,t)},o.options.kdNow?0:1)},searchKDTree:function(e,t){function c(e,t,n,i){var a,s,o=t.point,r=d.kdAxisArray[n%i],l=o;return a=((s=D(e[u])&&D(o[u])?Math.pow(e[u]-o[u],2):null)||0)+((a=D(e[_])&&D(o[_])?Math.pow(e[_]-o[_],2):null)||0),o.dist=D(a)?Math.sqrt(a):Number.MAX_VALUE,o.distX=D(s)?Math.sqrt(s):Number.MAX_VALUE,s=(r=e[r]-o[r])<0?"right":"left",t[a=r<0?"left":"right"]&&(l=(a=c(e,t[a],n+1,i))[h]<l[h]?a:o),t[s]&&Math.sqrt(r*r)<l[h]&&(l=(e=c(e,t[s],n+1,i))[h]<l[h]?e:l),l}var d=this,u=this.kdAxisArray[0],_=this.kdAxisArray[1],h=t?"distX":"dist";if(this.kdTree||this.buildKDTree(),this.kdTree)return c(e,this.kdTree,this.kdDimensions,this.kdDimensions)}},L.prototype={destroy:function(){s(this,this.axis)},render:function(e){var t=this.options,n=(n=t.format)?v(n,this):t.formatter.call(this);this.label?this.label.attr({text:n,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(n,null,null,t.useHTML).css(t.style).attr({align:this.textAlign,rotation:t.rotation,visibility:"hidden"}).add(e)},setOffset:function(e,t){var n=(o=this.axis).chart,i=n.inverted,a=o.reversed,s=(a=this.isNegative&&!a||!this.isNegative&&a,o.translate(o.usePercentage?100:this.total,0,0,0,1)),o=o.translate(0),r=(o=me(s-o),n.xAxis[0].translate(this.x)+e),l=n.plotHeight;a={x:i?a?s:s-o:r,y:i?l-r-t:a?l-s-o:l-s,width:i?o:t,height:i?t:o};(i=this.label)&&(i.align(this.alignOptions,null,a),a=i.alignAttr,i[!1===this.options.crop||n.isInsidePlot(a.x,a.y)?"show":"hide"](!0))}},ft.prototype.getStacks=function(){var t=this;Pe(t.yAxis,function(e){e.stacks&&e.hasVisibleSeries&&(e.oldStacks=e.stacks)}),Pe(t.series,function(e){!e.options.stacking||!0!==e.visible&&!1!==t.options.chart.ignoreHiddenSeries||(e.stackKey=e.type+Je(e.options.stack,""))})},ot.prototype.buildStacks=function(){var e,t,n=this.series,i=Je(this.options.reversedStacks,!0),a=n.length;if(!this.isXAxis){for(this.usePercentage=!1,t=a;t--;)n[i?t:a-t-1].setStackedPoints();for(t=a;t--;)(e=n[i?t:a-t-1]).setStackCliffs&&e.setStackCliffs();if(this.usePercentage)for(t=0;t<a;t++)n[t].setPercentStacks()}},ot.prototype.renderStackTotals=function(){var e,t,n=this.chart,i=n.renderer,a=this.stacks,s=this.stackTotalGroup;for(e in s||(this.stackTotalGroup=s=i.g("stack-labels").attr({visibility:"visible",zIndex:6}).add()),s.translate(n.plotLeft,n.plotTop),a)for(t in n=a[e])n[t].render(s)},ot.prototype.resetStacks=function(){var e,t,n=this.stacks;if(!this.isXAxis)for(e in n)for(t in n[e])n[e][t].touched<this.stacksTouched?(n[e][t].destroy(),delete n[e][t]):(n[e][t].total=null,n[e][t].cum=0)},ot.prototype.cleanStacks=function(){var e,t,n;if(!this.isXAxis)for(t in this.oldStacks&&(e=this.stacks=this.oldStacks),e)for(n in e[t])e[t][n].cum=e[t][n].total},gt.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var e,t,n,i,a,s,o,r=this.processedXData,l=this.processedYData,c=[],d=l.length,u=(p=this.options).threshold,_=p.startFromThreshold?u:0,h=p.stack,p=p.stacking,f=this.stackKey,m="-"+f,g=this.negStacks,A=this.yAxis,v=A.stacks,b=A.oldStacks;for(A.stacksTouched+=1,a=0;a<d;a++)s=r[a],o=l[a],i=(e=this.getStackIndicator(e,s,this.index)).key,v[n=(t=g&&o<(_?0:u))?m:f]||(v[n]={}),v[n][s]||(b[n]&&b[n][s]?(v[n][s]=b[n][s],v[n][s].total=null):v[n][s]=new L(A,A.options.stackLabels,t,s,h)),n=v[n][s],null!==o&&(n.points[i]=n.points[this.index]=[Je(n.cum,_)],n.touched=A.stacksTouched,0<e.index&&!1===this.singleStacks&&(n.points[i][0]=n.points[this.index+","+s+",0"][0])),"percent"===p?(t=t?f:m,g&&v[t]&&v[t][s]?(t=v[t][s],n.total=t.total=pe(t.total,n.total)+me(o)||0):n.total=B(n.total+(me(o)||0))):n.total=B(n.total+(o||0)),n.cum=Je(n.cum,_)+(o||0),null!==o&&n.points[i].push(n.cum),c[a]=n.cum;"percent"===p&&(A.usePercentage=!0),this.stackedYData=c,A.oldStacks={}}},gt.prototype.setPercentStacks=function(){var a,s=this,e=s.stackKey,o=s.yAxis.stacks,r=s.processedXData;Pe([e,"-"+e],function(e){for(var t,n,i=r.length;i--;)t=r[i],a=s.getStackIndicator(a,t,s.index),(t=(n=o[e]&&o[e][t])&&n.points[a.key])&&(n=n.total?100/n.total:0,t[0]=B(t[0]*n),t[1]=B(t[1]*n),s.stackedYData[i]=t[1])})},gt.prototype.getStackIndicator=function(e,t,n){return D(e)&&e.x===t?e.index++:e={x:t,index:0},e.key=[n,t,e.index].join(","),e},Xe(ft.prototype,{addSeries:function(e,t,n){var i,a=this;return e&&(t=Je(t,!0),We(a,"addSeries",{options:e},function(){i=a.initSeries(e),a.isDirtyLegend=!0,a.linkSeries(),t&&a.redraw(n)})),i},addAxis:function(e,t,n,i){var a=t?"xAxis":"yAxis",s=this.options;new ot(this,I(e,{index:this[a].length,isX:t})),s[a]=h(s[a]||{}),s[a].push(e),Je(n,!0)&&this.redraw(i)},showLoading:function(e){var t=this,n=t.options,i=t.loadingDiv,a=n.loading,s=function(){i&&O(i,{left:t.plotLeft+"px",top:t.plotTop+"px",width:t.plotWidth+"px",height:t.plotHeight+"px"})};i||(t.loadingDiv=i=S(Ne,{className:"highcharts-loading"},Xe(a.style,{zIndex:10,display:"none"}),t.container),t.loadingSpan=S("span",null,a.labelStyle,i),ze(t,"redraw",s)),t.loadingSpan.innerHTML=e||n.lang.loading,t.loadingShown||(O(i,{opacity:0,display:""}),Ye(i,{opacity:a.style.opacity},{duration:a.showDuration||0}),t.loadingShown=!0),s()},hideLoading:function(){var e=this.options,t=this.loadingDiv;t&&Ye(t,{opacity:0},{duration:e.loading.hideDuration||100,complete:function(){O(t,{display:"none"})}}),this.loadingShown=!1}}),Xe(mt.prototype,{update:function(e,t,n,i){function a(){o.applyOptions(e),null===o.y&&l&&(o.graphic=l.destroy()),_(e)&&!A(e)&&(o.redraw=function(){l&&l.element&&e&&e.marker&&e.marker.symbol&&(o.graphic=l.destroy()),e&&e.dataLabels&&o.dataLabel&&(o.dataLabel=o.dataLabel.destroy()),o.redraw=null}),s=o.index,r.updateParallelArrays(o,s),u&&o.name&&(u[o.x]=o.name),d.data[s]=_(d.data[s])?o.options:e,r.isDirty=r.isDirtyData=!0,!r.fixedBox&&r.hasCartesianSeries&&(c.isDirtyBox=!0),"point"===d.legendType&&(c.isDirtyLegend=!0),t&&c.redraw(n)}var s,o=this,r=o.series,l=o.graphic,c=r.chart,d=r.options,u=r.xAxis&&r.xAxis.names;t=Je(t,!0);!1===i?a():o.firePointEvent("update",{options:e},a)},remove:function(e,t){this.series.removePoint(Le(this,this.series.data),e,t)}}),Xe(gt.prototype,{addPoint:function(e,t,n,i){var a,s=this,o=s.options,r=s.data,l=s.graph,c=s.area,d=s.chart,u=s.xAxis&&s.xAxis.names,_=l&&l.shift||0,h=["graph","area"],p=(l=o.data,s.xData);if(F(i,d),n){for(i=s.zones.length;i--;)h.push("zoneGraph"+i,"zoneArea"+i);Pe(h,function(e){s[e]&&(s[e].shift=_+(o.step?2:1))})}if(c&&(c.isArea=!0),t=Je(t,!0),c={series:s},s.pointClass.prototype.applyOptions.apply(c,[e]),h=c.x,i=p.length,s.requireSorting&&h<p[i-1])for(a=!0;i&&p[i-1]>h;)i--;s.updateParallelArrays(c,"splice",i,0,0),s.updateParallelArrays(c,i),u&&c.name&&(u[h]=c.name),l.splice(i,0,e),a&&(s.data.splice(i,0,null),s.processData()),"point"===o.legendType&&s.generatePoints(),n&&(r[0]&&r[0].remove?r[0].remove(!1):(r.shift(),s.updateParallelArrays(c,"shift"),l.shift())),s.isDirty=!0,s.isDirtyData=!0,t&&(s.getAttribs(),d.redraw())},removePoint:function(e,t,n){var i=this,a=i.data,s=a[e],o=i.points,r=i.chart,l=function(){o&&o.length===a.length&&o.splice(e,1),a.splice(e,1),i.options.data.splice(e,1),i.updateParallelArrays(s||{series:i},"splice",e,1),s&&s.destroy(),i.isDirty=!0,i.isDirtyData=!0,t&&r.redraw()};F(n,r),t=Je(t,!0),s?s.firePointEvent("remove",null,l):l()},remove:function(e,t){var n=this,i=n.chart;We(n,"remove",null,function(){n.destroy(),i.isDirtyLegend=i.isDirtyBox=!0,i.linkSeries(),Je(e,!0)&&i.redraw(t)})},update:function(e,t){var n,i=this,a=this.chart,s=this.userOptions,o=this.type,r=Me[o].prototype,l=["group","markerGroup","dataLabelsGroup"];for(n in(e.type&&e.type!==o||void 0!==e.zIndex)&&(l.length=0),Pe(l,function(e){l[e]=i[e],delete i[e]}),e=I(s,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},e),this.remove(!1),r)this[n]=P;Xe(this,Me[e.type||o].prototype),Pe(l,function(e){i[e]=l[e]}),this.init(a,e),a.linkSeries(),Je(t,!0)&&a.redraw(!1)}}),Xe(ot.prototype,{update:function(e,t){var n=this.chart;e=n.options[this.coll][this.options.index]=I(this.userOptions,e);this.destroy(!0),this._addedPlotLB=this.chart._labelPanes=P,this.init(n,Xe(e,{events:P})),n.isDirtyBox=!0,Je(t,!0)&&n.redraw()},remove:function(e){for(var t=this.chart,n=this.coll,i=this.series,a=i.length;a--;)i[a]&&i[a].remove(!1);d(t.axes,this),d(t[n],this),t.options[n].splice(this.options.index,1),Pe(t[n],function(e,t){e.options.index=t}),this.destroy(),t.isDirtyBox=!0,Je(e,!0)&&t.redraw()},setTitle:function(e,t){this.update({title:e},t)},setCategories:function(e,t){this.update({categories:e},t)}});var At=e(gt);Me.line=At,et.area=I(tt,{softThreshold:!1,threshold:0});var vt,bt,yt,$t,wt,kt=e(gt,{type:"area",singleStacks:!1,getStackPoints:function(){var l,c,e,t=[],d=[],n=this.xAxis,i=this.yAxis,u=i.stacks[this.stackKey],_={},a=this.points,h=this.index,s=i.series,p=s.length,f=Je(i.options.reversedStacks,!0)?1:-1;if(this.options.stacking){for(c=0;c<a.length;c++)_[a[c].x]=a[c];for(e in u)null!==u[e].total&&d.push(+e);d.sort(function(e,t){return e-t}),l=Qe(s,function(){return this.visible}),Pe(d,function(a,s){var o,r,e=0;if(_[a]&&!_[a].isNull)t.push(_[a]),Pe([-1,1],function(e){var t=1===e?"rightNull":"leftNull",n=0,i=u[d[s+e]];if(i)for(c=h;0<=c&&c<p;)(o=i.points[c])||(c===h?_[a][t]=!0:l[c]&&(r=u[a].points[c])&&(n-=r[1]-r[0])),c+=f;_[a][1===e?"rightCliff":"leftCliff"]=n});else{for(c=h;0<=c&&c<p;){if(o=u[a].points[c]){e=o[1];break}c+=f}e=i.toPixels(e,!0),t.push({isNull:!0,plotX:n.toPixels(a,!0),plotY:e,yBottom:e})}})}return t},getGraphPath:function(r){var e,t,l,n,i=gt.prototype.getGraphPath,c=(a=this.options).stacking,d=this.yAxis,u=[],_=[],h=this.index,p=d.stacks[this.stackKey],f=a.threshold,m=d.getThreshold(a.threshold),a=a.connectNulls||"percent"===c,s=function(e,t,n){var i,a,s=r[e],o=(e=c&&p[s.x].points[h],s[n+"Null"]||0);n=s[n+"Cliff"]||0,s=!0;n||o?(i=(o?e[0]:e[1])+n,a=e[0]+n,s=!!o):!c&&r[t]&&r[t].isNull&&(i=a=f),void 0!==i&&(_.push({plotX:l,plotY:null===i?m:d.toPixels(i,!0),isNull:s}),u.push({plotX:l,plotY:null===a?m:d.toPixels(a,!0)}))};r=r||this.points;for(c&&(r=this.getStackPoints()),e=0;e<r.length;e++)t=r[e].isNull,l=Je(r[e].rectPlotX,r[e].plotX),n=Je(r[e].yBottom,m),(!t||a)&&(a||s(e,e-1,"left"),t&&!c&&a||(_.push(r[e]),u.push({x:e,plotX:l,plotY:n})),a||s(e,e+1,"right"));return e=i.call(this,_,!0,!0),(t=i.call(this,u.reverse(),!0,!0)).length&&(t[0]="L"),e=e.concat(t),i=i.call(this,_,!1,a),this.areaPath=e,i},drawGraph:function(){this.areaPath=[],gt.prototype.drawGraph.apply(this);var i=this,a=this.areaPath,s=this.options,n=[["area",this.color,s.fillColor]];Pe(this.zones,function(e,t){n.push(["zoneArea"+t,e.color||i.color,e.fillColor||s.fillColor])}),Pe(n,function(e){var t=e[0],n=i[t];n?n.animate({d:a}):(n={fill:e[2]||e[1],zIndex:0},e[2]||(n["fill-opacity"]=Je(s.fillOpacity,.75)),i[t]=i.chart.renderer.path(a).attr(n).add(i.group))})},drawLegendSymbol:nt.drawRectangle});return Me.area=kt,et.spline=I(tt),At=e(gt,{type:"spline",getPointSpline:function(e,t,n){var i,a,s,o,r,l=t.plotX,c=t.plotY,d=e[n-1];n=e[n+1];d&&!d.isNull&&n&&!n.isNull&&(e=d.plotY,s=n.plotX,o=(1.5*c+(n=n.plotY))/2.5,o+=r=(o-(a=(1.5*c+e)/2.5))*((s=(1.5*l+s)/2.5)-l)/(s-(i=(1.5*l+d.plotX)/2.5))+c-o,e<(a+=r)&&c<a?o=2*c-(a=pe(e,c)):a<e&&a<c&&(o=2*c-(a=fe(e,c))),n<o&&c<o?a=2*c-(o=pe(n,c)):o<n&&o<c&&(a=2*c-(o=fe(n,c))),t.rightContX=s,t.rightContY=o);return t=["C",Je(d.rightContX,d.plotX),Je(d.rightContY,d.plotY),Je(i,l),Je(a,c),l,c],d.rightContX=d.rightContY=null,t}}),Me.spline=At,et.areaspline=I(et.area),At=e(At,{type:"areaspline",getStackPoints:(kt=kt.prototype).getStackPoints,getGraphPath:kt.getGraphPath,setStackCliffs:kt.setStackCliffs,drawGraph:kt.drawGraph,drawLegendSymbol:nt.drawRectangle}),Me.areaspline=At,et.column=I(tt,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0}),At=e(gt,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){gt.prototype.init.apply(this,arguments);var t=this,e=t.chart;e.hasRendered&&Pe(e.series,function(e){e.type===t.type&&(e.isDirty=!0)})},getColumnMetrics:function(){var a,s=this,e=s.options,t=s.xAxis,o=s.yAxis,n=t.reversed,r={},l=0;!1===e.grouping?l=1:Pe(s.chart.series,function(e){var t,n=e.options,i=e.yAxis;e.type===s.type&&e.visible&&o.len===i.len&&o.pos===i.pos&&(n.stacking?(a=e.stackKey,r[a]===P&&(r[a]=l++),t=r[a]):!1!==n.grouping&&(t=l++),e.columnIndex=t)});var i=fe(me(t.transA)*(t.ordinalSlope||e.pointRange||t.closestPointRange||t.tickInterval||1),t.len),c=i*e.groupPadding,d=(i-2*c)/l;e=fe(e.maxPointWidth||t.len,Je(e.pointWidth,d*(1-2*e.pointPadding)));return s.columnMetrics={width:e,offset:(d-e)/2+(c+((s.columnIndex||0)+(n?1:0))*d-i/2)*(n?-1:1)},s.columnMetrics},crispCol:function(e,t,n,i){var a=this.chart,s=-((o=this.borderWidth)%2?.5:0),o=o%2?.5:1;return a.inverted&&a.renderer.isVML&&(o+=1),n=Math.round(e+n)+s,n-=e=Math.round(e)+s,i=Math.round(t+i)+o,s=me(t)<=.5&&.5<i,i-=t=Math.round(t)+o,s&&(t-=1,i+=1),{x:e,y:t,width:n,height:i}},translate:function(){var l=this,c=l.chart,e=l.options,t=l.borderWidth=Je(e.borderWidth,l.closestPointRange*l.xAxis.transA<2?0:1),d=l.yAxis,u=l.translatedThreshold=d.getThreshold(e.threshold),_=Je(e.minPointLength,5),n=l.getColumnMetrics(),h=n.width,p=l.barW=pe(h,1+2*t),f=l.pointXOffset=n.offset;c.inverted&&(u-=.5),e.pointPadding&&(p=he(p)),gt.prototype.translate.apply(l),Pe(l.points,function(e){var t,n=fe(Je(e.yBottom,u),9e4),i=999+me(n),a=(i=fe(pe(-i,e.plotY),d.len+i),e.plotX+f),s=p,o=fe(i,n),r=pe(i,n)-o;me(r)<_&&_&&(r=_,t=!d.reversed&&!e.negative||d.reversed&&e.negative,o=me(o-u)>_?n-_:u-(t?_:0)),e.barX=a,e.pointWidth=h,e.tooltipPos=c.inverted?[d.len+d.pos-c.plotLeft-i,l.xAxis.len-a-s/2,r]:[a+s/2,i+d.pos-c.plotTop,r],e.shapeType="rect",e.shapeArgs=l.crispCol(a,o,s,r)})},getSymbol:Se,drawLegendSymbol:nt.drawRectangle,drawGraph:Se,drawPoints:function(){var i,a,s=this,o=this.chart,r=s.options,l=o.renderer,c=r.animationLimit||250;Pe(s.points,function(e){var t=e.plotY,n=e.graphic;t===P||isNaN(t)||null===e.y?n&&(e.graphic=n.destroy()):(i=e.shapeArgs,t=D(s.borderWidth)?{"stroke-width":s.borderWidth}:{},a=e.pointAttr[e.selected?"select":""]||s.pointAttr[""],n?(Ve(n),n.attr(t).attr(a)[o.pointCount<c?"animate":"attr"](I(i))):e.graphic=l[e.shapeType](i).attr(t).attr(a).add(e.group||s.group).shadow(r.shadow,null,r.stacking&&!r.borderRadius))})},animate:function(e){var t=this.yAxis,n=this.options,i=this.chart.inverted,a={};xe&&(e?(a.scaleY=.001,e=fe(t.pos+t.len,pe(t.pos,t.toPixels(n.threshold))),i?a.translateX=e-t.len:a.translateY=e,this.group.attr(a)):(a.scaleY=1,a[i?"translateX":"translateY"]=t.pos,this.group.animate(a,this.options.animation),this.animate=null))},remove:function(){var t=this,e=t.chart;e.hasRendered&&Pe(e.series,function(e){e.type===t.type&&(e.isDirty=!0)}),gt.prototype.remove.apply(t,arguments)}}),Me.column=At,et.bar=I(et.column),kt=e(At,{type:"bar",inverted:!0}),Me.bar=kt,et.scatter=I(tt,{lineWidth:0,marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">\u25cf</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}}),kt=e(gt,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&gt.prototype.drawGraph.call(this)}}),Me.scatter=kt,et.pie=I(tt,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,states:{hover:{brightness:.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}}),tt={type:"pie",isCartesian:!1,pointClass:e(mt,{init:function(){mt.prototype.init.apply(this,arguments);var e,t=this;return t.name=Je(t.name,"Slice"),ze(t,"select",e=function(e){t.slice("select"===e.type)}),ze(t,"unselect",e),t},setVisible:function(t,e){var n=this,i=n.series,a=i.chart,s=i.options.ignoreHiddenPoint;e=Je(e,s);t!==n.visible&&(n.visible=n.options.visible=t=t===P?!n.visible:t,i.options.data[Le(n,i.data)]=n.options,Pe(["graphic","dataLabel","connector","shadowGroup"],function(e){n[e]&&n[e][t?"show":"hide"](!0)}),n.legendItem&&a.legend.colorizeItem(n,t),!t&&"hover"===n.state&&n.setState(""),s&&(i.isDirty=!0),e&&a.redraw())},slice:function(e,t,n){var i=this.series;F(n,i.chart),Je(t,!0),this.sliced=this.options.sliced=e=D(e)?e:!this.sliced,i.options.data[Le(this,i.data)]=this.options,e=e?this.slicedTranslation:{translateX:0,translateY:0},this.graphic.animate(e),this.shadowGroup&&this.shadowGroup.animate(e)},haloPath:function(e){var t=this.shapeArgs,n=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(n.plotLeft+t.x,n.plotTop+t.y,t.r+e,t.r+e,{innerR:this.shapeArgs.r,start:t.start,end:t.end})}}),requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},animate:function(e){var i=this,t=i.points,a=i.startAngleRad;e||(Pe(t,function(e){var t=e.graphic,n=e.shapeArgs;t&&(t.attr({r:e.startR||i.center[3]/2,start:a,end:a}),t.animate({r:n.r,start:n.start,end:n.end},i.options.animation))}),i.animate=null)},updateTotals:function(){var e,t,n=0,i=this.points,a=i.length,s=this.options.ignoreHiddenPoint;for(e=0;e<a;e++)t=i[e],n+=s&&!t.visible?0:t.y;for(this.total=n,e=0;e<a;e++)(t=i[e]).percentage=0<n&&(t.visible||!s)?t.y/n*100:0,t.total=n},generatePoints:function(){gt.prototype.generatePoints.call(this),this.updateTotals()},translate:function(n){this.generatePoints();var e,t,i,a,s,o=0,r=(h=this.options).slicedOffset,l=r+h.borderWidth,c=h.startAngle||0,d=this.startAngleRad=ve/180*(c-90),u=(c=(this.endAngleRad=ve/180*(Je(h.endAngle,c+360)-90))-d,this.points),_=h.dataLabels.distance,h=h.ignoreHiddenPoint,p=u.length;for(n||(this.center=n=this.getCenter()),this.getX=function(e,t){return i=de.asin(fe((e-n[1])/(n[2]/2+_),1)),n[0]+(t?-1:1)*ge(i)*(n[2]/2+_)},a=0;a<p;a++)s=u[a],e=d+o*c,h&&!s.visible||(o+=s.percentage/100),t=d+o*c,s.shapeType="arc",s.shapeArgs={x:n[0],y:n[1],r:n[2]/2,innerR:n[3]/2,start:ue(1e3*e)/1e3,end:ue(1e3*t)/1e3},1.5*ve<(i=(t+e)/2)?i-=2*ve:i<-ve/2&&(i+=2*ve),s.slicedTranslation={translateX:ue(ge(i)*r),translateY:ue(Ae(i)*r)},e=ge(i)*n[2]/2,t=Ae(i)*n[2]/2,s.tooltipPos=[n[0]+.7*e,n[1]+.7*t],s.half=i<-ve/2||ve/2<i?1:0,s.angle=i,l=fe(l,_/2),s.labelPos=[n[0]+e+ge(i)*_,n[1]+t+Ae(i)*_,n[0]+e+ge(i)*l,n[1]+t+Ae(i)*l,n[0]+e,n[1]+t,_<0?"center":s.half?"right":"left",i]},drawGraph:null,drawPoints:function(){var t,n,i,a,s,o,r=this,l=r.chart.renderer,c=r.options.shadow;c&&!r.shadowGroup&&(r.shadowGroup=l.g("shadow").add(r.group)),Pe(r.points,function(e){null!==e.y&&(n=e.graphic,s=e.shapeArgs,i=e.shadowGroup,(a=e.pointAttr[e.selected?"select":""]).stroke||(a.stroke=a.fill),c&&!i&&(i=e.shadowGroup=l.g("shadow").add(r.shadowGroup)),t=e.sliced?e.slicedTranslation:{translateX:0,translateY:0},i&&i.attr(t),n?n.setRadialReference(r.center).attr(a).animate(Xe(s,t)):(o={"stroke-linejoin":"round"},e.visible||(o.visibility="hidden"),e.graphic=n=l[e.shapeType](s).setRadialReference(r.center).attr(a).attr(o).attr(t).add(r.group).shadow(c,i)))})},searchPoint:Se,sortByAngle:function(e,n){e.sort(function(e,t){return void 0!==e.angle&&(t.angle-e.angle)*n})},drawLegendSymbol:nt.drawRectangle,getCenter:st.getCenter,getSymbol:Se},tt=e(gt,tt),Me.pie=tt,gt.prototype.drawDataLabels=function(){var c,d,u,_,h=this,p=h.options,f=p.cursor,m=p.dataLabels,e=h.points,t=h.hasRendered||0,g=h.chart.renderer;(m.enabled||h._hasPointLabels)&&(h.dlProcessOptions&&h.dlProcessOptions(m),_=h.plotGroup("dataLabelsGroup","data-labels",m.defer?"hidden":"visible",m.zIndex||6),Je(m.defer,!0)&&(_.attr({opacity:+t}),t||ze(h,"afterAnimate",function(){h.visible&&_.show(),_[p.animation?"animate":"attr"]({opacity:1},{duration:200})})),d=m,Pe(e,function(e){var t,n,i,a,s=e.dataLabel,o=e.connector,r=!0,l={};if(c=e.dlOptions||e.options&&e.options.dataLabels,t=Je(c&&c.enabled,d.enabled)&&null!==e.y,s&&!t)e.dataLabel=s.destroy();else if(t){if(a=(m=I(d,c)).style,t=m.rotation,n=e.getLabelConfig(),u=m.format?v(m.format,n):m.formatter.call(n,m),a.color=Je(m.color,a.color,h.color,"black"),s)D(u)?(s.attr({text:u}),r=!1):(e.dataLabel=s=s.destroy(),o&&(e.connector=o.destroy()));else if(D(u)){for(i in s={fill:m.backgroundColor,stroke:m.borderColor,"stroke-width":m.borderWidth,r:m.borderRadius||0,rotation:t,padding:m.padding,zIndex:1},"contrast"===a.color&&(l.color=m.inside||m.distance<0||p.stacking?g.getContrast(e.color||h.color):"#000000"),f&&(l.cursor=f),s)s[i]===P&&delete s[i];s=e.dataLabel=g[t?"text":"label"](u,0,-9999,m.shape,null,null,m.useHTML).attr(s).css(Xe(a,l)).add(_).shadow(m.shadow)}s&&h.alignDataLabel(e,s,m,null,r)}}))},gt.prototype.alignDataLabel=function(e,t,n,i,a){var s=this.chart,o=s.inverted,r=Je(e.plotX,-9999),l=Je(e.plotY,-9999),c=t.getBBox(),d=s.renderer.fontMetrics(n.style.fontSize).b,u=n.rotation,_=n.align,h=this.visible&&(e.series.forceDL||s.isInsidePlot(r,ue(l),o)||i&&s.isInsidePlot(r,o?i.x+1:i.y+i.height-1,o)),p="justify"===Je(n.overflow,"justify");h&&(i=Xe({x:o?s.plotWidth-l:r,y:ue(o?s.plotHeight-r:l),width:0,height:0},i),Xe(n,{width:c.width,height:c.height}),u?(p=!1,o=s.renderer.rotCorr(d,u),o={x:i.x+n.x+i.width/2+o.x,y:i.y+n.y+i.height/2},t[a?"attr":"animate"](o).attr({align:n.align}),r=180<(r=(u+720)%360)&&r<360,"left"===_?o.y-=r?c.height:0:"center"===_?(o.x-=c.width/2,o.y-=c.height/2):"right"===_&&(o.x-=c.width,o.y-=r?0:c.height)):(t.align(n,null,i),o=t.alignAttr),p?this.justifyDataLabel(t,n,o,c,i,a):Je(n.crop,!0)&&(h=s.isInsidePlot(o.x,o.y)&&s.isInsidePlot(o.x+c.width,o.y+c.height)),n.shape&&!u&&t.attr({anchorX:e.plotX,anchorY:e.plotY})),h||(Ve(t),t.attr({y:-9999}),t.placed=!1)},gt.prototype.justifyDataLabel=function(e,t,n,i,a,s){var o,r,l=this.chart,c=t.align,d=t.verticalAlign,u=e.box?0:e.padding||0;(o=n.x+u)<0&&("right"===c?t.align="left":t.x=-o,r=!0),(o=n.x+i.width-u)>l.plotWidth&&("left"===c?t.align="right":t.x=l.plotWidth-o,r=!0),(o=n.y+u)<0&&("bottom"===d?t.verticalAlign="top":t.y=-o,r=!0),(o=n.y+i.height-u)>l.plotHeight&&("top"===d?t.verticalAlign="bottom":t.y=l.plotHeight-o,r=!0),r&&(e.placed=!s,e.align(t,null,a))},Me.pie&&(Me.pie.prototype.drawDataLabels=function(){var e,t,n,i,a,s,o,r,l,c,d,u=this,_=u.data,h=u.chart,p=u.options.dataLabels,f=Je(p.connectorPadding,10),m=Je(p.connectorWidth,1),g=h.plotWidth,A=h.plotHeight,v=Je(p.softConnector,!0),b=p.distance,y=u.center,$=y[2]/2,w=y[1],k=0<b,C=[[],[]],E=[0,0,0,0],T=function(e,t){return t.y-e.y};if(u.visible&&(p.enabled||u._hasPointLabels)){for(gt.prototype.drawDataLabels.apply(u),Pe(_,function(e){e.dataLabel&&e.visible&&(C[e.half].push(e),e.dataLabel._pos=null)}),c=2;c--;){var x,I=[],D=[],O=C[c],S=O.length;if(S){for(u.sortByAngle(O,c-.5),d=_=0;!_&&O[d];)_=O[d]&&O[d].dataLabel&&(O[d].dataLabel.getBBox().height||21),d++;if(0<b){for(a=fe(w+$+b,h.plotHeight),d=pe(0,w-$-b);d<=a;d+=_)I.push(d);if((a=I.length)<S){for((e=[].concat(O)).sort(T),d=S;d--;)e[d].rank=d;for(d=S;d--;)O[d].rank>=a&&O.splice(d,1);S=O.length}for(d=0;d<S;d++){var R,B;for(e=O[d],s=e.labelPos,e=9999,B=0;B<a;B++)(R=me(I[B]-s[1]))<e&&(e=R,x=B);if(x<d&&null!==I[d])x=d;else for(a<S-d+x&&null!==I[d]&&(x=a-S+d);null===I[x];)x++;D.push({i:x,y:I[x]}),I[x]=null}D.sort(T)}for(d=0;d<S;d++)e=O[d],s=e.labelPos,i=e.dataLabel,l=!1===e.visible?"hidden":"inherit",e=s[1],0<b?(x=(a=D.pop()).i,((r=a.y)<e&&null!==I[x+1]||e<r&&null!==I[x-1])&&(r=fe(pe(0,e),h.plotHeight))):r=e,o=p.justify?y[0]+(c?-1:1)*($+b):u.getX(r===w-$-b||r===w+$+b?e:r,c),i._attr={visibility:l,align:s[6]},i._pos={x:o+p.x+({left:f,right:-f}[s[6]]||0),y:r+p.y-10},i.connX=o,i.connY=r,null===this.options.size&&(a=i.width,o-a<f?E[3]=pe(ue(a-o+f),E[3]):g-f<o+a&&(E[1]=pe(ue(o+a-g+f),E[1])),r-_/2<0?E[0]=pe(ue(_/2-r),E[0]):A<r+_/2&&(E[2]=pe(ue(r+_/2-A),E[2])))}}(0===N(E)||this.verifyDataLabelOverflow(E))&&(this.placeDataLabels(),k&&m&&Pe(this.points,function(e){t=e.connector,s=e.labelPos,(i=e.dataLabel)&&i._pos&&e.visible?(l=i._attr.visibility,o=i.connX,r=i.connY,n=v?["M",o+("left"===s[6]?5:-5),r,"C",o,r,2*s[2]-s[4],2*s[3]-s[5],s[2],s[3],"L",s[4],s[5]]:["M",o+("left"===s[6]?5:-5),r,"L",s[2],s[3],"L",s[4],s[5]],t?(t.animate({d:n}),t.attr("visibility",l)):e.connector=t=u.chart.renderer.path(n).attr({"stroke-width":m,stroke:p.connectorColor||e.color||"#606060",visibility:l}).add(u.dataLabelsGroup)):t&&(e.connector=t.destroy())}))}},Me.pie.prototype.placeDataLabels=function(){Pe(this.points,function(e){var t=e.dataLabel;t&&e.visible&&((e=t._pos)?(t.attr(t._attr),t[t.moved?"animate":"attr"](e),t.moved=!0):t&&t.attr({y:-9999}))})},Me.pie.prototype.alignDataLabel=Se,Me.pie.prototype.verifyDataLabelOverflow=function(e){var t,n=this.center,i=this.options,a=i.center,s=i.minSize||80,o=s;return null!==a[0]?o=pe(n[2]-pe(e[1],e[3]),s):(o=pe(n[2]-e[1]-e[3],s),n[0]+=(e[3]-e[1])/2),null!==a[1]?o=pe(fe(o,n[2]-pe(e[0],e[2])),s):(o=pe(fe(o,n[2]-e[0]-e[2]),s),n[1]+=(e[0]-e[2])/2),o<n[2]?(n[2]=o,n[3]=Math.min(/%$/.test(i.innerSize||0)?o*parseFloat(i.innerSize||0)/100:parseFloat(i.innerSize||0),o),this.translate(n),this.drawDataLabels&&this.drawDataLabels()):t=!0,t}),Me.column&&(Me.column.prototype.alignDataLabel=function(e,t,n,i,a){var s=this.chart.inverted,o=e.series,r=e.dlBox||e.shapeArgs,l=Je(e.below,e.plotY>Je(this.translatedThreshold,o.yAxis.len)),c=Je(n.inside,!!this.options.stacking);r&&((i=I(r)).y<0&&(i.height+=i.y,i.y=0),0<(r=i.y+i.height-o.yAxis.len)&&(i.height-=r),s&&(i={x:o.yAxis.len-i.y-i.height,y:o.xAxis.len-i.x-i.width,width:i.height,height:i.width}),c||(s?(i.x+=l?0:i.width,i.width=0):(i.y+=l?i.height:0,i.height=0))),n.align=Je(n.align,!s||c?"center":l?"right":"left"),n.verticalAlign=Je(n.verticalAlign,s||c?"middle":l?"top":"bottom"),gt.prototype.alignDataLabel.call(this,e,t,n,i,a)}),bt=(vt=le).Chart,yt=vt.each,$t=vt.pick,wt=vt.addEvent,bt.prototype.callbacks.push(function(e){function t(){var i=[];yt(e.series,function(e){var t=e.options.dataLabels,n=e.dataLabelCollections||["dataLabel"];(t.enabled||e._hasPointLabels)&&!t.allowOverlap&&e.visible&&yt(n,function(t){yt(e.points,function(e){e[t]&&(e[t].labelrank=$t(e.labelrank,e.shapeArgs&&e.shapeArgs.height),i.push(e[t]))})})}),e.hideOverlappingLabels(i)}t(),wt(e,"redraw",t)}),bt.prototype.hideOverlappingLabels=function(e){var t,n,i,a,s,o,r,l,c,d=e.length;for(n=0;n<d;n++)(t=e[n])&&(t.oldOpacity=t.opacity,t.newOpacity=1);for(e.sort(function(e,t){return(t.labelrank||0)-(e.labelrank||0)}),n=0;n<d;n++)for(i=e[n],t=n+1;t<d;++t)a=e[t],i&&a&&i.placed&&a.placed&&0!==i.newOpacity&&0!==a.newOpacity&&(s=i.alignAttr,o=a.alignAttr,r=i.parentGroup,l=a.parentGroup,c=2*(i.box?0:i.padding),s=!(o.x+l.translateX>s.x+r.translateX+(i.width-c)||o.x+l.translateX+(a.width-c)<s.x+r.translateX||o.y+l.translateY>s.y+r.translateY+(i.height-c)||o.y+l.translateY+(a.height-c)<s.y+r.translateY))&&((i.labelrank<a.labelrank?i:a).newOpacity=0);yt(e,function(e){var t,n
;e&&(n=e.newOpacity,e.oldOpacity!==n&&e.placed&&(n?e.show(!0):t=function(){e.hide()},e.alignAttr.opacity=n,e[e.isOld?"animate":"attr"](e.alignAttr,null,t)),e.isOld=!0)})},tt=le.TrackerMixin={drawTrackerPoint:function(){var t=this,i=t.chart,n=i.pointer,e=t.options.cursor,a=e&&{cursor:e},s=function(e){for(var t,n=e.target;n&&!t;)t=n.point,n=n.parentNode;t!==P&&t!==i.hoverPoint&&t.onMouseOver(e)};Pe(t.points,function(e){e.graphic&&(e.graphic.element.point=e),e.dataLabel&&(e.dataLabel.element.point=e)}),t._hasTracking||(Pe(t.trackerGroups,function(e){t[e]&&(t[e].addClass("highcharts-tracker").on("mouseover",s).on("mouseout",function(e){n.onTrackerMouseOut(e)}).css(a),U)&&t[e].on("touchstart",s)}),t._hasTracking=!0)},drawTrackerGraph:function(){var e=this,t=e.options,n=t.trackByArea,i=[].concat(n?e.areaPath:e.graphPath),a=i.length,s=e.chart,o=s.pointer,r=s.renderer,l=s.options.tooltip.snap,c=e.tracker,d=t.cursor,u=d&&{cursor:d},_=function(){s.hoverSeries!==e&&e.onMouseOver()},h="rgba(192,192,192,"+(xe?1e-4:.002)+")";if(a&&!n)for(d=a+1;d--;)"M"===i[d]&&i.splice(d+1,0,i[d+1]-l,i[d+2],"L"),(d&&"M"===i[d]||d===a)&&i.splice(d,0,"L",i[d-2]+l,i[d-1]);c?c.attr({d:i}):(e.tracker=r.path(i).attr({"stroke-linejoin":"round",visibility:e.visible?"visible":"hidden",stroke:h,fill:n?h:"none","stroke-width":t.lineWidth+(n?0:2*l),zIndex:2}).add(e.group),Pe([e.tracker,e.markerGroup],function(e){e.addClass("highcharts-tracker").on("mouseover",_).on("mouseout",function(e){o.onTrackerMouseOut(e)}).css(u),U&&e.on("touchstart",_)}))}},Me.column&&(At.prototype.drawTracker=tt.drawTrackerPoint),Me.pie&&(Me.pie.prototype.drawTracker=tt.drawTrackerPoint),Me.scatter&&(kt.prototype.drawTracker=tt.drawTrackerPoint),Xe(pt.prototype,{setItemEvents:function(n,e,t,i,a){var s=this;(t?e:n.legendGroup).on("mouseover",function(){n.setState("hover"),e.css(s.options.itemHoverStyle)}).on("mouseout",function(){e.css(n.visible?i:a),n.setState()}).on("click",function(e){var t=function(){n.setVisible&&n.setVisible()};e={browserEvent:e};n.firePointEvent?n.firePointEvent("legendItemClick",e,t):We(n,"legendItemClick",e,t)})},createCheckboxForItem:function(t){t.checkbox=S("input",{type:"checkbox",checked:t.selected,defaultChecked:t.selected},this.options.itemCheckboxStyle,this.chart.container),ze(t.checkbox,"click",function(e){We(t.series||t,"checkboxClick",{checked:e.target.checked,item:t},function(){t.select()})})}}),H.legend.itemStyle.cursor="pointer",Xe(ft.prototype,{showResetZoom:function(){var e=this,t=H.lang,n=e.options.chart.resetZoomButton,i=n.theme,a=i.states,s="chart"===n.relativeTo?null:"plotBox";this.resetZoomButton=e.renderer.button(t.resetZoom,null,null,function(){e.zoomOut()},i,a&&a.hover).attr({align:n.position.align,title:t.resetZoomTitle}).add().align(n.position,!1,s)},zoomOut:function(){var e=this;We(e,"selection",{resetSelection:!0},function(){e.zoom()})},zoom:function(e){var i,t,a=this.pointer,s=!1;!e||e.resetSelection?Pe(this.axes,function(e){i=e.zoom()}):Pe(e.xAxis.concat(e.yAxis),function(e){var t=e.axis,n=t.isXAxis;(a[n?"zoomX":"zoomY"]||a[n?"pinchX":"pinchY"])&&(i=t.zoom(e.min,e.max),t.displayBtn&&(s=!0))}),t=this.resetZoomButton,s&&!t?this.showResetZoom():!s&&_(t)&&(this.resetZoomButton=t.destroy()),i&&this.redraw(Je(this.options.chart.animation,e&&e.animation,this.pointCount<100))},pan:function(r,e){var l,c=this,t=c.hoverPoints;t&&Pe(t,function(e){e.setState()}),Pe("xy"===e?[1,0]:[1],function(e){var t=(e=c[e?"xAxis":"yAxis"][0]).horiz,n=r[t?"chartX":"chartY"],i=c[t=t?"mouseDownX":"mouseDownY"],a=(e.pointRange||0)/2,s=e.getExtremes(),o=e.toValue(i-n,!0)+a;a=e.toValue(i+e.len-n,!0)-a,i=n<i;e.series.length&&(i||o>fe(s.dataMin,s.min))&&(!i||a<pe(s.dataMax,s.max))&&(e.setExtremes(o,a,!1,!1,{trigger:"pan"}),l=!0),c[t]=n}),l&&c.redraw(!1),O(c.container,{cursor:"move"})}}),Xe(mt.prototype,{select:function(e,t){var n=this,i=n.series,a=i.chart;e=Je(e,!n.selected);n.firePointEvent(e?"select":"unselect",{accumulate:t},function(){n.selected=n.options.selected=e,i.options.data[Le(n,i.data)]=n.options,n.setState(e&&"select"),t||Pe(a.getSelectedPoints(),function(e){e.selected&&e!==n&&(e.selected=e.options.selected=!1,i.options.data[Le(e,i.data)]=e.options,e.setState(""),e.firePointEvent("unselect"))})})},onMouseOver:function(e,t){var n=this.series,i=n.chart,a=i.tooltip,s=i.hoverPoint;i.hoverSeries!==n&&n.onMouseOver(),s&&s!==this&&s.onMouseOut(),this.series&&(this.firePointEvent("mouseOver"),a&&(!a.shared||n.noSharedTooltip)&&a.refresh(this,e),this.setState("hover"),!t)&&(i.hoverPoint=this)},onMouseOut:function(){var e=this.series.chart,t=e.hoverPoints;this.firePointEvent("mouseOut"),t&&-1!==Le(this,t)||(this.setState(),e.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var e,t=I(this.series.options.point,this.options).events;for(e in this.events=t)ze(this,e,t[e]);this.hasImportedEvents=!0}},setState:function(e,t){var n,i=_e(this.plotX),a=this.plotY,s=this.series,o=s.options.states,r=et[s.type].marker&&s.options.marker,l=r&&!r.enabled,c=r&&r.states[e],d=c&&!1===c.enabled,u=s.stateMarkerGraphic,_=this.marker||{},h=s.chart,p=s.halo;e=e||"";n=this.pointAttr[e]||s.pointAttr[e],e===this.state&&!t||this.selected&&"select"!==e||o[e]&&!1===o[e].enabled||e&&(d||l&&!1===c.enabled)||e&&_.states&&_.states[e]&&!1===_.states[e].enabled||(this.graphic?(r=r&&this.graphic.symbolName&&n.r,this.graphic.attr(I(n,r?{x:i-r,y:a-r,width:2*r,height:2*r}:{})),u&&u.hide()):(e&&c&&(r=c.radius,_=_.symbol||s.symbol,u&&u.currentSymbol!==_&&(u=u.destroy()),u?u[t?"animate":"attr"]({x:i-r,y:a-r}):_&&(s.stateMarkerGraphic=u=h.renderer.symbol(_,i-r,a-r,2*r,2*r).attr(n).add(s.markerGroup),u.currentSymbol=_)),u&&(u[e&&h.isInsidePlot(i,a,h.inverted)?"show":"hide"](),u.element.point=this)),(i=o[e]&&o[e].halo)&&i.size?(p||(s.halo=p=h.renderer.path().add(h.seriesGroup)),p.attr(Xe({fill:this.color||s.color,"fill-opacity":i.opacity,zIndex:-1},i.attributes))[t?"animate":"attr"]({d:this.haloPath(i.size)})):p&&p.attr({d:[]}),this.state=e)},haloPath:function(e){var t=this.series,n=t.chart,i=t.getPlotBox(),a=n.inverted,s=Math.floor(this.plotX);return n.renderer.symbols.circle(i.translateX+(a?t.yAxis.len-this.plotY:s)-e,i.translateY+(a?t.xAxis.len-s:this.plotY)-e,2*e,2*e)}}),Xe(gt.prototype,{onMouseOver:function(){var e=this.chart,t=e.hoverSeries;t&&t!==this&&t.onMouseOut(),this.options.events.mouseOver&&We(this,"mouseOver"),this.setState("hover"),e.hoverSeries=this},onMouseOut:function(){var e=this.options,t=this.chart,n=t.tooltip,i=t.hoverPoint;t.hoverSeries=null,i&&i.onMouseOut(),this&&e.events.mouseOut&&We(this,"mouseOut"),n&&!e.stickyTracking&&(!n.shared||this.noSharedTooltip)&&n.hide(),this.setState()},setState:function(e){var t=this.options,n=this.graph,i=t.states,a=t.lineWidth;t=0,e=e||"";if(this.state!==e&&((!i[this.state=e]||!1!==i[e].enabled)&&(e&&(a=i[e].lineWidth||a+(i[e].lineWidthPlus||0)),n&&!n.dashstyle)))for(e={"stroke-width":a},n.attr(e);this["zoneGraph"+t];)this["zoneGraph"+t].attr(e),t+=1},setVisible:function(t,e){var n,i=this,a=i.chart,s=i.legendItem,o=a.options.chart.ignoreHiddenSeries,r=i.visible;n=(i.visible=t=i.userOptions.visible=t===P?!r:t)?"show":"hide",Pe(["group","dataLabelsGroup","markerGroup","tracker"],function(e){i[e]&&i[e][n]()}),a.hoverSeries!==i&&(a.hoverPoint&&a.hoverPoint.series)!==i||i.onMouseOut(),s&&a.legend.colorizeItem(i,t),i.isDirty=!0,i.options.stacking&&Pe(a.series,function(e){e.options.stacking&&e.visible&&(e.isDirty=!0)}),Pe(i.linkedSeries,function(e){e.setVisible(t,!1)}),o&&(a.isDirtyBox=!0),!1!==e&&a.redraw(),We(i,n)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(e){this.selected=e=e===P?!this.selected:e,this.checkbox&&(this.checkbox.checked=e),We(this,e?"select":"unselect")},drawTracker:tt.drawTrackerGraph}),Xe(le,{Color:K,Point:mt,Tick:j,Renderer:r,SVGElement:M,SVGRenderer:at,arrayMin:R,arrayMax:N,charts:Re,dateFormat:u,error:y,format:v,pathAnim:void 0,getOptions:function(){return H},hasBidiBug:a,isTouchDevice:i,setOptions:function(e){return H=I(!0,H,e),t(),H},addEvent:ze,removeEvent:qe,createElement:S,discardElement:o,css:O,each:Pe,map:Qe,merge:I,splat:h,stableSort:T,extendClass:e,pInt:f,svg:xe,canvas:Ie,vml:!xe&&!Ie,product:"Highcharts",version:"4.2.2"}),le}),function(){"use strict";function e(k){function n(e,a){var t,n,s=e==window,i=a&&a.message!==undefined?a.message:undefined;if(!(a=k.extend({},k.blockUI.defaults,a||{})).ignoreIfBlocked||!k(e).data("blockUI.isBlocked")){if(a.overlayCSS=k.extend({},k.blockUI.defaults.overlayCSS,a.overlayCSS||{}),t=k.extend({},k.blockUI.defaults.css,a.css||{}),a.onOverlayClick&&(a.overlayCSS.cursor="pointer"),n=k.extend({},k.blockUI.defaults.themedCSS,a.themedCSS||{}),i=i===undefined?a.message:i,s&&B&&C(window,{fadeOut:0}),i&&"string"!=typeof i&&(i.parentNode||i.jquery)){var o=i.jquery?i[0]:i,r={};k(e).data("blockUI.history",r),r.el=o,r.parent=o.parentNode,r.display=o.style.display,r.position=o.style.position,r.parent&&r.parent.removeChild(o)}k(e).data("blockUI.onUnblock",a.onUnblock);var l,c,d,u,_=a.baseZ;l=O||a.forceIframe?k('<iframe class="blockUI" style="z-index:'+_+++';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+a.iframeSrc+'"></iframe>'):k('<div class="blockUI" style="display:none"></div>'),c=a.theme?k('<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+_+++';display:none"></div>'):k('<div class="blockUI blockOverlay" style="z-index:'+_+++';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),a.theme&&s?(u='<div class="blockUI '+a.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(_+10)+';display:none;position:fixed">',a.title&&(u+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(a.title||"&nbsp;")+"</div>"),u+='<div class="ui-widget-content ui-dialog-content"></div>',u+="</div>"):a.theme?(u='<div class="blockUI '+a.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(_+10)+';display:none;position:absolute">',a.title&&(u+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(a.title||"&nbsp;")+"</div>"),u+='<div class="ui-widget-content ui-dialog-content"></div>',u+="</div>"):u=s?'<div class="blockUI '+a.blockMsgClass+' blockPage" style="z-index:'+(_+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+a.blockMsgClass+' blockElement" style="z-index:'+(_+10)+';display:none;position:absolute"></div>',d=k(u),i&&(a.theme?(d.css(n),d.addClass("ui-widget-content")):d.css(t)),a.theme||c.css(a.overlayCSS),c.css("position",s?"fixed":"absolute"),(O||a.forceIframe)&&l.css("opacity",0);var h=[l,c,d],p=k(s?"body":e);k.each(h,function(){this.appendTo(p)}),a.theme&&a.draggable&&k.fn.draggable&&d.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var f=R&&(!k.support.boxModel||0<k("object,embed",s?null:e).length);if(S||f){if(s&&a.allowBodyStretch&&k.support.boxModel&&k("html,body").css("height","100%"),(S||!k.support.boxModel)&&!s)var m=I(e,"borderTopWidth"),g=I(e,"borderLeftWidth"),A=m?"(0 - "+m+")":0,v=g?"(0 - "+g+")":0;k.each(h,function(e,t){var n=t[0].style;if(n.position="absolute",e<2)s?n.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+a.quirksmodeOffsetHack+') + "px"'):n.setExpression("height",'this.parentNode.offsetHeight + "px"'),s?n.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):n.setExpression("width",'this.parentNode.offsetWidth + "px"'),v&&n.setExpression("left",v),A&&n.setExpression("top",A);else if(a.centerY)s&&n.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),n.marginTop=0;else if(!a.centerY&&s){var i="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+(a.css&&a.css.top?parseInt(a.css.top,10):0)+') + "px"';n.setExpression("top",i)}})}if(i&&(a.theme?d.find(".ui-widget-content").append(i):d.append(i),(i.jquery||i.nodeType)&&k(i).show()),(O||a.forceIframe)&&a.showOverlay&&l.show(),a.fadeIn){var b=a.onBlock?a.onBlock:D,y=a.showOverlay&&!i?b:D,$=i?b:D;a.showOverlay&&c._fadeIn(a.fadeIn,y),i&&d._fadeIn(a.fadeIn,$)}else a.showOverlay&&c.show(),i&&d.show(),a.onBlock&&a.onBlock.bind(d)();if(E(1,e,a),s?(B=d[0],N=k(a.focusableElements,B),a.focusInput&&setTimeout(T,20)):x(d[0],a.centerX,a.centerY),a.timeout){var w=setTimeout(function(){s?k.unblockUI(a):k(e).unblock(a)},a.timeout);k(e).data("blockUI.timeout",w)}}}function C(e,t){var n,i,a=e==window,s=k(e),o=s.data("blockUI.history"),r=s.data("blockUI.timeout");r&&(clearTimeout(r),s.removeData("blockUI.timeout")),t=k.extend({},k.blockUI.defaults,t||{}),E(0,e,t),null===t.onUnblock&&(t.onUnblock=s.data("blockUI.onUnblock"),s.removeData("blockUI.onUnblock")),i=a?k("body").children().filter(".blockUI").add("body > .blockUI"):s.find(">.blockUI"),t.cursorReset&&(1<i.length&&(i[1].style.cursor=t.cursorReset),2<i.length&&(i[2].style.cursor=t.cursorReset)),a&&(B=N=null),t.fadeOut?(n=i.length,i.stop().fadeOut(t.fadeOut,function(){0==--n&&l(i,o,t,e)})):l(i,o,t,e)}function l(e,t,n,i){var a=k(i);if(!a.data("blockUI.isBlocked")){e.each(function(){this.parentNode&&this.parentNode.removeChild(this)}),t&&t.el&&(t.el.style.display=t.display,t.el.style.position=t.position,t.el.style.cursor="default",t.parent&&t.parent.appendChild(t.el),a.removeData("blockUI.history")),a.data("blockUI.static")&&a.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var s=k(document.body),o=s.width(),r=s[0].style.width;s.width(o-1).width(o),s[0].style.width=r}}function E(e,t,n){var i=t==window,a=k(t);if((e||(!i||B)&&(i||a.data("blockUI.isBlocked")))&&(a.data("blockUI.isBlocked",e),i&&n.bindEvents&&(!e||n.showOverlay))){var s="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";e?k(document).bind(s,n,o):k(document).unbind(s,o)}}function o(e){if("keydown"===e.type&&e.keyCode&&9==e.keyCode&&B&&e.data.constrainTabKey){var t=N,n=!e.shiftKey&&e.target===t[t.length-1],i=e.shiftKey&&e.target===t[0];if(n||i)return setTimeout(function(){T(i)},10),!1}var a=e.data,s=k(e.target);return s.hasClass("blockOverlay")&&a.onOverlayClick&&a.onOverlayClick(e),0<s.parents("div."+a.blockMsgClass).length||0===s.parents().children().filter("div.blockUI").length}function T(e){if(N){var t=N[!0===e?N.length-1:0];t&&t.focus()}}function x(e,t,n){var i=e.parentNode,a=e.style,s=(i.offsetWidth-e.offsetWidth)/2-I(i,"borderLeftWidth"),o=(i.offsetHeight-e.offsetHeight)/2-I(i,"borderTopWidth");t&&(a.left=0<s?s+"px":"0"),n&&(a.top=0<o?o+"px":"0")}function I(e,t){return parseInt(k.css(e,t),10)||0}k.fn._fadeIn=k.fn.fadeIn;var D=k.noop||function(){},O=/MSIE/.test(navigator.userAgent),S=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),R=(document.documentMode,k.isFunction(document.createElement("div").style.setExpression));k.blockUI=function(e){n(window,e)},k.unblockUI=function(e){C(window,e)},k.growlUI=function(e,t,n,i){var a=k('<div class="growlUI"></div>');e&&a.append("<h1>"+e+"</h1>"),t&&a.append("<h2>"+t+"</h2>"),n===undefined&&(n=3e3);var s=function(e){e=e||{},k.blockUI({message:a,fadeIn:"undefined"!=typeof e.fadeIn?e.fadeIn:700,fadeOut:"undefined"!=typeof e.fadeOut?e.fadeOut:1e3,timeout:"undefined"!=typeof e.timeout?e.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:k.blockUI.defaults.growlCSS})};s();a.css("opacity");a.mouseover(function(){s({fadeIn:0,timeout:3e4});var e=k(".blockMsg");e.stop(),e.fadeTo(300,1)}).mouseout(function(){k(".blockMsg").fadeOut(1e3)})},k.fn.block=function(e){if(this[0]===window)return k.blockUI(e),this;var t=k.extend({},k.blockUI.defaults,e||{});return this.each(function(){var e=k(this);t.ignoreIfBlocked&&e.data("blockUI.isBlocked")||e.unblock({fadeOut:0})}),this.each(function(){"static"==k.css(this,"position")&&(this.style.position="relative",k(this).data("blockUI.static",!0)),this.style.zoom=1,n(this,e)})},k.fn.unblock=function(e){return this[0]===window?(k.unblockUI(e),this):this.each(function(){C(this,e)})},k.blockUI.version=2.7,k.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var B=null,N=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}(),function(r,i,a,l){var c=r(i);r.fn.lazyload=function(e){function t(){var t=0;s.each(function(){var e=r(this);if(!o.skip_invisible||e.is(":visible"))if(r.abovethetop(this,o)||r.leftofbegin(this,o));else if(r.belowthefold(this,o)||r.rightoffold(this,o)){if(++t>o.failure_limit)return!1}else e.trigger("appear"),t=0})}var n,s=this,o={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:i,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return e&&(l!==e.failurelimit&&(e.failure_limit=e.failurelimit,delete e.failurelimit),l!==e.effectspeed&&(e.effect_speed=e.effectspeed,delete e.effectspeed),r.extend(o,e)),n=o.container===l||o.container===i?c:r(o.container),0===o.event.indexOf("scroll")&&n.on(o.event,function(){return t()}),this.each(function(){var i=this,a=r(i);i.loaded=!1,a.attr("src")!==l&&!1!==a.attr("src")||a.is("img")&&a.attr("src",o.placeholder),a.one("appear",function(){if(!this.loaded){if(o.appear){var e=s.length;o.appear.call(i,e,o)}r("<img />").one("load",function(){var e=a.attr("data-"+o.data_attribute);a.hide(),a.is("img")?a.attr("src",e):a.css("background-image","url('"+e+"')"),a[o.effect](o.effect_speed),i.loaded=!0;var t=r.grep(s,function(e){return!e.loaded});if(s=r(t),o.load){var n=s.length;o.load.call(i,n,o)}}).attr("src",a.attr("data-"+o.data_attribute))}}),0!==o.event.indexOf("scroll")&&a.on(o.event,function(){i.loaded||a.trigger("appear")})}),c.on("resize",function(){t()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&c.on("pageshow",function(e){e.originalEvent&&e.originalEvent.persisted&&s.each(function(){r(this).trigger("appear")})}),r(a).ready(function(){t()}),this},r.belowthefold=function(e,t){return(t.container===l||t.container===i?(i.innerHeight?i.innerHeight:c.height())+c.scrollTop():r(t.container).offset().top+r(t.container).height())<=r(e).offset().top-t.threshold},r.rightoffold=function(e,t){return(t.container===l||t.container===i?c.width()+c.scrollLeft():r(t.container).offset().left+r(t.container).width())<=r(e).offset().left-t.threshold},r.abovethetop=function(e,t){return(t.container===l||t.container===i?c.scrollTop():r(t.container).offset().top)>=r(e).offset().top+t.threshold+r(e).height()},r.leftofbegin=function(e,t){return(t.container===l||t.container===i?c.scrollLeft():r(t.container).offset().left)>=r(e).offset().left+t.threshold+r(e).width()},r.inviewport=function(e,t){return!(r.rightoffold(e,t)||r.leftofbegin(e,t)||r.belowthefold(e,t)||r.abovethetop(e,t))},r.extend(r.expr[":"],{"below-the-fold":function(e){return r.belowthefold(e,{threshold:0})},"above-the-top":function(e){return!r.belowthefold(e,{threshold:0})},"right-of-screen":function(e){return r.rightoffold(e,{threshold:0})},"left-of-screen":function(e){return!r.rightoffold(e,{threshold:0})},"in-viewport":function(e){return r.inviewport(e,{threshold:0})},"above-the-fold":function(e){return!r.belowthefold(e,{threshold:0})},"right-of-fold":function(e){return r.rightoffold(e,{threshold:0})},"left-of-fold":function(e){return!r.rightoffold(e,{threshold:0})}})}(jQuery,window,document),function(e){"function"==typeof define&&define.amd?define(e):window.purl=e()}(function(){function n(e,t){for(var n=decodeURI(e),i=m[t?"strict":"loose"].exec(n),a={attr:{},param:{},seg:{}},s=14;s--;)a.attr[p[s]]=i[s]||"";return a.param.query=c(a.attr.query),a.param.fragment=c(a.attr.fragment),a.seg.path=a.attr.path.replace(/^\/+|\/+$/g,"").split("/"),a.seg.fragment=a.attr.fragment.replace(/^\/+|\/+$/g,"").split("/"),a.attr.base=a.attr.host?(a.attr.protocol?a.attr.protocol+"://"+a.attr.host:a.attr.host)+(a.attr.port?":"+a.attr.port:""):"",a}function i(e){var t=e.tagName;return void 0!==t?h[t.toLowerCase()]:t}function o(e,t){if(0===e[t].length)return e[t]={};var n={};for(var i in e[t])n[i]=e[t][i];return e[t]=n}function r(e,t,n,i){var a=e.shift();if(a){var s=t[n]=t[n]||[];"]"==a?u(s)?""!==i&&s.push(i):"object"==typeof s?s[_(s).length]=i:s=t[n]=[t[n],i]:(~a.indexOf("]")&&(a=a.substr(0,a.length-1)),!g.test(a)&&u(s)&&(s=o(t,n)),r(e,s,a,i))}else u(t[n])?t[n].push(i):"object"==typeof t[n]?t[n]=i:"undefined"==typeof t[n]?t[n]=i:t[n]=[t[n],i]}function l(e,t,n){if(~t.indexOf("]")){r(t.split("["),e,"base",n)}else{if(!g.test(t)&&u(e.base)){var i={};for(var a in e.base)i[a]=e.base[a];e.base=i}""!==t&&s(e.base,t,n)}return e}function c(e){return t(String(e).split(/&|;/),function(e,t){try{t=decodeURIComponent(t.replace(/\+/g," "))}catch(o){}var n=t.indexOf("="),i=d(t),a=t.substr(0,i||n),s=t.substr(i||n,t.length);return s=s.substr(s.indexOf("=")+1,s.length),""===a&&(a=t,s=""),l(e,a,s)},{base:{}}).base}function s(e,t,n){var i=e[t];void 0===i?e[t]=n:u(i)?i.push(n):e[t]=[i,n]}function d(e){for(var t,n,i=e.length,a=0;a<i;++a)if("]"==(n=e[a])&&(t=!1),"["==n&&(t=!0),"="==n&&!t)return a}function t(e,t,n){for(var i=0,a=e.length>>0,s=n;i<a;)i in e&&(s=t.call(undefined,s,e[i],i,e)),++i;return s}function u(e){return"[object Array]"===Object.prototype.toString.call(e)}function _(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}function a(e,t){return 1===arguments.length&&!0===e&&(t=!0,e=undefined),t=t||!1,{data:n(e=e||window.location.toString(),t),attr:function(e){return void 0!==(e=f[e]||e)?this.data.attr[e]:this.data.attr},param:function(e){return void 0!==e?this.data.param.query[e]:this.data.param.query},fparam:function(e){return void 0!==e?this.data.param.fragment[e]:this.data.param.fragment},segment:function(e){return void 0===e?this.data.seg.path:(e=e<0?this.data.seg.path.length+e:e-1,this.data.seg.path[e])},fsegment:function(e){return void 0===e?this.data.seg.fragment:(e=e<0?this.data.seg.fragment.length+e:e-1,this.data.seg.fragment[e])}}}var h={a:"href",img:"src",form:"action",base:"href",script:"src",iframe:"src",link:"href",embed:"src",object:"data"},p=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","fragment"],f={anchor:"fragment"},m={strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/},g=/^[0-9]+$/;return a.jQuery=function(n){null!=n&&(n.fn.url=function(e){var t="";return this.length&&(t=n(this).attr(i(this[0]))||""),a(t,e)},n.url=a)},a.jQuery(window.jQuery),a}),function(n,i,wt){"use strict";!function(n){function i(e){if(a[e])return a[e].exports;var t=a[e]={exports:{},id:e,loaded:!1};return n[e].call(t.exports,t,t.exports,i),t.loaded=!0,t.exports}var a={};i.m=n,i.c=a,i.p="",i(0)}([function(e,t,n){n(1),n(50),n(51),n(52),n(54),n(55),n(58),n(59),n(60),n(61),n(62),n(63),n(64),n(65),n(66),n(68),n(70),n(72),n(74),n(77),n(78),n(79),n(83),n(87),n(88),n(89),n(90),n(92),n(93),n(94),n(95),n(96),n(98),n(100),n(101),n(102),n(104),n(105),n(106),n(108),n(109),n(110),n(112),n(113),n(114),n(115),n(116),n(117),n(118),n(119),n(120),n(121),n(122),n(123),n(124),n(125),n(127),n(131),n(132),n(133),n(134),n(138),n(140),n(141),n(142),n(143),n(144),n(145),n(146),n(147),n(148),n(149),n(150),n(151),n(152),n(153),n(159),n(160),n(162),n(163),n(164),n(168),n(169),n(170),n(171),n(172),n(174),n(175),n(176),n(177),n(180),n(182),n(183),n(184),n(186),n(188),n(190),n(191),n(192),n(194),n(195),n(196),n(197),n(203),n(206),n(207),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(219),n(220),n(222),n(223),n(224),n(225),n(226),n(227),n(228),n(229),n(231),n(234),n(235),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(247),n(248),n(250),n(251),n(252),n(253),n(254),n(255),n(256),n(257),n(259),n(260),n(262),n(263),n(264),n(265),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(288),n(289),n(292),n(157),n(293),n(237),n(294),n(295),n(296),n(297),n(298),n(300),n(301),n(302),n(304),e.exports=n(305)},function(e,t,n){var i=n(2),o=n(3),a=n(4),s=n(6),r=n(16),l=n(20).KEY,c=n(5),d=n(21),u=n(22),_=n(17),h=n(23),p=n(24),f=n(25),m=n(27),g=n(40),A=n(43),v=n(10),b=n(30),y=n(14),$=n(15),w=n(44),k=n(47),C=n(49),E=n(9),T=n(28),x=C.f,I=E.f,D=k.f,O=i.Symbol,S=i.JSON,R=S&&S.stringify,B="prototype",N=h("_hidden"),F=h("toPrimitive"),K={}.propertyIsEnumerable,M=d("symbol-registry"),j=d("symbols"),L=d("op-symbols"),P=Object[B],U="function"==typeof O,H=i.QObject,Q=!H||!H[B]||!H[B].findChild,z=a&&c(function(){return 7!=w(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(e,t,n){var i=x(P,t);i&&delete P[t],I(e,t,n),i&&e!==P&&I(P,t,i)}:I,q=function(e){var t=j[e]=w(O[B]);return t._k=e,t},W=U&&"symbol"==typeof O.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof O},Y=function ie(e,t,n){return e===P&&Y(L,t,n),v(e),t=y(t,!0),v(n),o(j,t)?(n.enumerable?(o(e,N)&&e[N][t]&&(e[N][t]=!1),n=w(n,{enumerable:$(0,!1)})):(o(e,N)||I(e,N,$(1,{})),e[N][t]=!0),z(e,t,n)):I(e,t,n)},V=function ae(e,t){v(e);for(var n,i=g(t=b(t)),a=0,s=i.length;a<s;)Y(e,n=i[a++],t[n]);return e},G=function se(e,t){return t===wt?w(e):V(w(e),t)},X=function oe(e){var t=K.call(this,e=y(e,!0));return!(this===P&&o(j,e)&&!o(L,e))&&(!(t||!o(this,e)||!o(j,e)||o(this,N)&&this[N][e])||t)},J=function re(e,t){if(e=b(e),t=y(t,!0),e!==P||!o(j,t)||o(L,t)){var n=x(e,t);return!n||!o(j,t)||o(e,N)&&e[N][t]||(n.enumerable=!0),n}},Z=function le(e){for(var t,n=D(b(e)),i=[],a=0;n.length>a;)o(j,t=n[a++])||t==N||t==l||i.push(t);return i},ee=function ce(e){for(var t,n=e===P,i=D(n?L:b(e)),a=[],s=0;i.length>s;)!o(j,t=i[s++])||n&&!o(P,t)||a.push(j[t]);return a};U||(r((O=function de(e){if(this instanceof O)throw TypeError("Symbol is not a constructor!");var t=_(0<arguments.length?e:wt),n=function(e){this===P&&n.call(L,e),o(this,N)&&o(this[N],t)&&(this[N][t]=!1),z(this,t,$(1,e))};return a&&Q&&z(P,t,{configurable:!0,set:n}),q(t)})[B],"toString",function ue(){return this._k}),C.f=J,E.f=Y,n(48).f=k.f=Z,n(42).f=X,n(41).f=ee,a&&!n(26)&&r(P,"propertyIsEnumerable",X,!0),p.f=function(e){return q(h(e))}),s(s.G+s.W+s.F*!U,{Symbol:O});for(var te="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ne=0;te.length>ne;)h(te[ne++]);for(te=T(h.store),ne=0;te.length>ne;)f(te[ne++]);s(s.S+s.F*!U,"Symbol",{"for":function(e){return o(M,e+="")?M[e]:M[e]=O(e)},keyFor:function _e(e){if(W(e))return m(M,e);throw TypeError(e+" is not a symbol!")},useSetter:function(){Q=!0},useSimple:function(){Q=!1}}),s(s.S+s.F*!U,"Object",{create:G,defineProperty:Y,defineProperties:V,getOwnPropertyDescriptor:J,getOwnPropertyNames:Z,getOwnPropertySymbols:ee}),S&&s(s.S+s.F*(!U||c(function(){var e=O();return"[null]"!=R([e])||"{}"!=R({a:e})||"{}"!=R(Object(e))})),"JSON",{stringify:function he(e){if(e!==wt&&!W(e)){for(var t,n,i=[e],a=1;arguments.length>a;)i.push(arguments[a++]);return"function"==typeof(t=i[1])&&(n=t),!n&&A(t)||(t=function(e,t){if(n&&(t=n.call(this,e,t)),!W(t))return t}),i[1]=t,R.apply(S,i)}}}),O[B][F]||n(8)(O[B],F,O[B].valueOf),u(O,"Symbol"),u(Math,"Math",!0),u(i.JSON,"JSON",!0)},function(e){var t=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof i&&(i=t)},function(e){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){e.exports=!n(5)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t,n){var f=n(2),m=n(7),g=n(8),A=n(16),v=n(18),b="prototype",y=function(e,t,n){var i,a,s,o,r=e&y.F,l=e&y.G,c=e&y.S,d=e&y.P,u=e&y.B,_=l?f:c?f[t]||(f[t]={}):(f[t]||{})[b],h=l?m:m[t]||(m[t]={}),p=h[b]||(h[b]={});for(i in l&&(n=t),n)s=((a=!r&&_&&_[i]!==wt)?_:n)[i],o=u&&a?v(s,f):d&&"function"==typeof s?v(Function.call,s):s,_&&A(_,i,s,e&y.U),h[i]!=s&&g(h,i,o),d&&p[i]!=s&&(p[i]=s)};f.core=m,y.F=1,y.G=2,y.S=4,y.P=8,y.B=16,y.W=32,y.U=64,y.R=128,e.exports=y},function(e){var t=e.exports={version:"2.4.0"};"number"==typeof n&&(n=t)},function(e,t,n){var i=n(9),a=n(15);e.exports=n(4)?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var a=n(10),s=n(12),o=n(14),r=Object.defineProperty;t.f=n(4)?Object.defineProperty:function l(e,t,n){if(a(e),t=o(t,!0),a(n),s)try{return r(e,t,n)}catch(i){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){var i=n(11);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(4)&&!n(5)(function(){return 7!=Object.defineProperty(n(13)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var i=n(11),a=n(2).document,s=i(a)&&i(a.createElement);e.exports=function(e){return s?a.createElement(e):{}}},function(e,t,n){var a=n(11);e.exports=function(e,t){if(!a(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!a(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!a(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!a(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var s=n(2),o=n(8),r=n(3),l=n(17)("src"),i="toString",a=Function[i],c=(""+a).split(i);n(7).inspectSource=function(e){return a.call(e)},(e.exports=function(e,t,n,i){var a="function"==typeof n;a&&(r(n,"name")||o(n,"name",t)),e[t]!==n&&(a&&(r(n,l)||o(n,l,e[t]?""+e[t]:c.join(String(t)))),e===s?e[t]=n:i?e[t]?e[t]=n:o(e,t,n):(delete e[t],o(e,t,n)))})(Function.prototype,i,function d(){return"function"==typeof this&&this[l]||a.call(this)})},function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(e===wt?"":e,")_",(++t+n).toString(36))}},function(e,t,n){var s=n(19);e.exports=function(i,a,e){if(s(i),a===wt)return i;switch(e){case 1:return function(e){return i.call(a,e)};case 2:return function(e,t){return i.call(a,e,t)};case 3:return function(e,t,n){return i.call(a,e,t,n)}}return function(){return i.apply(a,arguments)}}},function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var i=n(17)("meta"),a=n(11),s=n(3),o=n(9).f,r=0,l=Object.isExtensible||function(){return!0},c=!n(5)(function(){return l(Object.preventExtensions({}))}),d=function(e){o(e,i,{value:{i:"O"+ ++r,w:{}}})},u=function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,i)){if(!l(e))return"F";if(!t)return"E";d(e)}return e[i].i},_=function(e,t){if(!s(e,i)){if(!l(e))return!0;if(!t)return!1;d(e)}return e[i].w},h=function(e){return c&&p.NEED&&l(e)&&!s(e,i)&&d(e),e},p=e.exports={KEY:i,NEED:!1,fastKey:u,getWeak:_,onFreeze:h}},function(e,t,n){var i=n(2),a="__core-js_shared__",s=i[a]||(i[a]={});e.exports=function(e){return s[e]||(s[e]={})}},function(e,t,n){var i=n(9).f,a=n(3),s=n(23)("toStringTag");e.exports=function(e,t,n){e&&!a(e=n?e:e.prototype,s)&&i(e,s,{
configurable:!0,value:t})}},function(e,t,n){var i=n(21)("wks"),a=n(17),s=n(2).Symbol,o="function"==typeof s;(e.exports=function(e){return i[e]||(i[e]=o&&s[e]||(o?s:a)("Symbol."+e))}).store=i},function(e,t,n){t.f=n(23)},function(e,t,n){var i=n(2),a=n(7),s=n(26),o=n(24),r=n(9).f;e.exports=function(e){var t=a.Symbol||(a.Symbol=s?{}:i.Symbol||{});"_"==e.charAt(0)||e in t||r(t,e,{value:o.f(e)})}},function(e){e.exports=!1},function(e,t,n){var r=n(28),l=n(30);e.exports=function(e,t){for(var n,i=l(e),a=r(i),s=a.length,o=0;o<s;)if(i[n=a[o++]]===t)return n}},function(e,t,n){var i=n(29),a=n(39);e.exports=Object.keys||function s(e){return i(e,a)}},function(e,t,n){var o=n(3),r=n(30),l=n(34)(!1),c=n(38)("IE_PROTO");e.exports=function(e,t){var n,i=r(e),a=0,s=[];for(n in i)n!=c&&o(i,n)&&s.push(n);for(;t.length>a;)o(i,n=t[a++])&&(~l(s,n)||s.push(n));return s}},function(e,t,n){var i=n(31),a=n(33);e.exports=function(e){return i(a(e))}},function(e,t,n){var i=n(32);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},function(e){e.exports=function(e){if(e==wt)throw TypeError("Can't call method on  "+e);return e}},function(e,t,n){var l=n(30),c=n(35),d=n(37);e.exports=function(r){return function(e,t,n){var i,a=l(e),s=c(a.length),o=d(n,s);if(r&&t!=t){for(;o<s;)if((i=a[o++])!=i)return!0}else for(;o<s;o++)if((r||o in a)&&a[o]===t)return r||o||0;return!r&&-1}}},function(e,t,n){var i=n(36),a=Math.min;e.exports=function(e){return 0<e?a(i(e),9007199254740991):0}},function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(0<e?n:t)(e)}},function(e,t,n){var i=n(36),a=Math.max,s=Math.min;e.exports=function(e,t){return(e=i(e))<0?a(e+t,0):s(e,t)}},function(e,t,n){var i=n(21)("keys"),a=n(17);e.exports=function(e){return i[e]||(i[e]=a(e))}},function(e){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(28),l=n(41),c=n(42);e.exports=function(e){var t=r(e),n=l.f;if(n)for(var i,a=n(e),s=c.f,o=0;a.length>o;)s.call(e,i=a[o++])&&t.push(i);return t}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var i=n(32);e.exports=Array.isArray||function a(e){return"Array"==i(e)}},function(e,t,a){var i=a(10),s=a(45),o=a(39),r=a(38)("IE_PROTO"),l=function(){},c="prototype",d=function(){var e,t=a(13)("iframe"),n=o.length,i=">";for(t.style.display="none",a(46).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("<script>document.F=Object</script"+i),e.close(),d=e.F;n--;)delete d[c][o[n]];return d()};e.exports=Object.create||function u(e,t){var n;return null!==e?(l[c]=i(e),n=new l,l[c]=null,n[r]=e):n=d(),t===wt?n:s(n,t)}},function(e,t,n){var o=n(9),r=n(10),l=n(28);e.exports=n(4)?Object.defineProperties:function c(e,t){r(e);for(var n,i=l(t),a=i.length,s=0;s<a;)o.f(e,n=i[s++],t[n]);return e}},function(e,t,n){e.exports=n(2).document&&document.documentElement},function(e,t,n){var i=n(30),a=n(48).f,s={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],r=function(e){try{return a(e)}catch(t){return o.slice()}};e.exports.f=function l(e){return o&&"[object Window]"==s.call(e)?r(e):a(i(e))}},function(e,t,n){var i=n(29),a=n(39).concat("length","prototype");t.f=Object.getOwnPropertyNames||function s(e){return i(e,a)}},function(e,t,n){var i=n(42),a=n(15),s=n(30),o=n(14),r=n(3),l=n(12),c=Object.getOwnPropertyDescriptor;t.f=n(4)?c:function d(e,t){if(e=s(e),t=o(t,!0),l)try{return c(e,t)}catch(n){}if(r(e,t))return a(!i.f.call(e,t),e[t])}},function(e,t,n){var i=n(6);i(i.S+i.F*!n(4),"Object",{defineProperty:n(9).f})},function(e,t,n){var i=n(6);i(i.S+i.F*!n(4),"Object",{defineProperties:n(45)})},function(e,t,n){var i=n(30),a=n(49).f;n(53)("getOwnPropertyDescriptor",function(){return function n(e,t){return a(i(e),t)}})},function(e,t,n){var a=n(6),s=n(7),o=n(5);e.exports=function(e,t){var n=(s.Object||{})[e]||Object[e],i={};i[e]=t(n),a(a.S+a.F*o(function(){n(1)}),"Object",i)}},function(e,t,n){var i=n(6);i(i.S,"Object",{create:n(44)})},function(e,t,n){var i=n(56),a=n(57);n(53)("getPrototypeOf",function(){return function t(e){return a(i(e))}})},function(e,t,n){var i=n(33);e.exports=function(e){return Object(i(e))}},function(e,t,n){var i=n(3),a=n(56),s=n(38)("IE_PROTO"),o=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=a(e),i(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?o:null}},function(e,t,n){var i=n(56),a=n(28);n(53)("keys",function(){return function t(e){return a(i(e))}})},function(e,t,n){n(53)("getOwnPropertyNames",function(){return n(47).f})},function(e,t,n){var i=n(11),a=n(20).onFreeze;n(53)("freeze",function(t){return function n(e){return t&&i(e)?t(a(e)):e}})},function(e,t,n){var i=n(11),a=n(20).onFreeze;n(53)("seal",function(t){return function n(e){return t&&i(e)?t(a(e)):e}})},function(e,t,n){var i=n(11),a=n(20).onFreeze;n(53)("preventExtensions",function(t){return function n(e){return t&&i(e)?t(a(e)):e}})},function(e,t,n){var i=n(11);n(53)("isFrozen",function(t){return function n(e){return!i(e)||!!t&&t(e)}})},function(e,t,n){var i=n(11);n(53)("isSealed",function(t){return function n(e){return!i(e)||!!t&&t(e)}})},function(e,t,n){var i=n(11);n(53)("isExtensible",function(t){return function n(e){return!!i(e)&&(!t||t(e))}})},function(e,t,n){var i=n(6);i(i.S+i.F,"Object",{assign:n(67)})},function(e,t,n){var _=n(28),h=n(41),p=n(42),f=n(56),m=n(31),a=Object.assign;e.exports=!a||n(5)(function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach(function(e){t[e]=e}),7!=a({},e)[n]||Object.keys(a({},t)).join("")!=i})?function g(e,t){for(var n=f(e),i=arguments.length,a=1,s=h.f,o=p.f;a<i;)for(var r,l=m(arguments[a++]),c=s?_(l).concat(s(l)):_(l),d=c.length,u=0;u<d;)o.call(l,r=c[u++])&&(n[r]=l[r]);return n}:a},function(e,t,n){var i=n(6);i(i.S,"Object",{is:n(69)})},function(e){e.exports=Object.is||function n(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}},function(e,t,n){var i=n(6);i(i.S,"Object",{setPrototypeOf:n(71).set})},function(e,t,s){var n=s(11),i=s(10),o=function(e,t){if(i(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,n,i){try{(i=s(18)(Function.call,s(49).f(Object.prototype,"__proto__").set,2))(e,[]),n=!(e instanceof Array)}catch(t){n=!0}return function a(e,t){return o(e,t),n?e.__proto__=t:i(e,t),e}}({},!1):wt),check:o}},function(e,t,n){var i=n(73),a={};a[n(23)("toStringTag")]="z",a+""!="[object z]"&&n(16)(Object.prototype,"toString",function s(){return"[object "+i(this)+"]"},!0)},function(e,t,n){var a=n(32),s=n(23)("toStringTag"),o="Arguments"==a(function(){return arguments}()),r=function(e,t){try{return e[t]}catch(n){}};e.exports=function(e){var t,n,i;return e===wt?"Undefined":null===e?"Null":"string"==typeof(n=r(t=Object(e),s))?n:o?a(t):"Object"==(i=a(t))&&"function"==typeof t.callee?"Arguments":i}},function(e,t,n){var i=n(6);i(i.P,"Function",{bind:n(75)})},function(e,t,n){var s=n(19),o=n(11),r=n(76),l=[].slice,c={},d=function(e,t,n){if(!(t in c)){for(var i=[],a=0;a<t;a++)i[a]="a["+a+"]";c[t]=Function("F,a","return new F("+i.join(",")+")")}return c[t](e,n)};e.exports=Function.bind||function u(t){var n=s(this),i=l.call(arguments,1),a=function(){var e=i.concat(l.call(arguments));return this instanceof a?d(n,e.length,e):r(n,e,t)};return o(n.prototype)&&(a.prototype=n.prototype),a}},function(e){e.exports=function(e,t,n){var i=n===wt;switch(t.length){case 0:return i?e():e.call(n);case 1:return i?e(t[0]):e.call(n,t[0]);case 2:return i?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return i?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return i?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var i=n(9).f,a=n(15),s=n(3),o=Function.prototype,r=/^\s*function ([^ (]*)/,l="name",c=Object.isExtensible||function(){return!0};l in o||n(4)&&i(o,l,{configurable:!0,get:function(){try{var e=this,t=(""+e).match(r)[1];return s(e,l)||!c(e)||i(e,l,a(5,t)),t}catch(n){return""}}})},function(e,t,n){var i=n(11),a=n(57),s=n(23)("hasInstance"),o=Function.prototype;s in o||n(9).f(o,s,{value:function(e){if("function"!=typeof this||!i(e))return!1;if(!i(this.prototype))return e instanceof this;for(;e=a(e);)if(this.prototype===e)return!0;return!1}})},function(e,t,n){var i=n(2),a=n(3),s=n(32),o=n(80),d=n(14),r=n(5),l=n(48).f,c=n(49).f,u=n(9).f,_=n(81).trim,h="Number",p=i[h],f=p,m=p.prototype,g=s(n(44)(m))==h,A="trim"in String.prototype,v=function(e){var t=d(e,!1);if("string"==typeof t&&2<t.length){var n,i,a,s=(t=A?t.trim():_(t,3)).charCodeAt(0);if(43===s||45===s){if(88===(n=t.charCodeAt(2))||120===n)return NaN}else if(48===s){switch(t.charCodeAt(1)){case 66:case 98:i=2,a=49;break;case 79:case 111:i=8,a=55;break;default:return+t}for(var o,r=t.slice(2),l=0,c=r.length;l<c;l++)if((o=r.charCodeAt(l))<48||a<o)return NaN;return parseInt(r,i)}}return+t};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function w(e){var t=arguments.length<1?0:e,n=this;return n instanceof p&&(g?r(function(){m.valueOf.call(n)}):s(n)!=h)?o(new f(v(t)),n,p):v(t)};for(var b,y=n(4)?l(f):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),$=0;y.length>$;$++)a(f,b=y[$])&&!a(p,b)&&u(p,b,c(f,b));(p.prototype=m).constructor=p,n(16)(i,h,p)}},function(e,t,n){var s=n(11),o=n(71).set;e.exports=function(e,t,n){var i,a=t.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&s(i)&&o&&o(e,i),e}},function(e,t,n){var o=n(6),i=n(33),r=n(5),l=n(82),a="["+l+"]",c="\u200b\x85",s=RegExp("^"+a+a+"*"),d=RegExp(a+a+"*$"),u=function(e,t,n){var i={},a=r(function(){return!!l[e]()||c[e]()!=c}),s=i[e]=a?t(_):l[e];n&&(i[n]=s),o(o.P+o.F*a,"String",i)},_=u.trim=function(e,t){return e=String(i(e)),1&t&&(e=e.replace(s,"")),2&t&&(e=e.replace(d,"")),e};e.exports=u},function(e){e.exports="\t\n\x0B\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},function(e,t,n){var i=n(6),c=(n(84),n(36)),d=n(85),u=n(86),a=1..toFixed,s=Math.floor,o=[0,0,0,0,0,0],_="Number.toFixed: incorrect invocation!",h="0",p=function(e,t){for(var n=-1,i=t;++n<6;)i+=e*o[n],o[n]=i%1e7,i=s(i/1e7)},f=function(e){for(var t=6,n=0;0<=--t;)n+=o[t],o[t]=s(n/e),n=n%e*1e7},m=function(){for(var e=6,t="";0<=--e;)if(""!==t||0===e||0!==o[e]){var n=String(o[e]);t=""===t?n:t+u.call(h,7-n.length)+n}return t},g=function(e,t,n){return 0===t?n:t%2==1?g(e,t-1,n*e):g(e*e,t/2,n)},A=function(e){for(var t=0,n=e;4096<=n;)t+=12,n/=4096;for(;2<=n;)t+=1,n/=2;return t};i(i.P+i.F*(!!a&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(5)(function(){a.call({})})),"Number",{toFixed:function v(e){var t,n,i,a,s=d(this,_),o=c(e),r="",l=h;if(o<0||20<o)throw RangeError(_);if(s!=s)return"NaN";if(s<=-1e21||1e21<=s)return String(s);if(s<0&&(r="-",s=-s),1e-21<s)if(n=(t=A(s*g(2,69,1))-69)<0?s*g(2,-t,1):s/g(2,t,1),n*=4503599627370496,0<(t=52-t)){for(p(0,n),i=o;7<=i;)p(1e7,0),i-=7;for(p(g(10,i,1),0),i=t-1;23<=i;)f(1<<23),i-=23;f(1<<i),p(1,1),f(2),l=m()}else p(0,n),p(1<<-t,0),l=m()+u.call(h,o);return l=0<o?r+((a=l.length)<=o?"0."+u.call(h,o-a)+l:l.slice(0,a-o)+"."+l.slice(a-o)):r+l}})},function(e){e.exports=function(e,t,n,i){if(!(e instanceof t)||i!==wt&&i in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var i=n(32);e.exports=function(e,t){if("number"!=typeof e&&"Number"!=i(e))throw TypeError(t);return+e}},function(e,t,n){var a=n(36),s=n(33);e.exports=function o(e){var t=String(s(this)),n="",i=a(e);if(i<0||i==Infinity)throw RangeError("Count can't be negative");for(;0<i;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n}},function(e,t,n){var i=n(6),a=n(5),s=n(85),o=1..toPrecision;i(i.P+i.F*(a(function(){return"1"!==o.call(1,wt)})||!a(function(){o.call({})})),"Number",{toPrecision:function r(e){var t=s(this,"Number#toPrecision: incorrect invocation!");return e===wt?o.call(t):o.call(t,e)}})},function(e,t,n){var i=n(6);i(i.S,"Number",{EPSILON:Math.pow(2,-52)})},function(e,t,n){var i=n(6),a=n(2).isFinite;i(i.S,"Number",{isFinite:function s(e){return"number"==typeof e&&a(e)}})},function(e,t,n){var i=n(6);i(i.S,"Number",{isInteger:n(91)})},function(e,t,n){var i=n(11),a=Math.floor;e.exports=function s(e){return!i(e)&&isFinite(e)&&a(e)===e}},function(e,t,n){var i=n(6);i(i.S,"Number",{isNaN:function a(e){return e!=e}})},function(e,t,n){var i=n(6),a=n(91),s=Math.abs;i(i.S,"Number",{isSafeInteger:function o(e){return a(e)&&s(e)<=9007199254740991}})},function(e,t,n){var i=n(6);i(i.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(e,t,n){var i=n(6);i(i.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(e,t,n){var i=n(6),a=n(97);i(i.S+i.F*(Number.parseFloat!=a),"Number",{parseFloat:a})},function(e,t,n){var i=n(2).parseFloat,a=n(81).trim;e.exports=1/i(n(82)+"-0")!=-Infinity?function s(e){var t=a(String(e),3),n=i(t);return 0===n&&"-"==t.charAt(0)?-0:n}:i},function(e,t,n){var i=n(6),a=n(99);i(i.S+i.F*(Number.parseInt!=a),"Number",{parseInt:a})},function(e,t,n){var i=n(2).parseInt,a=n(81).trim,s=n(82),o=/^[\-+]?0[xX]/;e.exports=8!==i(s+"08")||22!==i(s+"0x16")?function r(e,t){var n=a(String(e),3);return i(n,t>>>0||(o.test(n)?16:10))}:i},function(e,t,n){var i=n(6),a=n(99);i(i.G+i.F*(parseInt!=a),{parseInt:a})},function(e,t,n){var i=n(6),a=n(97);i(i.G+i.F*(parseFloat!=a),{parseFloat:a})},function(e,t,n){var i=n(6),a=n(103),s=Math.sqrt,o=Math.acosh;i(i.S+i.F*!(o&&710==Math.floor(o(Number.MAX_VALUE))&&o(Infinity)==Infinity),"Math",{acosh:function r(e){return(e=+e)<1?NaN:94906265.62425156<e?Math.log(e)+Math.LN2:a(e-1+s(e-1)*s(e+1))}})},function(e){e.exports=Math.log1p||function t(e){return-1e-8<(e=+e)&&e<1e-8?e-e*e/2:Math.log(1+e)}},function(e,t,n){function i(e){return isFinite(e=+e)&&0!=e?e<0?-i(-e):Math.log(e+Math.sqrt(e*e+1)):e}var a=n(6),s=Math.asinh;a(a.S+a.F*!(s&&0<1/s(0)),"Math",{asinh:i})},function(e,t,n){var i=n(6),a=Math.atanh;i(i.S+i.F*!(a&&1/a(-0)<0),"Math",{atanh:function s(e){return 0==(e=+e)?e:Math.log((1+e)/(1-e))/2}})},function(e,t,n){var i=n(6),a=n(107);i(i.S,"Math",{cbrt:function s(e){return a(e=+e)*Math.pow(Math.abs(e),1/3)}})},function(e){e.exports=Math.sign||function t(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t,n){var i=n(6);i(i.S,"Math",{clz32:function a(e){return(e>>>=0)?31-Math.floor(Math.log(e+.5)*Math.LOG2E):32}})},function(e,t,n){var i=n(6),a=Math.exp;i(i.S,"Math",{cosh:function s(e){return(a(e=+e)+a(-e))/2}})},function(e,t,n){var i=n(6),a=n(111);i(i.S+i.F*(a!=Math.expm1),"Math",{expm1:a})},function(e){var t=Math.expm1;e.exports=!t||22025.465794806718<t(10)||t(10)<22025.465794806718||-2e-17!=t(-2e-17)?function n(e){return 0==(e=+e)?e:-1e-6<e&&e<1e-6?e+e*e/2:Math.exp(e)-1}:t},function(e,t,n){var i=n(6),s=n(107),a=Math.pow,o=a(2,-52),r=a(2,-23),l=a(2,127)*(2-r),c=a(2,-126),d=function(e){return e+1/o-1/o};i(i.S,"Math",{fround:function u(e){var t,n,i=Math.abs(e),a=s(e);return i<c?a*d(i/c/r)*c*r:l<(n=(t=(1+r/o)*i)-(t-i))||n!=n?a*Infinity:a*n}})},function(e,t,n){var i=n(6),l=Math.abs;i(i.S,"Math",{hypot:function c(e,t){for(var n,i,a=0,s=0,o=arguments.length,r=0;s<o;)r<(n=l(arguments[s++]))?(a=a*(i=r/n)*i+1,r=n):a+=0<n?(i=n/r)*i:n;return r===Infinity?Infinity:r*Math.sqrt(a)}})},function(e,t,n){var i=n(6),a=Math.imul;i(i.S+i.F*n(5)(function(){return-5!=a(4294967295,5)||2!=a.length}),"Math",{imul:function r(e,t){var n=65535,i=+e,a=+t,s=n&i,o=n&a;return 0|s*o+((n&i>>>16)*o+s*(n&a>>>16)<<16>>>0)}})},function(e,t,n){var i=n(6);i(i.S,"Math",{log10:function a(e){return Math.log(e)/Math.LN10}})},function(e,t,n){var i=n(6);i(i.S,"Math",{log1p:n(103)})},function(e,t,n){var i=n(6);i(i.S,"Math",{log2:function a(e){return Math.log(e)/Math.LN2}})},function(e,t,n){var i=n(6);i(i.S,"Math",{sign:n(107)})},function(e,t,n){var i=n(6),a=n(111),s=Math.exp;i(i.S+i.F*n(5)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function o(e){return Math.abs(e=+e)<1?(a(e)-a(-e))/2:(s(e-1)-s(-e-1))*(Math.E/2)}})},function(e,t,n){var i=n(6),a=n(111),s=Math.exp;i(i.S,"Math",{tanh:function o(e){var t=a(e=+e),n=a(-e);return t==Infinity?1:n==Infinity?-1:(t-n)/(s(e)+s(-e))}})},function(e,t,n){var i=n(6);i(i.S,"Math",{trunc:function a(e){return(0<e?Math.floor:Math.ceil)(e)}})},function(e,t,n){var i=n(6),s=n(37),o=String.fromCharCode,a=String.fromCodePoint;i(i.S+i.F*(!!a&&1!=a.length),"String",{fromCodePoint:function r(e){for(var t,n=[],i=arguments.length,a=0;a<i;){if(t=+arguments[a++],s(t,1114111)!==t)throw RangeError(t+" is not a valid code point");n.push(t<65536?o(t):o(55296+((t-=65536)>>10),t%1024+56320))}return n.join("")}})},function(e,t,n){var i=n(6),o=n(30),r=n(35);i(i.S,"String",{raw:function l(e){for(var t=o(e.raw),n=r(t.length),i=arguments.length,a=[],s=0;s<n;)a.push(String(t[s++])),s<i&&a.push(String(arguments[s]));return a.join("")}})},function(e,t,n){n(81)("trim",function(e){return function t(){return e(this,3)}})},function(e,t,n){var i=n(6),a=n(126)(!1);i(i.P,"String",{codePointAt:function s(e){return a(this,e)}})},function(e,t,n){var l=n(36),c=n(33);e.exports=function(r){return function(e,t){var n,i,a=String(c(e)),s=l(t),o=a.length;return s<0||o<=s?r?"":wt:(n=a.charCodeAt(s))<55296||56319<n||s+1===o||(i=a.charCodeAt(s+1))<56320||57343<i?r?a.charAt(s):n:r?a.slice(s,s+2):i-56320+(n-55296<<10)+65536}}},function(e,t,n){var i=n(6),r=n(35),l=n(128),c="endsWith",d=""[c];i(i.P+i.F*n(130)(c),"String",{endsWith:function u(e,t){var n=l(this,e,c),i=1<arguments.length?t:wt,a=r(n.length),s=i===wt?a:Math.min(r(i),a),o=String(e);return d?d.call(n,o,s):n.slice(s-o.length,s)===o}})},function(e,t,n){var i=n(129),a=n(33);e.exports=function(e,t,n){if(i(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(a(e))}},function(e,t,n){var i=n(11),a=n(32),s=n(23)("match");e.exports=function(e){var t;return i(e)&&((t=e[s])!==wt?!!t:"RegExp"==a(e))}},function(e,t,n){var a=n(23)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[a]=!1,!"/./"[e](t)}catch(i){}}return!0}},function(e,t,n){var i=n(6),a=n(128),s="includes";i(i.P+i.F*n(130)(s),"String",{includes:function o(e,t){return!!~a(this,e,s).indexOf(e,1<arguments.length?t:wt)}})},function(e,t,n){var i=n(6);i(i.P,"String",{repeat:n(86)})},function(e,t,n){var i=n(6),s=n(35),o=n(128),r="startsWith",l=""[r];i(i.P+i.F*n(130)(r),"String",{startsWith:function c(e,t){var n=o(this,e,r),i=s(Math.min(1<arguments.length?t:wt,n.length)),a=String(e);return l?l.call(n,a,i):n.slice(i,i+a.length)===a}})},function(e,t,n){var i=n(126)(!0);n(135)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:wt,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){var b=n(26),y=n(6),$=n(16),w=n(8),k=n(3),C=n(136),E=n(137),T=n(22),x=n(57),I=n(23)("iterator"),D=!([].keys&&"next"in[].keys()),O="@@iterator",S="keys",R="values",B=function(){return this};e.exports=function(e,t,a,n,i,s,o){E(a,t,n);var r,l,c,d=function(e){if(!D&&e in p)return p[e];switch(e){case S:return function t(){return new a(this,e)};case R:return function n(){return new a(this,e)}}return function i(){return new a(this,e)}},u=t+" Iterator",_=i==R,h=!1,p=e.prototype,f=p[I]||p[O]||i&&p[i],m=f||d(i),g=i?_?d("entries"):m:wt,A="Array"==t&&p.entries||f;if(A&&(c=x(A.call(new e)))!==Object.prototype&&(T(c,u,!0),b||k(c,I)||w(c,I,B)),_&&f&&f.name!==R&&(h=!0,m=function v(){return f.call(this)}),b&&!o||!D&&!h&&p[I]||w(p,I,m),C[t]=m,C[u]=B,i)if(r={values:_?m:d(R),keys:s?m:d(S),entries:g},o)for(l in r)l in p||$(p,l,r[l]);else y(y.P+y.F*(D||h),t,r);return r}},function(e){e.exports={}},function(e,t,n){var i=n(44),a=n(15),s=n(22),o={};n(8)(o,n(23)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=i(o,{next:a(1,n)}),s(e,t+" Iterator")}},function(e,t,n){n(139)("anchor",function(t){return function n(e){return t(this,"a","name",e)}})},function(e,t,n){var i=n(6),a=n(5),o=n(33),r=/"/g,s=function(e,t,n,i){var a=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(i).replace(r,"&quot;")+'"'),s+">"+a+"</"+t+">"};e.exports=function(t,e){var n={};n[t]=e(s),i(i.P+i.F*a(function(){var e=""[t]('"');return e!==e.toLowerCase()||3<e.split('"').length}),"String",n)}},function(e,t,n){n(139)("big",function(e){return function t(){return e(this,"big","","")}})},function(e,t,n){n(139)("blink",function(e){return function t(){return e(this,"blink","","")}})},function(e,t,n){n(139)("bold",function(e){return function t(){return e(this,"b","","")}})},function(e,t,n){n(139)("fixed",function(e){return function t(){return e(this,"tt","","")}})},function(e,t,n){n(139)("fontcolor",function(t){return function n(e){return t(this,"font","color",e)}})},function(e,t,n){n(139)("fontsize",function(t){return function n(e){return t(this,"font","size",e)}})},function(e,t,n){n(139)("italics",function(e){return function t(){return e(this,"i","","")}})},function(e,t,n){n(139)("link",function(t){return function n(e){return t(this,"a","href",e)}})},function(e,t,n){n(139)("small",function(e){return function t(){return e(this,"small","","")}})},function(e,t,n){n(139)("strike",function(e){return function t(){return e(this,"strike","","")}})},function(e,t,n){n(139)("sub",function(e){return function t(){return e(this,"sub","","")}})},function(e,t,n){n(139)("sup",function(e){return function t(){return e(this,"sup","","")}})},function(e,t,n){var i=n(6);i(i.S,"Array",{isArray:n(43)})},function(e,t,n){var p=n(18),i=n(6),f=n(56),m=n(154),g=n(155),A=n(35),v=n(156),b=n(157);i(i.S+i.F*!n(158)(function(e){Array.from(e)}),"Array",{from:function y(e,t,n){var i,a,s,o,r=f(e),l="function"==typeof this?this:Array,c=arguments.length,d=1<c?t:wt,u=d!==wt,_=0,h=b(r);if(u&&(d=p(d,2<c?n:wt,2)),h==wt||l==Array&&g(h))for(a=new l(i=A(r.length));_<i;_++)v(a,_,u?d(r[_],_):r[_]);else for(o=h.call(r),a=new l;!(s=o.next()).done;_++)v(a,_,u?m(o,d,[s.value,_],!0):s.value);return a.length=_,a}})},function(e,t,n){var o=n(10);e.exports=function(e,t,n,i){try{return i?t(o(n)[0],n[1]):t(n)}catch(s){var a=e["return"];throw a!==wt&&o(a.call(e)),s}}},function(e,t,n){var i=n(136),a=n(23)("iterator"),s=Array.prototype;e.exports=function(e){return e!==wt&&(i.Array===e||s[a]===e)}},function(e,t,n){var i=n(9),a=n(15);e.exports=function(e,t,n){t in e?i.f(e,t,a(0,n)):e[t]=n}},function(e,t,n){var i=n(73),a=n(23)("iterator"),s=n(136);e.exports=n(7).getIteratorMethod=function(e){if(e!=wt)return e[a]||e["@@iterator"]||s[i(e)]}},function(e,t,n){var s=n(23)("iterator"),o=!1;try{var i=[7][s]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(r){}e.exports=function(e,t){if(!t&&!o)return!1;var n=!1;try{var i=[7],a=i[s]();a.next=function(){return{done:n=!0}},i[s]=function(){return a},e(i)}catch(r){}return n}},function(e,t,n){var i=n(6),a=n(156);i(i.S+i.F*n(5)(function(){function e(){}return!(Array.of.call(e)instanceof e)}),"Array",{of:function s(){for(var e=0,t=arguments.length,n=new("function"==typeof this?this:Array)(t);e<t;)a(n,e,arguments[e++]);return n.length=t,n}})},function(e,t,n){var i=n(6),a=n(30),s=[].join;i(i.P+i.F*(n(31)!=Object||!n(161)(s)),"Array",{join:function o(e){return s.call(a(this),e===wt?",":e)}})},function(e,t,n){var i=n(5);e.exports=function(e,t){return!!e&&i(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,n){var i=n(6),a=n(46),c=n(32),d=n(37),u=n(35),_=[].slice;i(i.P+i.F*n(5)(function(){a&&_.call(a)}),"Array",{slice:function h(e,t){var n=u(this.length),i=c(this);if(t=t===wt?n:t,"Array"==i)return _.call(this,e,t);for(var a=d(e,n),s=d(t,n),o=u(s-a),r=Array(o),l=0;l<o;l++)r[l]="String"==i?this.charAt(a+l):this[a+l];return r}})},function(e,t,n){var i=n(6),a=n(19),s=n(56),o=n(5),r=[].sort,l=[1,2,3];i(i.P+i.F*(o(function(){l.sort(wt)})||!o(function(){l.sort(null)})||!n(161)(r)),"Array",{sort:function c(e){return e===wt?r.call(s(this)):r.call(s(this),a(e))}})},function(e,t,n){var i=n(6),a=n(165)(0),s=n(161)([].forEach,!0);i(i.P+i.F*!s,"Array",{forEach:function o(e,t){return a(this,e,t)}})},function(e,t,n){var v=n(18),b=n(31),y=n(56),$=n(35),i=n(166);e.exports=function(u,e){var _=1==u,h=2==u,p=3==u,f=4==u,m=6==u,g=5==u||m,A=e||i;return function(e,t,n){for(var i,a,s=y(e),o=b(s),r=v(t,n,3),l=$(o.length),c=0,d=_?A(e,l):h?A(e,0):wt;c<l;c++)if((g||c in o)&&(a=r(i=o[c],c,s),u))if(_)d[c]=a;else if(a)switch(u){case 3:return!0;case 5:return i;case 6:return c;case 2:d.push(i)}else if(f)return!1;return m?-1:p||f?f:d}}},function(e,t,n){var i=n(167);e.exports=function(e,t){return new(i(e))(t)}},function(e,t,n){var i=n(11),a=n(43),s=n(23)("species");e.exports=function(e){var t;return a(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!a(t.prototype)||(t=wt),i(t)&&null===(t=t[s])&&(t=wt)),t===wt?Array:t}},function(e,t,n){var i=n(6),a=n(165)(1);i(i.P+i.F*!n(161)([].map,!0),"Array",{map:function s(e,t){return a(this,e,t)}})},function(e,t,n){var i=n(6),a=n(165)(2);i(i.P+i.F*!n(161)([].filter,!0),"Array",{filter:function s(e,t){return a(this,e,t)}})},function(e,t,n){var i=n(6),a=n(165)(3);i(i.P+i.F*!n(161)([].some,!0),"Array",{some:function s(e,t){return a(this,e,t)}})},function(e,t,n){var i=n(6),a=n(165)(4);i(i.P+i.F*!n(161)([].every,!0),"Array",{every:function s(e,t){return a(this,e,t)}})},function(e,t,n){var i=n(6),a=n(173);i(i.P+i.F*!n(161)([].reduce,!0),"Array",{reduce:function s(e,t){return a(this,e,arguments.length,t,!1)}})},function(e,t,n){var d=n(19),u=n(56),_=n(31),h=n(35);e.exports=function(e,t,n,i,a){d(t);var s=u(e),o=_(s),r=h(s.length),l=a?r-1:0,c=a?-1:1;if(n<2)for(;;){if(l in o){i=o[l],l+=c;break}if(l+=c,a?l<0:r<=l)throw TypeError("Reduce of empty array with no initial value")}for(;a?0<=l:l<r;l+=c)l in o&&(i=t(i,o[l],l,s));return i}},function(e,t,n){var i=n(6),a=n(173);i(i.P+i.F*!n(161)([].reduceRight,!0),"Array",{reduceRight:function s(e,t){return a(this,e,arguments.length,t,!0)}})},function(e,t,n){var i=n(6),a=n(34)(!1),s=[].indexOf,o=!!s&&1/[1].indexOf(1,-0)<0;i(i.P+i.F*(o||!n(161)(s)),"Array",{indexOf:function r(e,t){return o?s.apply(this,arguments)||0:a(this,e,t)}})},function(e,t,n){var i=n(6),s=n(30),o=n(36),r=n(35),l=[].lastIndexOf,c=!!l&&1/[1].lastIndexOf(1,-0)<0;i(i.P+i.F*(c||!n(161)(l)),"Array",{lastIndexOf:function d(e,t){if(c)return l.apply(this,arguments)||0;var n=s(this),i=r(n.length),a=i-1;for(1<arguments.length&&(a=Math.min(a,o(t))),a<0&&(a=i+a);0<=a;a--)if(a in n&&n[a]===e)return a||0;return-1}})},function(e,t,n){var i=n(6);i(i.P,"Array",{copyWithin:n(178)}),n(179)("copyWithin")},function(e,t,n){var d=n(56),u=n(37),_=n(35);e.exports=[].copyWithin||function h(e,t,n){var i=d(this),a=_(i.length),s=u(e,a),o=u(t,a),r=2<arguments.length?n:wt,l=Math.min((r===wt?a:u(r,a))-o,a-s),c=1;for(o<s&&s<o+l&&(c=-1,o+=l-1,s+=l-1);0<l--;)o in i?i[s]=i[o]:delete i[s],s+=c,o+=c;return i}},function(e,t,n){var i=n(23)("unscopables"),a=Array.prototype;a[i]==wt&&n(8)(a,i,{}),e.exports=function(e){a[i][e]=!0}},function(e,t,n){var i=n(6);i(i.P,"Array",{fill:n(181)}),n(179)("fill")},function(e,t,n){var c=n(56),d=n(37),u=n(35);e.exports=function _(e,t,n){for(var i=c(this),a=u(i.length),s=arguments.length,o=d(1<s?t:wt,a),r=2<s?n:wt,l=r===wt?a:d(r,a);o<l;)i[o++]=e;return i}},function(e,t,n){var i=n(6),a=n(165)(5),s="find",o=!0;s in[]&&Array(1)[s](function(){o=!1}),i(i.P+i.F*o,"Array",{find:function r(e,t){return a(this,e,1<arguments.length?t:wt)}}),n(179)(s)},function(e,t,n){var i=n(6),a=n(165)(6),s="findIndex",o=!0;s in[]&&Array(1)[s](function(){o=!1}),i(i.P+i.F*o,"Array",{findIndex:function r(e,t){return a(this,e,1<arguments.length?t:wt)}}),n(179)(s)},function(e,t,n){var i=n(179),a=n(185),s=n(136),o=n(30);e.exports=n(135)(Array,"Array",function(e,t){this._t=o(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=wt,a(1)):a(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])},"values"),s.Arguments=s.Array,i("keys"),i("values"),i("entries")},function(e){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){n(187)("Array")},function(e,t,n){var i=n(2),a=n(9),s=n(4),o=n(23)("species");e.exports=function(e){var t=i[e];s&&t&&!t[o]&&a.f(t,o,{configurable:!0,get:function(){return this}})}},function(e,t,n){var i=n(2),s=n(80),a=n(9).f,o=n(48).f,r=n(129),l=n(189),c=i.RegExp,d=c,u=c.prototype,_=/a/g,h=/a/g,p=new c(_)!==_;if(n(4)&&(!p||n(5)(function(){return h[n(23)("match")]=!1,c(_)!=_||c(h)==h||"/a/i"!=c(_,"i")}))){c=function A(e,t){var n=this instanceof c,i=r(e),a=t===wt;return!n&&i&&e.constructor===c&&a?e:s(p?new d(i&&!a?e.source:e,t):d((i=e instanceof c)?e.source:e,i&&a?l.call(e):t),n?this:u,c)};for(var f=function(t){t in c||a(c,t,{configurable:!0,get:function(){return d[t]},set:function(e){d[t]=e}})},m=o(d),g=0;m.length>g;)f(m[g++]);(u.constructor=c).prototype=u,n(16)(i,"RegExp",c)}n(187)("RegExp")},function(e,t,n){var i=n(10);e.exports=function(){var e=i(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,n){n(191);var i=n(10),a=n(189),s=n(4),o="toString",r=/./[o],l=function(e){n(16)(RegExp.prototype,o,e,!0)};n(5)(function(){return"/a/b"!=r.call({source:"a",flags:"b"})})?l(function c(){var e=i(this);return"/".concat(e.source,"/","flags"in e?e.flags:!s&&e instanceof RegExp?a.call(e):wt)}):r.name!=o&&l(function c(){return r.call(this)})},function(e,t,n){n(4)&&"g"!=/./g.flags&&n(9).f(RegExp.prototype,"flags",{configurable:!0,get:n(189)})},function(e,t,n){n(193)("match",1,function(i,a,e){return[function s(e){var t=i(this),n=e==wt?wt:e[a];return n!==wt?n.call(e,t):new RegExp(e)[a](String(t))},e]})},function(e,t,n){var r=n(8),l=n(16),c=n(5),d=n(33),u=n(23);e.exports=function(t,e,n){var i=u(t),a=n(d,i,""[t]),s=a[0],o=a[1];c(function(){var e={};return e[i]=function(){return 7},7!=""[t](e)})&&(l(String.prototype,t,s),r(RegExp.prototype,i,2==e?function(e,t){return o.call(e,this,t)}:function(e){return o.call(e,this)}))}},function(e,t,n){n(193)("replace",2,function(a,s,o){return[function r(e,t){var n=a(this),i=e==wt?wt:e[s];return i!==wt?i.call(e,n,t):o.call(String(n),e,t)},o]})},function(e,t,n){n(193)("search",1,function(i,a,e){return[function s(e){var t=i(this),n=e==wt?wt:e[a];return n!==wt?n.call(e,t):new RegExp(e)[a](String(t))},e]})},function(e,t,n){n(193)("split",2,function(a,s,o){var h=n(129),p=o,f=[].push,e="split",m="length",g="lastIndex";if("c"=="abbc"[e](/(b)*/)[1]||4!="test"[e](/(?:)/,-1)[m]||2!="ab"[e](/(?:ab)*/)[m]||4!="."[e](/(.?)(.?)/)[m]||1<"."[e](/()()/)[m]||""[e](/.?/)[m]){var A=/()??/.exec("")[1]===wt;o=function(e,t){var n=String(this);if(e===wt&&0===t)return[];if(!h(e))return p.call(n,e,t);var i,a,s,o,r,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),d=0,u=t===wt?4294967295:t>>>0,_=new RegExp(e.source,c+"g");for(A||(i=new RegExp("^"+_.source+"$(?!\\s)",c));(a=_.exec(n))&&!(d<(s=a.index+a[0][m])&&(l.push(n.slice(d,a.index)),!A&&1<a[m]&&a[0].replace(i,function(){for(r=1;r<arguments[m]-2;r++)arguments[r]===wt&&(a[r]=wt)}),1<a[m]&&a.index<n[m]&&f.apply(l,a.slice(1)),o=a[0][m],d=s,l[m]>=u));)_[g]===a.index&&_[g]++;return d===n[m]?!o&&_.test("")||l.push(""):l.push(n.slice(d)),l[m]>u?l.slice(0,u):l}}else"0"[e](wt,0)[m]&&(o=function(e,t){return e===wt&&0===t?[]:p.call(this,e,t)});return[function r(e,t){var n=a(this),i=e==wt?wt:e[s];return i!==wt?i.call(e,n,t):o.call(String(n),e,t)},o]})},function(e,t,i){var n,a,s,o=i(26),r=i(2),l=i(18),c=i(73),d=i(6),u=i(11),_=(i(10),i(19)),h=i(84),p=i(198),f=(i(71).set,i(199)),m=i(200).set,g=i(201)(),A="Promise",v=r.TypeError,b=r.process,y=r[A],$="process"==c(b=r.process),w=function(){},k=!!function(){try{var e=y.resolve(1),t=(e.constructor={})[i(23)("species")]=function(e){e(w,w)};return($||"function"==typeof PromiseRejectionEvent)&&e.then(w)instanceof t}catch(n){}}(),C=function(e,t){return e===t||e===y&&t===s},E=function(e){var t;return!(!u(e)||"function"!=typeof(t=e.then))&&t},T=function(e){return C(y,e)?new x(e):new a(e)},x=a=function(e){var n,i;this.promise=new e(function(e,t){if(n!==wt||i!==wt)throw v("Bad Promise constructor");n=e,i=t}),this.resolve=_(n),this.reject=_(i)},I=function(e){try{e()}catch(t){return{error:t}}},D=function(d,n){if(!d._n){d._n=!0;var i=d._c;g(function(){for(var l=d._v,c=1==d._s,e=0,t=function(e){var t,n,i=c?e.ok:e.fail,a=e.resolve,s=e.reject,o=e.domain;try{i?(c||(2==d._h&&R(d),d._h=1),!0===i?t=l:(o&&o.enter(),t=i(l),o&&o.exit()),t===e.promise?s(v("Promise-chain cycle")):(n=E(t))?n.call(t,a,s):a(t)):s(l)}catch(r){s(r)}};i.length>e;)t(i[e++]);d._c=[],d._n=!1,
n&&!d._h&&O(d)})}},O=function(a){m.call(r,function(){var e,t,n,i=a._v;if(S(a)&&(e=I(function(){$?b.emit("unhandledRejection",i,a):(t=r.onunhandledrejection)?t({promise:a,reason:i}):(n=r.console)&&n.error&&n.error("Unhandled promise rejection",i)}),a._h=$||S(a)?2:1),a._a=wt,e)throw e.error})},S=function(e){if(1==e._h)return!1;for(var t,n=e._a||e._c,i=0;n.length>i;)if((t=n[i++]).fail||!S(t.promise))return!1;return!0},R=function(t){m.call(r,function(){var e;$?b.emit("rejectionHandled",t):(e=r.onrejectionhandled)&&e({promise:t,reason:t._v})})},B=function(e){var t=this;t._d||(t._d=!0,(t=t._w||t)._v=e,t._s=2,t._a||(t._a=t._c.slice()),D(t,!0))},N=function(n){var i,a=this;if(!a._d){a._d=!0,a=a._w||a;try{if(a===n)throw v("Promise can't be resolved itself");(i=E(n))?g(function(){var e={_w:a,_d:!1};try{i.call(n,l(N,e,1),l(B,e,1))}catch(t){B.call(e,t)}}):(a._v=n,a._s=1,D(a,!1))}catch(e){B.call({_w:a,_d:!1},e)}}};k||(y=function F(e){h(this,y,A,"_h"),_(e),n.call(this);try{e(l(N,this,1),l(B,this,1))}catch(t){B.call(this,t)}},(n=function K(){this._c=[],this._a=wt,this._s=0,this._d=!1,this._v=wt,this._h=0,this._n=!1}).prototype=i(202)(y.prototype,{then:function M(e,t){var n=T(f(this,y));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=$?b.domain:wt,this._c.push(n),this._a&&this._a.push(n),this._s&&D(this,!1),n.promise},"catch":function(e){return this.then(wt,e)}}),x=function(){var e=new n;this.promise=e,this.resolve=l(N,e,1),this.reject=l(B,e,1)}),d(d.G+d.W+d.F*!k,{Promise:y}),i(22)(y,A),i(187)(A),s=i(7)[A],d(d.S+d.F*!k,A,{reject:function j(e){var t=T(this);return(0,t.reject)(e),t.promise}}),d(d.S+d.F*(o||!k),A,{resolve:function L(e){if(e instanceof y&&C(e.constructor,this))return e;var t=T(this);return(0,t.resolve)(e),t.promise}}),d(d.S+d.F*!(k&&i(158)(function(e){y.all(e)["catch"](w)})),A,{all:function P(e){var o=this,t=T(o),r=t.resolve,l=t.reject,n=I(function(){var i=[],a=0,s=1;p(e,!1,function(e){var t=a++,n=!1;i.push(wt),s++,o.resolve(e).then(function(e){n||(n=!0,i[t]=e,--s||r(i))},l)}),--s||r(i)});return n&&l(n.error),t.promise},race:function U(e){var t=this,n=T(t),i=n.reject,a=I(function(){p(e,!1,function(e){t.resolve(e).then(n.resolve,i)})});return a&&i(a.error),n.promise}})},function(e,t,n){var _=n(18),h=n(154),p=n(155),f=n(10),m=n(35),g=n(157),A={},v={};(t=e.exports=function(e,t,n,i,a){var s,o,r,l,c=a?function(){return e}:g(e),d=_(n,i,t?2:1),u=0;if("function"!=typeof c)throw TypeError(e+" is not iterable!");if(p(c)){for(s=m(e.length);u<s;u++)if((l=t?d(f(o=e[u])[0],o[1]):d(e[u]))===A||l===v)return l}else for(r=c.call(e);!(o=r.next()).done;)if((l=h(r,d,o.value,t))===A||l===v)return l}).BREAK=A,t.RETURN=v},function(e,t,n){var a=n(10),s=n(19),o=n(23)("species");e.exports=function(e,t){var n,i=a(e).constructor;return i===wt||(n=a(i)[o])==wt?t:s(n)}},function(e,t,n){var i,a,s,o=n(18),r=n(76),l=n(46),c=n(13),d=n(2),u=d.process,_=d.setImmediate,h=d.clearImmediate,p=d.MessageChannel,f=0,m={},g="onreadystatechange",A=function(){var e=+this;if(m.hasOwnProperty(e)){var t=m[e];delete m[e],t()}},v=function(e){A.call(e.data)};_&&h||(_=function b(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return m[++f]=function(){r("function"==typeof e?e:Function(e),t)},i(f),f},h=function y(e){delete m[e]},"process"==n(32)(u)?i=function(e){u.nextTick(o(A,e,1))}:p?(s=(a=new p).port2,a.port1.onmessage=v,i=o(s.postMessage,s,1)):d.addEventListener&&"function"==typeof postMessage&&!d.importScripts?(i=function(e){d.postMessage(e+"","*")},d.addEventListener("message",v,!1)):i=g in c("script")?function(e){l.appendChild(c("script"))[g]=function(){l.removeChild(this),A.call(e)}}:function(e){setTimeout(o(A,e,1),0)}),e.exports={set:_,clear:h}},function(e,t,n){var r=n(2),l=n(200).set,c=r.MutationObserver||r.WebKitMutationObserver,d=r.process,u=r.Promise,_="process"==n(32)(d);e.exports=function(){var i,a,s,e=function(){var e,t;for(_&&(e=d.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(n){throw i?s():a=wt,n}}a=wt,e&&e.enter()};if(_)s=function(){d.nextTick(e)};else if(c){var t=!0,n=document.createTextNode("");new c(e).observe(n,{characterData:!0}),s=function(){n.data=t=!t}}else if(u&&u.resolve){var o=u.resolve();s=function(){o.then(e)}}else s=function(){l.call(r,e)};return function(e){var t={fn:e,next:wt};a&&(a.next=t),i||(i=t,s()),a=t}}},function(e,t,n){var a=n(16);e.exports=function(e,t,n){for(var i in t)a(e,i,t[i],n);return e}},function(e,t,n){var i=n(204);e.exports=n(205)("Map",function(t){return function n(e){return t(this,0<arguments.length?e:wt)}},{get:function a(e){var t=i.getEntry(this,e);return t&&t.v},set:function s(e,t){return i.def(this,0===e?0:e,t)}},i,!0)},function(e,t,n){var l=n(9).f,c=n(44),d=(n(8),n(202)),u=n(18),_=n(84),h=n(33),p=n(198),i=n(135),a=n(185),s=n(187),f=n(4),o=n(20).fastKey,m=f?"_s":"size",g=function(e,t){var n,i=o(t);if("F"!==i)return e._i[i];for(n=e._f;n;n=n.n)if(n.k==t)return n};e.exports={getConstructor:function(e,n,i,a){var s=e(function(e,t){_(e,s,n,"_i"),e._i=c(null),e._f=wt,e._l=wt,e[m]=0,t!=wt&&p(t,i,e[a],e)});return d(s.prototype,{clear:function o(){for(var e=this,t=e._i,n=e._f;n;n=n.n)n.r=!0,n.p&&(n.p=n.p.n=wt),delete t[n.i];e._f=e._l=wt,e[m]=0},"delete":function(e){var t=this,n=g(t,e);if(n){var i=n.n,a=n.p;delete t._i[n.i],n.r=!0,a&&(a.n=i),i&&(i.p=a),t._f==n&&(t._f=i),t._l==n&&(t._l=a),t[m]--}return!!n},forEach:function r(e,t){_(this,s,"forEach");for(var n,i=u(e,1<arguments.length?t:wt,3);n=n?n.n:this._f;)for(i(n.v,n.k,this);n&&n.r;)n=n.p},has:function t(e){return!!g(this,e)}}),f&&l(s.prototype,"size",{get:function(){return h(this[m])}}),s},def:function(e,t,n){var i,a,s=g(e,t);return s?s.v=n:(e._l=s={i:a=o(t,!0),k:t,v:n,p:i=e._l,n:wt,r:!1},e._f||(e._f=s),i&&(i.n=s),e[m]++,"F"!==a&&(e._i[a]=s)),e},getEntry:g,setStrong:function(e,t,n){i(e,t,function(e,t){this._t=e,this._k=t,this._l=wt},function(){for(var e=this,t=e._k,n=e._l;n&&n.r;)n=n.p;return e._t&&(e._l=n=n?n.n:e._t._f)?a(0,"keys"==t?n.k:"values"==t?n.v:[n.k,n.v]):(e._t=wt,a(1))},n?"entries":"values",!n,!0),s(t)}}},function(e,t,n){var g=n(2),A=n(6),v=n(16),b=n(202),y=n(20),$=n(198),w=n(84),k=n(11),C=n(5),E=n(158),T=n(22),x=n(80);e.exports=function(i,e,t,n,a,o){var s=g[i],r=s,l=a?"set":"add",c=r&&r.prototype,d={},u=function(e){var n=c[e];v(c,e,"delete"==e?function(e){return!(o&&!k(e))&&n.call(this,0===e?0:e)}:"has"==e?function t(e){return!(o&&!k(e))&&n.call(this,0===e?0:e)}:"get"==e?function i(e){return o&&!k(e)?wt:n.call(this,0===e?0:e)}:"add"==e?function a(e){return n.call(this,0===e?0:e),this}:function s(e,t){return n.call(this,0===e?0:e,t),this})};if("function"==typeof r&&(o||c.forEach&&!C(function(){(new r).entries().next()}))){var _=new r,h=_[l](o?{}:-0,1)!=_,p=C(function(){_.has(1)}),f=E(function(e){new r(e)}),m=!o&&C(function(){for(var e=new r,t=5;t--;)e[l](t,t);return!e.has(-0)});f||(((r=e(function(e,t){w(e,r,i);var n=x(new s,e,r);return t!=wt&&$(t,a,n[l],n),n})).prototype=c).constructor=r),(p||m)&&(u("delete"),u("has"),a&&u("get")),(m||h)&&u(l),o&&c.clear&&delete c.clear}else r=n.getConstructor(e,i,a,l),b(r.prototype,t),y.NEED=!0;return T(r,i),d[i]=r,A(A.G+A.W+A.F*(r!=s),d),o||n.setStrong(r,i,a),r}},function(e,t,n){var i=n(204);e.exports=n(205)("Set",function(t){return function n(e){return t(this,0<arguments.length?e:wt)}},{add:function a(e){return i.def(this,e=0===e?0:e,e)}},i)},function(e,t,n){var s,i=n(165)(0),o=n(16),a=n(20),r=n(67),l=n(208),c=n(11),d=(n(3),a.getWeak),u=Object.isExtensible,_=l.ufstore,h={},p=function(t){return function n(e){return t(this,0<arguments.length?e:wt)}},f={get:function g(e){if(c(e)){var t=d(e);return!0===t?_(this).get(e):t?t[this._i]:wt}},set:function A(e,t){return l.def(this,e,t)}},m=e.exports=n(205)("WeakMap",p,f,l,!0,!0);7!=(new m).set((Object.freeze||Object)(h),7).get(h)&&(r((s=l.getConstructor(p)).prototype,f),a.NEED=!0,i(["delete","has","get","set"],function(i){var e=m.prototype,a=e[i];o(e,i,function(e,t){if(!c(e)||u(e))return a.call(this,e,t);this._f||(this._f=new s);var n=this._f[i](e,t);return"set"==i?this:n})}))},function(e,t,n){var r=n(202),l=n(20).getWeak,a=n(10),c=n(11),d=n(84),u=n(198),i=n(165),_=n(3),s=i(5),o=i(6),h=0,p=function(e){return e._l||(e._l=new f)},f=function(){this.a=[]},m=function(e,t){return s(e.a,function(e){return e[0]===t})};f.prototype={get:function(e){var t=m(this,e);if(t)return t[1]},has:function(e){return!!m(this,e)},set:function(e,t){var n=m(this,e);n?n[1]=t:this.a.push([e,t])},"delete":function(t){var e=o(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},e.exports={getConstructor:function(e,n,i,a){var s=e(function(e,t){d(e,s,n,"_i"),e._i=h++,t!=(e._l=wt)&&u(t,i,e[a],e)});return r(s.prototype,{"delete":function(e){if(!c(e))return!1;var t=l(e);return!0===t?p(this)["delete"](e):t&&_(t,this._i)&&delete t[this._i]},has:function o(e){if(!c(e))return!1;var t=l(e);return!0===t?p(this).has(e):t&&_(t,this._i)}}),s},def:function(e,t,n){var i=l(a(t),!0);return!0===i?p(e).set(t,n):i[e._i]=n,e},ufstore:p}},function(e,t,n){var i=n(208);n(205)("WeakSet",function(t){return function n(e){return t(this,0<arguments.length?e:wt)}},{add:function a(e){return i.def(this,e,!0)}},i,!1,!0)},function(e,t,n){var i=n(6),a=n(19),s=n(10),o=Function.apply;i(i.S,"Reflect",{apply:function r(e,t,n){return o.call(a(e),t,s(n))}})},function(e,t,n){var i=n(6),l=n(44),c=n(19),d=n(10),u=n(11),_=n(75);i(i.S+i.F*n(5)(function(){function e(){}return!(Reflect.construct(function(){},[],e)instanceof e)}),"Reflect",{construct:function h(e,t,n){c(e),d(t);var i=arguments.length<3?e:c(n);if(e==i){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var a=[null];return a.push.apply(a,t),new(_.apply(e,a))}var s=i.prototype,o=l(u(s)?s:Object.prototype),r=Function.apply.call(e,o,t);return u(r)?r:o}})},function(e,t,n){var a=n(9),i=n(6),s=n(10),o=n(14);i(i.S+i.F*n(5)(function(){Reflect.defineProperty(a.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function r(e,t,n){s(e),t=o(t,!0),s(n);try{return a.f(e,t,n),!0}catch(i){return!1}}})},function(e,t,n){var i=n(6),a=n(49).f,s=n(10);i(i.S,"Reflect",{deleteProperty:function o(e,t){var n=a(s(e),t);return!(n&&!n.configurable)&&delete e[t]}})},function(e,t,n){var i=n(6),a=n(10),s=function(e){this._t=a(e),this._i=0;var t,n=this._k=[];for(t in e)n.push(t)};n(137)(s,"Object",function(){var e,t=this,n=t._k;do{if(t._i>=n.length)return{value:wt,done:!0}}while(!((e=n[t._i++])in t._t));return{value:e,done:!1}}),i(i.S,"Reflect",{enumerate:function o(e){return new s(e)}})},function(e,t,n){function o(e,t,n){var i,a,s=arguments.length<3?e:n;return u(e)===s?e[t]:(i=r.f(e,t))?c(i,"value")?i.value:i.get!==wt?i.get.call(s):wt:d(a=l(e))?o(a,t,s):void 0}var r=n(49),l=n(57),c=n(3),i=n(6),d=n(11),u=n(10);i(i.S,"Reflect",{get:o})},function(e,t,n){var i=n(49),a=n(6),s=n(10);a(a.S,"Reflect",{getOwnPropertyDescriptor:function o(e,t){return i.f(s(e),t)}})},function(e,t,n){var i=n(6),a=n(57),s=n(10);i(i.S,"Reflect",{getPrototypeOf:function o(e){return a(s(e))}})},function(e,t,n){var i=n(6);i(i.S,"Reflect",{has:function a(e,t){return t in e}})},function(e,t,n){var i=n(6),a=n(10),s=Object.isExtensible;i(i.S,"Reflect",{isExtensible:function o(e){return a(e),!s||s(e)}})},function(e,t,n){var i=n(6);i(i.S,"Reflect",{ownKeys:n(221)})},function(e,t,n){var i=n(48),a=n(41),s=n(10),o=n(2).Reflect;e.exports=o&&o.ownKeys||function r(e){var t=i.f(s(e)),n=a.f;return n?t.concat(n(e)):t}},function(e,t,n){var i=n(6),a=n(10),s=Object.preventExtensions;i(i.S,"Reflect",{preventExtensions:function o(e){a(e);try{return s&&s(e),!0}catch(t){return!1}}})},function(e,t,n){function l(e,t,n,i){var a,s,o=arguments.length<4?e:i,r=d.f(p(e),t);if(!r){if(f(s=u(e)))return l(s,t,n,o);r=h(0)}return _(r,"value")?!(!1===r.writable||!f(o))&&((a=d.f(o,t)||h(0)).value=n,c.f(o,t,a),!0):r.set!==wt&&(r.set.call(o,n),!0)}var c=n(9),d=n(49),u=n(57),_=n(3),i=n(6),h=n(15),p=n(10),f=n(11);i(i.S,"Reflect",{set:l})},function(e,t,n){var i=n(6),a=n(71);a&&i(i.S,"Reflect",{setPrototypeOf:function s(e,t){a.check(e,t);try{return a.set(e,t),!0}catch(n){return!1}}})},function(e,t,n){var i=n(6);i(i.S,"Date",{now:function(){return(new Date).getTime()}})},function(e,t,n){var i=n(6),a=n(56),s=n(14);i(i.P+i.F*n(5)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function o(){var e=a(this),t=s(e);return"number"!=typeof t||isFinite(t)?e.toISOString():null}})},function(e,t,n){var i=n(6),a=n(5),s=Date.prototype.getTime,o=function(e){return 9<e?e:"0"+e};i(i.P+i.F*(a(function(){return"0385-07-25T07:06:39.999Z"!=new Date(-5e13-1).toISOString()})||!a(function(){new Date(NaN).toISOString()})),"Date",{toISOString:function r(){if(!isFinite(s.call(this)))throw RangeError("Invalid time value");var e=this,t=e.getUTCFullYear(),n=e.getUTCMilliseconds(),i=t<0?"-":9999<t?"+":"";return i+("00000"+Math.abs(t)).slice(i?-6:-4)+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())+"."+(99<n?n:"0"+o(n))+"Z"}})},function(e,t,n){var i=Date.prototype,a="Invalid Date",s="toString",o=i[s],r=i.getTime;new Date(NaN)+""!=a&&n(16)(i,s,function l(){var e=r.call(this);return e==e?o.call(this):a})},function(e,t,n){var i=n(23)("toPrimitive"),a=Date.prototype;i in a||n(8)(a,i,n(230))},function(e,t,n){var i=n(10),a=n(14),s="number";e.exports=function(e){if("string"!==e&&e!==s&&"default"!==e)throw TypeError("Incorrect hint");return a(i(this),e!=s)}},function(e,t,n){var i=n(6),a=n(232),s=n(233),c=n(10),d=n(37),u=n(35),o=n(11),r=(n(23)("typed_array"),n(2).ArrayBuffer),_=n(199),h=s.ArrayBuffer,p=s.DataView,l=a.ABV&&r.isView,f=h.prototype.slice,m=a.VIEW,g="ArrayBuffer";i(i.G+i.W+i.F*(r!==h),{ArrayBuffer:h}),i(i.S+i.F*!a.CONSTR,g,{isView:function A(e){return l&&l(e)||o(e)&&m in e}}),i(i.P+i.U+i.F*n(5)(function(){return!new h(2).slice(1,wt).byteLength}),g,{slice:function v(e,t){if(f!==wt&&t===wt)return f.call(c(this),e);for(var n=c(this).byteLength,i=d(e,n),a=d(t===wt?n:t,n),s=new(_(this,h))(u(a-i)),o=new p(this),r=new p(s),l=0;i<a;)r.setUint8(l++,o.getUint8(i++));return s}}),n(187)(g)},function(e,t,n){for(var i,a=n(2),s=n(8),o=n(17),r=o("typed_array"),l=o("view"),c=!(!a.ArrayBuffer||!a.DataView),d=c,u=0,_=9,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<_;)(i=a[h[u++]])?(s(i.prototype,r,!0),s(i.prototype,l,!0)):d=!1;e.exports={ABV:c,CONSTR:d,TYPED:r,VIEW:l}},function(e,t,n){var i=n(2),a=n(4),s=n(26),o=n(232),r=n(8),l=n(202),c=n(5),d=n(84),_=n(36),u=n(35),h=n(48).f,p=n(9).f,f=n(181),m=n(22),g="ArrayBuffer",A="DataView",v="prototype",b="Wrong length!",y="Wrong index!",$=i[g],w=i[A],k=i.Math,C=(i.parseInt,i.RangeError),E=i.Infinity,T=$,x=k.abs,I=k.pow,D=(k.min,k.floor),O=k.log,S=k.LN2,R="buffer",B="byteLength",N="byteOffset",F=a?"_b":R,K=a?"_l":B,M=a?"_o":N,j=function(e,t,n){var i,a,s,o=Array(n),r=8*n-t-1,l=(1<<r)-1,c=l>>1,d=23===t?I(2,-24)-I(2,-77):0,u=0,_=e<0||0===e&&1/e<0?1:0;for((e=x(e))!=e||e===E?(a=e!=e?1:0,i=l):(i=D(O(e)/S),e*(s=I(2,-i))<1&&(i--,s*=2),2<=(e+=1<=i+c?d/s:d*I(2,1-c))*s&&(i++,s/=2),l<=i+c?(a=0,i=l):1<=i+c?(a=(e*s-1)*I(2,t),i+=c):(a=e*I(2,c-1)*I(2,t),i=0));8<=t;o[u++]=255&a,a/=256,t-=8);for(i=i<<t|a,r+=t;0<r;o[u++]=255&i,i/=256,r-=8);return o[--u]|=128*_,o},L=function(e,t,n){var i,a=8*n-t-1,s=(1<<a)-1,o=s>>1,r=a-7,l=n-1,c=e[l--],d=127&c;for(c>>=7;0<r;d=256*d+e[l],l--,r-=8);for(i=d&(1<<-r)-1,d>>=-r,r+=t;0<r;i=256*i+e[l],l--,r-=8);if(0===d)d=1-o;else{if(d===s)return i?NaN:c?-E:E;i+=I(2,t),d-=o}return(c?-1:1)*i*I(2,d-t)},P=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},U=function(e){return[255&e]},H=function(e){return[255&e,e>>8&255]},Q=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},z=function(e){return j(e,52,8)},q=function(e){return j(e,23,4)},W=function(e,t,n){p(e[v],t,{get:function(){return this[n]}})},Y=function(e,t,n,i){var a=+n,s=_(a);if(a!=s||s<0||s+t>e[K])throw C(y);var o=e[F]._b,r=s+e[M],l=o.slice(r,r+t);return i?l:l.reverse()},V=function(e,t,n,i,a,s){var o=+n,r=_(o);if(o!=r||r<0||r+t>e[K])throw C(y);for(var l=e[F]._b,c=r+e[M],d=i(+a),u=0;u<t;u++)l[c+u]=d[s?u:t-u-1]},G=function(e,t){d(e,$,g);var n=+t,i=u(n);if(n!=i)throw C(b);return i};if(o.ABV){if(!c(function(){new $})||!c(function(){new $(.5)})){for(var X,J=($=function ie(e){return new T(G(this,e))})[v]=T[v],Z=h(T),ee=0;Z.length>ee;)(X=Z[ee++])in $||r($,X,T[X]);s||(J.constructor=$)}var te=new w(new $(2)),ne=w[v].setInt8;te.setInt8(0,2147483648),te.setInt8(1,2147483649),!te.getInt8(0)&&te.getInt8(1)||l(w[v],{setInt8:function ae(e,t){ne.call(this,e,t<<24>>24)},setUint8:function se(e,t){ne.call(this,e,t<<24>>24)}},!0)}else $=function oe(e){var t=G(this,e);this._b=f.call(Array(t),0),this[K]=t},w=function re(e,t,n){d(this,w,A),d(e,$,A);var i=e[K],a=_(t);if(a<0||i<a)throw C("Wrong offset!");if(i<a+(n=n===wt?i-a:u(n)))throw C(b);this[F]=e,this[M]=a,this[K]=n},a&&(W($,B,"_l"),W(w,R,"_b"),W(w,B,"_l"),W(w,N,"_o")),l(w[v],{getInt8:function le(e){return Y(this,1,e)[0]<<24>>24},getUint8:function ce(e){return Y(this,1,e)[0]},getInt16:function de(e,t){var n=Y(this,2,e,t);return(n[1]<<8|n[0])<<16>>16},getUint16:function ue(e,t){var n=Y(this,2,e,t);return n[1]<<8|n[0]},getInt32:function _e(e,t){return P(Y(this,4,e,t))},getUint32:function he(e,t){return P(Y(this,4,e,t))>>>0},getFloat32:function pe(e,t){return L(Y(this,4,e,t),23,4)},getFloat64:function fe(e,t){return L(Y(this,8,e,t),52,8)},setInt8:function ae(e,t){V(this,1,e,U,t)},setUint8:function se(e,t){V(this,1,e,U,t)},setInt16:function me(e,t,n){V(this,2,e,H,t,n)},setUint16:function ge(e,t,n){V(this,2,e,H,t,n)},setInt32:function Ae(e,t,n){V(this,4,e,Q,t,n)},setUint32:function ve(e,t,n){V(this,4,e,Q,t,n)},setFloat32:function be(e,t,n){V(this,4,e,q,t,n)},setFloat64:function ye(e,t,n){V(this,8,e,z,t,n)}});m($,g),m(w,A),r(w[v],o.VIEW,!0),t[g]=$,t[A]=w},function(e,t,n){var i=n(6);i(i.G+i.W+i.F*!n(232).ABV,{DataView:n(233).DataView})},function(e,t,n){n(236)("Int8",1,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){if(n(4)){var b=n(26),y=n(2),$=n(5),w=n(6),k=n(232),i=n(233),p=n(18),C=n(84),a=n(15),E=n(8),s=n(202),o=(n(91),n(36)),T=n(35),r=n(37),l=n(14),c=n(3),d=n(69),x=n(73),I=n(11),f=n(56),m=n(155),D=n(44),O=n(57),S=n(48).f,g=(n(237),n(157)),u=n(17),_=n(23),h=n(165),A=n(34),v=n(199),R=n(184),B=n(136),N=n(158),F=n(187),K=n(181),M=n(178),j=n(9),L=n(49),P=j.f,U=L.f,H=y.RangeError,Q=y.TypeError,z=y.Uint8Array,q="ArrayBuffer",W="Shared"+q,Y="BYTES_PER_ELEMENT",V="prototype",G=Array[V],X=i.ArrayBuffer,J=i.DataView,Z=h(0),ee=h(2),te=h(3),ne=h(4),ie=h(5),ae=h(6),se=A(!0),oe=A(!1),re=R.values,le=R.keys,ce=R.entries,de=G.lastIndexOf,ue=G.reduce,_e=G.reduceRight,he=G.join,pe=G.sort,fe=G.slice,me=G.toString,ge=G.toLocaleString,Ae=_("iterator"),ve=_("toStringTag"),be=u("typed_constructor"),ye=u("def_constructor"),$e=k.CONSTR,we=k.TYPED,ke=k.VIEW,Ce="Wrong length!",Ee=h(1,function(e,t){return Se(v(e,e[ye]),t)}),Te=$(function(){return 1===new z(new Uint16Array([1]).buffer)[0]}),xe=!!z&&!!z[V].set&&$(function(){new z(1).set({})}),Ie=function(e,t){if(e===wt)throw Q(Ce);var n=+e,i=T(e);if(t&&!d(n,i))throw H(Ce);return i},De=function(e,t){var n=o(e);if(n<0||n%t)throw H("Wrong offset!");return n},Oe=function(e){if(I(e)&&we in e)return e;throw Q(e+" is not a typed array!")},Se=function(e,t){if(!(I(e)&&be in e))throw Q("It is not a typed array constructor!");return new e(t)},Re=function(e,t){return Be(v(e,e[ye]),t)},Be=function(e,t){for(var n=0,i=t.length,a=Se(e,i);n<i;)a[n]=t[n++];return a},Ne=function(e,t,n){P(e,t,{get:function(){return this._d[n]}})},Fe=function Ye(e,t,n){var i,a,s,o,r,l,c=f(e),d=arguments.length,u=1<d?t:wt,_=u!==wt,h=g(c);if(h!=wt&&!m(h)){for(l=h.call(c),s=[],i=0;!(r=l.next()).done;i++)s.push(r.value);c=s}for(_&&2<d&&(u=p(u,n,2)),i=0,a=T(c.length),o=Se(this,a);i<a;i++)o[i]=_?u(c[i],i):c[i];return o},Ke=function Ve(){for(var e=0,t=arguments.length,n=Se(this,t);e<t;)n[e]=arguments[e++];return n},Me=!!z&&$(function(){ge.call(new z(1))}),je=function Ge(){return ge.apply(Me?fe.call(Oe(this)):Oe(this),arguments)},Le={copyWithin:function Xe(e,t,n){return M.call(Oe(this),e,t,2<arguments.length?n:wt)},every:function Je(e,t){return ne(Oe(this),e,1<arguments.length?t:wt)},fill:function Ze(){return K.apply(Oe(this),arguments)},filter:function et(e,t){return Re(this,ee(Oe(this),e,1<arguments.length?t:wt))},find:function tt(e,t){return ie(Oe(this),e,1<arguments.length?t:wt)},findIndex:function nt(e,t){return ae(Oe(this),e,1<arguments.length?t:wt)},forEach:function it(e,t){Z(Oe(this),e,1<arguments.length?t:wt)},indexOf:function at(e,t){return oe(Oe(this),e,1<arguments.length?t:wt)},includes:function st(e,t){return se(Oe(this),e,1<arguments.length?t:wt)},join:function ot(){return he.apply(Oe(this),arguments)},lastIndexOf:function rt(){return de.apply(Oe(this),arguments)},map:function lt(e,t){return Ee(Oe(this),e,1<arguments.length?t:wt)},reduce:function ct(){return ue.apply(Oe(this),arguments)},reduceRight:function dt(){return _e.apply(Oe(this),arguments)},reverse:function ut(){for(var e,t=this,n=Oe(t).length,i=Math.floor(n/2),a=0;a<i;)e=t[a],t[a++]=t[--n],t[n]=e;return t},some:function _t(e,t){return te(Oe(this),e,1<arguments.length?t:wt)},sort:function ht(e){return pe.call(Oe(this),e)},subarray:function pt(e,t){var n=Oe(this),i=n.length,a=r(e,i);return new(v(n,n[ye]))(n.buffer,n.byteOffset+a*n.BYTES_PER_ELEMENT,T((t===wt?i:r(t,i))-a))}},Pe=function ft(e,t){return Re(this,fe.call(Oe(this),e,t))},Ue=function mt(e,t){Oe(this);var n=De(t,1),i=this.length,a=f(e),s=T(a.length),o=0;if(i<s+n)throw H(Ce);for(;o<s;)this[n+o]=a[o++]},He={entries:function gt(){return ce.call(Oe(this))},keys:function At(){return le.call(Oe(this))},values:function vt(){return re.call(Oe(this))}},Qe=function(e,t){return I(e)&&e[we]&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},ze=function bt(e,t){return Qe(e,t=l(t,!0))?a(2,e[t]):U(e,t)},qe=function yt(e,t,n){return!(Qe(e,t=l(t,!0))&&I(n)&&c(n,"value"))||c(n,"get")||c(n,"set")||n.configurable||c(n,"writable")&&!n.writable||c(n,"enumerable")&&!n.enumerable?P(e,t,n):(e[t]=n.value,e)};$e||(L.f=ze,j.f=qe),w(w.S+w.F*!$e,"Object",{getOwnPropertyDescriptor:ze,defineProperty:qe}),$(function(){me.call({})})&&(me=ge=function $t(){return he.call(this)});var We=s({},Le);s(We,He),E(We,Ae,He.values),s(We,{slice:Pe,set:Ue,constructor:function(){},toString:me,toLocaleString:je}),Ne(We,"buffer","b"),Ne(We,"byteOffset","o"),Ne(We,"byteLength","l"),Ne(We,"length","e"),P(We,ve,{get:function(){return this[we]}}),e.exports=function(e,u,t,a){var _=e+((a=!!a)?"Clamped":"")+"Array",s="Uint8Array"!=_,i="get"+e,o="set"+e,h=y[_],r=h||{},n=h&&O(h),l=!h||!k.ABV,c={},d=h&&h[V],p=function(e,t){var n=e._d;return n.v[i](t*u+n.o,Te)},f=function(e,t,n){var i=e._d;a&&(n=(n=Math.round(n))<0?0:255<n?255:255&n),i.v[o](t*u+i.o,n,Te)},m=function(e,t){P(e,t,{get:function(){return p(this,t)},set:function(e){return f(this,t,e)},enumerable:!0})};l?(h=t(function(e,t,n,i){C(e,h,_,"_d");var a,s,o,r,l=0,c=0;if(I(t)){if(!(t instanceof X||(r=x(t))==q||r==W))return we in t?Be(h,t):Fe.call(h,t);a=t,c=De(n,u);var d=t.byteLength;if(i===wt){if(d%u)throw H(Ce);if((s=d-c)<0)throw H(Ce)}else if(d<(s=T(i)*u)+c)throw H(Ce);o=s/u}else o=Ie(t,!0),a=new X(s=o*u);for(E(e,"_d",{b:a,o:c,l:s,e:o,v:new J(a)});l<o;)m(e,l++)}),d=h[V]=D(We),E(d,"constructor",h)):N(function(e){new h(null),new h(e)},!0)||(h=t(function(e,t,n,i){var a;return C(e,h,_),I(t)?t instanceof X||(a=x(t))==q||a==W?i!==wt?new r(t,De(n,u),i):n!==wt?new r(t,De(n,u)):new r(t):we in t?Be(h,t):Fe.call(h,t):new r(Ie(t,s))}),Z(n!==Function.prototype?S(r).concat(S(n)):S(r),function(e){e in h||E(h,e,r[e])}),h[V]=d,b||(d.constructor=h));var g=d[Ae],A=!!g&&("values"==g.name||g.name==wt),v=He.values;E(h,be,!0),E(d,we,_),E(d,ke,!0),E(d,ye,h),(a?new h(1)[ve]==_:ve in d)||P(d,ve,{get:function(){return _}}),c[_]=h,w(w.G+w.W+w.F*(h!=r),c),w(w.S,_,{BYTES_PER_ELEMENT:u,from:Fe,of:Ke}),Y in d||E(d,Y,u),w(w.P,_,Le),F(_),w(w.P+w.F*xe,_,{set:Ue}),w(w.P+w.F*!A,_,He),w(w.P+w.F*(d.toString!=me),_,{toString:me}),w(w.P+w.F*$(function(){new h(1).slice()}),_,{slice:Pe}),w(w.P+w.F*($(function(){return[1,2].toLocaleString()!=new h([1,2]).toLocaleString()})||!$(function(){d.toLocaleString.call([1,2])})),_,{toLocaleString:je}),B[_]=A?g:v,b||A||E(d,Ae,v)}}else e.exports=function(){}},function(e,t,n){var i=n(73),a=n(23)("iterator"),s=n(136);e.exports=n(7).isIterable=function(e){var t=Object(e);return t[a]!==wt||"@@iterator"in t||s.hasOwnProperty(i(t))}},function(e,t,n){n(236)("Uint8",1,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(236)("Uint8",1,function(i){return function a(e,t,n){return i(this,e,t,n)}},!0)},function(e,t,n){n(236)("Int16",2,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(236)("Uint16",2,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(236)("Int32",4,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(236)("Uint32",4,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(236)("Float32",4,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){n(236)("Float64",8,function(i){return function a(e,t,n){return i(this,e,t,n)}})},function(e,t,n){var i=n(6),a=n(34)(!0);i(i.P,"Array",{includes:function s(e,t){return a(this,e,1<arguments.length?t:wt)}}),n(179)("includes")},function(e,t,n){var i=n(6),a=n(126)(!0);i(i.P,"String",{at:function s(e){return a(this,e)}})},function(e,t,n){var i=n(6),a=n(249);i(i.P,"String",{padStart:function s(e,t){return a(this,e,1<arguments.length?t:wt,!0)}})},function(e,t,n){var d=n(35),u=n(86),_=n(33);e.exports=function(e,t,n,i){var a=String(_(e)),s=a.length,o=n===wt?" ":String(n),r=d(t);if(r<=s||""==o)return a;var l=r-s,c=u.call(o,Math.ceil(l/o.length));return c.length>l&&(c=c.slice(0,l)),i?c+a:a+c}},function(e,t,n){var i=n(6),a=n(249);i(i.P,"String",{padEnd:function s(e,t){return a(this,e,1<arguments.length?t:wt,!1)}})},function(e,t,n){n(81)("trimLeft",function(e){return function t(){return e(this,1)}},"trimStart")},function(e,t,n){n(81)("trimRight",function(e){return function t(){return e(this,2)}},"trimEnd")},function(e,t,n){var i=n(6),a=n(33),s=n(35),o=n(129),r=n(189),l=RegExp.prototype,c=function(e,t){this._r=e,this._s=t};n(137)(c,"RegExp String",function d(){var e=this._r.exec(this._s);return{value:e,done:null===e}}),i(i.P,"String",{matchAll:function u(e){if(a(this),!o(e))throw TypeError(e+" is not a regexp!");var t=String(this),n="flags"in l?String(e.flags):r.call(e),i=new RegExp(e.source,~n.indexOf("g")?n:"g"+n);return i.lastIndex=s(e.lastIndex),new c(i,t)}})},function(e,t,n){n(25)("asyncIterator")},function(e,t,n){n(25)("observable")},function(e,t,n){var i=n(6),r=n(221),l=n(30),c=n(49),d=n(156);i(i.S,"Object",{getOwnPropertyDescriptors:function u(e){for(var t,n=l(e),i=c.f,a=r(n),s={},o=0;a.length>o;)d(s,t=a[o++],i(n,t));return s}})},function(e,t,n){var i=n(6),a=n(258)(!1);i(i.S,"Object",{values:function s(e){return a(e)}})},function(e,t,n){var l=n(28),c=n(30),d=n(42).f;e.exports=function(r){return function(e){for(var t,n=c(e),i=l(n),a=i.length,s=0,o=[];s<a;)d.call(n,t=i[s++])&&o.push(r?[t,n[t]]:n[t]);return o}}},function(e,t,n){var i=n(6),a=n(258)(!0);i(i.S,"Object",{entries:function s(e){return a(e)}})},function(e,t,n){var i=n(6),a=n(56),s=n(19),o=n(9);n(4)&&i(i.P+n(261),"Object",{__defineGetter__:function r(e,t){o.f(a(this),e,{get:s(t),enumerable:!0,configurable:!0})}})},function(e,t,n){e.exports=n(26)||!n(5)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete n(2)[e]})},function(e,t,n){var i=n(6),a=n(56),s=n(19),o=n(9);n(4)&&i(i.P+n(261),"Object",{__defineSetter__:function r(e,t){o.f(a(this),e,{set:s(t),enumerable:!0,configurable:!0})}})},function(e,t,n){var i=n(6),a=n(56),s=n(14),o=n(57),r=n(49).f;n(4)&&i(i.P+n(261),"Object",{__lookupGetter__:function l(e){var t,n=a(this),i=s(e,!0);do{if(t=r(n,i))return t.get}while(n=o(n))}})},function(e,t,n){var i=n(6),a=n(56),s=n(14),o=n(57),r=n(49).f;n(4)&&i(i.P+n(261),"Object",{__lookupSetter__:function l(e){var t,n=a(this),i=s(e,!0);do{if(t=r(n,i))return t.set}while(n=o(n))}})},function(e,t,n){var i=n(6);i(i.P+i.R,"Map",{toJSON:n(266)("Map")})},function(e,t,n){var i=n(73),a=n(267);e.exports=function(e){return function t(){if(i(this)!=e)throw TypeError(e+"#toJSON isn't generic");return a(this)}}},function(e,t,n){var i=n(198);e.exports=function(e,t){var n=[];return i(e,!1,n.push,n,t),n}},function(e,t,n){var i=n(6);i(i.P+i.R,"Set",{toJSON:n(266)("Set")})},function(e,t,n){var i=n(6);i(i.S,"System",{global:n(2)})},function(e,t,n){var i=n(6),a=n(32);i(i.S,"Error",{isError:function s(e){return"Error"===a(e)}})},function(e,t,n){var i=n(6);i(i.S,"Math",{iaddh:function o(e,t,n,i){var a=e>>>0,s=n>>>0;return(t>>>0)+(i>>>0)+((a&s|(a|s)&~(a+s>>>0))>>>31)|0}})},function(e,t,n){var i=n(6);i(i.S,"Math",{isubh:function o(e,t,n,i){var a=e>>>0,s=n>>>0;return(t>>>0)-(i>>>0)-((~a&s|~(a^s)&a-s>>>0)>>>31)|0}})},function(e,t,n){var i=n(6);i(i.S,"Math",{imulh:function d(e,t){var n=65535,i=+e,a=+t,s=i&n,o=a&n,r=i>>16,l=a>>16,c=(r*o>>>0)+(s*o>>>16);return r*l+(c>>16)+((s*l>>>0)+(c&n)>>16)}})},function(e,t,n){var i=n(6);i(i.S,"Math",{umulh:function d(e,t){var n=65535,i=+e,a=+t,s=i&n,o=a&n,r=i>>>16,l=a>>>16,c=(r*o>>>0)+(s*o>>>16);return r*l+(c>>>16)+((s*l>>>0)+(c&n)>>>16)}})},function(e,t,n){var i=n(276),a=n(10),s=i.key,o=i.set;i.exp({defineMetadata:function r(e,t,n,i){o(e,t,a(n),s(i))}})},function(e,t,n){var s=n(203),i=n(6),a=n(21)("metadata"),o=a.store||(a.store=new(n(207))),r=function(e,t,n){var i=o.get(e);if(!i){if(!n)return wt;o.set(e,i=new s)}var a=i.get(t);if(!a){if(!n)return wt;i.set(t,a=new s)}return a},l=function(e,t,n){var i=r(t,n,!1);return i!==wt&&i.has(e)},c=function(e,t,n){var i=r(t,n,!1);return i===wt?wt:i.get(e)},d=function(e,t,n,i){r(n,i,!0).set(e,t)},u=function(e,t){var n=r(e,t,!1),i=[];return n&&n.forEach(function(e,t){i.push(t)}),i},_=function(e){return e===wt||"symbol"==typeof e?e:String(e)},h=function(e){i(i.S,"Reflect",e)};e.exports={store:o,map:r,has:l,get:c,set:d,keys:u,key:_,exp:h}},function(e,t,n){var i=n(276),o=n(10),r=i.key,l=i.map,c=i.store;i.exp({deleteMetadata:function d(e,t,n){var i=arguments.length<3?wt:r(n),a=l(o(t),i,!1);if(a===wt||!a["delete"](e))return!1;if(a.size)return!0;var s=c.get(t);return s["delete"](i),!!s.size||c["delete"](t)}})},function(e,t,n){var i=n(276),a=n(10),s=n(57),o=i.has,r=i.get,l=i.key,c=function(e,t,n){if(o(e,t,n))return r(e,t,n);var i=s(t);return null!==i?c(e,i,n):wt};i.exp({getMetadata:function d(e,t,n){return c(e,a(t),arguments.length<3?wt:l(n))}})},function(e,t,n){var s=n(206),o=n(267),i=n(276),a=n(10),r=n(57),l=i.keys,c=i.key,d=function(e,t){var n=l(e,t),i=r(e);if(null===i)return n;var a=d(i,t);return a.length?n.length?o(new s(n.concat(a))):a:n};i.exp({getMetadataKeys:function u(e,t){return d(a(e),arguments.length<2?wt:c(t))}})},function(e,t,n){var i=n(276),a=n(10),s=i.get,o=i.key;i.exp({getOwnMetadata:function r(e,t,n){return s(e,a(t),arguments.length<3?wt:o(n))}})},function(e,t,n){var i=n(276),a=n(10),s=i.keys,o=i.key;i.exp({getOwnMetadataKeys:function r(e,t){return s(a(e),arguments.length<2?wt:o(t))}})},function(e,t,n){var i=n(276),a=n(10),s=n(57),o=i.has,r=i.key,l=function(e,t,n){if(o(e,t,n))return!0;var i=s(t);return null!==i&&l(e,i,n)};i.exp({hasMetadata:function c(e,t,n){return l(e,a(t),arguments.length<3?wt:r(n))}})},function(e,t,n){var i=n(276),a=n(10),s=i.has,o=i.key;i.exp({hasOwnMetadata:function r(e,t,n){return s(e,a(t),arguments.length<3?wt:o(n))}})},function(e,t,n){var s=n(276),o=n(10),r=n(19),l=s.key,c=s.set;s.exp({metadata:function s(n,i){return function a(e,t){c(n,i,(t!==wt?o:r)(e),l(t))}}})},function(e,t,n){var i=n(6),a=n(201)(),s=n(2).process,o="process"==n(32)(s);i(i.G,{asap:function r(e){var t=o&&s.domain;a(t?t.bind(e):e)}})},function(e,t,n){var i=n(6),s=n(2),o=n(7),a=n(201)(),r=n(23)("observable"),l=n(19),c=n(10),d=n(84),u=n(202),_=n(8),h=n(198),p=h.RETURN,f=function(e){return null==e?wt:l(e)},m=function(e){var t=e._c;t&&(e._c=wt,t())},g=function(e){return e._o===wt},A=function(e){g(e)||(e._o=wt,m(e))},v=function(e,t){c(e),this._c=wt,this._o=e,e=new b(this);try{var n=t(e),i=n;null!=n&&("function"==typeof n.unsubscribe?n=function(){i.unsubscribe()}:l(n),this._c=n)}catch(a){return void e.error(a)}g(this)&&m(this)};v.prototype=u({},{unsubscribe:function $(){A(this)}});var b=function(e){this._s=e};b.prototype=u({},{next:function w(e){var t=this._s;if(!g(t)){var n=t._o;try{var i=f(n.next);if(i)return i.call(n,e)}catch(a){try{A(t)}finally{throw a}}}},error:function k(e){var t=this._s;if(g(t))throw e;var n=t._o;t._o=wt;try{var i=f(n.error);if(!i)throw e;e=i.call(n,e)}catch(a){try{m(t)
}finally{throw a}}return m(t),e},complete:function C(e){var t=this._s;if(!g(t)){var n=t._o;t._o=wt;try{var i=f(n.complete);e=i?i.call(n,e):wt}catch(a){try{m(t)}finally{throw a}}return m(t),e}}});var y=function E(e){d(this,y,"Observable","_f")._f=l(e)};u(y.prototype,{subscribe:function T(e){return new v(e,this._f)},forEach:function x(a){var t=this;return new(o.Promise||s.Promise)(function(e,n){l(a);var i=t.subscribe({next:function(e){try{return a(e)}catch(t){n(t),i.unsubscribe()}},error:n,complete:e})})}}),u(y,{from:function I(i){var e="function"==typeof this?this:y,t=f(c(i)[r]);if(t){var n=c(t.call(i));return n.constructor===e?n:new e(function(e){return n.subscribe(e)})}return new e(function(t){var n=!1;return a(function(){if(!n){try{if(h(i,!1,function(e){if(t.next(e),n)return p})===p)return}catch(e){if(n)throw e;return void t.error(e)}t.complete()}}),function(){n=!0}})},of:function D(){for(var e=0,t=arguments.length,i=Array(t);e<t;)i[e]=arguments[e++];return new("function"==typeof this?this:y)(function(t){var n=!1;return a(function(){if(!n){for(var e=0;e<i.length;++e)if(t.next(i[e]),n)return;t.complete()}}),function(){n=!0}})}}),_(y.prototype,r,function(){return this}),i(i.G,{Observable:y}),n(187)("Observable")},function(e,t,n){var i=n(6),a=n(200);i(i.G+i.B,{setImmediate:a.set,clearImmediate:a.clear})},function(e,t,n){for(var i=n(184),a=n(16),s=n(2),o=n(8),r=n(136),l=n(23),c=l("iterator"),d=l("toStringTag"),u=r.Array,_=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],h=0;h<5;h++){var p,f=_[h],m=s[f],g=m&&m.prototype;if(g)for(p in g[c]||o(g,c,u),g[d]||o(g,d,f),r[f]=u,i)g[p]||a(g,p,i[p],!0)}},function(e,t,n){var i=n(2),a=n(6),s=n(76),o=n(290),r=i.navigator,l=!!r&&/MSIE .\./.test(r.userAgent),c=function(n){return l?function(e,t){return n(s(o,[].slice.call(arguments,2),"function"==typeof e?e:Function(e)),t)}:n};a(a.G+a.B+a.F*l,{setTimeout:c(i.setTimeout),setInterval:c(i.setInterval)})},function(e,t,n){var i=n(291),d=n(76),a=n(19);e.exports=function(){for(var s=a(this),o=arguments.length,r=Array(o),e=0,l=i._,c=!1;e<o;)(r[e]=arguments[e++])===l&&(c=!0);return function(){var e,t=this,n=arguments.length,i=0,a=0;if(!c&&!n)return d(s,r,t);if(e=r.slice(),c)for(;i<o;i++)e[i]===l&&(e[i]=arguments[a++]);for(;a<n;)e.push(arguments[a++]);return d(s,e,t)}}},function(e,t,n){e.exports=n(2)},function(e,t,n){function _(e){var n=u(null);return e!=wt&&(b(e)?v(e,!0,function(e,t){n[e]=t}):d(n,e)),n}function i(e,t,n){A(t);var i,a,s=k(e),o=f(s),r=o.length,l=0;if(arguments.length<3){if(!r)throw TypeError("Reduce of empty object with no initial value");i=s[o[l++]]}else i=Object(n);for(;l<r;)E(s,a=o[l++])&&(i=t(i,s[a],a,e));return i}function a(e,t){return(t==t?g(e,t):x(e,function(e){return e!=e}))!==wt}function s(e,t){if(E(e,t))return e[t]}function o(e,t,n){return C&&t in Object?m.f(e,t,c(0,n)):e[t]=n,e}function r(e){return w(e)&&p(e)===_.prototype}var h=n(18),l=n(6),c=n(15),d=n(67),u=n(44),p=n(57),f=n(28),m=n(9),g=n(27),A=n(19),v=n(198),b=n(237),y=n(137),$=n(185),w=n(11),k=n(30),C=n(4),E=n(3),T=function(c){var d=1==c,u=4==c;return function(e,t,n){var i,a,s,o=h(t,n,3),r=k(e),l=d||7==c||2==c?new("function"==typeof this?this:_):wt;for(i in r)if(E(r,i)&&(s=o(a=r[i],i,e),c))if(d)l[i]=s;else if(s)switch(c){case 2:l[i]=a;break;case 3:return!0;case 5:return a;case 6:return i;case 7:l[s[0]]=s[1]}else if(u)return!1;return 3==c||u?u:l}},x=T(6),I=function(t){return function(e){return new D(e,t)}},D=function(e,t){this._t=k(e),this._a=f(e),this._i=0,this._k=t};y(D,"Dict",function(){var e,t=this,n=t._t,i=t._a,a=t._k;do{if(t._i>=i.length)return t._t=wt,$(1)}while(!E(n,e=i[t._i++]));return $(0,"keys"==a?e:"values"==a?n[e]:[e,n[e]])}),_.prototype=null,l(l.G+l.F,{Dict:_}),l(l.S,"Dict",{keys:I("keys"),values:I("values"),entries:I("entries"),forEach:T(0),map:T(1),filter:T(2),some:T(3),every:T(4),find:T(5),findKey:x,mapPairs:T(7),reduce:i,keyOf:g,includes:a,has:E,get:s,set:o,isDict:r})},function(e,t,n){var i=n(10),a=n(157);e.exports=n(7).getIterator=function(e){var t=a(e);if("function"!=typeof t)throw TypeError(e+" is not iterable!");return i(t.call(e))}},function(e,t,n){var i=n(2),a=n(7),s=n(6),o=n(290);s(s.G+s.F,{delay:function r(t){return new(a.Promise||i.Promise)(function(e){setTimeout(o.call(e,!0),t)})}})},function(e,t,n){var i=n(291),a=n(6);n(7)._=i._=i._||{},a(a.P+a.F,"Function",{part:n(290)})},function(e,t,n){var i=n(6);i(i.S+i.F,"Object",{isObject:n(11)})},function(e,t,n){var i=n(6);i(i.S+i.F,"Object",{classof:n(73)})},function(e,t,n){var i=n(6),a=n(299);i(i.S+i.F,"Object",{define:a})},function(e,t,n){var o=n(9),r=n(49),l=n(221),c=n(30);e.exports=function d(e,t){for(var n,i=l(c(t)),a=i.length,s=0;s<a;)o.f(e,n=i[s++],r.f(t,n));return e}},function(e,t,n){var i=n(6),a=n(299),s=n(44);i(i.S+i.F,"Object",{make:function(e,t){return a(s(e),t)}})},function(e,t,n){n(135)(Number,"Number",function(e){this._l=+e,this._i=0},function(){var e=this._i++,t=!(e<this._l);return{done:t,value:t?wt:e}})},function(e,t,n){var i=n(6),a=n(303)(/[\\^$*+?.()|[\]{}]/g,"\\$&");i(i.S,"RegExp",{escape:function s(e){return a(e)}})},function(e){e.exports=function(t,n){var i=n===Object(n)?function(e){return n[e]}:n;return function(e){return String(e).replace(t,i)}}},function(e,t,n){var i=n(6),a=n(303)(/[&<>"']/g,{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"});i(i.P+i.F,"String",{escapeHTML:function s(){return a(this)}})},function(e,t,n){var i=n(6),a=n(303)(/&(?:amp|lt|gt|quot|apos);/g,{"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&apos;":"'"});i(i.P+i.F,"String",{unescapeHTML:function s(){return a(this)}})}]),"undefined"!=typeof module&&module.exports?module.exports=n:"function"==typeof define&&define.amd?define(function(){return n}):i.core=n}(1,1),function(ve){function be(e,t){if(8==Ie){var n=Se.width(),i=Te.debounce(function(){var e=Se.width();n!=e&&(n=e,t())},1);Se.on(e,i)}else Se.on(e,Te.debounce(t,1))}function ye(e){var t=e[0].parentElement;do{if("visible"!=window.getComputedStyle(t).getPropertyValue("overflow"))break}while(t=t.parentElement);return t==document.body?ve([]):ve(t)}function $e(e){window&&window.console&&window.console.error&&window.console.error("jQuery.floatThead: "+e)}function we(e){var t=e.getBoundingClientRect();return t.width||t.right-t.left}function ke(){var e=ve("<div>").css({width:50,height:50,"overflow-y":"scroll",position:"absolute",top:-200,left:-200}).append(ve("<div>").css({height:100,width:"100%"}));ve("body").append(e);var t=e.innerWidth(),n=ve("div",e).innerWidth();return e.remove(),t-n}function Ce(e){if(e.dataTableSettings)for(var t=0;t<e.dataTableSettings.length;t++){var n=e.dataTableSettings[t].nTable;if(e[0]==n)return!0}return!1}function Ee(e,t,n){var i=n?"outerWidth":"width";if(r&&e.css("max-width")){var a=0;n&&(a+=parseInt(e.css("borderLeft"),10),a+=parseInt(e.css("borderRight"),10));for(var s=0;s<t.length;s++)a+=t.get(s).offsetWidth;return a}return e[i]()}ve.floatThead=ve.floatThead||{},ve.floatThead.defaults={headerCellSelector:"tr:visible:first>*:visible",zIndex:1001,position:"auto",top:0,bottom:0,scrollContainer:function(){return ve([])},responsiveContainer:function(){return ve([])},getSizingRow:function(e){return e.find("tbody tr:visible:first>*:visible")},floatTableClass:"floatThead-table",floatWrapperClass:"floatThead-wrapper",floatContainerClass:"floatThead-container",copyTableClass:!0,autoReflow:!1,debug:!1,support:{bootstrap:!0,datatables:!0,jqueryUI:!0,perfectScrollbar:!0}};var Te=ve.floatThead._,xe="undefined"!=typeof MutationObserver,Ie=function(){for(var e=3,t=document.createElement("b"),n=t.all||[];e=1+e,t.innerHTML="<!--[if gt IE "+e+"]><i><![endif]-->",n[0];);return 4<e?e:document.documentMode}(),e=/Gecko\//.test(navigator.userAgent),De=/WebKit\//.test(navigator.userAgent);Ie||e||De||(Ie=11);var r=function(){if(De){var e=ve("<div>").css("width",0).append(ve("<table>").css("max-width","100%").append(ve("<tr>").append(ve("<th>").append(ve("<div>").css("min-width",100).text("X")))));ve("body").append(e);var t=0==e.find("table").width();return e.remove(),t}return!1},Oe=!e&&!Ie,Se=ve(window);if(!window.matchMedia){var t=window.onbeforeprint,n=window.onafterprint;window.onbeforeprint=function(){t&&t(),Se.triggerHandler("beforeprint")},window.onafterprint=function(){n&&n(),Se.triggerHandler("afterprint")}}ve.fn.floatThead=function(e){if(e=e||{},!Te&&!(Te=ve.floatThead._))throw new Error("jquery.floatThead-slim.js requires underscore. You should use the non-lite version since you do not have underscore.");if(Ie<8)return this;var ge=null;if(Te.isFunction(r)&&(r=r()),Te.isString(e)){var a=e,s=Array.prototype.slice.call(arguments,1),o=this;return this.filter("table").each(function(){var e=ve(this),t=e.data("floatThead-lazy");t&&e.floatThead(t);var n=e.data("floatThead-attached");if(n&&Te.isFunction(n[a])){var i=n[a].apply(this,s);i!==undefined&&(o=i)}}),o}var Ae=ve.extend({},ve.floatThead.defaults||{},e);if(ve.each(e,function(e){e in ve.floatThead.defaults||!Ae.debug||$e("Used ["+e+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+Te.keys(ve.floatThead.defaults).join(", "))}),Ae.debug){var t=ve.fn.jquery.split(".");1==parseInt(t[0],10)&&parseInt(t[1],10)<=7&&$e("jQuery version "+ve.fn.jquery+" detected! This plugin supports 1.8 or better, or 1.7.x with jQuery UI 1.8.24 -> http://jqueryui.com/resources/download/jquery-ui-1.8.24.zip")}return this.filter(":not(."+Ae.floatTableClass+")").each(function(){function e(e){return e+".fth-"+u+".floatTHead"}function l(){var e=0;if(_.children("tr:visible").each(function(){e+=ve(this).outerHeight(!0)}),"collapse"==w.css("border-collapse")){var t=parseInt(w.css("border-top-width"),10);parseInt(w.find("thead tr:first").find(">*:first").css("border-top-width"),10)<t&&(e-=t/2)}q.outerHeight(e),W.outerHeight(e)}function c(){var e=Ee(w,G,!0),t=D?I:T,n=t.width()||e,i="hidden"!=t.css("overflow-y")?n-E.vertical:n;if(H.width(i),x){var a=100*e/i;M.css("width",a+"%")}else M.outerWidth(e)}function t(){k=(Te.isFunction(Ae.top)?Ae.top(w):Ae.top)||0,C=(Te.isFunction(Ae.bottom)?Ae.bottom(w):Ae.bottom)||0}function n(){var e,t=_.find(Ae.headerCellSelector);if(P?e=L.find("col").length:(e=0,t.each(function(){e+=parseInt(ve(this).attr("colspan")||1,10)})),e!=m){m=e;for(var n,i=[],a=[],s=[],o=0;o<e;o++)n=t.eq(o).text(),i.push('<th class="floatThead-col" aria-label="'+n+'"/>'),a.push("<col/>"),s.push(ve("<fthtd>").css({display:"table-cell",height:0,width:"auto"}));a=a.join(""),i=i.join(""),Oe&&(U.empty(),U.append(s),G=U.find("fthtd")),q.html(i),W=q.find("th"),P||L.html(a),Y=L.find("col"),j.html(a),V=j.find("col")}return e}function A(){if(!p){if(p=!0,O){var e=Ee(w,G,!0);F.width()<e&&w.css("minWidth",e)}w.css(Z),M.css(Z),M.append(_),h.before(z),l()}}function v(){p&&(p=!1,O&&w.width(te),z.detach(),w.prepend(_),w.css(ee),M.css(ee),w.css("minWidth",ne),w.css("minWidth",Ee(w,G)))}function b(e){ie!=e&&(ie=e,w.triggerHandler("floatThead",[e,H]))}function y(e){O!=e&&(O=e,H.css({position:O?"absolute":"fixed"}))}function s(e,t,n,i){return Oe?n:i?Ae.getSizingRow(e,t,n):t}function i(){var i,a=n();return function(){var e=H.scrollLeft();Y=L.find("col");var t=s(w,Y,G,Ie);if(t.length==a&&0<a){if(!P)for(i=0;i<a;i++)Y.eq(i).css("width","");v();var n=[];for(i=0;i<a;i++)n[i]=we(t.get(i));for(i=0;i<a;i++)V.eq(i).width(n[i]),Y.eq(i).width(n[i]);A()}else M.append(_),w.css(ee),M.css(ee),l();H.scrollLeft(e),w.triggerHandler("reflowed",[H])}}function a(e){var t=T.css("border-"+e+"-width"),n=0;return t&&~t.indexOf("px")&&(n=parseInt(t,10)),n}function $(){return"auto"==I.css("overflow-x")}function o(){var o,r=T.scrollTop(),l=0,c=R?S.outerHeight(!0):0,d=B?c:-c,u=H.height(),_=w.offset(),h=0,p=0;if(x){var e=T.offset();l=_.top-e.top+r,R&&B&&(l+=c),h=a("left"),p=a("top"),l-=p}else o=_.top-k-u+C+E.horizontal;var f=Se.scrollTop(),m=Se.scrollLeft(),g=($()?I:x?T:Se).scrollLeft();return function(e){D=$();var t=w[0].offsetWidth<=0&&w[0].offsetHeight<=0;if(!t&&Q)return Q=!1,setTimeout(function(){w.triggerHandler("reflow")},1),null;if(t&&(Q=!0,!O))return null;if("windowScroll"==e)f=Se.scrollTop(),m=Se.scrollLeft();else if("containerScroll"==e)if(I.length){if(!D)return;g=I.scrollLeft()}else r=T.scrollTop(),g=T.scrollLeft();else"init"!=e&&(f=Se.scrollTop(),m=Se.scrollLeft(),r=T.scrollTop(),g=(D?I:T).scrollLeft());if(!De||!(f<0||m<0)){if(K)y("windowScrollDone"==e);else if("windowScrollDone"==e)return null;var n,i;_=w.offset(),R&&B&&(_.top+=c);var a=w.outerHeight();if(x&&O){if(r<=l){var s=l-r+p;n=0<s?s:0,b(!1)}else n=N?p:r,b(!0);i=h}else!x&&O?(o+a+d<f?n=a-u+d:_.top>=f+k?(n=0,v(),b(!1)):(n=k+f-_.top+l+(B?c:0),A(),b(!0)),i=g):x&&!O?(r<l||a<r-l?(n=_.top-f,v(),b(!1)):(n=_.top+r-f-l,A(),b(!0)),i=_.left+g-m):x||O||(o+a+d<f?n=a+k-f+o+d:_.top>f+k?(n=_.top-f,A(),b(!1)):(n=k,b(!0)),i=_.left+g-m);return{top:Math.round(n),left:Math.round(i)}}}}function r(){var s=null,o=null,r=null;return function(e,t,n){if(null!=e&&(s!=e.top||o!=e.left)){if(8===Ie)H.css({top:e.top,left:e.left});else{var i="translateX("+e.left+"px) translateY("+e.top+"px)";H.css({"-webkit-transform":i,"-moz-transform":i,"-ms-transform":i,"-o-transform":i,transform:i,top:0,left:0})}s=e.top,o=e.left}t&&c(),n&&l();var a=(D?I:T).scrollLeft();O&&r==a||(H.scrollLeft(a),r=a)}}function d(){if(T.length)if(Ae.support&&Ae.support.perfectScrollbar&&T.data().perfectScrollbar)E={horizontal:0,vertical:0};else{if("scroll"==T.css("overflow-x"))E.horizontal=f;else{var e=T.width(),t=Ee(w,G),n=i<a?f:0;E.horizontal=e-n<t?f:0}if("scroll"==T.css("overflow-y"))E.vertical=f;else{var i=T.height(),a=w.height(),s=e<t?f:0;E.vertical=i-s<a?f:0}}}var u=Te.uniqueId(),w=ve(this);if(w.data("floatThead-attached"))return!0;if(!w.is("table"))throw new Error('jQuery.floatThead must be run on a table element. ex: $("table").floatThead();');xe=Ae.autoReflow&&xe;var _=w.children("thead:first"),h=w.children("tbody:first");if(0==_.length||0==h.length)return w.data("floatThead-lazy",Ae),void w.unbind("reflow").one("reflow",function(){w.floatThead(Ae)});w.data("floatThead-lazy")&&w.unbind("reflow"),w.data("floatThead-lazy",!1);var k,C,p=!0,E={vertical:0,horizontal:0},f=ke(),m=0;!0===Ae.scrollContainer&&(Ae.scrollContainer=ye);var T=Ae.scrollContainer(w)||ve([]),x=0<T.length,I=x?ve([]):Ae.responsiveContainer(w)||ve([]),D=$(),O=null;"undefined"!=typeof Ae.useAbsolutePositioning&&(Ae.position="auto",Ae.useAbsolutePositioning&&(Ae.position=Ae.useAbsolutePositioning?"absolute":"fixed"),$e("option 'useAbsolutePositioning' has been removed in v1.3.0, use `position:'"+Ae.position+"'` instead. See docs for more info: http://mkoryak.github.io/floatThead/#options")),"undefined"!=typeof Ae.scrollingTop&&(Ae.top=Ae.scrollingTop,$e("option 'scrollingTop' has been renamed to 'top' in v1.3.0. See docs for more info: http://mkoryak.github.io/floatThead/#options")),"undefined"!=typeof Ae.scrollingBottom&&(Ae.bottom=Ae.scrollingBottom,$e("option 'scrollingBottom' has been renamed to 'bottom' in v1.3.0. See docs for more info: http://mkoryak.github.io/floatThead/#options")),"auto"==Ae.position?O=null:"fixed"==Ae.position?O=!1:"absolute"==Ae.position?O=!0:Ae.debug&&$e('Invalid value given to "position" option, valid is "fixed", "absolute" and "auto". You passed: ',Ae.position),null==O&&(O=x);var S=w.find("caption"),R=1==S.length;if(R)var B="top"===(S.css("caption-side")||S.attr("align")||"top");var g=ve("<fthfoot>").css({display:"table-footer-group","border-spacing":0,height:0,"border-collapse":"collapse",visibility:"hidden"}),N=!1,F=ve([]),K=Ie<=9&&!x&&O,M=ve("<table/>"),j=ve("<colgroup/>"),L=w.children("colgroup:first"),P=!0;0==L.length&&(L=ve("<colgroup/>"),P=!1);var U=ve("<fthtr>").css({display:"table-row","border-spacing":0,height:0,"border-collapse":"collapse"}),H=ve("<div>").css("overflow","hidden").attr("aria-hidden","true"),Q=!1,z=ve("<thead/>"),q=ve('<tr class="size-row" aria-hidden="true"/>'),W=ve([]),Y=ve([]),V=ve([]),G=ve([]);z.append(q),w.prepend(L),Oe&&(g.append(U),w.append(g)),M.append(j),H.append(M),Ae.copyTableClass&&M.attr("class",w.attr("class")),M.attr({cellpadding:w.attr("cellpadding"),cellspacing:w.attr("cellspacing"),border:w.attr("border")});var X=w.css("display");if(M.css({borderCollapse:w.css("borderCollapse"),border:w.css("border"),display:X}),x||M.css("width","auto"),"none"==X&&(Q=!0),M.addClass(Ae.floatTableClass).css({margin:0,"border-bottom-width":0}),O){var J=function(e,t){var n=e.css("position"),i=e;if(!("relative"==n||"absolute"==n)||t){var a={paddingLeft:e.css("paddingLeft"),paddingRight:e.css("paddingRight")};H.css(a),i=e.data("floatThead-containerWrap")||e.wrap(ve("<div>").addClass(Ae.floatWrapperClass).css({position:"relative",clear:"both"})).parent(),e.data("floatThead-containerWrap",i),N=!0}return i};x?(F=J(T,!0)).prepend(H):(F=J(w),w.before(H))}else w.before(H);H.css({position:O?"absolute":"fixed",marginTop:0,top:O?0:"auto",zIndex:Ae.zIndex,willChange:"transform"}),H.addClass(Ae.floatContainerClass),t();var Z={"table-layout":"fixed"},ee={"table-layout":w.css("tableLayout")||"auto"},te=w[0].style.width||"",ne=w.css("minWidth")||"",ie=!1;d();var ae=function(){i()()};ae();var se=o(),oe=r();oe(se("init"),!0);var re,le=Te.debounce(function(){oe(se("windowScrollDone"),!1)},1),ce=function(){oe(se("windowScroll"),!1),K&&le()},de=function(){oe(se("containerScroll"),!1)},ue=function(){w.is(":hidden")||(t(),d(),ae(),se=o(),(oe=r())(se("resize"),!0,!0))},_e=Te.debounce(function(){w.is(":hidden")||(d(),t(),ae(),se=o(),oe(se("reflow"),!0))},1),he=function(){v()},pe=function(){A()},fe=function(e){e.matches?he():pe()};if(window.matchMedia&&window.matchMedia("print").addListener?(re=window.matchMedia("print")).addListener(fe):(Se.on("beforeprint",he),Se.on("afterprint",pe)),x?O?T.on(e("scroll"),de):(T.on(e("scroll"),de),Se.on(e("scroll"),ce)):(I.on(e("scroll"),de),Se.on(e("scroll"),ce)),Se.on(e("load"),_e),be(e("resize"),ue),w.on("reflow",_e),Ae.support&&Ae.support.datatables&&Ce(w)&&w.on("filter",_e).on("sort",_e).on("page",_e),Ae.support&&Ae.support.bootstrap&&Se.on(e("shown.bs.tab"),_e),Ae.support&&Ae.support.jqueryUI&&Se.on(e("tabsactivate"),_e),xe){var me=null;Te.isFunction(Ae.autoReflow)&&(me=Ae.autoReflow(w,T)),me||(me=T.length?T[0]:w[0]),(ge=new MutationObserver(function(e){for(var t=function(e){return e&&e[0]&&("THEAD"==e[0].nodeName||"TD"==e[0].nodeName||"TH"==e[0].nodeName)},n=0;n<e.length;n++)if(!t(e[n].addedNodes)&&!t(e[n].removedNodes)){_e();break}})).observe(me,{childList:!0,subtree:!0})}w.data("floatThead-attached",{destroy:function(){var e=".fth-"+u;return v(),w.css(ee),L.remove(),Oe&&g.remove(),z.parent().length&&z.replaceWith(_),b(!1),xe&&(ge.disconnect(),ge=null),w.off("reflow reflowed"),T.off(e),I.off(e),N&&(T.length?T.unwrap():w.unwrap()),x?T.data("floatThead-containerWrap",!1):w.data("floatThead-containerWrap",!1),w.css("minWidth",ne),H.remove(),w.data("floatThead-attached",!1),Se.off(e),re&&re.removeListener(fe),he=pe=function(){},function t(){return w.floatThead(Ae)}},reflow:function(){_e()},setHeaderHeight:function(){l()},getFloatContainer:function(){return H},getRowGroups:function(){return p?H.find(">table>thead").add(w.children("tbody,tfoot")):w.children("thead,tbody,tfoot")}})}),this}}(function(){var e=window.jQuery;return"undefined"!=typeof module&&module.exports&&!e&&(e=require("jquery")),e}()),function(t){t.floatThead=t.floatThead||{},t.floatThead._=function(){var i={},n=Object.prototype.hasOwnProperty,e=["Arguments","Function","String","Number","Date","RegExp"];i.has=function(e,t){return n.call(e,t)},i.keys=function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)i.has(e,n)&&t.push(n);return t};var a=0;return i.uniqueId=function(e){var t=++a+"";return e?e+t:t},t.each(e,function(){var t=this;i["is"+t]=function(e){return Object.prototype.toString.call(e)=="[object "+t+"]"}}),i.debounce=function(n,i,a){var s,o,r,l,c;return function(){r=this,o=arguments,l=new Date;var t=function(){var e=new Date-l;e<i?s=setTimeout(t,i-e):(s=null,a||(c=n.apply(r,o)))},e=a&&!s;return s||(s=setTimeout(t,i)),e&&(c=n.apply(r,o)),c}},i}()}(jQuery),function(){function ld(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cd(e,t,n,i){for(var a=-1,s=null==e?0:e.length;++a<s;){var o=e[a];t(i,o,n(o),e)}return i}function dd(e,t){for(var n=-1,i=null==e?0:e.length;++n<i&&!1!==t(e[n],n,e););return e}function ud(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function _d(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(!t(e[n],n,e))return!1;return!0}function hd(e,t){for(var n=-1,i=null==e?0:e.length,a=0,s=[];++n<i;){var o=e[n];t(o,n,e)&&(s[a++]=o)}return s}function pd(e,t){return!!(null==e?0:e.length)&&-1<kd(e,t,0)}function fd(e,t,n){for(var i=-1,a=null==e?0:e.length;++i<a;)if(n(t,e[i]))return!0;return!1}function md(e,t){for(var n=-1,i=null==e?0:e.length,a=Array(i);++n<i;)a[n]=t(e[n],n,e);return a}function gd(e,t){for(var n=-1,i=t.length,a=e.length;++n<i;)e[a+n]=t[n];return e}function Ad(e,t,n,i){var a=-1,s=null==e?0:e.length;for(i&&s&&(n=e[++a]);++a<s;)n=t(n,e[a],a,e);return n}function vd(e,t,n,i){var a=null==e?0:e.length;for(i&&a&&(n=e[--a]);a--;)n=t(n,e[a],a,e);return n}function bd(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function t(e){return e.split("")}function yd(e){return e.match(o)||[]}function $d(e,i,t){var a;return t(e,function(e,t,n){if(i(e,t,n))return a=t,!1}),a}function wd(e,t,n,i){for(var a=e.length,s=n+(i?1:-1);i?s--:++s<a;)if(t(e[s],s,e))return s;return-1}function kd(e,t,n){return t==t?i(e,t,n):wd(e,Ed,n)}function Cd(e,t,n,i){for(var a=n-1,s=e.length;++a<s;)if(i(e[a],t))return a;return-1}function Ed(e){return e!=e}function Td(e,t){var n=null==e?0:e.length;return n?Od(e,t)/n:Fu}function xd(t){return function(e){return null==e?nu:e[t]}}function e(t){return function(e){return null==t?nu:t[e]}}function Id(e,i,a,s,t){return t(e,function(e,t,n){a=s?(s=!1,e):i(a,e,t,n)}),a}function Dd(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Od(e,t){for(var n,i=-1,a=e.length;++i<a;){var s=t(e[i]);s!==nu&&(n=n===nu?s:n+s)}return n}function Sd(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}function Rd(t,e){return md(e,function(e){return[e,t[e]]})}function Bd(e){return e?e.slice(0,eu(e)+1).replace(N_,""):e}function Nd(t){return function(e){return t(e)}}function Fd(t,e){return md(e,function(e){return t[e]})}function Kd(e,t){return e.has(t)}function Md(e,t){for(var n=-1,i=e.length;++n<i&&-1<kd(t,e[n],0););return n}function jd(e,t){for(var n=e.length;n--&&-1<kd(t,e[n],0););return n}function Ld(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&++i;return i}function Pd(e){return"\\"+q[e]}function Ud(e,t){return null==e?nu:e[t]}function Hd(e){return P.test(e)}function Qd(e){return U.test(e)}function zd(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function qd(e){var n=-1,i=Array(e.size);return e.forEach(function(e,t){i[++n]=[t,e]}),i}function Wd(t,n){return function(e){return t(n(e))}}function Yd(e,t){for(var n=-1,i=e.length,a=0,s=[];++n<i;){var o=e[n];o!==t&&o!==du||(e[n]=du,s[a++]=n)}return s}function Vd(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function Gd(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=[e,e]}),n}function i(e,t,n){for(var i=n-1,a=e.length;++i<a;)if(e[i]===t)return i;return-1}function Xd(e,t,n){for(var i=n+1;i--;)if(e[i]===t)return i;return i}function Jd(e){return Hd(e)?n(e):Z(e)}function Zd(e){return Hd(e)?a(e):t(e)}function eu(e){for(var t=e.length;t--&&s.test(e.charAt(t)););return t}function n(e){for(var t=j.lastIndex=0;j.test(e);)++t;return t}function a(e){return e.match(j)||[]}function tu(e){return e.match(L)||[]}var nu,iu="4.17.21",au=200,su="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",ou="Expected a function",ru="Invalid `variable` option passed into `_.template`",lu="__lodash_hash_undefined__",cu=500,du="__lodash_placeholder__",uu=1,_u=2,hu=4,pu=1,fu=2,mu=1,gu=2,Au=4,vu=8,bu=16,yu=32,$u=64,wu=128,ku=256,Cu=512,Eu=30,Tu="...",xu=800,Iu=16,Du=1,Ou=2,Su=3,Ru=1/0,Bu=9007199254740991,Nu=17976931348623157e292,Fu=NaN,Ku=4294967295,Mu=Ku-1,ju=Ku>>>1,Lu=[["ary",wu],["bind",mu],["bindKey",gu],["curry",vu],["curryRight",bu],["flip",Cu],["partial",yu],["partialRight",$u],["rearg",ku]],Pu="[object Arguments]",Uu="[object Array]",Hu="[object AsyncFunction]",Qu="[object Boolean]",zu="[object Date]",qu="[object DOMException]",Wu="[object Error]",Yu="[object Function]",Vu="[object GeneratorFunction]",Gu="[object Map]",Xu="[object Number]",Ju="[object Null]",Zu="[object Object]",e_="[object Promise]",t_="[object Proxy]",n_="[object RegExp]",i_="[object Set]",a_="[object String]",s_="[object Symbol]",o_="[object Undefined]",r_="[object WeakMap]",l_="[object WeakSet]",c_="[object ArrayBuffer]",d_="[object DataView]",u_="[object Float32Array]",__="[object Float64Array]",h_="[object Int8Array]",p_="[object Int16Array]",f_="[object Int32Array]",m_="[object Uint8Array]",g_="[object Uint8ClampedArray]",A_="[object Uint16Array]",v_="[object Uint32Array]",b_=/\b__p \+= '';/g,y_=/\b(__p \+=) '' \+/g,$_=/(__e\(.*?\)|\b__t\)) \+\n'';/g,w_=/&(?:amp|lt|gt|quot|#39);/g,k_=/[&<>"']/g,C_=RegExp(w_.source),E_=RegExp(k_.source),T_=/<%-([\s\S]+?)%>/g,x_=/<%([\s\S]+?)%>/g,I_=/<%=([\s\S]+?)%>/g,D_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O_=/^\w*$/,S_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,R_=/[\\^$.*+?()[\]{}|]/g,B_=RegExp(R_.source),N_=/^\s+/,s=/\s/,F_=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,K_=/\{\n\/\* \[wrapped with (.+)\] \*/,M_=/,? & /,o=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,j_=/[()=,{}\[\]\/\s]/,L_=/\\(\\)?/g,P_=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,U_=/\w*$/,H_=/^[-+]0x[0-9a-f]+$/i,Q_=/^0b[01]+$/i,z_=/^\[object .+?Constructor\]$/,q_=/^0o[0-7]+$/i,W_=/^(?:0|[1-9]\d*)$/,Y_=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,V_=/($^)/,G_=/['\n\r\u2028\u2029\\]/g,r="\\ud800-\\udfff",l="\\u0300-\\u036f"+"\\ufe20-\\ufe2f"+"\\u20d0-\\u20ff",c="\\u2700-\\u27bf",d="a-z\\xdf-\\xf6\\xf8-\\xff",u="A-Z\\xc0-\\xd6\\xd8-\\xde",_="\\ufe0e\\ufe0f",h="\\xac\\xb1\\xd7\\xf7"+"\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"+"\\u2000-\\u206f"+" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",p="['\u2019]",f="["+r+"]",m="["+h+"]",g="["+l+"]",A="\\d+",v="["+c+"]",b="["+d+"]",y="[^"+r+h+A+c+d+u+"]",$="\\ud83c[\\udffb-\\udfff]",w="[^"+r+"]",k="(?:\\ud83c[\\udde6-\\uddff]){2}",C="[\\ud800-\\udbff][\\udc00-\\udfff]",E="["+u+"]",T="\\u200d",x="(?:"+b+"|"+y+")",I="(?:"+E+"|"+y+")",D="(?:"+p+"(?:d|ll|m|re|s|t|ve))?",O="(?:"+p+"(?:D|LL|M|RE|S|T|VE))?",S="(?:"+g+"|"+$+")"+"?",R="["+_+"]?",B="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",N="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",F=R+S+("(?:"+T+"(?:"+[w,k,C].join("|")+")"+R+S+")*"),K="(?:"+[v,k,C].join("|")+")"+F,M="(?:"+[w+g+"?",g,k,C,f].join("|")+")",X_=RegExp(p,"g"),J_=RegExp(g,"g"),j=RegExp($+"(?="+$+")|"+M+F,"g"),L=RegExp([E+"?"+b+"+"+D+"(?="+[m,E,"$"].join("|")+")",I+"+"+O+"(?="+[m,E+x,"$"].join("|")+")",E+"?"+x+"+"+D,E+"+"+O,N,B,A,K].join("|"),"g"),P=RegExp("["+T+r+l+_+"]"),U=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Z_=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eh=-1,th={};th[u_]=th[__]=th[h_]=th[p_]=th[f_]=th[m_]=th[g_]=th[A_]=th[v_]=!0,th[Pu]=th[Uu]=th[c_]=th[Qu]=th[d_]=th[zu]=th[Wu]=th[Yu]=th[Gu]=th[Xu]=th[Zu]=th[n_]=th[i_]=th[a_]=th[r_]=!1;var nh={};nh[Pu]=nh[Uu]=nh[c_]=nh[d_]=nh[Qu]=nh[zu]=nh[u_]=nh[__]=nh[h_]=nh[p_]=nh[f_]=nh[Gu]=nh[Xu]=nh[Zu]=nh[n_]=nh[i_]=nh[a_]=nh[s_]=nh[m_]=nh[g_]=nh[A_]=nh[v_]=!0,nh[Wu]=nh[Yu]=nh[r_]=!1;var H={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"},Q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},z={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},q={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ih=parseFloat,ah=parseInt,W="object"==typeof global&&global&&global.Object===Object&&global,Y="object"==typeof self&&self&&self.Object===Object&&self,sh=W||Y||Function("return this")(),V="object"==typeof exports&&exports&&!exports.nodeType&&exports,G=V&&"object"==typeof module&&module&&!module.nodeType&&module,oh=G&&G.exports===V,X=oh&&W.process,J=function(){try{var e=G&&G.require&&G.require("util").types;return e||X&&X.binding&&X.binding("util")}catch(t){}}(),rh=J&&J.isArrayBuffer,lh=J&&J.isDate,ch=J&&J.isMap,dh=J&&J.isRegExp,uh=J&&J.isSet,_h=J&&J.isTypedArray,Z=xd("length"),hh=e(H),ph=e(Q),fh=e(z),mh=function mh(e){function m(e){if(Ga(e)&&!dc(e)&&!(e instanceof A)){if(e instanceof g)return e;if(cr.call(e,"__wrapped__"))return Wn(e)}return new g(e)}function s(){}function g(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=nu}function A(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ku,this.__views__=[]}function t(){var e=new A(this.__wrapped__);return e.__actions__=Et(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Et(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Et(this.__views__),e}function n(){if(this.__filtered__){var e=new A(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e}function i(){var e=this.__wrapped__.value(),t=this.__dir__,n=dc(e),i=t<0,a=n?e.length:0,s=mn(0,a,this.__views__),o=s.start,r=s.end,l=r-o,c=i?r:o-1,d=this.__iteratees__,u=d.length,_=0,h=jr(l,this.__takeCount__);if(!n||!i&&a==l&&h==l)return ct(e,this.__actions__);var p=[];e:for(;l--&&_<h;){for(var f=-1,m=e[c+=t];++f<u;){var g=d[f],A=g.iteratee,v=g.type,b=A(m);if(v==Ou)m=b;else if(!b){if(v==Du)continue e;break e}}p[_++]=m}return p}function a(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function o(){this.__data__=Vr?Vr(null):{},this.size=0}function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function l(e){var t=this.__data__;if(Vr){var n=t[e];return n===lu?nu:n}return cr.call(t,e)?t[e]:nu
}function c(e){var t=this.__data__;return Vr?t[e]!==nu:cr.call(t,e)}function d(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Vr&&t===nu?lu:t,this}function u(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function _(){this.__data__=[],this.size=0}function h(e){var t=this.__data__,n=P(t,e);return!(n<0)&&(n==t.length-1?t.pop():wr.call(t,n,1),--this.size,!0)}function p(e){var t=this.__data__,n=P(t,e);return n<0?nu:t[n][1]}function f(e){return-1<P(this.__data__,e)}function v(e,t){var n=this.__data__,i=P(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}function b(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function y(){this.size=0,this.__data__={hash:new a,map:new(zr||u),string:new a}}function $(e){var t=_n(this,e)["delete"](e);return this.size-=t?1:0,t}function w(e){return _n(this,e).get(e)}function k(e){return _n(this,e).has(e)}function C(e,t){var n=_n(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}function E(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new b;++t<n;)this.add(e[t])}function T(e){return this.__data__.set(e,lu),this}function x(e){return this.__data__.has(e)}function I(e){var t=this.__data__=new u(e);this.size=t.size}function D(){this.__data__=new u,this.size=0}function O(e){var t=this.__data__,n=t["delete"](e);return this.size=t.size,n}function S(e){return this.__data__.get(e)}function R(e){return this.__data__.has(e)}function B(e,t){var n=this.__data__;if(n instanceof u){var i=n.__data__;if(!zr||i.length<au-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new b(i)}return n.set(e,t),this.size=n.size,this}function N(e,t){var n=dc(e),i=!n&&cc(e),a=!n&&!i&&_c(e),s=!n&&!i&&!a&&gc(e),o=n||i||a||s,r=o?Sd(e.length,nr):[],l=r.length;for(var c in e)!t&&!cr.call(e,c)||o&&("length"==c||a&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||kn(c,l))||r.push(c);return r}function F(e){var t=e.length;return t?e[Qe(0,t-1)]:nu}function K(e,t){return Hn(Et(e),W(t,0,e.length))}function M(e){return Hn(Et(e))}function j(e,t,n){(n===nu||Fa(e[t],n))&&(n!==nu||t in e)||z(e,t,n)}function L(e,t,n){var i=e[t];cr.call(e,t)&&Fa(i,n)&&(n!==nu||t in e)||z(e,t,n)}function P(e,t){for(var n=e.length;n--;)if(Fa(e[n][0],t))return n;return-1}function U(e,i,a,s){return rl(e,function(e,t,n){i(s,e,a(e),n)}),s}function H(e,t){return e&&Tt(t,Os(t),e)}function Q(e,t){return e&&Tt(t,Ss(t),e)}function z(e,t,n){"__proto__"==t&&Tr?Tr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function q(e,t){for(var n=-1,i=t.length,a=Vo(i),s=null==e;++n<i;)a[n]=s?nu:xs(e,t[n]);return a}function W(e,t,n){return e==e&&(n!==nu&&(e=e<=n?e:n),t!==nu&&(e=t<=e?e:t)),e}function Y(n,i,a,e,t,s){var o,r=i&uu,l=i&_u,c=i&hu;if(a&&(o=t?a(n,e,t,s):a(n)),o!==nu)return o;if(!Va(n))return n;var d=dc(n);if(d){if(o=vn(n),!r)return Et(n,o)}else{var u=vl(n),_=u==Yu||u==Vu;if(_c(n))return mt(n,r);if(u==Zu||u==Pu||_&&!t){if(o=l||_?{}:bn(n),!r)return l?It(n,Q(o,n)):xt(n,H(o,n))}else{if(!nh[u])return t?n:{};o=yn(n,u,r)}}s||(s=new I);var h=s.get(n);if(h)return h;s.set(n,o),mc(n)?n.forEach(function(e){o.add(Y(e,i,a,e,n,s))}):pc(n)&&n.forEach(function(e,t){o.set(t,Y(e,i,a,t,n,s))});var p=d?nu:(c?l?ln:rn:l?Ss:Os)(n);return dd(p||n,function(e,t){p&&(e=n[t=e]),L(o,t,Y(e,i,a,t,n,s))}),o}function V(t){var n=Os(t);return function(e){return G(e,t,n)}}function G(e,t,n){var i=n.length;if(null==e)return!i;for(e=er(e);i--;){var a=n[i],s=t[a],o=e[a];if(o===nu&&!(a in e)||!s(o))return!1}return!0}function X(e,t,n){if("function"!=typeof e)throw new ir(ou);return $l(function(){e.apply(nu,n)},t)}function J(e,t,n,i){var a=-1,s=pd,o=!0,r=e.length,l=[],c=t.length;if(!r)return l;n&&(t=md(t,Nd(n))),i?(s=fd,o=!1):t.length>=au&&(s=Kd,o=!1,t=new E(t));e:for(;++a<r;){var d=e[a],u=null==n?d:n(d);if(d=i||0!==d?d:0,o&&u==u){for(var _=c;_--;)if(t[_]===u)continue e;l.push(d)}else s(t,u,i)||l.push(d)}return l}function Z(e,i){var a=!0;return rl(e,function(e,t,n){return a=!!i(e,t,n)}),a}function ee(e,t,n){for(var i=-1,a=e.length;++i<a;){var s=e[i],o=t(s);if(null!=o&&(r===nu?o==o&&!rs(o):n(o,r)))var r=o,l=s}return l}function te(e,t,n,i){var a=e.length;for((n=hs(n))<0&&(n=a<-n?0:a+n),(i=i===nu||a<i?a:hs(i))<0&&(i+=a),i=i<n?0:ps(i);n<i;)e[n++]=t;return e}function ne(e,i){var a=[];return rl(e,function(e,t,n){i(e,t,n)&&a.push(e)}),a}function ie(e,t,n,i,a){var s=-1,o=e.length;for(n||(n=wn),a||(a=[]);++s<o;){var r=e[s];0<t&&n(r)?1<t?ie(r,t-1,n,i,a):gd(a,r):i||(a[a.length]=r)}return a}function ae(e,t){return e&&cl(e,t,Os)}function se(e,t){return e&&dl(e,t,Os)}function oe(t,e){return hd(e,function(e){return qa(t[e])})}function re(e,t){for(var n=0,i=(t=pt(t,e)).length;null!=e&&n<i;)e=e[Qn(t[n++])];return n&&n==i?e:nu}function le(e,t,n){var i=t(e);return dc(e)?i:gd(i,n(e))}function ce(e){return null==e?e===nu?o_:Ju:Er&&Er in er(e)?fn(e):Fn(e)}function de(e,t){return t<e}function ue(e,t){return null!=e&&cr.call(e,t)}function _e(e,t){return null!=e&&t in er(e)}function he(e,t,n){return e>=jr(t,n)&&e<Mr(t,n)}function pe(e,t,n){for(var i=n?fd:pd,a=e[0].length,s=e.length,o=s,r=Vo(s),l=Infinity,c=[];o--;){var d=e[o];o&&t&&(d=md(d,Nd(t))),l=jr(d.length,l),r[o]=!n&&(t||120<=a&&120<=d.length)?new E(o&&d):nu}d=e[0];var u=-1,_=r[0];e:for(;++u<a&&c.length<l;){var h=d[u],p=t?t(h):h;if(h=n||0!==h?h:0,!(_?Kd(_,p):i(c,p,n))){for(o=s;--o;){var f=r[o];if(!(f?Kd(f,p):i(e[o],p,n)))continue e}_&&_.push(p),c.push(h)}}return c}function fe(e,i,a,s){return ae(e,function(e,t,n){i(s,a(e),t,n)}),s}function me(e,t,n){var i=null==(e=Mn(e,t=pt(t,e)))?e:e[Qn(_i(t))];return null==i?nu:ld(i,e,n)}function ge(e){return Ga(e)&&ce(e)==Pu}function Ae(e){return Ga(e)&&ce(e)==c_}function ve(e){return Ga(e)&&ce(e)==zu}function be(e,t,n,i,a){return e===t||(null==e||null==t||!Ga(e)&&!Ga(t)?e!=e&&t!=t:ye(e,t,n,i,be,a))}function ye(e,t,n,i,a,s){var o=dc(e),r=dc(t),l=o?Uu:vl(e),c=r?Uu:vl(t),d=(l=l==Pu?Zu:l)==Zu,u=(c=c==Pu?Zu:c)==Zu,_=l==c;if(_&&_c(e)){if(!_c(t))return!1;d=!(o=!0)}if(_&&!d)return s||(s=new I),o||gc(e)?nn(e,t,n,i,a,s):an(e,t,l,n,i,a,s);if(!(n&pu)){var h=d&&cr.call(e,"__wrapped__"),p=u&&cr.call(t,"__wrapped__");if(h||p){var f=h?e.value():e,m=p?t.value():t;return s||(s=new I),a(f,m,n,i,s)}}return!!_&&(s||(s=new I),sn(e,t,n,i,a,s))}function $e(e){return Ga(e)&&vl(e)==Gu}function we(e,t,n,i){var a=n.length,s=a,o=!i;if(null==e)return!s;for(e=er(e);a--;){var r=n[a];if(o&&r[2]?r[1]!==e[r[0]]:!(r[0]in e))return!1}for(;++a<s;){var l=(r=n[a])[0],c=e[l],d=r[1];if(o&&r[2]){if(c===nu&&!(l in e))return!1}else{var u=new I;if(i)var _=i(c,d,l,e,t,u);if(!(_===nu?be(d,c,pu|fu,i,u):_))return!1}}return!0}function ke(e){return!(!Va(e)||In(e))&&(qa(e)?fr:z_).test(zn(e))}function Ce(e){return Ga(e)&&ce(e)==n_}function Ee(e){return Ga(e)&&vl(e)==i_}function Te(e){return Ga(e)&&Ya(e.length)&&!!th[ce(e)]}function xe(e){return"function"==typeof e?e:null==e?$o:"object"==typeof e?dc(e)?Be(e[0],e[1]):Re(e):Do(e)}function Ie(e){if(!Dn(e))return Kr(e);var t=[];for(var n in er(e))cr.call(e,n)&&"constructor"!=n&&t.push(n);return t}function De(e){if(!Va(e))return Nn(e);var t=Dn(e),n=[];for(var i in e)("constructor"!=i||!t&&cr.call(e,i))&&n.push(i);return n}function Oe(e,t){return e<t}function Se(e,i){var a=-1,s=Ka(e)?Vo(e.length):[];return rl(e,function(e,t,n){s[++a]=i(e,t,n)}),s}function Re(t){var n=hn(t);return 1==n.length&&n[0][2]?Sn(n[0][0],n[0][1]):function(e){return e===t||we(e,t,n)}}function Be(n,i){return En(n)&&On(i)?Sn(Qn(n),i):function(e){var t=xs(e,n);return t===nu&&t===i?Ds(e,n):be(i,t,pu|fu)}}function Ne(i,a,s,o,r){i!==a&&cl(a,function(e,t){if(r||(r=new I),Va(e))Fe(i,a,t,s,Ne,o,r);else{var n=o?o(Ln(i,t),e,t+"",i,a,r):nu;n===nu&&(n=e),j(i,t,n)}},Ss)}function Fe(e,t,n,i,a,s,o){var r=Ln(e,n),l=Ln(t,n),c=o.get(l);if(c)j(e,n,c);else{var d=s?s(r,l,n+"",e,t,o):nu,u=d===nu;if(u){var _=dc(l),h=!_&&_c(l),p=!_&&!h&&gc(l);d=l,_||h||p?d=dc(r)?r:Ma(r)?Et(r):h?mt(l,!(u=!1)):p?yt(l,!(u=!1)):[]:as(l)||cc(l)?cc(d=r)?d=ms(r):Va(r)&&!qa(r)||(d=bn(l)):u=!1}u&&(o.set(l,d),a(d,l,i,s,o),o["delete"](l)),j(e,n,d)}}function Ke(e,t){var n=e.length;if(n)return kn(t+=t<0?n:0,n)?e[t]:nu}function Me(e,n,i){n=n.length?md(n,function(t){return dc(t)?function(e){return re(e,1===t.length?t[0]:t)}:t}):[$o];var a=-1;return n=md(n,Nd(un())),Dd(Se(e,function(t){return{criteria:md(n,function(e){return e(t)}),index:++a,value:t}}),function(e,t){return wt(e,t,i)})}function je(n,e){return Le(n,e,function(e,t){return Ds(n,t)})}function Le(e,t,n){for(var i=-1,a=t.length,s={};++i<a;){var o=t[i],r=re(e,o);n(r,o)&&Ge(s,pt(o,e),r)}return s}function Pe(t){return function(e){return re(e,t)}}function Ue(e,t,n,i){var a=i?Cd:kd,s=-1,o=t.length,r=e;for(e===t&&(t=Et(t)),n&&(r=md(e,Nd(n)));++s<o;)for(var l=0,c=t[s],d=n?n(c):c;-1<(l=a(r,d,l,i));)r!==e&&wr.call(r,l,1),wr.call(e,l,1);return e}function He(e,t){for(var n=e?t.length:0,i=n-1;n--;){var a=t[n];if(n==i||a!==s){var s=a;kn(a)?wr.call(e,a,1):ot(e,a)}}return e}function Qe(e,t){return e+Sr(Ur()*(t-e+1))}function ze(e,t,n,i){for(var a=-1,s=Mr(Or((t-e)/(n||1)),0),o=Vo(s);s--;)o[i?s:++a]=e,e+=n;return o}function qe(e,t){var n="";if(!e||t<1||Bu<t)return n;for(;t%2&&(n+=e),(t=Sr(t/2))&&(e+=e),t;);return n}function We(e,t){return wl(Kn(e,t,$o),e+"")}function Ye(e){return F(Qs(e))}function Ve(e,t){var n=Qs(e);return Hn(n,W(t,0,n.length))}function Ge(e,t,n,i){if(!Va(e))return e;for(var a=-1,s=(t=pt(t,e)).length,o=s-1,r=e;null!=r&&++a<s;){var l=Qn(t[a]),c=n;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(a!=o){var d=r[l];(c=i?i(d,l,r):nu)===nu&&(c=Va(d)?d:kn(t[a+1])?[]:{})}L(r,l,c),r=r[l]}return e}function Xe(e){return Hn(Qs(e))}function Je(e,t,n){var i=-1,a=e.length;t<0&&(t=a<-t?0:a+t),(n=a<n?a:n)<0&&(n+=a),a=n<t?0:n-t>>>0,t>>>=0;for(var s=Vo(a);++i<a;)s[i]=e[i+t];return s}function Ze(e,i){var a;return rl(e,function(e,t,n){return!(a=i(e,t,n))}),!!a}function et(e,t,n){var i=0,a=null==e?i:e.length;if("number"==typeof t&&t==t&&a<=ju){for(;i<a;){var s=i+a>>>1,o=e[s];null!==o&&!rs(o)&&(n?o<=t:o<t)?i=s+1:a=s}return a}return tt(e,t,$o,n)}function tt(e,t,n,i){var a=0,s=null==e?0:e.length;if(0===s)return 0;for(var o=(t=n(t))!=t,r=null===t,l=rs(t),c=t===nu;a<s;){var d=Sr((a+s)/2),u=n(e[d]),_=u!==nu,h=null===u,p=u==u,f=rs(u);if(o)var m=i||p;else m=c?p&&(i||_):r?p&&_&&(i||!h):l?p&&_&&!h&&(i||!f):!h&&!f&&(i?u<=t:u<t);m?a=d+1:s=d}return jr(s,Mu)}function nt(e,t){for(var n=-1,i=e.length,a=0,s=[];++n<i;){var o=e[n],r=t?t(o):o;if(!n||!Fa(r,l)){var l=r;s[a++]=0===o?0:o}}return s}function it(e){return"number"==typeof e?e:rs(e)?Fu:+e}function at(e){if("string"==typeof e)return e;if(dc(e))return md(e,at)+"";if(rs(e))return sl?sl.call(e):"";var t=e+"";return"0"==t&&1/e==-Ru?"-0":t}function st(e,t,n){var i=-1,a=pd,s=e.length,o=!0,r=[],l=r;if(n)o=!1,a=fd;else if(au<=s){var c=t?null:fl(e);if(c)return Vd(c);o=!1,a=Kd,l=new E}else l=t?[]:r;e:for(;++i<s;){var d=e[i],u=t?t(d):d;if(d=n||0!==d?d:0,o&&u==u){for(var _=l.length;_--;)if(l[_]===u)continue e;t&&l.push(u),r.push(d)}else a(l,u,n)||(l!==r&&l.push(u),r.push(d))}return r}function ot(e,t){return null==(e=Mn(e,t=pt(t,e)))||delete e[Qn(_i(t))]}function rt(e,t,n,i){return Ge(e,t,n(re(e,t)),i)}function lt(e,t,n,i){for(var a=e.length,s=i?a:-1;(i?s--:++s<a)&&t(e[s],s,e););return n?Je(e,i?0:s,i?s+1:a):Je(e,i?s+1:0,i?a:s)}function ct(e,t){var n=e;return n instanceof A&&(n=n.value()),Ad(t,function(e,t){return t.func.apply(t.thisArg,gd([e],t.args))},n)}function dt(e,t,n){var i=e.length;if(i<2)return i?st(e[0]):[];for(var a=-1,s=Vo(i);++a<i;)for(var o=e[a],r=-1;++r<i;)r!=a&&(s[a]=J(s[a]||o,e[r],t,n));return st(ie(s,1),t,n)}function ut(e,t,n){for(var i=-1,a=e.length,s=t.length,o={};++i<a;){var r=i<s?t[i]:nu;n(o,e[i],r)}return o}function _t(e){return Ma(e)?e:[]}function ht(e){return"function"==typeof e?e:$o}function pt(e,t){return dc(e)?e:En(e,t)?[e]:kl(As(e))}function ft(e,t,n){var i=e.length;return n=n===nu?i:n,!t&&i<=n?e:Je(e,t,n)}function mt(e,t){if(t)return e.slice();var n=e.length,i=vr?vr(n):new e.constructor(n);return e.copy(i),i}function gt(e){var t=new e.constructor(e.byteLength);return new Ar(t).set(new Ar(e)),t}function At(e,t){var n=t?gt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function vt(e){var t=new e.constructor(e.source,U_.exec(e));return t.lastIndex=e.lastIndex,t}function bt(e){return al?er(al.call(e)):{}}function yt(e,t){var n=t?gt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function $t(e,t){if(e!==t){var n=e!==nu,i=null===e,a=e==e,s=rs(e),o=t!==nu,r=null===t,l=t==t,c=rs(t);if(!r&&!c&&!s&&t<e||s&&o&&l&&!r&&!c||i&&o&&l||!n&&l||!a)return 1;if(!i&&!s&&!c&&e<t||c&&n&&a&&!i&&!s||r&&n&&a||!o&&a||!l)return-1}return 0}function wt(e,t,n){for(var i=-1,a=e.criteria,s=t.criteria,o=a.length,r=n.length;++i<o;){var l=$t(a[i],s[i]);if(l)return r<=i?l:l*("desc"==n[i]?-1:1)}return e.index-t.index}function kt(e,t,n,i){for(var a=-1,s=e.length,o=n.length,r=-1,l=t.length,c=Mr(s-o,0),d=Vo(l+c),u=!i;++r<l;)d[r]=t[r];for(;++a<o;)(u||a<s)&&(d[n[a]]=e[a]);for(;c--;)d[r++]=e[a++];return d}function Ct(e,t,n,i){for(var a=-1,s=e.length,o=-1,r=n.length,l=-1,c=t.length,d=Mr(s-r,0),u=Vo(d+c),_=!i;++a<d;)u[a]=e[a];for(var h=a;++l<c;)u[h+l]=t[l];for(;++o<r;)(_||a<s)&&(u[h+n[o]]=e[a++]);return u}function Et(e,t){var n=-1,i=e.length;for(t||(t=Vo(i));++n<i;)t[n]=e[n];return t}function Tt(e,t,n,i){var a=!n;n||(n={});for(var s=-1,o=t.length;++s<o;){var r=t[s],l=i?i(n[r],e[r],r,n,e):nu;l===nu&&(l=e[r]),a?z(n,r,l):L(n,r,l)}return n}function xt(e,t){return Tt(e,gl(e),t)}function It(e,t){return Tt(e,Al(e),t)}function Dt(a,s){return function(e,t){var n=dc(e)?cd:U,i=s?s():{};return n(e,a,un(t,2),i)}}function Ot(r){return We(function(e,t){var n=-1,i=t.length,a=1<i?t[i-1]:nu,s=2<i?t[2]:nu;for(a=3<r.length&&"function"==typeof a?(i--,a):nu,s&&Cn(t[0],t[1],s)&&(a=i<3?nu:a,i=1),e=er(e);++n<i;){var o=t[n];o&&r(e,o,n,a)}return e})}function St(s,o){return function(e,t){if(null==e)return e;if(!Ka(e))return s(e,t);for(var n=e.length,i=o?n:-1,a=er(e);(o?i--:++i<n)&&!1!==t(a[i],i,a););return e}}function Rt(l){return function(e,t,n){for(var i=-1,a=er(e),s=n(e),o=s.length;o--;){var r=s[l?o:++i];if(!1===t(a[r],r,a))break}return e}}function Bt(e,t,n){function i(){return(this&&this!==sh&&this instanceof i?s:e).apply(a?n:this,arguments)}var a=t&mu,s=Kt(e);return i}function Nt(a){return function(e){var t=Hd(e=As(e))?Zd(e):nu,n=t?t[0]:e.charAt(0),i=t?ft(t,1).join(""):e.slice(1);return n[a]()+i}}function Ft(t){return function(e){return Ad(go(Gs(e).replace(X_,"")),t,"")}}function Kt(i){return function(){var e=arguments;switch(e.length){case 0:return new i;case 1:return new i(e[0]);case 2:return new i(e[0],e[1]);case 3:return new i(e[0],e[1],e[2]);case 4:return new i(e[0],e[1],e[2],e[3]);case 5:return new i(e[0],e[1],e[2],e[3],e[4]);case 6:return new i(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new i(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=ol(i.prototype),n=i.apply(t,e);return Va(n)?n:t}}function Mt(s,o,r){function l(){for(var e=arguments.length,t=Vo(e),n=e,i=dn(l);n--;)t[n]=arguments[n];var a=e<3&&t[0]!==i&&t[e-1]!==i?[]:Yd(t,i);return(e-=a.length)<r?Vt(s,o,Pt,l.placeholder,nu,t,a,nu,nu,r-e):ld(this&&this!==sh&&this instanceof l?c:s,this,t)}var c=Kt(s);return l}function jt(o){return function(e,t,n){var i=er(e);if(!Ka(e)){var a=un(t,3);e=Os(e),t=function(e){return a(i[e],e,i)}}var s=o(e,t,n);return-1<s?i[a?e[s]:s]:nu}}function Lt(l){return on(function(a){var s=a.length,e=s,t=g.prototype.thru;for(l&&a.reverse();e--;){var n=a[e];if("function"!=typeof n)throw new ir(ou);if(t&&!o&&"wrapper"==cn(n))var o=new g([],!0)}for(e=o?e:s;++e<s;){var i=cn(n=a[e]),r="wrapper"==i?ml(n):nu;o=r&&xn(r[0])&&r[1]==(wu|vu|yu|ku)&&!r[4].length&&1==r[9]?o[cn(r[0])].apply(o,r[3]):1==n.length&&xn(n)?o[i]():o.thru(n)}return function(){var e=arguments,t=e[0];if(o&&1==e.length&&dc(t))return o.plant(t).value();for(var n=0,i=s?a[n].apply(this,e):t;++n<s;)i=a[n].call(this,i);return i}})}function Pt(l,c,d,u,_,h,p,f,m,g){function A(){for(var e=arguments.length,t=Vo(e),n=e;n--;)t[n]=arguments[n];if($)var i=dn(A),a=Ld(t,i);if(u&&(t=kt(t,u,_,$)),h&&(t=Ct(t,h,p,$)),e-=a,$&&e<g){var s=Yd(t,i);return Vt(l,c,Pt,A.placeholder,d,t,s,f,m,g-e)}var o=b?d:this,r=y?o[l]:l;return e=t.length,f?t=jn(t,f):w&&1<e&&t.reverse(),v&&m<e&&(t.length=m),this&&this!==sh&&this instanceof A&&(r=k||Kt(r)),r.apply(o,t)}var v=c&wu,b=c&mu,y=c&gu,$=c&(vu|bu),w=c&Cu,k=y?nu:Kt(l);return A}function Ut(n,i){return function(e,t){return fe(e,n,i(t),{})}}function Ht(i,a){return function(e,t){var n;if(e===nu&&t===nu)return a;if(e!==nu&&(n=e),t!==nu){if(n===nu)return t;"string"==typeof e||"string"==typeof t?(e=at(e),t=at(t)):(e=it(e),t=it(t)),n=i(e,t)}return n}}function Qt(i){return on(function(e){return e=md(e,Nd(un())),We(function(t){var n=this;return i(e,function(e){return ld(e,n,t)})})})}function zt(e,t){var n=(t=t===nu?" ":at(t)).length;if(n<2)return n?qe(t,e):t;var i=qe(t,Or(e/Jd(t)));return Hd(t)?ft(Zd(i),0,e).join(""):i.slice(0,e)}function qt(o,e,r,l){function c(){for(var e=-1,t=arguments.length,n=-1,i=l.length,a=Vo(i+t),s=this&&this!==sh&&this instanceof c?u:o;++n<i;)a[n]=l[n];for(;t--;)a[n++]=arguments[++e];return ld(s,d?r:this,a)}var d=e&mu,u=Kt(o);return c}function Wt(i){return function(e,t,n){return n&&"number"!=typeof n&&Cn(e,t,n)&&(t=n=nu),e=_s(e),t===nu?(t=e,e=0):t=_s(t),ze(e,t,n=n===nu?e<t?1:-1:_s(n),i)}}function Yt(n){return function(e,t){return"string"==typeof e&&"string"==typeof t||(e=fs(e),t=fs(t)),n(e,t)}}function Vt(e,t,n,i,a,s,o,r,l,c){var d=t&vu;t|=d?yu:$u,(t&=~(d?$u:yu))&Au||(t&=~(mu|gu));var u=[e,t,a,d?s:nu,d?o:nu,d?nu:s,d?nu:o,r,l,c],_=n.apply(nu,u);return xn(e)&&yl(_,u),_.placeholder=i,Pn(_,e,t)}function Gt(e){var i=Zo[e];return function(e,t){if(e=fs(e),(t=null==t?0:jr(hs(t),292))&&Nr(e)){var n=(As(e)+"e").split("e");return+((n=(As(i(n[0]+"e"+(+n[1]+t)))+"e").split("e"))[0]+"e"+(+n[1]-t))}return i(e)}}function Xt(n){return function(e){var t=vl(e);return t==Gu?qd(e):t==i_?Gd(e):Rd(e,n(e))}}function Jt(e,t,n,i,a,s,o,r){var l=t&gu;if(!l&&"function"!=typeof e)throw new ir(ou);var c=i?i.length:0;if(c||(t&=~(yu|$u),i=a=nu),o=o===nu?o:Mr(hs(o),0),r=r===nu?r:hs(r),c-=a?a.length:0,t&$u){var d=i,u=a;i=a=nu}var _=l?nu:ml(e),h=[e,t,n,i,a,d,u,s,o,r];if(_&&Bn(h,_),e=h[0],t=h[1],n=h[2],i=h[3],a=h[4],!(r=h[9]=h[9]===nu?l?0:e.length:Mr(h[9]-c,0))&&t&(vu|bu)&&(t&=~(vu|bu)),t&&t!=mu)p=t==vu||t==bu?Mt(e,t,r):t!=yu&&t!=(mu|yu)||a.length?Pt.apply(nu,h):qt(e,t,n,i);else var p=Bt(e,t,n);return Pn((_?ul:yl)(p,h),e,t)}function Zt(e,t,n,i){return e===nu||Fa(e,or[n])&&!cr.call(i,n)?t:e}function en(e,t,n,i,a,s){return Va(e)&&Va(t)&&(s.set(t,e),Ne(e,t,nu,en,s),s["delete"](t)),e}function tn(e){return as(e)?nu:e}function nn(e,t,n,i,a,s){var o=n&pu,r=e.length,l=t.length;if(r!=l&&!(o&&r<l))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var u=-1,_=!0,h=n&fu?new E:nu;for(s.set(e,t),s.set(t,e);++u<r;){var p=e[u],f=t[u];if(i)var m=o?i(f,p,u,t,e,s):i(p,f,u,e,t,s);if(m!==nu){if(m)continue;_=!1;break}if(h){if(!bd(t,function(e,t){if(!Kd(h,t)&&(p===e||a(p,e,n,i,s)))return h.push(t)})){_=!1;break}}else if(p!==f&&!a(p,f,n,i,s)){_=!1;break}}return s["delete"](e),s["delete"](t),_}function an(e,t,n,i,a,s,o){switch(n){case d_:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case c_:return!(e.byteLength!=t.byteLength||!s(new Ar(e),new Ar(t)));case Qu:case zu:case Xu:return Fa(+e,+t);case Wu:return e.name==t.name&&e.message==t.message;case n_:case a_:return e==t+"";case Gu:var r=qd;case i_:var l=i&pu;if(r||(r=Vd),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;i|=fu,o.set(e,t);var d=nn(r(e),r(t),i,a,s,o);return o["delete"](e),d;case s_:if(al)return al.call(e)==al.call(t)}return!1}function sn(e,t,n,i,a,s){var o=n&pu,r=rn(e),l=r.length;if(l!=rn(t).length&&!o)return!1;for(var c=l;c--;){var d=r[c];if(!(o?d in t:cr.call(t,d)))return!1}var u=s.get(e),_=s.get(t);if(u&&_)return u==t&&_==e;var h=!0;s.set(e,t),s.set(t,e);for(var p=o;++c<l;){var f=e[d=r[c]],m=t[d];if(i)var g=o?i(m,f,d,t,e,s):i(f,m,d,e,t,s);if(!(g===nu?f===m||a(f,m,n,i,s):g)){h=!1;break}p||(p="constructor"==d)}if(h&&!p){var A=e.constructor,v=t.constructor;A!=v&&"constructor"in e&&"constructor"in t&&!("function"==typeof A&&A instanceof A&&"function"==typeof v&&v instanceof v)&&(h=!1)}return s["delete"](e),s["delete"](t),h}function on(e){return wl(Kn(e,nu,ai),e+"")}function rn(e){return le(e,Os,gl)}function ln(e){return le(e,Ss,Al)}function cn(e){for(var t=e.name+"",n=Xr[t],i=cr.call(Xr,t)?n.length:0;i--;){var a=n[i],s=a.func;if(null==s||s==e)return a.name}return t}function dn(e){return(cr.call(m,"placeholder")?m:e).placeholder}function un(e,t){var n=m.iteratee||wo;return n=n===wo?xe:n,arguments.length?n(e,t):n}function _n(e,t){var n=e.__data__;return Tn(t)?n["string"==typeof t?"string":"hash"]:n.map}function hn(e){for(var t=Os(e),n=t.length;n--;){var i=t[n],a=e[i];t[n]=[i,a,On(a)]}return t}function pn(e,t){var n=Ud(e,t);return ke(n)?n:nu}function fn(e){var t=cr.call(e,Er),n=e[Er];try{e[Er]=nu;var i=!0}catch(s){}var a=_r.call(e);return i&&(t?e[Er]=n:delete e[Er]),a}function mn(e,t,n){for(var i=-1,a=n.length;++i<a;){var s=n[i],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=jr(t,e+o);break;case"takeRight":e=Mr(e,t-o)}}return{start:e,end:t}}function gn(e){var t=e.match(K_);return t?t[1].split(M_):[]}function An(e,t,n){for(var i=-1,a=(t=pt(t,e)).length,s=!1;++i<a;){var o=Qn(t[i]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++i!=a?s:!!(a=null==e?0:e.length)&&Ya(a)&&kn(o,a)&&(dc(e)||cc(e))}function vn(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&cr.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function bn(e){return"function"!=typeof e.constructor||Dn(e)?{}:ol(br(e))}function yn(e,t,n){var i=e.constructor;switch(t){case c_:return gt(e);case Qu:case zu:return new i(+e);case d_:return At(e,n);case u_:case __:case h_:case p_:case f_:case m_:case g_:case A_:case v_:return yt(e,n);case Gu:return new i;case Xu:case a_:return new i(e);case n_:return vt(e);case i_:return new i;case s_:return bt(e)}}function $n(e,t){var n=t.length;if(!n)return e;var i=n-1;return t[i]=(1<n?"& ":"")+t[i],t=t.join(2<n?", ":" "),e.replace(F_,"{\n/* [wrapped with "+t+"] */\n")}function wn(e){return dc(e)||cc(e)||!!(kr&&e&&e[kr])}function kn(e,t){var n=typeof e;return!!(t=null==t?Bu:t)&&("number"==n||"symbol"!=n&&W_.test(e))&&-1<e&&e%1==0&&e<t}function Cn(e,t,n){if(!Va(n))return!1;var i=typeof t;return!!("number"==i?Ka(n)&&kn(t,n.length):"string"==i&&t in n)&&Fa(n[t],e)}function En(e,t){if(dc(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!rs(e))||(O_.test(e)||!D_.test(e)||null!=t&&e in er(t))}function Tn(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function xn(e){var t=cn(e),n=m[t];if("function"!=typeof n||!(t in A.prototype))return!1;if(e===n)return!0;var i=ml(n);return!!i&&e===i[0]}function In(e){return!!ur&&ur in e}function Dn(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||or)}function On(e){return e==e&&!Va(e)}function Sn(t,n){return function(e){return null!=e&&(e[t]===n&&(n!==nu||t in er(e)))}}function Rn(e){var t=$a(e,function(e){return n.size===cu&&n.clear(),e}),n=t.cache;return t}function Bn(e,t){var n=e[1],i=t[1],a=n|i,s=a<(mu|gu|wu),o=i==wu&&n==vu||i==wu&&n==ku&&e[7].length<=t[8]||i==(wu|ku)&&t[7].length<=t[8]&&n==vu;if(!s&&!o)return e;i&mu&&(e[2]=t[2],a|=n&mu?0:Au);var r=t[3];if(r){var l=e[3];e[3]=l?kt(l,r,t[4]):r,e[4]=l?Yd(e[3],du):t[4]}return(r=t[5])&&(l=e[5],e[5]=l?Ct(l,r,t[6]):r,e[6]=l?Yd(e[5],du):t[6]),(r=t[7])&&(e[7]=r),i&wu&&(e[8]=null==e[8]?t[8]:jr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=a,e}function Nn(e){var t=[];if(null!=e)for(var n in er(e))t.push(n);return t}function Fn(e){return _r.call(e)}function Kn(s,o,r){return o=Mr(o===nu?s.length-1:o,0),function(){for(var e=arguments,t=-1,n=Mr(e.length-o,0),i=Vo(n);++t<n;)i[t]=e[o+t];t=-1;for(var a=Vo(o+1);++t<o;)a[t]=e[t];return a[o]=r(i),ld(s,this,a)}}function Mn(e,t){return t.length<2?e:re(e,Je(t,0,-1))}function jn(e,t){for(var n=e.length,i=jr(t.length,n),a=Et(e);i--;){var s=t[i];e[i]=kn(s,n)?a[s]:nu}return e}function Ln(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Pn(e,t,n){var i=t+"";return wl(e,$n(i,qn(gn(i),n)))}function Un(i){var a=0,s=0;return function(e){var t=Lr(),n=Iu-(t-s);if(s=t,0<n){if(++a>=xu)return e}else a=0;return i.apply(nu,arguments)}}function Hn(e,t){var n=-1,i=e.length,a=i-1;for(t=t===nu?i:t;++n<t;){var s=Qe(n,a),o=e[s];e[s]=e[n],e[n]=o}return e.length=t,e}function Qn(e){if("string"==typeof e||rs(e))return e;var t=e+"";return"0"==t&&1/e==-Ru?"-0":t}function zn(e){if(null!=e){try{return lr.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function qn(n,i){return dd(Lu,function(e){var t="_."+e[0];i&e[1]&&!pd(n,t)&&n.push(t)}),n.sort()}function Wn(e){if(e instanceof A)return e.clone();var t=new g(e.__wrapped__,e.__chain__);return t.__actions__=Et(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Yn(e,t,n){t=(n?Cn(e,t,n):t===nu)?1:Mr(hs(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var a=0,s=0,o=Vo(Or(i/t));a<i;)o[s++]=Je(e,a,a+=t);return o}function Vn(e){for(var t=-1,n=null==e?0:e.length,i=0,a=[];++t<n;){var s=e[t];s&&(a[i++]=s)}return a}function Gn(e){var t=arguments.length;if(!t)return[];for(var n=Vo(t-1),i=e,a=t;a--;)n[a-1]=arguments[a];return gd(dc(i)?Et(i):[i],ie(n,1))}function Xn(e,t,n){var i=null==e?0:e.length;return i?Je(e,(t=n||t===nu?1:hs(t))<0?0:t,i):[]}function Jn(e,t,n){var i=null==e?0:e.length;return i?Je(e,0,(t=i-(t=n||t===nu?1:hs(t)))<0?0:t):[]}function Zn(e,t){return e&&e.length?lt(e,un(t,3),!0,!0):[]}function ei(e,t){return e&&e.length?lt(e,un(t,3),!0):[]}function ti(e,t,n,i){var a=null==e?0:e.length;return a?(n&&"number"!=typeof n&&Cn(e,t,n)&&(n=0,i=a),te(e,t,n,i)):[]}function ni(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var a=null==n?0:hs(n);return a<0&&(a=Mr(i+a,0)),wd(e,un(t,3),a)}function ii(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var a=i-1;return n!==nu&&(a=hs(n),a=n<0?Mr(i+a,0):jr(a,i-1)),wd(e,un(t,3),a,!0)}function ai(e){return(null==e?0:e.length)?ie(e,1):[]}function si(e){return(null==e?0:e.length)?ie(e,Ru):[]}function oi(e,t){return(null==e?0:e.length)?ie(e,t=t===nu?1:hs(t)):[]}function ri(e){for(var t=-1,n=null==e?0:e.length,i={};++t<n;){var a=e[t];i[a[0]]=a[1]}return i}function li(e){return e&&e.length?e[0]:nu}function ci(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var a=null==n?0:hs(n);return a<0&&(a=Mr(i+a,0)),kd(e,t,a)}function di(e){return(null==e?0:e.length)?Je(e,0,-1):[]}function ui(e,t){return null==e?"":Fr.call(e,t)}function _i(e){var t=null==e?0:e.length;return t?e[t-1]:nu}function hi(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var a=i;return n!==nu&&(a=(a=hs(n))<0?Mr(i+a,0):jr(a,i-1)),t==t?Xd(e,t,a):wd(e,Ed,a,!0)}function pi(e,t){return e&&e.length?Ke(e,hs(t)):nu}function fi(e,t){return e&&e.length&&t&&t.length?Ue(e,t):e}function mi(e,t,n){return e&&e.length&&t&&t.length?Ue(e,t,un(n,2)):e}function gi(e,t,n){return e&&e.length&&t&&t.length?Ue(e,t,nu,n):e}function Ai(e,t){var n=[];if(!e||!e.length)return n;var i=-1,a=[],s=e.length;for(t=un(t,3);++i<s;){var o=e[i];t(o,i,e)&&(n.push(o),a.push(i))}return He(e,a),n}function vi(e){return null==e?e:Hr.call(e)}function bi(e,t,n){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&Cn(e,t,n)?(t=0,n=i):(t=null==t?0:hs(t),n=n===nu?i:hs(n)),Je(e,t,n)):[]}function yi(e,t){return et(e,t)}function $i(e,t,n){return tt(e,t,un(n,2))}function wi(e,t){var n=null==e?0:e.length;if(n){var i=et(e,t);if(i<n&&Fa(e[i],t))return i}return-1}function ki(e,t){return et(e,t,!0)}function Ci(e,t,n){return tt(e,t,un(n,2),!0)}function Ei(e,t){if(null==e?0:e.length){var n=et(e,t,!0)-1;if(Fa(e[n],t))return n}return-1}function Ti(e){return e&&e.length?nt(e):[]}function xi(e,t){return e&&e.length?nt(e,un(t,2)):[]}function Ii(e){var t=null==e?0:e.length;return t?Je(e,1,t):[]}function Di(e,t,n){return e&&e.length?Je(e,0,(t=n||t===nu?1:hs(t))<0?0:t):[]}function Oi(e,t,n){var i=null==e?0:e.length;return i?Je(e,(t=i-(t=n||t===nu?1:hs(t)))<0?0:t,i):[]}function Si(e,t){return e&&e.length?lt(e,un(t,3),!1,!0):[]}function Ri(e,t){return e&&e.length?lt(e,un(t,3)):[]}function Bi(e){return e&&e.length?st(e):[]}function Ni(e,t){return e&&e.length?st(e,un(t,2)):[]}function Fi(e,t){return t="function"==typeof t?t:nu,e&&e.length?st(e,nu,t):[]}function Ki(t){if(!t||!t.length)return[];var n=0;return t=hd(t,function(e){if(Ma(e))return n=Mr(e.length,n),!0}),Sd(n,function(e){return md(t,xd(e))})}function Mi(e,t){if(!e||!e.length)return[];var n=Ki(e);return null==t?n:md(n,function(e){return ld(t,nu,e)})}function ji(e,t){return ut(e||[],t||[],L)}function Li(e,t){return ut(e||[],t||[],Ge)}function Pi(e){var t=m(e);return t.__chain__=!0,t}function Ui(e,t){return t(e),e}function Hi(e,t){return t(e)}function Qi(){return Pi(this)}function zi(){return new g(this.value(),this.__chain__)}function qi(){this.__values__===nu&&(this.__values__=us(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?nu:this.__values__[this.__index__++]}}function Wi(){return this}function Yi(e){for(var t,n=this;n instanceof s;){var i=Wn(n);i.__index__=0,i.__values__=nu,t?a.__wrapped__=i:t=i;var a=i;n=n.__wrapped__}return a.__wrapped__=e,t}function Vi(){var e=this.__wrapped__;if(e instanceof A){var t=e;return this.__actions__.length&&(t=new A(this)),(t=t.reverse()).__actions__.push({func:Hi,args:[vi],thisArg:nu}),new g(t,this.__chain__)}return this.thru(vi)}function Gi(){return ct(this.__wrapped__,this.__actions__)}function Xi(e,t,n){var i=dc(e)?_d:Z;return n&&Cn(e,t,n)&&(t=nu),i(e,un(t,3))}function Ji(e,t){return(dc(e)?hd:ne)(e,un(t,3))}function Zi(e,t){return ie(sa(e,t),1)}function ea(e,t){return ie(sa(e,t),Ru)}function ta(e,t,n){return n=n===nu?1:hs(n),ie(sa(e,t),n)}function na(e,t){return(dc(e)?dd:rl)(e,un(t,3))}function ia(e,t){return(dc(e)?ud:ll)(e,un(t,3))}function aa(e,t,n,i){e=Ka(e)?e:Qs(e),n=n&&!i?hs(n):0;var a=e.length;return n<0&&(n=Mr(a+n,0)),os(e)?n<=a&&-1<e.indexOf(t,n):!!a&&-1<kd(e,t,n)}function sa(e,t){return(dc(e)?md:Se)(e,un(t,3))}function oa(e,t,n,i){return null==e?[]:(dc(t)||(t=null==t?[]:[t]),dc(n=i?nu:n)||(n=null==n?[]:[n]),Me(e,t,n))}function ra(e,t,n){var i=dc(e)?Ad:Id,a=arguments.length<3;return i(e,un(t,4),n,a,rl)}function la(e,t,n){var i=dc(e)?vd:Id,a=arguments.length<3;return i(e,un(t,4),n,a,ll)}function ca(e,t){return(dc(e)?hd:ne)(e,wa(un(t,3)))}function da(e){return(dc(e)?F:Ye)(e)}function ua(e,t,n){return t=(n?Cn(e,t,n):t===nu)?1:hs(t),(dc(e)?K:Ve)(e,t)}function _a(e){return(dc(e)?M:Xe)(e)}function ha(e){if(null==e)return 0;if(Ka(e))return os(e)?Jd(e):e.length;var t=vl(e);return t==Gu||t==i_?e.size:Ie(e).length}function pa(e,t,n){var i=dc(e)?bd:Ze;return n&&Cn(e,t,n)&&(t=nu),i(e,un(t,3))}function fa(e,t){if("function"!=typeof t)throw new ir(ou);return e=hs(e),function(){if(--e<1)return t.apply(this,arguments)}}function ma(e,t,n){return t=n?nu:t,t=e&&null==t?e.length:t,Jt(e,wu,nu,nu,nu,nu,t)}function ga(e,t){var n;if("function"!=typeof t)throw new ir(ou);return e=hs(e),function(){return 0<--e&&(n=t.apply(this,arguments)),e<=1&&(t=nu),n}}function Aa(e,t,n){var i=Jt(e,vu,nu,nu,nu,nu,nu,t=n?nu:t);return i.placeholder=Aa.placeholder,i}function va(e,t,n){var i=Jt(e,bu,nu,nu,nu,nu,nu,t=n?nu:t);return i.placeholder=va.placeholder,i}function ba(i,n,e){function a(e){var t=_,n=h;return _=h=nu,A=e,f=i.apply(n,t)}function s(e){return A=e,m=$l(r,n),v?a(e):f}function t(e){var t=n-(e-g);return b?jr(t,p-(e-A)):t}function o(e){var t=e-g;return g===nu||n<=t||t<0||b&&p<=e-A}function r(){var e=Xl();if(o(e))return l(e);m=$l(r,t(e))}function l(e){return m=nu,y&&_?a(e):(_=h=nu,f)}function c(){m!==nu&&pl(m),A=0,_=g=h=m=nu}function d(){return m===nu?f:l(Xl())}function u(){var e=Xl(),t=o(e);if(_=arguments,h=this,g=e,t){if(m===nu)return s(g);if(b)return pl(m),m=$l(r,n),a(g)}return m===nu&&(m=$l(r,n)),f}var _,h,p,f,m,g,A=0,v=!1,b=!1,y=!0;if("function"!=typeof i)throw new ir(ou);return n=fs(n)||0,Va(e)&&(v=!!e.leading,p=(b="maxWait"in e)?Mr(fs(e.maxWait)||0,n):p,y="trailing"in e?!!e.trailing:y),u.cancel=c,u.flush=d,u}function ya(e){return Jt(e,Cu)}function $a(a,s){if("function"!=typeof a||null!=s&&"function"!=typeof s)throw new ir(ou);var o=function(){var e=arguments,t=s?s.apply(this,e):e[0],n=o.cache;if(n.has(t))return n.get(t);var i=a.apply(this,e);return o.cache=n.set(t,i)||n,i};return o.cache=new($a.Cache||b),o}function wa(t){if("function"!=typeof t)throw new ir(ou);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}
function ka(e){return ga(2,e)}function Ca(e,t){if("function"!=typeof e)throw new ir(ou);return We(e,t=t===nu?t:hs(t))}function Ea(i,a){if("function"!=typeof i)throw new ir(ou);return a=null==a?0:Mr(hs(a),0),We(function(e){var t=e[a],n=ft(e,0,a);return t&&gd(n,t),ld(i,this,n)})}function Ta(e,t,n){var i=!0,a=!0;if("function"!=typeof e)throw new ir(ou);return Va(n)&&(i="leading"in n?!!n.leading:i,a="trailing"in n?!!n.trailing:a),ba(e,t,{leading:i,maxWait:t,trailing:a})}function xa(e){return ma(e,1)}function Ia(e,t){return ac(ht(t),e)}function Da(e){if(!arguments.length)return[];var t=e;return dc(t)?t:[t]}function Oa(e){return Y(e,hu)}function Sa(e,t){return Y(e,hu,t="function"==typeof t?t:nu)}function Ra(e){return Y(e,uu|hu)}function Ba(e,t){return Y(e,uu|hu,t="function"==typeof t?t:nu)}function Na(e,t){return null==t||G(e,t,Os(t))}function Fa(e,t){return e===t||e!=e&&t!=t}function Ka(e){return null!=e&&Ya(e.length)&&!qa(e)}function Ma(e){return Ga(e)&&Ka(e)}function ja(e){return!0===e||!1===e||Ga(e)&&ce(e)==Qu}function La(e){return Ga(e)&&1===e.nodeType&&!as(e)}function Pa(e){if(null==e)return!0;if(Ka(e)&&(dc(e)||"string"==typeof e||"function"==typeof e.splice||_c(e)||gc(e)||cc(e)))return!e.length;var t=vl(e);if(t==Gu||t==i_)return!e.size;if(Dn(e))return!Ie(e).length;for(var n in e)if(cr.call(e,n))return!1;return!0}function Ua(e,t){return be(e,t)}function Ha(e,t,n){var i=(n="function"==typeof n?n:nu)?n(e,t):nu;return i===nu?be(e,t,nu,n):!!i}function Qa(e){if(!Ga(e))return!1;var t=ce(e);return t==Wu||t==qu||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function za(e){return"number"==typeof e&&Nr(e)}function qa(e){if(!Va(e))return!1;var t=ce(e);return t==Yu||t==Vu||t==Hu||t==t_}function Wa(e){return"number"==typeof e&&e==hs(e)}function Ya(e){return"number"==typeof e&&-1<e&&e%1==0&&e<=Bu}function Va(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ga(e){return null!=e&&"object"==typeof e}function Xa(e,t){return e===t||we(e,t,hn(t))}function Ja(e,t,n){return n="function"==typeof n?n:nu,we(e,t,hn(t),n)}function Za(e){return is(e)&&e!=+e}function es(e){if(bl(e))throw new Xo(su);return ke(e)}function ts(e){return null===e}function ns(e){return null==e}function is(e){return"number"==typeof e||Ga(e)&&ce(e)==Xu}function as(e){if(!Ga(e)||ce(e)!=Zu)return!1;var t=br(e);if(null===t)return!0;var n=cr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&lr.call(n)==hr}function ss(e){return Wa(e)&&-Bu<=e&&e<=Bu}function os(e){return"string"==typeof e||!dc(e)&&Ga(e)&&ce(e)==a_}function rs(e){return"symbol"==typeof e||Ga(e)&&ce(e)==s_}function ls(e){return e===nu}function cs(e){return Ga(e)&&vl(e)==r_}function ds(e){return Ga(e)&&ce(e)==l_}function us(e){if(!e)return[];if(Ka(e))return os(e)?Zd(e):Et(e);if(Cr&&e[Cr])return zd(e[Cr]());var t=vl(e);return(t==Gu?qd:t==i_?Vd:Qs)(e)}function _s(e){return e?(e=fs(e))!==Ru&&e!==-Ru?e==e?e:0:(e<0?-1:1)*Nu:0===e?e:0}function hs(e){var t=_s(e),n=t%1;return t==t?n?t-n:t:0}function ps(e){return e?W(hs(e),0,Ku):0}function fs(e){if("number"==typeof e)return e;if(rs(e))return Fu;if(Va(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Va(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Bd(e);var n=Q_.test(e);return n||q_.test(e)?ah(e.slice(2),n?2:8):H_.test(e)?Fu:+e}function ms(e){return Tt(e,Ss(e))}function gs(e){return e?W(hs(e),-Bu,Bu):0===e?e:0}function As(e){return null==e?"":at(e)}function vs(e,t){var n=ol(e);return null==t?n:H(n,t)}function bs(e,t){return $d(e,un(t,3),ae)}function ys(e,t){return $d(e,un(t,3),se)}function $s(e,t){return null==e?e:cl(e,un(t,3),Ss)}function ws(e,t){return null==e?e:dl(e,un(t,3),Ss)}function ks(e,t){return e&&ae(e,un(t,3))}function Cs(e,t){return e&&se(e,un(t,3))}function Es(e){return null==e?[]:oe(e,Os(e))}function Ts(e){return null==e?[]:oe(e,Ss(e))}function xs(e,t,n){var i=null==e?nu:re(e,t);return i===nu?n:i}function Is(e,t){return null!=e&&An(e,t,ue)}function Ds(e,t){return null!=e&&An(e,t,_e)}function Os(e){return Ka(e)?N(e):Ie(e)}function Ss(e){return Ka(e)?N(e,!0):De(e)}function Rs(e,i){var a={};return i=un(i,3),ae(e,function(e,t,n){z(a,i(e,t,n),e)}),a}function Bs(e,i){var a={};return i=un(i,3),ae(e,function(e,t,n){z(a,t,i(e,t,n))}),a}function Ns(e,t){return Fs(e,wa(un(t)))}function Fs(e,n){if(null==e)return{};var t=md(ln(e),function(e){return[e]});return n=un(n),Le(e,t,function(e,t){return n(e,t[0])})}function Ks(e,t,n){var i=-1,a=(t=pt(t,e)).length;for(a||(a=1,e=nu);++i<a;){var s=null==e?nu:e[Qn(t[i])];s===nu&&(i=a,s=n),e=qa(s)?s.call(e):s}return e}function Ms(e,t,n){return null==e?e:Ge(e,t,n)}function js(e,t,n,i){return i="function"==typeof i?i:nu,null==e?e:Ge(e,t,n,i)}function Ls(e,i,a){var t=dc(e),n=t||_c(e)||gc(e);if(i=un(i,4),null==a){var s=e&&e.constructor;a=n?t?new s:[]:Va(e)&&qa(s)?ol(br(e)):{}}return(n?dd:ae)(e,function(e,t,n){return i(a,e,t,n)}),a}function Ps(e,t){return null==e||ot(e,t)}function Us(e,t,n){return null==e?e:rt(e,t,ht(n))}function Hs(e,t,n,i){return i="function"==typeof i?i:nu,null==e?e:rt(e,t,ht(n),i)}function Qs(e){return null==e?[]:Fd(e,Os(e))}function zs(e){return null==e?[]:Fd(e,Ss(e))}function qs(e,t,n){return n===nu&&(n=t,t=nu),n!==nu&&(n=(n=fs(n))==n?n:0),t!==nu&&(t=(t=fs(t))==t?t:0),W(fs(e),t,n)}function Ws(e,t,n){return t=_s(t),n===nu?(n=t,t=0):n=_s(n),he(e=fs(e),t,n)}function Ys(e,t,n){if(n&&"boolean"!=typeof n&&Cn(e,t,n)&&(t=n=nu),n===nu&&("boolean"==typeof t?(n=t,t=nu):"boolean"==typeof e&&(n=e,e=nu)),e===nu&&t===nu?(e=0,t=1):(e=_s(e),t===nu?(t=e,e=0):t=_s(t)),t<e){var i=e;e=t,t=i}if(n||e%1||t%1){var a=Ur();return jr(e+a*(t-e+ih("1e-"+((a+"").length-1))),t)}return Qe(e,t)}function Vs(e){return Hc(As(e).toLowerCase())}function Gs(e){return(e=As(e))&&e.replace(Y_,hh).replace(J_,"")}function Xs(e,t,n){e=As(e),t=at(t);var i=e.length,a=n=n===nu?i:W(hs(n),0,i);return 0<=(n-=t.length)&&e.slice(n,a)==t}function Js(e){return(e=As(e))&&E_.test(e)?e.replace(k_,ph):e}function Zs(e){return(e=As(e))&&B_.test(e)?e.replace(R_,"\\$&"):e}function eo(e,t,n){e=As(e);var i=(t=hs(t))?Jd(e):0;if(!t||t<=i)return e;var a=(t-i)/2;return zt(Sr(a),n)+e+zt(Or(a),n)}function to(e,t,n){e=As(e);var i=(t=hs(t))?Jd(e):0;return t&&i<t?e+zt(t-i,n):e}function no(e,t,n){e=As(e);var i=(t=hs(t))?Jd(e):0;return t&&i<t?zt(t-i,n)+e:e}function io(e,t,n){return n||null==t?t=0:t&&(t=+t),Pr(As(e).replace(N_,""),t||0)}function ao(e,t,n){return t=(n?Cn(e,t,n):t===nu)?1:hs(t),qe(As(e),t)}function so(){var e=arguments,t=As(e[0]);return e.length<3?t:t.replace(e[1],e[2])}function oo(e,t,n){return n&&"number"!=typeof n&&Cn(e,t,n)&&(t=n=nu),(n=n===nu?Ku:n>>>0)?(e=As(e))&&("string"==typeof t||null!=t&&!fc(t))&&!(t=at(t))&&Hd(e)?ft(Zd(e),0,n):e.split(t,n):[]}function ro(e,t,n){return e=As(e),n=null==n?0:W(hs(n),0,e.length),t=at(t),e.slice(n,n+t.length)==t}function lo(o,e,t){var n=m.templateSettings;t&&Cn(o,e,t)&&(e=nu),o=As(o),e=$c({},e,n,Zt);var r,l,i=$c({},e.imports,n.imports,Zt),a=Os(i),s=Fd(i,a),c=0,d=e.interpolate||V_,u="__p += '",_=tr((e.escape||V_).source+"|"+d.source+"|"+(d===I_?P_:V_).source+"|"+(e.evaluate||V_).source+"|$","g"),h="//# sourceURL="+(cr.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++eh+"]")+"\n";o.replace(_,function(e,t,n,i,a,s){return n||(n=i),u+=o.slice(c,s).replace(G_,Pd),t&&(r=!0,u+="' +\n__e("+t+") +\n'"),a&&(l=!0,u+="';\n"+a+";\n__p += '"),n&&(u+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=s+e.length,e}),u+="';\n";var p=cr.call(e,"variable")&&e.variable;if(p){if(j_.test(p))throw new Xo(ru)}else u="with (obj) {\n"+u+"\n}\n";u=(l?u.replace(b_,""):u).replace(y_,"$1").replace($_,"$1;"),u="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+u+"return __p\n}";var f=Qc(function(){return Jo(a,h+"return "+u).apply(nu,s)});if(f.source=u,Qa(f))throw f;return f}function co(e){return As(e).toLowerCase()}function uo(e){return As(e).toUpperCase()}function _o(e,t,n){if((e=As(e))&&(n||t===nu))return Bd(e);if(!e||!(t=at(t)))return e;var i=Zd(e),a=Zd(t);return ft(i,Md(i,a),jd(i,a)+1).join("")}function ho(e,t,n){if((e=As(e))&&(n||t===nu))return e.slice(0,eu(e)+1);if(!e||!(t=at(t)))return e;var i=Zd(e);return ft(i,0,jd(i,Zd(t))+1).join("")}function po(e,t,n){if((e=As(e))&&(n||t===nu))return e.replace(N_,"");if(!e||!(t=at(t)))return e;var i=Zd(e);return ft(i,Md(i,Zd(t))).join("")}function fo(e,t){var n=Eu,i=Tu;if(Va(t)){var a="separator"in t?t.separator:a;n="length"in t?hs(t.length):n,i="omission"in t?at(t.omission):i}var s=(e=As(e)).length;if(Hd(e)){var o=Zd(e);s=o.length}if(s<=n)return e;var r=n-Jd(i);if(r<1)return i;var l=o?ft(o,0,r).join(""):e.slice(0,r);if(a===nu)return l+i;if(o&&(r+=l.length-r),fc(a)){if(e.slice(r).search(a)){var c,d=l;for(a.global||(a=tr(a.source,As(U_.exec(a))+"g")),a.lastIndex=0;c=a.exec(d);)var u=c.index;l=l.slice(0,u===nu?r:u)}}else if(e.indexOf(at(a),r)!=r){var _=l.lastIndexOf(a);-1<_&&(l=l.slice(0,_))}return l+i}function mo(e){return(e=As(e))&&C_.test(e)?e.replace(w_,fh):e}function go(e,t,n){return e=As(e),(t=n?nu:t)===nu?Qd(e)?tu(e):yd(e):e.match(t)||[]}function Ao(i){var a=null==i?0:i.length,t=un();return i=a?md(i,function(e){if("function"!=typeof e[1])throw new ir(ou);return[t(e[0]),e[1]]}):[],We(function(e){for(var t=-1;++t<a;){var n=i[t];if(ld(n[0],this,e))return ld(n[1],this,e)}})}function vo(e){return V(Y(e,uu))}function bo(e){return function(){return e}}function yo(e,t){return null==e||e!=e?t:e}function $o(e){return e}function wo(e){return xe("function"==typeof e?e:Y(e,uu))}function ko(e){return Re(Y(e,uu))}function Co(e,t){return Be(e,Y(t,uu))}function Eo(i,t,e){var n=Os(t),a=oe(t,n);null!=e||Va(t)&&(a.length||!n.length)||(e=t,t=i,i=this,a=oe(t,Os(t)));var s=!(Va(e)&&"chain"in e&&!e.chain),o=qa(i);return dd(a,function(e){var n=t[e];i[e]=n,o&&(i.prototype[e]=function(){var e=this.__chain__;if(s||e){var t=i(this.__wrapped__);return(t.__actions__=Et(this.__actions__)).push({func:n,args:arguments,thisArg:i}),t.__chain__=e,t}return n.apply(i,gd([this.value()],arguments))})}),i}function To(){return sh._===this&&(sh._=pr),this}function xo(){}function Io(t){return t=hs(t),We(function(e){return Ke(e,t)})}function Do(e){return En(e)?xd(Qn(e)):Pe(e)}function Oo(t){return function(e){return null==t?nu:re(t,e)}}function So(){return[]}function Ro(){return!1}function Bo(){return{}}function No(){return""}function Fo(){return!0}function Ko(e,t){if((e=hs(e))<1||Bu<e)return[];var n=Ku,i=jr(e,Ku);t=un(t),e-=Ku;for(var a=Sd(i,t);++n<e;)t(n);return a}function Mo(e){return dc(e)?md(e,Qn):rs(e)?[e]:Et(kl(As(e)))}function jo(e){var t=++dr;return As(e)+t}function Lo(e){return e&&e.length?ee(e,$o,de):nu}function Po(e,t){return e&&e.length?ee(e,un(t,2),de):nu}function Uo(e){return Td(e,$o)}function Ho(e,t){return Td(e,un(t,2))}function Qo(e){return e&&e.length?ee(e,$o,Oe):nu}function zo(e,t){return e&&e.length?ee(e,un(t,2),Oe):nu}function qo(e){return e&&e.length?Od(e,$o):0}function Wo(e,t){return e&&e.length?Od(e,un(t,2)):0}var Yo,Vo=(e=null==e?sh:gh.defaults(sh.Object(),e,gh.pick(sh,Z_))).Array,Go=e.Date,Xo=e.Error,Jo=e.Function,Zo=e.Math,er=e.Object,tr=e.RegExp,nr=e.String,ir=e.TypeError,ar=Vo.prototype,sr=Jo.prototype,or=er.prototype,rr=e["__core-js_shared__"],lr=sr.toString,cr=or.hasOwnProperty,dr=0,ur=(Yo=/[^.]+$/.exec(rr&&rr.keys&&rr.keys.IE_PROTO||""))?"Symbol(src)_1."+Yo:"",_r=or.toString,hr=lr.call(er),pr=sh._,fr=tr("^"+lr.call(cr).replace(R_,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mr=oh?e.Buffer:nu,gr=e.Symbol,Ar=e.Uint8Array,vr=mr?mr.allocUnsafe:nu,br=Wd(er.getPrototypeOf,er),yr=er.create,$r=or.propertyIsEnumerable,wr=ar.splice,kr=gr?gr.isConcatSpreadable:nu,Cr=gr?gr.iterator:nu,Er=gr?gr.toStringTag:nu,Tr=function(){try{var e=pn(er,"defineProperty");return e({},"",{}),e}catch(t){}}(),xr=e.clearTimeout!==sh.clearTimeout&&e.clearTimeout,Ir=Go&&Go.now!==sh.Date.now&&Go.now,Dr=e.setTimeout!==sh.setTimeout&&e.setTimeout,Or=Zo.ceil,Sr=Zo.floor,Rr=er.getOwnPropertySymbols,Br=mr?mr.isBuffer:nu,Nr=e.isFinite,Fr=ar.join,Kr=Wd(er.keys,er),Mr=Zo.max,jr=Zo.min,Lr=Go.now,Pr=e.parseInt,Ur=Zo.random,Hr=ar.reverse,Qr=pn(e,"DataView"),zr=pn(e,"Map"),qr=pn(e,"Promise"),Wr=pn(e,"Set"),Yr=pn(e,"WeakMap"),Vr=pn(er,"create"),Gr=Yr&&new Yr,Xr={},Jr=zn(Qr),Zr=zn(zr),el=zn(qr),tl=zn(Wr),nl=zn(Yr),il=gr?gr.prototype:nu,al=il?il.valueOf:nu,sl=il?il.toString:nu,ol=function(){function n(){}return function(e){if(!Va(e))return{};if(yr)return yr(e);n.prototype=e;var t=new n;return n.prototype=nu,t}}();m.templateSettings={escape:T_,evaluate:x_,interpolate:I_,variable:"",imports:{_:m}},m.prototype=s.prototype,m.prototype.constructor=m,g.prototype=ol(s.prototype),g.prototype.constructor=g,A.prototype=ol(s.prototype),A.prototype.constructor=A,a.prototype.clear=o,a.prototype["delete"]=r,a.prototype.get=l,a.prototype.has=c,a.prototype.set=d,u.prototype.clear=_,u.prototype["delete"]=h,u.prototype.get=p,u.prototype.has=f,u.prototype.set=v,b.prototype.clear=y,b.prototype["delete"]=$,b.prototype.get=w,b.prototype.has=k,b.prototype.set=C,E.prototype.add=E.prototype.push=T,E.prototype.has=x,I.prototype.clear=D,I.prototype["delete"]=O,I.prototype.get=S,I.prototype.has=R,I.prototype.set=B;var rl=St(ae),ll=St(se,!0),cl=Rt(),dl=Rt(!0),ul=Gr?function(e,t){return Gr.set(e,t),e}:$o,_l=Tr?function(e,t){return Tr(e,"toString",{configurable:!0,enumerable:!1,value:bo(t),writable:!0})}:$o,hl=We,pl=xr||function(e){return sh.clearTimeout(e)},fl=Wr&&1/Vd(new Wr([,-0]))[1]==Ru?function(e){return new Wr(e)}:xo,ml=Gr?function(e){return Gr.get(e)}:xo,gl=Rr?function(t){return null==t?[]:(t=er(t),hd(Rr(t),function(e){return $r.call(t,e)}))}:So,Al=Rr?function(e){for(var t=[];e;)gd(t,gl(e)),e=br(e);return t}:So,vl=ce;(Qr&&vl(new Qr(new ArrayBuffer(1)))!=d_||zr&&vl(new zr)!=Gu||qr&&vl(qr.resolve())!=e_||Wr&&vl(new Wr)!=i_||Yr&&vl(new Yr)!=r_)&&(vl=function(e){var t=ce(e),n=t==Zu?e.constructor:nu,i=n?zn(n):"";if(i)switch(i){case Jr:return d_;case Zr:return Gu;case el:return e_;case tl:return i_;case nl:return r_}return t});var bl=rr?qa:Ro,yl=Un(ul),$l=Dr||function(e,t){return sh.setTimeout(e,t)},wl=Un(_l),kl=Rn(function(e){var a=[];return 46===e.charCodeAt(0)&&a.push(""),e.replace(S_,function(e,t,n,i){a.push(n?i.replace(L_,"$1"):t||e)}),a}),Cl=We(function(e,t){return Ma(e)?J(e,ie(t,1,Ma,!0)):[]}),El=We(function(e,t){var n=_i(t);return Ma(n)&&(n=nu),Ma(e)?J(e,ie(t,1,Ma,!0),un(n,2)):[]}),Tl=We(function(e,t){var n=_i(t);return Ma(n)&&(n=nu),Ma(e)?J(e,ie(t,1,Ma,!0),nu,n):[]}),xl=We(function(e){var t=md(e,_t);return t.length&&t[0]===e[0]?pe(t):[]}),Il=We(function(e){var t=_i(e),n=md(e,_t);return t===_i(n)?t=nu:n.pop(),n.length&&n[0]===e[0]?pe(n,un(t,2)):[]}),Dl=We(function(e){var t=_i(e),n=md(e,_t);return(t="function"==typeof t?t:nu)&&n.pop(),n.length&&n[0]===e[0]?pe(n,nu,t):[]}),Ol=We(fi),Sl=on(function(e,t){var n=null==e?0:e.length,i=q(e,t);return He(e,md(t,function(e){return kn(e,n)?+e:e}).sort($t)),i}),Rl=We(function(e){return st(ie(e,1,Ma,!0))}),Bl=We(function(e){var t=_i(e);return Ma(t)&&(t=nu),st(ie(e,1,Ma,!0),un(t,2))}),Nl=We(function(e){var t=_i(e);return t="function"==typeof t?t:nu,st(ie(e,1,Ma,!0),nu,t)}),Fl=We(function(e,t){return Ma(e)?J(e,t):[]}),Kl=We(function(e){return dt(hd(e,Ma))}),Ml=We(function(e){var t=_i(e);return Ma(t)&&(t=nu),dt(hd(e,Ma),un(t,2))}),jl=We(function(e){var t=_i(e);return t="function"==typeof t?t:nu,dt(hd(e,Ma),nu,t)}),Ll=We(Ki),Pl=We(function(e){var t=e.length,n=1<t?e[t-1]:nu;return Mi(e,n="function"==typeof n?(e.pop(),n):nu)}),Ul=on(function(t){var n=t.length,e=n?t[0]:0,i=this.__wrapped__,a=function(e){return q(e,t)};return!(1<n||this.__actions__.length)&&i instanceof A&&kn(e)?((i=i.slice(e,+e+(n?1:0))).__actions__.push({func:Hi,args:[a],thisArg:nu}),new g(i,this.__chain__).thru(function(e){return n&&!e.length&&e.push(nu),e})):this.thru(a)}),Hl=Dt(function(e,t,n){cr.call(e,n)?++e[n]:z(e,n,1)}),Ql=jt(ni),zl=jt(ii),ql=Dt(function(e,t,n){cr.call(e,n)?e[n].push(t):z(e,n,[t])}),Wl=We(function(e,t,n){var i=-1,a="function"==typeof t,s=Ka(e)?Vo(e.length):[];return rl(e,function(e){s[++i]=a?ld(t,e,n):me(e,t,n)}),s}),Yl=Dt(function(e,t,n){z(e,n,t)}),Vl=Dt(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),Gl=We(function(e,t){if(null==e)return[];var n=t.length;return 1<n&&Cn(e,t[0],t[1])?t=[]:2<n&&Cn(t[0],t[1],t[2])&&(t=[t[0]]),Me(e,ie(t,1),[])}),Xl=Ir||function(){return sh.Date.now()},Jl=We(function(e,t,n){var i=mu;if(n.length){var a=Yd(n,dn(Jl));i|=yu}return Jt(e,i,t,n,a)}),Zl=We(function(e,t,n){var i=mu|gu;if(n.length){var a=Yd(n,dn(Zl));i|=yu}return Jt(t,i,e,n,a)}),ec=We(function(e,t){return X(e,1,t)}),tc=We(function(e,t,n){return X(e,fs(t)||0,n)});$a.Cache=b;var nc,ic=hl(function(i,a){var s=(a=1==a.length&&dc(a[0])?md(a[0],Nd(un())):md(ie(a,1),Nd(un()))).length;return We(function(e){for(var t=-1,n=jr(e.length,s);++t<n;)e[t]=a[t].call(this,e[t]);return ld(i,this,e)})}),ac=We(function(e,t){var n=Yd(t,dn(ac));return Jt(e,yu,nu,t,n)}),sc=We(function(e,t){var n=Yd(t,dn(sc));return Jt(e,$u,nu,t,n)}),oc=on(function(e,t){return Jt(e,ku,nu,nu,nu,t)}),rc=Yt(de),lc=Yt(function(e,t){return t<=e}),cc=ge(function(){return arguments}())?ge:function(e){return Ga(e)&&cr.call(e,"callee")&&!$r.call(e,"callee")},dc=Vo.isArray,uc=rh?Nd(rh):Ae,_c=Br||Ro,hc=lh?Nd(lh):ve,pc=ch?Nd(ch):$e,fc=dh?Nd(dh):Ce,mc=uh?Nd(uh):Ee,gc=_h?Nd(_h):Te,Ac=Yt(Oe),vc=Yt(function(e,t){return e<=t}),bc=Ot(function(e,t){if(Dn(t)||Ka(t))Tt(t,Os(t),e);else for(var n in t)cr.call(t,n)&&L(e,n,t[n])}),yc=Ot(function(e,t){Tt(t,Ss(t),e)}),$c=Ot(function(e,t,n,i){Tt(t,Ss(t),e,i)}),wc=Ot(function(e,t,n,i){Tt(t,Os(t),e,i)}),kc=on(q),Cc=We(function(e,t){e=er(e);var n=-1,i=t.length,a=2<i?t[2]:nu;for(a&&Cn(t[0],t[1],a)&&(i=1);++n<i;)for(var s=t[n],o=Ss(s),r=-1,l=o.length;++r<l;){var c=o[r],d=e[c];(d===nu||Fa(d,or[c])&&!cr.call(e,c))&&(e[c]=s[c])}return e}),Ec=We(function(e){return e.push(nu,en),ld(Oc,nu,e)}),Tc=Ut(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=_r.call(t)),e[t]=n},bo($o)),xc=Ut(function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=_r.call(t)),cr.call(e,t)?e[t].push(n):e[t]=[n]},un),Ic=We(me),Dc=Ot(function(e,t,n){Ne(e,t,n)}),Oc=Ot(function(e,t,n,i){Ne(e,t,n,i)}),Sc=on(function(t,e){var n={};if(null==t)return n;var i=!1;e=md(e,function(e){return e=pt(e,t),i||(i=1<e.length),e}),Tt(t,ln(t),n),i&&(n=Y(n,uu|_u|hu,tn));for(var a=e.length;a--;)ot(n,e[a]);return n}),Rc=on(function(e,t){return null==e?{}:je(e,t)}),Bc=Xt(Os),Nc=Xt(Ss),Fc=Ft(function(e,t,n){return t=t.toLowerCase(),e+(n?Vs(t):t)}),Kc=Ft(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Mc=Ft(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),jc=Nt("toLowerCase"),Lc=Ft(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Pc=Ft(function(e,t,n){return e+(n?" ":"")+Hc(t)}),Uc=Ft(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Hc=Nt("toUpperCase"),Qc=We(function(e,t){try{return ld(e,nu,t)}catch(n){return Qa(n)?n:new Xo(n)}}),zc=on(function(t,e){return dd(e,function(e){e=Qn(e),z(t,e,Jl(t[e],t))}),t}),qc=Lt(),Wc=Lt(!0),Yc=We(function(t,n){return function(e){return me(e,t,n)}}),Vc=We(function(t,n){return function(e){return me(t,e,n)}}),Gc=Qt(md),Xc=Qt(_d),Jc=Qt(bd),Zc=Wt(),ed=Wt(!0),td=Ht(function(e,t){return e+t},0),nd=Gt("ceil"),id=Ht(function(e,t){return e/t},1),ad=Gt("floor"),sd=Ht(function(e,t){return e*t},1),od=Gt("round"),rd=Ht(function(e,t){return e-t},0);return m.after=fa,m.ary=ma,m.assign=bc,m.assignIn=yc,m.assignInWith=$c,m.assignWith=wc,m.at=kc,m.before=ga,m.bind=Jl,m.bindAll=zc,m.bindKey=Zl,m.castArray=Da,m.chain=Pi,m.chunk=Yn,m.compact=Vn,m.concat=Gn,m.cond=Ao,m.conforms=vo,m.constant=bo,m.countBy=Hl,m.create=vs,m.curry=Aa,m.curryRight=va,m.debounce=ba,m.defaults=Cc,m.defaultsDeep=Ec,m.defer=ec,m.delay=tc,m.difference=Cl,m.differenceBy=El,m.differenceWith=Tl,m.drop=Xn,m.dropRight=Jn,m.dropRightWhile=Zn,m.dropWhile=ei,m.fill=ti,m.filter=Ji,m.flatMap=Zi,m.flatMapDeep=ea,m.flatMapDepth=ta,m.flatten=ai,m.flattenDeep=si,m.flattenDepth=oi,m.flip=ya,m.flow=qc,m.flowRight=Wc,m.fromPairs=ri,m.functions=Es,m.functionsIn=Ts,m.groupBy=ql,m.initial=di,m.intersection=xl,m.intersectionBy=Il,m.intersectionWith=Dl,m.invert=Tc,m.invertBy=xc,m.invokeMap=Wl,m.iteratee=wo,m.keyBy=Yl,m.keys=Os,m.keysIn=Ss,m.map=sa,m.mapKeys=Rs,m.mapValues=Bs,m.matches=ko,m.matchesProperty=Co,m.memoize=$a,m.merge=Dc,m.mergeWith=Oc,m.method=Yc,m.methodOf=Vc,m.mixin=Eo,m.negate=wa,m.nthArg=Io,m.omit=Sc,m.omitBy=Ns,m.once=ka,m.orderBy=oa,m.over=Gc,m.overArgs=ic,m.overEvery=Xc,m.overSome=Jc,m.partial=ac,m.partialRight=sc,m.partition=Vl,m.pick=Rc,m.pickBy=Fs,m.property=Do,m.propertyOf=Oo,m.pull=Ol,m.pullAll=fi,m.pullAllBy=mi,m.pullAllWith=gi,m.pullAt=Sl,m.range=Zc,m.rangeRight=ed,m.rearg=oc,m.reject=ca,m.remove=Ai,m.rest=Ca,m.reverse=vi,m.sampleSize=ua,m.set=Ms,m.setWith=js,m.shuffle=_a,m.slice=bi,m.sortBy=Gl,m.sortedUniq=Ti,m.sortedUniqBy=xi,m.split=oo,m.spread=Ea,m.tail=Ii,m.take=Di,m.takeRight=Oi,m.takeRightWhile=Si,m.takeWhile=Ri,m.tap=Ui,m.throttle=Ta,m.thru=Hi,m.toArray=us,m.toPairs=Bc,m.toPairsIn=Nc,m.toPath=Mo,m.toPlainObject=ms,m.transform=Ls,m.unary=xa,m.union=Rl,m.unionBy=Bl,m.unionWith=Nl,m.uniq=Bi,m.uniqBy=Ni,m.uniqWith=Fi,m.unset=Ps,m.unzip=Ki,m.unzipWith=Mi,m.update=Us,m.updateWith=Hs,m.values=Qs,m.valuesIn=zs,m.without=Fl,m.words=go,m.wrap=Ia,m.xor=Kl,m.xorBy=Ml,m.xorWith=jl,m.zip=Ll,m.zipObject=ji,m.zipObjectDeep=Li,m.zipWith=Pl,m.entries=Bc,m.entriesIn=Nc,m.extend=yc,m.extendWith=$c,Eo(m,m),m.add=td,m.attempt=Qc,m.camelCase=Fc,m.capitalize=Vs,m.ceil=nd,m.clamp=qs,m.clone=Oa,m.cloneDeep=Ra,m.cloneDeepWith=Ba,m.cloneWith=Sa,m.conformsTo=Na,m.deburr=Gs,m.defaultTo=yo,m.divide=id,m.endsWith=Xs,m.eq=Fa,m.escape=Js,m.escapeRegExp=Zs,m.every=Xi,m.find=Ql,m.findIndex=ni,m.findKey=bs,m.findLast=zl,m.findLastIndex=ii,m.findLastKey=ys,m.floor=ad,m.forEach=na,m.forEachRight=ia,m.forIn=$s,m.forInRight=ws,m.forOwn=ks,m.forOwnRight=Cs,m.get=xs,m.gt=rc,m.gte=lc,m.has=Is,m.hasIn=Ds,m.head=li,m.identity=$o,m.includes=aa,m.indexOf=ci,m.inRange=Ws,m.invoke=Ic,m.isArguments=cc,m.isArray=dc,m.isArrayBuffer=uc,m.isArrayLike=Ka,m.isArrayLikeObject=Ma,m.isBoolean=ja,m.isBuffer=_c,m.isDate=hc,m.isElement=La,m.isEmpty=Pa,m.isEqual=Ua,m.isEqualWith=Ha,m.isError=Qa,m.isFinite=za,m.isFunction=qa,m.isInteger=Wa,m.isLength=Ya,m.isMap=pc,m.isMatch=Xa,m.isMatchWith=Ja,m.isNaN=Za,m.isNative=es,m.isNil=ns,m.isNull=ts,m.isNumber=is,m.isObject=Va,m.isObjectLike=Ga,m.isPlainObject=as,m.isRegExp=fc,m.isSafeInteger=ss,m.isSet=mc,m.isString=os,m.isSymbol=rs,m.isTypedArray=gc,m.isUndefined=ls,m.isWeakMap=cs,m.isWeakSet=ds,m.join=ui,m.kebabCase=Kc,m.last=_i,m.lastIndexOf=hi,m.lowerCase=Mc,m.lowerFirst=jc,m.lt=Ac,m.lte=vc,m.max=Lo,m.maxBy=Po,m.mean=Uo,m.meanBy=Ho,m.min=Qo,m.minBy=zo,m.stubArray=So,m.stubFalse=Ro,m.stubObject=Bo,m.stubString=No,m.stubTrue=Fo,m.multiply=sd,m.nth=pi,m.noConflict=To,m.noop=xo,m.now=Xl,m.pad=eo,m.padEnd=to,m.padStart=no,m.parseInt=io,m.random=Ys,m.reduce=ra,m.reduceRight=la,m.repeat=ao,m.replace=so,m.result=Ks,m.round=od,m.runInContext=mh,m.sample=da,m.size=ha,m.snakeCase=Lc,m.some=pa,m.sortedIndex=yi,m.sortedIndexBy=$i,m.sortedIndexOf=wi,m.sortedLastIndex=ki,m.sortedLastIndexBy=Ci,m.sortedLastIndexOf=Ei,m.startCase=Pc,m.startsWith=ro,m.subtract=rd,m.sum=qo,m.sumBy=Wo,m.template=lo,m.times=Ko,m.toFinite=_s,m.toInteger=hs,m.toLength=ps,m.toLower=co,m.toNumber=fs,m.toSafeInteger=gs,m.toString=As,m.toUpper=uo,m.trim=_o,m.trimEnd=ho,m.trimStart=po,m.truncate=fo,m.unescape=mo,m.uniqueId=jo,m.upperCase=Uc,m.upperFirst=Hc,m.each=na,m.eachRight=ia,m.first=li,Eo(m,(nc={},ae(m,function(e,t){cr.call(m.prototype,t)||(nc[t]=e)}),nc),{chain:!1}),m.VERSION=iu,dd(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){m[e].placeholder=m}),dd(["drop","take"],function(n,i){A.prototype[n]=function(e){e=e===nu?1:Mr(hs(e),0);var t=this.__filtered__&&!i?new A(this):this.clone();return t.__filtered__?t.__takeCount__=jr(e,t.__takeCount__):t.__views__.push({size:jr(e,Ku),type:n+(t.__dir__<0?"Right":"")}),t},A.prototype[n+"Right"]=function(e){return this.reverse()[n](e).reverse()}}),dd(["filter","map","takeWhile"],function(e,t){var n=t+1,i=n==Du||n==Su;A.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:un(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),dd(["head","last"],function(e,t){var n="take"+(t?"Right":"");A.prototype[e]=function(){return this[n](1).value()[0]}}),dd(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");A.prototype[e]=function(){return this.__filtered__?new A(this):this[n](1)}}),A.prototype.compact=function(){return this.filter($o)},A.prototype.find=function(e){return this.filter(e).head()},A.prototype.findLast=function(e){return this.reverse().find(e)},A.prototype.invokeMap=We(function(t,n){return"function"==typeof t?new A(this):this.map(function(e){return me(e,t,n)})}),A.prototype.reject=function(e){return this.filter(wa(un(e)))},A.prototype.slice=function(e,t){e=hs(e);var n=this;return n.__filtered__&&(0<e||t<0)?new A(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==nu&&(n=(t=hs(t))<0?n.dropRight(-t):n.take(t-e)),n)},A.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},A.prototype.toArray=function(){return this.take(Ku)},ae(A.prototype,function(u,e){var _=/^(?:filter|find|map|reject)|While$/.test(e),h=/^(?:head|last)$/.test(e),p=m[h?"take"+("last"==e?"Right":""):e],f=h||/^find/.test(e);p&&(m.prototype[e]=function(){var e=this.__wrapped__,n=h?[1]:arguments,t=e instanceof A,i=n[0],a=t||dc(e),s=function(e){var t=p.apply(m,gd([e],n));return h&&o?t[0]:t};a&&_&&"function"==typeof i&&1!=i.length&&(t=a=!1);var o=this.__chain__,r=!!this.__actions__.length,l=f&&!o,c=t&&!r;if(f||!a)return l&&c?u.apply(this,n):(d=this.thru(s),l?h?d.value()[0]:d.value():d);e=c?e:new A(this);var d=u.apply(e,n);return d.__actions__.push({func:Hi,args:[s],thisArg:nu}),new g(d,o)})}),dd(["pop","push","shift","sort","splice","unshift"],function(e){var n=ar[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);m.prototype[e]=function(){var t=arguments;if(!a||this.__chain__)return this[i](function(e){return n.apply(dc(e)?e:[],t)});var e=this.value();return n.apply(dc(e)?e:[],t)}}),ae(A.prototype,function(e,t){var n=m[t];if(n){var i=n.name+"";cr.call(Xr,i)||(Xr[i]=[]),Xr[i].push({name:t,func:n})}}),Xr[Pt(nu,gu).name]=[{name:"wrapper",func:nu}],A.prototype.clone=t,A.prototype.reverse=n,A.prototype.value=i,m.prototype.at=Ul,m.prototype.chain=Qi,m.prototype.commit=zi,m.prototype.next=qi,m.prototype.plant=Yi,m.prototype.reverse=Vi,m.prototype.toJSON=m.prototype.valueOf=m.prototype.value=Gi,m.prototype.first=m.prototype.head,Cr&&(m.prototype[Cr]=Wi),m},gh=mh();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(sh._=gh,define(function(){return gh})):G?((G.exports=gh)._=gh,V._=gh):sh._=gh}.call(this),function(e){if("function"==typeof define&&define.amd)define(["jquery","lodash","jquery-ui/data","jquery-ui/disable-selection","jquery-ui/focusable","jquery-ui/form","jquery-ui/ie","jquery-ui/keycode","jquery-ui/labels","jquery-ui/jquery-1-7","jquery-ui/plugin","jquery-ui/safe-active-element","jquery-ui/safe-blur","jquery-ui/scroll-parent","jquery-ui/tabbable","jquery-ui/unique-id","jquery-ui/version","jquery-ui/widget","jquery-ui/widgets/mouse","jquery-ui/widgets/draggable","jquery-ui/widgets/droppable","jquery-ui/widgets/resizable"],e);else if("undefined"!=typeof exports){try{jQuery=require("jquery")}catch(t){}try{_=require("lodash")}catch(t){}e(jQuery,_)}else e(jQuery,_)}(function(_,h){var e=window,t=function(e,t,n){var i=function(){return console.warn("gridstack.js: Function `"+t+"` is deprecated as of v0.2.5 and has been replaced with `"+n+"`. It will be **completely** removed in v1.0."),e.apply(this,arguments)};return i.prototype=e.prototype,i},l=function(e,t){console.warn("gridstack.js: Option `"+e+"` is deprecated as of v0.2.5 and has been replaced with `"+t+"`. It will be **completely** removed in v1.0.")},o={isIntercepted:function(e,t){return!(e.x+e.width<=t.x||t.x+t.width<=e.x||e.y+e.height<=t.y||t.y+t.height<=e.y)},sort:function(e,t,n){return n=n||h.chain(e).map(function(e){return e.x+e.width}).max().value(),t=-1!=t?1:-1,h.sortBy(e,function(e){return t*(e.x+e.y*n)})},createStylesheet:function(e){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.setAttribute("data-gs-style-id",e),t.styleSheet?t.styleSheet.cssText="":t.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(t),t.sheet},removeStylesheet:function(e){_("STYLE[data-gs-style-id="+e+"]").remove()},insertCSSRule:function(e,t,n,i){"function"==typeof e.insertRule?e.insertRule(t+"{"+n+"}",i):"function"==typeof e.addRule&&e.addRule(t,n,i)},toBool:function(e){return"boolean"==typeof e?e:"string"==typeof e?!(""===(e=e.toLowerCase())||"no"==e||"false"==e||"0"==e):Boolean(e)},_collisionNodeCheck:function(e){return e!=this.node&&o.isIntercepted(e,this.nn)},_didCollide:function(e){return o.isIntercepted({x:this.n.x,y:this.newY,width:this.n.width,height:this.n.height},e)},_isAddNodeIntercepted:function(e){return o.isIntercepted({x:this.x,y:this.y,width:this.node.width,height:this.node.height},e)},parseHeight:function(e){var t=e,n="px";if(t&&h.isString(t)){var i=t.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw)?$/);if(!i)throw new Error("Invalid height");n=i[2]||"px",t=parseFloat(i[1])}return{height:t,unit:n}}};o.is_intercepted=t(o.isIntercepted,"is_intercepted","isIntercepted"),o.create_stylesheet=t(o.createStylesheet,"create_stylesheet","createStylesheet"),o.remove_stylesheet=t(o.removeStylesheet,"remove_stylesheet","removeStylesheet"),o.insert_css_rule=t(o.insertCSSRule,"insert_css_rule","insertCSSRule");var s=0,p=function(e,t,n,i,a){this.width=e,this["float"]=n||!1,this.height=i||0,this.nodes=a||[],this.onchange=t||function(){},this._updateCounter=0,this._float=this["float"],this._addedNodes=[],this._removedNodes=[]};p.prototype.batchUpdate=function(){this._updateCounter=1,this["float"]=!0},p.prototype.commit=function(){0!==this._updateCounter&&(this._updateCounter=0,this["float"]=this._float,this._packNodes(),this._notify())},p.prototype.getNodeDataByDOMEl=function(t){return h.find(this.nodes,function(e){return t.get(0)===e.el.get(0)})},p.prototype._fixCollisions=function(e){this._sortNodes(-1);var t=e,n=Boolean(h.find(this.nodes,function(e){return e.locked}));for(this["float"]||n||(t={x:0,y:e.y,width:this.width,height:e.height});;){var i=h.find(this.nodes,h.bind(o._collisionNodeCheck,{node:e,nn:t}));if(void 0===i)return;this.moveNode(i,i.x,e.y+e.height,i.width,i.height,!0)}},p.prototype.isAreaEmpty=function(e,t,n,i){var a={x:e||0,y:t||0,width:n||1,height:i||1},s=h.find(this.nodes,h.bind(function(e){return o.isIntercepted(e,a)},this));return null==s},p.prototype._sortNodes=function(e){this.nodes=o.sort(this.nodes,e,this.width)},p.prototype._packNodes=function(){this._sortNodes(),this["float"]?h.each(this.nodes,h.bind(function(e){if(!e._updating&&"undefined"!=typeof e._origY&&e.y!=e._origY)for(var t=e.y;t>=e._origY;){h.chain(this.nodes).find(h.bind(o._didCollide,{n:e,newY:t})).value()||(e._dirty=!0,e.y=t),--t}},this)):h.each(this.nodes,h.bind(function(e,t){if(!e.locked)for(;0<e.y;){var n=e.y-1,i=0===t;if(0<t)i=void 0===h.chain(this.nodes).take(t).find(h.bind(o._didCollide,{n:e,newY:n})).value();if(!i)break;e._dirty=e.y!=n,e.y=n}},this))},p.prototype._prepareNode=function(e,t){return(e=h.defaults(e||{},{width:1,height:1,x:0,y:0})).x=parseInt(""+e.x),e.y=parseInt(""+e.y),e.width=parseInt(""+e.width),e.height=parseInt(""+e.height),e.autoPosition=e.autoPosition||!1,e.noResize=e.noResize||!1,e.noMove=e.noMove||!1,e.width>this.width?e.width=this.width:e.width<1&&(e.width=1),e.height<1&&(e.height=1),e.x<0&&(e.x=0),e.x+e.width>this.width&&(t?e.width=this.width-e.x:e.x=this.width-e.width),e.y<0&&(e.y=0),e},p.prototype._notify=function(){var e=Array.prototype.slice.call(arguments,0);if(e[0]="undefined"==typeof e[0]?[]:[e[0]],e[1]="undefined"==typeof e[1]||e[1],!this._updateCounter){var t=e[0].concat(this.getDirtyNodes());this.onchange(t,e[1])}},p.prototype.cleanNodes=function(){this._updateCounter||h.each(this.nodes,function(e){e._dirty=!1})},p.prototype.getDirtyNodes=function(){return h.filter(this.nodes,function(e){return e._dirty})},p.prototype.addNode=function(e,t){if("undefined"!=typeof(e=this._prepareNode(e)).maxWidth&&(e.width=Math.min(e.width,e.maxWidth)),"undefined"!=typeof e.maxHeight&&(e.height=Math.min(e.height,e.maxHeight)),"undefined"!=typeof e.minWidth&&(e.width=Math.max(e.width,e.minWidth)),"undefined"!=typeof e.minHeight&&(e.height=Math.max(e.height,e.minHeight)),e._id=++s,e._dirty=!0,e.autoPosition){this._sortNodes();for(
var n=0;;++n){var i=n%this.width,a=Math.floor(n/this.width);if(!(i+e.width>this.width)&&!h.find(this.nodes,h.bind(o._isAddNodeIntercepted,{x:i,y:a,node:e}))){e.x=i,e.y=a;break}}}return this.nodes.push(e),void 0!==t&&t&&this._addedNodes.push(h.clone(e)),this._fixCollisions(e),this._packNodes(),this._notify(),e},p.prototype.removeNode=function(e,t){t=void 0===t||t,this._removedNodes.push(h.clone(e)),e._id=null,this.nodes=h.without(this.nodes,e),this._packNodes(),this._notify(e,t)},p.prototype.canMoveNode=function(t,e,n,i,a){var s,o=Boolean(h.find(this.nodes,function(e){return e.locked}));if(!this.height&&!o)return!0;var r=new p(this.width,null,this["float"],0,h.map(this.nodes,function(e){return e==t?s=_.extend({},e):_.extend({},e)}));if(void 0===s)return!0;r.moveNode(s,e,n,i,a);var l=!0;return o&&(l&=!Boolean(h.find(r.nodes,function(e){return e!=s&&Boolean(e.locked)&&Boolean(e._dirty)}))),this.height&&(l&=r.getGridHeight()<=this.height),l},p.prototype.canBePlacedWithRespectToHeight=function(e){if(!this.height)return!0;var t=new p(this.width,null,this["float"],0,h.map(this.nodes,function(e){return _.extend({},e)}));return t.addNode(e),t.getGridHeight()<=this.height},p.prototype.moveNode=function(e,t,n,i,a,s){if("number"!=typeof t&&(t=e.x),"number"!=typeof n&&(n=e.y),"number"!=typeof i&&(i=e.width),"number"!=typeof a&&(a=e.height),"undefined"!=typeof e.maxWidth&&(i=Math.min(i,e.maxWidth)),"undefined"!=typeof e.maxHeight&&(a=Math.min(a,e.maxHeight)),"undefined"!=typeof e.minWidth&&(i=Math.max(i,e.minWidth)),"undefined"!=typeof e.minHeight&&(a=Math.max(a,e.minHeight)),e.x==t&&e.y==n&&e.width==i&&e.height==a)return e;var o=e.width!=i;return e._dirty=!0,e.x=t,e.y=n,e.width=i,e.height=a,e=this._prepareNode(e,o),this._fixCollisions(e),s||(this._packNodes(),this._notify()),e},p.prototype.getGridHeight=function(){return h.reduce(this.nodes,function(e,t){return Math.max(e,t.y+t.height)},0)},p.prototype.beginUpdate=function(e){h.each(this.nodes,function(e){e._origY=e.y}),e._updating=!0},p.prototype.endUpdate=function(){h.each(this.nodes,function(e){e._origY=e.y});var e=h.find(this.nodes,function(e){return e._updating});e&&(e._updating=!1)};var n=function(e,t){var n,i,c=this;t=t||{},this.container=_(e),"undefined"!=typeof t.handle_class&&(t.handleClass=t.handle_class,l("handle_class","handleClass")),"undefined"!=typeof t.item_class&&(t.itemClass=t.item_class,l("item_class","itemClass")),"undefined"!=typeof t.placeholder_class&&(t.placeholderClass=t.placeholder_class,l("placeholder_class","placeholderClass")),"undefined"!=typeof t.placeholder_text&&(t.placeholderText=t.placeholder_text,l("placeholder_text","placeholderText")),"undefined"!=typeof t.cell_height&&(t.cellHeight=t.cell_height,l("cell_height","cellHeight")),"undefined"!=typeof t.vertical_margin&&(t.verticalMargin=t.vertical_margin,l("vertical_margin","verticalMargin")),"undefined"!=typeof t.min_width&&(t.minWidth=t.min_width,l("min_width","minWidth")),"undefined"!=typeof t.static_grid&&(t.staticGrid=t.static_grid,l("static_grid","staticGrid")),"undefined"!=typeof t.is_nested&&(t.isNested=t.is_nested,l("is_nested","isNested")),"undefined"!=typeof t.always_show_resize_handle&&(t.alwaysShowResizeHandle=t.always_show_resize_handle,l("always_show_resize_handle","alwaysShowResizeHandle")),t.itemClass=t.itemClass||"grid-stack-item";var a=0<this.container.closest("."+t.itemClass).length;if(this.opts=h.defaults(t||{},{width:parseInt(this.container.attr("data-gs-width"))||12,height:parseInt(this.container.attr("data-gs-height"))||0,itemClass:"grid-stack-item",placeholderClass:"grid-stack-placeholder",placeholderText:"",handle:".grid-stack-item-content",handleClass:null,cellHeight:60,verticalMargin:20,auto:!0,minWidth:768,"float":!1,staticGrid:!1,_class:"grid-stack-instance-"+(1e4*Math.random()).toFixed(0),animate:Boolean(this.container.attr("data-gs-animate"))||!1,alwaysShowResizeHandle:t.alwaysShowResizeHandle||!1,resizable:h.defaults(t.resizable||{},{autoHide:!t.alwaysShowResizeHandle,handles:"se"}),draggable:h.defaults(t.draggable||{},{handle:(t.handleClass?"."+t.handleClass:t.handle?t.handle:"")||".grid-stack-item-content",scroll:!1,appendTo:"body"}),disableDrag:t.disableDrag||!1,disableResize:t.disableResize||!1,rtl:"auto",removable:!1,removeTimeout:2e3,verticalMarginUnit:"px",cellHeightUnit:"px"}),"auto"===this.opts.rtl&&(this.opts.rtl="rtl"===this.container.css("direction")),this.opts.rtl&&this.container.addClass("grid-stack-rtl"),this.opts.isNested=a,(i="auto"===this.opts.cellHeight)?c.cellHeight(c.cellWidth(),!0):this.cellHeight(this.opts.cellHeight,!0),this.verticalMargin(this.opts.verticalMargin,!0),this.container.addClass(this.opts._class),this._setStaticClass(),a&&this.container.addClass("grid-stack-nested"),this._initStyles(),this.grid=new p(this.opts.width,function(e,t){t=void 0===t||t;var n=0;h.each(e,function(e){t&&null===e._id?e.el&&e.el.remove():(e.el.attr("data-gs-x",e.x).attr("data-gs-y",e.y).attr("data-gs-width",e.width).attr("data-gs-height",e.height),n=Math.max(n,e.y+e.height))}),c._updateStyles(n+10)},this.opts["float"],this.opts.height),this.opts.auto){var s=[],o=this;this.container.children("."+this.opts.itemClass+":not(."+this.opts.placeholderClass+")").each(function(e,t){t=_(t),s.push({el:t,i:parseInt(t.attr("data-gs-x"))+parseInt(t.attr("data-gs-y"))*o.opts.width})}),h.chain(s).sortBy(function(e){return e.i}).each(function(e){c._prepareElement(e.el)}).value()}if(this.setAnimation(this.opts.animate),this.placeholder=_('<div class="'+this.opts.placeholderClass+" "+this.opts.itemClass+'"><div class="placeholder-content">'+this.opts.placeholderText+"</div></div>").hide(),this._updateContainerHeight(),this._updateHeightsOnResize=h.throttle(function(){c.cellHeight(c.cellWidth(),!1)},100),this.onResizeHandler=function(){if(i&&c._updateHeightsOnResize(),c._isOneColumnMode()){if(n)return;n=!0,c.grid._sortNodes(),h.each(c.grid.nodes,function(e){c.container.append(e.el),c.opts.staticGrid||((e.noMove||c.opts.disableDrag)&&e.el.draggable("disable"),(e.noResize||c.opts.disableResize)&&e.el.resizable("disable"),e.el.trigger("resize"))})}else{if(!n)return;if(n=!1,c.opts.staticGrid)return;h.each(c.grid.nodes,function(e){e.noMove||c.opts.disableDrag||e.el.draggable("enable"),e.noResize||c.opts.disableResize||e.el.resizable("enable"),e.el.trigger("resize")})}},_(window).resize(this.onResizeHandler),this.onResizeHandler(),!c.opts.staticGrid&&"string"==typeof c.opts.removable){var r=_(c.opts.removable);r.data("droppable")||r.droppable({accept:"."+c.opts.itemClass}),r.on("dropover",function(e,t){var n=_(t.draggable);n.data("_gridstack_node")._grid===c&&c._setupRemovingTimeout(n)}).on("dropout",function(e,t){var n=_(t.draggable);n.data("_gridstack_node")._grid===c&&c._clearRemovingTimeout(n)})}if(!c.opts.staticGrid&&c.opts.acceptWidgets){var d=null,u=function(e,t){var n=d,i=n.data("_gridstack_node"),a=c.getCellFromPixel(t.offset,!0),s=Math.max(0,a.x),o=Math.max(0,a.y);if(i._added){if(!c.grid.canMoveNode(i,s,o))return;c.grid.moveNode(i,s,o),c._updateContainerHeight()}else i._added=!0,i.el=n,i.x=s,i.y=o,c.grid.cleanNodes(),c.grid.beginUpdate(i),c.grid.addNode(i),c.container.append(c.placeholder),c.placeholder.attr("data-gs-x",i.x).attr("data-gs-y",i.y).attr("data-gs-width",i.width).attr("data-gs-height",i.height).show(),i.el=c.placeholder,i._beforeDragX=i.x,i._beforeDragY=i.y,c._updateContainerHeight()};_(c.container).droppable({accept:function(e){var t=(e=_(e)).data("_gridstack_node");return(!t||t._grid!==c)&&e.is(!0===c.opts.acceptWidgets?".grid-stack-item":c.opts.acceptWidgets)},over:function(e,t){c.container.offset();var n=_(t.draggable),i=c.cellWidth(),a=c.cellHeight(),s=n.data("_gridstack_node"),o=s?s.width:Math.ceil(n.outerWidth()/i),r=s?s.height:Math.ceil(n.outerHeight()/a);d=n;var l=c.grid._prepareNode({width:o,height:r,_added:!1,_temporary:!0});n.data("_gridstack_node",l),n.data("_gridstack_node_orig",s),n.on("drag",u)},out:function(e,t){var n=_(t.draggable);n.unbind("drag",u);var i=n.data("_gridstack_node");i.el=null,c.grid.removeNode(i),c.placeholder.detach(),c._updateContainerHeight(),n.data("_gridstack_node",n.data("_gridstack_node_orig"))},drop:function(e,t){c.placeholder.detach();var n=_(t.draggable).data("_gridstack_node");n._grid=c;var i=_(t.draggable).clone(!1);i.data("_gridstack_node",n),_(t.draggable).remove(),n.el=i,c.placeholder.hide(),i.attr("data-gs-x",n.x).attr("data-gs-y",n.y).attr("data-gs-width",n.width).attr("data-gs-height",n.height).addClass(c.opts.itemClass).removeAttr("style").enableSelection().removeData("draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled").unbind("drag",u),c.container.append(i),c._prepareElementsByNode(i,n),c._updateContainerHeight(),c._triggerChangeEvent(),c.grid.endUpdate()}})}};return n.prototype._triggerChangeEvent=function(e){var t=this.grid.getDirtyNodes(),n=!1,i=[];t&&t.length&&(i.push(t),n=!0),(n||!0===e)&&this.container.trigger("change",i)},n.prototype._triggerAddEvent=function(){this.grid._addedNodes&&0<this.grid._addedNodes.length&&(this.container.trigger("added",[h.map(this.grid._addedNodes,h.clone)]),this.grid._addedNodes=[])},n.prototype._triggerRemoveEvent=function(){this.grid._removedNodes&&0<this.grid._removedNodes.length&&(this.container.trigger("removed",[h.map(this.grid._removedNodes,h.clone)]),this.grid._removedNodes=[])},n.prototype._initStyles=function(){this._stylesId&&o.removeStylesheet(this._stylesId),this._stylesId="gridstack-style-"+(1e5*Math.random()).toFixed(),this._styles=o.createStylesheet(this._stylesId),null!==this._styles&&(this._styles._max=0)},n.prototype._updateStyles=function(e){if(null!==this._styles&&"undefined"!=typeof this._styles){var t,n="."+this.opts._class+" ."+this.opts.itemClass,i=this;if(void 0===e&&(e=this._styles._max,this._initStyles(),this._updateContainerHeight()),this.opts.cellHeight&&!(0!==this._styles._max&&e<=this._styles._max)&&(t=this.opts.verticalMargin&&this.opts.cellHeightUnit!==this.opts.verticalMarginUnit?function(e,t){return e&&t?"calc("+(i.opts.cellHeight*e+i.opts.cellHeightUnit)+" + "+(i.opts.verticalMargin*t+i.opts.verticalMarginUnit)+")":i.opts.cellHeight*e+i.opts.verticalMargin*t+i.opts.cellHeightUnit}:function(e,t){return i.opts.cellHeight*e+i.opts.verticalMargin*t+i.opts.cellHeightUnit},0===this._styles._max&&o.insertCSSRule(this._styles,n,"min-height: "+t(1,0)+";",0),e>this._styles._max)){for(var a=this._styles._max;a<e;++a)o.insertCSSRule(this._styles,n+'[data-gs-height="'+(a+1)+'"]',"height: "+t(a+1,a)+";",a),o.insertCSSRule(this._styles,n+'[data-gs-min-height="'+(a+1)+'"]',"min-height: "+t(a+1,a)+";",a),o.insertCSSRule(this._styles,n+'[data-gs-max-height="'+(a+1)+'"]',"max-height: "+t(a+1,a)+";",a),o.insertCSSRule(this._styles,n+'[data-gs-y="'+a+'"]',"top: "+t(a,a)+";",a);this._styles._max=e}}},n.prototype._updateContainerHeight=function(){if(!this.grid._updateCounter){var e=this.grid.getGridHeight();this.container.attr("data-gs-current-height",e),this.opts.cellHeight&&(this.opts.verticalMargin?this.opts.cellHeightUnit===this.opts.verticalMarginUnit?this.container.css("height",e*(this.opts.cellHeight+this.opts.verticalMargin)-this.opts.verticalMargin+this.opts.cellHeightUnit):this.container.css("height","calc("+(e*this.opts.cellHeight+this.opts.cellHeightUnit)+" + "+(e*(this.opts.verticalMargin-1)+this.opts.verticalMarginUnit)+")"):this.container.css("height",e*this.opts.cellHeight+this.opts.cellHeightUnit))}},n.prototype._isOneColumnMode=function(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<=this.opts.minWidth},n.prototype._setupRemovingTimeout=function(e){var t=this,n=_(e).data("_gridstack_node");!n._removeTimeout&&t.opts.removable&&(n._removeTimeout=setTimeout(function(){e.addClass("grid-stack-item-removing"),n._isAboutToRemove=!0},t.opts.removeTimeout))},n.prototype._clearRemovingTimeout=function(e){var t=_(e).data("_gridstack_node");t._removeTimeout&&(clearTimeout(t._removeTimeout),t._removeTimeout=null,e.removeClass("grid-stack-item-removing"),t._isAboutToRemove=!1)},n.prototype._prepareElementsByNode=function(o,r){if("undefined"!=typeof _.ui){var l,c,d=this,e=function(e,t){var n,i,a=Math.round(t.position.left/l),s=Math.floor((t.position.top+c/2)/c);if("drag"!=e.type&&(n=Math.round(t.size.width/l),i=Math.round(t.size.height/c)),"drag"==e.type)a<0||a>=d.grid.width||s<0?(!0===d.opts.removable&&d._setupRemovingTimeout(o),a=r._beforeDragX,s=r._beforeDragY,d.placeholder.detach(),d.placeholder.hide(),d.grid.removeNode(r),d._updateContainerHeight(),r._temporaryRemoved=!0):(d._clearRemovingTimeout(o),r._temporaryRemoved&&(d.grid.addNode(r),d.placeholder.attr("data-gs-x",a).attr("data-gs-y",s).attr("data-gs-width",n).attr("data-gs-height",i).show(),d.container.append(d.placeholder),r.el=d.placeholder,r._temporaryRemoved=!1));else if("resize"==e.type&&a<0)return;d.grid.canMoveNode(r,a,s,n,i)&&(d.grid.moveNode(r,a,s,n,i),d._updateContainerHeight())},t=function(e){d.container.append(d.placeholder);var t=_(this);d.grid.cleanNodes(),d.grid.beginUpdate(r),l=d.cellWidth();var n=Math.ceil(t.outerHeight()/t.attr("data-gs-height"));c=d.container.height()/parseInt(d.container.attr("data-gs-current-height")),d.placeholder.attr("data-gs-x",t.attr("data-gs-x")).attr("data-gs-y",t.attr("data-gs-y")).attr("data-gs-width",t.attr("data-gs-width")).attr("data-gs-height",t.attr("data-gs-height")).show(),r.el=d.placeholder,r._beforeDragX=r.x,r._beforeDragY=r.y,o.resizable("option","minWidth",l*(r.minWidth||1)),o.resizable("option","minHeight",n*(r.minHeight||1)),"resizestart"==e.type&&t.find(".grid-stack-item").trigger("resizestart")},n=function(e){var t=_(this);if(t.data("_gridstack_node")){var n=!1;d.placeholder.detach(),r.el=t,d.placeholder.hide(),r._isAboutToRemove?(n=!0,o.removeData("_gridstack_node"),o.remove()):(d._clearRemovingTimeout(o),r._temporaryRemoved?(t.attr("data-gs-x",r._beforeDragX).attr("data-gs-y",r._beforeDragY).attr("data-gs-width",r.width).attr("data-gs-height",r.height).removeAttr("style"),r.x=r._beforeDragX,r.y=r._beforeDragY,d.grid.addNode(r)):t.attr("data-gs-x",r.x).attr("data-gs-y",r.y).attr("data-gs-width",r.width).attr("data-gs-height",r.height).removeAttr("style")),d._updateContainerHeight(),d._triggerChangeEvent(n),d.grid.endUpdate();var i=t.find(".grid-stack");i.length&&"resizestop"==e.type&&(i.each(function(e,t){_(t).data("gridstack").onResizeHandler()}),t.find(".grid-stack-item").trigger("resizestop"))}};o.draggable(h.extend({},this.opts.draggable,{containment:this.opts.isNested?this.container.parent():null,start:t,stop:n,drag:e})).resizable(h.extend({},this.opts.resizable,{start:t,stop:n,resize:e})),(r.noMove||this._isOneColumnMode()||this.opts.disableDrag)&&o.draggable("disable"),(r.noResize||this._isOneColumnMode()||this.opts.disableResize)&&o.resizable("disable"),o.attr("data-gs-locked",r.locked?"yes":null)}},n.prototype._prepareElement=function(e,t){t=void 0!==t&&t;var n=this;(e=_(e)).addClass(this.opts.itemClass);var i=n.grid.addNode({x:e.attr("data-gs-x"),y:e.attr("data-gs-y"),width:e.attr("data-gs-width"),height:e.attr("data-gs-height"),maxWidth:e.attr("data-gs-max-width"),minWidth:e.attr("data-gs-min-width"),maxHeight:e.attr("data-gs-max-height"),minHeight:e.attr("data-gs-min-height"),autoPosition:o.toBool(e.attr("data-gs-auto-position")),noResize:o.toBool(e.attr("data-gs-no-resize")),noMove:o.toBool(e.attr("data-gs-no-move")),locked:o.toBool(e.attr("data-gs-locked")),el:e,id:e.attr("data-gs-id"),_grid:n},t);e.data("_gridstack_node",i),this._prepareElementsByNode(e,i)},n.prototype.setAnimation=function(e){e?this.container.addClass("grid-stack-animate"):this.container.removeClass("grid-stack-animate")},n.prototype.addWidget=function(e,t,n,i,a,s,o,r,l,c,d){return e=_(e),void 0!==t&&e.attr("data-gs-x",t),void 0!==n&&e.attr("data-gs-y",n),void 0!==i&&e.attr("data-gs-width",i),void 0!==a&&e.attr("data-gs-height",a),void 0!==s&&e.attr("data-gs-auto-position",s?"yes":null),void 0!==o&&e.attr("data-gs-min-width",o),void 0!==r&&e.attr("data-gs-max-width",r),void 0!==l&&e.attr("data-gs-min-height",l),void 0!==c&&e.attr("data-gs-max-height",c),void 0!==d&&e.attr("data-gs-id",d),this.container.append(e),this._prepareElement(e,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),e},n.prototype.makeWidget=function(e){return e=_(e),this._prepareElement(e,!0),this._triggerAddEvent(),this._updateContainerHeight(),this._triggerChangeEvent(!0),e},n.prototype.willItFit=function(e,t,n,i,a){var s={x:e,y:t,width:n,height:i,autoPosition:a};return this.grid.canBePlacedWithRespectToHeight(s)},n.prototype.removeWidget=function(e,t){t=void 0===t||t;var n=(e=_(e)).data("_gridstack_node");n||(n=this.grid.getNodeDataByDOMEl(e)),this.grid.removeNode(n,t),e.removeData("_gridstack_node"),this._updateContainerHeight(),t&&e.remove(),this._triggerChangeEvent(!0),this._triggerRemoveEvent()},n.prototype.removeAll=function(t){h.each(this.grid.nodes,h.bind(function(e){this.removeWidget(e.el,t)},this)),this.grid.nodes=[],this._updateContainerHeight()},n.prototype.destroy=function(e){_(window).off("resize",this.onResizeHandler),this.disable(),void 0===e||e?this.container.remove():(this.removeAll(!1),this.container.removeData("gridstack")),o.removeStylesheet(this._stylesId),this.grid&&(this.grid=null)},n.prototype.resizable=function(e,i){var a=this;return(e=_(e)).each(function(e,t){var n=(t=_(t)).data("_gridstack_node");null!=n&&"undefined"!=typeof _.ui&&(n.noResize=!i,n.noResize||a._isOneColumnMode()?t.resizable("disable"):t.resizable("enable"))}),this},n.prototype.movable=function(e,i){var a=this;return(e=_(e)).each(function(e,t){var n=(t=_(t)).data("_gridstack_node");null!=n&&"undefined"!=typeof _.ui&&(n.noMove=!i,n.noMove||a._isOneColumnMode()?(t.draggable("disable"),t.removeClass("ui-draggable-handle")):(t.draggable("enable"),t.addClass("ui-draggable-handle")))}),this},n.prototype.enableMove=function(e,t){this.movable(this.container.children("."+this.opts.itemClass),e),t&&(this.opts.disableDrag=!e)},n.prototype.enableResize=function(e,t){this.resizable(this.container.children("."+this.opts.itemClass),e),t&&(this.opts.disableResize=!e)},n.prototype.disable=function(){this.movable(this.container.children("."+this.opts.itemClass),!1),this.resizable(this.container.children("."+this.opts.itemClass),!1),this.container.trigger("disable")},n.prototype.enable=function(){this.movable(this.container.children("."+this.opts.itemClass),!0),this.resizable(this.container.children("."+this.opts.itemClass),!0),this.container.trigger("enable")},n.prototype.locked=function(e,i){return(e=_(e)).each(function(e,t){var n=(t=_(t)).data("_gridstack_node");null!=n&&(n.locked=i||!1,t.attr("data-gs-locked",n.locked?"yes":null))}),this},n.prototype.maxHeight=function(e,i){return(e=_(e)).each(function(e,t){var n=(t=_(t)).data("_gridstack_node");null!=n&&(isNaN(i)||(n.maxHeight=i||!1,t.attr("data-gs-max-height",i)))}),this},n.prototype.minHeight=function(e,i){return(e=_(e)).each(function(e,t){var n=(t=_(t)).data("_gridstack_node");null!=n&&(isNaN(i)||(n.minHeight=i||!1,t.attr("data-gs-min-height",i)))}),this},n.prototype.maxWidth=function(e,i){return(e=_(e)).each(function(e,t){var n=(t=_(t)).data("_gridstack_node");null!=n&&(isNaN(i)||(n.maxWidth=i||!1,t.attr("data-gs-max-width",i)))}),this},n.prototype.minWidth=function(e,i){return(e=_(e)).each(function(e,t){var n=(t=_(t)).data("_gridstack_node");null!=n&&(isNaN(i)||(n.minWidth=i||!1,t.attr("data-gs-min-width",i)))}),this},n.prototype._updateElement=function(e,t){var n=(e=_(e).first()).data("_gridstack_node");if(null!=n){var i=this;i.grid.cleanNodes(),i.grid.beginUpdate(n),t.call(this,e,n),i._updateContainerHeight(),i._triggerChangeEvent(),i.grid.endUpdate()}},n.prototype.resize=function(e,n,i){this._updateElement(e,function(e,t){n=null!=n?n:t.width,i=null!=i?i:t.height,this.grid.moveNode(t,t.x,t.y,n,i)})},n.prototype.move=function(e,n,i){this._updateElement(e,function(e,t){n=null!=n?n:t.x,i=null!=i?i:t.y,this.grid.moveNode(t,n,i,t.width,t.height)})},n.prototype.update=function(e,n,i,a,s){this._updateElement(e,function(e,t){n=null!=n?n:t.x,i=null!=i?i:t.y,a=null!=a?a:t.width,s=null!=s?s:t.height,this.grid.moveNode(t,n,i,a,s)})},n.prototype.verticalMargin=function(e,t){if(void 0===e)return this.opts.verticalMargin;var n=o.parseHeight(e);this.opts.verticalMarginUnit===n.unit&&this.opts.height===n.height||(this.opts.verticalMarginUnit=n.unit,this.opts.verticalMargin=n.height,t||this._updateStyles())},n.prototype.cellHeight=function(e,t){if(void 0===e){if(this.opts.cellHeight)return this.opts.cellHeight;var n=this.container.children("."+this.opts.itemClass).first();return Math.ceil(n.outerHeight()/n.attr("data-gs-height"))}var i=o.parseHeight(e);this.opts.cellHeightUnit===i.heightUnit&&this.opts.height===i.height||(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.height,t||this._updateStyles())},n.prototype.cellWidth=function(){return Math.round(this.container.outerWidth()/this.opts.width)},n.prototype.getCellFromPixel=function(e,t){var n=void 0!==t&&t?this.container.offset():this.container.position(),i=e.left-n.left,a=e.top-n.top,s=Math.floor(this.container.width()/this.opts.width),o=Math.floor(this.container.height()/parseInt(this.container.attr("data-gs-current-height")));return{x:Math.floor(i/s),y:Math.floor(a/o)}},n.prototype.batchUpdate=function(){this.grid.batchUpdate()},n.prototype.commit=function(){this.grid.commit(),this._updateContainerHeight()},n.prototype.isAreaEmpty=function(e,t,n,i){return this.grid.isAreaEmpty(e,t,n,i)},n.prototype.setStatic=function(e){this.opts.staticGrid=!0===e,this.enableMove(!e),this.enableResize(!e),this._setStaticClass()},n.prototype._setStaticClass=function(){var e="grid-stack-static";!0===this.opts.staticGrid?this.container.addClass(e):this.container.removeClass(e)},n.prototype._updateNodeWidths=function(e,t){this.grid._sortNodes(),this.grid.batchUpdate();for(var n={},i=0;i<this.grid.nodes.length;i++)n=this.grid.nodes[i],this.update(n.el,Math.round(n.x*t/e),undefined,Math.round(n.width*t/e),undefined);this.grid.commit()},n.prototype.setGridWidth=function(e,t){this.container.removeClass("grid-stack-"+this.opts.width),!0!==t&&this._updateNodeWidths(this.opts.width,e),this.opts.width=e,this.grid.width=e,this.container.addClass("grid-stack-"+e)},p.prototype.batch_update=t(p.prototype.batchUpdate),p.prototype._fix_collisions=t(p.prototype._fixCollisions,"_fix_collisions","_fixCollisions"),p.prototype.is_area_empty=t(p.prototype.isAreaEmpty,"is_area_empty","isAreaEmpty"),p.prototype._sort_nodes=t(p.prototype._sortNodes,"_sort_nodes","_sortNodes"),p.prototype._pack_nodes=t(p.prototype._packNodes,"_pack_nodes","_packNodes"),p.prototype._prepare_node=t(p.prototype._prepareNode,"_prepare_node","_prepareNode"),p.prototype.clean_nodes=t(p.prototype.cleanNodes,"clean_nodes","cleanNodes"),p.prototype.get_dirty_nodes=t(p.prototype.getDirtyNodes,"get_dirty_nodes","getDirtyNodes"),p.prototype.add_node=t(p.prototype.addNode,"add_node","addNode, "),p.prototype.remove_node=t(p.prototype.removeNode,"remove_node","removeNode"),p.prototype.can_move_node=t(p.prototype.canMoveNode,"can_move_node","canMoveNode"),p.prototype.move_node=t(p.prototype.moveNode,"move_node","moveNode"),p.prototype.get_grid_height=t(p.prototype.getGridHeight,"get_grid_height","getGridHeight"),p.prototype.begin_update=t(p.prototype.beginUpdate,"begin_update","beginUpdate"),p.prototype.end_update=t(p.prototype.endUpdate,"end_update","endUpdate"),p.prototype.can_be_placed_with_respect_to_height=t(p.prototype.canBePlacedWithRespectToHeight,"can_be_placed_with_respect_to_height","canBePlacedWithRespectToHeight"),n.prototype._trigger_change_event=t(n.prototype._triggerChangeEvent,"_trigger_change_event","_triggerChangeEvent"),n.prototype._init_styles=t(n.prototype._initStyles,"_init_styles","_initStyles"),n.prototype._update_styles=t(n.prototype._updateStyles,"_update_styles","_updateStyles"),n.prototype._update_container_height=t(n.prototype._updateContainerHeight,"_update_container_height","_updateContainerHeight"),n.prototype._is_one_column_mode=t(n.prototype._isOneColumnMode,"_is_one_column_mode","_isOneColumnMode"),n.prototype._prepare_element=t(n.prototype._prepareElement,"_prepare_element","_prepareElement"),n.prototype.set_animation=t(n.prototype.setAnimation,"set_animation","setAnimation"),n.prototype.add_widget=t(n.prototype.addWidget,"add_widget","addWidget"),n.prototype.make_widget=t(n.prototype.makeWidget,"make_widget","makeWidget"),n.prototype.will_it_fit=t(n.prototype.willItFit,"will_it_fit","willItFit"),n.prototype.remove_widget=t(n.prototype.removeWidget,"remove_widget","removeWidget"),n.prototype.remove_all=t(n.prototype.removeAll,"remove_all","removeAll"),n.prototype.min_height=t(n.prototype.minHeight,"min_height","minHeight"),n.prototype.min_width=t(n.prototype.minWidth,"min_width","minWidth"),n.prototype._update_element=t(n.prototype._updateElement,"_update_element","_updateElement"),n.prototype.cell_height=t(n.prototype.cellHeight,"cell_height","cellHeight"),n.prototype.cell_width=t(n.prototype.cellWidth,"cell_width","cellWidth"),n.prototype.get_cell_from_pixel=t(n.prototype.getCellFromPixel,"get_cell_from_pixel","getCellFromPixel"),n.prototype.batch_update=t(n.prototype.batchUpdate,"batch_update","batchUpdate"),n.prototype.is_area_empty=t(n.prototype.isAreaEmpty,"is_area_empty","isAreaEmpty"),n.prototype.set_static=t(n.prototype.setStatic,"set_static","setStatic"),n.prototype._set_static_class=t(n.prototype._setStaticClass,"_set_static_class","_setStaticClass"),e.GridStackUI=n,e.GridStackUI.Utils=o,e.GridStackUI.Engine=p,_.fn.gridstack=function(t){return this.each(function(){var e=_(this);e.data("gridstack")||e.data("gridstack",new n(this,t))})},e.GridStackUI}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Clipboard=e()}}(function(){var o;return function d(s,o,r){function l(n,e){if(!o[n]){if(!s[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(c)return c(n,!0);var i=new Error("Cannot find module '"+n+"'");throw i.code="MODULE_NOT_FOUND",i}var a=o[n]={exports:{}};s[n][0].call(a.exports,function(e){var t=s[n][1][e];return l(t||e)},a,a.exports,d,s,o,r)}return o[n].exports}for(var c="function"==typeof require&&require,e=0;e<r.length;e++)l(r[e]);return l}({1:[function(e,t){function n(e,t){for(;e&&e.nodeType!==i;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var a=Element.prototype;a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}t.exports=n},{}],2:[function(e,t){function n(e,t,n,i,a){var s=o.apply(this,arguments);return e.addEventListener(n,s,a),{destroy:function(){e.removeEventListener(n,s,a)}}}function o(t,n,e,i){return function(e){e.delegateTarget=a(e.target,n),e.delegateTarget&&i.call(t,e)}}var a=e("./closest");t.exports=n},{"./closest":1}],3:[function(e,t,n){n.node=function(e){return e!==undefined&&e instanceof HTMLElement&&1===e.nodeType},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return e!==undefined&&("[object NodeList]"===t||"[object HTMLCollection]"===t)&&"length"in e&&(0===e.length||n.node(e[0]))},n.string=function(e){return"string"==typeof e||e instanceof String},n.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},{}],4:[function(e,t){function n(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!o.string(t))throw new TypeError("Second argument must be a String");if(!o.fn(n))throw new TypeError("Third argument must be a Function");if(o.node(e))return i(e,t,n);if(o.nodeList(e))return a(e,t,n);if(o.string(e))return s(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}function a(e,t,n){return Array.prototype.forEach.call(e,function(e){e.addEventListener(t,n)}),{destroy:function(){Array.prototype.forEach.call(e,function(e){e.removeEventListener(t,n)})}}}function s(e,t,n){return r(document.body,e,t,n)}var o=e("./is"),r=e("delegate");t.exports=n},{"./is":3,delegate:2}],5:[function(e,t){function n(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),a=document.createRange();a.selectNodeContents(e),i.removeAllRanges(),i.addRange(a),t=i.toString()}return t}t.exports=n},{}],6:[function(e,t){function n(){}n.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){function i(){a.off(e,i),t.apply(n,arguments)}var a=this;return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,a=n.length;i<a;i++)n[i].fn.apply(n[i].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),i=n[e],a=[];if(i&&t)for(var s=0,o=i.length;s<o;s++)i[s].fn!==t&&i[s].fn._!==t&&a.push(i[s]);return a.length?n[e]=a:delete n[e],this}},t.exports=n},{}],7:[function(i,a,s){!function(e,t){if("function"==typeof o&&o.amd)o(["module","select"],t);else if(void 0!==s)t(a,i("select"));else{var n={exports:{}};t(n,e.select),e.clipboardAction=n.exports}}(this,function(e,t){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var h=n(t),p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),i=function(){function t(e){_(this,t),this.resolveOptions(e),this.initSelection()}return f(t,[{key:"resolveOptions",value:function n(e){var t=0<arguments.length&&e!==undefined?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function e(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function i(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,h["default"])(this.fakeElem),this.copyText()}},{key:"removeFake",value:function a(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function s(){this.selectedText=(0,h["default"])(this.target),this.copyText()}},{key:"copyText",value:function o(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function r(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function l(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function c(){this.removeFake()}},{key:"action",set:function d(e){var t=0<arguments.length&&e!==undefined?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function u(){return this._action}},{key:"target",set:function d(e){if(e!==undefined){if(
!e||"object"!==(void 0===e?"undefined":p(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function u(){return this._target}}]),t}();e.exports=i})},{select:5}],8:[function(i,a,s){!function(e,t){if("function"==typeof o&&o.amd)o(["module","./clipboard-action","tiny-emitter","good-listener"],t);else if(void 0!==s)t(a,i("./clipboard-action"),i("tiny-emitter"),i("good-listener"));else{var n={exports:{}};t(n,e.clipboardAction,e.tinyEmitter,e.goodListener),e.clipboard=n.exports}}(this,function(e,t,n,i){"use strict";function a(e){return e&&e.__esModule?e:{"default":e}}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}var h=a(t),p=a(n),f=a(i),m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g=function(){function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}}(),s=function(){function i(e,t){c(this,i);var n=d(this,(i.__proto__||Object.getPrototypeOf(i)).call(this));return n.resolveOptions(t),n.listenClick(e),n}return u(i,p["default"]),g(i,[{key:"resolveOptions",value:function n(e){var t=0<arguments.length&&e!==undefined?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===m(t.container)?t.container:document.body}},{key:"listenClick",value:function a(e){var t=this;this.listener=(0,f["default"])(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function s(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new h["default"]({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function t(e){return _("action",e)}},{key:"defaultTarget",value:function o(e){var t=_("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function r(e){return _("text",e)}},{key:"destroy",value:function e(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function l(e){var t=0<arguments.length&&e!==undefined?arguments[0]:["copy","cut"],n="string"==typeof t?[t]:t,i=!!document.queryCommandSupported;return n.forEach(function(e){i=i&&!!document.queryCommandSupported(e)}),i}}]),i}();e.exports=s})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}),$(function(r){"en"==r("body").data("language")&&(r.fn.datepicker.dates.en.format="yyyy/mm/dd",r.fn.datepicker.defaults.language="en",r.fn.datetimepicker.defaults.locale="en",r.extend(r.fn.select2.defaults,r.fn.select2.locales.en)),setInterval(function(){r.ajax({url:"/xhr/notifications/reload",type:"GET"}).done(function(e){0!=e.result&&(r("#js_badge_unread_notifications_num").hide(),r("#js_badge_unread_notifications_num_append").html('<div style="position: absolute; bottom: 10px; left: 7px;"><span class="badge" id="js_badge_unread_notifications_num" style="background-color: red;">'+e.result+"</span></div>"))})},6e4);var e=r("body");if(e.data("controller_name")!=undefined){var t=e.data("controller_name").replace(/\//g,"_"),n=e.data("action_name"),i=App[t];i!==undefined&&r.isFunction(i[n])&&i[n]()}r(".item_datepicker").datepicker(),App.concerns.set_tooltip(),r(document).ready(function(){r(".hp-tooltip-help-link").hover(function(){r(this).find(".tooltip-text-bottom").css("display","flex")},function(){r(this).find(".tooltip-text-bottom").css("display","none")})}),r(document).on("keydown",".hp-tooltip-help-link",function(e){"Enter"==e.key&&(e.preventDefault(),r(this).blur(),window.open(r(this).attr("href"),"_blank"))}),App.concerns.set_tooltip_route_link(),r(document).on("click",".deal-sheet-detail-page-top",function(){r("#scroll_container").animate({scrollTop:0},100)}),r(document).on("click",".page-top",function(){r("html,body").animate({scrollTop:0},100)}),r(document).on("click",".modal-top",function(){r(".modal").animate({scrollTop:0},100)}),r(document).on("show.bs.modal",".modal",function(e){"bs.modal"==e.namespace&&"modal_search"!=e.target.id&&App.concerns.fix_background()}),r(document).on("hidden.bs.modal",".modal",function(){"modal_search"!=r(this).attr("id")&&App.concerns.unfix_background()}),r(document).on("click",".modal-caller",function(e){r(this).tooltip("hide"),e.currentTarget.setAttribute("disabled","disabled");var t=r(this).closest(".modal");0<t.length?t.children(".modal-caller").css("pointer-events","none"):r(".modal-caller").not(".modal .modal-caller").css("pointer-events","none")}),r(document).on("click",".modal-caller.notification",function(e){var t=e||window.event;(t.ctrlKey||t.shiftKey||t.metaKey)&&(r(".modal-caller").attr("disabled",null),r(".modal-caller").css("pointer-events",""))}),r(document).on("hidden.bs.modal",".modal",function(){r(".img_button").attr("disabled",null),r(".modal-caller").attr("disabled",null),r(".modal-caller").css("pointer-events",""),r(".img_button").attr("style","opacity: 1;")}),r("img").lazyload(),r('[data-toggle="popover"]').popover(),r("body").on("click",function(e){r('[data-toggle="popover"]').each(function(){r(this).is(e.target)||0!==r(this).has(e.target).length||0!==r(".popover").has(e.target).length||r(this).popover("hide")})});var a=location.hash;a.match(/comment/)&&App.concerns.scroll_to_target(a),r("#map_target_extraction").on("click",function(e){e.preventDefault();var o=r("#target-extraction");0===o.length?r.ajax({url:"/xhr/maps/target_extraction",dataType:"html",data:{dataType:"html"}}).done(function(e){r("body").append(e);var t=r(".hp-map-page");App.lead_filters.target_extraction_condition_modal(t),App.lead_filters.all_checked_items(),App.concerns.attach_select_search_handlers(t),App.concerns.attach_date_time_picker_handlers(t),App.concerns.attach_date_picker_handlers(t),App.lead_filters.lead_filter_modal(t),t.find('[data-hp-role="select2"]').select2({minimumResultsForSearch:20}),(o=r("#target-extraction")).on("show.bs.modal",function(){r("body").addClass("hp-map-body")}),o.on("hidden.bs.modal",function(){r("body").removeClass("hp-map-body")}),o.modal("show");var n=r("#lead_filter_lead_ids"),i=r("#lead_filter_indivisual_lead_ids"),a=r('[data-hp-role="decision"]'),s=r("[data-hp-role='individual-decision']");a.off("click"),a.on("click",function(e){if(e.preventDefault(),r('[data-toggle="dropdown"]').parent().removeClass("open"),0!=r(this).data("hp-error").length)return alert(r(this).data("hp-error")),!1;var t=r("#js_transition_map");n.attr("name","lead_filter[lead_ids]"),t.off("submit"),t.submit(),t.on("submit",function(e){e.preventDefault()}),n.removeAttr("name")}),s.off("click"),s.on("click",function(e){e.preventDefault(),r('[data-toggle="dropdown"]').parent().removeClass("open");var t=r("#js_indivisual_transition_map"),n=r.map(r("[name='lead_filter[lead_ids][]']:checked"),function(e){return r(e).val()});if(0==n.length)return alert(r(this).data("hp-error")),!1;i.val(n.join(",")),i.attr("name","lead_filter[lead_ids]"),t.off("submit"),t.submit(),t.on("submit",function(e){e.preventDefault()}),i.removeAttr("name")})}):o.modal("show")}),App.new_notifications.set_favicon(),r(document).on("click","#search_assoc_by_default_condition",function(){r("form.association_search_form")[0].reset(),r("form.association_search_form").find("#search_segment_id").val(""),r("#search_user_ids_on_search_association_modal, #search_pref_ids_on_search_association_modal, #search_status_kbn_ids, #search_status_in, #search_user_ids_on_search_as_association_modal, #search_segment_id").trigger("change")}),r(document).on("click",".js-clear-default-condition-button",function(){r(this).parents(".modal-search-area").find("form.association_search_form")[0].reset(),r(this).parents(".modal-search-area").find("#search_simple").val(""),r(this).parents(".modal-search-area").find("#search_user_ids_on_search_association_modal").trigger("change"),r(this).parents(".modal-search-area").find("#search_client_id_on_search_association_modal").trigger("change"),r(this).parents(".modal-search-area").find("#search_pref_ids_on_search_association_modal").trigger("change"),r(this).parents(".modal-search-area").find("#search_status_kbn_ids").trigger("change"),r(this).parents(".modal-search-area").find("#search_status_in").trigger("change"),r(this).parents(".modal-search-area").find("#search_user_ids_on_search_as_association_modal").trigger("change")}),r(document).on("click",".js-clear-default-condition-with-tab-button",function(){r(this).parents(".modal-search-area").find("form.association_tab_search_form")[0].reset(),r(this).parents(".modal-search-area").find("#search_owner_user_ids_on_search_association_modal").trigger("change"),r(this).parents(".modal-search-area").find("#departments").trigger("change"),r(this).parents(".modal-search-area").find("#search_user_ids_on_search_association_modal").trigger("change"),r(this).parents(".modal-search-area").find("#search_pref_ids_on_search_association_modal").trigger("change"),r(this).parents(".modal-search-area").find("#search_status_kbn_ids").trigger("change"),r(this).parents(".modal-search-area").find("#search_status_in").trigger("change"),r(this).parents(".modal-search-area").find("#search_user_ids_on_search_as_association_modal").trigger("change")}),CustomerSheets.init(),CommunicationModals.init(),RelationModals.init(),App.concerns.show_correspondence_history(),r(document).on("click",".check-pagination-close-link",function(){return r.ajax({url:r(this).attr("href"),dataType:"json",success:function(e){location.href=e.path},error:function(e){alert(e.responseJSON.error)}}),!1}),r(document).on("click",".pagination-link",function(){var t=-1!==this.href.indexOf("next");return r.when(r.ajax({url:r(this).attr("href"),dataType:"json",success:function(e){r.ajax({type:"POST",url:e.path,dataType:"script",data:{tbc_with_custom_item_param_mapping:r("#tbc_with_custom_item_param_mapping").val(),temporary_business_card_id:r("#temporary_business_card_id").val(),temporary_business_card_basic_item_client_name:r("#temporary_business_card_basic_item_client_name").val()||r("#temporary_business_card_basic_items_for_mail_client_name").val(),temporary_business_card_basic_item_organization_name:r("#temporary_business_card_basic_item_organization_name").val()||r("#temporary_business_card_basic_items_for_mail_organization_name").val(),temporary_business_card_basic_item_post:r("#temporary_business_card_basic_item_post").val()||r("#temporary_business_card_basic_items_for_mail_post").val(),temporary_business_card_basic_item_family_name:r("#temporary_business_card_basic_item_family_name").val()||r("#temporary_business_card_basic_items_for_mail_family_name").val(),temporary_business_card_basic_item_first_name:r("#temporary_business_card_basic_item_first_name").val()||r("#temporary_business_card_basic_items_for_mail_first_name").val(),temporary_business_card_basic_item_email:r("#temporary_business_card_basic_item_email").val()||r("#temporary_business_card_basic_items_for_mail_email").val(),update_flg:t}})},error:function(){r.ajax({type:"POST",url:"/xhr/temporary_business_cards/check_tbc_modal",dataType:"script",data:{tbc_with_custom_item_param_mapping:r("#tbc_with_custom_item_param_mapping").val(),temporary_business_card_id:r("#temporary_business_card_id").val(),temporary_business_card_basic_item_client_name:r("#temporary_business_card_basic_item_client_name").val()||r("#temporary_business_card_basic_items_for_mail_client_name").val(),temporary_business_card_basic_item_organization_name:r("#temporary_business_card_basic_item_organization_name").val()||r("#temporary_business_card_basic_items_for_mail_organization_name").val(),temporary_business_card_basic_item_post:r("#temporary_business_card_basic_item_post").val()||r("#temporary_business_card_basic_items_for_mail_post").val(),temporary_business_card_basic_item_family_name:r("#temporary_business_card_basic_item_family_name").val()||r("#temporary_business_card_basic_items_for_mail_family_name").val(),temporary_business_card_basic_item_first_name:r("#temporary_business_card_basic_item_first_name").val()||r("#temporary_business_card_basic_items_for_mail_first_name").val(),temporary_business_card_basic_item_email:r("#temporary_business_card_basic_item_email").val()||r("#temporary_business_card_basic_items_for_mail_email").val(),update_flg:"true"}})}})).always(function(){setTimeout(function(){r("#search_to_ids").trigger("change.select2"),r("#search_cc_ids").trigger("change.select2"),r("#search_bcc_ids").trigger("change.select2"),""!==r("#search_to_ids").val()&&1===r("#search_to_ids").val().split(",").length&&r("#mail_template_id").change()},2e3)}),!1}),r(document).on("click","#close_check_tbc_modal",function(){var e=r("#modal_block_for_check_tbc_modal").val()||"to",t=r("#search_"+e+"_ids").val().split(",").filter(function(e){return-1==r("#canceled_exclude_tbc_ids").val().split(" ").indexOf(e)});r("#tbc_edited_"+e+"_ids").val(t),r("#search_"+e+"_ids").val(t).trigger("change.select2")}),r(document).on("show.bs.modal","#modal_check_tbc",function(){r(".modal-backdrop").last().css("z-index",1055),App.concerns.generate_tooptip(r(".hp-tooltip-text"))}),r(document).on("keydown","#modal_check_tbc .form-control",function(e){13==e.keyCode&&(e.preventDefault(),r("#update_tbc").addClass("ui-state-hover").click())}),r(".detail-page-paginator").removeClass("hide"),r.fn.modal.Constructor.prototype.enforceFocus=function(){},r(document).on("ready",function(){var e=r(".navbar.navbar-inverse").outerHeight();if(72<=e&&!r("#app_wrapper").hasClass("longer")){var t=e-60;r("#app_wrapper").addClass("longer"),r("#app_wrapper").css("margin-top",t+"px")}else e<=72&&r("#app_wrapper").hasClass("longer")&&(r("#app_wrapper").removeClass("longer"),r("#app_wrapper").css("margin-top","0"));if(72<=e&&!r("#global_menu_wrapper").hasClass("longer")){t=e-17;r("#global_menu_wrapper").addClass("longer"),r("#global_menu_wrapper").css("margin-top",t+"px")}else e<=72&&r("#global_menu_wrapper").hasClass("longer")&&(r("#global_menu_wrapper").removeClass("longer"),r("#global_menu_wrapper").css("margin-top","0"));0==r("#app_wrapper").find("#row-wrapper").find("#row-footer-wrapper").find("#footer").length&&1==r("#app_wrapper").find("#row-footer-wrapper").find("#footer").length?r("#row-footer-wrapper").addClass("row"):1==r("#app_wrapper").find("#row-wrapper").find("#col-wrapper").find("#row-footer-wrapper").find("#footer").length&&r("#footer").removeClass("col-xs-12")}),r(window).on("resize",function(){var e=r(".navbar.navbar-inverse").outerHeight();if(72<=e&&!r("#app_wrapper").hasClass("longer")){var t=e-60;r("#app_wrapper").addClass("longer"),r("#app_wrapper").css("margin-top",t+"px")}else e<=72&&r("#app_wrapper").hasClass("longer")&&(r("#app_wrapper").removeClass("longer"),r("#app_wrapper").css("margin-top","0"));if(72<=e&&!r("#global_menu_wrapper").hasClass("longer")){t=e-17;r("#global_menu_wrapper").addClass("longer"),r("#global_menu_wrapper").css("margin-top",t+"px")}else e<=72&&r("#global_menu_wrapper").hasClass("longer")&&(r("#global_menu_wrapper").removeClass("longer"),r("#global_menu_wrapper").css("margin-top","0"))}),r(document).on("ready",function(){var t=9;$dropdown_menus=r(".navbar-left .dropdown .dropdown-menu"),$dropdown_menus.each(function(){var e=(r(this).outerWidth(!0)-t).toString();r(this).children(".dropdown-submenu").children(".dropdown-menu").css({left:e+"px"})}),$dropdown_menus=r(".navbar-right .dropdown .dropdown-menu"),$dropdown_menus.each(function(){var e=(r(this).outerWidth(!0)-t).toString();r(this).children(".dropdown-submenu").children(".dropdown-menu").css({right:e+"px"})})}),r(".img_button").on("click",function(){r(this).attr("disabled",!0),r(this).attr("style","opacity: 0.5;")})}),Highcharts.setOptions({lang:{thousandsSep:","}}),$(window).bind("unload",function(){}),setInterval(function(){var e=$(document).find(".select2-container-multi.select2-drop-above");if(e.length){var t=e.offset().top-$("#select2-drop").outerHeight(!1)+Number($("body").css("top").replace(/[^0-9]/g,""))+"px";$("#select2-drop").css({top:t})}},100),$(document).on("click",".item-link",function(){$(".item-link").addClass("disabled"),$(".noti-link").addClass("disabled")}),$(document).on("click",".noti-link",function(){$(this).parent().parent().addClass("read")}),$(document).on("click",".global-menu-close-btn",function(){$(this).parent().alert("close")}),$(document).on("click",".activity-collapse-link-business-category",function(){$(this).hasClass("in")?$(this).removeClass("in"):$(this).addClass("in")}),$(document).on("click","#collapse-link",function(){$(this).hasClass("in")?$(this).removeClass("in"):$(this).addClass("in")}),$(document).on("click",".all-open-accordion-business-category",function(){$(this).parent().children().find(".collapse").collapse("show"),$(this).parent().children().find(".activity-collapse-link-business-category").addClass("in")}),$(document).on("click",".all-close-accordion-business-category",function(){$(this).parent().children().find(".collapse").hasClass("in")&&$(this).parent().children().find(".collapse").collapse("hide"),$(this).parent().children().find(".activity-collapse-link-business-category").removeClass("in")}),$(document).on("click",".js-disable-button",function(){$(this).attr("disabled",!0)}),$(document).on("click",".node-organizations_tree .tree-view-detail-link, .node-organizations_tree_of_customer_sheets .tree-view-detail-link",function(e){e.preventDefault(),e.stopPropagation();var t=$(this).attr("href");"_blank"===$(this).attr("target")?window.open(t,"_blank"):window.location.assign(t)});