1var sm3=sm3||{};(function(){var r=599,f=768,h=991,n=function(){return window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth||$(window).width()},o=function(){return window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight||$(window).height()},t=function(){return n()<=r},e=function(){return o()<=r},i=function(){return t()||e()},s=function(){return!i()&&(n()<=f||o()<=f)},u=function(){return n()>f&&o()>f},c=function(){return u()&&"desktop"||i()&&"mobile"||s()&&"tablet"};sm3.isTabletBreakpoint=s;sm3.isDesktopBreakpoint=u;sm3.isHeightMinimumBreakpoint=e;sm3.isMinimumBreakpoint=i;sm3.isWidthMinimumBreakpoint=t;sm3.getDeviceType=c;$(function(){function p(n,t,i){var u=Utils.AppPath+"/Include/AJAX/MapSearch/GetListingDetailLayout.aspx?layoutId="+t+"&listingId="+rbw.context.Listing.ListingID,r=function(t){n[i?"after":"append"](t)};$.ajax({type:"GET",url:u,success:function(n){r(n)},error:function(){r('<h4 class="error">Error: Failed to load Layout ID '+t+".<\/h4>")}})}function c(n,t,i){rbw.utils.awaitSelector(n).then(function(){p($(n),t,i)})}function l(){c(".js-main-content-3-layout-marker",226,!0)}function a(){c(".js-sidebar-container-3-layout-marker",231,!0)}sm3.closeFiltersBox=function(){};var o={config:{tnknox:{name:"Patricia Corcoran",lic:"325242",email:"",phone:"844-400-9663"},"ohcincy-v":{name:"David Sonner",lic:"BRK.0000114798",email:"",phone:"844-400-9663"},"azwar-x":{name:"Jonathan Cerreta",lic:"BR536272000",email:"",phone:"844-400-9663"},copikes:{name:"Viola Robinson",lic:"ER1201535",email:"[email protected]",phone:"844-400-9663"},okcmbr:{name:"Steve D. Clinkenbeard",lic:"084507",email:"",phone:"844-400-XOME"}},template:'<div><span>Broker: <\/span><span class="tpl-name"><\/span> (Lic. #<span class="tpl-lic"><\/span>) <span class="tpl-row2"><span class="tpl-email"><\/span><span class="tpl-phone"><\/span><\/span><\/div>',_process:function(n){var t=this.config,i,r;return(n=n.toLowerCase(),!t||typeof t[n]=="undefined")?!1:(i=t[n],r=$(this.template),["name","lic","email","phone"].forEach(function(n){var t=$(".tpl-"+n,r);i[n]==""?t.remove():t.text(i[n])}),$(".broker-attr-container").html("").append(r).show(),!0)},processLDP:function(){($(".broker-attr-container").hide(),rbw&&rbw.context&&rbw.context.Listing)&&this._process(rbw.context.Listing.MLSShortName)},processSRP:function(n){$("#search-display-options-v3").removeClass("with-broker-attr");var t=n.find(function(n){return o.config.hasOwnProperty(n.MLSShortName.toLowerCase())});t&&this._process(t.MLSShortName)&&$("#search-display-options-v3").addClass("with-broker-attr")}},v=function(n){var t=$(n),u=t.find("html"),f=t.find("body"),e=t.find("#Master_Viewport"),i=Math.max(u.outerHeight(),f.outerHeight(),e.outerHeight()),o=Math.max(u.outerWidth(),f.outerWidth(),e.outerWidth()),r=(parseInt($(".modal-body").css("padding-top"))||0)+(parseInt($(".modal-body").css("padding-bottom"))||0)+(parseInt($(".modal-body").css("margin-top"))||0)+(parseInt($(".modal-body").css("margin-bottom"))||0)+(parseInt($(".modal-header").css("padding-top"))||0)+(parseInt($(".modal-header").css("padding-bottom"))||0)+(parseInt($(".modal-header").css("margin-top"))||0)+(parseInt($(".modal-header").css("margin-bottom"))||0);$("#search-options-modal .modal-content").height(i+r);$(".modal-save-properties .modal-content").height(i+r);$("#single-listing-overlay .modal-content").height(i+r)},f=new function(){var n=rbw&&rbw.storage&&rbw.storage.isSessionStorageEnabled(),t=function(t,i){n&&i&&rbw.storage.setSessionItem(t,typeof i=="string"?i:JSON.stringify(i))},r=function(t,i){if(n){var r=rbw.storage.getSessionItem(t);if(!i)return r;if(r&&r.length)try{return JSON.parse(r)}catch(u){}}return null},i=function(t){n&&rbw.storage.removeSessionItem(t)};this.storeListingDetailOverlay=function(n){t("sm3-overlay",{overlayType:"listingdetail",url:n})};this.storePublicRecordsOverlay=function(n,i){n&&i&&t("sm3-overlay",{overlayType:"publicrecords",propertyId:n,address:i})};this.handleSignIn=function(n){var i=r("sm3-overlay",!1);i&&t("sm3-overlay-restore",i);n&&n()};this.clearOverlay=function(){i("sm3-overlay")};this.clearOverlayRestore=function(){i("sm3-overlay-restore")};this.checkRestoreOverlay=function(n,t){var u=r("sm3-overlay-restore",!0);u&&u.overlayType&&(u.overlayType==="listingdetail"&&u.url?n(u.url):u.overlayType==="publicrecords"&&u.propertyId&&u.address&&t(u.propertyId,u.address),i("sm3-overlay-restore"))}},y=function(){var n,t;$(window).width()<1199&&(n=$("#request-showing-question-form"),n.addClass("panel"),n.addClass("panel-default"),t=$("#property-description-v3"),t.append(n))};(function(){$("body").attr("id")==="ui-searchmotifv3-listingdetail"&&(rbw&&rbw.context&&rbw.context.
1isWhiteLabel&&(o.processLDP(),l(),a()),$(document).trigger("navigation",[window.location.pathname+window.location.search]))})(),function(){var v=$("body").attr("id");if(v==="listing-listingsearch"||v==="listing-advancedlistinglanding"||v==="listing-jumpsearchesedit"||v==="listing-listingsearchresultsonly"||v==="account-savemapsearch"){var w=function(){},y=function(){},ht=function(){},c=function(){},b=function(){},ct="",p="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,vt=function(){for(var t="transform WebkitTransform MozTransform OTransform msTransform".split(" "),i=document.createElement("div"),n=0;n<t.length;++n)if(i&&i.style[t[n]]!==undefined)return t[n];return!1}(),lt=function(){return Number($("#fixed-site-header-height").val())||0},rt=function(){return $("html").scrollTop()||$("body").scrollTop()},k=function(n){return $("#search-results-container-v3").data("disable-slideout-overlay")?!1:typeof n!="undefined"&&n!==null&&typeof n.target!="undefined"&&typeof n.target.className!="undefined"&&n.target.className.indexOf("slick-arrow")!==-1?!1:rbw.context.isWhiteLabel?i()?!1:p?u():!0:!0},ut=function(){return $("#mapsearch-mainmap-results").hasClass("r-view-map")},yt=function(){return $("#mapsearch-mainmap-results").hasClass("r-view-gallery")},pt=function(){var n=document.getElementById("estimated-value-info-modal");n&&document.body.appendChild(n)},wt=function(){$("#estimated-value-info-modal").remove()},ft=function(n){f.storeListingDetailOverlay(n);var t=n+(/\?/.test(n)?"&":"?")+"overlayLdp=1",i=$.ajaxSetup.cache;$.ajaxSetup({cache:!0});$("#single-listing-overlay").attr("data-url",n).empty().load(t,function(){if($.ajaxSetup({cache:i}),ot(),rw.recaptcha.reset(),rbw&&rbw.context&&rbw.context.isWhiteLabel){function n(){l();a();$(document).trigger("navigation",[t])}nt()?n():setTimeout(n,200)}else $(document).trigger("navigation",[t])});$("html").hasClass("single-listing-overlay-active")||Search.openSingleListingOverlay()},at=function(n,t){f.storePublicRecordsOverlay(n,t);var r=$("#mapsearch-public-records-overlay > div"),i="/Include/AJAX/MapSearch/GetPublicRecordsOverlay.aspx?propertyId="+n+"&address="+encodeURIComponent(t),u=Utils.AppPath+i;r.empty().load(u,function(){pt();historicalValueChartLoadAddress();medianSalesPriceSqFtChartLoadZipCode();residentialHomesSoldChartLoadZipCode();$(document).trigger("navigation",[i])});Search.openPublicRecordsOverlay()},d=function(n,t){if(!k(n))return!1;if(n&&(n.preventDefault(),n.stopImmediatePropagation()),rbw.context.isFrameableIdx)return window.location.href=t||$(this).attr("href"),!1;if(rbw.Utils.isAdminSite()){open_detail(location.protocol+"//"+rbw.Utils.PublicHostHeader+$(this).attr("href"));return}return ft(t||$(this).attr("href")),!0},et=function(n){return typeof LanguagePlugin=="undefined"?n:LanguagePlugin.replace(n,n)},g=function(n){var t=$("#search-criteria-form-v3"),i=0,r=t.offset().left,u=$(window).innerWidth()-(t.offset().left+t.innerWidth());n&&n.css({top:i,left:r,right:u});$(document).trigger("reposition-searchv3-overlay",[i,r,u])},ot=function(){var t=$("#single-listing-overlay"),n=t.get(0),i,r;n&&n.offsetWidth&&n.clientWidth&&(i=1+(parseInt(t.css("border-left-width"))||0),r=n.offsetWidth-n.clientWidth,$("#navBar_view_previous_listing, #navBar_view_next_listing").each(function(){var n=$(this).attr("data-href"),t;typeof n!="undefined"&&(t=n.toLowerCase(),t!=="javascript:;"&&$(this).show())}),$("#top-navigation-v3").css({left:t.offset().left+i,width:t.innerWidth()-r}))},bt=function(){function e(){n={};$("input, select","#search-criteria-form-filters-v3").each(function(){if(this.tagName==="SELECT")n[this.name]=$(this).val();else switch(this.type){case"text":case"number":n[this.name]=$(this).val();break;case"radio":case"checkbox":n[this.name]=n[this.name]||[];$(this).is(":checked")&&n[this.name].push($(this).val())}})}function i(){n=null}function o(){n&&(Object.keys(n).forEach(function(n){var t=$('#search-criteria-form-filters-v3 [name="'+n+'"]'),r,i;t.length!==0&&(r=t.get(0).tagName,i=t.attr("type"),i==="radio"||i==="checkbox"?t.prop({checked:!1}
1).change():(r==="SELECT"||i==="text"||i==="number")&&t.val("").change())}),$('[name="Criteria/Status"][value="1"]').prop({checked:!0}).change(),$("#mapsearch-criteria-status-active").closest("span").addClass("active"),$('[name="Criteria/ListingTypeID"][value="1"]').prop({checked:!0}).change(),i())}function u(){n&&(Object.keys(n).forEach(function(t){var r=n[t],i=$('#search-criteria-form-filters-v3 [name="'+t+'"]'),u=i.attr("type");switch(u){case"radio":case"checkbox":i.prop({checked:!1}).change();r.forEach(function(n){i.filter('[value="'+n+'"]').prop({checked:!0}).change()});break;default:i.val(r).change()}}),i())}function s(){var n=$(window).innerHeight(),t=$(this).offset();$(this).offset({left:0}).height(n-t.top)}function h(){e();typeof Search!="undefined"&&Search!==null&&(t=!0,Search.disableOnMapChange("srp-filter-box"));var n=$("#mapsearch-container");n.length&&(rbw.Utils.isAdminSite()&&$(n).offset().top>$(window).height()?($("#dd-criteria-filters-menu").css({"overflow-y":"scroll"}),$("body").css({overflow:"hidden"})):($("html").addClass("filters-overlay-open"),$("body").addClass("disable-scroll")));$(this).addClass("open")}function l(n,i){(i==undefined||i!=undefined&&i!="submit")&&u();var r=$(this);r.addClass("closing");$("body").removeClass("disable-scroll");$("html").removeClass("filters-overlay-open");setTimeout(function(){r.removeClass("closing open");setTimeout(function(){t&&(t=!1,Search.enableOnMapChange("srp-filter-box"))},3e3)},500)}function f(){i();c()}var t=!1,n=null;rbw.Utils.awaitSelector("#dd-criteria-filters-menu").then(function(n){$(".button-apply",n).on("click",function(){i()});$(".button-close",n).on("click",function(){u();f()});$(".button-clear",n).on("click",function(){var i,r;f();$(document).trigger("criteriacleared");i=$("#mapsearch-container");rbw.Utils.isAdminSite()&&$(i).offset().top>$(window).height()&&(r=localStorage.getItem("filteroffset"),window.scrollTo(0,r));o();t&&(t=!1,Search.enableOnMapChange("srp-filter-box"));typeof Search!="undefined"&&Search!==null&&Search.clearCriteria();$(".button-apply",n).first().click()});$(n).on("reposition-filter-box",s).on("open-filter-box",h).on("close-filter-box",l)}).then(function(){function i(t){t?$("#criteria-form-filters-dropdown-all").prepend(n):n.detach()}var t="(max-width: "+r+"px)",n=$(".js-criteria-filters-phone-fieldsets");rbw.Utils.watchMediaQuery(t,i)})},kt=function(){function n(n){$(".status-chkbox, .proptype-toggler, .hometype-toggler",n).each(function(){function t(){i.toggleClass("active",n.prop("checked"))}var i=$(this),n=$("input",this);t();n.on("change",t)})}rbw.Utils.awaitSelector("#criteria-form-filters-dropdown").then(n).then(function(n){$('#mapsearch-drivetime-desktop input[name="grp_rangetype"]',n).prop({checked:!1})})},nt=function(){return!rbw.context.isWhiteLabel||typeof $("#mapsearch-criteria-basicsearch").attr("data-disable-flyout-animation")=="undefined"},tt=function(){var f,i;if(!(n()<=r)){var o=$("#mapsearch-criteria-minprice"),e=$("#mapsearch-criteria-maxprice"),u=parseFloat(o.val().replace(/[$,]/g,""))||0,t=parseFloat(e.val().replace(/[$,]/g,""))||0;t>0&&t<u&&(e.val(u),t=u);f=function(n){return n>=1e6?"$"+Math.round(n/1e3)/1e3+"m":n>=1e3?"$"+Math.round(n/1e3)+"k":"$"+(n||0)};i=[];(u>0||t>0)&&i.push(f(u));u>0&&t==0&&i.push("+");t>0&&(i.push("-"),i.push(f(t)));$("#ddbtn-criteria-pricerange .dd-info").text(i.length>0?i.join(""):ct)}},it=function(){$(".dd-criteria-container.open button").attr("aria-expanded",!1);$(".dd-criteria-container.open").removeClass("open")},st=function(n){$(".dd-criteria-container").each(function(){function o(n){$(".dd-menu-item.active",r).removeClass("active");$(n).closest(".dd-menu-item").addClass("active");var t=$(n).closest("label");i.text(t.text()+" "+l(n.value));it()}var t;if((!$(this).data("initialized")||n)&&($(this).data("initialized",!0),t=$("> button",this),t.attr("id")!="criteria-toggle-filters")){var u=$(this),r=$("> .dropdown-menu",this),i=$(".dd-info",t),s=i.data("suff")||"",f=i.is("[data-suff-none]")?i.data("suff-none")||"":!1,e=i.data("suff-plural")||s,h=i.data("suff-singular")||e,l=function(n){return(n=parseInt(n),f!==!1&&(isNaN(n)||n===0))?f:isNaN(n)||n!==1?e:h},a=function(){r.css({minWidth:t.outerWidth()})};n||(u.click(function(n){n.stopImmediatePropagation()}),t.click(function(){var n=!$(this).is("[data-preserve-overlays-onclick]"),i;(n&&b(),t.attr("id")!="criteria-toggle-filters")&&(i=!u.hasClass("open"),i&&(a(),n&&c(),w(),y(),t.attr("aria-expanded",!0)),u.toggleClass("open"))}),$('> .dd-menu-item label input[type="radio"]',r).change(function(){o(this)}));$('> .dd-menu-item label input[type="radio"]:checked',r).each(function(){o(this)})}})};$(document).ready(function(){if(p?$("html").addClass("touch"):$(".v3 [data-toggle='tooltip']").tooltip(),!rbw||!rbw.context||!rbw.context.enrolledInMarketWatch){$("#mapsearch-mlo-branding").remove();$("#mapsearch-results-header .mapsearch-singleprop.has-content").eq(0).css({marginTop:0});$(document).one("search-results-start",function(){$("#mapsearch-mainmap-results #mapsearch-results-header .mapsearch-results-header-pad.pad-2").addClass("visible")})}$(document).trigger("navigation",[window.location.pathname+window.location.search]);$("#mapsearch-single-listing-overlay, #mapsearch-public-records-overlay").addClass(vt?"with-transform":"without-transform");$(document).one("criteriachange",function(){p&&i()&&v!=="listing-advancedlistinglanding"&&window.Search.setActiveView("gallery")});$("#mapsearch-results-body").on("click",".singleprop-footer .save-listing",function(){typeof SavePropertyUtility!="undefined"&&SavePropertyUtility.saveOrUnsaveproperty($(this).data("listingid"),$(this).data("listingnumber"),$(this).data("customer-listing-id"),$(this))});$("#mapsearch-results-body").on("init",".photo-carousel-list, .photo-carousel-gallery",function(){var n=$(this),i=n.closest(".singleprop-media"),t=$("<div><\/div>");t.insertBefore(n);t.append(n);i.find("a.ldp-link").on("click",function(n){d(n,this.href)})});$("#mapsearch-results-body").on("click",".slick-next",function(n){if(n.preventDefault(),n.stopImmediatePropagation(),!$(this).hasClass("faux-slick-button")){var t=$(".photo-carousel-gallery",$(this).closest(".singleprop-media"));t.slick("slickNext")}});$("#mapsearch-results-body").on("click",".slick-prev",function(n){if(n.preventDefault(),n.stopImmediatePropagation(),!$(this).hasClass("faux-slick-button")){var t=$(".photo-carousel-gallery",$(this).closest(".singleprop-media"));t.slick("slickPrev")}});$("body").on("saved-property",function(){if(f.clearOverlayRestore(),Search.submit(),$("html").hasClass("single-listing-overlay-active")){var n=$("#single-listing-overlay").attr("data-url");setTimeout(function(){d(null,n)||(window.location.href=n)},100)}});$(document).on("search-results-start",function(){$("#mapsearch-searching-message").show();$("#mapsearch-searching-message, #mapsearch-results-all").addClass("search-results-loading");$("#mapsearch-searching-message").css({top:$("#mapsearch-right-top").offset().top+$("#mapsearch-right-top").outerHeight()+20})});
1if(rbw&&rbw.context&&rbw.context.isWhiteLabel)$(document).on("search-results-event",function(n,t){o.processSRP(t?t.Items:[])});$(document).on("search-results-loaded",function(){$(window).scroll();$("#mapsearch-searching-message, #mapsearch-results-all").removeClass("search-results-loading");setTimeout(function(){$("#mapsearch-searching-message").hide()},1e3);$("#mapsearch-results").find(".singleprop-header, .singleprop-media img, .singleprop-courtesyof").off("click").on("click",function(n){if(k(n)&&!$(this).hasClass("non-listing")&&(n.preventDefault(),n.stopImmediatePropagation(),!$(this).parents(".initializing-carousel").length)){var t=$(this).closest(".mapsearch-singleprop");if(rbw.Utils.isAdminSite()){open_detail(location.protocol+"//"+rbw.Utils.PublicHostHeader+t.attr("detail-href"));return}rbw.context.isFrameableIdx?window.location.href=t.attr("detail-href"):ft(t.attr("detail-href"))}});p||$(".v3 [data-toggle='tooltip']").tooltip()});$(document).on("search-results-event-finish",function(){$("#mapsearch-searching-message, #mapsearch-results-all").removeClass("search-results-loading");k()&&f.checkRestoreOverlay(ft,at)});rbw.Utils.watchAwaitSelector(function(n){if(!p||!(i()||s()))$(n).off("click.ldpoverlay").on("click.ldpoverlay",d)},"#mapsearch-mainmap-toolbar .r-bubble-address");$(document).on("map-valuation-click",function(n,t){if(n.preventDefault(),n.stopImmediatePropagation(),k(n)){var i=t.url.substring(t.url.lastIndexOf("/")+1).replace("-"+t.propertyId,"");at(t.propertyId,i)}else window.open(t.url,"_blank")});$(document).on("prOverlayDeactivated",wt);$(document).on("click",".navbar-view-prev, .navbar-view-next",function(n){$("#top-navigation-v3").remove();var t=$(this).attr("data-href");$("#single-listing-overlay").trigger("ldpOverlayNavigation",[{url:t}]);d(n,t)||(window.location.href=t)});(function(){if(p&&t()){var i=$('<div id="mobile-map-bubble-container"><\/div>').appendTo("#mapsearch-mainmap-toolbar"),n=$('<a href="javascript:;" class="close">×<\/a>'),r=function(){n.detach();i.html("").removeClass("active")};n.click(function(n){n.preventDefault();r()});$(document).on("mapbubbledisplay",function(){r();var t=$("#mapsearch-mainmap-toolbar .pushpinPopup");$(".bubble-loading",t).length||($(".pushpinPopupArrowRight, .pushpinPopupArrowLeft",t).hide(),i.append(t).prepend(n).addClass("active"))})}})();typeof SavePropertyUtility!="undefined"&&(SavePropertyUtility.refreshParent=!1);bt();kt();var e=$("#criteria-listingtype-default");(function(){var k=$("body").attr("id");if(k==="listing-advancedlistinglanding"){var s=$("#criteria-toggle-filters"),f=$("#search-criteria-form-filters-v3"),o=$("#dd-criteria-filters-dropdown"),i=$("#dd-criteria-filters-menu"),v=$("#criteria-form-filters-dropdown"),d=i.is("[data-custom-resize]")||v.is("[data-custom-resize]"),l=i.is("[data-custom-toggle]")||v.is("[data-custom-toggle]");sm3.closeFiltersBox=c=function(n){l&&i.trigger("close-filter-box",n);f.removeClass("open");o.removeClass("open");s.attr("aria-expanded",!1);var t=$("#mapsearch-container");rbw.Utils.isAdminSite()&&$(t).offset().top>$(window).height()&&(localStorage.setItem("filteroffset",window.pageYOffset),$("body").css({overflow:""}))};var g=function(){$("#r-location-summary-dropdown").removeClass("open");$(".btn-show-all-locations").attr("aria-expanded",!1)},p=function(){b();o.hasClass("open")||s.trigger("click");$(this).attr("aria-expanded",!0);l&&i.trigger("open-filter-box")},a=function(){var u;if(d){i.trigger("reposition-filter-box");return}if(o.hasClass("open"))if(n()<=r)f.hasClass("mobile-pos")||f.addClass("mobile-pos").appendTo("#search-criteria-form-v3"),i.css({top:$("#mapsearch-criteria-basicsearch").innerHeight()});else{f.hasClass("mobile-pos")&&f.removeClass("mobile-pos").appendTo("#dd-criteria-filters-menu");u=$(window).height();i.css({top:"",minHeight:t()?545:0,maxHeight:u*.75});var e=$("#search-criteria-form-v3"),a=e.offset().left,v=s.offset().left+s.outerWidth()-a,c=e.innerWidth(),l=c-v;n()<=h?i.css({right:l*-1,maxWidth:c}):i.css({right:l/3*-2})}};f.appendTo("#dd-criteria-filters-menu");w=g;ht=p;$(document).on("open-show-all-locations",function(){y();c()});s.on("click",function(n){n.stopImmediatePropagation();var t=!o.hasClass("open");t?(w(),y(),f.addClass("open"),o.addClass("open"),p(),a(),u()&&$("input:visible,select:visible",i).first().focus()):(c(),o.removeClass("open"),f.removeClass("open"))});$(window).resize($.throttle?$.throttle(100,a):a);$("#criteria-form-filters-dropdown").on("click","#toggle-criteria-filters-table",function(n){(n.preventDefault(),n.stopImmediatePropagation(),l)||($(this).hide(),$("#criteria-filters-table, #criteria-filters-types").show())});$("input[name='Criteria/ListingTypeID']",i).change(function(){$("input[name='Criteria/ListingTypeID']:checked").length?e.detach():e.prependTo(i)});$("body").on("click","#filters-submit",function(){var n,t;c("submit");typeof Search!="undefined"&&Search!==null&&Search.submit();n=$("#mapsearch-container");rbw.Utils.isAdminSite()&&$(n).offset().top>$(window).height()&&(t=localStorage.getItem("filteroffset"),window.scrollTo(0,t))});$("body").on("click",".button-close",function(){c()});$("body").on("click","#criteria-filters-savesearch-bar button",function(){$("body").trigger("savesearch-modal-requested");$("#filters-submit").click()});$(document).on("criteriacleared",function(){$('input[name="Criteria/MinPrice"]').val("");$('input[name="Criteria/MaxPrice"]').val("");tt();$('[name="Criteria/MinBedrooms"][value=""]').prop({checked:!0});$('[name="Criteria/MinBathrooms"][value=""]').prop({checked:!0});st(!0)})}})()});$(document).on("maploaded",function(){var o=$("#mapsearch-criteria-basicsearch"),f=$("#criteria-listingtype-default");typeof $.fn.selectpicker!="undefined"&&($(".bootstrap-select").selectpicker(),function(){(function(){$(["#search-options-modal","#modal-save-property-id","#modal-my-properties-id"]).each(function(n,r){function o(){var n=0;try{n=iframe.contents().height()}catch(t){n=0}return n}var u=$(r).appendTo("body"),f=function(){var h=$(window).width()>$(window).height(),n,f,s;if(e()||t())u.css({top:10}
1),$(r+" .modal-content").css({height:.93*$(window).height()});else if(u.find(".modal-dialog").css({top:50}),i())h?$(r+" .modal-content").css({height:$(window).innerHeight()-30}):$(r+" .modal-content").css({height:$(window).innerHeight()-($("#search-display-options-v3").offset().top+$("#search-display-options-v3").height())-15});else{if(n=$(r+" .modal-content iframe"),f=20,n.length)n.on("load",function(){var t=n.contents().height();$(r+" .modal-content").css({height:t+f});n.removeAttr("scroll")});s=Math.max(500,o());$(r+" .modal-content").css({height:s+f})}};$("#hiddenLink").on("click",function(n){n.stopImmediatePropagation();u.modal("show");$(r+" .modal-body iframe").replaceWith('<iframe src="'+$(this).attr("href")+'" scrolling="no"><\/iframe>');setTimeout(function(){$(r+" .modal-body iframe").contents().find("body").addClass("iframed")},500)});u.on("show.bs.modal",function(){Search.disableOnMapChange();f()});u.on("hidden.bs.modal",function(){setTimeout(function(){Search.enableOnMapChange()},3e3)});$(window).resize($.throttle?$.throttle(100,f):f)});$(document).trigger("init-search-options-modal")})(),function(){var n=$('<div id="search-options-dropdown-overlay"><\/div>').appendTo("body"),o=$('<a id="search-options-dropdown-close" href="javascript:;">×<\/a>').appendTo(n),f=$('<div id="search-options-dropdown-layout"><\/div>').appendTo(n);$(".fsd-layout, #listing-listingsearch > #viewport-wrapper").on("click",function(){r()});$('<iframe id="search-options-dropdown-iframe" src="about:blank"><\/iframe>').appendTo(n);var s=$("#btn-save-this-search"),v=$("#search-criteria-form-v3"),i={},h=238,t=function(){n.hasClass("open")&&g(n)},e=function(){Search.disableOnMapChange();var i=-1*rt();$("html").addClass("search-options-dropdown-overlay-open").css({top:i});n.addClass("open");$(window).bind("resize.searchoptionsoverlay",t);t()},r=function(){n.hasClass("open")&&($(window).unbind("resize.searchoptionsoverlay"),n.removeClass("open"),$("html").removeClass("search-options-dropdown-overlay-open").css({top:0}),Search.enableOnMapChange())};b=r;var c=function(n){var t=$("#search-options-dropdown-iframe");return t.attr("src")!=n&&t.replaceWith('<iframe id="search-options-dropdown-iframe" src="'+n+'"><\/iframe>'),e(),t},u=function(n){$(".cacheable-wrapper",f).detach();f.html("").append(n)},l=function(n,t){switch(n){case h:$(".targetarealist-title",t).html('<div class="overlay-title">'+et("Target Search")+"<\/div>");$(".savedsearchlist-title",t).html('<div class="overlay-title">'+et("My Saved Searches")+"<\/div>");t.on("click",".delete-saved-search",function(n){n.preventDefault();var t=$(this).data("savedsearchid")})}},a=function(r){if(e(),typeof i[r]!="undefined"){u(i[r]);return}var f=$('<span class="loading-spinner"><\/span>').css({marginTop:n.height()/3});u(f);$.ajax({type:"GET",url:getAppRoot()+"/include/ajax/api.aspx",data:"op=GetRenderedLayoutMarkup&layoutTypeID="+r,dataType:"json",success:function(n){var f=$('<div class="cacheable-wrapper"><\/div>');i[r]=f;u(f);f.html(n);l(r,f);t()},error:function(){u("<b>Error: Page could not be loaded.<\/b>")}})};$("body").on("savesearch-modal-requested",function(){i={}});$(window).load(t);$(".fsd-layout img").load(t).error(t);s.click(function(){$("body").trigger("savesearch-modal-requested");$("html").addClass("modal-open");var n=setInterval(function(){$("body").hasClass("modal-open")||($("html").removeClass("modal-open"),clearInterval(n))},250)});o.click(function(n){n.preventDefault();r();location.href.toLowerCase().indexOf("listingsearch.aspx")>-1&&location.reload()});$(".criteria-user-menu-aside .dropdown-menu li, #modal-user-menu-mobile li").each(function(){$("a",this).click(function(t){r();$(".criteria-user-menu-aside").dropdown("toggle");t.preventDefault();t.stopImmediatePropagation();$("#criteria-user-account-menu").removeClass("open");$("#modal-user-menu-mobile").modal("hide");var f=$(this),u=f.data("type"),i=f.data("target");n.removeClass("layout-active iframe-active").addClass(u+"-active");u=="location"?(/^(?:\/|http)/i.test(i)||(i=window.location.protocol+"//"+i),window.location.href=i):u=="layout"?a(i):u=="iframe"&&(/^(?:\/|http)/i.test(i)||(i=window.location.protocol+"//"+i),c(i));$(document).trigger("navigation",[i,u])})}),function(){var n=new Querystring;n.get("view")==="savedprops"&&$(".view-savedprops").eq(0).click()}(),function(){var n=new Querystring;n.get("view")==="savedsearches"&&$(".view-savedsearches").eq(0).click()}()}()}()),function(){var s=$("#criteria-toggle-filters"),e=$("#search-criteria-form-filters-v3"),o=$("#dd-criteria-filters-dropdown"),i=$("#dd-criteria-filters-menu"),v=$("#criteria-form-filters-dropdown"),k=i.is("[data-custom-resize]")||v.is("[data-custom-resize]"),l=i.is("[data-custom-toggle]")||v.is("[data-custom-toggle]");sm3.closeFiltersBox=c=function(n){l&&i.trigger("close-filter-box",n);e.removeClass("open");o.removeClass("open");s.attr("aria-expanded",!1);var t=$("#mapsearch-container");rbw.Utils.isAdminSite()&&$(t).offset().top>$(window).height()&&(localStorage.setItem("filteroffset",window.pageYOffset),$("body").css({overflow:""}))};var d=function(){$("#r-location-summary-dropdown").removeClass("open");$(".btn-show-all-locations").attr("aria-expanded",!1)},p=function(){b();o.hasClass("open")||s.trigger("click");$(this).attr("aria-expanded",!0);l&&i.trigger("open-filter-box")},a=function(){var u;if(k){i.trigger("reposition-filter-box");return}if(o.hasClass("open"))if(n()<=r)e.hasClass("mobile-pos")||e.addClass("mobile-pos").appendTo("#search-criteria-form-v3"),i.css({top:$("#mapsearch-criteria-basicsearch").innerHeight()});else{e.hasClass("mobile-pos")&&e.removeClass("mobile-pos").appendTo("#dd-criteria-filters-menu");u=$(window).height();i.css({top:"",minHeight:t()?545:0,maxHeight:u*.75});var f=$("#search-criteria-form-v3"),a=f.offset().left,v=s.offset().left+s.outerWidth()-a,c=f.innerWidth(),l=c-v;n()<=h?i.css({right:l*-1,maxWidth:c}):i.css({right:l/3*-2})}};e.appendTo("#dd-criteria-filters-menu");w=d;ht=p;$(document).on("open-show-all-locations",function(){y();c()});s.on("click",function(n){n.stopImmediatePropagation();var t=!o.hasClass("open");t?(w(),y(),e.addClass("open"),o.addClass("open"),p(),a(),u()&&$("input:visible,select:visible",i).first().focus()):(c(),o.removeClass("open"),e.removeClass("open"))});$(window).resize($.throttle?$.throttle(100,a):a);$("#criteria-form-filters-dropdown").on("click","#toggle-criteria-filters-table",function(n){(n.preventDefault(),n.stopImmediatePropagation(),l)||($(this).hide(),$("#criteria-filters-table, #criteria-filters-types").show())});$("input[name='Criteria/ListingTypeID']",i).change(function(){$("input[name='Criteria/ListingTypeID']:checked").length?f.detach():f.prependTo(i)});$("body").on("click","#filters-submit",function(){var n,t;c("submit");Search.submit();n=$("#mapsearch-container");rbw.Utils.isAdminSite()&&$(n).offset().top>$(window).height()&&(t=localStorage.getItem("filteroffset"),window.scrollTo(0,t))});$("body").on("click",".button-close",function(){c()});$("body").on("click","#criteria-filters-savesearch-bar button",function(){$("body").trigger("savesearch-modal-requested");$("#filters-submit").click()});$(document).on("criteriacleared",function(){$('input[name="Criteria/MinPrice"]').val("");$('input[name="Criteria/MaxPrice"]').val("");tt();$('[name="Criteria/MinBedrooms"][value=""]').prop({checked:!0});$('[name="Criteria/MinBathrooms"][value=""]').prop({checked:!0});st(!0)})}()});$(function(){var n=$("#mapsearch-single-listing-overlay"),o=$("#mapsearch-public-records-overlay"),h=function(n,t){function i(){t.addClass("open");$(window).resize()}g(t);
1Search.disableOnMapChange();$("html").addClass(n);$("body").height()>$(window).height()&&$("#mapsearch-right, .sitehead-nav, .fsd-layout, .header.navbar").css("margin-right",$(".js-inner-box-1").data("scrollbarwidth")+"px");nt()?i():setTimeout(i,250)},c=function(n,t){function i(){t.removeClass("closing done");$("html").removeClass(n);$("#mapsearch-right, .sitehead-nav, .fsd-layout, .header.navbar").css("margin-right","0")}t.removeClass("open");f.clearOverlay();nt()?i():setTimeout(i,1e3);setTimeout(function(){Search.enableOnMapChange()},3e3)},r=function(){g(n);ot()},u=function(){g(o)},v=function(){Search.disableOnMapChange();h("single-listing-overlay-active",n);n.one("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){n.removeClass("open").addClass("done");ot()})},y=function(){function t(){n.addClass("closing").removeClass("done").addClass("open");c("single-listing-overlay-active",n);Search.enableOnMapChange()}$("#single-listing-overlay").empty();$("#top-navigation-v3").remove();nt()?t():setTimeout(t,250)},p=function(){h("public-records-overlay-active",o)},w=function(){c("public-records-overlay-active",o)},l=function(){var e=ut();if(e){var i=lt(),t=$("#mapsearch-mainmap-toolbar"),r=t.height(),o=$("#search-results-container-v3"),s=o.offset().top,u=rt()+i,n=$("#mapsearch-results-all"),f=n.height(),h=f-u+n.offset().top,c=r-h,l=u>s&&f>r&&n.is(":visible")&&n.css("display")!="block";l?(t.css({position:"fixed",top:Math.min(i,-c)}),n.css({marginLeft:t.width()})):(t.css({position:"",top:""}),n.css({marginLeft:""}))}},s=function(){var h=$("#mapsearch-right-top").offset().top+$("#mapsearch-right-top").height(),o=$(window).height(),c=$("#search-results-container-v3").offset().top,s=lt(),f=ut(),l=yt(),i,n;t()||e()?f&&$("#mapsearch-mainmap-toolbar").css({width:""}):(i=function(){if($("html").hasClass("single-listing-overlay-active")){setTimeout(i,100);return}var r=$("#mapsearch-mainmap-toolbar"),n=$("#mapsearch-results-all"),u=parseInt(n.css("max-width")),t=!r.is(":visible")||!n.is(":visible")||n.css("display")==="block"||n.outerWidth()<u?"":$("#search-results-container-v3").innerWidth()-n.outerWidth()-1;$("#search-display-options-v3 .major-wrapper").css({minWidth:t});f&&r.css({height:o-s,width:t===0?"":t})},i());n=$("#location-criteria-list");t()?n.css({minHeight:$("ul",n).height()}):n.css({minHeight:"auto"});r();u()},b=function(){(typeof event=="undefined"||event&&event.keyCode===27)&&$("body").data("escapeGallery","true")},a=function(){var r=$(".mapsearch-singleprop:last").outerHeight()*(ut()||i()?6:2),u=rt(),n=u+$(window).height()+r,t=$("#mapsearch-results-all"),f=t.offset().top+t.height();n>0&&n>f&&Search.infiniteNextPage()&&Search.throttleInfiniteSearch()};$(document).on("criteriasummaryrendered",s).on("ldpOverlayActivated",v).on("ldpOverlayDeactivated",y).on("prOverlayActivated",p).on("prOverlayDeactivated",w).on("onBeforeClose.lg",b);$(window).resize($.throttle?$.throttle(100,s):s).scroll($.throttle?$.throttle(100,r):r).scroll($.throttle?$.throttle(100,u):u).scroll($.throttle?$.throttle(2,l):l).scroll().scroll($.throttle?$.throttle(10,a):a).load(r).load(u)});$(function(){var n,t,i,u=function(){return i.attr("data-current-sortdir")},r=function(n){i.removeClass("fa-long-arrow-up fa-long-arrow-down").addClass(n==1?"fa-long-arrow-up":"fa-long-arrow-down").attr("data-current-sortdir",n)},e=function(){return[{asc:1,desc:6},{asc:4,desc:7},{asc:9,desc:10},{asc:11,desc:12},{asc:13,desc:14},{asc:15,desc:16},{asc:17,desc:18},{asc:19,desc:20},{asc:23,desc:24},{asc:22,desc:22},{asc:39,desc:27}].reduce(function(n,t){return n[t.asc]={type:"desc",value:t.desc},n[t.desc]={type:"asc",value:t.asc},n},{})},f=function(){var y=[],p=[],c,f,w,a,v,o,l=$("#mapsearch-sort-list")[0],b=e(),s,h;if(l){for(n=$("#search-results-sorttype"),$sorttype_mobile=$("#modal-sort-menu-options"),t=$("#search-results-sortdir"),i=$("#search-results-sortdir i"),o=0;o<l.options.length;o++)(c=l.options[o].value,mobile_value=l.options[o].value,f=l.options[o].text,w=f.replace("Hi to Lo","(High to Low)").replace("Lo to Hi","(Low to High)"),f=f.replace("Hi to Lo","").replace("Z to A",""),f=f.trim(),f=et(f,f),v=b[c],a="",v&&(a=v.type,c=c+","+v.value),p.push('<li><a href="#" data-sort="'+mobile_value+'">'+w+"<\/a><\/li>"),a!="desc")&&y.push('<option class="'+a+'" value="'+c+'">'+f+"<\/option>");n.html(y.join(""));$sorttype_mobile.html(p.join(""));s=$("#mapsearch-sort-list").val();h=b[s];h?(r(h.type=="asc"?0:1),s=h.type=="asc"?s+","+h.value:h.value+","+s):t.prop("disabled",!0);n.val(s);n.on("change",function(){var n=$(this).val().split(","),i=u();n.length===2?(t.prop("disabled",!1),n=n[i],$("#mapsearch-sort-list").val(n).change()):n.length===1&&(r(0),t.prop("disabled",!0),$("#mapsearch-sort-list").val(n[0]).change())});
1$("#modal-sort-menu-mobile li a").on("click",function(){$("#modal-sort-menu-mobile").modal("hide");var n=$(this).data("sort");$("#mapsearch-sort-list").val(n).change()});typeof n.selectpicker!="undefined"&&n.selectpicker();t.on("click",function(){var t=u();r(t==0?1:0);n.change()})}},o=function(){n.off();t.off();f()};$(document).on("addcontrols",f);$(document).on("resetcontrols",o)});$(function(){function t(n,t){function u(){var n=t.data("slick-desired-action");n==="previous"?t.slick("slickPrev"):n==="next"&&t.slick("slickNext")}function f(n){$(n).addClass("with-background-photo").css({backgroundImage:"url("+i.attr("src")+")"});t.removeClass("carousel-initializer initializing-carousel");u()}var i=$("img",t),r=$("<img/>");r.on("load",function(){r.remove();t.on("slickListingImageCarousel.addUnloadedListingImages.completed",f);rbw.slickListingImageCarousel.listings[n]={carouselEle:t,currentPhotoEle:$("#photo_num_"+n),lazyLoadImages:!0,listingId:n};rbw.slickListingImageCarousel.init(rbw.slickListingImageCarousel.listings[n]);rbw.slickListingImageCarousel.lazyLoadListingImagesHandler(0)}).attr({src:i.attr("src")})}var n=function(){$("#mapsearch-results .singleprop-media .photo-gallery-no-photo img").load(function(){var n=$(this),t=n.parent().height(),i=n.height();n.css({marginTop:(t-i)/2})})};n();$(document).on("search-results-loaded",function(){var i=$("#mapsearch-results-all .mapsearch-singleprop:not(.slick-already-processed)");i.addClass("slick-already-processed");i.each(function(){function s(){n.addClass("carousel-initializer initializing-carousel")}function r(){n.data("did-init-slick")||(n.data("did-init-slick",!0),s(),$(".faux-slick-button",n).remove(),t(i,n))}var o=$(this),i=o.attr("lid"),n,u,f,e;if(i&&(n=$("#photo_gallery_"+i),n.length===0&&(n=$("#photo_list_"+i)),u=parseInt(n.data("photos"))||0,!(u<2))){f=$('<button type="button" data-role="none" class="faux-slick-button slick-prev slick-arrow" aria-label="Previous" role="button" data-temporary="true"><\/button>');e=$('<button type="button" data-role="none" class="faux-slick-button slick-next slick-arrow" aria-label="Next" role="button" data-temporary="true"><\/button>');n.prepend(f);n.append(e);n.one("mousedown",".slick-prev",function(){n.data("slick-desired-action","previous");r()});n.one("mousedown",".slick-next",function(){n.data("slick-desired-action","next");r()});n.swipe({swipeStatus:function(t,i,u){if(i==="end"){var f;if(u==="right")f="previous";else if(u==="left")f="next";else return;n.data("slick-desired-action",f);r()}}})}});n()})});$(function(){y=it;var t=function(){typeof Search=="object"&&(Search.initPrice($("#mapsearch-criteria-minprice, #mapsearch-criteria-maxprice")),Search.initSqft($("#mapsearch-criteria-minsqft, #mapsearch-criteria-maxsqft")))},f=function(){var n=$('[name="Criteria/ListingTypeID"]').attr("type");n!==undefined&&n.toLowerCase()==="checkbox"&&$('[name="Criteria/ListingTypeID"]').filter('[value="1"], [value="3"], [value="4"]').prop({checked:!0}).change()},i=function(){var t=$("#criteria-form-filters-dropdown"),i=$("#dd-criteria-pricerange-container, #dd-criteria-beds-container, #dd-criteria-baths-container"),u=$("#criteria-form-filters-dropdown-desktop"),f=$("#criteria-form-filters-dropdown-mobile"),e=function(){n()<=r?t.hasClass("mobile")||(t.addClass("mobile").removeClass("desktop"),i.detach(),u.detach(),f.appendTo(t),$(document).trigger("toggled-form-filters")):t.hasClass("desktop")||(t.addClass("desktop").removeClass("mobile"),f.detach(),u.appendTo(t),i.prependTo(".criteria-basicsearch-row-2"),$(document).trigger("toggled-form-filters"))};$(window).resize($.throttle?$.throttle(100,e):e).resize()},u=function(){$(window).scrollTop(0)};$(window).click(function(){$("#dd-criteria-filters-dropdown").hasClass("open")||it()});$(document).keyup(function(n){n.keyCode==27&&$(".dd-criteria-container").hasClass("open")&&it()});$(document).one("criteriachange",function(){ct=$("#ddbtn-criteria-pricerange .dd-info").text();$("body").addClass("search-criteria-form-loaded");t();st();tt();i();u();$('input[name="Criteria/PropertyTypeID"][checked]').addClass("r-do-not-clear");$('input[name="Criteria/ListingTypeID"][checked]').prop({checked:!0});$("#mapsearch-criteria-minprice, #mapsearch-criteria-maxprice").on("change",tt)});v==="listing-advancedlistinglanding"&&$(document).trigger("criteriachange"),function(){rbw.utils.awaitSelector(".js-inner-box-1").then(function(){var n=$(".js-inner-box-1").width()-$(".js-inner-box-2").innerWidth();$(".js-inner-box-1").data("scrollbarwidth",n)})}()})}}(),function(){if($("body").attr("id")==="account-ignoredlistinglist"||$("body").attr("id")==="account-savedlistinglist"){var n=function(){var i=$(".mapsearch-singleprop:last").outerHeight()*2,r=$("html").scrollTop()||$("body").scrollTop(),n=r+$(window).height()+i,t=$("#mapsearch-results-all"),u=t.offset().top+t.height();n>0&&n>u&&Search.infiniteNextPage()&&Search.throttleInfiniteSearch()};$(window).scroll($.throttle?$.throttle(10,n):n)}}();sm3.resizeModalByIframe=v;sm3.overlayRetention=f;sm3.requestShowingWorkflowForSM3=y})})(),function(){rbw.utils.wait.until(function(){return typeof $!="undefined"&&typeof $("body").attr("id")!="undefined"}).then(function(){var n=$("body").attr("id"),t=function(n){return/^listing-listingsearch|^listing-advancedlistinglanding|^listing-jumpsearchesedit|^account-savemapsearch$/.test(n)?"listing-listingsearch":n}(n);$("html").attr({id:"page-"+t}).addClass("body-"+n)});rbw.utils.awaitSelector("html").then(function(){var n=rbw&&rbw.context&&rbw.context.
1isWhiteLabel;$("html").addClass(n?"white-label":"no-white-label")})}(); 2(function(n){typeof define=="function"&&define.amd&&define.amd.jQuery?define(["jquery"],n):typeof module!="undefined"&&module.exports?n(require("jquery")):n(jQuery)})(function(n){"use strict";function ft(t){return t&&t.allowPageScroll===undefined&&(t.swipe!==undefined||t.swipeStatus!==undefined)&&(t.allowPageScroll=o),t.click!==undefined&&t.tap===undefined&&(t.tap=t.click),t||(t={}),t=n.extend({},n.fn.swipe.defaults,t),this.each(function(){var r=n(this),i=r.data(c);i||(i=new et(this,t),r.data(c,i))})}function et(ft,et){function tr(t){var r,f,u,e;if(!pu())return n(t.target).closest(et.excludedElements,ot).length>0?void 0:(r=t.originalEvent?t.originalEvent:t,r.pointerType&&r.pointerType=="mouse"&&et.fallbackToMouseEvents==!1)?void 0:(u=r.touches,e=u?u[0]:r,st=rt,u?ct=u.length:et.preventDefaultEvents!==!1&&t.preventDefault(),at=0,vt=null,yt=null,kt=null,lt=0,dt=0,gt=0,pt=1,bt=0,ci=ku(),dr(),wi(0,e),!u||ct===et.fingers||et.fingers===a||vi()?(gi=ti(),ct==2&&(wi(1,u[1]),dt=gt=hr(ht[0].start,ht[1].start)),(et.swipeStatus||et.pinchStatus)&&(f=wt(r,st))):f=!1,f===!1)?(st=i,wt(r,st),f):(et.hold&&(ei=setTimeout(n.proxy(function(){ot.trigger("hold",[r.target]);et.hold&&(f=et.hold.call(ot,r,r.target))},this),et.longTapThreshold)),pi(!0),null)}function ir(n){var f=n.originalEvent?n.originalEvent:n,e,h;if(st!==t&&st!==i&&!yi()){var o,r=f.touches,c=r?r[0]:f,u=gr(c);li=ti();r&&(ct=r.length);et.hold&&clearTimeout(ei);st=s;ct==2&&(dt==0?(wi(1,r[1]),dt=gt=hr(ht[0].start,ht[1].start)):(gr(r[1]),gt=hr(ht[0].end,ht[1].end),kt=gu(ht[0].end,ht[1].end)),pt=du(dt,gt),bt=Math.abs(dt-gt));ct===et.fingers||et.fingers===a||!r||vi()?(vt=iu(u.start,u.end),yt=iu(u.last,u.end),uu(n,yt),at=nf(u.start,u.end),lt=tu(),bu(vt,at),o=wt(f,st),(!et.triggerOnTouchEnd||et.triggerOnTouchLeave)&&(e=!0,et.triggerOnTouchLeave&&(h=rf(this),e=uf(u.end,h)),!et.triggerOnTouchEnd&&e?st=fr(s):et.triggerOnTouchLeave&&!e&&(st=fr(t)),(st==i||st==t)&&wt(f,st))):(st=i,wt(f,st));o===!1&&(st=i,wt(f,st))}}function rr(n){var r=n.originalEvent?n.originalEvent:n,u=r.touches;if(u){if(u.length&&!yi())return yu(r),!0;if(u.length&&yi())return!0}return yi()&&(ct=nr),li=ti(),lt=tu(),or()||!er()?(st=i,wt(r,st)):et.triggerOnTouchEnd||et.triggerOnTouchEnd===!1&&st===s?(et.preventDefaultEvents!==!1&&n.cancelable!==!1&&n.preventDefault(),st=t,wt(r,st)):!et.triggerOnTouchEnd&&br()?(st=t,ui(r,st,w)):st===s&&(st=i,wt(r,st)),pi(!1),null}function ri(){ct=0;li=0;gi=0;dt=0;gt=0;pt=1;dr();pi(!1)}function ur(n){var i=n.originalEvent?n.originalEvent:n;et.triggerOnTouchLeave&&(st=fr(t),wt(i,st))}function cr(){ot.unbind(si,tr);ot.unbind(hi,ri);ot.unbind(ki,ir);ot.unbind(di,rr);ii&&ot.unbind(ii,ur);pi(!1)}function fr(n){var r=n,f=lr(),u=er(),e=or();return!f||e?r=i:u&&n==s&&(!et.triggerOnTouchEnd||et.triggerOnTouchLeave)?r=t:!u&&n==t&&et.triggerOnTouchLeave&&(r=i),r}function wt(n,r){var u,f=n.touches;return(eu()||yr())&&(u=ui(n,r,g)),(fu()||vi())&&u!==!1&&(u=ui(n,r,nt)),au()&&u!==!1?u=ui(n,r,tt):vu()&&u!==!1?u=ui(n,r,it):lu()&&u!==!1&&(u=ui(n,r,w)),r===i&&ri(n),r===t&&(f?f.length||ri(n):ri(n)),u}function ui(o,s,h){var c;if(h==g){if(ot.trigger("swipeStatus",[s,vt||null,at||0,lt||0,ct,ht,yt]),et.swipeStatus&&(c=et.swipeStatus.call(ot,o,s,vt||null,at||0,lt||0,ct,ht,yt),c===!1))return!1;if(s==t&&vr()){if(clearTimeout(fi),clearTimeout(ei),ot.trigger("swipe",[vt,at,lt,ct,ht,yt]),et.swipe&&(c=et.swipe.call(ot,o,vt,at,lt,ct,ht,yt),c===!1))return!1;switch(vt){case r:ot.trigger("swipeLeft",[vt,at,lt,ct,ht,yt]);et.swipeLeft&&(c=et.swipeLeft.call(ot,o,vt,at,lt,ct,ht,yt));break;case u:ot.trigger("swipeRight",[vt,at,lt,ct,ht,yt]);et.swipeRight&&(c=et.swipeRight.call(ot,o,vt,at,lt,ct,ht,yt));break;case f:ot.trigger("swipeUp",[vt,at,lt,ct,ht,yt]);et.swipeUp&&(c=et.swipeUp.call(ot,o,vt,at,lt,ct,ht,yt));break;case e:ot.trigger("swipeDown",[vt,at,lt,ct,ht,yt]);et.swipeDown&&(c=et.swipeDown.call(ot,o,vt,at,lt,ct,ht,yt))}}}if(h==nt){if(ot.trigger("pinchStatus",[s,kt||null,bt||0,lt||0,ct,pt,ht]),et.pinchStatus&&(c=et.pinchStatus.call(ot,o,s,kt||null,bt||0,lt||0,ct,pt,ht),c===!1))return!1;if(s==t&&ar())switch(kt){case y:ot.trigger("pinchIn",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchIn&&(c=et.pinchIn.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht));break;case p:ot.trigger("pinchOut",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchOut&&(c=et.pinchOut.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht))}}return h==w?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),sr()&&!su()?(ni=ti(),fi=setTimeout(n.proxy(function(){ni=null;ot.trigger("tap",[o.target]);et.tap&&(c=et.tap.call(ot,o,o.target))},this),et.doubleTapThreshold)):(ni=null,ot.trigger("tap",[o.target]),et.tap&&(c=et.tap.call(ot,o,o.target)))):h==tt?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),ni=null,ot.trigger("doubletap",[o.target]),et.doubleTap&&(c=et.doubleTap.call(ot,o,o.target))):h==it&&(s===i||s===t)&&(clearTimeout(fi),ni=null,ot.trigger("longtap",[o.target]),et.longTap&&(c=et.longTap.call(ot,o,o.target))),c}function er(){var n=!0;return et.threshold!==null&&(n=at>=et.threshold),n}function or(){var n=!1;return et.cancelThreshold!==null&&vt!==null&&(n=nu(vt)-at>=et.cancelThreshold),n}function ru(){return et.pinchThreshold!==null?bt>=et.pinchThreshold:!0}function lr(){return et.maxTimeThreshold?lt>=et.maxTimeThreshold?!1:!0:!0}function uu(n,t){if(et.preventDefaultEvents!==!1)if(et.allowPageScroll===o)n.preventDefault();else{var i=et.allowPageScroll===d;switch(t){case r:(et.swipeLeft&&i||!i&&et.allowPageScroll!=b)&&n.preventDefault();break;case u:(et.swipeRight&&i||!i&&et.allowPageScroll!=b)&&n.preventDefault();break;case f:(et.swipeUp&&i||!i&&et.allowPageScroll!=k)&&n.preventDefault();break;case e:(et.swipeDown&&i||!i&&et.allowPageScroll!=k)&&n.preventDefault()}}}function ar(){var n=pr(),t=wr(),i=ru();return n&&t&&i}function vi(){return!!(et.pinchStatus||et.pinchIn||et.pinchOut)}function fu(){return!!(ar()&&vi())}function vr(){var n=lr(),t=er(),i=pr(),r=wr(),u=or();return!u&&r&&i&&t&&n}function yr(){return!!(et.swipe||et.swipeStatus||et.swipeLeft||et.swipeRight||et.swipe
2Up||et.swipeDown)}function eu(){return!!(vr()&&yr())}function pr(){return ct===et.fingers||et.fingers===a||!l}function wr(){return ht[0].end.x!==0}function br(){return!!et.tap}function sr(){return!!et.doubleTap}function ou(){return!!et.longTap}function kr(){if(ni==null)return!1;var n=ti();return sr()&&n-ni<=et.doubleTapThreshold}function su(){return kr()}function hu(){return(ct===1||!l)&&(isNaN(at)||at<et.threshold)}function cu(){return lt>et.longTapThreshold&&at<ut}function lu(){return!!(hu()&&br())}function au(){return!!(kr()&&sr())}function vu(){return!!(cu()&&ou())}function yu(n){ai=ti();nr=n.touches.length+1}function dr(){ai=0;nr=0}function yi(){var n=!1,t;return ai&&(t=ti()-ai,t<=et.fingerReleaseThreshold&&(n=!0)),n}function pu(){return!!(ot.data(c+"_intouch")===!0)}function pi(n){ot&&(n===!0?(ot.bind(ki,ir),ot.bind(di,rr),ii&&ot.bind(ii,ur)):(ot.unbind(ki,ir,!1),ot.unbind(di,rr,!1),ii&&ot.unbind(ii,ur,!1)),ot.data(c+"_intouch",n===!0))}function wi(n,t){var i={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return i.start.x=i.last.x=i.end.x=t.pageX||t.clientX,i.start.y=i.last.y=i.end.y=t.pageY||t.clientY,ht[n]=i,i}function gr(n){var i=n.identifier!==undefined?n.identifier:0,t=wu(i);return t===null&&(t=wi(i,n)),t.last.x=t.end.x,t.last.y=t.end.y,t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function wu(n){return ht[n]||null}function bu(n,t){n!=o&&(t=Math.max(t,nu(n)),ci[n].distance=t)}function nu(n){return ci[n]?ci[n].distance:undefined}function ku(){var n={};return n[r]=bi(r),n[u]=bi(u),n[f]=bi(f),n[e]=bi(e),n}function bi(n){return{direction:n,distance:0}}function tu(){return li-gi}function hr(n,t){var i=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y);return Math.round(Math.sqrt(i*i+r*r))}function du(n,t){var i=t/n*1;return i.toFixed(2)}function gu(){return pt<1?p:y}function nf(n,t){return Math.round(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)))}function tf(n,t){var r=n.x-t.x,u=t.y-n.y,f=Math.atan2(u,r),i=Math.round(f*180/Math.PI);return i<0&&(i=360-Math.abs(i)),i}function iu(n,t){if(ff(n,t))return o;var i=tf(n,t);return i<=45&&i>=0?r:i<=360&&i>=315?r:i>=135&&i<=225?u:i>45&&i<135?e:f}function ti(){var n=new Date;return n.getTime()}function rf(t){t=n(t);var i=t.offset();return{left:i.left,right:i.left+t.outerWidth(),top:i.top,bottom:i.top+t.outerHeight()}}function uf(n,t){return n.x>t.left&&n.x<t.right&&n.y>t.top&&n.y<t.bottom}function ff(n,t){return n.x==t.x&&n.y==t.y}var et=n.extend({},et),oi=l||h||!et.fallbackToMouseEvents,si=oi?h?v?"MSPointerDown":"pointerdown":"touchstart":"mousedown",ki=oi?h?v?"MSPointerMove":"pointermove":"touchmove":"mousemove",di=oi?h?v?"MSPointerUp":"pointerup":"touchend":"mouseup",ii=oi?h?"mouseleave":null:"mouseleave",hi=h?v?"MSPointerCancel":"pointercancel":"touchcancel",at=0,vt=null,yt=null,lt=0,dt=0,gt=0,pt=1,bt=0,kt=0,ci=null,ot=n(ft),st="start",ct=0,ht={},gi=0,li=0,ai=0,nr=0,ni=0,fi=null,ei=null;try{ot.bind(si,tr);ot.bind(hi,ri)}catch(ef){n.error("events not supported "+si+","+hi+" on jQuery.swipe")}this.enable=function(){return this.disable(),ot.bind(si,tr),ot.bind(hi,ri),ot};this.disable=function(){return cr(),ot};this.destroy=function(){cr();ot.data(c,null);ot=null};this.option=function(t,i){if(typeof t=="object")et=n.extend(et,t);else if(et[t]!==undefined){if(i===undefined)return et[t];et[t]=i}else if(t)n.error("Option "+t+" does not exist on jQuery.swipe.options");else return et;return null}}var r="left",u="right",f="up",e="down",y="in",p="out",o="none",d="auto",g="swipe",nt="pinch",w="tap",tt="doubletap",it="longtap",b="horizontal",k="vertical",a="all",ut=10,rt="start",s="move",t="end",i="cancel",l="ontouchstart"in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!l,h=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!l,c="TouchSwipe";n.fn.swipe=function(t){var r=n(this),i=r.data(c);if(i&&typeof t=="string"){if(i[t])return i[t].apply(i,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(i&&typeof t=="object")i.option.apply(i,arguments);else if(!i&&(typeof t=="object"||!t))return ft.apply(this,arguments);return r};n.fn.swipe.version="1.6.18";n.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:".noSwipe",preventDefaultEvents:!1};n.fn.swipe.phases={PHASE_START:rt,PHASE_MOVE:s,PHASE_END:t,PHASE_CANCEL:i};n.fn.swipe.directions={LEFT:r,RIGHT:u,UP:f,DOWN:e,IN:y,OUT:p};n.fn.swipe.pageScroll={NONE:o,HORIZONTAL:b,VERTICAL:k,AUTO:d};n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:a}}); 3/* 4 _ _ _ _ 5 ___| (_) ___| | __ (_)___ 6/ __| | |/ __| |/ / | / __| 7\__ \ | | (__| < _ | \__ \ 8|___/_|_|\___|_|\_(_)/ |___/ 9 |__/ 10 11 Version: 1.8.1 12 Author: Ken Wheeler 13 Website: http://kenwheeler.github.io 14 Docs: http://kenwheeler.github.io/slick 15 Repo: http://github.com/kenwheeler/slick 16 Issues: http://github.com/kenwheeler/slick/issues 17 18 */ 19!function (i) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], i) : "undefined" != typeof exports ? module.exports = i(require("jquery")) : i(jQuery) }(function (i) { "use strict"; var e = window.Slick || {}; (e = function () { var e = 0; return function (t, o) { var s, n = this; n.defaults = { accessibility: !0, adaptiveHeight: !1, appendArrows: i(t), appendDots: i(t), arrows: !0, asNavFor: null, prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', autoplay: !1, autoplaySpeed: 3e3, centerMode: !1, centerPadding: "50px", cssEase: "ease", customPaging: function (e, t) { return i('<button type="button" />').text(t + 1) }, dots: !1, dotsClass: "slick-dots", draggable: !0, easing: "linear", edgeFriction: .35, fade: !1, focusOnSelect: !1, focusOnChange: !1, infinite: !0, initialSlide: 0, lazyLoad: "ondemand", mobileFirst: !1, pauseOnHover: !0, pauseOnFocus: !0, pauseOnDotsHover: !1, respondTo: "window", responsive: null, rows: 1, rtl: !1, slide: "", slidesPerRow: 1, slidesToShow: 1, slidesToScroll: 1, speed: 500, swipe: !0, swipeToSlide: !1, touchMove: !0, touchThreshold: 5, useCSS: !0, useTransform: !0, variableWidth: !1, vertical: !1, verticalSwiping: !1, waitForAnimate: !0, zIndex: 1e3 }, n.initials = { animating: !1, dragging: !1, autoPlayTimer: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, $dots: null, listWidth: null, listHeight: null, loadIndex: 0, $nextArrow: null, $prevArrow: null, scrolling: !1, slideCount: null, slideWidth: null, $slideTrack: null, $slides: null, sliding: !1, slideOffset: 0, swipeLeft: null, swiping: !1, $list: null, touchObject: {}, transformsEnabled: !1, unslicked: !1 }, i.extend(n, n.initials), n.activeBreakpoint = null, n.animType = null, n.animProp = null, n.breakpoints = [], n.breakpointSettings = [], n.cssTransitions = !1, n.focussed = !1, n.interrupted = !1, n.hidden = "hidden", n.paused = !0, n.positionProp = null, n.respondTo = null, n.rowCount = 1, n.shouldClick = !0, n.$slider = i(t), n.$slidesCache = null, n.transformType = null, n.transitionType = null, n.visibilityChange = "visibilitychange", n.windowWidth = 0, n.windowTimer = null, s = i(t).data("slick") || {}, n.options = i.extend({}, n.defaults, o, s), n.currentSlide = n.options.initialSlide, n.originalSettings = n.options, void 0 !== document.mozHidden ? (n.hidden = "mozHidden", n.visibilityChange = "mozvisibilitychange") : void 0 !== document.webkitHidden && (n.hidden = "webkitHidden", n.visibilityChange = "webkitvisibilitychange"), n.autoPlay = i.proxy(n.autoPlay, n), n.autoPlayClear = i.proxy(n.autoPlayClear, n), n.autoPlayIterator = i.proxy(n.autoPlayIterator, n), n.changeSlide = i.proxy(n.changeSlide, n), n.clickHandler = i.proxy(n.clickHandler, n), n.selectHandler = i.proxy(n.selectHandler, n), n.setPosition = i.proxy(n.setPosition, n), n.swipeHandler = i.proxy(n.swipeHandler, n), n.dragHandler = i.proxy(n.dragHandler, n), n.keyHandler = i.proxy(n.keyHandler, n), n.instanceUid = e++, n.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/, n.registerBreakpoints(), n.init(!0) } }()).prototype.activateADA = function () { this.$slideTrack.find(".slick-active").attr({ "aria-hidden": "false" }).find("a, input, button, select").attr({ tabindex: "0" }) }, e.prototype.addSlide = e.prototype.slickAdd = function (e, t, o) { var s = this; if ("boolean" == typeof t) o = t, t = null; else if (t < 0 || t >= s.slideCount) return !1; s.unload(), "number" == typeof t ? 0 === t && 0 === s.$slides.length ? i(e).appendTo(s.$slideTrack) : o ? i(e).insertBefore(s.$slides.eq(t)) : i(e).insertAfter(s.$slides.eq(t)) : !0 === o ? i(e).prependTo(s.$slideTrack) : i(e).appendTo(s.$slideTrack), s.$slides = s.$slideTrack.children(this.options.slide), s.$slideTrack.children(this.options.slide).detach(), s.$slideTrack.append(s.$slides), s.$slides.each(function (e, t) { i(t).attr("data-slick-index", e) }), s.$slidesCache = s.$slides, s.reinit() }, e.prototype.animateHeight = function () { var i = this; if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { var e = i.$slides.eq(i.currentSlide).outerHeight(!0); i.$list.animate({ height: e }, i.options.speed) } }, e.prototype.animateSlide = function (e, t) { var o = {}, s = this; s.animateHeight(), !0 === s.options.rtl && !1 === s.options.vertical && (e = -e), !1 === s.transformsEnabled ? !1 === s.options.vertical ? s.$slideTrack.animate({ left: e }, s.options.speed, s.options.easing, t) : s.$slideTrack.animate({ top: e }, s.options.speed, s.options.easing, t) : !1 === s.cssTransitions ? (!0 === s.options.rtl && (s.currentLeft = -s.currentLeft), i({ animStart: s.currentLeft }).animate({ animStart: e }, { duration: s.options.speed, easing: s.options.easing, step: function (i) { i = Math.ceil(i), !1 === s.options.vertical ? (o[s.animType] = "translate(" + i + "px, 0px)", s.$slideTrack.css(o)) : (o[s.animType] = "translate(0px," + i + "px)", s.$slideTrack.css(o)) }, complete: function () { t && t.call() } }
vendor: 5,228 bytes, line 19
19)) : (s.applyTransition(), e = Math.ceil(e), !1 === s.options.vertical ? o[s.animType] = "translate3d(" + e + "px, 0px, 0px)" : o[s.animType] = "translate3d(0px," + e + "px, 0px)", s.$slideTrack.css(o), t && setTimeout(function () { s.disableTransition(), t.call() }, s.options.speed)) }, e.prototype.getNavTarget = function () { var e = this, t = e.options.asNavFor; return t && null !== t && (t = i(t).not(e.$slider)), t }, e.prototype.asNavFor = function (e) { var t = this.getNavTarget(); null !== t && "object" == typeof t && t.each(function () { var t = i(this).slick("getSlick"); t.unslicked || t.slideHandler(e, !0) }) }, e.prototype.applyTransition = function (i) { var e = this, t = {}; !1 === e.options.fade ? t[e.transitionType] = e.transformType + " " + e.options.speed + "ms " + e.options.cssEase : t[e.transitionType] = "opacity " + e.options.speed + "ms " + e.options.cssEase, !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t) }, e.prototype.autoPlay = function () { var i = this; i.autoPlayClear(), i.slideCount > i.options.slidesToShow && (i.autoPlayTimer = setInterval(i.autoPlayIterator, i.options.autoplaySpeed)) }, e.prototype.autoPlayClear = function () { var i = this; i.autoPlayTimer && clearInterval(i.autoPlayTimer) }, e.prototype.autoPlayIterator = function () { var i = this, e = i.currentSlide + i.options.slidesToScroll; i.paused || i.interrupted || i.focussed || (!1 === i.options.infinite && (1 === i.direction && i.currentSlide + 1 === i.slideCount - 1 ? i.direction = 0 : 0 === i.direction && (e = i.currentSlide - i.options.slidesToScroll, i.currentSlide - 1 == 0 && (i.direction = 1))), i.slideHandler(e)) }, e.prototype.buildArrows = function () { var e = this; !0 === e.options.arrows && (e.$prevArrow = i(e.options.prevArrow).addClass("slick-arrow"), e.$nextArrow = i(e.options.nextArrow).addClass("slick-arrow"), e.slideCount > e.options.slidesToShow ? (e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"), e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.prependTo(e.options.appendArrows), e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.appendTo(e.options.appendArrows), !0 !== e.options.infinite && e.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true")) : e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({ "aria-disabled": "true", tabindex: "-1" })) }, e.prototype.buildDots = function () { var e, t, o = this; if (!0 === o.options.dots) { for (o.$slider.addClass("slick-dotted"), t = i("<ul />").addClass(o.options.dotsClass), e = 0; e <= o.getDotCount(); e += 1)t.append(i("<li />").append(o.options.customPaging.call(this, o, e))); o.$dots = t.appendTo(o.options.appendDots), o.$dots.find("li").first().addClass("slick-active") } }, e.prototype.buildOut = function () { var e = this; e.$slides = e.$slider.children(e.options.slide + ":not(.slick-cloned)").addClass("slick-slide"), e.slideCount = e.$slides.length, e.$slides.each(function (e, t) { i(t).attr("data-slick-index", e).data("originalStyling", i(t).attr("style") || "") }), e.$slider.addClass("slick-slider"), e.$slideTrack = 0 === e.slideCount ? i('<div class="slick-track"/>').appendTo(e.$slider) : e.$slides.wrapAll('<div class="slick-track"/>').parent(), e.$list = e.$slideTrack.wrap('<div class="slick-list"/>').parent(), e.$slideTrack.css("opacity", 0), !0 !== e.options.centerMode && !0 !== e.options.swipeToSlide || (e.options.slidesToScroll = 1), i("img[data-lazy]", e.$slider).not("[src]").addClass("slick-loading"), e.setupInfinite(), e.buildArrows(), e.buildDots(), e.updateDots(), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), !0 === e.options.draggable && e.$list.addClass("draggable") }, e.prototype.buildRows = function () { var i, e, t, o, s, n, r, l = this; if (o = document.createDocumentFragment(), n = l.$slider.children(), l.options.rows > 1) { for (r = l.options.slidesPerRow * l.options.rows, s = Math.ceil(n.length / r), i = 0; i < s; i++){ var d = document.createElement("div"); for (e = 0; e < l.options.rows; e++){ var a = document.createElement("div"); for (t = 0; t < l.options.slidesPerRow; t++){ var c = i * r + (e * l.options.slidesPerRow + t); n.get(c) && a.appendChild(n.get(c)) } d.appendChild(a) } o.appendChild(d) } l.$slider.empty().append(o), l.$slider.children().children().children().css({ width: 100 / l.options.slidesPerRow + "%", display: "inline-block" }) } }, e.prototype.checkResponsive = function (e, t) { var o, s, n, r = this, l = !1, d = r.$slider.width(), a = window.innerWidth || i(window).width(); if ("window" === r.respondTo ? n = a : "slider" === r.respondTo ? n = d : "min" === r.respondTo && (n = Math.min(a, d)), r.options.responsive && r.options.responsive.length && null !== r.options.responsive) { s = null; for (o in r.breakpoints) r.breakpoints.hasOwnProperty(o) && (!1 === r.originalSettings.mobileFirst ? n < r.breakpoints[o] && (s = r.breakpoints[o]) : n > r.breakpoints[o] && (s = r.breakpoints[o])); null !== s ? null !== r.activeBreakpoint ? (s !== r.activeBreakpoint || t) && (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.o
19ptions = i.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e)), l = s) : (r.activeBreakpoint = s, "unslick" === r.breakpointSettings[s] ? r.unslick(s) : (r.options = i.extend({}, r.originalSettings, r.breakpointSettings[s]), !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e)), l = s) : null !== r.activeBreakpoint && (r.activeBreakpoint = null, r.options = r.originalSettings, !0 === e && (r.currentSlide = r.options.initialSlide), r.refresh(e), l = s), e || !1 === l || r.$slider.trigger("breakpoint", [r, l]) } }, e.prototype.changeSlide = function (e, t) { var o, s, n, r = this, l = i(e.currentTarget); switch (l.is("a") && e.preventDefault(), l.is("li") || (l = l.closest("li")), n = r.slideCount % r.options.slidesToScroll != 0, o = n ? 0 : (r.slideCount - r.currentSlide) % r.options.slidesToScroll, e.data.message) { case "previous": s = 0 === o ? r.options.slidesToScroll : r.options.slidesToShow - o, r.slideCount > r.options.slidesToShow && r.slideHandler(r.currentSlide - s, !1, t); break; case "next": s = 0 === o ? r.options.slidesToScroll : o, r.slideCount > r.options.slidesToShow && r.slideHandler(r.currentSlide + s, !1, t); break; case "index": var d = 0 === e.data.index ? 0 : e.data.index || l.index() * r.options.slidesToScroll; r.slideHandler(r.checkNavigable(d), !1, t), l.children().trigger("focus"); break; default: return } }, e.prototype.checkNavigable = function (i) { var e, t; if (e = this.getNavigableIndexes(), t = 0, i > e[e.length - 1]) i = e[e.length - 1]; else for (var o in e) { if (i < e[o]) { i = t; break } t = e[o] } return i }, e.prototype.cleanUpEvents = function () { var e = this; e.options.dots && null !== e.$dots && (i("li", e.$dots).off("click.slick", e.changeSlide).off("mouseenter.slick", i.proxy(e.interrupt, e, !0)).off("mouseleave.slick", i.proxy(e.interrupt, e, !1)), !0 === e.options.accessibility && e.$dots.off("keydown.slick", e.keyHandler)), e.$slider.off("focus.slick blur.slick"), !0 === e.options.arrows && e.slideCount > e.options.slidesToShow && (e.$prevArrow && e.$prevArrow.off("click.slick", e.changeSlide), e.$nextArrow && e.$nextArrow.off("click.slick", e.changeSlide), !0 === e.options.accessibility && (e.$prevArrow && e.$prevArrow.off("keydown.slick", e.keyHandler), e.$nextArrow && e.$nextArrow.off("keydown.slick", e.keyHandler))), e.$list.off("touchstart.slick mousedown.slick", e.swipeHandler), e.$list.off("touchmove.slick mousemove.slick", e.swipeHandler), e.$list.off("touchend.slick mouseup.slick", e.swipeHandler), e.$list.off("touchcancel.slick mouseleave.
19slick", e.swipeHandler), e.$list.off("click.slick", e.clickHandler), i(document).off(e.visibilityChange, e.visibility), e.cleanUpSlideEvents(), !0 === e.options.accessibility && e.$list.off("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().off("click.slick", e.selectHandler), i(window).off("orientationchange.slick.slick-" + e.instanceUid, e.orientationChange), i(window).off("resize.slick.slick-" + e.instanceUid, e.resize), i("[draggable!=true]", e.$slideTrack).off("dragstart", e.preventDefault), i(window).off("load.slick.slick-" + e.instanceUid, e.setPosition) }, e.prototype.cleanUpSlideEvents = function () { var e = this; e.$list.off("mouseenter.slick", i.proxy(e.interrupt, e, !0)), e.$list.off("mouseleave.slick", i.proxy(e.interrupt, e, !1)) }, e.prototype.cleanUpRows = function () { var i, e = this; e.options.rows > 1 && ((i = e.$slides.children().children()).removeAttr("style"), e.$slider.empty().append(i)) }, e.prototype.clickHandler = function (i) { !1 === this.shouldClick && (i.stopImmediatePropagation(), i.stopPropagation(), i.preventDefault()) }, e.prototype.destroy = function (e) { var t = this; t.autoPlayClear(), t.touchObject = {}, t.cleanUpEvents(), i(".slick-cloned", t.$slider).detach(), t.$dots && t.$dots.remove(), t.$prevArrow && t.$prevArrow.length && (t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.prevArrow) && t.$prevArrow.remove()), t.$nextArrow && t.$nextArrow.length && (t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display", ""), t.htmlExpr.test(t.options.nextArrow) && t.$nextArrow.remove()), t.$slides && (t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function () { i(this).attr("style", i(this).data("originalStyling")) }), t.$slideTrack.children(this.options.slide).detach(), t.$slideTrack.detach(), t.$list.detach(), t.$slider.append(t.$slides)), t.cleanUpRows(), t.$slider.removeClass("slick-slider"), t.$slider.removeClass("slick-initialized"), t.$slider.removeClass("slick-dotted"), t.unslicked = !0, e || t.$slider.trigger("destroy", [t]) }, e.prototype.disableTransition = function (i) { var e = this, t = {}; t[e.transitionType] = "", !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t) }, e.prototype.fadeSlide = function (i, e) { var t = this; !1 === t.cssTransitions ? (t.$slides.eq(i).css({ zIndex: t.options.zIndex }), t.$slides.eq(i).animate({ opacity: 1 }, t.options.speed, t.options.easing, e)) : (t.applyTransition(i), t.$slides.eq(i).css({ opacity: 1, zIndex: t.options.zIndex }), e && setTimeout(function () { t.disableTransition(i), e.call() }, t.options.speed)) }, e.prototype.fadeSlideOut = function (i) { var e = this; !1 === e.cssTransitions ? e.$slides.eq(i).animate({ opacity: 0, zIndex: e.options.zIndex - 2 }, e.options.speed, e.options.easing) : (e.applyTransition(i), e.$slides.eq(i).css({ opacity: 0, zIndex: e.options.zIndex - 2 })) }, e.prototype.filterSlides = e.prototype.slickFilter = function (i) { var e = this; null !== i && (e.$slidesCache = e.$slides, e.unload(), e.$slideTrack.children(this.options.slide).detach(), e.$slidesCache.filter(i).appendTo(e.$slideTrack), e.reinit()) }, e.prototype.focusHandler = function () { var e = this; e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick", "*", function (t) { t.stopImmediatePropagation(); var o = i(this); setTimeout(function () { e.options.pauseOnFocus && (e.focussed = o.is(":focus"), e.autoPlay()) }, 0) }) }, e.prototype.getCurrent = e.prototype.slickCurrentSlide = function () { return this.currentSlide }, e.prototype.getDotCount = function () { var i = this, e = 0, t = 0, o = 0; if (!0 === i.options.infinite) if (i.slideCount <= i.options.slidesToShow) ++o; else for (; e < i.slideCount;)++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow;
vendor: 4,384 bytes, line 19
19 else if (!0 === i.options.centerMode) o = i.slideCount; else if (i.options.asNavFor) for (; e < i.slideCount;)++o, e = t + i.options.slidesToScroll, t += i.options.slidesToScroll <= i.options.slidesToShow ? i.options.slidesToScroll : i.options.slidesToShow; else o = 1 + Math.ceil((i.slideCount - i.options.slidesToShow) / i.options.slidesToScroll); return o - 1 }, e.prototype.getLeft = function (i) { var e, t, o, s, n = this, r = 0; return n.slideOffset = 0, t = n.$slides.first().outerHeight(!0), !0 === n.options.infinite ? (n.slideCount > n.options.slidesToShow && (n.slideOffset = n.slideWidth * n.options.slidesToShow * -1, s = -1, !0 === n.options.vertical && !0 === n.options.centerMode && (2 === n.options.slidesToShow ? s = -1.5 : 1 === n.options.slidesToShow && (s = -2)), r = t * n.options.slidesToShow * s), n.slideCount % n.options.slidesToScroll != 0 && i + n.options.slidesToScroll > n.slideCount && n.slideCount > n.options.slidesToShow && (i > n.slideCount ? (n.slideOffset = (n.options.slidesToShow - (i - n.slideCount)) * n.slideWidth * -1, r = (n.options.slidesToShow - (i - n.slideCount)) * t * -1) : (n.slideOffset = n.slideCount % n.options.slidesToScroll * n.slideWidth * -1, r = n.slideCount % n.options.slidesToScroll * t * -1))) : i + n.options.slidesToShow > n.slideCount && (n.slideOffset = (i + n.options.slidesToShow - n.slideCount) * n.slideWidth, r = (i + n.options.slidesToShow - n.slideCount) * t), n.slideCount <= n.options.slidesToShow && (n.slideOffset = 0, r = 0), !0 === n.options.centerMode && n.slideCount <= n.options.slidesToShow ? n.slideOffset = n.slideWidth * Math.floor(n.options.slidesToShow) / 2 - n.slideWidth * n.slideCount / 2 : !0 === n.options.centerMode && !0 === n.options.infinite ? n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2) - n.slideWidth : !0 === n.options.centerMode && (n.slideOffset = 0, n.slideOffset += n.slideWidth * Math.floor(n.options.slidesToShow / 2)), e = !1 === n.options.vertical ? i * n.slideWidth * -1 + n.slideOffset : i * t * -1 + r, !0 === n.options.variableWidth && (o = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(i) : n.$slideTrack.children(".slick-slide").eq(i + n.options.slidesToShow), e = !0 === n.options.rtl ? o[0] ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, !0 === n.options.centerMode && (o = n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite ? n.$slideTrack.children(".slick-slide").eq(i) : n.$slideTrack.children(".slick-slide").eq(i + n.options.slidesToShow + 1), e = !0 === n.options.rtl ? o[0] ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width()) : 0 : o[0] ? -1 * o[0].offsetLeft : 0, e += (n.$list.width() - o.outerWidth()) / 2)), e }, e.prototype.getOption = e.prototype.slickGetOption = function (i) { return this.options[i] }, e.prototype.getNavigableIndexes = function () { var i, e = this, t = 0, o = 0, s = []; for (!1 === e.options.infinite ? i = e.slideCount : (t = -1 * e.options.slidesToScroll, o = -1 * e.options.slidesToScroll, i = 2 * e.slideCount); t < i;)s.push(t), t = o + e.options.slidesToScroll, o += e.options.slidesToScroll <= e.options.slidesToShow ? e.options.slidesToScroll : e.options.slidesToShow; return s }, e.prototype.getSlick = function () { return this }, e.prototype.getSlideCount = function () { var e, t, o = this; return t = !0 === o.options.centerMode ? o.slideWidth * Math.floor(o.options.slidesToShow / 2) : 0, !0 === o.options.swipeToSlide ? (o.$slideTrack.find(".slick-slide").each(function (s, n) { if (n.offsetLeft - t + i(n).outerWidth() / 2 > -1 * o.swipeLeft) return e = n, !1 }), Math.abs(i(e).attr("data-slick-index") - o.currentSlide) || 1) : o.options.slidesToScroll }, e.prototype.goTo = e.prototype.slickGoTo = function (i, e) { this.changeSlide({ data: { message: "index", index: parseInt(i) } }, e) }, e.prototype.init = function (e) { var t = this; i(t.$slider).hasClass("slick-initialized") || (i(t.$slider).addClass("slick-initialized"), t.buildRows(), t.buildOut(), t.setProps(), t.startLoad(), t.loadSlider(), t.initializeEvents(), t.updateArrows(), t.updateDots(), t.checkResponsive(!0), t.focusHandler()), e && t.$slider.trigger("init", [t]), !0 === t.options.accessibility && t.initADA(), t.options.autoplay && (t.paused = !1, t.autoPlay()) }
19, e.prototype.initADA = function () { var e = this, t = Math.ceil(e.slideCount / e.options.slidesToShow), o = e.getNavigableIndexes().filter(function (i) { return i >= 0 && i < e.slideCount }); e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({ "aria-hidden": "true", tabindex: "-1" }).find("a, input, button, select").attr({ tabindex: "-1" }), null !== e.$dots && (e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function (t) { var s = o.indexOf(t); i(this).attr({ role: "tabpanel", id: "slick-slide" + e.instanceUid + t, tabindex: -1 }), -1 !== s && i(this).attr({ "aria-describedby": "slick-slide-control" + e.instanceUid + s }) }), e.$dots.attr("role", "tablist").find("li").each(function (s) { var n = o[s]; i(this).attr({ role: "presentation" }), i(this).find("button").first().attr({ role: "tab", id: "slick-slide-control" + e.instanceUid + s, "aria-controls": "slick-slide" + e.instanceUid + n, "aria-label": s + 1 + " of " + t, "aria-selected": null, tabindex: "-1" }) }).eq(e.currentSlide).find("button").attr({ "aria-selected": "true", tabindex: "0" }).end()); for (var s = e.currentSlide, n = s + e.options.slidesToShow; s < n; s++)e.$slides.eq(s).attr("tabindex", 0); e.activateADA() }, e.prototype.initArrowEvents = function () { var i = this; !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.off("click.slick").on("click.slick", { message: "previous" }, i.changeSlide), i.$nextArrow.off("click.slick").on("click.slick", { message: "next" }, i.changeSlide), !0 === i.options.accessibility && (i.$prevArrow.on("keydown.slick", i.keyHandler), i.$nextArrow.on("keydown.slick", i.keyHandler))) }, e.prototype.initDotEvents = function () { var e = this; !0 === e.options.dots && (i("li", e.$dots).on("click.slick", { message: "index" }, e.changeSlide), !0 === e.options.accessibility && e.$dots.on("keydown.slick", e.keyHandler)), !0 === e.options.dots && !0 === e.options.pauseOnDotsHover && i("li", e.$dots).on("mouseenter.slick", i.proxy(e.interrupt, e, !0)).on("mouseleave.slick", i.proxy(e.interrupt, e, !1)) }, e.prototype.initSlideEvents = function () { var e = this; e.options.pauseOnHover && (e.$list.on("mouseenter.slick", i.proxy(e.interrupt, e, !0)), e.$list.on("mouseleave.slick", i.proxy(e.interrupt, e, !1))) }, e.prototype.initializeEvents = function () { var e = this; e.initArrowEvents(), e.initDotEvents(), e.initSlideEvents(), e.$list.on("touchstart.slick mousedown.slick", { action: "start" }, e.swipeHandler), e.$list.on("touchmove.slick mousemove.slick", { action: "move" }, e.swipeHandler), e.$list.on("touchend.slick mouseup.slick", { action: "end" }
vendor: 14,973 bytes, line 19
19, e.swipeHandler), e.$list.on("touchcancel.slick mouseleave.slick", { action: "end" }, e.swipeHandler), e.$list.on("click.slick", e.clickHandler), i(document).on(e.visibilityChange, i.proxy(e.visibility, e)), !0 === e.options.accessibility && e.$list.on("keydown.slick", e.keyHandler), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), i(window).on("orientationchange.slick.slick-" + e.instanceUid, i.proxy(e.orientationChange, e)), i(window).on("resize.slick.slick-" + e.instanceUid, i.proxy(e.resize, e)), i("[draggable!=true]", e.$slideTrack).on("dragstart", e.preventDefault), i(window).on("load.slick.slick-" + e.instanceUid, e.setPosition), i(e.setPosition) }, e.prototype.initUI = function () { var i = this; !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.show(), i.$nextArrow.show()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.show() }, e.prototype.keyHandler = function (i) { var e = this; i.target.tagName.match("TEXTAREA|INPUT|SELECT") || (37 === i.keyCode && !0 === e.options.accessibility ? e.changeSlide({ data: { message: !0 === e.options.rtl ? "next" : "previous" } }) : 39 === i.keyCode && !0 === e.options.accessibility && e.changeSlide({ data: { message: !0 === e.options.rtl ? "previous" : "next" } })) }, e.prototype.lazyLoad = function () { function e(e) { i("img[data-lazy]", e).each(function () { var e = i(this), t = i(this).attr("data-lazy"), o = i(this).attr("data-srcset"), s = i(this).attr("data-sizes") || n.$slider.attr("data-sizes"), r = document.createElement("img"); r.onload = function () { e.animate({ opacity: 0 }, 100, function () { o && (e.attr("srcset", o), s && e.attr("sizes", s)), e.attr("src", t).animate({ opacity: 1 }, 200, function () { e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading") }), n.$slider.trigger("lazyLoaded", [n, e, t]) }) }, r.onerror = function () { e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), n.$slider.trigger("lazyLoadError", [n, e, t]) }, r.src = t }) } var t, o, s, n = this; if (!0 === n.options.centerMode ? !0 === n.options.infinite ? s = (o = n.currentSlide + (n.options.slidesToShow / 2 + 1)) + n.options.slidesToShow + 2 : (o = Math.max(0, n.currentSlide - (n.options.slidesToShow / 2 + 1)), s = n.options.slidesToShow / 2 + 1 + 2 + n.currentSlide) : (o = n.options.infinite ? n.options.slidesToShow + n.currentSlide : n.currentSlide, s = Math.ceil(o + n.options.slidesToShow), !0 === n.options.fade && (o > 0 && o--, s <= n.slideCount && s++)), t = n.$slider.find(".slick-slide").slice(o, s), "anticipated" === n.options.lazyLoad) for (var r = o - 1, l = s, d = n.$slider.find(".slick-slide"), a = 0; a < n.options.slidesToScroll; a++)r < 0 && (r = n.slideCount - 1), t = (t = t.add(d.eq(r))).add(d.eq(l)), r--, l++; e(t), n.slideCount <= n.options.slidesToShow ? e(n.$slider.find(".slick-slide")) : n.currentSlide >= n.slideCount - n.options.slidesToShow ? e(n.$slider.find(".slick-cloned").slice(0, n.options.slidesToShow)) : 0 === n.currentSlide && e(n.$slider.find(".slick-cloned").slice(-1 * n.options.slidesToShow)) }, e.prototype.loadSlider = function () { var i = this; i.setPosition(), i.$slideTrack.css({ opacity: 1 }), i.$slider.removeClass("slick-loading"), i.initUI(), "progressive" === i.options.lazyLoad && i.progressiveLazyLoad() }, e.prototype.next = e.prototype.slickNext = function () { this.changeSlide({ data: { message: "next" } }) }, e.prototype.orientationChange = function () { var i = this; i.checkResponsive(), i.setPosition() }, e.prototype.pause = e.prototype.slickPause = function () { var i = this; i.autoPlayClear(), i.paused = !0 }, e.prototype.play = e.prototype.slickPlay = function () { var i = this; i.autoPlay(), i.options.autoplay = !0, i.paused = !1, i.focussed = !1, i.interrupted = !1 }, e.prototype.postSlide = function (e) { var t = this; t.unslicked || (t.$slider.trigger("afterChange", [t, e]), t.animating = !1, t.slideCount > t.options.slidesToShow && t.setPosition(), t.swipeLeft = null, t.options.autoplay && t.autoPlay(), !0 === t.options.accessibility && (t.initADA(), t.options.focusOnChange && i(t.$slides.get(t.currentSlide)).attr("tabindex", 0).focus())) }, e.prototype.prev = e.prototype.slickPrev = function () { this.changeSlide({ data: { message: "previous" } }) }, e.prototype.preventDefault = function (i) { i.preventDefault() }, e.prototype.progressiveLazyLoad = function (e) { e = e || 1; var t, o, s, n, r, l = this, d = i("img[data-lazy]", l.$slider); d.length ? (t = d.first(), o = t.attr("data-lazy"), s = t.attr("data-srcset"), n = t.attr("data-sizes") || l.$slider.attr("data-sizes"), (r = document.createElement("img")).onload = function () { s && (t.attr("srcset", s), n && t.attr("sizes", n)), t.attr("src", o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"), !0 === l.options.adaptiveHeight && l.setPosition(), l.$slider.trigger("lazyLoaded", [l, t, o]), l.progressiveLazyLoad() }, r.onerror = function () { e < 3 ? setTimeout(function () { l.progressiveLazyLoad(e + 1) }, 500) : (t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"), l.$slider.trigger("lazyLoadError", [l, t, o]), l.progressiveLazyLoad()) }, r.src = o) : l.$slider.trigger("allImagesLoaded", [l]) }, e.prototype.refresh = function (e) { var t, o, s = this; o = s.slideCount - s.options.slidesToShow, !s.options.infinite && s.currentSlide > o && (s.currentSlide = o), s.slideCount <= s.options.slidesToShow && (s.currentSlide = 0), t = s.currentSlide, s.destroy(!0), i.extend(s, s.initials, { currentSlide: t }), s.init(), e || s.changeSlide({ data: { message: "index", index: t } }, !1) }, e.prototype.registerBreakpoints = function () { var e, t, o, s = this, n = s.options.responsive || null; if ("array" === i.type(n) && n.length) { s.respondTo = s.options.respondTo || "window"; for (e in n) if (o = s.breakpoints.length - 1, n.hasOwnProperty(e)) { for (t = n[e].breakpoint; o >= 0;)s.breakpoints[o] && s.breakpoints[o] === t && s.breakpoints.splice(o, 1), o--; s.breakpoints.push(t), s.breakpointSettings[t] = n[e].settings } s.breakpoints.sort(function (i, e) { return s.options.mobileFirst ? i - e : e - i }) } }, e.prototype.reinit = function () { var e = this; e.$slides = e.$slideTrack.children(e.options.slide).addClass("slick-slide"), e.slideCount = e.$slides.length, e.currentSlide >= e.slideCount && 0 !== e.currentSlide && (e.currentSlide = e.currentSlide - e.options.slidesToScroll), e.slideCount <= e.options.slidesToShow && (e.currentSlide = 0), e.registerBreakpoints(), e.setProps(), e.setupInfinite(), e.buildArrows(), e.updateArrows(), e.initArrowEvents(), e.buildDots(), e.updateDots(), e.initDotEvents(), e.cleanUpSlideEvents(), e.initSlideEvents(), e.checkResponsive(!1, !0), !0 === e.options.focusOnSelect && i(e.$slideTrack).children().on("click.slick", e.selectHandler), e.setSlideClasses("number" == typeof e.currentSlide ? e.currentSlide : 0), e.setPosition(), e.focusHandler(), e.paused = !e.options.autoplay, e.autoPlay(), e.$slider.trigger("reInit", [e]) }, e.prototype.resize = function () { var e = this; i(window).width() !== e.windowWidth && (clearTimeout(e.windowDelay), e.windowDelay = window.setTimeout(function () { e.windowWidth = i(window).width(), e.checkResponsive(), e.unslicked || e.setPosition() }, 50)) }, e.prototype.removeSlide = e.prototype.slickRemove = function (i, e, t) { var o = this; if (i = "boolean" == typeof i ? !0 === (e = i) ? 0 : o.slideCount - 1 : !0 === e ? --i : i, o.slideCount < 1 || i < 0 || i > o.slideCount - 1) return !1; o.unload(), !0 === t ? o.$slideTrack.children().remove() : o.$slideTrack.children(this.options.slide).eq(i).remove(), o.$slides = o.$slideTrack.children(this.options.slide), o.$slideTrack.children(this.options.slide).detach(), o.$slideTrack.append(o.$slides), o.$slidesCache = o.$slides, o.reinit() }, e.prototype.setCSS = function (i) { var e, t, o = this, s = {}; !0 === o.options.rtl && (i = -i), e = "left" == o.positionProp ? Math.ceil(i) + "px" : "0px", t = "top" == o.positionProp ? Math.ceil(i) + "px" : "0px", s[o.positionProp] = i, !1 === o.transformsEnabled ? o.$slideTrack.css(s) : (s = {}, !1 === o.cssTransitions ? (s[o.animType] = "translate(" + e + ", " + t + ")", o.$slideTrack.css(s)) : (s[o.animType] = "translate3d(" + e + ", " + t + ", 0px)", o.$slideTrack.css(s))) }, e.prototype.setDimensions = function () { var i = this; !1 === i.options.vertical ? !0 === i.options.centerMode && i.$list.css({ padding: "0px " + i.options.centerPadding }) : (i.$list.height(i.$slides.first().outerHeight(!0) * i.options.slidesToShow), !0 === i.options.centerMode && i.$list.css({ padding: i.options.centerPadding + " 0px" })), i.listWidth = i.$list.width(), i.listHeight = i.$list.height(), !1 === i.options.vertical && !1 === i.options.variableWidth ? (i.slideWidth = Math.ceil(i.listWidth / i.options.slidesToShow), i.$slideTrack.width(Math.ceil(i.slideWidth * i.$slideTrack.children(".slick-slide").length))) : !0 === i.options.variableWidth ? i.$slideTrack.width(5e3 * i.slideCount) : (i.slideWidth = Math.ceil(i.listWidth), i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0) * i.$slideTrack.children(".slick-slide").length))); var e = i.$slides.first().outerWidth(!0) - i.$slides.first().width(); !1 === i.options.variableWidth && i.$slideTrack.children(".slick-slide").width(i.slideWidth - e) }, e.prototype.setFade = function () { var e, t = this; t.$slides.each(function (o, s) { e = t.slideWidth * o * -1, !0 === t.options.rtl ? i(s).css({ position: "relative", right: e, top: 0, zIndex: t.options.zIndex - 2, opacity: 0 }) : i(s).css({ position: "relative", left: e, top: 0, zIndex: t.options.zIndex - 2, opacity: 0 }) }), t.$slides.eq(t.currentSlide).css({ zIndex: t.options.zIndex - 1, opacity: 1 }) }, e.prototype.setHeight = function () { var i = this; if (1 === i.options.slidesToShow && !0 === i.options.adaptiveHeight && !1 === i.options.vertical) { var e = i.$slides.eq(i.currentSlide).outerHeight(!0); i.$list.css("height", e) } }, e.prototype.setOption = e.prototype.slickSetOption = function () { var e, t, o, s, n, r = this, l = !1; if ("object" === i.type(arguments[0]) ? (o = arguments[0], l = arguments[1], n = "multiple") : "string" === i.type(arguments[0]) && (o = arguments[0], s = arguments[1], l = arguments[2], "responsive" === arguments[0] && "array" === i.type(arguments[1]) ? n = "responsive" : void 0 !== arguments[1] && (n = "single")), "single" === n) r.options[o] = s; else if ("multiple" === n) i.each(o, function (i, e) { r.options[i] = e }); else if ("responsive" === n) for (t in s) if ("array" !== i.type(r.options.responsive)) r.options.responsive = [s[t]]; else { for (e = r.options.responsive.length - 1; e >= 0;)r.options.responsive[e].breakpoint === s[t].breakpoint && r.options.responsive.splice(e, 1), e--; r.options.responsive.push(s[t]) } l && (r.unload(), r.reinit()) }, e.prototype.setPosition = function () { var i = this; i.setDimensions(), i.setHeight(), !1 === i.options.fade ? i.setCSS(i.getLeft(i.currentSlide)) : i.setFade(), i.$slider.trigger("setPosition", [i]) }, e.prototype.setProps = function () { var i = this, e = document.body.style; i.positionProp = !0 === i.options.vertical ? "top" : "left", "top" === i.positionProp ? i.$slider.addClass("slick-vertical") : i.$slider.removeClass("slick-vertical"), void 0 === e.WebkitTransition && void 0 === e.MozTransition && void 0 === e.msTransition || !0 === i.options.useCSS && (i.cssTransitions = !0), i.options.fade && ("number" == typeof i.options.zIndex ? i.options.zIndex < 3 && (i.options.zIndex = 3) : i.options.zIndex = i.defaults.zIndex), void 0 !== e.OTransform && (i.animType = "OTransform", i.transformType = "-o-transform", i.transitionType = "OTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.MozTransform && (i.animType = "MozTransform", i.transformType = "-moz-transform", i.transitionType = "MozTransition", void 0 === e.perspectiveProperty && void 0 === e.MozPerspective && (i.animType = !1)), void 0 !== e.webkitTransform && (i.animType = "webkitTransform", i.transformType = "-webkit-transform", i.transitionType = "webkitTransition", void 0 === e.perspectiveProperty && void 0 === e.webkitPerspective && (i.animType = !1)), void 0 !== e.msTransform && (i.animType = "msTransform", i.transformType = "-ms-transform", i.transitionType = "msTransition", void 0 === e.msTransform && (i.animType = !1)), void 0 !== e.transform && !1 !== i.animType && (i.animType = "transform", i.transformType = "transform", i.transitionType = "transition"), i.transformsEnabled = i.options.useTransform && null !== i.animType && !1 !== i.animType }, e.prototype.setSlideClasses = function (i) { var e, t, o, s, n = this; if (t = n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden", "true"), n.$slides.eq(i).addClass("slick-current"), !0 === n.options.centerMode) { var r = n.options.slidesToShow % 2 == 0 ? 1 : 0; e = Math.floor(n.options.slidesToShow / 2), !0 === n.options.infinite && (i >= e && i <= n.slideCount - 1 - e ? n.$slides.slice(i - e + r, i + e + 1).addClass("slick-active").attr("aria-hidden", "false") : (o = n.options.slidesToShow + i, t.slice(o - e + 1 + r, o + e + 2).addClass("slick-active").attr("aria-hidden", "false")), 0 === i ? t.eq(t.length - 1 - n.options.slidesToShow).addClass("slick-center") : i === n.slideCount - 1 && t.eq(n.options.slidesToShow).addClass("slick-center")), n.$slides.eq(i).addClass("slick-center") } else i >= 0 && i <= n.slideCount - n.options.slidesToShow ? n.$slides.slice(i, i + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false") : t.length <= n.options.slidesToShow ? t.addClass("slick-active").attr("aria-hidden", "false") : (s = n.slideCount % n.options.slidesToShow, o = !0 === n.options.infinite ? n.options.slidesToShow + i : i, n.options.slidesToShow == n.options.slidesToScroll && n.slideCount - i < n.options.slidesToShow ? t.slice(o - (n.options.slidesToShow - s), o + s).addClass("slick-active").attr("aria-hidden", "false") : t.slice(o, o + n.options.slidesToShow).addClass("slick-active").attr("aria-hidden", "false")); "ondemand" !== n.options.lazyLoad && "anticipated" !== n.options.lazyLoad || n.lazyLoad() }, e.prototype.setupInfinite = function () { var e, t, o, s = this; if (!0 === s.options.fade && (s.options.centerMode = !1), !0 === s.options.infinite && !1 === s.options.fade && (t = null, s.slideCount > s.options.slidesToShow)) { for (o = !0 === s.options.centerMode ? s.options.slidesToShow + 1 : s.options.slidesToShow, e = s.slideCount; e > s.slideCount - o; e -= 1)t = e - 1, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t - s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned"); for (e = 0; e < o + s.slideCount;
19 e += 1)t = e, i(s.$slides[t]).clone(!0).attr("id", "").attr("data-slick-index", t + s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned"); s.$slideTrack.find(".slick-cloned").find("[id]").each(function () { i(this).attr("id", "") }) } }, e.prototype.interrupt = function (i) { var e = this; i || e.autoPlay(), e.interrupted = i }, e.prototype.selectHandler = function (e) { var t = this, o = i(e.target).is(".slick-slide") ? i(e.target) : i(e.target).parents(".slick-slide"), s = parseInt(o.attr("data-slick-index")); s || (s = 0), t.slideCount <= t.options.slidesToShow ? t.slideHandler(s, !1, !0) : t.slideHandler(s) }, e.prototype.slideHandler = function (i, e, t) { var o, s, n, r, l, d = null, a = this; if (e = e || !1, !(!0 === a.animating && !0 === a.options.waitForAnimate || !0 === a.options.fade && a.currentSlide === i)) if (!1 === e && a.asNavFor(i), o = i, d = a.getLeft(o), r = a.getLeft(a.currentSlide), a.currentLeft = null === a.swipeLeft ? r : a.swipeLeft, !1 === a.options.infinite && !1 === a.options.centerMode && (i < 0 || i > a.getDotCount() * a.options.slidesToScroll)) !1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(r, function () { a.postSlide(o) }) : a.postSlide(o)); else if (!1 === a.options.infinite && !0 === a.options.centerMode && (i < 0 || i > a.slideCount - a.options.slidesToScroll)) !1 === a.options.fade && (o = a.currentSlide, !0 !== t ? a.animateSlide(r, function () { a.postSlide(o) }) : a.postSlide(o)); else { if (a.options.autoplay && clearInterval(a.autoPlayTimer), s = o < 0 ? a.slideCount % a.options.slidesToScroll != 0 ? a.slideCount - a.slideCount % a.options.slidesToScroll : a.slideCount + o : o >= a.slideCount ? a.slideCount % a.options.slidesToScroll != 0 ? 0 : o - a.slideCount : o, a.animating = !0, a.$slider.trigger("beforeChange", [a, a.currentSlide, s]), n = a.currentSlide, a.currentSlide = s, a.setSlideClasses(a.currentSlide), a.options.asNavFor && (l = (l = a.getNavTarget()).slick("getSlick")).slideCount <= l.options.slidesToShow && l.setSlideClasses(a.currentSlide), a.updateDots(), a.updateArrows(), !0 === a.options.fade) return !0 !== t ? (a.fadeSlideOut(n), a.fadeSlide(s, function () { a.postSlide(s) })) : a.postSlide(s), void a.animateHeight(); !0 !== t ? a.animateSlide(d, function () { a.postSlide(s) }) : a.postSlide(s) } }, e.prototype.startLoad = function () { var i = this; !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && (i.$prevArrow.hide(), i.$nextArrow.hide()), !0 === i.options.dots && i.slideCount > i.options.slidesToShow && i.$dots.hide(), i.$slider.addClass("slick-loading") }, e.prototype.swipeDirection = function () { var i, e, t, o, s = this; return i = s.touchObject.startX - s.touchObject.curX, e = s.touchObject.startY - s.touchObject.curY, t = Math.atan2(e, i), (o = Math.round(180 * t / Math.PI)) < 0 && (o = 360 - Math.abs(o)), o <= 45 && o >= 0 ? !1 === s.options.rtl ? "left" : "right" : o <= 360 && o >= 315 ? !1 === s.options.rtl ? "left" : "right" : o >= 135 && o <= 225 ? !1 === s.options.rtl ? "right" : "left" : !0 === s.options.verticalSwiping ? o >= 35 && o <= 135 ? "down" : "up" : "vertical" }, e.prototype.swipeEnd = function (i) { var e, t, o = this; if (o.dragging = !1, o.swiping = !1, o.scrolling) return o.scrolling = !1, !1; if (o.interrupted = !1, o.shouldClick = !(o.touchObject.swipeLength > 10), void 0 === o.touchObject.curX) return !1; if (!0 === o.touchObject.edgeHit && o.$slider.trigger("edge", [o, o.swipeDirection()]), o.touchObject.swipeLength >= o.touchObject.minSwipe) { switch (t = o.swipeDirection()) { case "left": case "down": e = o.options.swipeToSlide ? o.checkNavigable(o.currentSlide + o.getSlideCount()) : o.currentSlide + o.getSlideCount(), o.currentDirection = 0; break; case "right": case "up": e = o.options.swipeToSlide ? o.checkNavigable(o.currentSlide - o.getSlideCount()) : o.currentSlide - o.getSlideCount(), o.currentDirection = 1 }"vertical" != t && (o.slideHandler(e), o.touchObject = {}, o.$slider.trigger("swipe", [o, t])) } else o.touchObject.startX !== o.touchObject.curX && (o.slideHandler(o.currentSlide), o.touchObject = {}) }, e.prototype.swipeHandler = function (i) { var e = this; if (!(!1 === e.options.swipe || "ontouchend" in document && !1 === e.options.swipe || !1 === e.options.draggable && -1 !== i.type.indexOf("mou
19se"))) switch (e.touchObject.fingerCount = i.originalEvent && void 0 !== i.originalEvent.touches ? i.originalEvent.touches.length : 1, e.touchObject.minSwipe = e.listWidth / e.options.touchThreshold, !0 === e.options.verticalSwiping && (e.touchObject.minSwipe = e.listHeight / e.options.touchThreshold), i.data.action) { case "start": e.swipeStart(i); break; case "move": e.swipeMove(i); break; case "end": e.swipeEnd(i) } }, e.prototype.swipeMove = function (i) { var e, t, o, s, n, r, l = this; return n = void 0 !== i.originalEvent ? i.originalEvent.touches : null, !(!l.dragging || l.scrolling || n && 1 !== n.length) && (e = l.getLeft(l.currentSlide), l.touchObject.curX = void 0 !== n ? n[0].pageX : i.clientX, l.touchObject.curY = void 0 !== n ? n[0].pageY : i.clientY, l.touchObject.swipeLength = Math.round(Math.sqrt(Math.pow(l.touchObject.curX - l.touchObject.startX, 2))), r = Math.round(Math.sqrt(Math.pow(l.touchObject.curY - l.touchObject.startY, 2))), !l.options.verticalSwiping && !l.swiping && r > 4 ? (l.scrolling = !0, !1) : (!0 === l.options.verticalSwiping && (l.touchObject.swipeLength = r), t = l.swipeDirection(), void 0 !== i.originalEvent && l.touchObject.swipeLength > 4 && (l.swiping = !0, i.preventDefault()), s = (!1 === l.options.rtl ? 1 : -1) * (l.touchObject.curX > l.touchObject.startX ? 1 : -1), !0 === l.options.verticalSwiping && (s = l.touchObject.curY > l.touchObject.startY ? 1 : -1), o = l.touchObject.swipeLength, l.touchObject.edgeHit = !1, !1 === l.options.infinite && (0 === l.currentSlide && "right" === t || l.currentSlide >= l.getDotCount() && "left" === t) && (o = l.touchObject.swipeLength * l.options.edgeFriction, l.touchObject.edgeHit = !0), !1 === l.options.vertical ? l.swipeLeft = e + o * s : l.swipeLeft = e + o * (l.$list.height() / l.listWidth) * s, !0 === l.options.verticalSwiping && (l.swipeLeft = e + o * s), !0 !== l.options.fade && !1 !== l.options.touchMove && (!0 === l.animating ? (l.swipeLeft = null, !1) : void l.setCSS(l.swipeLeft)))) }, e.prototype.swipeStart = function (i) { var e, t = this; if (t.interrupted = !0, 1 !== t.touchObject.fingerCount || t.slideCount <= t.options.slidesToShow) return t.touchObject = {}, !1; void 0 !== i.originalEvent && void 0 !== i.originalEvent.touches && (e = i.originalEvent.touches[0]), t.touchObject.startX = t.touchObject.curX = void 0 !== e ? e.pageX : i.clientX, t.touchObject.startY = t.touchObject.curY = void 0 !== e ? e.pageY : i.clientY, t.dragging = !0 }, e.prototype.unfilterSlides = e.prototype.slickUnfilter = function () { var i = this; null !== i.$slidesCache && (i.unload(), i.$slideTrack.children(this.options.slide).detach(), i.$slidesCache.appendTo(i.$slideTrack), i.reinit()) }, e.prototype.unload = function () { var e = this; i(".slick-cloned", e.$slider).remove(), e.$dots && e.$dots.remove(), e.$prevArrow && e.htmlExpr.test(e.options.prevArrow) && e.$prevArrow.remove(), e.$nextArrow && e.htmlExpr.test(e.options.nextArrow) && e.$nextArrow.remove(), e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden", "true").css("width", "") }, e.prototype.unslick = function (i) { var e = this; e.$slider.trigger("unslick", [e, i]), e.destroy() }, e.prototype.updateArrows = function () { var i = this; Math.floor(i.options.slidesToShow / 2), !0 === i.options.arrows && i.slideCount > i.options.slidesToShow && !i.options.infinite && (i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false"), 0 === i.currentSlide ? (i.$prevArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - i.options.slidesToShow && !1 === i.options.centerMode ? (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false")) : i.currentSlide >= i.slideCount - 1 && !0 === i.options.centerMode && (i.$nextArrow.addClass("slick-disabled").attr("aria-disabled", "true"), i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled", "false"))) }, e.prototype.updateDots = function () { var i = this; null !== i.$dots && (i.$dots.find("li").removeClass("slick-active").end(), i.$dots.find("li").eq(Math.floor(i.currentSlide / i.options.slidesToScroll)).addClass("slick-active")) }, e.prototype.visibility = function () { var i = this; i.options.autoplay && (document[i.hidden] ? i.interrupted = !0 : i.interrupted = !1) }, i.fn.slick = function () { var i, t, o = this, s = arguments[0], n = Array.prototype.slice.call(arguments, 1), r = o.length; for (i = 0; i < r; i++)if ("object" == typeof s || void 0 === s ? o[i].slick = new e(o[i], s) : t = o[i].slick[s].apply(o[i].slick, n), void 0 !== t) return t; return o } }); 20(function(l,n,o){"use strict";l.rbw=l.rbw||{};l.rbw.slickListingImageCarousel={listings:{},lazyLoadListingImagesTimer:null,init:function(e){var i=this;var t=n.extend(true,{},{lazyLoadImages:true,lazyImageTemplate:'<div><img id="img_{listingId}_{displaySequence}" border="0" alt="MLS: {listingNumber}" data-lazy="{filePath}" /></div>',slick:{dots:false,infinite:true,speed:300,slidesToShow:1,slidesToScroll:1,variableWidth:false,centerMode:false,prevArrow:'<button type="button" data-role="none" class="r-cta-icon slick-prev" aria-label="Previous" tabindex="0" role="button"></button>',nextArrow:'<button type="button" data-role="none" class="r-cta-icon slick-next" aria-label="Next" tabindex="0" role="button"></button>'}},e);
20if(!t.carouselEle||!t.listingId){throw"rbw.slickCarousel exception: 'carouselEle' and 'listingId' are required properties of rbw.slickCarousel.init's options argument."}i.listings[t.listingId]=n.extend(true,{},{lazyLoadImages:false,carouselEle:t.carouselEle,selectedImage:0,loadedImages:0,lazyImageTemplate:t.lazyImageTemplate},i.listings[t.listingId]||{});function a(){t.carouselEle.slick({accessibility:false,dots:t.slick.dots,infinite:t.slick.infinite,speed:t.slick.speed,slidesToShow:t.slick.slidesToShow,slidesToScroll:t.slick.slidesToScroll,variableWidth:t.slick.variableWidth,centerMode:t.slick.centerMode,prevArrow:t.slick.prevArrow,nextArrow:t.slick.nextArrow})}t.carouselEle.on({init:function(){l.setTimeout(function(){t.carouselEle.slick("setPosition");if(i.listings[t.listingId])i.listings[t.listingId].lazyLoadImages=t.lazyLoadImages},1)},afterChange:function(){var e=arguments[2];i.listings[t.listingId].selectedImage=e;if(t.currentPhotoEle){t.currentPhotoEle.text(e+1)}}});a()},lazyLoadListingImagesInView:function(){var s=this;var e=[];function i(){function t(e){e=e[0];var i=e.getBoundingClientRect().top;var t=e.getBoundingClientRect().bottom;var a=i<l.innerHeight&&t>=0;return a}return n.map(s.listings,function(e,i){if(e.carouselEle&&e.lazyLoadImages&&t(e.carouselEle)){return i}})}function t(e){return s.listings[e].loadedImages===0}function a(){function a(e,i){if(!e)return;var a=e.lazyImageTemplate||"";function t(e,i){var t=new RegExp("{"+e+"}","ig");a=a.replace(t,i)}n.each(e,t);n.each(i,t);e.carouselEle.slick("slickAdd",a)}n.ajax({type:"POST",url:o()+"/include/ajax/api.aspx?op=GetListingsImages",data:{listingids:e.join(),skip:1}}).done(function(e){var i=e.Entity;n.each(i,function(e,i){var t=s.listings[i.ListingId];if(t!=undefined){n.each(i.Images,function(e,i){a(t,i);t.loadedImages=t.loadedImages+1});t.carouselEle.trigger("slickListingImageCarousel.addUnloadedListingImages.completed")}})})}e=n.grep(i(),t);if(e.length===0){return}a()},lazyLoadListingImagesHandler:function(e){var i=this;if(i.lazyLoadListingImagesTimer!==null){l.clearTimeout(i.lazyLoadListingImagesTimer)}i.lazyLoadListingImagesTimer=l.setTimeout(function(){i.lazyLoadListingImagesInView()},e)}};l.addEventListener("scroll",function(){l.rbw.slickListingImageCarousel.lazyLoadListingImagesHandler(100)},false)})(window,jQuery,getAppRoot); 21(function(n){function u(n,t,i,r){var f,u,e;for(r=r instanceof Array?r:[],f={},u=0;u<r.length;u++)f[r[u]]=!0;e=function(n){this.element=n};e.prototype=i;n.fn[t]=function(){var i=arguments,r=this;return this.each(function(){var o=n(this),u=o.data("plugin-"+t),s,h;u?typeof i[0]=="string"&&i[0].charAt(0)!="_"&&typeof u[i[0]]=="function"&&(s=Array.prototype.slice.call(i,1),h=u[i[0]].apply(u,s),i[0]in f&&(r=h)):(u=new e(o),o.data("plugin-"+t,u),u._init&&u._init.apply(u,i))}),r}}var t,i=function(){},r=function(t,i){return function(){return n.isFunction(i)?i.apply(t,arguments):t[i].apply(t,arguments)}},o=function(n){var t=[];for(var i in n)t.push(i);return t};animationqueue={};animationqueue.AnimationQueue=function(){this.sets=[];this.isRunning=!1;this.current=0;this.totalTime=0;this.elapsedTime=0;this.startTime=1;this.poll=null};animationqueue.AnimationQueue.prototype={queue:function(n){this.sets.push(n)},start:function(t,r){var u,f,e;this.totalTime=t;this.elapsedTime=0;this.isRunning=!0;r=n.isFunction(r)?r:i;u=1;f=1;this.sets.length>0&&(u=this.sets.length,f=this.sets[0].totalTime>0?Math.max(0,Math.min(1,1-this.sets[0].elapsedTime/this.sets[0].totalTime)):1);e=(new Date).getTime();this.sets.length>0&&this.sets[0].start(f/u*this.totalTime),function(n,t,i){function u(){n.elapsedTime=(new Date).getTime()-e;n.sets.length&&!n.sets[0].isRunning&&(n.sets.shift(),n.sets.length&&n.sets[0].start(t/i));n.elapsedTime>=n.totalTime&&n.sets.length==0&&(r(n.elapsedTime),n.stop())}n.poll=setInterval(u,16)}(this,this.totalTime,u)},stop:function(){if(this.isRunning){this.isRunning=!1;for(var n=this.sets.length;n--;)this.sets[n].stop();clearInterval(this.poll)}},remove:function(n){for(var t=this.sets.length,i;t--;)this.sets[t]==n&&(i=this.sets.slice(0,t),this.animationSet=i.push(this.sets.slice(t+1)))},get:function(){return this.sets.slice(0)}};animationqueue.AnimationSet=function(){this.steps=[];this.isStepsSorted=!0;this.currentStep=-1;this.animations=[];this.isRunning=!1;this.totalTime=0;this.elapsedTime=0;this.poll=null;this.data={}};animationqueue.AnimationSet.prototype={add:function(n){n instanceof animationqueue.AnimationStep?(this.steps.push(n),this.isStepsSorted=!1,++this.currentStep):n instanceof animationqueue.Animation&&this.animations.push(n)},start:function(n){function u(){for(t.elapsedTime=(new Date).getTime()-t.startTime;t.currentStep>=0&&t.steps[t.currentStep].getTime(t.totalTime)<=t.elapsedTime;)t.steps[t.currentStep].doIt(),--t.currentStep;if(t.elapsedTime>=t.totalTime&&t.currentStep<0){while(i>=0&&!t.animations[i].isRunning)--i;i<0&&t.reset(t.elapsedTime)}}var r,t,i;for(this.elapsedTime=this.totalTime==0?0:this.elapsedTime/this.totalTime*n,this.totalTime=n,this.isStepsSorted||(this.steps.sort(function(n,t){return t.moment-n.moment}),this.isStepsSorted=!0),this.isRunning=!0,this.startTime=(new Date).getTime()-this.elapsedTime,r=this.animations.length;r--;)this.animations[r].start(this.totalTime);t=this;i=this.animations.length-1;this.poll=setInterval(u,16)},stop:function(){if(this.isRunning){this.isRunning=!1;this.poll&&clearInterval(this.poll);for(var n=this.animations.length;n--;)this.animations[n].stop()}},setData:function(n,t){this.data[n]=t},getData:function(n){return this.data[n]},reset:function(){this.stop();this.elapsedTime=0;this.currentStep=this.steps.length-1}};animationqueue.AnimationStep=function(n,t,i){this.$element=n;this.cssParams=t;this.moment=Math.min(1,Math.max(0,i))};animationqueue.AnimationStep.prototype={getTime:function(n){return this.moment*n},doIt:function(){this.$element.css(this.cssParams)}};animationqueue.Animation=function(t,i){this.$element=t;this.animateParams=n.isArray(i)?i:[i];this.isRunning=!1};animationqueue.Animation.prototype={start:function(n){var u,e,t;if(this.$element.stop(),n===0){for(t=0;t<this.animateParams.length;++t)this.$element.css(this.animateParams[t]);self.isRunning=!1}else{if(this.animateParams.length>1){for(var i=0,f=0,t=this.animateParams.length;t--!=0;)u=this.animateParams[t].animationDuration,!isNaN(u)&&u>=0?i+=u:(++f,delete this.animateParams[t].animationDuration);for(e=0,f&&i<1&&(e=(1-i)/f,i=1),t=this.animateParams.length;t--!=0;)this.animateParams[t].animationDuration=isNaN(this.animateParams[t].animationDuration)?e:this.animateParams[t].animationDuration/i}else this.animateParams[0].animationDuration=1;for(this.isRunning=!0,t=0;t<this.animateParams.length-1;++t)this.$element.animate(this.animateParams[t],n*this.animateParams[t].animationDuration);this.$element.animate(this.animateParams[t],n*this.animateParams[t].animationDuration,r(this,function(){this.isRunning=!1}))}},stop:function(){this.$element.stop();this.isRunning=!1}};n.jcoverflip={animationElement:function(n,t,i){return{element:n,animate:t,steps:i}},getItemFromElement:function(t){t=n(t);var i=t.hasClass("ui-jcoverflip--item")?t:t.parents(".ui-jcoverflip--item");return i.size()==0?null:{element:i,index:i.data("jcoverflip__index")}}};var f={_init:function(i){var u,f,o,s;for(this.options=n.extend(e,i||{}),this.animationQueue=new animationqueue.AnimationQueue,this.isInit=!1,this.goToPoll={id:null},this.goToQueue=[],u=this.items(),this.element.addClass("ui-jcoverflip"),u.addClass("ui-jcoverflip--item"),f=u.size();f--;)o=u.eq(f),o.data("jcoverflip__index",f),s=this.options.titles.create(o),s.css({display:"none"}).addClass("ui-jcoverflip--title").appendTo(this.element),o.data("jcoverflip__titleElement",s);this.element.click(r(this,this._clickItem));this.options.wrapItemsAround&&(this.options.wrapCenter=this.options.wrapCenter===t?this.options.current:this.options.wrapCenter);this._goTo(this.options.current,0,!0);this.options.controls.create(this.element,this.length())},_clickItem:function(t){if(this.options.disabled!=!0){var i=n.jcoverflip.getItemFromElement(t.target);return i!==null&&i.index!=this.current()?(this.current(i.index,t),t.preventDefault(),!1):!0}},_nextAndPrevParameters:function(t,r,u,f){return f=typeof t=="object"?t:typeof r=="object"?r:typeof u=="object"?u:typeof f=="object"?f:{},u=n.isFunction(t)?t:n.isFunction(r)?r:n.isFunction(u)?u:i,r=typeof t=="boolean"?t:typeof r=="boolean"?r:!0,t=isNaN(parseInt(t))?1:parseInt(t),{by:t,wrapAround:r,callback:u,originalEvent:f}},next:function(n,t,i,r){if(this.options.disabled!=!0){var u=this._nextAndPrevParameters(n,t,i,r);return this._nextAux(u.by,u.wrapAround,u.callback,u.originalEvent,"next")}},_nextAux:function(i,r,u,f,e){var c;i=i===t&&isNaN(i)?1:parseInt(i);r=r!==!1;var o=this.current(),s=o,h=this.length();return r?(o=(o+i)%h,o=o<0?o+h:o):o=Math.min(h-1,Math.max(0,o+i)),o!=this.current()&&this.current(o,f),e&&s!=o&&(c=n.Event(f),c.type=this.widgetEventPrefix+e,u.call(this.element,c,{from:s,to:o}),this._trigger(e,f,{from:s,to:o})),o},previous:function(n,t,i,r){if(this.options.disabled!=!0){var u=this._nextAndPrevParameters(n,t,i,r);return this._nextAux(-1*u.by,u.wrapAround,u.callback,u.originalEvent,"previous")}},first:function(t,r){var u,f,e;this.options.disabled!=!0&&(r=typeof t=="object"?t:typeof r=="object"?r:{},t=n.isFunction(t)?t:i,u=this.current(),f=this.current(0,r),u!=f&&(e=n.Event(r),e.type=this.widgetEventPrefix+"first",t.call(this.element,e,{from:u,to:f}),this._trigger("first",r,{from:u,to:f})))},last:function(t,r){var u,f,e;this.options.disabled!=!0&&(r=typeof t=="object"?t:typeof r=="object"?r:{},t=n.isFunction(t)?t:i,u=this.current(),f=this.current(this.length()-1,r),u!=f&&(e=n.Event(r),e.type=this.widgetEventPrefix+"last",t.call(this.element,e,{from:u,to:f}),this._trigger("last",r,{from:u,to:f})))},current:function(n,i){return n===t||isNaN(n)||this.options.disabled||n==this.options.current||this._goTo(n,t,!1,i),this.options.current},destroy:function(){if(this.options.disabled!=!0){this._trigger("destroy",{});this.element.removeClass("ui-jcoverflip");for(var n=this.items(),t,i=n.length;i--;)t=n.eq(i).data("jcoverflip__titleElement"),this.options.titles.destroy(t);n.removeClass("ui-jcoverflip--item").find("*").add(n.get()).each(function(){this.removeAttribute("style")});this.options.controls.destroy(this.element)}},enable:function(){this.options.disabled=!1;this._trigger("enable",{})},disable:function(){this.options.disabled=!0;this._trigger("disable",{})},option:function(t,i){return typeof i=="undefined"?n.widget.prototype.option.apply(this,arguments):t=="current"?this.current(i):t in{items:"",titles:"",controls:""}?this.options.items:(t in{beforeCss:"",afterCss:"",currentCss:""}&&(this.options[t]=i,this._goTo(this.current(),0,!0)),t=="time"&&isNaN(parseInt(i))&&parseInt(i)<0)?this.options.time:n.widget.prototype.option.apply(this,arguments)},_goTo:function(n,u,f,e){var c,s,st,ht,p,tt,y,h,d,o,w,b,ot,g,v,nt;if(this.options.disabled!=!0&&(f=!!f,e=e==t?{}:e,u=u===t?this.options.time:parseInt(u),c=this.options.current,s=Math.floor(Math.max(0,Math.min(n,this.length()-1))),this.options.current=s,this.options.prestart===t||(st=this._trigger("prestart",e,{to:s,from:c}),!st.redrawNeeded))){for(ht=function(n,t,i){for(var u,f,r=0;r<Math.floor(i/2)+1;++r){if(u=n-r<0?i+n-r:n-r,f=(n+r)%i,f===t)return{goingRight:!0,steps:r-1};if(u===t)return{goingRight:!1,steps:r-1}}return null},this.animationQueue.stop(),p=this.animationQueue.get(),tt=p.length;tt--;){var vt=p[tt].getData("to"),it=p[tt].getData("goingToTheRight"),yt=vt>s;(yt!=it||this.options.loop)&&this.animationQueue.remove(p[tt])}p=this.animationQueue.get();var ut=ht(c,s,this.length()),ft=this.options.loop?ut.steps:p.length>0?p.pop().getData("to"):c,it=this.options.loop?ut.goingRight:ft<s;ft+=it?1:-1;f&&(ft=s);var et=this.options.loop?this.getLoopingOffset(c):this.getOffset(c),rt=et,l=this.options.loop?ut.goingRight:et[s]>0,k=Math.abs(et[s]),a=this.items(),ct=this.options.loop?c:l?s-k:s+k,lt=this.options.wrapItemsAround?-1*this.options.wrapCenter:1-a.length,at=this.options.wrapItemsAround?a.length-1-this.options.wrapCenter:a.length-1;for(f&&k==0&&(k=1,ct+=l?-1:1),v=1;v<=k;++v){for(y=ct+(l?v:-1*v),this.options.loop&&(y=l?y%a.length:y<0?a.length+y:y),h=this.options.loop?this.getLoopingOffset(y):this.getOffset(y),d=new animationqueue.AnimationSet,this.animationQueue.queue(d),d.setData("goingToTheRight",l),d.setData("to",y),o=a.length;o--!=0;)for(w=a.eq(o),h[o]==0?b=this.options.currentCss(w,this.element,v==k):rt[o]==lt&&h[o]==at?b=this.options.startToEndCss?this.options.startToEndCss(w,this.element,h[o]-1,-1*rt[o]-1):this.options.afterCss(w,this.element,h[o]-1,l):rt[o]==at&&h[o]==lt?b=this.options.endToStartCss?this.options.endToStartCss(w,this.element,-1*h[o]-1,rt[o]-1):this.options.beforeCss(w,this.element,-1*h[o]-1,l):h[o]>0?b=this.options.afterCss(w,this.element,h[o]-1,l):h[o]<0&&(b=this.options.beforeCss(w,this.element,-1*h[o]-1,l)),ot=b.length;ot--;){g=b[ot];d.add(new animationqueue.Animation(g.element,g.animate));for(v in g.steps)d.add(new animationqueue.AnimationStep(g.element,g.steps[v],parseFloat(v)))}rt=h}nt=a.eq(s).data("jcoverflip__titleElement");nt&&this.options.titleAnimateIn(nt,u,it);s!=c&&(nt=a.eq(c).data("jcoverflip__titleElement"),nt&&this.options.titleAnimateOut(nt,u,it));f?this.animationQueue.start(u,i):(this._trigger("start",e,{to:s,from:c}),this.animationQueue.start(u,r(this,function(n){this._trigger("stop",e,{to:s,from:c,time:n,goingRight:it})})),this._trigger("change",e,{to:s,from:c}))}},items:function(n){return this.itemsCache!==t&&!n||(this.itemsCache=this.options.items?this.element.find(this.options.items):this.element.children()),this.itemsCache},length:function(){var n=this.items();return n.length},getOffset:function(n){var u={},i=this.length(),t,r;if(this.options.wrapItemsAround){var f=-1*this.options.wrapCenter,e=(n-this.options.wrapCenter+i)%i,o=i+f;for(t=e,r=f;r<o;++r,t=(t+1)%i)u[t]=r}else for(t=0;t<i;++t)u[t]=t-n;return u},getLoopingOffset:function(n){for(var u,f,i={},r=this.length(),t=0;t<Math.floor(r/2)+1;++t)u=n-t<0?r+n-t:n-t,f=(n+t)%r,i[u]=-t,i[f]=t;return i},_trigger:function(t,i,r){var e=this.options[t],o=t=="jcoverflip"?t:"jcoverflip"+t,u,f;if(i=n.Event(i),i.type=o,i.originalEvent)for(u=n.event.props.length;u;)f=n.event.props[--u],i[f]=i.originalEvent[f];return this.element.trigger(i,r),!(n.isFunction(e)&&e.call(this.element[0],i,r)===!1||i.isDefaultPrevented())}},e={items:"",startToEndCss:function(t,i,r){return[n.jcoverflip.animationElement(t,{left:i.width()/2+110+110*r+"px",bottom:"20px"},{}),n.jcoverflip.animationElement(t.find("img"),[{opacity:.2,width:"50px"},{opacity:.5,width:"100px"}],{})]},endToStartCss:function(t,i,r){return[n.jcoverflip.animationElement(t,{left:i.width()/2-210-110*r+"px",bottom:"20px"},{}),n.jcoverflip.animationElement(t.find("img"),[{opacity:.2,width:"50px"},{opacity:.5,width:"100px"}],{})]},beforeCss:function(t,i,r){return[n.jcoverflip.animationElement(t,{left:i.width()/2-210-110*r+"px",bottom:"20px"},{}),n.jcoverflip.animationElement(t.find("img"),{opacity:.5,width:"100px"},{})]},afterCss:function(t,i,r){return[n.jcoverflip.animationElement(t,{left:i.width()/2+110+110*r+"px",bottom:"20px"},{}),n.jcoverflip.animationElement(t.find("img"),{opacity:.5,width:"100px"},{})]},currentCss:function(t,i,r){return r?[n.jcoverflip.animationElement(t,{left:i.width()/2-100+"px",bottom:0},{}),n.jcoverflip.animationElement(t.find("img"),{opacity:1,width:"200px"},{})]:[n.jcoverflip.animationElement(t,{left:i.width()/2-50+"px",bottom:"20px"},{}),n.jcoverflip.animationElement(t.find("img"),{opacity:.5,width:"100px"},{})]},time:500,titles:{create:function(t){var u="",i=n([]),r=t.find(".title:first");return r.size()==1?(i=r.clone(!0),r.css("display","none"),i.data("jcoverflip__origin","cloned"),i.data("jcoverflip__source",r)):t.attr("title")?u=t.attr("title"):t.attr("alt")?u=t.attr("alt"):(r=t.find("[title], [alt]").eq(0),r.size()==1&&(u=r.attr("title")||r.attr("alt")||"")),i.size()?i.css({opacity:0,display:"block"}):(i=n('<span class="title">'+u+"<\/span>"),i.data("jcoverflip__origin","attribute")),i},destroy:function(n){n.data("jcoverflip__origin")=="cloned"&&n.data("jcoverflip__source").css("display","");n.remove()}},titleAnimateIn:function(n,t){n.css("display")=="none"&&n.css({opacity:0,display:"block"});n.stop
21().animate({opacity:1},t)},titleAnimateOut:function(t,i){t.stop().animate({opacity:0},i,function(){n(this).css("display","none")})},controls:{create:i,destroy:i},current:0,loop:!1};u(jQuery,"jcoverflip",f,["length","current"])})(jQuery); 22(function(n){"use strict";function i(){}function r(n,t){if(u)return t.indexOf(n);for(var i=t.length;i--;)if(t[i]===n)return i;return-1}var t=i.prototype,u=Array.prototype.indexOf?!0:!1;t._getEvents=function(){return this._events||(this._events={})};t.getListeners=function(n){var t=this._getEvents(),r,i;if(typeof n=="object"){r={};for(i in t)t.hasOwnProperty(i)&&n.test(i)&&(r[i]=t[i])}else r=t[n]||(t[n]=[]);return r};t.getListenersAsObject=function(n){var t=this.getListeners(n),i;return t instanceof Array&&(i={},i[n]=t),i||t};t.addListener=function(n,t){var i=this.getListenersAsObject(n);for(var u in i)i.hasOwnProperty(u)&&r(t,i[u])===-1&&i[u].push(t);return this};t.on=t.addListener;t.defineEvent=function(n){return this.getListeners(n),this};t.defineEvents=function(n){for(var t=0;t<n.length;t+=1)this.defineEvent(n[t]);return this};t.removeListener=function(n,t){var i=this.getListenersAsObject(n),u;for(var f in i)i.hasOwnProperty(f)&&(u=r(t,i[f]),u!==-1&&i[f].splice(u,1));return this};t.off=t.removeListener;t.addListeners=function(n,t){return this.manipulateListeners(!1,n,t)};t.removeListeners=function(n,t){return this.manipulateListeners(!0,n,t)};t.manipulateListeners=function(n,t,i){var r,u,f=n?this.removeListener:this.addListener,e=n?this.removeListeners:this.addListeners;if(typeof t!="object"||t instanceof RegExp)for(r=i.length;r--;)f.call(this,t,i[r]);else for(r in t)t.hasOwnProperty(r)&&(u=t[r])&&(typeof u=="function"?f.call(this,r,u):e.call(this,r,u));return this};t.removeEvent=function(n){var r=typeof n,t=this._getEvents(),i;if(r==="string")delete t[n];else if(r==="object")for(i in t)t.hasOwnProperty(i)&&n.test(i)&&delete t[i];else delete this._events;return this};t.emitEvent=function(n,t){var i=this.getListenersAsObject(n),u,r,f;for(r in i)if(i.hasOwnProperty(r))for(u=i[r].length;u--;)f=t?i[r][u].apply(null,t):i[r][u](),f===!0&&this.removeListener(n,i[r][u]);return this};t.trigger=t.emitEvent;t.emit=function(n){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(n,t)};typeof define=="function"&&define.amd?define(function(){return i}):n.EventEmitter=i})(this),function(n){"use strict";var t=document.documentElement,r=function(){},i,u;t.addEventListener?r=function(n,t,i){n.addEventListener(t,i,!1)}:t.attachEvent&&(r=function(t,i,r){t[i+r]=r.handleEvent?function(){var t=n.event;t.target=t.target||t.srcElement;r.handleEvent.call(r,t)}:function(){var i=n.event;i.target=i.target||i.srcElement;r.call(t,i)};t.attachEvent("on"+i,t[i+r])});i=function(){};t.removeEventListener?i=function(n,t,i){n.removeEventListener(t,i,!1)}:t.detachEvent&&(i=function(n,t,i){n.detachEvent("on"+t,n[t+i]);try{delete n[t+i]}catch(r){n[t+i]=undefined}});u={bind:r,unbind:i};typeof define=="function"&&define.amd?define(u):n.eventie=u}(this),function(n){"use strict";function r(n,t){for(var i in t)n[i]=t[i];return n}function o(n){return e.call(n)==="[object Array]"}function s(n){var t=[],i,r;if(o(n))t=n;else if(typeof n.length=="number")for(i=0,r=n.length;i<r;i++)t.push(n[i]);else t.push(n);return t}function u(n,u){function e(n,i,u){if(!(this instanceof e))return new e(n,i);if(typeof n=="string"&&(n=t(document).find(n).get()),this.elements=s(n),this.options=r({},this.options),typeof i=="function"?u=i:r(this.options,i),u)this.on("always",u);this.getImages();t&&(this.jqDeferred=new t.Deferred);var f=this;setTimeout(function(){f.check()})}function o(n){this.img=n}e.prototype=new n;e.prototype.options={};e.prototype.getImages=function(){var n,f,i,u,r,e,o;for(this.images=[],n=0,f=this.elements.length;n<f;n++)for(i=this.elements[n],i.nodeName==="IMG"&&this.addImage(i),u=t(i).find("img").get(),r=0,e=u.length;r<e;r++)o=u[r],this.addImage(o)};e.prototype.addImage=function(n){var t=new o(n);this.images.push(t)};e.prototype.check=function(){function o(n,r){return t.options.debug&&f&&i.log("confirm",n,r),t.progress(n),u++,u===e&&t.complete(),!0}var t=this,u=0,e=this.images.length,n,r;for(this.hasAnyBroken=!1,n=0;n<e;n++){r=this.images[n];r.on("confirm",o);r.check()}};e.prototype.progress=function(n){this.hasAnyBroken=this.hasAnyBroken||!n.isLoaded;
22this.emit("progress",this,n);this.jqDeferred&&this.jqDeferred.notify(this,n)};e.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done",n;this.isComplete=!0;this.emit(t,this);this.emit("always",this);this.jqDeferred&&(n=this.hasAnyBroken?"reject":"resolve",this.jqDeferred[n](this))};t&&(t.fn.imagesLoaded=function(n,i){var r=new e(this,n,i);return r.jqDeferred.promise(t(this))});var h={};return o.prototype=new n,o.prototype.check=function(){var t=h[this.img.src],n;if(t){this.useCached(t);return}if(h[this.img.src]=this,this.img.complete&&this.img.naturalWidth!==undefined){this.confirm(this.img.naturalWidth!==0,"naturalWidth");return}n=this.proxyImage=new Image;u.bind(n,"load",this);u.bind(n,"error",this);n.src=this.img.src},o.prototype.useCached=function(n){if(n.isConfirmed)this.confirm(n.isLoaded,"cached was confirmed");else{var t=this;n.on("confirm",function(n){return t.confirm(n.isLoaded,"cache emitted confirmed"),!0})}},o.prototype.confirm=function(n,t){this.isConfirmed=!0;this.isLoaded=n;this.emit("confirm",this,t)},o.prototype.handleEvent=function(n){var t="on"+n.type;this[t]&&this[t](n)},o.prototype.onload=function(){this.confirm(!0,"onload");this.unbindProxyEvents()},o.prototype.onerror=function(){this.confirm(!1,"onerror");this.unbindProxyEvents()},o.prototype.unbindProxyEvents=function(){u.unbind(this.proxyImage,"load",this);u.unbind(this.proxyImage,"error",this)},e}var t=n.jQuery,i=n.console,f=typeof i!="undefined",e=Object.prototype.toString;typeof define=="function"&&define.amd?define(["eventEmitter","eventie"],u):n.imagesLoaded=u(n.EventEmitter,n.eventie)}(window); 23var ListingGallery=((n,t)=>{var i=null;const e=t=>{const{mlsDiclaimer:i="",pinterestPinIt:r=!1,title:u=""}=t;if(i&&n(".lg-counter").append(`<div class="mls-disclaimer"><span>${mlsDisclaimer}</span></div>`),r){const t=` 24 <span id="socialmedia-pinterest"> 25 <a class="lg-pin-it-button" count-layout="horizontal" target="_blank"> 26 <img border="0" src="//assets.pinterest.com/images/PinExt.png" title="${Utils.translate("Pin It","Pin It")}" /> 27 </a> 28 </span>`;n(".lg-counter .lg-fullscreen-title").length||n(".lg-counter").append(`<div class="lg-fullscreen-title"><span>${u}</span>${t}</div>`);n(".lg-pin-it-button").on("click",()=>{const t=n("#current-image-container img"),i=t.attr("src")||"",r=t.prop("title")||"",u=document.location.href.replace("#listingphoto-gallery-large","");n(".lg-pin-it-button").attr("href",`http://pinterest.com/pin/create/button/?url=${u}&media=${i}&description=${r}`)})}},o=()=>{n(".lg-toolbar > button, .lg-toolbar > a").each((t,i)=>{$this=n(i);var r=$this.attr("aria-label");r&&$this.attr("title",r)})},s=()=>{n("#lg-share-pinterest").attr("data-pin-custom",!0)},r=t=>{var i,r;return t.preventDefault(),i=n(t.currentTarget).attr("href"),i&&(r=n("<input />").appendTo(n(document.body)),r.val(decodeURIComponent(i)).select(),document.execCommand("copy"),r.remove(),alert("Link copied to clipboard.")),!1},h=n=>{const t=n.twitterShareUrl??window.location.href;return`//twitter.com/intent/tweet?url=${encodeURIComponent(t)}`},c=n=>{const t=n.shareLinkUrl??window.location.href;return encodeURIComponent(t)},u=(u,f)=>{const e={...{licenseKey:t,exThumbImage:"data-src",appendSubHtmlTo:".lg-item",googlePlus:!1,twitter:!1,download:!1,extraProps:["shareLinkUrl"],additionalShareOptions:[{selector:".lg-share-x-twitter",dropdownHTML:`<li><a class="lg-share-x-twitter" target="_blank" rel="noopener"><span class="lg-icon"><i class="fa-brands fa-x-twitter"></i></span><span class="lg-dropdown-text">X</span></a></li>`,generateLink:h},{selector:".lg-share-link",dropdownHTML:`<li><a class="lg-share-link" target="_blank"><span class="lg-icon"><i class="fa fa-link"></i></span><span class="lg-dropdown-text">Copy Link</span></a></li>`,generateLink:c}]},...f};return u.addEventListener("lgInit",()=>{n(".lg-share").off("click",".lg-share-link",r).on("click",".lg-share-link",r)}),i=lightGallery(u,e)},l=()=>{i&&i.destroy()},f=(n,t)=>{const{propertyInfo:i={},...lgOptions}={...{plugins:[lgShare,lgThumbnail,lgFullscreen,lgAutoplay]},...t};return n.addEventListener("lgAfterOpen",()=>{e(i),o(),s()}),u(n,lgOptions)},a=(n,t)=>{const i={...{plugins:[lgShare,lgThumbnail,lgFullscreen,lgVideo],youtubePlayerParams:{rel:0}},...t};return u(n,i)},v=(t,i,r)=>{typeof t!="undefined"&&typeof i!="undefined"&&typeof r!="undefined"?Promise.resolve(n.ajax({type:"POST",url:getAppRoot()+"/include/ajax/api.aspx?op=GetListingImages",data:{listingId:i}}).done(function(i){if(i.Images.length>0){var r=[];if(n.each(i.Images,function(n,t){var i={src:t.FilePath,thumb:t.FilePath};r.push(i)}),r.length>0){const n=f(document.querySelector(t),{dynamic:!0,dynamicEl:r});n.openGallery()}}})):Promise.reject("Invalid parameters to initFullScreen")};return{initPhotoGallery:f,initVideoGallery:a,initFullScreen:v,destroyPhotoGallery:l}})(window.jQuery,rbw.license.lightGallery); 29function rollover(n,t){n.src=t.src}function toggleImg(n,t){n.src=t}function rollover2(n,t){eval('document.images["'+n+'"].src = '+t+".src")}function showMyMenu(n,t){var u=document.getElementById(n),i,r;u&&(i=document.getElementById(t),i&&(n=="divNav1"?(clearTimeout(timeoutID),!searchStyleSet&&document.all&&(searchStyleSet=!0)):n=="divNav3"&&(loginStyleSet||(loginStyleSet=!0,r=document.getElementById("divNav3Login"),orientation=="top"&&(r.style.top=0-i.offsetHeight-r.offsetHeight+"px")))),orientation!="none"&&(n=="divNav3"?document.getElementById("divNav3Login").style.visibility="visible":u.style.visibility="visible"))}function hideMyMenu(n){var t=document.getElementById(n);t&&(n=="divNav1"?timeoutID=setTimeout("document.getElementById('"+n+"').style.visibility = 'hidden'",800):t.style.visibility="hidden",n=="divNav3"&&(document.getElementById("divNav3Login").style.visibility="hidden"))}function setPosition(n,t){var f=document.getElementById(n),e,r,i,u;if(f&&(e=document.getElementById(t),e))if(document.all){if(r=!1,navItems.length==0)navItems[0]=t,navNames[0]=n;else{for(i=0;i<navItems.length;i++)if(navItems[i]==t){r=!0;break}r==!1&&(navNames[i]=n,navItems[i]=t)}for(clearTimeout(timeoutID),i=0;i<navNames.length;i++)n==navNames[i]?(f.style.visibility="visible",u=document.getElementById(n.replace("divNav","subNav")),u&&(u.style.display="block")):document.getElementById(navNames[i]).style.visibility="hidden"}else{if(r=!1,navItems.length==0)navItems[0]=t,navNames[0]=n;else{for(i=0;i<navItems.length;i++)if(navItems[i]==t){r=!0;break}r==!1&&(navItems[i]=t,navNames[i]=n)}for(clearTimeout(timeoutID),i=0;i<navNames.length;i++)n==navNames[i]?(f.style.visibility="visible",u=document.getElementById(n.replace("divNav","subNav")),u&&(u.style.display="block")):document.getElementById(navNames[i]).style.visibility="hidden"}}function hideMenu(n){var t=document.getElementById(n);t&&(timeoutID=setTimeout("document.getElementById('"+n+"').style.visibility = 'hidden'",400))}var timeoutID=0,searchStyleSet=!1,loginStyleSet=!1,navItems=[],navNames=[]; 30var ListingUrlNavigator=new function(){var n,t,i;if(typeof sessionStorage!="undefined"&&rbw.storage.isSessionStorageEnabled()&&(t=sessionStorage.getItem("rbw.storage.listingUrls"),t&&t.length))try{n=JSON.parse(t)}catch(r){n={}}rbw.storage.isSessionStorageEnabled()||typeof jQuery=="undefined"||jQuery(document).trigger("sessionStorageDisabled");typeof n=="undefined"&&(n={});i=this;this.clearUrls=function(){i.startAddingUrls();i.endAddingUrls()};this.startAddingUrls=function(){n={}};this.addUrl=function(t,i,r){n[t]={prev:i,next:r}};this.endAddingUrls=function(){rbw.storage.isSessionStorageEnabled()&&sessionStorage.setItem("rbw.storage.listingUrls",JSON.stringify(n))};this.getPrevUrl=function(t){var i="";return n.hasOwnProperty(t)&&(i=n[t].prev),i};this.getNextUrl=function(t){var i="";return n.hasOwnProperty(t)&&(i=n[t].next),i}}; 31function MapSearch(n){function e(){return rbw.ui.ListingSearchVersion>=3}function gr(){return rbw.ui.ListingSearchVersion==4}function gi(n){return y?!n&&p?!1:(p=!0,!0):!1}function tu(n){y&&p&&n===c&&(p=!1)}function kt(n){y&&n.requestId===c&&(p=!1,(ut===0||n.page<=0)&&(ut=0,$(window).scroll()))}function iu(n){var f=document.getElementById("divNeighborhood"),i=document.getElementById("Neighborhood"),r;f&&i&&(i.length=0,r=$("#selNeighborhood").val(),$("#selNeighborhood").val(""),n.Zoom>=10&&n.Style!="o"?($(i).hide(),$("#NeighborhoodLoading").html("<img src='"+imageBase+"spinner.gif' height='12'/>").show(),$("#divNeighborhoodInfo").html(t.retrieveNbrhd).show(),$.ajax({mode:"abort",port:"neighborhoods",type:"GET",url:Utils.AppPath+"/Include/AJAX/MapSearch/GetLocations.aspx",data:{type:"neighborhood",q:"*",nelat:n.NELat,nelon:n.NELon,swlat:n.SWLat,swlon:n.SWLon,limit:5e3},dataType:"json",success:function(n){var f,e,h,a,o,c,v,l,s;try{if(n.length===0){$("#divNeighborhoodInfo").html(t.noBbrhdFound);$("#icNeighborhoodInfo").attr("title",t.noBbrhdFound);$(i).blur();return}if(f=$(":input[name='Criteria/City']",$(u.criteria)).val().toLowerCase(),f.indexOf(",")>0&&(f=f.substring(0,f.indexOf(","))),f.length===0)e=n;else for(e=[],h=0,a=n.length;h<a;h++)o=n[h],o.City&&o.City.length>0?o.City.toLowerCase()==f&&e.push(o):e.push(o);if(e.length>0){for($("#icNeighborhoodInfo").attr("title",t.icNeighborhoodInfo),$(i).append("<option value=''>- "+t.selectNbrhd+" -<\/option>"),c=0,v=e.length;c<v;c++)l=e[c],s=document.createElement("option"),s.text=l.Name,s.value=l.BoundaryID,l.BoundaryID==r&&(s.selected="selected"),addOption(i,s);$("#divNeighborhoodInfo").hide();$(i).show()}else $("#divNeighborhoodInfo").html(t.noBbrhdFound),$("#icNeighborhoodInfo").attr("title",t.noBbrhdFound);$(i).blur()}
31catch(y){Utils.Logger.warn(t.errorLoadingNbrhd+": "+y.message)}finally{$("#NeighborhoodLoading").hide()}}})):($(i).hide(),$("#divNeighborhoodInfo").html(t.zoomInToViewNbrhd).show(),$("#icNeighborhoodInfo").attr("title",t.zoomInToViewNbrhd).show()))}function ct(n){var i,t;return e()?i=n:(t=$("#SearchTab").val(),i=t=="basicSearch"||t=="advancedSearch"?"#basicSearch "+n+",#advancedSearch "+n:"#"+t+" "+n),i}function ru(n){var t=$("#SearchTab").val(),i;return t=="advancedSearch"&&(t="basicSearch"),t="#"+t,i=$(t+" input[name='"+n+"']"),i.length==0&&($(t).append("<input type='hidden' name='"+n+"' value='' />"),i=$(t+" input[name='"+n+"']")),i}function uu(n){for(var u,e,i=searchLocation.getFlattenedLocations("name"),r=searchLocation.getFlattenedLocations("type"),t=0;t<r.length;t++){u=r[t];switch(n){case"drivetime":f.removeLocation(i[t]);break;default:u=="drivetime"&&(e=i[t],f.removeLocation(e))}}}function nr(n,t){var i=t.toLowerCase();(i==="points"||i==="radius")&&r.clearPolygon(n,!1);(i==="city"||i==="county"||i==="zip code"||i==="neighborhood"||i==="township"||i==="borough"||i==="boundary"||i.indexOf("school")!==-1)&&r.clearPolygon(n,!1);i==="drivetime"&&(r.deleteAllPins("target"),r.allowShapeEdit(!0),r.clearPolygon(n,!1))}function fu(n){var r=!0,i,t;if(n.name==="Criteria/Location")f.removeLocation(n.val);else for(i=n.name.split("|"),t=0;t<i.length;t++)$(ct("*[name='"+i[t]+"']"),$(u.criteria)).each(function(){this.type==="checkbox"?this.value===n.val&&this.checked&&($(this).click(),r=!1):this.nodeName.toLowerCase()==="select"&&(this.name==="HardCodedCriterion"||this.name==="ExtendedCriterion")?$(this).val()===n.val&&$(this).val(""):this.type!=="radio"&&this.type!=="hidden"&&$(this).val("")}
31);r&&s(!1)}function tr(t,r){var e={},y,c,d,nt,tt;$(".customer-listings-view").length&&(e.useCookieFormDom="1",a=!0);$("#saved-search-update-results").length&&(a=!0);for(var b=searchLocation.getLocations(),k=[],p=[],w,s=0;s<b.length;s++){for(y=[],w=0;w<b[s].length;w++)c=b[s][w],c.type.toLowerCase()==="points"?(d=c.value.split(","),d.length>=8?y.push(c):p.push(c)):y.push(c);y.length>0&&k.push(y)}if(p.length>0)for(s=0;s<p.length;s++)f.removeLocation(p[s].name);return ru("Criteria/LocationJson").val($.toJSON(k)),$(ct(":input"),$(u.criteriaContainers)).each(function(){var t,i,r;if(!this.name||this.value.length===0||(this.type=="radio"||this.type=="checkbox")&&!this.checked||this.disabled||this.name=="PolygonType"||(t=this.value,this.name=="Criteria/City"&&t!=""&&t.indexOf(",")>-1&&(i=t.split(","),t=i[0],e["Criteria/StateOrProvinceCode"]?e["Criteria/StateOrProvinceCode"].push(i[1]):e["Criteria/StateOrProvinceCode"]=[i[1]]),this.name=="Criteria/Status"&&(t=="1"?t=n.statuses.active:t=="2"?t=n.statuses.sold:t=="5"&&(t=n.statuses.pending)),(this.name=="Criteria/OpenHouseStartDtm"||this.name=="Criteria/OpenHouseStopDtm")&&this.standarddate&&(t=this.standarddate),r=this.name,e[this.name]&&$(this).attr("sendOne")))return!0;$(this).attr("multiple")&&this.options!=undefined?$.each(this.options,function(){$(this).attr("selected")&&(e[r]?e[r].push($(this).val()):e[r]=[$(this).val()])}):e[this.name]?e[this.name].push(t):e[this.name]=this.name=="Criteria/SquareFootage"&&vi==!0?null:this.name=="Criteria/SquareMetre"&&yi==!0?null:this.name=="Criteria/MaxSquareFootage"&&pi==!0?null:this.name=="Criteria/MaxSquareMetre"&&wi==!0?null:this.name=="Criteria/SquareFootage"||this.name=="Criteria/MaxSquareFootage"?[Utils.Format.parseToEnUSFormat(t)]:[t]}),e["Criteria/Status"]||(e["Criteria/Status"]=$(ct("input[name='Criteria/Status']")).length>0?-1:1),t&&(e["Criteria/SearchMapNELat"]=t.NELat,e["Criteria/SearchMapNELong"]=t.NELon,e["Criteria/SearchMapSWLat"]=t.SWLat,e["Criteria/SearchMapSWLong"]=t.SWLon,e["Criteria/Zoom"]=t.Zoom,e["Criteria/SearchMapStyle"]=t.Style,e["Criteria/MapHeight"]=t.MapH,e["Criteria/MapWidth"]=t.MapW),nt=typeof n.defaultBoundingBox!="undefined"&&n.defaultBoundingBox!==null&&JSON.stringify(n.startingBoundingBox)===JSON.stringify(n.defaultBoundingBox),tt=typeof e["Criteria/Location"]!="undefined"&&e["Criteria/Location"].length&&e["Criteria/Location"].every(function(n){return n.length>4})||typeof e["Criteria/LocationJson"]!="undefined"&&e["Criteria/LocationJson"].length&&e["Criteria/LocationJson"].every(function(n){return n.length>4}),(e.AutoAdjustMap!="on"||r||a)&&(!wt||!nt||e["Criteria/PolyPoints"]!=undefined||!tt||h.contains("ListingSearch")||h.contains("ListingSearchID"))?e.IgnoreMap=a&&r:(e.IgnoreMap=!0,a=!0),wt=!1,(!l||l<1)&&(l=$("#mapsearch-sort-list").val()),e.ListingSortID=l,e.view=o,e.first=i.page*i.resultsPerPage,e["Criteria/SearchType"]="map",e.SearchTab=$("#SearchTab").val(),e.CLSID=it,e.ResultsPerPage=i.resultsPerPage,h.contains("LayoutID")&&(e.LayoutID=h.get("LayoutID"),e.LayoutVersion=h.get("LayoutVersion")),o!="map"&&($(u.tabCssSelectorOn,$("#mapsearch-viewtabs")).removeClass(u.tabCssClassOn).addClass(u.tabCssClassOff),$(u.tabSelectorPrefix+o).removeClass(u.tabCssClassOff).addClass(u.tabCssClassOn),(g()||v())&&($("#mapsearch-mainmap-toolbar").css({visibility:"hidden",overflow:"hidden",height:"1px"}),$("#mapsearch-results-header").css("visibility","hidden"),$("#mapsearch-results-all").offset({top:$("#mapsearch-mainmap-toolbar").offset().top,left:$("#mapsearch-results-all").offset().left}))),$(document).trigger("getFormData",[e]),e}function ir(n){var r=-1,u,f;if($(".no-results-found").addClass("hidden"),typeof n!="undefined"&&n!==null&&(r=n.count,i.totalCount=r),e())r===0&&($(".no-results-found").removeClass("hidden"),$("#mapsearch-results-seemore,#mapsearch-results-displayingall-msg").hide()),isNaN(r)||r===-1?(r=0,$("#search-numresults-text").hide()):(r=r.toLocaleString("en"),$("#search-numresults-text").show(),$(".search-numresults-number").text(r)),Search.setSeeNextCount(0),function(){var n=$("[data-id='criteria-results-type']"),t=$("[data-original-index='0']",n.next(".dropdown-menu")),i=$(".text",t),u=$.trim(i.text()).replace(/\(.*\)/,"("+r+")");i.text(u);t.hasClass("selected")&&$("> span:first-child",n).text(u);$(".js-count-existing-homes").text(r)}();else{isNaN(r)||r===-1?u=t.errorRetrievingRslts:r===-2?u="":(f=String(r).toLocaleStr
31ing(),u=t.propertiesFound.replace("{[0]}",f),v()&&eu(u));rr(u);try{$("#mapsearch-count").animate({backgroundColor:"transparent"},1e3)}catch(s){$("#mapsearch-count").css({backgroundColor:"transparent"})}}}function rr(n){$(".mapsearch-count-total").html(n)}function eu(n){$(".mapsearch-count-displayed").html(n);$(".mapsearch-count-displayed").show()}function ur(){var n=$("#mapsearch-results-body");$("div[mapconfig]",n).each(function(){var n=$(this).data("map");n&&n.dispose()});$("a.smallMapRoad",n).unbind("click");$("a.smallMapAerial",n).unbind("click");$("a.smallMapHybrid",n).unbind("click");$("div[lid]",n).unbind("mouseenter").unbind("mouseleave")}function fr(n,i,r){var o=[],u=i*Math.floor(n/i),f,e;for(u+i>r&&(u-=u+i-r),u<0&&(u=0),f=u;f<u+i&&f<r;f++){if(e=f+1,f==n){o.push("<span class='current-page'>{0}<\/span>".format(e));continue}o.push("<a href='JavaScript:Search.gotoPage("+e+"); "+d()+"' name='map-results-page-"+e+"' title='"+t.gotopage+" "+e+"'>"+e+"<\/a>")}return o}function d(){return e()?"":o!="map"?"window.scrollTo(0, 0);":""}function ou(r){var u;if(typeof r!="undefined"&&r!=null){if(n.pagerVersion===2){su(r);return}r.resultsPerPage=i.resultsPerPage;var e=r.count,f=Math.ceil(e/r.resultsPerPage),o=r.page*r.resultsPerPage;$(".mapsearch-results-paging-properties").html(t.propertiesFound.replace("{[0]}",String(i.totalCount).toLocaleString()));u=[];u.push(t.page+" "+fr(i.page,5,f).join(" | ")+" ");u.push(t.of+f+" ");i.page===0?u.push("<span>"+t.prev+"<\/span> | "):u.push("<a href='JavaScript:Search.prevPage(); "+d()+"' name='ms-results-prev' title='"+t.prevpage+"'>"+t.prev+"<\/a> | ");i.page==f-1?u.push("<span>"+t.next+"<\/span>"):u.push("<a href='JavaScript:Search.nextPage(); "+d()+"' name='ms-results-next' title='"+t.nextPage+"'>"+t.next+"<\/a>");i.totalPages=f;i.count=e;i.pageLinksHtml=u.join("");$("#mapsearch-mainmap").trigger("pageinfochange",[{pageInfo:i}]);$(".mapsearch-results-paging-pages").html(i.pageLinksHtml)}}function su(t){n&&n.searchUi&&$.inArray("sidelist",n.searchUi.split(","))>=0&&o=="map"?hu(t):cu(t)}function hu(n){var u,e,r,o,f,s;n.resultsPerPage=i.resultsPerPage;u=n.count;e=Math.ceil(u/n.resultsPerPage);$(".mapsearch-results-paging-properties").html(t.propertiesFound.replace("{[0]}",Utils.Format.addCommas(i.totalCount)));r=[];i.page!==0?r.push("<a href='JavaScript:Search.prevPage(); "+d()+"' name='ms-results-prev' title='"+t.prevpage+"'><i class='fa fa-angle-left'><\/i><\/a>"):r.push("<span><i class='fa fa-angle-left'><\/i><\/span>");o=n.page*n.resultsPerPage+1;f=(n.page+1)*n.resultsPerPage;f>u&&(f=u);r.push("<span>"+o+"-"+f+t.of+u+"<\/span>");i.page!=e-1?r.push("<a href='JavaScript:Search.nextPage(); "+d()+"' name='ms-results-next' title='"+t.nextPage+"'><i class='fa fa-angle-right'><\/i><\/a>"):r.push("<span><i class='fa fa-angle-right'><\/i><\/span>");i.totalPages=e;i.count=u;s=$.map(r,function(n,t){return'<li class="section'+t+'">'+n+"<\/li>"}).join("");i.pageLinksHtml='<div class="pagination"><ul class="pagination">'+s+"<\/ul><\/div>";$("#mapsearch-mainmap").trigger("pageinfochange",[{pageInfo:i}]);$(".mapsearch-results-paging-pages").html(i.pageLinksHtml)}function cu(n){var f,u,r,e,o;n.resultsPerPage=i.resultsPerPage;f=n.count;u=Math.ceil(f/n.resultsPerPage);$(".mapsearch-results-paging-properties").html(t.propertiesFound.replace("{[0]}",Utils.Format.addCommas(i.totalCount)));r=[];i.page!==0&&r.push("<a href='JavaScript:Search.prevPage(); "+d()+"' name='ms-results-prev' title='"+t.prevpage+"'><i class='fa fa-arrow-left'><\/i> "+t.previous+"<\/a>");e=fr(i.page,5,u);
31$.each(e,function(n,t){r.push(t)});i.page!=u-1&&r.push("<a href='JavaScript:Search.nextPage(); "+d()+"' name='ms-results-next' title='"+t.nextPage+"'>"+t.next+"<i class='fa fa-arrow-right'><\/i><\/a>");i.totalPages=u;i.count=f;o=$.map(r,function(n){return"<li>"+n+"<\/li>"}).join("");i.pageLinksHtml='<div class="pagination"><ul>'+o+"<\/ul><\/div>";$("#mapsearch-mainmap").trigger("pageinfochange",[{pageInfo:i}]);$(".mapsearch-results-paging-pages").html(i.pageLinksHtml)}function dt(t){if(!yt){yt=!0;var i=e()?"#mapsearch-advisory-box":"#mapsearch-advisory-box, #mapsearch-searching-message";$(i).each(function(){var i=$(this),e,u,f;if(i.length!==0){o=="map"?e=$("#mapsearch-mainmap").height():(e=$("#mapsearch-mainmap-results").height(),t=!1);var s=($("#mapsearch-mainmap-results").width()-i.width())/2-5,c=(e-i.height())/2+50,h=$("#mapsearch-mainmap-toolbar").height()-i.height()*2+11,l=i.position().top,r;r=o=="map"?h:0;at()&&(r=0);u=$(".map-menuitems",document.getElementById(n.container));u.length&&(f=u.position().top+u.outerHeight(),f>0&&r<f&&(r=f+5));i.animate({top:r,left:s},"slow","swing",function(){yt=!1})}})}}function gt(){er();var n=at?" "+t.changeSearchCriteriaOnTheTop:" "+t.changeSearchCriteriaOnTheLeft;i.totalCount===0?ni(t.propertiesFound.replace("{[0]}","<div id='box-count'>0<\/div>"),n):i.totalCount===-2?ni(t.tooManyProperties,t.adjustLocation):lt()}function lu(){gr?($(".search-numresults-number").html('<i class="srp-count-loading"><\/i>'),$("#mapsearch-searching-message").show().fadeTo("slow",.9)):($("#mapsearch-commingling-info").hide(),$(".mapsearch-count-displayed").hide(),rr(t.searching+"..."),au())}function eu(n){$(".mapsearch-count-displayed").html(n);$(".mapsearch-count-displayed").show()}function au(){(dt(),e())||$("#mapsearch-searching-message").show().fadeTo("slow",.9)}function er(){$("#mapsearch-searching-message").fadeTo("slow",0).hide()}function lt(){(er(),e())||$("#mapsearch-advisory-box").fadeTo("slow",0).hide()}function ni(n,t,i){dt();$("#mapsearch-advisory-box-total").html(n).removeClass("too-many-properties");$("#mapsearch-advisory-box-count").html(t).removeClass("too-many-properties");(n.indexOf("many properties")!==-1||i)&&($("#mapsearch-advisory-box-total").addClass("too-many-properties"),$("#mapsearch-advisory-box-count").addClass("too-many-properties"));$("#mapsearch-advisory-box").show().fadeTo("slow",.9);i&&setTimeout(gt,5e3)}function vu(){$("#mapsearch-results-body div[lid]").each(function(){$(this).unbind("mouseenter").mouseenter(function(){yu($(this).attr("lid"))})})}function yu(n){var t=setTimeout(function(){pu(n)},dr);$("#mapsearch-results-body div[lid='"+n+"']").mouseleave(function(){wu(n,t)})}function pu(n){r.showListingBubble("1_"+n)}function wu(n,t){clearTimeout(t);r.hideListingBubble();$("#mapsearch-results-body div[lid='"+n+"']").unbind("mouseleave")}function or(i){var u,r,s;i&&i.requestId===c&&(ur(),y?(i.page===0&&$("#mapsearch-results-body").empty(),u=$("<div><\/div>").append(i.listingsHtml),$("#mapsearch-results-body").append(u.html()).unblock(),u.remove()):$("#mapsearch-results-body").html(i.listingsHtml).unblock(),$("#mapsearch-container").removeClass("r-side-list"),$("#mapsearch-container").removeClass("r-bottom-list"),o=="map"?(at()?$("#mapsearch-container").addClass("r-side-list"):$("#mapsearch-container").addClass("r-bottom-list"),vu(),(g()||v())&&$("#mapsearch-results-header").show()):((g()||v())&&$("#mapsearch-results-header").hide(),$("#mapsearch-results-body div.lsrcExtendedInfoBoxHead h5").click(function(){var r=$(this).attr("lid"),i=$("#mapsearch-results-body .lsrEIB_"+r);i.is(":visible")?(i.hide("slow"),$(this).html("<span class='arrow arrow-left'><\/span>"+t.view+" "+t.remarksAndMap)):($(this).html("<span class='arrow arrow-down'><\/span>"+t.hide+" "+t.remarksAndMap),i.show("slow",function(){var t=$("div[mapconfig]",this),r;if(t.length>0&&!t.data("map")){var u=t.parent(),i=eval("("+t.attr("mapconfig")+")"),f=!0;typeof i.centerPin!="undefined"&&(f=i.centerPin);r=new BingMap({startingMidLat:i.lat,startingMidLong:i.lon,startingZoom:i.zoom||18,mapView:i.view||"o",centerPin:f,showBubble:!1,disableMouseWheel:!0,container:t.attr("id"),backend:n.backend});r.load();t.data("map",r);$("a.smallMapRoad",u).click(function(){r.setView("r")});$("a.smallMapAerial",u).click(function(){r.setView("a")});$("a.smallMapHybrid",u).click(function(){r.setView("h")})}}))})),ou(i),y||(r="scrollposition",$("#mapsearch-results-body a").click(function(){createCookie(r,$(window).scrollTop())}),s=readCookie(r),s!=null&&(setTimeout(function(){$(window).scrollTop(s);var n=$("#colorbox").css("display")==="block";$.colorbox&&n&&$.colorbox.position()},100),eraseCookie(r))),$("body").trigger("search-results-loaded"),ai||(ai=!0,ht=!0,e()&&(o==="gallery"?f.disableOnMapC
31hange("MapSearch._activeView"):f.enableOnMapChange("MapSearch._activeView"))))}function ti(n,i,r){tu(n);i!=="abort"&&(k=!1,i&&i.length>0&&Utils.Logger.warn(t.errorGettingRslts+i),r&&r.message&&r.message.length>0&&Utils.Logger.warn(t.errorGettingRslts+r.message),ir(null),lt(),$("#mapsearch-results-body").unblock())}function bu(n,t){var h,v,y,l,nt,i,s,u,b,d;if(n&&n.requestId===c){if($("body").trigger("search-results-event",[n.ListingResultSet]),k=!1,ir(n),h=a,a=!1,v=typeof n.pins!="undefined"&&n.pins.length>0,y=typeof n.clusters!="undefined"&&n.clusters.length>0,v||y){if(v){r.startAddingPins("Properties",!1);ListingUrlNavigator.startAddingUrls();var o=0,w="",g="";for(l=0,nt=n.pins.length;l<nt;l++)i=n.pins[l],i.lat&&!isNaN(i.lat)&&r.addPin("Properties","1_"+i.lid,i.lat,i.lon,i.ptid,"Listing",i.bub,i.price,i.isFav,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,i.isVisible),o>0&&ListingUrlNavigator.addUrl(o,w,Utils.AppPath+i.url),o=i.lid,w=g,g=i.url;o>0&&ListingUrlNavigator.addUrl(o,w,"");r.collocatePins("Properties");r.endAddingPins("Properties",h,t);ListingUrlNavigator.endAddingUrls()}if(y){for(r.startAddingPins("Properties",!1),s=0;
31s<n.clusters.length;s++)u=n.clusters[s],r.addPin("Properties","1_cluster"+s,u.lat,u.lon,BingMap.PinType.ListingActive,"Cluster",null,"0",!1,u.count,u.northLat,u.southLat,u.westLon,u.eastLon,u.avgPrice,u.minPrice,u.maxPrice,undefined,!0);r.endAddingPins("Properties",h,t)}or(n);lt();n.disclaimer?n.disclaimerPosition==="underresults"?($("#mapsearch-disclaimers").html(""),$("#mapsearch-results-disclaimers").html(n.disclaimer),$("#mapsearch-results-disclaimers img").attr("alt","MLS logo")):($("#mapsearch-results-disclaimers").html(""),$("#mapsearch-disclaimers").html(n.disclaimer),$("#mapsearch-disclaimers img").attr("alt","MLS logo")):($("#mapsearch-disclaimers").html(""),$("#mapsearch-results-disclaimers").html(""));$(".results-refresh-date-disclaimer").html(n.refreshDateDisclaimer||"");e()?$("#mapsearch-results-body").show():$("#mapsearch-results").show();$(".mapsearch-results-paging").show()}else r.deleteAllPins("Properties"),r.endAddingPins("Properties",h),n.count===0||n.count===-2?gt():lt(),$("#mapsearch-disclaimers").html(""),e()?$("#mapsearch-results-body").hide():$("#mapsearch-results").hide(),$(".mapsearch-results-paging").hide();b=!1;$(".IDXRules_DontDisplayFields").each(function(){var n=$(this).text();n.indexOf("DaysOnMarket")>=0&&(b=!0)});d=$("#mapsearch-sort-list option[value='5']");b==!0?$(d).hide():$(d).show();$("body").trigger("search-results-event-finish",[n]);!p&&st>1&&f.gotoPage(st);try{CustomerLogin.SearchSummary.TargetAreaSearch&&CustomerLogin.SearchSummary.TargetAreaSearch.isTargetArea&&Search.setOptions({showDrawingTools:!1})}catch(tt){}}}function at(){return n&&n.searchUi&&$.inArray("sidelist",n.searchUi.split(","))>=0}function s(t,u,f){var p,h,l,v,b,o,e,d;if(ft!==null&&(clearTimeout(ft),ft=null),$("#city-state-message").html(""),w&&r.isLoaded()){k=!0;setTimeout(function(){k=!1},15e3);a||(a=t||!1);rt?(p=typeof n.defaultStartingMap!="undefined"&&n.defaultStartingMap!==null&&JSON.stringify(n.startingBoundingBox)===JSON.stringify(n.defaultBoundingBox),p&&n.startingLocations&&n.startingLocations.length>0&&(a=!0)):i.clear();u=u||r.getMapState();h=$("#SearchTab").val();h!="addressSearch"&&h!="mapsearch-criteria-addresssearch"&&r.deleteAllPins("Address");try{$("#mapsearch-count").animate({backgroundColor:"#ffd73b"},1e3)}catch(g){$("#mapsearch-count").css({backgroundColor:"#ffd73b"})}if($("#mapsearch-results-body").block({message:null}),lu(),l="",window.location.search.indexOf("embed=1")>=0&&(l="&embed=1"),(window.location.search.indexOf("collab=1")>=0||window.location.search.indexOf("mozaic=1")>=0)&&(l+="&mozaic=1"),v="",typeof LanguagePlugin!="undefined"&&LanguagePlugin.overrideLocaleID&&(v="&OverrideLocaleID="+LanguagePlugin.overrideLocaleID),b=c,c=Date.now(),o=c,y&&!gi(!0)){c=b;return}e=tr(u,f);typeof e=="undefined"||e===null||Object.keys(e).length===0?(d=new Error("Form data is empty"),rbw.utils.reportError(d),ti(o)):$.ajax({mode:"abort",port:"mapsearch",type:"POST",url:Utils.AppPath+"/Include/AJAX/MapSearch/GetListingPins.aspx?searchoverride="+n.cookieGuid+"&ts="+o+"&"+window.location.search.substring(1)+v,data:e,traditional:!0,cache:!1,dataType:"json",success:function(n){n.requestId=o;bu(n,f);kt(n)},error:function(n,t,i){ti(o,t,i)},beforeSend:function(n){n.setRequestHeader("X-Form",JSON.stringify(e))}});rt==!1&&n.persistSearchResult==!0&&(a=!1);rt=!1;r.gotoPolyDeferredAfter();$(document).trigger("criteriaitemchange",[{}]);$(document).trigger("search-results-start",[{}]);return}ft=setTimeout(function(){s(t,u)},100)}function g(){return $("#mapsearch-container.v1").length}function v(){return $("#mapsearch-container.v2").length}function ii(){return e()?$("#search-criteria-form-v3").is(":visible"):v()?$("#mapsearch-left2").is(":visible"):$("#mapsearch-left").is(":visible")}function sr(t){var i=ii();i&&!n.isSavedListings&&$.ajax({mode:"abort",port:"mapstate",type:"POST",url:Utils.AppPath+"/Include/AJAX/MapSearch/SaveMapState.ashx?searchoverride="+n.cookieGuid,data:tr(t,!0),traditional:!0,cache:!1,dataType:"json"})}function ku(n){for(var i,r,t={minLat:0,maxLat:0,minLon:0,maxLon:0},f=n.split(","),u=0;u<f.length;u++)i=Number(f[u]),r=Number(f[++u]),u==1&&(t.maxLat=i,t.minLat=i,t.maxLon=r,t.minLon=r),i>t.maxLat&&(t.maxLat=i),i<t.minLat&&(t.minLat=i),r>t.maxLon&&(t.maxLon=r),r<t.minLon&&(t.minLon=r);return t}function du(i,u,e,o){var h,c=!1,s,l;if(typeof o!="undefined"?(n.restrictLargeSearches&&(c=o>150),h={Name:u,Type:"radius",Value:e+"~"+o}
31):(n.restrictLargeSearches&&(s=ku(e),l=Math.abs((s.maxLon-s.minLon)*Math.cos(s.maxLat)*69.172),c=l>150),h={Name:u,Type:"points",Value:e}),c){r.clearPolygon(u,!1);ni(t.boundaryTooLarge,t.keepUnder150Miles,!0);return}CustomerLogin&&CustomerLogin.SearchSummary&&CustomerLogin.SearchSummary.DisableAllCriteria&&CustomerLogin.SearchSummary.DisableAllCriteria();f.addLocation(h,!0,!0);r.onChangeView()}function hr(n,t){if(vt!==null&&clearTimeout(vt),rt||!(Object.keys(b).length>0)){if(w&&r.isLoaded()){if(!rt&&!pt&&!k&&t!=="SetMapView"&&o==="map"&&!a){pt=!0;r.fitMapToPins(undefined,!0);return}var i=r.getMapState();t==="SetMapView"?sr(i):(iu(i),pt=o==="map",s(!1,i,!0));return}vt=setTimeout(function(){hr(n,t)},100)}}function ri(){$("#mapsearch-results-header a[sort]").each(function(){var n=$(this),t=eval(n.attr("sort"));n.text(n.text().replace("▲","").replace("▼",""));l==t[0][0]?n.text(n.text()+"▲"):l==t[1][0]&&n.text(n.text()+"▼")})}function ui(){var n="";$(":input[name='Criteria/Status'][checked]",$(u.criteria)).each(function(){this.value=="1"?n+="Active,":this.value=="5"?n+="Pending,":this.value=="2"&&(n+="Sold,")});n.length>0&&(n=n.substring(0,n.length-1),$("#selectedStatus").html(n).attr("title",n))}function tt(t,r){var e,f,a,v;r===c&&(y||$("#mapsearch-results-body").block({message:null}),e=!1,$(ct(":input"),$(u.criteria)).each(function(){if(!this.name)return!0;this.name=="AgentHomePageSearchType"&&(this.value=="PriorSales"?e=!0:this.value=="AllMyListings"&&(e=!1))}),f={view:o,first:t||0,count:i.resultsPerPage,clsid:it,ListingSortID:l,priorSale:e},$(".customer-listings-view").length&&(f.useCookieFormDom="1"),h.contains("LayoutID")&&(f.LayoutID=h.get("LayoutID"),f.LayoutVersion=h.get("LayoutVersion")),a="",window.location.search.indexOf("embed=1")>=0&&(a="&embed=1"),(window.location.search.indexOf("collab=1")>=0||window.location.search.indexOf("mozaic=1")>=0)&&(a+="&mozaic=1"),v="",typeof LanguagePlugin!="undefined"&&LanguagePlugin.overrideLocaleID&&(v="&OverrideLocaleID="+LanguagePlugin.overrideLocaleID),!y||gi())&&r===c&&$.ajax({mode:"abort",port:"listingshtml",type:"POST",url:Utils.AppPath+"/Include/AJAX/MapSearch/GetListings.aspx?searchoverride="+n.cookieGuid+"&ts="+r+"&"+window.location.search.substring(1)+v,data:f,cache:!1,dataType:"json",error:function(n,t,i){ti(r,t,i)},success:function(n){r===c&&(n.requestId=r,n.listingsHtml&&n.listingsHtml.length>0?($(document).trigger("search-results-changed",[{}]),n.count=i.totalCount,p||(n.page=i.page),or(n),$("body").trigger("search-results-event",[n.ListingResultSet]),kt(n)):(kt(n),st=i.page+1,s()))}})}function fi(n){var t=o;o=n;o!=t&&(e()&&(o=="gallery"?f.disableOnMapChange("MapSearch._activeView"):f.enableOnMapChange("MapSearch._activeView")),$(u.tabSelectorPrefix+t).removeClass(u.tabCssClassOn).addClass(u.tabCssClassOff),$(u.tabSelectorPrefix+n).removeClass(u.tabCssClassOff).addClass(u.tabCssClassOn),cr(o),e()||tt(i.page*i.resultsPerPage,c),(g()||v())&&(t=="map"?($("#mapsearch-container").removeClass("r-side-list").removeClass("r-bottom-list"),$("#mapsearch-mainmap-toolbar").css({visibility:"hidden",overflow:"hidden",height:"1px"}),$("#mapsearch-results-header").css("visibility","hidden"),$("#mapsearch-results-all").offset({top:$("#mapsearch-mainmap-toolbar").offset().top,left:$("#mapsearch-results-all").offset().left})):o=="map"&&(at()?$("#mapsearch-container").addClass("r-side-list").removeClass("r-bottom-list"):$("#mapsearch-container").addClass("r-bottom-list").removeClass("r-side-list"),$("#mapsearch-mainmap-toolbar").css({visibility:"visible",overflow:"visible",height:"auto"}),$("#mapsearch-results-header").css("visibility","visible"),$("#mapsearch-results-all").offset({top:$("#mapsearch-mainmap-toolbar").offset().top+$("#mapsearch-mainmap-toolbar").height(),left:$("#mapsearch-results-all").offset().left}),r.gotoPolyDeferredAfterForce())),gt(),r.ready().then(function(){var n=r.getMapState();sr(n)}));$(document).trigger("criteriachange",[{activeTab:$("#SearchTab").val(),view:o}])}function cr(n){$.each(["map","list","gallery","detail"],function(n,t){$("#mapsearch-mainmap-results").removeClass("r-view-"+t)});$("#mapsearch-mainmap-results").addClass("r-view-"+n);e()&&n==="gallery"?$("#search-results-displaytype-mobile-map").removeClass("hidden"):$("#search-results-displaytype-mobile-gallery").removeClass("hidden");e()&&$(window).width()<=599&&n==="map"&&$("#mapsearch-mainmap-results").removeClass("r-view-"+n);$("#search-results-displaytype-mobile-"+n).addClass("hidden")}function gu(){var i=document.getElementById("mapsearch-sort-list");l=n.listingSortID;$(i).change(function(){l=$(this).val();ri();s()});$("#mapsearch-results-header a[sort]").each(function(){var t=$(this),n=eval(t.attr("sort")),r=$(i);$("option[value='"+n[0][0]+"']",r).length===0&&(i.options[i.options.length]=new Option(n[0][1],n[0][0]));$("option[value='"+n[1][0]+"']",r).length===0&&(i.options[i.options.length]=new Option(n[1][1],n[1][0]));t.css("cursor","pointer");t.click(function(){l=l==n[0][0]?n[1][0]:n[0][0];$(i).val(l);ri();$(document).trigger("resetcontrols");s()})});$(i).val(l);ri();
31$(document).trigger("addcontrols");$("#mapsearch-commingling-list").change(function(){it=$(this).val();s(!1)});$("#criteria-location-morelistings-list").change(function(){it=$(this).val();s(!1)});e()?$("#search-results-displaytype-map, #search-results-displaytype-gallery, #search-results-displaytype-mobile-map, #search-results-displaytype-mobile-gallery").click(function(){fi(this.id.split("-").pop());this.id.indexOf("-mobile")>0&&$(window).scrollTop(0)}):$("div",$("#mapsearch-viewtabs")).click(function(){var n=$(this).attr("id").replace("mapsearch-viewtab-","");fi(n)});$(".search-criteria-toggle").click(function(){ii()?($("#mapsearch-left").hide(),$("#mapsearch-right").attr("style","margin-left:0"),$(this).html(t.showCriteria+' <img src="/images/common/icons/arrow-right.png"/>'),$(this).attr("style","margin-left:0")):($("#mapsearch-left").show(),$("#mapsearch-right").removeAttr("style"),$(this).html('<img src="/images/common/icons/arrow-left.png"/> '+t.hideCriteria),$(this).removeAttr("style"))})}function ei(n,t){n||(n="");var i=$("#SearchTab").val(),u=ot&&ot!=""&&i!=ot;if(ot=i,n==""){s(u);return}t.toLowerCase()=="address"?$("#"+i+" :input[name='Criteria/FilterByAddress']").val()=="1"?s(!0):r.addAddressPin(n):t.toLowerCase()=="county"||t.toLowerCase()=="municipality"||t.toLowerCase()=="radius"?s(!0,null,!0):s(!0)}function nf(t){t.Offices.length>0&&$.ajax({type:"GET",url:"/include/ajax/api.aspx",data:"op=GetLayoutMarkup&layoutTypeID=125",dataType:"json",success:function(i){$.each(t.Offices,function(){this.GUID=n.cookieGuid});i=$.tmpl(i,t);$.fn.colorbox({html:i,width:"550px",maxHeight:"70%",scrolling:!0,open:!0})}})}function oi(){$("#city-state-message").length===0&&(v()?$("div:contains('Location')","#criteria-location").append("<span id='city-state-message' style='float:right'><\/span>"):$("<div id='city-state-message'><\/div>").insertBefore($("#criteria-location-input")));$("#city-state-message").html("<small><small>"+t.valIncludeCityState+"<\/small><\/small>")}function tf(n){n.name=="Criteria/SquareMetre"&&(vi=!0);n.name=="Criteria/SquareFootage"&&(yi=!0);n.name=="Criteria/MaxSquareMetre"&&(pi=!0);n.name=="Criteria/MaxSquareFootage"&&(wi=!0)}function rf(){wt=!0;var t=$(u.criteria),i=$(u.criteriaForm),o=$(u.searchSummary);ci=!(document.getElementById("SearchVendor")&&document.getElementById("SearchVendor").value.length>0);ci?$("#mapsearch-sort").show():$("#mapsearch-sort").hide();$("#customerLoginSpinner").hide();$(".toggleadvanced a").html(bt);$(".button-clear, [data-ms-button-clear], .btn-refiner-criteria-clear-all",i).click(f.clearCriteria).keypress(function(n){n.keyCode=="13"&&(n.preventDefault(),f.clearCriteria())});$(".button-clear",o).click(f.clearCriteria).keypress(function(n){n.keyCode=="13"&&(n.preventDefault(),f.clearCriteria())});$(".button-submit, [data-ms-button-submit]",i).click(function(){k||s(!1)}).keypress(function(n){n.keyCode=="13"&&(k||s(!1))});$("input[name='SearchTab']",t).remove();f.toggleCriteria();$(".toggleadvanced").click(function(){ff()});$("select[name='Criteria/ListingTypeID']",t).each(function(){f.toggleListingType(this,!0)});$("input[type='text'][name='Criteria/Location']",t).each(function(){$(this).attr("name","Criteria/LocationBox")});$("input.location,input[name='Criteria/City'],input[name='Criteria/ZipCodeAdvanced']").val("");w=n.submitEnabledOnLoad;$(":input[name]",t).each(function(){$(this).data("old-val",$(this).val()||"");$(this).change(function(){var i=$(this).data("old-val"),n=$(this).val();$(this).data("old-val",n);this.type=="checkbox"||this.type=="radio"?$(":input[name='"+this.name+"'][value='"+this.value+"']",t).attr("checked",this.checked):this.nodeName=="SELECT"?i&&i.length?$(":input[name='"+this.name+"']").has("option[value='"+i+"']").val(n):n&&n.length&&$(":input[name='"+this.name+"']").has("option[value='"+n+"']").val(n):$("input[name='"+this.name+"']",t).val(n)});this.name=="Criteria/ListingNumber"?($(this).unbind("change"),$(this).change(function(){ei(this.value,"ListingNumber")}),$(this).keypress(function(n){n.which==13&&(n.preventDefault(),$(this).change())})):this.type=="checkbox"?$(this).change(function(){f.onChangeSubmit(this)}):this.type=="checkbox"||$(this).is(".location")||$(this).change(function(){tf(this);
31f.onChangeSubmit(this)});$(this).focus(function(){this.select&&this.select()})});$("select.featuresdd:not([onchange])",t).change(function(){var n=$("#"+$(this).val(),t);n.prevAll().hide();n.nextAll().hide();n.show()});$("select#mapsearch-criteria-address-searchtype:not([onchange])",t).change(function(){r.setZoomLevel($(this).val()=="1"?20:15)});nt.bindLocationAutoComplete(t,f,"addLocationFromAutoSuggest",n.restrictLargeSearches?oi:null,n.autocompleteOptions);e()&&nt.bindLocationAutoComplete($("#search-criteria-form-filters-v3"),f,"addLocationFromAutoSuggest",n.restrictLargeSearches?oi:null,n.autocompleteOptions);t.find("#criteria-location").length===0&&nt.bindLocationAutoComplete($("#criteria-location"),f,"addLocationFromAutoSuggest",n.restrictLargeSearches?oi:null);wr($("[type='text'][name*='Price']",t));br($("[type='text'][name*='SquareFootage']",t));$("[type='text'][name*='Acreage']",t).each(function(){this.value=Utils.Format.addCommas(this.value);$(this).autocomplete("numeric",{maxChars:7,formatResult:function(n){return Utils.Format.addCommas(n)},formatItem:function(n){return Utils.Format.addCommas(n)},highlight:!1,selectFirst:!1}).result(function(){$(this).change()})});$("[type='text'][name='Criteria/City']",t).autocomplete(Utils.AppPath+"/Include/AJAX/MapSearch/GetLocations.aspx",{dataType:"json",extraParams:{type:"City"},minChars:0,max:50,width:"auto",cacheLength:50,parse:function(n){for(var t,i=[],r=0,u=n.length;r<u;r++)t=n[r],i[i.length]={data:t,value:t.Name,result:nt.formatLocationItem(t,!1)};return i},formatItem:function(n){return"<nobr>"+nt.formatLocationItem(n,!1)+"<\/nobr>"},delay:100}).result(function(n,t){var i,r,u;t||(i=$(this).val(),i&&i.length>0?(r=defaultState,u=i.lastIndexOf(","),u!=-1&&(r=i.substring(u+1),i=i.substring(0,u)),t={Name:i,Type:"City",State:r},$(this).val(i+", "+r)):t={Name:""});$(this).val("");f.addLocation(t)}).change(function(){$(this).search()});ui();$(".advanced :input").each(function(){return this.name?this.type=="hidden"?!0:this.value.length===0?!0:(this.type=="radio"||this.type=="checkbox")&&!this.checked?!0:this.disabled?!0:this.type=="radio"&&this.name.indexOf("Groups")===0?!0:this.name=="Criteria/Status"&&this.value.indexOf("2")==-1&&this.value.indexOf("5")==-1?!0:(si(),!1):!0});e()&&t.append($("#search-criteria-form-filters-v3"));$(document).trigger("criteriachange",[{activeTab:$("#SearchTab").val()}]);g()&&($("#mapsearch-location").toggle("fast"),$("#mapsearch-criteria").toggle("fast"));typeof ToggleOnMarketSearchCriteria=="function"&&ToggleOnMarketSearchCriteria();$(document).trigger("maploaded")}function uf(){li||(r.dispose(),r=null,n=null,ur(),li=!0)}function ff(){var n=$(".advanced",$(u.criteriaForm));n.is(":visible")?ef():si()}function si(){var n=$(".advanced",$(u.criteriaForm));n.show();$("span.arrow",$(u.criteriaForm)).removeClass("arrow-left").addClass("arrow-down");$("div.wide a",$(u.criteriaForm)).html(ki);$(".toggleadvanced").addClass("expanded")}function ef(){var n=$(".advanced",$(u.criteriaForm));n.hide();$("span.arrow",$(u.criteriaForm)).removeClass("arrow-down").addClass("arrow-left");$("div.wide a",$(u.criteriaForm)).html(bt);$(".toggleadvanced").removeClass("expanded")}function sf(n){(n.type!=="keyup"||hi(n))&&f.closeSingleListingOverlay()}function lr(n){var i=document.getElementById("single-listing-overlay"),t=$("body"),r=hi(n);if(r&&(t.hasClass("lg-on")||t.data("escapeGallery")==="true")){t.data("escapeGallery","false");return}!r&&(i&&i.contains(n.target)||$(n.target).parents(".lg-slide").length||$(n.target).parents(".modal-dialog").length||$(n.target).parents(".mobile-fixed-menu").length)||vr(n)||n.originalEvent&&n.originalEvent.defaultPrevented||sf(n)}function hf(n){var t=n.target.id==="cboxOverlay"||document.getElementById("colorbox").contains(n.target);!t&&(n.type!=="keyup"||hi(n))&&f.closePublicRecordsOverlay()}function ar(n){var t=document.getElementById("public-records-overlay"),i=document.getElementById("estimated-value-info-modal");t&&t.contains(n.target)||typeof n.target.className!="undefined"&&n.target.className.indexOf("labelCanvas")>-1||i&&i.contains(n.target)||vr(n)||hf(n)}function vr(n){return CustomerLogin&&!CustomerLogin.isLoggedIn()&&n&&n.type==="click"&&(n.target.id==="btn-sign-in-or-register"||n.target.id==="btn-save-this-search")}
31function hi(n){return n&&n.type==="keyup"&&n.keyCode===27}function yr(){return searchLocation.getFlattenedLocations()}function cf(){var n=[],t=0,i=yr();return $.each(i,function(i,r){(r.type=="City"||r.type=="Zip Code")&&(n[t]=r,t++)}),n}function lf(n){var r,i,u,e;n&&n!="0,0"?(r=$("#NearbyAreasRange").val(),i={Name:$("#NearbyAreasName").val(),Type:$("#NearbyAreasType").val(),Value:$("#NearbyAreasValue").val()},i.Type="radius",u=i.Name.indexOf(" ("),u>0&&(i.Name=i.Name.substring(0,u)),i.Name+=rbw.context.preferredMeasurementSystem.indexOf("US")!=-1?r==.5?" (1/2 "+t.mile+")":r==1?" (1 "+t.mile+")":" ("+r+" "+t.miles+")":r==.3?" (1/2 "+t.km+")":" ("+Math.round(r*1.60934)+" "+t.km+")",e=n+"~"+r,i.Value=e,$("#NearbyAreasName").val(i.Name),$("#NearbyAreasType").val(i.Type),$("#NearbyAreasValue").val(i.Value),f.addLocation(i)):alert(t.locNotRegognized)}function pr(){var n,t,i;$("#NearbyAreasList").empty();n={Name:$("#NearbyAreasName").val(),Type:$("#NearbyAreasType").val(),Value:$("#NearbyAreasValue").val()};n.Type=="radius"&&(t=n.Name.indexOf(" ("),t>0&&(n.Name=n.Name.substring(0,t)));i=10;$.ajax({type:"GET",url:"/include/ajax/api.aspx?op=GetNearbyCities",data:{miles:i,name:n.Name,order:bi},dataType:"json",success:af});$("#NearbyListLoading").show();$("#NearbyAreasPopup").removeClass("hide")}function af(n){for(var u,r,f,e,o=cf(),i=0;i<n.length;i++){for(u="",r=0;r<o.length;r++)if(o[r].name==n[i].CityName+" (City)"){u='checked="checked"';break}rbw.context.preferredMeasurementSystem.indexOf("US")!=-1?(e=t.mi,f=n[i].Miles.toFixed(1)):(e=t.km,f=n[i].Kilometre.toFixed(1));$("#NearbyAreasList").append('<tr><td><input type="checkbox" id="NearbyCitiesCheck'+i+'" onclick="Search.NearbyCityClick(this.checked, this.value);" value="'+n[i].CityName+' (City)" '+u+' /><\/td><td><label for="NearbyCitiesCheck'+i+'"" >'+n[i].CityName+"<\/label><\/td><td>"+Utils.Format.addCommas(f)+" "+e+"<\/td><\/tr>");$("#NearbyListLoading").hide()}}var f=this,r,w=!1,b={},ft=null,vt=null,et=null,u=null,h=new Querystring,o="map",l,ci=!0,kr="",ot="",yt=!1,a=!1,li=!1,it=-1,rt=!0,pt=!1,ai=!1,k=!1,wt=!1,vi=!1,yi=!1,pi=!1,wi=!1,st=0,nt=new AutoCompleteBinder(n.autoCompleteBinderOptions),dr=250,bi,bt="MORE OPTIONS",ki="FEWER OPTIONS",ht=!1,ut=0,y=n.enableInfiniteScroll,p=!1,c=Date.now(),di,i={totalCount:0,resultsPerPage:n.resultsPerPage,page:y?0:n.first/n.resultsPerPage,totalPages:0,cache:!0,pageCache:{},clear:function(){this.page=0;this.pageCache={}}},nu={statuses:{active:"1",pending:"5",sold:"2"},mapExpandDiff:225,resultsPerPage:10,poiEnabled:!0,showMinimap:!0,submitEnabledOnLoad:!0,getOfficePins:!0,autoCompleteBinderOptions:{},isSM3:e()},t,wr,br;n=$.extend(!0,nu,n);r=new BingMap(n);t={};t.retrieveNbrhd=Utils.translate("Retrieving Neighborhoods in this Area","Retrieving Neighborhoods in this Area");t.zoomInToViewNbrhd=Utils.translate("Zoom in to view Neighborhoods","Zoom in to view Neighborhoods");t.noBbrhdFound=Utils.translate("No Neighborhoods Found","No Neighborhoods Found");t.icNeighborhoodInfo=Utils.translate("The list below shows all neighborhoods in the nearby map area","The list below shows all neighborhoods in the nearby map area. Select a neighborhood to see it outlined on the map or zoom out the map to see more neighborhoods.");t.selectNbrhd=Utils.translate("Select Neighborhood","Select Neighborhood");t.errorLoadingNbrhd=Utils.translate("Error loading neighborhoods","Error loading neighborhoods");t.errorRetrievingRslts=Utils.translate("An error has occurred retrieving your results. Please try again.","An error has occurred retrieving your results. Please try again.");t.errorRetrievingRslts1=Utils.translate("An error has occurred retrieving your results.","An error has occurred retrieving your results.");t.changeSearchCriteria=Utils.translate("To view properties please change your search criteria","To view properties please change your search criteria");t.adjustLocation=Utils.translate("Please adjust the location or zoom in on the map","Please adjust the location or zoom in on the map");t.zoomInToEnable=Utils.translate("Points of Interest disabled. Please zoom in to enable.","Points of Interest disabled. Please zoom in to enable.");t.inDrawingMode=Utils.translate("You are in Drawing mode.","You are in Drawing mode.");t.clickStartPoint=Utils.translate("Click on the starting point of your search area to start drawing.","Click on the starting point of your search area to start drawing.");t.clickNextPoint=Utils.translate("Click on the next point.","Click on the next point.");t.comeOutOfDrawingMode=Utils.translate("You can click on Cancel Drawing at any time to come out of drawing mode.",'You can click on "Cancel Drawing" at any time to come out of drawing mode.');t.continueDrawing=Utils.translate("Now continue drawing your search area...","Now continue drawing your search area...");
31t.clickEndDrawing=Utils.translate("Or click on the End Drawing point on the map to finish drawing.","Or click on the End Drawing point on the map to finish drawing.");t.evenMoreOptions=Utils.translate("Even More Options","Even More Options");t.lessOptions=Utils.translate("Less Options","Less Options");t.tooManyProperties=Utils.translate("Too many properties","Too many properties");t.plsTryAgain=Utils.translate("Please try again.","Please try again.");t.keepUnder150Miles=Utils.translate("Please try again, and keep it under 150 miles.","Please try again, and keep it under 150 miles.");t.valIncludeCityState=Utils.translate("Please include the city and state.","Please include the city and state.");t.dateFormatValidation=Utils.translate("Please enter a date in the format MM/DD/YYYY.","Please enter a date in the format MM/DD/YYYY.");t.otherValidation=Utils.translate("Invalid entry. Please enter valid value for: ","Invalid entry. Please enter valid value for: ");t.locNotRegognized=Utils.translate("The location was not recoginized.","The location was not recoginized.");t.errorGettingRslts=Utils.translate("Error getting results","Error getting results")+": ";t.remarksAndMap=Utils.translate("Remarks & Map","Remarks & Map");t.showCriteria=Utils.translate("Show Criteria","Show Criteria");t.hideCriteria=Utils.translate("Hide Criteria","Hhow Criteria");t.dateListed=Utils.translate("Date Listed","Date Listed");t.boundaryTooLarge=Utils.translate("Boundary too large","Boundary too large");t.searching=Utils.translate("Searching","Searching");t.view=Utils.translate("View","View");t.add=Utils.translate("Add","Add")+" ";t.display=Utils.translate("Display","Display")+" ";t.hide=Utils.translate("Hide","Hide");t.remove=Utils.translate("Remove","Remove")+" ";t.propFound=Utils.translate("properties found","properties found");t.propertiesFound=Utils.translate("{[0]} properties found","{[0]} properties found");t.propFound1=Utils.translate("Property Found","Property Found");t.propDisplayedtxt=Utils.translate("{[0]} properties displayed","{[0]} properties displayed");t.ofpropDisplayed=t.propDisplayedtxt;t.of=" "+Utils.translate("of","of")+" ";t.changeSearchCriteriaOnTheTop=Utils.translate("To view properties please change your search criteria on the top","To view properties please change your search criteria on the top");t.changeSearchCriteriaOnTheLeft=Utils.translate("To view properties please change your search criteria on the left","To view properties please change your search criteria on the left");t.onTheTop=Utils.translate("on the top","on the top");t.onTheLeft=Utils.translate("on the left","on the left");t.prev=Utils.translate("Prev","Prev");t.previous=Utils.translate("Previous","Previous");t.prevpage=Utils.translate("Previous Page","Previous Page");t.next=Utils.translate("Next","Next");t.nextPage=Utils.translate("Next Page","Next Page");t.page=Utils.translate("Page","Page");t.mi=Utils.translate("mi","mi");t.km=Utils.translate("km","km");t.mile=Utils.translate("mile","mile");t.miles=Utils.translate("miles","miles");t.gotopage=Utils.translate("Goto page","Goto page");this.addLocationFromAutoSuggest=function(n,t,i){return f.addLocation(n,t,i,!0)};this.clearPolygons=function(){r.clearPolygons()};this.addLocation=function(t,i,u,h,c){var y,w,k,it,p,b,d,rt,v,l,g,nt;if(!t||!t.Name||t.Name==="")return i||s(),!1;e()&&o==="gallery"&&f.enableOnMapChange("MapSearch._activeView");h=typeof h!="undefined"?h:!1;c=typeof c!="undefined"?c:!1;y=t.Name;t.City&&t.City!==""&&t.Type.toLowerCase()!=="custom"&&(y+=", "+t.City);t.State&&t.State!==""&&t.Type.toLowerCase()!=="custom"&&(y+=", "+t.State);y.indexOf("(")==-1&&t.Type.toLowerCase()!=="points"&&t.Type.toLowerCase()!=="radius"&&t.Type.toLowerCase()!="drivetime"&&t.Type.toLowerCase()!=="custom"&&(y+=" ("+t.Type+")");rbw.context.branding=="RECo"&&rbw.context.useOfficeApi&&(w={op:"GetOfficesByOfficeRegion"},t.Type.toLowerCase()=="city"?(w.city=t.Name,t.State!=null&&(w.state=t.State)):t.Type.toLowerCase()=="zip code"&&(w.zipCode=t.Name),f.searchOffices(w));k=t.Type;uu(k);var tt=searchLocation.getFlattenedLocations("name"),ut=searchLocation.getFlattenedLocations("type"),ft=searchLocation.getFlattenedLocations("value");for(rbw&&rbw.storage&&$("#criteria-location-input").val()&&(it={input
31Location:$("#criteria-location-input").val(),timestamp:Date.now(),autocompleteData:t},rbw.storage.setLocalItem("mapsearch-addlocation",JSON.stringify(it))),p=!1,b=0;b<tt.length;b++)if(d=tt[b],rt=ut[b],d===y&&rt===k){p=!0;break}else if(y.indexOf("Current Location")>=0&&d.indexOf("Current Location")>=0){p=!0;break}if(!p||c){if(v=t.Name,l=t.Type.toLowerCase(),l==="city"||l==="county"?t.State&&t.State.length>0&&(v+=","+t.State):l==="subdivision"?(t.City&&t.City.length&&(v+=","+t.City),t.State&&t.State.length>0&&(v+=","+t.State)):l==="neighborhood"||l==="boundary"||l==="custom"||l==="township"||l==="borough"?v=t.BID:l==="points"||l==="radius"?v=t.Value:l==="drivetime"?v=t.time+","+t.duration+","+t.rangeType:l.indexOf("school")!==-1&&(t.BID&&t.BID.length>0?v=t.BID:t.State&&t.State.length>0&&(v+=","+t.State)),!c){if(g={name:y,type:k,value:v,isOr:!0,BID:t.BID},n.supportsBooleanSearch&&h&&searchLocation.isBooleanSearchCompatible(g))return p;searchLocation.addBoolean(g)}a=!0;l==="city"?r.gotoPolyDeferred(y,"city",v):l==="county"?r.gotoPolyDeferred(y,"county",v):l==="zip code"?r.gotoPolyDeferred(y,"zip",v):l==="neighborhood"||l==="township"||l==="borough"?r.gotoPoly(y,l,v,!0,i):l==="drivetime"?r.gotoPoly(y,"drivetime",v,!0,i):l==="points"?u||r.gotoPoly(y,"points",v,!0,i):l==="radius"?u||r.gotoPoly(y,"radius",v,!0,i):l.indexOf("school")!==-1?r.gotoPoly(y,l,v,!0,i):t.BID&&t.BID>0?l==="custom"?f.submit(!0):r.gotoPoly(y,"boundary",v,!0,i):(nt=t.Name,t.State&&t.State.length>0&&(nt+=","+t.State),ei(nt,t.Type))}return p};this.removeLocation=function(n){for(var r=[],u=searchLocation.getFlattenedLocations("name"),f=searchLocation.getFlattenedLocations("type"),e=searchLocation.getFlattenedLocations("value"),t=0;t<u.length;t++){var i=u[t],o=f[t],s=e[t];typeof i!="undefined"&&i===n&&(nr(n,o),r=searchLocation.remove({name:i},function(n,t){return n.name===t.name},!0))}$.each(r,function(){nr(this.name,this.type)})};this.submitDriveTimeSearch=function(n,t,i,r){var u={Name:n,duration:i,time:t,Type:"drivetime",rangeType:r};f.addLocation(u,!1,!1,!1,!1);f.submit(!0,null,!0)};this.isLoaded=function(){return r?r.isLoaded():!1};this.clearCriteria=function(t){(w=!1,$(":input:not('.r-do-not-clear,.r-do-not-clear input')",$(u.criteriaContainers)).each(function(){var t=this.type,i=this.tagName.toLowerCase(),n=this.name;t=="text"||t=="password"||i=="textarea"||n=="Criteria/LocationType"||n=="Criteria/Location"||n=="Criteria/LocationValue"?this.value="":t=="checkbox"?(this.disabled||(this.checked=!1),n=="Criteria/Status"&&$(this).closest(".status-chkbox").removeClass("active")):t=="radio"&&n.indexOf("Groups")==-1&&n.indexOf("ListingTypeID")===-1?this.checked=!1:t=="radio"&&(n.indexOf("Groups")>-1||n.indexOf("ListingTypeID")>-1)?this.value==1&&(this.checked=!0):i=="select"&&($(this).attr("multiple")?$.each(this.options,function(){$(this).removeAttr("selected")}):(this.selectedIndex=0,typeof $.fn.selectpicker!="undefined"&&$(this).hasClass("bootstrap-select")&&$(this).selectpicker("refresh")),n=="Criteria/ListingTypeID"&&f.toggleListingType(this),n=="dd_Features"&&f.toggleFeature(this));$(".js-proptype-toggler, .js-hometype-toggler").removeClass("active")}),searchLocation.load([]),$(":input[name='Criteria/Status']",$(u.criteria)).length>0&&$(":input[name='Criteria/Status'][checked]",$(u.criteria)).length===0&&($(":input[name='Criteria/Status'][value='1']",$(u.criteria)).attr("checked",!0),$(":input[name='Criteria/Status'][id='mapsearch-criteria-status-active']",$(u.criteria)).attr("checked",!0),ui()),e()&&$(":input[name='Criteria/ListingTypeID']",$(u.criteria)).length>0&&$(":input[name='Criteria/ListingTypeID'][checked]",$(u.criteria)).length===0&&($(":input[name='Criteria/ListingTypeID'][value='1']",$(u.criteria)).attr("checked",!0),$(".proptype-residential").closest("span").addClass("active")),r.clearPolygons(),kr="",w=!0,$(document).trigger("criteriachange",[{activeTab:$("#SearchTab").val()}]),$(document).trigger("criteriacleared"),t&&t.shouldNotResetMap)||r.setMapExtent(n.defaultBoundingBox)};this.load=function(){var l,a,c,y;searchLocation.load(n.startingLocations);w=!1;it=n.startingCLSID==undefined?-1:n.startingCLSID;$("#mapsearch-mainmap").bind("mapchange",hr);$("#mapsearch-mainmap").bind("shapedrawn",du);r.load();$(document).bind("loginupdate",function(n,t){var r=document.getElementById("single-listing-overlay");t.canReloadView&&r===null&&tt(i.page*i.resultsPerPage)});$(document).bind("removecriteria",function(n,t){fu(t)});$(document).bind("onbooleanlocationchange",function(n,t){var i;t&&t.item?(i={Name:t.item.name,Type:t.item.type,Value:t.item.value,BID:t.item.BID},f.addLocation(i,!1,!0,!1,!0)):s(!0)});$(document).on("enableCriteriaLocationChange",function(n,t){var i=t.criteriaAll,h="",c="",y="",e,s,v;if(i.type.toLowerCase()=="neighborhood"&&(e=i.value.split(","),e&&e.length>0)){try{y=e[0]}catch(n){}try{h=e[1]}catch(n){}try{c=e[2].split(" ")[0]}catch(n){}}var o=t.locationData,u={Type:i.type,Name:t.fieldText.split(",")[0],City:h,State:c,BID:i.data,County:null},l=i.isAnd||i.isNot,p=function(n){if(n){var t=n.indexOf(","),i=n.indexOf("("),r=n.indexOf(")");return t!==-1&&i>t&&r>i}},a=function(n){if(n){var t=n.indexOf(","),i=n.substring(t+1),r=i.replace(/\s*\(.*?\)\s*/g,"");return r.trim()}};(i.type.toLowerCase()==="neighborhood"||i.type.toLowerCase()==="township"||i.type.toLowerCase()==="borough")&&(u=$.extend(u,{BID:a(o.value)}));(i.type.toLowerCase()==="city"||i.type.toLowerCase()==="neighborhood"||i.type.toLowerCase().indexOf("school")!==-1||i.type.toLowerCase()==="county"||i.type.toLowerCase()==="township"||i.type.toLowerCase()==="borough")&&(u=$.extend(u,{State:a(t.fieldText)}));i.type.toLowerCase()==="radius"&&p(t.fieldText)&&(u=$.extend(u,{Name:t.fieldText}));(i.type.toLowerCase()==="points"||i.type.toLowerCase()==="radius")&&(u=$.extend(u,{Value:i.data}));i.type.toLowerCase()==="drivetime"&&o&&(s=o[0].value.split(","),u={Name:t.fieldText,duration:s[1],time:s[0],Type:"drivetime",rangeType:s[2]});l?(v={BID:null,isNot:i.isNot,isAnd:i.isAnd,isOr:i.isOr,name:i.value,type:i.type,value:i.data},searchLocation.addRoot(o),$(window.document).trigger("onbooleanlocationchange",[{item:v}])):(f.addLocation(u,!1,!0,!1,l),(i.type.toLowerCase()==="points"||i.type.toLowerCase()==="radius")&&r.gotoPoly(u.Name,u.Type,u.Value,!1,!0))});u={criteria:document.getElementById("mapsearch-criteria-layout"),criteriaForm:document.getElementById("mapsearch-criteria"),searchSummary:document.getElementById("search-summary"),tabCssClassOn:"ms_tab_on",tabCssClassOff:"ms_tab_off",tabCssSelectorOn:".ms_tab_on",tabCssSelectorOff:".ms_tab_off",tabSelectorPrefix:"#mapsearch-viewtab-"};e()?(u.criteriaContainers="#mapsearch-criteria-layout, #criteria-form-filters-dropdown",u.tabSelectorPrefix="#search-results-displaytype-"):u.criteriaContainers=u.criteria;
31(e()||v())&&(u.tabCssClassOn="active",u.tabCssClassOff="inactive",u.tabCssSelectorOn=".active",u.tabCssSelectorOff=".inactive",bt=t.evenMoreOptions,ki=t.lessOptions);document.location.href.includes("searchtype=map")?(o="map",$("#mapsearch-mainmap-toolbar").css({visibility:"visible",overflow:"visible",height:"auto"})):l=n.defaultView;o=g()&&(l=="detail"||l=="list")?"list":l=="gallery"?"gallery":"map";cr(o);$(function(){gu()});$(window).resize(function(){et&&clearTimeout(et);et=setTimeout(function(){f.isLoaded()&&r.resize($("#mapsearch-maptoolbar").width());dt();et=null},100)});$(window).unload(uf);$(document).bind("criteriachange",function(){var n=function(n,t){return n.length>0?n.val().toLowerCase().indexOf(t)!==-1:!1};$.each(["#mapsearch-criteria-minprice","#mapsearch-criteria-maxprice"],function(t,i){(n($(i),"minimum")||n($(i),"maximum"))&&$(i).val("")})});a=Utils.AppPath+"/include/ajax/mapsearch/getsearchcriteria.aspx";c=[];n.cookieGuid!=""&&c.push("searchoverride="+n.cookieGuid);h.contains("LayoutID")&&(c.push("LayoutID="+h.get("LayoutID")),c.push("LayoutVersion="+h.get("LayoutVersion")));h.contains("ListingSearch")&&c.push("ListingSearch="+h.get("ListingSearch"));h.contains("search")&&c.push("search="+h.get("search"));h.contains("savedSearchTypeId")&&c.push("savedSearchTypeId="+h.get("savedSearchTypeId"));y=new Date;c.push("dt="+y.getTime());e()?c.push("v=3"):v()&&c.push("v=2");typeof LanguagePlugin!="undefined"&&LanguagePlugin.overrideLocaleID&&c.push("OverrideLocaleID="+LanguagePlugin.overrideLocaleID);c.length>0&&(a+="?"+c.join("&"));$(u.criteria).load(a,null,rf)};this.setOptions=function(t){t&&(n=$.extend({},n,t),r.setOptions(t),i.resultsPerPage=n.resultsPerPage||i.resultsPerPage,nt.setOptions(t.autoCompleteBinderOptions))};this.setActiveView=function(n){fi(n)};this.enableSubmit=function(){w=!0};this.mapIsReady=function(){return rbw.utils.wait.until(function(){return r.isLoaded()})};this.enableOnMapChange=function(n){(n=n||"__default",typeof b[n]!="undefined")&&--b[n]<=0&&delete b[n]};this.disableOnMapChange=function(n){n=n||"__default";b[n]=b[n]||0;++b[n]};this.startDrawing=function(){$("#mapsearch-maptoolbar-draw").addClass("drawing").html("<span><\/span>"+t.cancelDrawing);$("#criteria-location-draw a").addClass("drawing").html(t.cancelDrawingOnMap);document.getElementById("selNeighborhood")&&(document.getElementById("selNeighborhood").value="",document.getElementById("Neighborhood").selectedIndex=0);r.startDrawing()};this.endDrawing=function(n){$("#mapsearch-maptoolbar-draw").removeClass("drawing").html("<span><\/span>"+t.drawSearchArea);$("#criteria-location-draw a").removeClass("drawing").html(t.drawSearchAreaonMap);var i=r.endDrawing(n);i&&f.addLocation(i)};this.toggleFeature=function(n){if(n){for(var t=0,i=n.length;t<i;t++)$("#feature_"+t).hide();$("#feature_"+n.selectedIndex).show()}};this.toggleListingType=function(n,t){var u,r,f,i,o,e,h;if(n){for(i=0,o=n.length;i<o;i++){if(u=document.getElementById("propertyType_"+i),u)for(r=u.getElementsByTagName("input"),e=0,h=r.length;e<h;e++)f=r[e].getAttribute("name"),f.toLowerCase()=="criteria/propertytypeid"&&r[e].setAttribute("name","Criteria/PropertyTypeID_X"),f.toLowerCase()=="criteria/defaultpropertytypeid"&&r[e].setAttribute("name","Criteria/DefaultPropertyTypeID_X");hide("propertyType_"+i)}if(u=document.getElementById("propertyType_"+n.selectedIndex),u)for(r=u.getElementsByTagName("input"),i=0,o=r.length;i<o;i++)f=r[i].getAttribute("name"),f.toLowerCase()=="criteria/propertytypeid_x"&&r[i].setAttribute("name","Criteria/PropertyTypeID"),f.toLowerCase()=="criteria/defaultpropertytypeid_x"&&r[i].setAttribute("name","Criteria/DefaultPropertyTypeID");$("input[name='Criteria/PropertyTypeID']").blur();display("propertyType_"+n.selectedIndex);typeof t!="undefined"&&t||s()}};this.setListingStatus=function(){ui();s()};this.toggleCriteria=function(n){var l=n,o=$("#SearchTab"),f=$(u.criteria),t,r,h;if(o.length!==0){var i=$("#basicSearch").length>0,s=$(".searchtab",f).eq(0).attr("id"),c=!1;n?i&&n.indexOf("Search")==-1&&(n+="Search"):(t=o.val(),t=="2"||t=="advanced"||t=="advancedSearch"?i?n="advancedSearch":(n=s,c=!0):t=="3"||t=="mlsID"||t=="mlsIDSearch"?n=i?"mlsIDSearch":$(".searchtab:has(input[name='Criteria/ListingNumber'])",f).eq(0).attr("id"):t=="4"||t=="address"||t=="addressSearch"?n=i?"addressSearch":$(".searchtab:has(input[name='Criteria/FullAddress'])",f).eq(0).attr("id"):t=="5"||t=="school"||t=="schoolSearch"?n=i?"schoolSearch":$(".searchtab:has(input[name='Criteria/School'])",f).eq(0).attr("id"):t=="6"?n="foreclosureSearch":t=="1"||t=="basic"||t=="basicSearch"?n=i?"basicSearch":s:t!=""&&(n=t),n||(n=i?"basicSearch":s));n&&n.length>0&&(r=$("#"+n),r.length===0&&(n="mapsearch-criteria-basicsearch",r=$("#"+n),r.length===0&&(n="basic-search-criteria",r=$("#"+n))),r.length>0&&(i?n=="basicSearch"?($("#advancedSearch,#mlsIDSearch,#addressSearch,#schoolSearch,#foreclosureSearch,#tab_adv_on,#tab_basic_off").hide(),$("#tab_adv_off,#tab_basic_on,#basicSearch").show()):n=="advancedSearch"?($("#basicSearch,#mlsIDSearch,#addressSearch,#schoolSearch,#foreclosureSearch,#tab_basic_on,#tab_adv_off").hide(),$("#tab_basic_off,#tab_adv_on,#advancedSearch").show()):n=="mlsIDSearch"?($("#basicSearch,#advancedSearch,#addressSearch,#schoolSearch,#foreclosureSearch").hide(),$("#mlsIDSearch").show()):n=="addressSearch"?($("#basicSearch,#advancedSearch,#mlsIDSearch,#schoolSearch,#foreclosureSearch,").hide(),$("#addressSearch").show()):n=="foreclosureSearch"?($("#basicSearch,#advancedSearch,#mlsIDSearch,#schoolSearch").hide(),$("#foreclosureSearch").show()):n=="schoolSearch"&&($("#basicSearch,#advancedSearch,#mlsIDSearch,#addressSearch,#foreclosureSearch").hide(),$("#schoolSearch").show()):($(".searchtab",f).removeClass("active"),r.addClass("active"),c&&si()),e()?$(document).trigger("criteriachange",[{activeTab:n}]):v()?$(document).trigger("criteriachange",[{activeTab:n}]):(h=$("#mapsearch-left").offset().top,h<$(window).scrollTop()&&$("body,html").animate({scrollTop:h},1e3,function(){$(document).trigger("criteriachange",[{activeTab:n}])})),o.val(n),l&&$(document).trigger("criteriachange",[{activeTab:n}])))}};this.onChangeSubmit=function(n,i){var r,u;if(n&&n.name&&n.name.toLowerCase().indexOf("price")>-1&&n.type==="text"&&(i="money"),i=="mmddyyyy"&&(i="date"),i&&i.length!==0||($(n).is(".numeric")?i="numeric":$(n).is(".money")?i="money":$(n).is(".date")?i="date":$(n).is(".year")&&(i="year")),r=null,n)n.value.length>0&&(i=="numeric"?n.value=Utils.Format.addCommas(n.value):i=="money"&&(n.value="$"+Utils.Format.formatCurrency(n.value))),r=n.value;else return;u=!1;u=n.value.length>0?i=="numeric"?IsNumeric(r):i=="money"?IsMoney(r):i=="date"?n.standarddate?IsDate(n.standarddate):IsDate(r):i=="year"?IsNumeric(r)&&r.length==4:!0:!0;u?s():(i=="date"?alert(t.dateFormatValidation):alert(t.otherValidation+Utils.translate(i,i)),setTimeout(function(){n.focus();n.select()},25))};this.submit=s;this.isCriteriaVisible=ii;this.isV1=g;this.isV2=v;this.isV3=e;this.openSingleListingOverlay=function(){window.ldpOverlayVisible=!0;di=$(window).scrollTop();$(document).filter(e).trigger("ldpOverlayActivated").on("click keyup",lr)};this.closeSingleListingOverlay=function(){window.ldpOverlayVisible=!1;typeof ListingGallery!="undefined"&&ListingGallery.destroyPhotoGallery();
31$(document).filter(e).trigger("ldpOverlayDeactivated").off("click keyup",lr);e&&document.activeElement.id==="listing-listingsearch"&&$(window).scrollTop(di)};this.openPublicRecordsOverlay=function(){$(document).filter(e).trigger("prOverlayActivated").on("click keyup",ar)};this.closePublicRecordsOverlay=function(){$(document).filter(e).trigger("prOverlayDeactivated").off("click keyup",ar)};this.closeOverlays=function(){this.closeSingleListingOverlay();this.closePublicRecordsOverlay()};this.GotoZip=function(n){var t={Name:n,Type:"Zip Code",Value:n};$("input[name='Criteria/ZipCode'],input[name='Criteria/ZipCodeAdvanced']",$(u.criteria)).val("");f.addLocation(t)};this.GotoCity=function(n){var t={Name:n,Type:"City",Value:n};$("input[name='Criteria/City']",$(u.criteria)).val("");f.addLocation(t)};this.addressGoto=function(n){var i;if(n===null||n=="")if(i=$("#SearchTab").val(),i=="5"||i=="subdivisionSearch")n="SS";else if(i=="4"||i=="addressSearch")n="AS";else return;n="#"+n;var r=$(n+"_StreetName").val(),u=$(n+"_City").val(),f=$(n+"_State").val(),e=$(n+"_ZipCode").val(),t="";(u.length>0&&(t=u),f.length>0&&(t+=","+f),t.length>0&&(t+=",usa"),t.length===0&&e.length>0&&(t=e),t.length!==0)&&(r.length>0&&(t=r+","+t),r.length>0&&ei(t,"Address"))};this.prevPage=function(){tt(--i.page*i.resultsPerPage,c)};this.nextPage=function(){tt(++i.page*i.resultsPerPage,c)};this.gotoPage=function(n){st=0;n=n<=0?1:n;i.page=n-1;tt(i.page*i.resultsPerPage,c)};this.hasMoreInfinitePages=function(){return ut+1<i.totalPages};this.throttleInfiniteSearch=function(n){ht=!1;setTimeout(function(){ht=!0},n||2e3)};this.infiniteNextPage=function(){if(!y||p||!this.hasMoreInfinitePages()||!ht)return!1;var t=++ut,n=t*i.resultsPerPage;return tt(n,c),this.setSeeNextCount(n),!0};this.setSeeNextCount=function(n){n==0&&(ut=0,$("#mapsearch-results").scrollTop(0));var r=n+i.resultsPerPage,t=r+i.resultsPerPage;t>i.totalCount&&(t=i.totalCount);setTimeout(function(){$(".result-next-count").text(`${r} - ${t}`)},500)};this.togglePinBubble=function(n,t){$("#pin_"+n).show();$("#pin_"+t).hide()};this.searchOffices=function(n){$.ajax({type:"GET",url:"/include/ajax/api.aspx",data:n,dataType:"json",success:function(n){nf(n)}})};this.getLocations=function(){return searchLocation.getLocations()};this.OpenNearbyAreas=function(n,t,i){var u,r;$("#NearbyAreasName").val(n);$("#NearbyAreasType").val(t);$("#NearbyAreasValue").val(i);t.toLowerCase()=="radius"?(u=i.substring(i.indexOf("~")+1),$("#NearbyAreasRange").val(u)):$("#NearbyAreasRange").val(0);t.toLowerCase()=="radius"&&(n.indexOf("Current Location")>=0||n.indexOf("Radius Shape")>=0)?($("#nearby-areas-cities").hide(),$("#nearby-areas-clearall-button").hide()):($("#nearby-areas-cities").show(),$("#nearby-areas-clearall-button").show());r=n.indexOf(" (");r>0&&(n=n.substring(0,r));$(".nearby-areas-name").html(n);pr()};this.NearbyAreasChange=function(){var i=$("#NearbyAreasRange").val(),n={Name:$("#NearbyAreasName").val(),Type:$("#NearbyAreasType").val(),Value:$("#NearbyAreasValue").val()},r;if(f.removeLocation(n.Name),r=n.Name.indexOf(" ("),r>0&&(n.Name=n.Name.substring(0,r)),n.Name.indexOf("Current Location")>=0||n.Name.indexOf("Radius Shape")>=0)i<=.5&&(i=.5),n.Value=n.Value.substring(0,n.Value.indexOf("~")+1)+i,n.Name+=rbw.context.preferredMeasurementSystem.indexOf("US")!=-1?i==.5?" (1/2"+t.mile+" )":i==1?" (1 "+t.mile+")":" ("+i+" "+t.miles+")":i==.3?" (1/2 "+t.km+")":" ("+i+" "+t.km+")";else{if(i>0){$.ajax({type:"GET",url:"/include/ajax/api.aspx?op=GetCoordinates",data:{name:n.Name},dataType:"json",success:lf});return}$.isNumeric(n.Name)?(n.Type="Zip Code",n.Value=n.Name,n.Name=n.Name+" (Zip Code)"):(n.Type="City",n.Name=n.Name+" (City)",n.Value=n.Name)}$("#NearbyAreasName").val(n.Name);$("#NearbyAreasType").val(n.Type);$("#NearbyAreasValue").val(n.Value);f.addLocation(n)};this.NearbyAreasClearAll=function(){$("#NearbyAreasList :checked").each(function(){$(this).prop("checked",!1);f.removeLocation($(this).val())});s(!1)};this.NearbyAreasSort=function(n){bi=n;pr()};this.NearbyAreasRemove=function(n){var t=typeof n=="undefined"?$("#NearbyAreasName").val():n;f.removeLocation(t);s(!1)};this.NearbyCityClick=function(n,t){if(n){var i={Name:t,Type:"City",Value:t};f.addLocation(i)}else f.removeLocation(t),s(!1)};this.initPrice=function(n){n.each(function(){$(this).data("has-autocomplete")||($(this).data("has-autocomplete",!0),this.value!=""&&(this.value="$"+Utils.Format.formatCurrency(this.value)),$(this).autocomplete("numeric",{maxChars:8,formatResult:function(n){return"$"+Utils.Format.formatCurrency(n)},formatItem:function(n){return"$"+Utils.Format.formatCurrency(n)},highlight:!1,selectFirst:!1}).result(function(){$(this).change()}))})};this.initSqft=function(n){n.each(function(){$(this).data("has-autocomplete")||($(this).data("has-autocomplete",!0),this.value=Utils.Format.addCommas(this.value),$(this).autocomplete("numeric",{maxChars:5,formatResult:function(n){return Utils.Format.addCommas(n)},formatItem:function(n){return Utils.Format.addCommas(n)},highlight:!1,selectFirst:!1}).result(function(){$(this).change()}))})};wr=this.initPrice;br=this.initSqft}function toggling(n){document.getElementById(n)&&(document.getElementById(n).style.display=document.getElementById(n).style.display==""?"none":"")}function toggleOpenHouseRange(){document.getElementById("OpenHouses").checked?(document.getElementById("OpenHouseStartDtm").disabled=!1,document.getElementById("OpenHouseStopDtm").disabled=!1):(document.getElementById("OpenHouseStartDtm").disabled=!0,document.getElementById("OpenHouseStopDtm").disabled=!0)}function lcs(){return!0}function setArrows(){$(".search-criteria-panel-header").each(function(){$("span.arrow",this).hasClass("arrow arrow-left")||$("span.arrow",$(".search-criteria-panel-header")).addClass("arrow-left")});$(".search-criteria-panel-header").click(function(){return $("span.arrow",this).hasClass("arrow arrow-left")?$("span.arrow",this).removeClass("arrow-left").addClass("arrow-down"):$("span.arrow",this).addClass("arrow arrow-left").removeClass("arrow-down"),$(this).next().toggle("fast"),!1})}function toggleSearchAreas(n,t){$(n).show();$(t).hide()}typeof ldpOverlayVisible=="undefined"&&(window.ldpOverlayVisible=!1);$(function(){$(document).on("click","#did-you-know-container-v1 .hide-did-you-know-v1",function(){$("#did-you-know-container-v1").fadeOut(200)});setTimeout(function(){$("#mapsearch-mainmap-toolbar").css("visibility")=="hidden"&&$("#did-you-know-container-v1").hide()},1e3);$(document).on("click","#mapsearch-viewtabs > div",function(){$(this).attr("id")==="mapsearch-viewtab-map"?$("#did-you-know-container-v1").show():$("#did-you-know-container-v1").hide()});$(document).on("click","#search-options-dropdown-close",function(n){n.preventDefault();window.location.href="/listing/listingsearch.aspx"})}); 32(function(n){function i(i,r){n(i).each(function(){var u=n(this);u.attr("er")!="ready"&&(u.attr("er","ready"),r.apply(this,[n]));t[i]=null});n.isReady&&t[i]!=null&&(clearInterval(t[i]),t[i]=null)}n.fn.elementready=function(n){var r=this.selector;return t[r]||(t[r]=setInterval(function(){i(r,n)},25)),this};var t=[]})(jQuery); 33(function(n){n.fn.hoverinfo=function(t){return t=n.extend({},n.fn.hoverinfo.defaults,t),this.each(function(){var i,r=n(this),u=r.attr(t.infoIdAttr);i=u!=undefined&&u.length>0?n("#"+u).addClass("caption1 info-hover-panel"):r.children(":first").addClass("caption1 info-hover-panel").appendTo(n("body")).hide();n.fn.bgiframe&&i.bgiframe();r.hover(function(n){i.attr("class")&&i.attr("class").indexOf("show-left")>=0?i.css("left",n.pageX-(i.width()+18)+"px"):i.css("left",n.pageX+8+"px");i.css("top",n.pageY+8+"px").fadeIn("fast")},function(){i.fadeOut("fast")});r.css("display","inline")})};n.fn.hoverinfo.defaults={infoIdAttr:"infoId"}})(jQuery); 34jQuery.ui||function(n){function s(t,i,r,u){function e(r){var u=n[t][i][r]||[];return typeof u=="string"?u.split(/,?\s+/):u}var f=e("getter");return u.length==1&&typeof u[0]=="string"&&(f=f.concat(e("getterSetter"))),n.inArray(r,f)!=-1}var u=n.fn.remove,f=n.browser.mozilla&&parseFloat(n.browser.version)<1.9;if(n.ui={version:"1.7.2",plugin:{add:function(t,i,r){var f=n.ui[t].prototype;for(var u in r)f.plugins[u]=f.plugins[u]||[],f.plugins[u].push([i,r[u]])},call:function(n,t,i){var u=n.plugins[t],r;if(u&&n.element[0].parentNode)for(r=0;r<u.length;r++)n.options[u[r][0]]&&u[r][1].apply(n.element,i)}},contains:function(n,t){return document.compareDocumentPosition?n.compareDocumentPosition(t)&16:n!==t&&n.contains(t)},hasScroll:function(t,i){if(n(t).css("overflow")=="hidden")return!1;var r=i&&i=="left"?"scrollLeft":"scrollTop",u=!1;return t[r]>0?!0:(t[r]=1,u=t[r]>0,t[r]=0,u)},isOverAxis:function(n,t,i){return n>t&&n<t+i},isOver:function(t,i,r,u,f,e){return n.ui.isOverAxis(t,r,f)&&n.ui.isOverAxis(i,u,e)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}},f){var i=n.attr,e=n.fn.removeAttr,r="http://www.w3.org/2005/07/aaa",t=/^aria-/,o=/^wairole:/;n.attr=function(n,u,f){var e=f!==undefined;return u=="role"?e?i.call(this,n,u,"wairole:"+f):(i.apply(this,arguments)||"").replace(o,""):t.test(u)?e?n.setAttributeNS(r,u.replace(t,"aaa:"),f):i.call(this,n,u.replace(t,"aaa:")):i.apply(this,arguments)};n.fn.removeAttr=function(n){return t.test(n)?this.each(function(){this.removeAttributeNS(r,n.replace(t,""))}):e.call(this,n)}}n.fn.extend({remove:function(){return n("*",this).add(this).each(function(){n(this).triggerHandler("remove")}),u.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return!1})},scrollParent:function(){var t;return t=n.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(n.curCSS(this,"position",1))&&/(auto|scroll)/.test(n.curCSS(this,"overflow",1)+n.curCSS(this,"overflow-y",1)+n.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(n.curCSS(this,"overflow",1)+n.curCSS(this,"overflow-y",1)+n.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!t.length?n(document):t}});n.extend(n.expr[":"],{data:function(t,i,r){return!!n.data(t,r[3])},focusable:function(t){var i=t.nodeName.toLowerCase(),r=n.attr(t,"tabindex");return(/input|select|textarea|button|object/.test(i)?!t.disabled:"a"==i||"area"==i?t.href||!isNaN(r):!isNaN(r))&&
34!n(t)["area"==i?"parents":"closest"](":hidden").length},tabbable:function(t){var i=n.attr(t,"tabindex");return(isNaN(i)||i>=0)&&n(t).is(":focusable")}});n.widget=function(t,i){var r=t.split(".")[0];t=t.split(".")[1];n.fn[t]=function(i){var u=typeof i=="string",e=Array.prototype.slice.call(arguments,1),f;return u&&i.substring(0,1)=="_"?this:u&&s(r,t,i,e)?(f=n.data(this[0],t),f?f[i].apply(f,e):undefined):this.each(function(){var f=n.data(this,t);f||u||n.data(this,t,new n[r][t](this,i))._init();f&&u&&n.isFunction(f[i])&&f[i].apply(f,e)})};n[r]=n[r]||{};n[r][t]=function(i,u){var f=this;this.namespace=r;this.widgetName=t;this.widgetEventPrefix=n[r][t].eventPrefix||t;this.widgetBaseClass=r+"-"+t;this.options=n.extend({},n.widget.defaults,n[r][t].defaults,n.metadata&&n.metadata.get(i)[t],u);this.element=n(i).bind("setData."+t,function(n,t,r){if(n.target==i)return f._setData(t,r)}).bind("getData."+t,function(n,t){if(n.target==i)return f._getData(t)}).bind("remove",function(){return f.destroy()})};n[r][t].prototype=n.extend({},n.widget.prototype,i);n[r][t].getterSetter="option"};n.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(t,i){var r=t,u=this;if(typeof t=="string"){if(i===undefined)return this._getData(t);r={};r[t]=i}n.each(r,function(n,t){u._setData(n,t)})},_getData:function(n){return this.options[n]},_setData:function(n,t){this.options[n]=t;n=="disabled"&&this.element[t?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",t)},enable:function(){this._setData("disabled",!1)},disable:function(){this._setData("disabled",!0)},_trigger:function(t,i,r){var e=this.options[t],o=t==this.widgetEventPrefix?t:this.widgetEventPrefix+t,u,f;if(i=n.Event(i),i.type=o,i.originalEvent)for(u=n.event.props.length;u;)f=n.event.props[--u],i[f]=i.originalEvent[f];return this.element.trigger(i,r),!(n.isFunction(e)&&e.call(this.element[0],i,r)===!1||i.isDefaultPrevented())}};n.widget.defaults={disabled:!1};n.ui.mouse={_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(n){return t._mouseDown(n)}).bind("click."+this.widgetName,function(n){if(t._preventClickEvent)return t._preventClickEvent=!1,n.stopImmediatePropagation(),!1});n.browser.msie&&(this._mouseUnselectable=this.element.attr("unselectable"),this.element.attr("unselectable","on"));this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);n.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable)},_mouseDown:function(t){if(t.originalEvent=t.originalEvent||{},!t.originalEvent.mouseHandled){this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var i=this,r=t.which==1,u=typeof this.options.cancel=="string"?n(t.target).parents().add(t.target).filter(this.options.cancel).length:!1;return!r||u||!this._mouseCapture(t)?!0:(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted))?(t.preventDefault(),!0):(this._mouseMoveDelegate=function(n){return i._mouseMove(n)},this._mouseUpDelegate=function(n){return i._mouseUp(n)},n(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),n.browser.safari||t.preventDefault(),t.originalEvent.mouseHandled=!0,!0)}},_mouseMove:function(t){return n.browser.msie&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return n(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,this._preventClickEvent=t.target==this._mouseDownEvent.target,this._mouseStop(t)),!1},_mouseDistanceMet:function(n){return Math.max(Math.abs(this._mouseDownEvent.pageX-n.pageX),Math.abs(this._mouseDownEvent.pageY-n.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}};n.ui.mouse.defaults={cancel:null,distance:1,delay:0}}(jQuery); 35jQuery.effects||function(n){function t(t,i){var u=t[1]&&t[1].constructor==Object?t[1]:{},r,f;return i&&(u.mode=i),r=t[1]&&t[1].constructor!=Object?t[1]:u.duration?u.duration:t[2],r=n.fx.off?0:typeof r=="number"?r:n.fx.speeds[r]||n.fx.speeds._default,f=u.callback||n.isFunction(t[1])&&t[1]||n.isFunction(t[2])&&t[2]||n.isFunction(t[3])&&t[3],[t[0],u,r,f]}function i(t){var i;return t&&t.constructor==Array&&t.length==3?t:(i=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(t))?[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3],10)]:(i=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(t))?[parseFloat(i[1])*2.55,parseFloat(i[2])*2.55,parseFloat(i[3])*2.55]:(i=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(t))?[parseInt(i[1],16),parseInt(i[2],16),parseInt(i[3],16)]:(i=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(t))?[parseInt(i[1]+i[1],16),parseInt(i[2]+i[2],16),parseInt(i[3]+i[3],16)]:(i=/rgba\(0, 0, 0, 0\)/.exec(t))?r.transparent:r[n.trim(t).toLowerCase()]}function u(t,r){var u;do{if(u=n.curCSS(t,r),u!=""&&u!="transparent"||n.nodeName(t,"body"))break;r="backgroundColor"}while(t=t.parentNode);return i(u)}n.effects={version:"1.7.2",save:function(n,t){for(var i=0;i<t.length;i++)t[i]!==null&&n.data("ec.storage."+t[i],n[0].style[t[i]])},restore:function(n,t){for(var i=0;i<t.length;i++)t[i]!==null&&n.css(t[i],n.data("ec.storage."+t[i]))},setMode:function(n,t){return t=="toggle"&&(t=n.is(":hidden")?"show":"hide"),t},getBaseline:function(n,t){var i,r;switch(n[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=n[0]/t.height}switch(n[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=n[1]/t.width}return{x:r,y:i}},createWrapper:function(n){var u,t,i,r;return n.parent().is(".ui-effects-wrapper")?n.parent():(u={width:n.outerWidth(!0),height:n.outerHeight(!0),float:n.css("float")},n.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"><\/div>'),t=n.parent(),n.css("position")=="static"?(t.css({position:"relative"}),n.css({position:"relative"})):(i=n.css("top"),isNaN(parseInt(i,10))&&(i="auto"),r=n.css("left"),isNaN(parseInt(r,10))&&(r="auto"),t.css({position:n.css("position"),top:i,left:r,zIndex:n.css("z-index")}).show(),n.css({position:"relative",top:0,left:0})),t.css(u),t)},removeWrapper:function(n){return n.parent().is(".ui-effects-wrapper")?n.parent().replaceWith(n):n},setTransition:function(t,i,r,u){return u=u||{},n.each(i,function(n,i){unit=t.cssUnit(i);unit[0]>0&&(u[i]=unit[0]*r+unit[1])}),u},animateClass:function(t,i,r,u){var f=typeof r=="function"?r:u?u:null,e=typeof r=="string"?r:null;return this.each(function(){var c={},u=n(this),s=u.attr("style")||"",h,o,r;typeof s=="object"&&(s=s.cssText);t.toggle&&(u.hasClass(t.toggle)?t.remove=t.toggle:t.add=t.toggle);h=n.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle);t.add&&u.addClass(t.add);t.remove&&u.removeClass(t.remove);o=n.extend({},document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle);t.add&&u.removeClass(t.add);t.remove&&u.addClass(t.remove);for(r in o)typeof o[r]=="function"||!o[r]||r.indexOf("Moz")!=-1||r.indexOf("length")!=-1||o[r]==h[r]||!r.match(/color/i)&&(r.match(/color/i)||isNaN(parseInt(o[r],10)))||h.position=="static"&&(h.position!="static"||r.match(/left|top|bottom|right/))||(c[r]=o[r]);u.animate(c,i,e,function(){typeof n(this).attr("style")=="object"?(n(this).attr("style").cssText="",n(this).attr("style").cssText=s):n(this).attr("style",s);t.add&&n(this).addClass(t.add);t.remove&&n(this).removeClass(t.remove);f&&f.apply(this,arguments)})})}};n.fn.extend({_show:n.fn.show,_hide:n.fn.hide,__toggle:n.fn.toggle,_addClass:n.fn.addClass,_removeClass:n.fn.removeClass,_toggleClass:n.fn.toggleClass,effect:function(t,i,r,u){return n.effects[t]?n.effects[t].call(this,{method:t,options:i||{},duration:r,callback:u}):null},show:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])?this._show.apply(this,arguments):this.effect.apply(this,t(arguments,"show"))},hide:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])?this._hide.apply(this,arguments):this.effect.apply(this,t(arguments,"hide"))},toggle:function(){return!arguments[0]||arguments[0].constructor==Number||/(slow|normal|fast)/.test(arguments[0])||n.isFunction(arguments[0])||typeof arguments[0]=="boolean"?this.__toggle.apply(this,arguments):this.effect.apply(this,t(arguments,"toggle"))},addClass:function(t,i,r,u){return i?n.effects.animateClass.apply(this,[{add:t},i,r,u]):this._addClass(t)},removeClass:function(t,i,r,u){return i?n.effects.animateClass.apply(this,[{remove:t},i,r,u]):this._removeClass(t)},toggleClass:function(t,i,r,u){return typeof i!="boolean"&&i?n.effects.animateClass.apply(this,[{toggle:t},i,r,u]):this._toggleClass(t,i)},morph:function(t,i,r,u,f){return n.effects.animateClass.apply(this,[{add:i,remove:t},r,u,f])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(t){var i=this.css(t),r=[];return n.each(["em","px","%","pt"],function(n,t){i.indexOf(t)>0&&(r=[parseFloat(i),t])}),r}});n.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(t,r){n.fx.step[r]=function(n){n.state==0&&(n.start=u(n.elem,r),n.end=i(n.end));n.elem.style[r]="rgb("+[Math.max(Math.min(parseInt(n.pos*(n.end[0]-n.start[0])+n.start[0],10),255),0),Math.max(Math.min(parseInt(n.pos*(n.end[1]-n.start[1])+n.start[1],10),255),0),Math.max(Math.min(parseInt(n.pos*(n.end[2]-n.start[2])+n.start[2],10),255),0)].join(",")+")"}});var r={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};n.easing.jswing=n.easing.swing;n.extend(n.easing,{def:"easeOutQuad",swing:function(t,i,r,u,f){return n.easing[n.easing.def](t,i,r,u,f)},easeInQuad:function(n,t,i,r,u){return r*(t/=u)*t+i},easeOutQuad:function(n,t,i,r,u){return-r*(t/=u)*(t-2)+i},easeInOutQuad:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t+i:-r/2*(--t*(t-2)-1)+i},easeInCubic:function(n,t,i,r,u){return r*(t/=u)*t*t+i}
35,easeOutCubic:function(n,t,i,r,u){return r*((t=t/u-1)*t*t+1)+i},easeInOutCubic:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t+i:r/2*((t-=2)*t*t+2)+i},easeInQuart:function(n,t,i,r,u){return r*(t/=u)*t*t*t+i},easeOutQuart:function(n,t,i,r,u){return-r*((t=t/u-1)*t*t*t-1)+i},easeInOutQuart:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t+i:-r/2*((t-=2)*t*t*t-2)+i},easeInQuint:function(n,t,i,r,u){return r*(t/=u)*t*t*t*t+i},easeOutQuint:function(n,t,i,r,u){return r*((t=t/u-1)*t*t*t*t+1)+i},easeInOutQuint:function(n,t,i,r,u){return(t/=u/2)<1?r/2*t*t*t*t*t+i:r/2*((t-=2)*t*t*t*t+2)+i},easeInSine:function(n,t,i,r,u){return-r*Math.cos(t/u*(Math.PI/2))+r+i},easeOutSine:function(n,t,i,r,u){return r*Math.sin(t/u*(Math.PI/2))+i},easeInOutSine:function(n,t,i,r,u){return-r/2*(Math.cos(Math.PI*t/u)-1)+i},easeInExpo:function(n,t,i,r,u){return t==0?i:r*Math.pow(2,10*(t/u-1))+i},easeOutExpo:function(n,t,i,r,u){return t==u?i+r:r*(-Math.pow(2,-10*t/u)+1)+i},easeInOutExpo:function(n,t,i,r,u){return t==0?i:t==u?i+r:(t/=u/2)<1?r/2*Math.pow(2,10*(t-1))+i:r/2*(-Math.pow(2,-10*--t)+2)+i},easeInCirc:function(n,t,i,r,u){return-r*(Math.sqrt(1-(t/=u)*t)-1)+i},easeOutCirc:function(n,t,i,r,u){return r*Math.sqrt(1-(t=t/u-1)*t)+i},easeInOutCirc:function(n,t,i,r,u){return(t/=u/2)<1?-r/2*(Math.sqrt(1-t*t)-1)+i:r/2*(Math.sqrt(1-(t-=2)*t)+1)+i},easeInElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),-(e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f))+i)},easeOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u)==1?i+r:(f||(f=u*.3),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),e*Math.pow(2,-10*t)*Math.sin((t*u-o)*2*Math.PI/f)+r+i)},easeInOutElastic:function(n,t,i,r,u){var o=1.70158,f=0,e=r;return t==0?i:(t/=u/2)==2?i+r:(f||(f=u*.3*1.5),e<Math.abs(r)?(e=r,o=f/4):o=f/(2*Math.PI)*Math.asin(r/e),t<1)?-.5*e*Math.pow(2,10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)+i:e*Math.pow(2,-10*(t-=1))*Math.sin((t*u-o)*2*Math.PI/f)*.5+r+i},easeInBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*(t/=u)*t*((f+1)*t-f)+i},easeOutBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*((t=t/u-1)*t*((f+1)*t+f)+1)+i},easeInOutBack:function(n,t,i,r,u,f){return(f==undefined&&(f=1.70158),(t/=u/2)<1)?r/2*t*t*(((f*=1.525)+1)*t-f)+i:r/2*((t-=2)*t*(((f*=1.525)+1)*t+f)+2)+i},easeInBounce:function(t,i,r,u,f){return u-n.easing.easeOutBounce(t,f-i,0,u,f)+r},easeOutBounce:function(n,t,i,r,u){return(t/=u)<1/2.75?r*7.5625*t*t+i:t<2/2.75?r*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?r*(7.5625*(t-=2.25/2.75)*t+.9375)+i:r*(7.5625*(t-=2.625/2.75)*t+.984375)+i},easeInOutBounce:function(t,i,r,u,f){return i<f/2?n.easing.easeInBounce(t,i*2,0,u,f)*.5+r:n.easing.easeOutBounce(t,i*2-f,0,u,f)*.5+u*.5+r}})}(jQuery); 36(function(){"use strict";function n(n,t){n.push(t)}function i(n,t){for(var r,i=0;i<n.length;i++)for(r=0;r<n[i].length;r++)if(t(n[i][r]))return n[i][r];return null}function r(n,t){for(var r,i=0;i<n.length;i++)for(r=0;r<n[i].length;r++)t(n[i][r]);return!1}function u(n,t,i){for(var u,r=0;r<n.length;r++)for(u=0;u<n[r].length;u++)if(i(n[r][u],t))return!0;return!1}function t(n,t,i,r){var u,f,e=[],o=[];for(r=typeof r!="undefined"?r:!1,u=0;u<n.length;u++)for(f=0;f<n[u].length;f++)if(i(n[u][f],t)){if(e=e.concat(n[u].splice(f,1)),n[u].length===0)n.splice(u,1);else if(r)for(o=n.splice(u,1),u=0;u<o[0].length;u++)e.push(o[0][u]);return e}return e}function f(n){var t,i={};for(t in n)i[t]=n[t];return i}function e(i,r,u){var e=i[r][0],o=f(e),s=i[u];n(s,o);t(i,e,function(n,t){return n===t})}function o(n,t,i,r){n.splice(t,0,n[t].splice(i,1));r&&r(n[t][0])}window.xt={};window.xt.add=n;window.xt.each=r;window.xt.exists=u;window.xt.find=i;window.xt.move=e;window.xt.remove=t;window.xt.extract=o})(); 37(function(n,t,i){"use strict";function f(n,t){return n.name===t.name}function e(n){n.isNot=!1}function o(n){n.isNot=!0}function u(){t(n.document).trigger("criteriaitemchange")}function h(i){r.root=i;u();t(n.document).trigger("searchlocationloaded")}function c(n){n.isAnd?i.add(r.root[n.andWithIndex],n):(n.isNot&&(n.isNot=!0),i.add(r.root,[n]));u()}function l(n){r.root.push(n);u()}function s(n){switch(n.type){case"State":case"City":case"County":case"Zip Code":case"Neighborhood":case"Township":case"Borough":case"Subdivision":case"School District":case"Elementary School":case"Middle School":case"High School":return!0;default:return!1}}function a(i){var u,e,f,h=0,c=0,l=0,o={};if(!s(i))return!1;for(u=0;
37u<r.root.length;u++)for(r.root[u][0].isNot&&h++,e=0;e<r.root[u].length;e++)if(f=r.root[u][e],f.type.indexOf("School")!==-1&&l++,o[f.type]||(o[f.type]=0),o[f.type]++,c++,!s(f))return!1;return r.root.length===0||h===r.root.length||o[i.type]===c&&l===0?!1:(t(n).trigger("onshowsearchdialog",[{item:i}]),!0)}function v(n){return i.find(r.root,n)}function y(n){return r.root[n]}function p(n){var f,e=[],i,u;return t.each(r.root,function(t){if(u=this,!u[0].isNot){for(i=u[0].name,f=1;f<u.length;f++)i+=" "+r.BO_AND+u[f].name;n===t&&(i=i.replace(u[0].name+" "+r.BO_AND,""));i=i.replace(r.BO_AND,"\n"+r.BO_AND);e.push({name:i,value:t})}}),e}function w(){var f,e=[],i,n,u;return t.each(r.root,function(t){for(n=this,i=n[0].name,n[0].isNot&&(i=r.BO_NOT+i),f=1;f<n.length;f++)i+=" "+r.BO_AND+n[f].name;u={text:i,name:"Criteria/Location",value:i,type:n[0].type,data:n[0].value,dataLocation:t,isNot:n[0].isNot,isAnd:n.length>1,isOr:!n[0].isNot&&n.length===1};(u.isNot||u.isAnd)&&(u.value=n[0].name);e.push(u)}),e}function b(){return i.each(r.root,function(n){var i,r=[];for(i in n)i!=="name"&&i!=="type"&&i!=="value"&&i!=="isNot"&&i!=="isAnd"&&i!=="isOr"&&r.push(i);t.each(r,function(){delete n[this]})}),r.root}function k(n){var u=[];return(i.each(r.root,function(n){u.push(n)}),n!==undefined)?t.map(u,function(t){return t[n]}):u}function d(n){var t;r.root[n.selectedIndex].length>1?n.isAnd?i.move(r.root,n.selectedIndex,n.andWithIndex,f):i.extract(r.root,n.selectedIndex,0,n.isOr?e:o):(t=r.root[n.selectedIndex][0],n.isAnd?(t.isNot=!1,i.move(r.root,n.selectedIndex,n.andWithIndex)):t.isNot=n.isNot);u()}function g(n){for(var i=-1,t=0;t<r.root.length;t++)if(r.root[t][0].name==n.name){i=t;break}i>=0&&(r.root[i][0]=n)}function nt(n,t,u){return i.remove(r.root,n,t,u)}function tt(n){return n.type.toLowerCase()==="city"||n.type.toLowerCase()==="zip code"||n.type.toLowerCase()==="radius"}var r={root:[],BO_AND:"[AND] ",BO_NOT:"[NOT IN] "};n.mslequals=f;n.mslor=e;n.mslnot=o;n.searchLocation={find:v,getFlattenedLocations:k,getLocations:b,getRootItem:y,getItemsForBooleanDropDown:p,getItemsForSummary:w,supportsNearbySearch:tt,isBooleanSearchCompatible:a,addBoolean:c,addRoot:l,load:h,modifyBoolean:d,updateItem:g,remove:nt}})(window,this.jQuery,this.xt); 38(function(n,t,i){"use strict";function v(n){var i=[],t;for(i.push('<option value="">-- Select One --<\/option>'),t=0;t<n.model.length;t++)i.push('<option value="'+n.model[t].value+'">'+n.model[t].name+"<\/option>");n.container.html(i.join(""));n.selectedIndex!==-1&&n.container.find('[value^="'+n.selectedIndex+'"]').attr("selected","selected");n.container.selectpicker("refresh")}function a(){var n=f!==-1?i.getLocations()[f]:null,p=r!==null?r.name:n[0].name,u=!1,a=!1,y=!1;t(".bsm-removelocation").hide();t(".bsm-findnearby").hide();n?(u=n[0].isNot,a=!u&&n.length===1,y=n.length>1,t(".bsm-removelocation").show()):c.click();r!==null&&i.supportsNearbySearch(r)&&t(".bsm-findnearby").show();t(".boolean-location").html(p);v({container:l,model:i.getItemsForBooleanDropDown(f),selectedIndex:f});u&&o.click();a&&(e.click(),s.click());y&&(e.click(),h.click())}function y(){f=-1;r=null}function p(){var e={};o.is(":checked")?(e.isNot=!0,r&&(r.isNot=!0)):c.is(":checked")||s.is(":checked")?(e.isOr=!0,r&&(r.isOr=!0)):h.is(":checked")&&(e.isAnd=!0,r&&(r.isAnd=!0),e.andWithIndex=parseInt(l.val(),10));e.selectedIndex=f;e.enteredItem=r;r!==null?(e.name=r.name,e.type=r.type,e.value=r.value,e.BID=r.BID,i.addBoolean(e)):i.modifyBoolean(e);t(n.document).trigger("onbooleanlocationchange",[{item:r}]);u.modal("hide")}var f=-1,r=null,u,e,o,s,h,c,l;t(function(){u=t("#boolean-modal");e=u.find('[name="showPropertiesOption"][value="in"]');o=u.find('[name="showPropertiesOption"][value="not"]');l=t('[name="andLocation"]');s=u.find('[name="showPropertiesInOption"][value="in"]');h=u.find('[name="showPropertiesInOption"][value="and"]');c=t('[name="showPropertiesOption"][value="or"]');t("body").on("click","[data-location]",function(){var n=t(this);f=parseInt(n.attr("data-location"),10)}).on("click",".bsm-findnearby",function(){Search.OpenNearbyAreas(r.name,r.type,r.value);t("#NearbyAreasPopup").modal("show");u.modal("hide")}).on("click",".bsm-removelocation",function(){Search.NearbyAreasRemove(i.getL
38ocations()[f][0].name);u.modal("hide")});t(n).on("onshowsearchdialog",function(n,t){r=t.item;rbw.ui.ListingSearchVersion>=3&&a();u.modal("show")});u.on("hidemodal",y).on("showmodal",a).on("submitform",p)})})(window,this.jQuery,this.searchLocation); 39rbw.ui.InrixDriveTimeSearch=function(n){function a(){if(n.driveTimeContainer!=null){$(n.driveTimeContainer).empty();var t={"6:00":"6:00 AM","6:15":"6:15 AM","6:30":"6:30 AM","6:45":"6:45 AM","7:00":"7:00 AM","7:15":"7:15 AM","7:30":"7:30 AM","7:45":"7:45 AM","8:00":"8:00 AM","8:15":"8:15 AM","8:30":"8:30 AM","8:45":"8:45 AM","9:00":"9:00 AM","9:15":"9:15 AM","9:30":"9:30 AM","9:45":"9:45 AM","10:00":"10:00 AM","10:15":"10:15 AM","10:30":"10:30 AM","10:45":"10:45 AM","11:00":"11:00 AM","11:15":"11:15 AM","11:30":"11:30 AM","11:45":"11:45 AM","12:00":"12:00 PM","12:15":"12:15 PM","12:30":"12:30 PM","12:45":"12:45 PM","13:00":"1:00 PM","13:15":"1:15 PM","13:30":"1:30 PM","13:45":"1:45 PM","14:00":"2:00 PM","14:15":"2:15 PM","14:30":"2:30 PM","14:45":"2:45 PM","15:00":"3:00 PM","15:15":"3:15 PM","15:30":"3:30 PM","15:45":"3:45 PM","16:00":"4:00 PM","16:15":"4:15 PM","16:30":"4:30 PM","16:45":"4:45 PM","17:00":"5:00 PM","17:15":"5:15 PM","17:30":"5:30 PM","17:45":"5:45 PM","18:00":"6:00 PM","18:15":"6:15 PM","18:30":"6:30 PM","18:45":"6:45 PM","19:00":"7:00 PM","19:15":"7:15 PM","19:30":"7:30 PM","19:45":"7:45 PM","20:00":"8:00 PM","20:15":"8:15 PM","20:30":"8:30 PM","20:45":"8:45 PM","21:00":"9:00 PM","21:15":"9:15 PM","21:30":"9:30 PM","21:45":"9:45 PM","22:00":"10:00 PM","22:15":"10:15 PM","22:30":"10:30 PM","22:45":"10:45 PM","23:00":"11:00 PM","23:15":"11:15 PM","23:30":"11:30 PM","23:45":"11:45 PM","0:00":"12:00 AM","0:15":"12:15 AM","0:30":"12:30 AM","0:45":"12:45 AM"};for(key in t)t.hasOwnProperty(key)&&(key==="8:00"?$(n.driveTimeContainer).append('<option value="'+key+'" selected="selected">'+t[key]+"<\/option>"):$(n.driveTimeContainer).append('<option value="'+key+'">'+t[key]+"<\/option>"))}}function v(){if(n.durationContainer!=null){$(n.durationContainer).empty();var t={"5":"5 minutes","10":"10 minutes","15":"15 minutes","20":"20 minutes","25":"25 minutes","30":"30 minutes","35":"35 minutes","40":"40 minutes","45":"45 minutes","60":"60 minutes","70":"70 minutes","80":"80 minutes","90":"90 minutes"};for(key in t)t.hasOwnProperty(key)&&(key==="15"?$(n.durationContainer).append('<option value="'+key+'" selected="selected">'+t[key]+"<\/option>"):$(n.durationContainer).append('<option value="'+key+'">'+t[key]+"<\/option>"))}}function y(n,t,i){var r={StreetAddress1:n,CityName:t,ZipCode:i};$.ajax({type:"GET",url:rbw.serviceUrl+"?op=SaveLoginWorkAddress",data:r,dataType:"json",contentType:"application/json; charset=utf-8",error:function(n){rbw.utils.reportError(["Inrix failed saving address","File: "+window.location.href,"Data: "+JSON.stringify(n)])}})}function r(){$(n.alertContainer).find("div.alert").alert("close")}function t(t){$(n.alertContainer).children().length>0&&$(n.alertContainer).empty();$(n.alertContainer).append('<div class="alert alert-danger fade in"><strong>Error: <\/strong><span>'+t+"<\/span><\/div>")}function e(){if($(n.addressContainer).val().trim().length===0){t("Please enter a starting address");return}$.ajax({type:"GET",url:rbw.serviceUrl,data:"op=GetAddressCoordinatesWithQuality&address="+encodeURIComponent($(n.addressContainer).val()),dataType:"json",contentType:"application/json; charset=utf-8",success:function(i){var u,f;if(i!=null)if(i.IsSuccess!=null&&i.IsSuccess===!1&&i.ErrorMessages!=null&&i.ErrorMessages.length>0&&t(i.ErrorMessages[0].Value),u=i.Entity.split(","),f=parseInt(u[2]),f>85){r();var e=u[3],o=u[4],s=u[6];y(e,o,s);$(n.submitButton).trigger("submitData");typeof n.closeFilterBox!="undefined"&&n.closeFilterBox&&$(document).trigger("open-show-all-locations")}else t("Address not found. Please try again");else t("Server Error")},error:function(n){rbw.utils.reportError(["Inrix failed validating address","File: "+window.location.href,"Data: "+JSON.stringify(n)])}})}function p(){i=!1;$(n.submitButton).html(u);$(n.submitButton).removeClass("disabled");$(n.submitButton).prop("disabled",!1)}function w(){i=!0;$(n.submitButton).html("Searching...");$(n.submitButton).addClass("disabled");$(n.submitButton).prop("disabled",!0)}function b(){typeof rbw.storage.setSessionItem!="undefined"&&rbw.storage.setSessionItem("drivetime-search-input",JSON.stringify({address:$(n.addressContainer).val(),driveTime:$(n.driveTimeContainer).val(),duration:$(n.durationContainer).val(),rangeType:$("input[type='radio'][name='grp_rangetype']:checked",$(n.container)).val(),avoidToll:$(n.avoidToll).val()}))}function o(){var i,t;if(typeof rbw.storage.getSessionItem!="undefined"&&(i=rbw.storage.getSessionItem("drivetime-search-input"),i&&i.length))try{t=JSON.parse(i);$(n.addressContainer).val(t.address);$(n.driveTimeContainer).val(t.driveTime);$(n.durationContainer).val(t.duration);t.rangeType&&$("input[type='radio'][name='grp_rangetype'][value=' + input
39s.rangeType + ']",$(n.container)).prop("checked",!0);$(n.avoidToll).val(t.avoidToll)}catch(r){}}function s(){if(!i){w();b();var t=$("input[type='radio'][name='grp_rangetype']:checked",$(n.container)).val();window.Search.submitDriveTimeSearch($(n.addressContainer).val(),$(n.driveTimeContainer).val(),$(n.durationContainer).val(),t,$(n.avoidToll).val())}}function h(n){$(n.target).val().trim().length>0&&$(n.target).select()}function c(){if(n.requireLogin&&!rbw.context.isAuthenticated){if(typeof InrixDriveTimeUtility!="undefined"){InrixDriveTimeUtility.launchSearchFilters();return}CustomerLogin.signin()}}function k(t){var i=function(){$(this).next(".popover").find(".arrow").css("top","")},f=function(n){if(n.popover({content:n.data("content")||"Note: By Clicking Calculate Drive Time you will be replacing any previous location search",placement:n.data("placement")||"right",trigger:n.data("trigger")||"hover",title:n.attr("title")||"Drive Time Search"}),n.data("placement")==="bottom")n.off(".shown.bs.popover",i).on("shown.bs.popover",i)};if(t=typeof t=="undefined"?null:t,(t==null||t.alertContainer!==n.alertContainer)&&(t!=null&&t.alertContainer!=null&&$(t.alertContainer).off("click",r),n.alertContainer!=null))$(n.alertContainer).on("click",r);if((t==null||t.addressContainer!==n.addressContainer)&&(t!=null&&t.addressContainer!=null&&$(t.addressContainer).off("focus",c).off("click",h),n.addressContainer!=null))$(n.addressContainer).on("focus",c).on("click",h);if((t==null||t.submitButton!==n.submitButton)&&(t!=null&&t.submitButton!=null&&$(t.submitButton).off("click",e).off("submitData",s).popover("disable"),n.submitButton!=null)){$(n.submitButton).on("click",e).on("submitData",s);n.showPopoverFromAddressInput&&f($(n.submitButton));u=$(n.submitButton).html()}(t==null||t.showPopoverFromAddressInput!==n.showPopoverFromAddressInput)&&(n.showPopoverFromAddressInput?f($(n.submitButton)):$(n.submitButton).popover("disable"))}function d(){$(window.document).on("searchlocationloaded",function(){var i=searchLocation.getLocations(),t;if(i!=null&&i.length===1&&(t=i[0][0],t.type==="drivetime")){n.defaultAddress!=null&&(t.name!==n.defaultAddress?$(n.addressContainer).val(t.name):$(n.addressContainer).val(n.defaultAddress));$(f).trigger("drivetime-active");return}n.defaultAddress!=null&&$(n.addressContainer).val(n.defaultAddress)});$("#mapsearch-mainmap").on("drivetime-shapedrawn",function(){p()});$(document).on("loginupdate",function(t,i){i.isLoggedIn&&$.ajax({url:"/include/ajax/api.aspx?op=GetLoginWorkAddress",type:"POST",success:function(t){$(n.addressContainer).val(t)}})}).on("toggled-form-filters",o)}function g(){f.setOptions(n,l);d();a();v();o()}var u="Search",i=!1,f=this,l={requireLogin:!0,showPopoverFromAddressInput
vendor: 251,915 bytes, lines 39-53
39:!0,alertContainer:null,driveTimeContainer:null,addressContainer:null,defaultAddress:null,submitButton:null,container:"#mapsearch-drivetime"};this.setOptions=function(t,i){if(t){if(i=typeof i=="undefined"?n:i,n=$.extend({},i,t),n.addressContainer==null||n.driveTimeContainer==null||n.durationContainer==null)return rbw.utils.reportError(["Inrix initialization failed, containers are null","File: "+window.location.href,"Options: "+JSON.stringify(n)]),!1;k(i)}return!0};g()}; 40/*! 41 * Chart.js v4.5.1 42 * https://www.chartjs.org 43 * (c) 2025 Chart.js Contributors 44 * Released under the MIT License 45 */ 46!function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).Chart = e() }(this, (function () { 47 "use strict"; var t = Object.freeze({ __proto__: null, get Colors() { return Jo }, get Decimation() { return ta }, get Filler() { return ba }, get Legend() { return Ma }, get SubTitle() { return Pa }, get Title() { return ka }, get Tooltip() { return Na } }); function e() { } const i = (() => { let t = 0; return () => t++ })(); function s(t) { return null == t } function n(t) { if (Array.isArray && Array.isArray(t)) return !0; const e = Object.prototype.toString.call(t); return "[object" === e.slice(0, 7) && "Array]" === e.slice(-6) } function o(t) { return null !== t && "[object Object]" === Object.prototype.toString.call(t) } function a(t) { return ("number" == typeof t || t instanceof Number) && isFinite(+t) } function r(t, e) { return a(t) ? t : e } function l(t, e) { return void 0 === t ? e : t } const h = (t, e) => "string" == typeof t && t.endsWith("%") ? parseFloat(t) / 100 : +t / e, c = (t, e) => "string" == typeof t && t.endsWith("%") ? parseFloat(t) / 100 * e : +t; function d(t, e, i) { if (t && "function" == typeof t.call) return t.apply(i, e) } function u(t, e, i, s) { let a, r, l; if (n(t)) if (r = t.length, s) for (a = r - 1; a >= 0; a--)e.call(i, t[a], a); else for (a = 0; a < r; a++)e.call(i, t[a], a); else if (o(t)) for (l = Object.keys(t), r = l.length, a = 0; a < r; a++)e.call(i, t[l[a]], l[a]) } function f(t, e) { let i, s, n, o; if (!t || !e || t.length !== e.length) return !1; for (i = 0, s = t.length; i < s; ++i)if (n = t[i], o = e[i], n.datasetIndex !== o.datasetIndex || n.index !== o.index) return !1; return !0 } function g(t) { if (n(t)) return t.map(g); if (o(t)) { const e = Object.create(null), i = Object.keys(t), s = i.length; let n = 0; for (; n < s; ++n)e[i[n]] = g(t[i[n]]); return e } return t } function p(t) { return -1 === ["__proto__", "prototype", "constructor"].indexOf(t) } function m(t, e, i, s) { if (!p(t)) return; const n = e[t], a = i[t]; o(n) && o(a) ? x(n, a, s) : e[t] = g(a) } function x(t, e, i) { const s = n(e) ? e : [e], a = s.length; if (!o(t)) return t; const r = (i = i || {}).merger || m; let l; for (let e = 0; e < a; ++e) { if (l = s[e], !o(l)) continue; const n = Object.keys(l); for (let e = 0, s = n.length; e < s; ++e)r(n[e], t, l, i) } return t } function b(t, e) { return x(t, e, { merger: _ }) } function _(t, e, i) { if (!p(t)) return; const s = e[t], n = i[t]; o(s) && o(n) ? b(s, n) : Object.prototype.hasOwnProperty.call(e, t) || (e[t] = g(n)) } const y = { "": t => t, x: t => t.x, y: t => t.y }; function v(t) { const e = t.split("."), i = []; let s = ""; for (const t of e) s += t, s.endsWith("\\") ? s = s.slice(0, -1) + "." : (i.push(s), s = ""); return i } function M(t, e) { const i = y[e] || (y[e] = function (t) { const e = v(t); return t => { for (const i of e) { if ("" === i) break; t = t && t[i] } return t } }(e)); return i(t) } function w(t) { return t.charAt(0).toUpperCase() + t.slice(1) } const k = t => void 0 !== t, S = t => "function" == typeof t, P = (t, e) => { if (t.size !== e.size) return !1; for (const i of t) if (!e.has(i)) return !1; return !0 }; function D(t) { return "mouseup" === t.type || "click" === t.type || "contextmenu" === t.type } const C = Math.PI, O = 2 * C, A = O + C, T = Number.POSITIVE_INFINITY, L = C / 180, E = C / 2, R = C / 4, I = 2 * C / 3, z = Math.log10, F = Math.sign; function V(t, e, i) { return Math.abs(t - e) < i } function B(t) { const e = Math.round(t); t = V(t, e, t / 1e3) ? e : t; const i = Math.pow(10, Math.floor(z(t))), s = t / i; return (s <= 1 ? 1 : s <= 2 ? 2 : s <= 5 ? 5 : 10) * i } function W(t) { const e = [], i = Math.sqrt(t); let s; for (s = 1; s < i; s++)t % s == 0 && (e.push(s), e.push(t / s)); return i === (0 | i) && e.push(i), e.sort(((t, e) => t - e)).pop(), e } function N(t) { return !function (t) { return "symbol" == typeof t || "object" == typeof t && null !== t && !(Symbol.toPrimitive in t || "toString" in t || "valueOf" in t) }(t) && !isNaN(parseFloat(t)) && isFinite(t) } function H(t, e) { const i = Math.round(t); return i - e <= t && i + e >= t } function j(t, e, i) { let s, n, o; for (s = 0, n = t.length; s < n; s++)o = t[s][i], isNaN(o) || (e.min = Math.min(e.min, o), e.max = Math.max(e.max, o)) } function $(t) { return t * (C / 180) } function Y(t) { return t * (180 / C) } function U(t) { if (!a(t)) return; let e = 1, i = 0; for (; Math.round(t * e) / e !== t;)e *= 10, i++; return i } function X(t, e) { const i = e.x - t.x, s = e.y - t.y, n = Math.sqrt(i * i + s * s); let o = Math.atan2(s, i); return o < -.5 * C && (o += O), { angle: o, distance: n } } function q(t, e) { return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)) } function K(t, e) { return (t - e + A) % O - C } function G(t) { return (t % O + O) % O } function J(t, e, i, s) { const n = G(t), o = G(e), a = G(i), r = G(o - n), l = G(a - n), h = G(n - o), c = G(n - a); return n === o || n === a || s && o === a || r > l && h < c } function Z(t, e, i) { return Math.max(e, Math.min(i, t)) } function Q(t) { return Z(t, -32768, 32767) } function tt(t, e, i, s = 1e-6) { return t >= Math.min(e, i) - s && t <= Math.max(e, i) + s } function et(t, e, i) { i = i || (i => t[i] < e); let s, n = t.length - 1, o = 0; for (; n - o > 1;)s = o + n >> 1, i(s) ? o = s : n = s; return { lo: o, hi: n } } const it = (t, e, i, s) => et(t, i, s ? s => { const n = t[s][e]; return n < i || n === i && t[s + 1][e] === i } : s => t[s][e] < i), st = (t, e, i) => et(t, i, (s => t[s][e] >= i)); function nt(t, e, i) { let s = 0, n = t.length; for (; s < n && t[s] < e;)s++; for (; n > s && t[n - 1] > i;)n--; return s > 0 || n < t.length ? t.slice(s, n) : t } const ot = ["push", "pop", "shift", "splice", "unshift"]; function at(t, e) { t._chartjs ? t._chartjs.listeners.push(e) : (Object.defineProperty(t, "_chartjs", { configurable: !0, enumerable: !1, value: { listeners: [e] } }), ot.forEach((e => { const i = "_onData" + w(e), s = t[e]; Object.defineProperty(t, e, { configurable: !0, enumerable: !1, value(...e) { const n = s.apply(this, e); return t._chartjs.listeners.forEach((t => { "function" == typeof t[i] && t[i](...e) })), n } }) }))) } function rt(t, e) { const i = t._chartjs; if (!i) return; const s = i.listeners, n = s.indexOf(e); -1 !== n && s.splice(n, 1), s.length > 0 || (ot.forEach((e => { delete t[e] })), delete t._chartjs) } function lt(t) { const e = new Set(t); return e.size === t.length ? t : Array.from(e) } const ht = "undefined" == typeof window ? function (t) { return t() } : window.requestAnimationFrame; function ct(t, e) { let i = [], s = !1; return function (...n) { i = n, s || (s = !0, ht.call(window, (() => { s = !1, t.apply(e, i) }))) } } function dt(t, e) { let i; return function (...s) { return e ? (clearTimeout(i), i = setTimeout(t, e, s)) : t.apply(this, s), e } } const ut = t => "start" === t ? "left" : "end" === t ? "right" : "center", ft = (t, e, i) => "start" === t ? e : "end" === t ? i : (e + i) / 2, gt = (t, e, i, s) => t === (s ? "left" : "right") ? i : "center" === t ? (e + i) / 2 : e; function pt(t, e, i) { const n = e.length; let o = 0, a = n; if (t._sorted) { const { iScale: r, vScale: l, _parsed: h } = t, c = t.dataset && t.dataset.options ? t.dataset.options.spanGaps : null, d = r.axis, { min: u, max: f, minDefined: g, maxDefined: p } = r.getUserBounds(); if (g) { if (o = Math.min(it(h, d, u).lo, i ? n : it(e, d, r.getPixelForValue(u)).lo), c) { const t = h.slice(0, o + 1).reverse().findIndex((t => !s(t[l.axis]))); o -= Math.max(0, t) } o = Z(o, 0, n - 1) } if (p) { let t = Math.max(it(h, r.axis, f, !0).hi + 1, i ? 0 : it(e, d, r.getPixelForValue(f), !0).hi + 1); if (c) { const e = h.slice(t - 1).findIndex((t => !s(t[l.axis]))); t += Math.max(0, e) } a = Z(t, o, n) - o } else a = n - o } return { start: o, count: a } } function mt(t) { const { xScale: e, yScale: i, _scaleRanges: s } = t, n = { xmin: e.min, xmax: e.max, ymin: i.min, ymax: i.max }; if (!s) return t._scaleRanges = n, !0; const o = s.xmin !== e.min || s.xmax !== e.max || s.ymin !== i.min || s.ymax !== i.max; return Object.assign(s, n), o } class xt { constructor() { this._request = null, this._charts = new Map, this._running = !1, this._lastDate = void 0 } _notify(t, e, i, s) { const n = e.listeners[s], o = e.duration; n.forEach((s => s({ chart: t, initial: e.initial, numSteps: o, currentStep: Math.min(i - e.start, o) }))) } _refresh() { this._request || (this._running = !0, this._request = ht.call(window, (() => { this._update(), this._request = null, this._running && this._refresh() }))) } _update(t = Date.now()) { let e = 0; this._charts.forEach(((i, s) => { if (!i.running || !i.items.length) return; const n = i.items; let o, a = n.length - 1, r = !1; for (; a >= 0; --a)o = n[a], o._active ? (o._total > i.duration && (i.duration = o._total), o.tick(t), r = !0) : (n[a] = n[n.length - 1], n.pop()); r && (s.draw(), this._notify(s, i, t, "progress")), n.length || (i.running = !1, this._notify(s, i, t, "complete"), i.initial = !1), e += n.length })), this._lastDate = t, 0 === e && (this._running = !1) } _getAnims(t) { const e = this._charts; let i = e.get(t); return i || (i = { running: !1, initial: !0, items: [], listeners: { complete: [], progress: [] } }, e.set(t, i)), i } listen(t, e, i) { this._getAnims(t).listeners[e].push(i) } add(t, e) { e && e.length && this._getAnims(t).items.push(...e) } has(t) { return this._getAnims(t).items.length > 0 } start(t) { const e = this._charts.get(t); e && (e.running = !0, e.start = Date.now(), e.duration = e.items.reduce(((t, e) => Math.max(t, e._duration)), 0), this._refresh()) } running(t) { if (!this._running) return !1; const e = this._charts.get(t); return !!(e && e.running && e.items.length) } stop(t) { const e = this._charts.get(t); if (!e || !e.items.length) return; const i = e.items; let s = i.length - 1; for (; s >= 0; --s)i[s].cancel(); e.items = [], this._notify(t, e, Date.now(), "complete") } remove(t) { return this._charts.delete(t) } } var bt = new xt; 48/*! 49 * @kurkle/color v0.3.2 50 * https://github.com/kurkle/color#readme 51 * (c) 2023 Jukka Kurkela 52 * Released under the MIT License 53 */function _t(t) { return t + .5 | 0 } const yt = (t, e, i) => Math.max(Math.min(t, i), e); function vt(t) { return yt(_t(2.55 * t), 0, 255) } function Mt(t) { return yt(_t(255 * t), 0, 255) } function wt(t) { return yt(_t(t / 2.55) / 100, 0, 1) } function kt(t) { return yt(_t(100 * t), 0, 100) } const St = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 }, Pt = [..."0123456789ABCDEF"], Dt = t => Pt[15 & t], Ct = t => Pt[(240 & t) >> 4] + Pt[15 & t], Ot = t => (240 & t) >> 4 == (15 & t); function At(t) { var e = (t => Ot(t.r) && Ot(t.g) && Ot(t.b) && Ot(t.a))(t) ? Dt : Ct; return t ? "#" + e(t.r) + e(t.g) + e(t.b) + ((t, e) => t < 255 ? e(t) : "")(t.a, e) : void 0 } const Tt = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/; function Lt(t, e, i) { const s = e * Math.min(i, 1 - i), n = (e, n = (e + t / 30) % 12) => i - s * Math.max(Math.min(n - 3, 9 - n, 1), -1); return [n(0), n(8), n(4)] } function Et(t, e, i) { const s = (s, n = (s + t / 60) % 6) => i - i * e * Math.max(Math.min(n, 4 - n, 1), 0); return [s(5), s(3), s(1)] } function Rt(t, e, i) { const s = Lt(t, 1, .5); let n; for (e + i > 1 && (n = 1 / (e + i), e *= n, i *= n), n = 0; n < 3; n++)s[n] *= 1 - e - i, s[n] += e; return s } function It(t) { const e = t.r / 255, i = t.g / 255, s = t.b / 255, n = Math.max(e, i, s), o = Math.min(e, i, s), a = (n + o) / 2; let r, l, h; return n !== o && (h = n - o, l = a > .5 ? h / (2 - n - o) : h / (n + o), r = function (t, e, i, s, n) { return t === n ? (e - i) / s + (e < i ? 6 : 0) : e === n ? (i - t) / s + 2 : (t - e) / s + 4 }(e, i, s, h, n), r = 60 * r + .5), [0 | r, l || 0, a] } function zt(t, e, i, s) { return (Array.isArray(e) ? t(e[0], e[1], e[2]) : t(e, i, s)).map(Mt) } function Ft(t, e, i) { return zt(Lt, t, e, i) } function Vt(t) { return (t % 360 + 360) % 360 } function Bt(t) { const e = Tt.exec(t); let i, s = 255; if (!e) return; e[5] !== i && (s = e[6] ? vt(+e[5]) : Mt(+e[5])); const n = Vt(+e[2]), o = +e[3] / 100, a = +e[4] / 100; return i = "hwb" === e[1] ? function (t, e, i) { return zt(Rt, t, e, i) }(n, o, a) : "hsv" === e[1] ? function (t, e, i) { return zt(Et, t, e, i) }(n, o, a) : Ft(n, o, a), { r: i[0], g: i[1], b: i[2], a: s } } const Wt = { x: "dark", Z: "light", Y: "re", X: "blu", W: "gr", V: "medium", U: "slate", A: "ee", T: "ol", S: "or", B: "ra", C: "lateg", D: "ights", R: "in", Q: "turquois", E: "hi", P: "ro", O: "al", N: "le", M: "de", L: "yello", F: "en", K: "ch", G: "arks", H: "ea", I: "ightg", J: "wh" }, Nt = { OiceXe: "f0f8ff", antiquewEte: "faebd7", aqua: "ffff", aquamarRe: "7fffd4", azuY: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "0", blanKedOmond: "ffebcd", Xe: "ff", XeviTet: "8a2be2", bPwn: "a52a2a", burlywood: "deb887", caMtXe: "5f9ea0", KartYuse: "7fff00", KocTate: "d2691e", cSO: "ff7f50", cSnflowerXe: "6495ed", cSnsilk: "fff8dc", crimson: "dc143c", cyan: "ffff", xXe: "8b", xcyan: "8b8b", xgTMnPd: "b8860b", xWay: "a9a9a9", xgYF: "6400", xgYy: "a9a9a9", xkhaki: "bdb76b", xmagFta: "8b008b", xTivegYF: "556b2f", xSange: "ff8c00", xScEd: "9932cc", xYd: "8b0000", xsOmon: "e9967a", xsHgYF: "8fbc8f", xUXe: "483d8b", xUWay: "2f4f4f", xUgYy: "2f4f4f", xQe: "ced1", xviTet: "9400d3", dAppRk: "ff1493", dApskyXe: "bfff", dimWay: "696969", dimgYy: "696969", dodgerXe: "1e90ff", fiYbrick: "b22222", flSOwEte: "fffaf0", foYstWAn: "228b22", fuKsia: "ff00ff", gaRsbSo: "dcdcdc", ghostwEte: "f8f8ff", gTd: "ffd700", gTMnPd: "daa520", Way: "808080", gYF: "8000", gYFLw: "adff2f", gYy: "808080", honeyMw: "f0fff0", hotpRk: "ff69b4", RdianYd: "cd5c5c", Rdigo: "4b0082", ivSy: "fffff0", khaki: "f0e68c", lavFMr: "e6e6fa", lavFMrXsh: "fff0f5", lawngYF: "7cfc00", NmoncEffon: "fffacd", ZXe: "add8e6", ZcSO: "f08080", Zcyan: "e0ffff", ZgTMnPdLw: "fafad2", ZWay: "d3d3d3", ZgYF: "90ee90", ZgYy: "d3d3d3", ZpRk: "ffb6c1", ZsOmon: "ffa07a", ZsHgYF: "20b2aa", ZskyXe: "87cefa", ZUWay: "778899", ZUgYy: "778899", ZstAlXe: "b0c4de", ZLw: "ffffe0", lime: "ff00", limegYF: "32cd32", lRF: "faf0e6", magFta: "ff00ff", maPon: "800000", VaquamarRe: "66cdaa", VXe: "cd", VScEd: "ba55d3", VpurpN: "9370db", VsHgYF: "3cb371", VUXe: "7b68ee", VsprRggYF: "fa9a", VQe: "48d1cc", VviTetYd: "c71585", midnightXe: "191970", mRtcYam: "f5fffa", mistyPse: "ffe4e1", moccasR: "ffe4b5", navajowEte: "ffdead", navy: "80", Tdlace: "fdf5e6", Tive: "808000", TivedBb: "6b8e23", Sange: "ffa500", SangeYd: "ff4500", ScEd: "da70d6", pOegTMnPd: "eee8aa", pOegYF: "98fb98", pOeQe: "afeeee", pOeviTetYd: "db7093", papayawEp: "ffefd5", pHKpuff: "ffdab9", peru: "cd853f", pRk: "ffc0cb", plum: "dda0dd", powMrXe: "b0e0e6", purpN: "800080", YbeccapurpN: "663399", Yd: "ff0000", Psybrown: "bc8f8f", PyOXe: "4169e1", saddNbPwn: "8b4513", sOmon: "fa8072", sandybPwn: "f4a460", sHgYF: "2e8b57", sHshell: "fff5ee", siFna: "a0522d", silver: "c0c0c0", skyXe: "87ceeb", UXe: "6a5acd", UWay: "708090", UgYy: "708090", snow: "fffafa", sprRggYF: "ff7f", stAlXe: "4682b4", tan: "d2b48c", teO: "8080", tEstN: "d8bfd8", tomato: "ff6347", Qe: "40e0d0", viTet: "ee82ee", JHt: "f5deb3", wEte: "ffffff", wEtesmoke: "f5f5f5", Lw: "ffff00", LwgYF: "9acd32" }; let Ht; function jt(t) { Ht || (Ht = function () { const t = {}, e = Object.keys(Nt), i = Object.keys(Wt); let s, n, o, a, r; for (s = 0; s < e.length; s++) { for (a = r = e[s], n = 0; n < i.length; n++)o = i[n], r = r.replace(o, Wt[o]); o = parseInt(Nt[a], 16), t[r] = [o >> 16 & 255, o >> 8 & 255, 255 & o] } return t }(), Ht.transparent = [0, 0, 0, 0]); const e = Ht[t.toLowerCase()]; return e && { r: e[0], g: e[1], b: e[2], a: 4 === e.length ? e[3] : 255 } } const $t = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/; const Yt = t => t <= .0031308 ? 12.92 * t : 1.055 * Math.pow(t, 1 / 2.4) - .055, Ut = t => t <= .04045 ? t / 12.92 : Math.pow((t + .055) / 1.055, 2.4); function Xt(t, e, i) { if (t) { let s = It(t); s[e] = Math.max(0, Math.min(s[e] + s[e] * i, 0 === e ? 360 : 1)), s = Ft(s), t.r = s[0], t.g = s[1], t.b = s[2] } } function qt(t, e) { return t ? Object.assign(e || {}, t) : t } function Kt(t) { var e = { r: 0, g: 0, b: 0, a: 255 }; return Array.isArray(t) ? t.length >= 3 && (e = { r: t[0], g: t[1], b: t[2], a: 255 }, t.length > 3 && (e.a = Mt(t[3]))) : (e = qt(t, { r: 0, g: 0, b: 0, a: 1 })).a = Mt(e.a), e } function Gt(t) { return "r" === t.charAt(0) ? function (t) { const e = $t.exec(t); let i, s, n, o = 255; if (e) { if (e[7] !== i) { const t = +e[7]; o = e[8] ? vt(t) : yt(255 * t, 0, 255) } return i = +e[1], s = +e[3], n = +e[5], i = 255 & (e[2] ? vt(i) : yt(i, 0, 255)), s = 255 & (e[4] ? vt(s) : yt(s, 0, 255)), n = 255 & (e[6] ? vt(n) : yt(n, 0, 255)), { r: i, g: s, b: n, a: o } } }(t) : Bt(t) } class Jt { constructor(t) { if (t instanceof Jt) return t; const e = typeof t; let i; var s, n, o; "object" === e ? i = Kt(t) : "string" === e && (o = (s = t).length, "#" === s[0] && (4 === o || 5 === o ? n = { r: 255 & 17 * St[s[1]], g: 255 & 17 * St[s[2]], b: 255 & 17 * St[s[3]], a: 5 === o ? 17 * St[s[4]] : 255 } : 7 !== o && 9 !== o || (n = { r: St[s[1]] << 4 | St[s[2]], g: St[s[3]] << 4 | St[s[4]], b: St[s[5]] << 4 | St[s[6]], a: 9 === o ? St[s[7]] << 4 | St[s[8]] : 255 })), i = n || jt(t) || Gt(t)), this._rgb = i, this._valid = !!i } get valid() { return this._valid } get rgb() { var t = qt(this._rgb); return t && (t.a = wt(t.a)), t } set rgb(t) { this._rgb = Kt(t) } rgbString() { return this._valid ? (t = this._rgb) && (t.a < 255 ? `rgba(${t.r}, ${t.g}, ${t.b}, ${wt(t.a)})` : `rgb(${t.r}, ${t.g}, ${t.b})`) : void 0; var t } hexString() { return this._valid ? At(this._rgb) : void 0 } hslString() { return this._valid ? function (t) { if (!t) return; const e = It(t), i = e[0], s = kt(e[1]), n = kt(e[2]); return t.a < 255 ? `hsla(${i}, ${s}%, ${n}%, ${wt(t.a)})` : `hsl(${i}, ${s}%, ${n}%)` }(this._rgb) : void 0 } mix(t, e) { if (t) { const i = this.rgb, s = t.rgb; let n; const o = e === n ? .5 : e, a = 2 * o - 1, r = i.a - s.a, l = ((a * r == -1 ? a : (a + r) / (1 + a * r)) + 1) / 2; n = 1 - l, i.r = 255 & l * i.r + n * s.r + .5, i.g = 255 & l * i.g + n * s.g + .5, i.b = 255 & l * i.b + n * s.b + .5, i.a = o * i.a + (1 - o) * s.a, this.rgb = i } return this } interpolate(t, e) { return t && (this._rgb = function (t, e, i) { const s = Ut(wt(t.r)), n = Ut(wt(t.g)), o = Ut(wt(t.b)); return { r: Mt(Yt(s + i * (Ut(wt(e.r)) - s))), g: Mt(Yt(n + i * (Ut(wt(e.g)) - n))), b: Mt(Yt(o + i * (Ut(wt(e.b)) - o))), a: t.a + i * (e.a - t.a) } }(this._rgb, t._rgb, e)), this } clone() { return new Jt(this.rgb) } alpha(t) { return this._rgb.a = Mt(t), this } clearer(t) { return this._rgb.a *= 1 - t, this } greyscale() { const t = this._rgb, e = _t(.3 * t.r + .59 * t.g + .11 * t.b); return t.r = t.g = t.b = e, this } opaquer(t) { return this._rgb.a *= 1 + t, this } negate() { const t = this._rgb; return t.r = 255 - t.r, t.g = 255 - t.g, t.b = 255 - t.b, this } lighten(t) { return Xt(this._rgb, 2, t), this } darken(t) { return Xt(this._rgb, 2, -t), this } saturate(t) { return Xt(this._rgb, 1, t), this } desaturate(t) { return Xt(this._rgb, 1, -t), this } rotate(t) { return function (t, e) { var i = It(t); i[0] = Vt(i[0] + e), i = Ft(i), t.r = i[0], t.g = i[1], t.b = i[2] }(this._rgb, t), this } } function Zt(t) { if (t && "object" == typeof t) { const e = t.toString(); return "[object CanvasPattern]" === e || "[object CanvasGradient]" === e } return !1 } function Qt(t) { return Zt(t) ? t : new Jt(t) } function te(t) { return Zt(t) ? t : new Jt(t).saturate(.5).darken(.1).hexString() } const ee = ["x", "y", "borderWidth", "radius", "tension"], ie = ["color", "borderColor", "backgroundColor"]; const se = new Map; function ne(t, e, i) { return function (t, e) { e = e || {}; const i = t + JSON.stringify(e); let s = se.get(i); return s || (s = new Intl.NumberFormat(t, e), se.set(i, s)), s }(e, i).format(t) } const oe = { values: t => n(t) ? t : "" + t, numeric(t, e, i) { if (0 === t) return "0"; const s = this.chart.options.locale; let n, o = t; if (i.length > 1) { const e = Math.max(Math.abs(i[0].value), Math.abs(i[i.length - 1].value)); (e < 1e-4 || e > 1e15) && (n = "scientific"), o = function (t, e) { let i = e.length > 3 ? e[2].value - e[1].value : e[1].value - e[0].value; Math.abs(i) >= 1 && t !== Math.floor(t) && (i = t - Math.floor(t)); return i }(t, i) } const a = z(Math.abs(o)), r = isNaN(a) ? 1 : Math.max(Math.min(-1 * Math.floor(a), 20), 0), l = { notation: n, minimumFractionDigits: r, maximumFractionDigits: r }; return Object.assign(l, this.options.ticks.format), ne(t, s, l) }, logarithmic(t, e, i) { if (0 === t) return "0"; const s = i[e].significand || t / Math.pow(10, Math.floor(z(t))); return [1, 2, 3, 5, 10, 15].includes(s) || e > .8 * i.length ? oe.numeric.call(this, t, e, i) : "" } }; var ae = { formatters: oe }; const re = Object.create(null), le = Object.create(null); function he(t, e) { if (!e) return t; const i = e.split("."); for (let e = 0, s = i.length; e < s; ++e) { const s = i[e]; t = t[s] || (t[s] = Object.create(null)) } return t } function ce(t, e, i) { return "string" == typeof e ? x(he(t, e), i) : x(he(t, ""), e) } class de { constructor(t, e) { this.animation = void 0, this.backgroundColor = "rgba(0,0,0,0.1)", this.borderColor = "rgba(0,0,0,0.1)", this.color = "#666", this.datasets = {}, this.devicePixelRatio = t => t.chart.platform.getDevicePixelRatio(), this.elements = {}, this.events = ["mousemove", "mouseout", "click", "touchstart", "touchmove"], this.font = { family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", size: 12, style: "normal", lineHeight: 1.2, weight: null }, this.hover = {}, this.hoverBackgroundColor = (t, e) => te(e.backgroundColor), this.hoverBorderColor = (t, e) => te(e.borderColor), this.hoverColor = (t, e) => te(e.color), this.indexAxis = "x", this.interaction = { mode: "nearest", intersect: !0, includeInvisible: !1 }, this.maintainAspectRatio = !0, this.onHover = null, this.onClick = null, this.parsing = !0, this.plugins = {}, this.responsive = !0, this.scale = void 0, this.scales = {}, this.showLine = !0, this.drawActiveElementsOnTop = !0, this.describe(t), this.apply(e) } set(t, e) { return ce(this, t, e) } get(t) { return he(this, t) } describe(t, e) { return ce(le, t, e) } override(t, e) { return ce(re, t, e) } route(t, e, i, s) { const n = he(this, t), a = he(this, i), r = "_" + e; Object.defineProperties(n, { [r]: { value: n[e], writable: !0 }, [e]: { enumerable: !0, get() { const t = this[r], e = a[s]; return o(t) ? Object.assign({}, e, t) : l(t, e) }, set(t) { this[r] = t } } }) } apply(t) { t.forEach((t => t(this))) } } var ue = new de({ _scriptable: t => !t.startsWith("on"), _indexable: t => "events" !== t, hover: { _fallback: "interaction" }, interaction: { _scriptable: !1, _indexable: !1 } }, [function (t) { t.set("animation", { delay: void 0, duration: 1e3, easing: "easeOutQuart", fn: void 0, from: void 0, loop: void 0, to: void 0, type: void 0 }), t.describe("animation", { _fallback: !1, _indexable: !1, _scriptable: t => "onProgress" !== t && "onComplete" !== t && "fn" !== t }), t.set("animations", { colors: { type: "color", properties: ie }, numbers: { type: "number", properties: ee } }), t.describe("animations", { _fallback: "animation" }), t.set("transitions", { active: { animation: { duration: 400 } }, resize: { animation: { duration: 0 } }, show: { animations: { colors: { from: "transparent" }, visible: { type: "boolean", duration: 0 } } }, hide: { animations: { colors: { to: "transparent" }, visible: { type: "boolean", easing: "linear", fn: t => 0 | t } } } }) }, function (t) { t.set("layout", { autoPadding: !0, padding: { top: 0, right: 0, bottom: 0, left: 0 } }) }, function (t) { t.set("scale", { display: !0, offset: !1, reverse: !1, beginAtZero: !1, bounds: "ticks", clip: !0, grace: 0, grid: { display: !0, lineWidth: 1, drawOnChartArea: !0, drawTicks: !0, tickLength: 8, tickWidth: (t, e) => e.lineWidth, tickColor: (t, e) => e.color, offset: !1 }, border: { display: !0, dash: [], dashOffset: 0, width: 1 }, title: { display: !1, text: "", padding: { top: 4, bottom: 4 } }, ticks: { minRotation: 0, maxRotation: 50, mirror: !1, textStrokeWidth: 0, textStrokeColor: "", padding: 3, display: !0, autoSkip: !0, autoSkipPadding: 3, labelOffset: 0, callback: ae.formatters.values, minor: {}, major: {}, align: "center", crossAlign: "near", showLabelBackdrop: !1, backdropColor: "rgba(255, 255, 255, 0.75)", backdropPadding: 2 } }), t.route("scale.ticks", "color", "", "color"), t.route("scale.grid", "color", "", "borderColor"), t.route("scale.border", "color", "", "borderColor"), t.route("scale.title", "color", "", "color"), t.describe("scale", { _fallback: !1, _scriptable: t => !t.startsWith("before") && !t.startsWith("after") && "callback" !== t && "parser" !== t, _indexable: t => "borderDash" !== t && "tickBorderDash" !== t && "dash" !== t }), t.describe("scales", { _fallback: "scale" }), t.describe("scale.ticks", { _scriptable: t => "backdropPadding" !== t && "callback" !== t, _indexable: t => "backdropPadding" !== t }) }]); function fe() { return "undefined" != typeof window && "undefined" != typeof document } function ge(t) { let e = t.parentNode; return e && "[object ShadowRoot]" === e.toString() && (e = e.host), e } function pe(t, e, i) { let s; return "string" == typeof t ? (s = parseInt(t, 10), -1 !== t.indexOf("%") && (s = s / 100 * e.parentNode[i])) : s = t, s } const me = t => t.ownerDocument.defaultView.getComputedStyle(t, null); function xe(t, e) { return me(t).getPropertyValue(e) } const be = ["top", "right", "bottom", "left"]; function _e(t, e, i) { const s = {}; i = i ? "-" + i : ""; for (let n = 0; n < 4; n++) { const o = be[n]; s[o] = parseFloat(t[e + "-" + o + i]) || 0 } return s.width = s.left + s.right, s.height = s.top + s.bottom, s } const ye = (t, e, i) => (t > 0 || e > 0) && (!i || !i.shadowRoot); function ve(t, e) { if ("native" in t) return t; const { canvas: i, currentDevicePixelRatio: s } = e, n = me(i), o = "border-box" === n.boxSizing, a = _e(n, "padding"), r = _e(n, "border", "width"), { x: l, y: h, box: c } = function (t, e) { const i = t.touches, s = i && i.length ? i[0] : t, { offsetX: n, offsetY: o } = s; let a, r, l = !1; if (ye(n, o, t.target)) a = n, r = o; else { const t = e.getBoundingClientRect(); a = s.clientX - t.left, r = s.clientY - t.top, l = !0 } return { x: a, y: r, box: l } }(t, i), d = a.left + (c && r.left), u = a.top + (c && r.top); let { width: f, height: g } = e; return o && (f -= a.width + r.width, g -= a.height + r.height), { x: Math.round((l - d) / f * i.width / s), y: Math.round((h - u) / g * i.height / s) } } const Me = t => Math.round(10 * t) / 10; function we(t, e, i, s) { const n = me(t), o = _e(n, "margin"), a = pe(n.maxWidth, t, "clientWidth") || T, r = pe(n.maxHeight, t, "clientHeight") || T, l = function (t, e, i) { let s, n; if (void 0 === e || void 0 === i) { const o = t && ge(t); if (o) { const t = o.getBoundingClientRect(), a = me(o), r = _e(a, "border", "width"), l = _e(a, "padding"); e = t.width - l.width - r.width, i = t.height - l.height - r.height, s = pe(a.maxWidth, o, "clientWidth"), n = pe(a.maxHeight, o, "clientHeight") } else e = t.clientWidth, i = t.clientHeight } return { width: e, height: i, maxWidth: s || T, maxHeight: n || T } }(t, e, i); let { width: h, height: c } = l; if ("content-box" === n.boxSizing) { const t = _e(n, "border", "width"), e = _e(n, "padding"); h -= e.width + t.width, c -= e.height + t.height } h = Math.max(0, h - o.width), c = Math.max(0, s ? h / s : c - o.height), h = Me(Math.min(h, a, l.maxWidth)), c = Me(Math.min(c, r, l.maxHeight)), h && !c && (c = Me(h / 2)); return (void 0 !== e || void 0 !== i) && s && l.height && c > l.height && (c = l.height, h = Me(Math.floor(c * s))), { width: h, height: c } } function ke(t, e, i) { const s = e || 1, n = Me(t.height * s), o = Me(t.width * s); t.height = Me(t.height), t.width = Me(t.width); const a = t.canvas; return a.style && (i || !a.style.height && !a.style.width) && (a.style.height = `${t.height}px`, a.style.width = `${t.width}px`), (t.currentDevicePixelRatio !== s || a.height !== n || a.width !== o) && (t.currentDevicePixelRatio = s, a.height = n, a.width = o, t.ctx.setTransform(s, 0, 0, s, 0, 0), !0) } const Se = function () { let t = !1; try { const e = { get passive() { return t = !0, !1 } }; fe() && (window.addEventListener("test", null, e), window.removeEventListener("test", null, e)) } catch (t) { } return t }(); function Pe(t, e) { const i = xe(t, e), s = i && i.match(/^(\d+)(\.\d+)?px$/); return s ? +s[1] : void 0 } function De(t) { return !t || s(t.size) || s(t.family) ? null : (t.style ? t.style + " " : "") + (t.weight ? t.weight + " " : "") + t.size + "px " + t.family } function Ce(t, e, i, s, n) { let o = e[n]; return o || (o = e[n] = t.measureText(n).width, i.push(n)), o > s && (s = o), s } function Oe(t, e, i, s) { let o = (s = s || {}).data = s.data || {}, a = s.garbageCollect = s.garbageCollect || []; s.font !== e && (o = s.data = {}, a = s.garbageCollect = [], s.font = e), t.save(), t.font = e; let r = 0; const l = i.length; let h, c, d, u, f; for (h = 0; h < l; h++)if (u = i[h], null == u || n(u)) { if (n(u)) for (c = 0, d = u.length; c < d; c++)f = u[c], null == f || n(f) || (r = Ce(t, o, a, r, f)) } else r = Ce(t, o, a, r, u); t.restore(); const g = a.length / 2; if (g > i.length) { for (h = 0; h < g; h++)delete o[a[h]]; a.splice(0, g) } return r } function Ae(t, e, i) { const s = t.currentDevicePixelRatio, n = 0 !== i ? Math.max(i / 2, .5) : 0; return Math.round((e - n) * s) / s + n } function Te(t, e) { (e || t) && ((e = e || t.getContext("2d")).save(), e.resetTransform(), e.clearRect(0, 0, t.width, t.height), e.restore()) } function Le(t, e, i, s) { Ee(t, e, i, s, null) } function Ee(t, e, i, s, n) { let o, a, r, l, h, c, d, u; const f = e.pointStyle, g = e.rotation, p = e.radius; let m = (g || 0) * L; if (f && "object" == typeof f && (o = f.toString(), "[object HTMLImageElement]" === o || "[object HTMLCanvasElement]" === o)) return t.save(), t.translate(i, s), t.rotate(m), t.drawImage(f, -f.width / 2, -f.height / 2, f.width, f.height), void t.restore(); if (!(isNaN(p) || p <= 0)) { switch (t.beginPath(), f) { default: n ? t.ellipse(i, s, n / 2, p, 0, 0, O) : t.arc(i, s, p, 0, O), t.closePath(); break; case "triangle": c = n ? n / 2 : p, t.moveTo(i + Math.sin(m) * c, s - Math.cos(m) * p), m += I, t.lineTo(i + Math.sin(m) * c, s - Math.cos(m) * p), m += I, t.lineTo(i + Math.sin(m) * c, s - Math.cos(m) * p), t.closePath(); break; case "rectRounded": h = .516 * p, l = p - h, a = Math.cos(m + R) * l, d = Math.cos(m + R) * (n ? n / 2 - h : l), r = Math.sin(m + R) * l, u = Math.sin(m + R) * (n ? n / 2 - h : l), t.arc(i - d, s - r, h, m - C, m - E), t.arc(i + u, s - a, h, m - E, m), t.arc(i + d, s + r, h, m, m + E), t.arc(i - u, s + a, h, m + E, m + C), t.closePath(); break; case "rect": if (!g) { l = Math.SQRT1_2 * p, c = n ? n / 2 : l, t.rect(i - c, s - l, 2 * c, 2 * l); break } m += R; case "rectRot": d = Math.cos(m) * (n ? n / 2 : p), a = Math.cos(m) * p, r = Math.sin(m) * p, u = Math.sin(m) * (n ? n / 2 : p), t.moveTo(i - d, s - r), t.lineTo(i + u, s - a), t.lineTo(i + d, s + r), t.lineTo(i - u, s + a), t.closePath(); break; case "crossRot": m += R; case "cross": d = Math.cos(m) * (n ? n / 2 : p), a = Math.cos(m) * p, r = Math.sin(m) * p, u = Math.sin(m) * (n ? n / 2 : p), t.moveTo(i - d, s - r), t.lineTo(i + d, s + r), t.moveTo(i + u, s - a), t.lineTo(i - u, s + a); break; case "star": d = Math.cos(m) * (n ? n / 2 : p), a = Math.cos(m) * p, r = Math.sin(m) * p, u = Math.sin(m) * (n ? n / 2 : p), t.moveTo(i - d, s - r), t.lineTo(i + d, s + r), t.moveTo(i + u, s - a), t.lineTo(i - u, s + a), m += R, d = Math.cos(m) * (n ? n / 2 : p), a = Math.cos(m) * p, r = Math.sin(m) * p, u = Math.sin(m) * (n ? n / 2 : p), t.moveTo(i - d, s - r), t.lineTo(i + d, s + r), t.moveTo(i + u, s - a), t.lineTo(i - u, s + a); break; case "line": a = n ? n / 2 : Math.cos(m) * p, r = Math.sin(m) * p, t.moveTo(i - a, s - r), t.lineTo(i + a, s + r); break; case "dash": t.moveTo(i, s), t.lineTo(i + Math.cos(m) * (n ? n / 2 : p), s + Math.sin(m) * p); break; case !1: t.closePath() }t.fill(), e.borderWidth > 0 && t.stroke() } } function Re(t, e, i) { return i = i || .5, !e || t && t.x > e.left - i && t.x < e.right + i && t.y > e.top - i && t.y < e.bottom + i } function Ie(t, e) { t.save(), t.beginPath(), t.rect(e.left, e.top, e.right - e.left, e.bottom - e.top), t.clip() } function ze(t) { t.restore() } function Fe(t, e, i, s, n) { if (!e) return t.lineTo(i.x, i.y); if ("middle" === n) { const s = (e.x + i.x) / 2; t.lineTo(s, e.y), t.lineTo(s, i.y) } else "after" === n != !!s ? t.lineTo(e.x, i.y) : t.lineTo(i.x, e.y); t.lineTo(i.x, i.y) } function Ve(t, e, i, s) { if (!e) return t.lineTo(i.x, i.y); t.bezierCurveTo(s ? e.cp1x : e.cp2x, s ? e.cp1y : e.cp2y, s ? i.cp2x : i.cp1x, s ? i.cp2y : i.cp1y, i.x, i.y) } function Be(t, e, i, s, n) { if (n.strikethrough || n.underline) { const o = t.measureText(s), a = e - o.actualBoundingBoxLeft, r = e + o.actualBoundingBoxRight, l = i - o.actualBoundingBoxAscent, h = i + o.actualBoundingBoxDescent, c = n.strikethrough ? (l + h) / 2 : h; t.strokeStyle = t.fillStyle, t.beginPath(), t.lineWidth = n.decorationWidth || 2, t.moveTo(a, c), t.lineTo(r, c), t.stroke() } } function We(t, e) { const i = t.fillStyle; t.fillStyle = e.color, t.fillRect(e.left, e.top, e.width, e.height), t.fillStyle = i } function Ne(t, e, i, o, a, r = {}) { const l = n(e) ? e : [e], h = r.strokeWidth > 0 && "" !== r.strokeColor; let c, d; for (t.save(), t.font = a.string, function (t, e) { e.translation && t.translate(e.translation[0], e.translation[1]), s(e.rotation) || t.rotate(e.rotation), e.color && (t.fillStyle = e.color), e.textAlign && (t.textAlign = e.textAlign), e.textBaseline && (t.textBaseline = e.textBaseline) }(t, r), c = 0; c < l.length; ++c)d = l[c], r.backdrop && We(t, r.backdrop), h && (r.strokeColor && (t.strokeStyle = r.strokeColor), s(r.strokeWidth) || (t.lineWidth = r.strokeWidth), t.strokeText(d, i, o, r.maxWidth)), t.fillText(d, i, o, r.maxWidth), Be(t, i, o, d, r), o += Number(a.lineHeight); t.restore() } function He(t, e) { const { x: i, y: s, w: n, h: o, radius: a } = e; t.arc(i + a.topLeft, s + a.topLeft, a.topLeft, 1.5 * C, C, !0), t.lineTo(i, s + o - a.bottomLeft), t.arc(i + a.bottomLeft, s + o - a.bottomLeft, a.bottomLeft, C, E, !0), t.lineTo(i + n - a.bottomRight, s + o), t.arc(i + n - a.bottomRight, s + o - a.bottomRight, a.bottomRight, E, 0, !0), t.lineTo(i + n, s + a.topRight), t.arc(i + n - a.topRight, s + a.topRight, a.topRight, 0, -E, !0), t.lineTo(i + a.topLeft, s) } function je(t, e = [""], i, s, n = (() => t[0])) { const o = i || t; void 0 === s && (s = ti("_fallback", t)); const a = { [Symbol.toStringTag]: "Object", _cacheable: !0, _scopes: t, _rootScopes: o, _fallback: s, _getTarget: n, override: i => je([i, ...t], e, o, s) }; return new Proxy(a, { deleteProperty: (e, i) => (delete e[i], delete e._keys, delete t[0][i], !0), get: (i, s) => qe(i, s, (() => function (t, e, i, s) { let n; for (const o of e) if (n = ti(Ue(o, t), i), void 0 !== n) return Xe(t, n) ? Ze(i, s, t, n) : n }(s, e, t, i))), getOwnPropertyDescriptor: (t, e) => Reflect.getOwnPropertyDescriptor(t._scopes[0], e), getPrototypeOf: () => Reflect.getPrototypeOf(t[0]), has: (t, e) => ei(t).includes(e), ownKeys: t => ei(t), set(t, e, i) { const s = t._storage || (t._storage = n()); return t[e] = s[e] = i, delete t._keys, !0 } }) } function $e(t, e, i, s) { const a = { _cacheable: !1, _proxy: t, _context: e, _subProxy: i, _stack: new Set, _descriptors: Ye(t, s), setContext: e => $e(t, e, i, s), override: n => $e(t.override(n), e, i, s) }; return new Proxy(a, { deleteProperty: (e, i) => (delete e[i], delete t[i], !0), get: (t, e, i) => qe(t, e, (() => function (t, e, i) { const { _proxy: s, _context: a, _subProxy: r, _descriptors: l } = t; let h = s[e]; S(h) && l.isScriptable(e) && (h = function (t, e, i, s) { const { _proxy: n, _context: o, _subProxy: a, _stack: r } = i; if (r.has(t)) throw new Error("Recursion detected: " + Array.from(r).join("->") + "->" + t); r.add(t); let l = e(o, a || s); r.delete(t), Xe(t, l) && (l = Ze(n._scopes, n, t, l)); return l }(e, h, t, i)); n(h) && h.length && (h = function (t, e, i, s) { const { _proxy: n, _context: a, _subProxy: r, _descriptors: l } = i; if (void 0 !== a.index && s(t)) return e[a.index % e.length]; if (o(e[0])) { const i = e, s = n._scopes.filter((t => t !== i)); e = []; for (const o of i) { const i = Ze(s, n, t, o); e.push($e(i, a, r && r[t], l)) } } return e }(e, h, t, l.isIndexable)); Xe(e, h) && (h = $e(h, a, r && r[e], l)); return h }(t, e, i))), getOwnPropertyDescriptor: (e, i) => e._descriptors.allKeys ? Reflect.has(t, i) ? { enumerable: !0, configurable: !0 } : void 0 : Reflect.getOwnPropertyDescriptor(t, i), getPrototypeOf: () => Reflect.getPrototypeOf(t), has: (e, i) => Reflect.has(t, i), ownKeys: () => Reflect.ownKeys(t), set: (e, i, s) => (t[i] = s, delete e[i], !0) }) } function Ye(t, e = { scriptable: !0, indexable: !0 }) { const { _scriptable: i = e.scriptable, _indexable: s = e.indexable, _allKeys: n = e.allKeys } = t; return { allKeys: n, scriptable: i, indexable: s, isScriptable: S(i) ? i : () => i, isIndexable: S(s) ? s : () => s } } const Ue = (t, e) => t ? t + w(e) : e, Xe = (t, e) => o(e) && "adapters" !== t && (null === Object.getPrototypeOf(e) || e.constructor === Object); function qe(t, e, i) { if (Object.prototype.hasOwnProperty.call(t, e) || "constructor" === e) return t[e]; const s = i(); return t[e] = s, s } function Ke(t, e, i) { return S(t) ? t(e, i) : t } const Ge = (t, e) => !0 === t ? e : "string" == typeof t ? M(e, t) : void 0; function Je(t, e, i, s, n) { for (const o of e) { const e = Ge(i, o); if (e) { t.add(e); const o = Ke(e._fallback, i, n); if (void 0 !== o && o !== i && o !== s) return o } else if (!1 === e && void 0 !== s && i !== s) return null } return !1 } function Ze(t, e, i, s) { const a = e._rootScopes, r = Ke(e._fallback, i, s), l = [...t, ...a], h = new Set; h.add(s); let c = Qe(h, l, i, r || i, s); return null !== c && ((void 0 === r || r === i || (c = Qe(h, l, r, c, s), null !== c)) && je(Array.from(h), [""], a, r, (() => function (t, e, i) { const s = t._getTarget(); e in s || (s[e] = {}); const a = s[e]; if (n(a) && o(i)) return i; return a || {} }(e, i, s)))) } function Qe(t, e, i, s, n) { for (; i;)i = Je(t, e, i, s, n); return i } function ti(t, e) { for (const i of e) { if (!i) continue; const e = i[t]; if (void 0 !== e) return e } } function ei(t) { let e = t._keys; return e || (e = t._keys = function (t) { const e = new Set; for (const i of t) for (const t of Object.keys(i).filter((t => !t.startsWith("_")))) e.add(t); return Array.from(e) }(t._scopes)), e } function ii(t, e, i, s) { const { iScale: n } = t, { key: o = "r" } = this._parsing, a = new Array(s); let r, l, h, c; for (r = 0, l = s; r < l; ++r)h = r + i, c = e[h], a[r] = { r: n.parse(M(c, o), h) }; return a } const si = Number.EPSILON || 1e-14, ni = (t, e) => e < t.length && !t[e].skip && t[e], oi = t => "x" === t ? "y" : "x"; function ai(t, e, i, s) { const n = t.skip ? e : t, o = e, a = i.skip ? e : i, r = q(o, n), l = q(a, o); let h = r / (r + l), c = l / (r + l); h = isNaN(h) ? 0 : h, c = isNaN(c) ? 0 : c; const d = s * h, u = s * c; return { previous: { x: o.x - d * (a.x - n.x), y: o.y - d * (a.y - n.y) }, next: { x: o.x + u * (a.x - n.x), y: o.y + u * (a.y - n.y) } } } function ri(t, e = "x") { const i = oi(e), s = t.length, n = Array(s).fill(0), o = Array(s); let a, r, l, h = ni(t, 0); for (a = 0; a < s; ++a)if (r = l, l = h, h = ni(t, a + 1), l) { if (h) { const t = h[e] - l[e]; n[a] = 0 !== t ? (h[i] - l[i]) / t : 0 } o[a] = r ? h ? F(n[a - 1]) !== F(n[a]) ? 0 : (n[a - 1] + n[a]) / 2 : n[a - 1] : n[a] } !function (t, e, i) { const s = t.length; let n, o, a, r, l, h = ni(t, 0); for (let c = 0; c < s - 1; ++c)l = h, h = ni(t, c + 1), l && h && (V(e[c], 0, si) ? i[c] = i[c + 1] = 0 : (n = i[c] / e[c], o = i[c + 1] / e[c], r = Math.pow(n, 2) + Math.pow(o, 2), r <= 9 || (a = 3 / Math.sqrt(r), i[c] = n * a * e[c], i[c + 1] = o * a * e[c]))) }(t, n, o), function (t, e, i = "x") { const s = oi(i), n = t.length; let o, a, r, l = ni(t, 0); for (let h = 0; h < n; ++h) { if (a = r, r = l, l = ni(t, h + 1), !r) continue; const n = r[i], c = r[s]; a && (o = (n - a[i]) / 3, r[`cp1${i}`] = n - o, r[`cp1${s}`] = c - o * e[h]), l && (o = (l[i] - n) / 3, r[`cp2${i}`] = n + o, r[`cp2${s}`] = c + o * e[h]) } }(t, o, e) } function li(t, e, i) { return Math.max(Math.min(t, i), e) } function hi(t, e, i, s, n) { let o, a, r, l; if (e.spanGaps && (t = t.filter((t => !t.skip))), "monotone" === e.cubicInterpolationMode) ri(t, n); else { let i = s ? t[t.length - 1] : t[0]; for (o = 0, a = t.length; o < a; ++o)r = t[o], l = ai(i, r, t[Math.min(o + 1, a - (s ? 0 : 1)) % a], e.tension), r.cp1x = l.previous.x, r.cp1y = l.previous.y, r.cp2x = l.next.x, r.cp2y = l.next.y, i = r } e.capBezierPoints && function (t, e) { let i, s, n, o, a, r = Re(t[0], e); for (i = 0, s = t.length; i < s; ++i)a = o, o = r, r = i < s - 1 && Re(t[i + 1], e), o && (n = t[i], a && (n.cp1x = li(n.cp1x, e.left, e.right), n.cp1y = li(n.cp1y, e.top, e.bottom)), r && (n.cp2x = li(n.cp2x, e.left, e.right), n.cp2y = li(n.cp2y, e.top, e.bottom))) }(t, i) } const ci = t => 0 === t || 1 === t, di = (t, e, i) => -Math.pow(2, 10 * (t -= 1)) * Math.sin((t - e) * O / i), ui = (t, e, i) => Math.pow(2, -10 * t) * Math.sin((t - e) * O / i) + 1, fi = { linear: t => t, easeInQuad: t => t * t, easeOutQuad: t => -t * (t - 2), easeInOutQuad: t => (t /= .5) < 1 ? .5 * t * t : -.5 * (--t * (t - 2) - 1), easeInCubic: t => t * t * t, easeOutCubic: t => (t -= 1) * t * t + 1, easeInOutCubic: t => (t /= .5) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2), easeInQuart: t => t * t * t * t, easeOutQuart: t => -((t -= 1) * t * t * t - 1), easeInOutQuart: t => (t /= .5) < 1 ? .5 * t * t * t * t : -.5 * ((t -= 2) * t * t * t - 2), easeInQuint: t => t * t * t * t * t, easeOutQuint: t => (t -= 1) * t * t * t * t + 1, easeInOutQuint: t => (t /= .5) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2), easeInSine: t => 1 - Math.cos(t * E), easeOutSine: t => Math.sin(t * E), easeInOutSine: t => -.5 * (Math.cos(C * t) - 1), easeInExpo: t => 0 === t ? 0 : Math.pow(2, 10 * (t - 1)), easeOutExpo: t => 1 === t ? 1 : 1 - Math.pow(2, -10 * t), easeInOutExpo: t => ci(t) ? t : t < .5 ? .5 * Math.pow(2, 10 * (2 * t - 1)) : .5 * (2 - Math.pow(2, -10 * (2 * t - 1))), easeInCirc: t => t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1), easeOutCirc: t => Math.sqrt(1 - (t -= 1) * t), easeInOutCirc: t => (t /= .5) < 1 ? -.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1), easeInElastic: t => ci(t) ? t : di(t, .075, .3), easeOutElastic: t => ci(t) ? t : ui(t, .075, .3), easeInOutElastic(t) { const e = .1125; return ci(t) ? t : t < .5 ? .5 * di(2 * t, e, .45) : .5 + .5 * ui(2 * t - 1, e, .45) }, easeInBack(t) { const e = 1.70158; return t * t * ((e + 1) * t - e) }, easeOutBack(t) { const e = 1.70158; return (t -= 1) * t * ((e + 1) * t + e) + 1 }, easeInOutBack(t) { let e = 1.70158; return (t /= .5) < 1 ? t * t * ((1 + (e *= 1.525)) * t - e) * .5 : .5 * ((t -= 2) * t * ((1 + (e *= 1.525)) * t + e) + 2) }, easeInBounce: t => 1 - fi.easeOutBounce(1 - t), easeOutBounce(t) { const e = 7.5625, i = 2.75; return t < 1 / i ? e * t * t : t < 2 / i ? e * (t -= 1.5 / i) * t + .75 : t < 2.5 / i ? e * (t -= 2.25 / i) * t + .9375 : e * (t -= 2.625 / i) * t + .984375 }, easeInOutBounce: t => t < .5 ? .5 * fi.easeInBounce(2 * t) : .5 * fi.easeOutBounce(2 * t - 1) + .5 }; function gi(t, e, i, s) { return { x: t.x + i * (e.x - t.x), y: t.y + i * (e.y - t.y) } } function pi(t, e, i, s) { return { x: t.x + i * (e.x - t.x), y: "middle" === s ? i < .5 ? t.y : e.y : "after" === s ? i < 1 ? t.y : e.y : i > 0 ? e.y : t.y } } function mi(t, e, i, s) { const n = { x: t.cp2x, y: t.cp2y }, o = { x: e.cp1x, y: e.cp1y }, a = gi(t, n, i), r = gi(n, o, i), l = gi(o, e, i), h = gi(a, r, i), c = gi(r, l, i); return gi(h, c, i) } const xi = /^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/, bi = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/; function _i(t, e) { const i = ("" + t).match(xi); if (!i || "normal" === i[1]) return 1.2 * e; switch (t = +i[2], i[3]) { case "px": return t; case "%": t /= 100 }return e * t } const yi = t => +t || 0; function vi(t, e) { const i = {}, s = o(e), n = s ? Object.keys(e) : e, a = o(t) ? s ? i => l(t[i], t[e[i]]) : e => t[e] : () => t; for (const t of n) i[t] = yi(a(t)); return i } function Mi(t) { return vi(t, { top: "y", right: "x", bottom: "y", left: "x" }) } function wi(t) { return vi(t, ["topLeft", "topRight", "bottomLeft", "bottomRight"]) } function ki(t) { const e = Mi(t); return e.width = e.left + e.right, e.height = e.top + e.bottom, e } function Si(t, e) { t = t || {}, e = e || ue.font; let i = l(t.size, e.size); "string" == typeof i && (i = parseInt(i, 10)); let s = l(t.style, e.style); s && !("" + s).match(bi) && (console.warn('Invalid font style specified: "' + s + '"'), s = void 0); const n = { family: l(t.family, e.family), lineHeight: _i(l(t.lineHeight, e.lineHeight), i), size: i, style: s, weight: l(t.weight, e.weight), string: "" }; return n.string = De(n), n } function Pi(t, e, i, s) { let o, a, r, l = !0; for (o = 0, a = t.length; o < a; ++o)if (r = t[o], void 0 !== r && (void 0 !== e && "function" == typeof r && (r = r(e), l = !1), void 0 !== i && n(r) && (r = r[i % r.length], l = !1), void 0 !== r)) return s && !l && (s.cacheable = !1), r } function Di(t, e, i) { const { min: s, max: n } = t, o = c(e, (n - s) / 2), a = (t, e) => i && 0 === t ? 0 : t + e; return { min: a(s, -Math.abs(o)), max: a(n, o) } } function Ci(t, e) { return Object.assign(Object.create(t), e) } function Oi(t, e, i) { return t ? function (t, e) { return { x: i => t + t + e - i, setWidth(t) { e = t }, textAlign: t => "center" === t ? t : "right" === t ? "left" : "right", xPlus: (t, e) => t - e, leftForLtr: (t, e) => t - e } }(e, i) : { x: t => t, setWidth(t) { }, textAlign: t => t, xPlus: (t, e) => t + e, leftForLtr: (t, e) => t } } function Ai(t, e) { let i, s; "ltr" !== e && "rtl" !== e || (i = t.canvas.style, s = [i.getPropertyValue("direction"), i.getPropertyPriority("direction")], i.setProperty("direction", e, "important"), t.prevTextDirection = s) } function Ti(t, e) { void 0 !== e && (delete t.prevTextDirection, t.canvas.style.setProperty("direction", e[0], e[1])) } function Li(t) { return "angle" === t ? { between: J, compare: K, normalize: G } : { between: tt, compare: (t, e) => t - e, normalize: t => t } } function Ei({ start: t, end: e, count: i, loop: s, style: n }) { return { start: t % i, end: e % i, loop: s && (e - t + 1) % i == 0, style: n } } function Ri(t, e, i) { if (!i) return [t]; const { property: s, start: n, end: o } = i, a = e.length, { compare: r, between: l, normalize: h } = Li(s), { start: c, end: d, loop: u, style: f } = function (t, e, i) { const { property: s, start: n, end: o } = i, { between: a, normalize: r } = Li(s), l = e.length; let h, c, { start: d, end: u, loop: f } = t; if (f) { for (d += l, u += l, h = 0, c = l; h < c && a(r(e[d % l][s]), n, o); ++h)d--, u--; d %= l, u %= l } return u < d && (u += l), { start: d, end: u, loop: f, style: t.style } }(t, e, i), g = []; let p, m, x, b = !1, _ = null; const y = () => b || l(n, x, p) && 0 !== r(n, x), v = () => !b || 0 === r(o, p) || l(o, x, p); for (let t = c, i = c; t <= d; ++t)m = e[t % a], m.skip || (p = h(m[s]), p !== x && (b = l(p, n, o), null === _ && y() && (_ = 0 === r(p, n) ? t : i), null !== _ && v() && (g.push(Ei({ start: _, end: t, loop: u, count: a, style: f })), _ = null), i = t, x = p)); return null !== _ && g.push(Ei({ start: _, end: d, loop: u, count: a, style: f })), g } function Ii(t, e) { const i = [], s = t.segments; for (let n = 0; n < s.length; n++) { const o = Ri(s[n], t.points, e); o.length && i.push(...o) } return i } function zi(t, e) { const i = t.points, s = t.options.spanGaps, n = i.length; if (!n) return []; const o = !!t._loop, { start: a, end: r } = function (t, e, i, s) { let n = 0, o = e - 1; if (i && !s) for (; n < e && !t[n].skip;)n++; for (; n < e && t[n].skip;)n++; for (n %= e, i && (o += n); o > n && t[o % e].skip;)o--; return o %= e, { start: n, end: o } }(i, n, o, s); if (!0 === s) return Fi(t, [{ start: a, end: r, loop: o }], i, e); return Fi(t, function (t, e, i, s) { const n = t.length, o = []; let a, r = e, l = t[e]; for (a = e + 1; a <= i; ++a) { const i = t[a % n]; i.skip || i.stop ? l.skip || (s = !1, o.push({ start: e % n, end: (a - 1) % n, loop: s }), e = r = i.stop ? a : null) : (r = a, l.skip && (e = a)), l = i } return null !== r && o.push({ start: e % n, end: r % n, loop: s }), o }(i, a, r < a ? r + n : r, !!t._fullLoop && 0 === a && r === n - 1), i, e) } function Fi(t, e, i, s) { return s && s.setContext && i ? function (t, e, i, s) { const n = t._chart.getContext(), o = Vi(t.options), { _datasetIndex: a, options: { spanGaps: r } } = t, l = i.length, h = []; let c = o, d = e[0].start, u = d; function f(t, e, s, n) { const o = r ? -1 : 1; if (t !== e) { for (t += l; i[t % l].skip;)t -= o; for (; i[e % l].skip;)e += o; t % l != e % l && (h.push({ start: t % l, end: e % l, loop: s, style: n }), c = n, d = e % l) } } for (const t of e) { d = r ? d : t.start; let e, o = i[d % l]; for (u = d + 1; u <= t.end; u++) { const r = i[u % l]; e = Vi(s.setContext(Ci(n, { type: "segment", p0: o, p1: r, p0DataIndex: (u - 1) % l, p1DataIndex: u % l, datasetIndex: a }))), Bi(e, c) && f(d, u - 1, t.loop, c), o = r, c = e } d < u - 1 && f(d, u - 1, t.loop, c) } return h }(t, e, i, s) : e } function Vi(t) { return { backgroundColor: t.backgroundColor, borderCapStyle: t.borderCapStyle, borderDash: t.borderDash, borderDashOffset: t.borderDashOffset, borderJoinStyle: t.borderJoinStyle, borderWidth: t.borderWidth, borderColor: t.borderColor } } function Bi(t, e) { if (!e) return !1; const i = [], s = function (t, e) { return Zt(e) ? (i.includes(e) || i.push(e), i.indexOf(e)) : e }; return JSON.stringify(t, s) !== JSON.stringify(e, s) } function Wi(t, e, i) { return t.options.clip ? t[i] : e[i] } function Ni(t, e) { const i = e._clip; if (i.disabled) return !1; const s = function (t, e) { const { xScale: i, yScale: s } = t; return i && s ? { left: Wi(i, e, "left"), right: Wi(i, e, "right"), top: Wi(s, e, "top"), bottom: Wi(s, e, "bottom") } : e }(e, t.chartArea); return { left: !1 === i.left ? 0 : s.left - (!0 === i.left ? 0 : i.left), right: !1 === i.right ? t.width : s.right + (!0 === i.right ? 0 : i.right), top: !1 === i.top ? 0 : s.top - (!0 === i.top ? 0 : i.top), bottom: !1 === i.bottom ? t.height : s.bottom + (!0 === i.bottom ? 0 : i.bottom) } } var Hi = Object.freeze({ __proto__: null, HALF_PI: E, INFINITY: T, PI: C, PITAU: A, QUARTER_PI: R, RAD_PER_DEG: L, TAU: O, TWO_THIRDS_PI: I, _addGrace: Di, _alignPixel: Ae, _alignStartEnd: ft, _angleBetween: J, _angleDiff: K, _arrayUnique: lt, _attachContext: $e, _bezierCurveTo: Ve, _bezierInterpolation: mi, _boundSegment: Ri, _boundSegments: Ii, _capitalize: w, _computeSegments: zi, _createResolver: je, _decimalPlaces: U, _deprecated: function (t, e, i, s) { void 0 !== e && console.warn(t + ': "' + i + '" is deprecated. Please use "' + s + '" instead') }, _descriptors: Ye, _elementsEqual: f, _factorize: W, _filterBetween: nt, _getParentNode: ge, _getStartAndCountOfVisiblePoints: pt, _int16Range: Q, _isBetween: tt, _isClickEvent: D, _isDomSupported: fe, _isPointInArea: Re, _limitValue: Z, _longestText: Oe, _lookup: et, _lookupByKey: it, _measureText: Ce, _merger: m, _mergerIf: _, _normalizeAngle: G, _parseObjectDataRadialScale: ii, _pointInLine: gi, _readValueToProps: vi, _rlookupByKey: st, _scaleRangesChanged: mt, _setMinAndMaxByKey: j, _splitKey: v, _steppedInterpolation: pi, _steppedLineTo: Fe, _textX: gt, _toLeftRightCenter: ut, _updateBezierControlPoints: hi, addRoundedRectPath: He, almostEquals: V, almostWhole: H, callback: d, clearCanvas: Te, clipArea: Ie, clone: g, color: Qt, createContext: Ci, debounce: dt, defined: k, distanceBetweenPoints: q, drawPoint: Le, drawPointLegend: Ee, each: u, easingEffects: fi, finiteOrDefault: r, fontString: function (t, e, i) { return e + " " + t + "px " + i }, formatNumber: ne, getAngleFromPoint: X, getDatasetClipArea: Ni, getHoverColor: te, getMaximumSize: we, getRelativePosition: ve, getRtlAdapter: Oi, getStyle: xe, isArray: n, isFinite: a, isFunction: S, isNullOrUndef: s, isNumber: N, isObject: o, isPatternOrGradient: Zt, listenArrayEvents: at, log10: z, merge: x, mergeIf: b, niceNum: B, noop: e, overrideTextDirection: Ai, readUsedSize: Pe, renderText: Ne, requestAnimFrame: ht, resolve: Pi, resolveObjectKey: M, restoreTextDirection: Ti, retinaScale: ke, setsEqual: P, sign: F, splineCurve: ai, splineCurveMonotone: ri, supportsEventListenerOptions: Se, throttled: ct, toDegrees: Y, toDimension: c, toFont: Si, toFontString: De, toLineHeight: _i, toPadding: ki, toPercentage: h, toRadians: $, toTRBL: Mi, toTRBLCorners: wi, uid: i, unclipArea: ze, unlistenArrayEvents: rt, valueOrDefault: l }); function ji(t, e, i, n) { const { controller: o, data: a, _sorted: r } = t, l = o._cachedMeta.iScale, h = t.dataset && t.dataset.options ? t.dataset.options.spanGaps : null; if (l && e === l.axis && "r" !== e && r && a.length) { const r = l._reversePixels ? st : it; if (!n) { const n = r(a, e, i); if (h) { const { vScale: e } = o._cachedMeta, { _parsed: i } = t, a = i.slice(0, n.lo + 1).reverse().findIndex((t => !s(t[e.axis]))); n.lo -= Math.max(0, a); const r = i.slice(n.hi).findIndex((t => !s(t[e.axis]))); n.hi += Math.max(0, r) } return n } if (o._sharedOptions) { const t = a[0], s = "function" == typeof t.getRange && t.getRange(e); if (s) { const t = r(a, e, i - s), n = r(a, e, i + s); return { lo: t.lo, hi: n.hi } } } } return { lo: 0, hi: a.length - 1 } } function $i(t, e, i, s, n) { const o = t.getSortedVisibleDatasetMetas(), a = i[e]; for (let t = 0, i = o.length; t < i; ++t) { const { index: i, data: r } = o[t], { lo: l, hi: h } = ji(o[t], e, a, n); for (let t = l; t <= h; ++t) { const e = r[t]; e.skip || s(e, i, t) } } } function Yi(t, e, i, s, n) { const o = []; if (!n && !t.isPointInArea(e)) return o; return $i(t, i, e, (function (i, a, r) { (n || Re(i, t.chartArea, 0)) && i.inRange(e.x, e.y, s) && o.push({ element: i, datasetIndex: a, index: r }) }), !0), o } function Ui(t, e, i, s, n, o) { let a = []; const r = function (t) { const e = -1 !== t.indexOf("x"), i = -1 !== t.indexOf("y"); return function (t, s) { const n = e ? Math.abs(t.x - s.x) : 0, o = i ? Math.abs(t.y - s.y) : 0; return Math.sqrt(Math.pow(n, 2) + Math.pow(o, 2)) } }(i); let l = Number.POSITIVE_INFINITY; return $i(t, i, e, (function (i, h, c) { const d = i.inRange(e.x, e.y, n); if (s && !d) return; const u = i.getCenterPoint(n); if (!(!!o || t.isPointInArea(u)) && !d) return; const f = r(e, u); f < l ? (a = [{ element: i, datasetIndex: h, index: c }], l = f) : f === l && a.push({ element: i, datasetIndex: h, index: c }) })), a } function Xi(t, e, i, s, n, o) { return o || t.isPointInArea(e) ? "r" !== i || s ? Ui(t, e, i, s, n, o) : function (t, e, i, s) { let n = []; return $i(t, i, e, (function (t, i, o) { const { startAngle: a, endAngle: r } = t.getProps(["startAngle", "endAngle"], s), { angle: l } = X(t, { x: e.x, y: e.y }); J(l, a, r) && n.push({ element: t, datasetIndex: i, index: o }) })), n }(t, e, i, n) : [] } function qi(t, e, i, s, n) { const o = [], a = "x" === i ? "inXRange" : "inYRange"; let r = !1; return $i(t, i, e, ((t, s, l) => { t[a] && t[a](e[i], n) && (o.push({ element: t, datasetIndex: s, index: l }), r = r || t.inRange(e.x, e.y, n)) })), s && !r ? [] : o } var Ki = { evaluateInteractionItems: $i, modes: { index(t, e, i, s) { const n = ve(e, t), o = i.axis || "x", a = i.includeInvisible || !1, r = i.intersect ? Yi(t, n, o, s, a) : Xi(t, n, o, !1, s, a), l = []; return r.length ? (t.getSortedVisibleDatasetMetas().forEach((t => { const e = r[0].index, i = t.data[e]; i && !i.skip && l.push({ element: i, datasetIndex: t.index, index: e }) })), l) : [] }, dataset(t, e, i, s) { const n = ve(e, t), o = i.axis || "xy", a = i.includeInvisible || !1; let r = i.intersect ? Yi(t, n, o, s, a) : Xi(t, n, o, !1, s, a); if (r.length > 0) { const e = r[0].datasetIndex, i = t.getDatasetMeta(e).data; r = []; for (let t = 0; t < i.length; ++t)r.push({ element: i[t], datasetIndex: e, index: t }) } return r }, point: (t, e, i, s) => Yi(t, ve(e, t), i.axis || "xy", s, i.includeInvisible || !1), nearest(t, e, i, s) { const n = ve(e, t), o = i.axis || "xy", a = i.includeInvisible || !1; return Xi(t, n, o, i.intersect, s, a) }, x: (t, e, i, s) => qi(t, ve(e, t), "x", i.intersect, s), y: (t, e, i, s) => qi(t, ve(e, t), "y", i.intersect, s) } }; const Gi = ["left", "top", "right", "bottom"]; function Ji(t, e) { return t.filter((t => t.pos === e)) } function Zi(t, e) { return t.filter((t => -1 === Gi.indexOf(t.pos) && t.box.axis === e)) } function Qi(t, e) { return t.sort(((t, i) => { const s = e ? i : t, n = e ? t : i; return s.weight === n.weight ? s.index - n.index : s.weight - n.weight })) } function ts(t, e) { const i = function (t) { const e = {}; for (const i of t) { const { stack: t, pos: s, stackWeight: n } = i; if (!t || !Gi.includes(s)) continue; const o = e[t] || (e[t] = { count: 0, placed: 0, weight: 0, size: 0 }); o.count++, o.weight += n } return e }(t), { vBoxMaxWidth: s, hBoxMaxHeight: n } = e; let o, a, r; for (o = 0, a = t.length; o < a; ++o) { r = t[o]; const { fullSize: a } = r.box, l = i[r.stack], h = l && r.stackWeight / l.weight; r.horizontal ? (r.width = h ? h * s : a && e.availableWidth, r.height = n) : (r.width = s, r.height = h ? h * n : a && e.availableHeight) } return i } function es(t, e, i, s) { return Math.max(t[i], e[i]) + Math.max(t[s], e[s]) } function is(t, e) { t.top = Math.max(t.top, e.top), t.left = Math.max(t.left, e.left), t.bottom = Math.max(t.bottom, e.bottom), t.right = Math.max(t.right, e.right) } function ss(t, e, i, s) { const { pos: n, box: a } = i, r = t.maxPadding; if (!o(n)) { i.size && (t[n] -= i.size); const e = s[i.stack] || { size: 0, count: 1 }; e.size = Math.max(e.size, i.horizontal ? a.height : a.width), i.size = e.size / e.count, t[n] += i.size } a.getPadding && is(r, a.getPadding()); const l = Math.max(0, e.outerWidth - es(r, t, "left", "right")), h = Math.max(0, e.outerHeight - es(r, t, "top", "bottom")), c = l !== t.w, d = h !== t.h; return t.w = l, t.h = h, i.horizontal ? { same: c, other: d } : { same: d, other: c } } function ns(t, e) { const i = e.maxPadding; function s(t) { const s = { left: 0, top: 0, right: 0, bottom: 0 }; return t.forEach((t => { s[t] = Math.max(e[t], i[t]) })), s } return s(t ? ["left", "right"] : ["top", "bottom"]) } function os(t, e, i, s) { const n = []; let o, a, r, l, h, c; for (o = 0, a = t.length, h = 0; o < a; ++o) { r = t[o], l = r.box, l.update(r.width || e.w, r.height || e.h, ns(r.horizontal, e)); const { same: a, other: d } = ss(e, i, r, s); h |= a && n.length, c = c || d, l.fullSize || n.push(r) } return h && os(n, e, i, s) || c } function as(t, e, i, s, n) { t.top = i, t.left = e, t.right = e + s, t.bottom = i + n, t.width = s, t.height = n } function rs(t, e, i, s) { const n = i.padding; let { x: o, y: a } = e; for (const r of t) { const t = r.box, l = s[r.stack] || { count: 1, placed: 0, weight: 1 }, h = r.stackWeight / l.weight || 1; if (r.horizontal) { const s = e.w * h, o = l.size || t.height; k(l.start) && (a = l.start), t.fullSize ? as(t, n.left, a, i.outerWidth - n.right - n.left, o) : as(t, e.left + l.placed, a, s, o), l.start = a, l.placed += s, a = t.bottom } else { const s = e.h * h, a = l.size || t.width; k(l.start) && (o = l.start), t.fullSize ? as(t, o, n.top, a, i.outerHeight - n.bottom - n.top) : as(t, o, e.top + l.placed, a, s), l.start = o, l.placed += s, o = t.right } } e.x = o, e.y = a } var ls = { addBox(t, e) { t.boxes || (t.boxes = []), e.fullSize = e.fullSize || !1, e.position = e.position || "top", e.weight = e.weight || 0, e._layers = e._layers || function () { return [{ z: 0, draw(t) { e.draw(t) } }] }, t.boxes.push(e) }, removeBox(t, e) { const i = t.boxes ? t.boxes.indexOf(e) : -1; -1 !== i && t.boxes.splice(i, 1) }, configure(t, e, i) { e.fullSize = i.fullSize, e.position = i.position, e.weight = i.weight }, update(t, e, i, s) { if (!t) return; const n = ki(t.options.layout.padding), o = Math.max(e - n.width, 0), a = Math.max(i - n.height, 0), r = function (t) { const e = function (t) { const e = []; let i, s, n, o, a, r; for (i = 0, s = (t || []).length; i < s; ++i)n = t[i], ({ position: o, options: { stack: a, stackWeight: r = 1 } } = n), e.push({ index: i, box: n, pos: o, horizontal: n.isHorizontal(), weight: n.weight, stack: a && o + a, stackWeight: r }); return e }(t), i = Qi(e.filter((t => t.box.fullSize)), !0), s = Qi(Ji(e, "left"), !0), n = Qi(Ji(e, "right")), o = Qi(Ji(e, "top"), !0), a = Qi(Ji(e, "bottom")), r = Zi(e, "x"), l = Zi(e, "y"); return { fullSize: i, leftAndTop: s.concat(o), rightAndBottom: n.concat(l).concat(a).concat(r), chartArea: Ji(e, "chartArea"), vertical: s.concat(n).concat(l), horizontal: o.concat(a).concat(r) } }(t.boxes), l = r.vertical, h = r.horizontal; u(t.boxes, (t => { "function" == typeof t.beforeLayout && t.beforeLayout() })); const c = l.reduce(((t, e) => e.box.options && !1 === e.box.options.display ? t : t + 1), 0) || 1, d = Object.freeze({ outerWidth: e, outerHeight: i, padding: n, availableWidth: o, availableHeight: a, vBoxMaxWidth: o / 2 / c, hBoxMaxHeight: a / 2 }), f = Object.assign({}, n); is(f, ki(s)); const g = Object.assign({ maxPadding: f, w: o, h: a, x: n.left, y: n.top }, n), p = ts(l.concat(h), d); os(r.fullSize, g, d, p), os(l, g, d, p), os(h, g, d, p) && os(l, g, d, p), function (t) { const e = t.maxPadding; function i(i) { const s = Math.max(e[i] - t[i], 0); return t[i] += s, s } t.y += i("top"), t.x += i("left"), i("right"), i("bottom") }(g), rs(r.leftAndTop, g, d, p), g.x += g.w, g.y += g.h, rs(r.rightAndBottom, g, d, p), t.chartArea = { left: g.left, top: g.top, right: g.left + g.w, bottom: g.top + g.h, height: g.h, width: g.w }, u(r.chartArea, (e => { const i = e.box; Object.assign(i, t.chartArea), i.update(g.w, g.h, { left: 0, top: 0, right: 0, bottom: 0 }) })) } }; class hs { acquireContext(t, e) { } releaseContext(t) { return !1 } addEventListener(t, e, i) { } removeEventListener(t, e, i) { } getDevicePixelRatio() { return 1 } getMaximumSize(t, e, i, s) { return e = Math.max(0, e || t.width), i = i || t.height, { width: e, height: Math.max(0, s ? Math.floor(e / s) : i) } } isAttached(t) { return !0 } updateConfig(t) { } } class cs extends hs { acquireContext(t) { return t && t.getContext && t.getContext("2d") || null } updateConfig(t) { t.options.animation = !1 } } const ds = "$chartjs", us = { touchstart: "mousedown", touchmove: "mousemove", touchend: "mouseup", pointerenter: "mouseenter", pointerdown: "mousedown", pointermove: "mousemove", pointerup: "mouseup", pointerleave: "mouseout", pointerout: "mouseout" }, fs = t => null === t || "" === t; const gs = !!Se && { passive: !0 }; function ps(t, e, i) { t && t.canvas && t.canvas.removeEventListener(e, i, gs) } function ms(t, e) { for (const i of t) if (i === e || i.contains(e)) return !0 } function xs(t, e, i) { const s = t.canvas, n = new MutationObserver((t => { let e = !1; for (const i of t) e = e || ms(i.addedNodes, s), e = e && !ms(i.removedNodes, s); e && i() })); return n.observe(document, { childList: !0, subtree: !0 }), n } function bs(t, e, i) { const s = t.canvas, n = new MutationObserver((t => { let e = !1; for (const i of t) e = e || ms(i.removedNodes, s), e = e && !ms(i.addedNodes, s); e && i() })); return n.observe(document, { childList: !0, subtree: !0 }), n } const _s = new Map; let ys = 0; function vs() { const t = window.devicePixelRatio; t !== ys && (ys = t, _s.forEach(((e, i) => { i.currentDevicePixelRatio !== t && e() }))) } function Ms(t, e, i) { const s = t.canvas, n = s && ge(s); if (!n) return; const o = ct(((t, e) => { const s = n.clientWidth; i(t, e), s < n.clientWidth && i() }), window), a = new ResizeObserver((t => { const e = t[0], i = e.contentRect.width, s = e.contentRect.height; 0 === i && 0 === s || o(i, s) })); return a.observe(n), function (t, e) { _s.size || window.addEventListener("resize", vs), _s.set(t, e) }(t, o), a } function ws(t, e, i) { i && i.disconnect(), "resize" === e && function (t) { _s.delete(t), _s.size || window.removeEventListener("resize", vs) }(t) } function ks(t, e, i) { const s = t.canvas, n = ct((e => { null !== t.ctx && i(function (t, e) { const i = us[t.type] || t.type, { x: s, y: n } = ve(t, e); return { type: i, chart: e, native: t, x: void 0 !== s ? s : null, y: void 0 !== n ? n : null } }(e, t)) }), t); return function (t, e, i) { t && t.addEventListener(e, i, gs) }(s, e, n), n } class Ss extends hs { acquireContext(t, e) { const i = t && t.getContext && t.getContext("2d"); return i && i.canvas === t ? (function (t, e) { const i = t.style, s = t.getAttribute("height"), n = t.getAttribute("width"); if (t[ds] = { initial: { height: s, width: n, style: { display: i.display, height: i.height, width: i.width } } }, i.display = i.display || "block", i.boxSizing = i.boxSizing || "border-box", fs(n)) { const e = Pe(t, "width"); void 0 !== e && (t.width = e) } if (fs(s)) if ("" === t.style.height) t.height = t.width / (e || 2); else { const e = Pe(t, "height"); void 0 !== e && (t.height = e) } }(t, e), i) : null } releaseContext(t) { const e = t.canvas; if (!e[ds]) return !1; const i = e[ds].initial;["height", "width"].forEach((t => { const n = i[t]; s(n) ? e.removeAttribute(t) : e.setAttribute(t, n) })); const n = i.style || {}; return Object.keys(n).forEach((t => { e.style[t] = n[t] })), e.width = e.width, delete e[ds], !0 } addEventListener(t, e, i) { this.removeEventListener(t, e); const s = t.$proxies || (t.$proxies = {}), n = { attach: xs, detach: bs, resize: Ms }[e] || ks; s[e] = n(t, e, i) } removeEventListener(t, e) { const i = t.$proxies || (t.$proxies = {}), s = i[e]; if (!s) return; ({ attach: ws, detach: ws, resize: ws }[e] || ps)(t, e, s), i[e] = void 0 } getDevicePixelRatio() { return window.devicePixelRatio } getMaximumSize(t, e, i, s) { return we(t, e, i, s) } isAttached(t) { const e = t && ge(t); return !(!e || !e.isConnected) } } function Ps(t) { return !fe() || "undefined" != typeof OffscreenCanvas && t instanceof OffscreenCanvas ? cs : Ss } var Ds = Object.freeze({ __proto__: null, BasePlatform: hs, BasicPlatform: cs, DomPlatform: Ss, _detectPlatform: Ps }); const Cs = "transparent", Os = { boolean: (t, e, i) => i > .5 ? e : t, color(t, e, i) { const s = Qt(t || Cs), n = s.valid && Qt(e || Cs); return n && n.valid ? n.mix(s, i).hexString() : e }, number: (t, e, i) => t + (e - t) * i }; class As { constructor(t, e, i, s) { const n = e[i]; s = Pi([t.to, s, n, t.from]); const o = Pi([t.from, n, s]); this._active = !0, this._fn = t.fn || Os[t.type || typeof o], this._easing = fi[t.easing] || fi.linear, this._start = Math.floor(Date.now() + (t.delay || 0)), this._duration = this._total = Math.floor(t.duration), this._loop = !!t.loop, this._target = e, this._prop = i, this._from = o, this._to = s, this._promises = void 0 } active() { return this._active } update(t, e, i) { if (this._active) { this._notify(!1); const s = this._target[this._prop], n = i - this._start, o = this._duration - n; this._start = i, this._duration = Math.floor(Math.max(o, t.duration)), this._total += n, this._loop = !!t.loop, this._to = Pi([t.to, e, s, t.from]), this._from = Pi([t.from, s, e]) } } cancel() { this._active && (this.tick(Date.now()), this._active = !1, this._notify(!1)) } tick(t) { const e = t - this._start, i = this._duration, s = this._prop, n = this._from, o = this._loop, a = this._to; let r; if (this._active = n !== a && (o || e < i), !this._active) return this._target[s] = a, void this._notify(!0); e < 0 ? this._target[s] = n : (r = e / i % 2, r = o && r > 1 ? 2 - r : r, r = this._easing(Math.min(1, Math.max(0, r))), this._target[s] = this._fn(n, a, r)) } wait() { const t = this._promises || (this._promises = []); return new Promise(((e, i) => { t.push({ res: e, rej: i }) })) } _notify(t) { const e = t ? "res" : "rej", i = this._promises || []; for (let t = 0; t < i.length; t++)i[t][e]() } } class Ts { constructor(t, e) { this._chart = t, this._properties = new Map, this.configure(e) } configure(t) { if (!o(t)) return; const e = Object.keys(ue.animation), i = this._properties; Object.getOwnPropertyNames(t).forEach((s => { const a = t[s]; if (!o(a)) return; const r = {}; for (const t of e) r[t] = a[t]; (n(a.properties) && a.properties || [s]).forEach((t => { t !== s && i.has(t) || i.set(t, r) })) })) } _animateOptions(t, e) { const i = e.options, s = function (t, e) { if (!e) return; let i = t.options; if (!i) return void (t.options = e); i.$shared && (t.options = i = Object.assign({}, i, { $shared: !1, $animations: {} })); return i }(t, i); if (!s) return []; const n = this._createAnimations(s, i); return i.$shared && function (t, e) { const i = [], s = Object.keys(e); for (let e = 0; e < s.length; e++) { const n = t[s[e]]; n && n.active() && i.push(n.wait()) } return Promise.all(i) }(t.options.$animations, i).then((() => { t.options = i }), (() => { })), n } _createAnimations(t, e) { const i = this._properties, s = [], n = t.$animations || (t.$animations = {}), o = Object.keys(e), a = Date.now(); let r; for (r = o.length - 1; r >= 0; --r) { const l = o[r]; if ("$" === l.charAt(0)) continue; if ("options" === l) { s.push(...this._animateOptions(t, e)); continue } const h = e[l]; let c = n[l]; const d = i.get(l); if (c) { if (d && c.active()) { c.update(d, h, a); continue } c.cancel() } d && d.duration ? (n[l] = c = new As(d, t, l, h), s.push(c)) : t[l] = h } return s } update(t, e) { if (0 === this._properties.size) return void Object.assign(t, e); const i = this._createAnimations(t, e); return i.length ? (bt.add(this._chart, i), !0) : void 0 } } function Ls(t, e) { const i = t && t.options || {}, s = i.reverse, n = void 0 === i.min ? e : 0, o = void 0 === i.max ? e : 0; return { start: s ? o : n, end: s ? n : o } } function Es(t, e) { const i = [], s = t._getSortedDatasetMetas(e); let n, o; for (n = 0, o = s.length; n < o; ++n)i.push(s[n].index); return i } function Rs(t, e, i, s = {}) { const n = t.keys, o = "single" === s.mode; let r, l, h, c; if (null === e) return; let d = !1; for (r = 0, l = n.length; r < l; ++r) { if (h = +n[r], h === i) { if (d = !0, s.all) continue; break } c = t.values[h], a(c) && (o || 0 === e || F(e) === F(c)) && (e += c) } return d || s.all ? e : 0 } function Is(t, e) { const i = t && t.options.stacked; return i || void 0 === i && void 0 !== e.stack } function zs(t, e, i) { const s = t[e] || (t[e] = {}); return s[i] || (s[i] = {}) } function Fs(t, e, i, s) { for (const n of e.getMatchingVisibleMetas(s).reverse()) { const e = t[n.index]; if (i && e > 0 || !i && e < 0) return n.index } return null } function Vs(t, e) { const { chart: i, _cachedMeta: s } = t, n = i._stacks || (i._stacks = {}), { iScale: o, vScale: a, index: r } = s, l = o.axis, h = a.axis, c = function (t, e, i) { return `${t.id}.${e.id}.${i.stack || i.type}` }(o, a, s), d = e.length; let u; for (let t = 0; t < d; ++t) { const i = e[t], { [l]: o, [h]: d } = i; u = (i._stacks || (i._stacks = {}))[h] = zs(n, c, o), u[r] = d, u._top = Fs(u, a, !0, s.type), u._bottom = Fs(u, a, !1, s.type); (u._visualValues || (u._visualValues = {}))[r] = d } } function Bs(t, e) { const i = t.scales; return Object.keys(i).filter((t => i[t].axis === e)).shift() } function Ws(t, e) { const i = t.controller.index, s = t.vScale && t.vScale.axis; if (s) { e = e || t._parsed; for (const t of e) { const e = t._stacks; if (!e || void 0 === e[s] || void 0 === e[s][i]) return; delete e[s][i], void 0 !== e[s]._visualValues && void 0 !== e[s]._visualValues[i] && delete e[s]._visualValues[i] } } } const Ns = t => "reset" === t || "none" === t, Hs = (t, e) => e ? t : Object.assign({}, t); class js { static defaults = {}; static datasetElementType = null; static dataElementType = null; constructor(t, e) { this.chart = t, this._ctx = t.ctx, this.index = e, this._cachedDataOpts = {}, this._cachedMeta = this.getMeta(), this._type = this._cachedMeta.type, this.options = void 0, this._parsing = !1, this._data = void 0, this._objectData = void 0, this._sharedOptions = void 0, this._drawStart = void 0, this._drawCount = void 0, this.enableOptionSharing = !1, this.supportsDecimation = !1, this.$context = void 0, this._syncList = [], this.datasetElementType = new.target.datasetElementType, this.dataElementType = new.target.dataElementType, this.initialize() } initialize() { const t = this._cachedMeta; this.configure(), this.linkScales(), t._stacked = Is(t.vScale, t), this.addElements(), this.options.fill && !this.chart.isPluginEnabled("filler") && console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options") } updateIndex(t) { this.index !== t && Ws(this._cachedMeta), this.index = t } linkScales() { const t = this.chart, e = this._cachedMeta, i = this.getDataset(), s = (t, e, i, s) => "x" === t ? e : "r" === t ? s : i, n = e.xAxisID = l(i.xAxisID, Bs(t, "x")), o = e.yAxisID = l(i.yAxisID, Bs(t, "y")), a = e.rAxisID = l(i.rAxisID, Bs(t, "r")), r = e.indexAxis, h = e.iAxisID = s(r, n, o, a), c = e.vAxisID = s(r, o, n, a); e.xScale = this.getScaleForId(n), e.yScale = this.getScaleForId(o), e.rScale = this.getScaleForId(a), e.iScale = this.getScaleForId(h), e.vScale = this.getScaleForId(c) } getDataset() { return this.chart.data.datasets[this.index] } getMeta() { return this.chart.getDatasetMeta(this.index) } getScaleForId(t) { return this.chart.scales[t] } _getOtherScale(t) { const e = this._cachedMeta; return t === e.iScale ? e.vScale : e.iScale } reset() { this._update("reset") } _destroy() { const t = this._cachedMeta; this._data && rt(this._data, this), t._stacked && Ws(t) } _dataCheck() { const t = this.getDataset(), e = t.data || (t.data = []), i = this._data; if (o(e)) { const t = this._cachedMeta; this._data = function (t, e) { const { iScale: i, vScale: s } = e, n = "x" === i.axis ? "x" : "y", o = "x" === s.axis ? "x" : "y", a = Object.keys(t), r = new Array(a.length); let l, h, c; for (l = 0, h = a.length; l < h; ++l)c = a[l], r[l] = { [n]: c, [o]: t[c] }; return r }(e, t) } else if (i !== e) { if (i) { rt(i, this); const t = this._cachedMeta; Ws(t), t._parsed = [] } e && Object.isExtensible(e) && at(e, this), this._syncList = [], this._data = e } } addElements() { const t = this._cachedMeta; this._dataCheck(), this.datasetElementType && (t.dataset = new this.datasetElementType) } buildOrUpdateElements(t) { const e = this._cachedMeta, i = this.getDataset(); let s = !1; this._dataCheck(); const n = e._stacked; e._stacked = Is(e.vScale, e), e.stack !== i.stack && (s = !0, Ws(e), e.stack = i.stack), this._resyncElements(t), (s || n !== e._stacked) && (Vs(this, e._parsed), e._stacked = Is(e.vScale, e)) } configure() { const t = this.chart.config, e = t.datasetScopeKeys(this._type), i = t.getOptionScopes(this.getDataset(), e, !0); this.options = t.createResolver(i, this.getContext()), this._parsing = this.options.parsing, this._cachedDataOpts = {} } parse(t, e) { const { _cachedMeta: i, _data: s } = this, { iScale: a, _stacked: r } = i, l = a.axis; let h, c, d, u = 0 === t && e === s.length || i._sorted, f = t > 0 && i._parsed[t - 1]; if (!1 === this._parsing) i._parsed = s, i._sorted = !0, d = s; else { d = n(s[t]) ? this.parseArrayData(i, s, t, e) : o(s[t]) ? this.parseObjectData(i, s, t, e) : this.parsePrimitiveData(i, s, t, e); const a = () => null === c[l] || f && c[l] < f[l]; for (h = 0; h < e; ++h)i._parsed[h + t] = c = d[h], u && (a() && (u = !1), f = c); i._sorted = u } r && Vs(this, d) } parsePrimitiveData(t, e, i, s) { const { iScale: n, vScale: o } = t, a = n.axis, r = o.axis, l = n.getLabels(), h = n === o, c = new Array(s); let d, u, f; for (d = 0, u = s; d < u; ++d)f = d + i, c[d] = { [a]: h || n.parse(l[f], f), [r]: o.parse(e[f], f) }; return c } parseArrayData(t, e, i, s) { const { xScale: n, yScale: o } = t, a = new Array(s); let r, l, h, c; for (r = 0, l = s; r < l; ++r)h = r + i, c = e[h], a[r] = { x: n.parse(c[0], h), y: o.parse(c[1], h) }; return a } parseObjectData(t, e, i, s) { const { xScale: n, yScale: o } = t, { xAxisKey: a = "x", yAxisKey: r = "y" } = this._parsing, l = new Array(s); let h, c, d, u; for (h = 0, c = s; h < c; ++h)d = h + i, u = e[d], l[h] = { x: n.parse(M(u, a), d), y: o.parse(M(u, r), d) }; return l } getParsed(t) { return this._cachedMeta._parsed[t] } getDataElement(t) { return this._cachedMeta.data[t] } applyStack(t, e, i) { const s = this.chart, n = this._cachedMeta, o = e[t.axis]; return Rs({ keys: Es(s, !0), values: e._stacks[t.axis]._visualValues }, o, n.index, { mode: i }) } updateRangeFromParsed(t, e, i, s) { const n = i[e.axis]; let o = null === n ? NaN : n; const a = s && i._stacks[e.axis]; s && a && (s.values = a, o = Rs(s, n, this._cachedMeta.index)), t.min = Math.min(t.min, o), t.max = Math.max(t.max, o) } getMinMax(t, e) { const i = this._cachedMeta, s = i._parsed, n = i._sorted && t === i.iScale, o = s.length, r = this._getOtherScale(t), l = ((t, e, i) => t && !e.hidden && e._stacked && { keys: Es(i, !0), values: null })(e, i, this.chart), h = { min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY }, { min: c, max: d } = function (t) { const { min: e, max: i, minDefined: s, maxDefined: n } = t.getUserBounds(); return { min: s ? e : Number.NEGATIVE_INFINITY, max: n ? i : Number.POSITIVE_INFINITY } }(r); let u, f; function g() { f = s[u]; const e = f[r.axis]; return !a(f[t.axis]) || c > e || d < e } for (u = 0; u < o && (g() || (this.updateRangeFromParsed(h, t, f, l), !n)); ++u); if (n) for (u = o - 1; u >= 0; --u)if (!g()) { this.updateRangeFromParsed(h, t, f, l); break } return h } getAllParsedValues(t) { const e = this._cachedMeta._parsed, i = []; let s, n, o; for (s = 0, n = e.length; s < n; ++s)o = e[s][t.axis], a(o) && i.push(o); return i } getMaxOverflow() { return !1 } getLabelAndValue(t) { const e = this._cachedMeta, i = e.iScale, s = e.vScale, n = this.getParsed(t); return { label: i ? "" + i.getLabelForValue(n[i.axis]) : "", value: s ? "" + s.getLabelForValue(n[s.axis]) : "" } } _update(t) { const e = this._cachedMeta; this.update(t || "default"), e._clip = function (t) { let e, i, s, n; return o(t) ? (e = t.top, i = t.right, s = t.bottom, n = t.left) : e = i = s = n = t, { top: e, right: i, bottom: s, left: n, disabled: !1 === t } }(l(this.options.clip, function (t, e, i) { if (!1 === i) return !1; const s = Ls(t, i), n = Ls(e, i); return { top: n.end, right: s.end, bottom: n.start, left: s.start } }(e.xScale, e.yScale, this.getMaxOverflow()))) } update(t) { } draw() { const t = this._ctx, e = this.chart, i = this._cachedMeta, s = i.data || [], n = e.chartArea, o = [], a = this._drawStart || 0, r = this._drawCount || s.length - a, l = this.options.drawActiveElementsOnTop; let h; for (i.dataset && i.dataset.draw(t, n, a, r), h = a; h < a + r; ++h) { const e = s[h]; e.hidden || (e.active && l ? o.push(e) : e.draw(t, n)) } for (h = 0; h < o.length; ++h)o[h].draw(t, n) } getStyle(t, e) { const i = e ? "active" : "default"; return void 0 === t && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(i) : this.resolveDataElementOptions(t || 0, i) } getContext(t, e, i) { const s = this.getDataset(); let n; if (t >= 0 && t < this._cachedMeta.data.length) { const e = this._cachedMeta.data[t]; n = e.$context || (e.$context = function (t, e, i) { return Ci(t, { active: !1, dataIndex: e, parsed: void 0, raw: void 0, element: i, index: e, mode: "default", type: "data" }) }(this.getContext(), t, e)), n.parsed = this.getParsed(t), n.raw = s.data[t], n.index = n.dataIndex = t } else n = this.$context || (this.$context = function (t, e) { return Ci(t, { active: !1, dataset: void 0, datasetIndex: e, index: e, mode: "default", type: "dataset" }) }(this.chart.getContext(), this.index)), n.dataset = s, n.index = n.datasetIndex = this.index; return n.active = !!e, n.mode = i, n } resolveDatasetElementOptions(t) { return this._resolveElementOptions(this.datasetElementType.id, t) } resolveDataElementOptions(t, e) { return this._resolveElementOptions(this.dataElementType.id, e, t) } _resolveElementOptions(t, e = "default", i) { const s = "active" === e, n = this._cachedDataOpts, o = t + "-" + e, a = n[o], r = this.enableOptionSharing && k(i); if (a) return Hs(a, r); const l = this.chart.config, h = l.datasetElementScopeKeys(this._type, t), c = s ? [`${t}Hover`, "hover", t, ""] : [t, ""], d = l.getOptionScopes(this.getDataset(), h), u = Object.keys(ue.elements[t]), f = l.resolveNamedOptions(d, u, (() => this.getContext(i, s, e)), c); return f.$shared && (f.$shared = r, n[o] = Object.freeze(Hs(f, r))), f } _resolveAnimations(t, e, i) { const s = this.chart, n = this._cachedDataOpts, o = `animation-${e}`, a = n[o]; if (a) return a; let r; if (!1 !== s.options.animation) { const s = this.chart.config, n = s.datasetAnimationScopeKeys(this._type, e), o = s.getOptionScopes(this.getDataset(), n); r = s.createResolver(o, this.getContext(t, i, e)) } const l = new Ts(s, r && r.animations); return r && r._cacheable && (n[o] = Object.freeze(l)), l } getSharedOptions(t) { if (t.$shared) return this._sharedOptions || (this._sharedOptions = Object.assign({}, t)) } includeOptions(t, e) { return !e || Ns(t) || this.chart._animationsDisabled } _getSharedOptions(t, e) { const i = this.resolveDataElementOptions(t, e), s = this._sharedOptions, n = this.getSharedOptions(i), o = this.includeOptions(e, n) || n !== s; return this.updateSharedOptions(n, e, i), { sharedOptions: n, includeOptions: o } } updateElement(t, e, i, s) { Ns(s) ? Object.assign(t, i) : this._resolveAnimations(e, s).update(t, i) } updateSharedOptions(t, e, i) { t && !Ns(e) && this._resolveAnimations(void 0, e).update(t, i) } _setStyle(t, e, i, s) { t.active = s; const n = this.getStyle(e, s); this._resolveAnimations(e, i, s).update(t, { options: !s && this.getSharedOptions(n) || n }) } removeHoverStyle(t, e, i) { this._setStyle(t, i, "active", !1) } setHoverStyle(t, e, i) { this._setStyle(t, i, "active", !0) } _removeDatasetHoverStyle() { const t = this._cachedMeta.dataset; t && this._setStyle(t, void 0, "active", !1) } _setDatasetHoverStyle() { const t = this._cachedMeta.dataset; t && this._setStyle(t, void 0, "active", !0) } _resyncElements(t) { const e = this._data, i = this._cachedMeta.data; for (const [t, e, i] of this._syncList) this[t](e, i); this._syncList = []; const s = i.length, n = e.length, o = Math.min(n, s); o && this.parse(0, o), n > s ? this._insertElements(s, n - s, t) : n < s && this._removeElements(n, s - n) } _insertElements(t, e, i = !0) { const s = this._cachedMeta, n = s.data, o = t + e; let a; const r = t => { for (t.length += e, a = t.length - 1; a >= o; a--)t[a] = t[a - e] }; for (r(n), a = t; a < o; ++a)n[a] = new this.dataElementType; this._parsing && r(s._parsed), this.parse(t, e), i && this.updateElements(n, t, e, "reset") } updateElements(t, e, i, s) { } _removeElements(t, e) { const i = this._cachedMeta; if (this._parsing) { const s = i._parsed.splice(t, e); i._stacked && Ws(i, s) } i.data.splice(t, e) } _sync(t) { if (this._parsing) this._syncList.push(t); else { const [e, i, s] = t; this[e](i, s) } this.chart._dataChanges.push([this.index, ...t]) } _onDataPush() { const t = arguments.length; this._sync(["_insertElements", this.getDataset().data.length - t, t]) } _onDataPop() { this._sync(["_removeElements", this._cachedMeta.data.length - 1, 1]) } _onDataShift() { this._sync(["_removeElements", 0, 1]) } _onDataSplice(t, e) { e && this._sync(["_removeElements", t, e]); const i = arguments.length - 2; i && this._sync(["_insertElements", t, i]) } _onDataUnshift() { this._sync(["_insertElements", 0, arguments.length]) } } class $s { static defaults = {}; static defaultRoutes = void 0; x; y; active = !1; options; $animations; tooltipPosition(t) { const { x: e, y: i } = this.getProps(["x", "y"], t); return { x: e, y: i } } hasValue() { return N(this.x) && N(this.y) } getProps(t, e) { const i = this.$animations; if (!e || !i) return this; const s = {}; return t.forEach((t => { s[t] = i[t] && i[t].active() ? i[t]._to : this[t] })), s } } function Ys(t, e) { const i = t.options.ticks, n = function (t) { const e = t.options.offset, i = t._tickSize(), s = t._length / i + (e ? 0 : 1), n = t._maxLength / i; return Math.floor(Math.min(s, n)) }(t), o = Math.min(i.maxTicksLimit || n, n), a = i.major.enabled ? function (t) { const e = []; let i, s; for (i = 0, s = t.length; i < s; i++)t[i].major && e.push(i); return e }(e) : [], r = a.length, l = a[0], h = a[r - 1], c = []; if (r > o) return function (t, e, i, s) { let n, o = 0, a = i[0]; for (s = Math.ceil(s), n = 0; n < t.length; n++)n === a && (e.push(t[n]), o++, a = i[o * s]) }(e, c, a, r / o), c; const d = function (t, e, i) { const s = function (t) { const e = t.length; let i, s; if (e < 2) return !1; for (s = t[0], i = 1; i < e; ++i)if (t[i] - t[i - 1] !== s) return !1; return s }(t), n = e.length / i; if (!s) return Math.max(n, 1); const o = W(s); for (let t = 0, e = o.length - 1; t < e; t++) { const e = o[t]; if (e > n) return e } return Math.max(n, 1) }(a, e, o); if (r > 0) { let t, i; const n = r > 1 ? Math.round((h - l) / (r - 1)) : null; for (Us(e, c, d, s(n) ? 0 : l - n, l), t = 0, i = r - 1; t < i; t++)Us(e, c, d, a[t], a[t + 1]); return Us(e, c, d, h, s(n) ? e.length : h + n), c } return Us(e, c, d), c } function Us(t, e, i, s, n) { const o = l(s, 0), a = Math.min(l(n, t.length), t.length); let r, h, c, d = 0; for (i = Math.ceil(i), n && (r = n - s, i = r / Math.floor(r / i)), c = o; c < 0;)d++, c = Math.round(o + d * i); for (h = Math.max(o, 0); h < a; h++)h === c && (e.push(t[h]), d++, c = Math.round(o + d * i)) } const Xs = (t, e, i) => "top" === e || "left" === e ? t[e] + i : t[e] - i, qs = (t, e) => Math.min(e || t, t); function Ks(t, e) { const i = [], s = t.length / e, n = t.length; let o = 0; for (; o < n; o += s)i.push(t[Math.floor(o)]); return i } function Gs(t, e, i) { const s = t.ticks.length, n = Math.min(e, s - 1), o = t._startPixel, a = t._endPixel, r = 1e-6; let l, h = t.getPixelForTick(n); if (!(i && (l = 1 === s ? Math.max(h - o, a - h) : 0 === e ? (t.getPixelForTick(1) - h) / 2 : (h - t.getPixelForTick(n - 1)) / 2, h += n < e ? l : -l, h < o - r || h > a + r))) return h } function Js(t) { return t.drawTicks ? t.tickLength : 0 } function Zs(t, e) { if (!t.display) return 0; const i = Si(t.font, e), s = ki(t.padding); return (n(t.text) ? t.text.length : 1) * i.lineHeight + s.height } function Qs(t, e, i) { let s = ut(t); return (i && "right" !== e || !i && "right" === e) && (s = (t => "left" === t ? "right" : "right" === t ? "left" : t)(s)), s } class tn extends $s { constructor(t) { super(), this.id = t.id, this.type = t.type, this.options = void 0, this.ctx = t.ctx, this.chart = t.chart, this.top = void 0, this.bottom = void 0, this.left = void 0, this.right = void 0, this.width = void 0, this.height = void 0, this._margins = { left: 0, right: 0, top: 0, bottom: 0 }, this.maxWidth = void 0, this.maxHeight = void 0, this.paddingTop = void 0, this.paddingBottom = void 0, this.paddingLeft = void 0, this.paddingRight = void 0, this.axis = void 0, this.labelRotation = void 0, this.min = void 0, this.max = void 0, this._range = void 0, this.ticks = [], this._gridLineItems = null, this._labelItems = null, this._labelSizes = null, this._length = 0, this._maxLength = 0, this._longestTextCache = {}, this._startPixel = void 0, this._endPixel = void 0, this._reversePixels = !1, this._userMax = void 0, this._userMin = void 0, this._suggestedMax = void 0, this._suggestedMin = void 0, this._ticksLength = 0, this._borderValue = 0, this._cache = {}, this._dataLimitsCached = !1, this.$context = void 0 } init(t) { this.options = t.setContext(this.getContext()), this.axis = t.axis, this._userMin = this.parse(t.min), this._userMax = this.parse(t.max), this._suggestedMin = this.parse(t.suggestedMin), this._suggestedMax = this.parse(t.suggestedMax) } parse(t, e) { return t } getUserBounds() { let { _userMin: t, _userMax: e, _suggestedMin: i, _suggestedMax: s } = this; return t = r(t, Number.POSITIVE_INFINITY), e = r(e, Number.NEGATIVE_INFINITY), i = r(i, Number.POSITIVE_INFINITY), s = r(s, Number.NEGATIVE_INFINITY), { min: r(t, i), max: r(e, s), minDefined: a(t), maxDefined: a(e) } } getMinMax(t) { let e, { min: i, max: s, minDefined: n, maxDefined: o } = this.getUserBounds(); if (n && o) return { min: i, max: s }; const a = this.getMatchingVisibleMetas(); for (let r = 0, l = a.length; r < l; ++r)e = a[r].controller.getMinMax(this, t), n || (i = Math.min(i, e.min)), o || (s = Math.max(s, e.max)); return i = o && i > s ? s : i, s = n && i > s ? i : s, { min: r(i, r(s, i)), max: r(s, r(i, s)) } } getPadding() { return { left: this.paddingLeft || 0, top: this.paddingTop || 0, right: this.paddingRight || 0, bottom: this.paddingBottom || 0 } } getTicks() { return this.ticks } getLabels() { const t = this.chart.data; return this.options.labels || (this.isHorizontal() ? t.xLabels : t.yLabels) || t.labels || [] } getLabelItems(t = this.chart.chartArea) { return this._labelItems || (this._labelItems = this._computeLabelItems(t)) } beforeLayout() { this._cache = {}, this._dataLimitsCached = !1 } beforeUpdate() { d(this.options.beforeUpdate, [this]) } update(t, e, i) { const { beginAtZero: s, grace: n, ticks: o } = this.options, a = o.sampleSize; this.beforeUpdate(), this.maxWidth = t, this.maxHeight = e, this._margins = i = Object.assign({ left: 0, right: 0, top: 0, bottom: 0 }, i), this.ticks = null, this._labelSizes = null, this._gridLineItems = null, this._labelItems = null, this.beforeSetDimensions(), this.setDimensions(), this.afterSetDimensions(), this._maxLength = this.isHorizontal() ? this.width + i.left + i.right : this.height + i.top + i.bottom, this._dataLimitsCached || (this.beforeDataLimits(), this.determineDataLimits(), this.afterDataLimits(), this._range = Di(this, n, s), this._dataLimitsCached = !0), this.beforeBuildTicks(), this.ticks = this.buildTicks() || [], this.afterBuildTicks(); const r = a < this.ticks.length; this._convertTicksToLabels(r ? Ks(this.ticks, a) : this.ticks), this.configure(), this.beforeCalculateLabelRotation(), this.calculateLabelRotation(), this.afterCalculateLabelRotation(), o.display && (o.autoSkip || "auto" === o.source) && (this.ticks = Ys(this, this.ticks), this._labelSizes = null, this.afterAutoSkip()), r && this._convertTicksToLabels(this.ticks), this.beforeFit(), this.fit(), this.afterFit(), this.afterUpdate() } configure() { let t, e, i = this.options.reverse; this.isHorizontal() ? (t = this.left, e = this.right) : (t = this.top, e = this.bottom, i = !i), this._startPixel = t, this._endPixel = e, this._reversePixels = i, this._length = e - t, this._alignToPixels = this.options.alignToPixels } afterUpdate() { d(this.options.afterUpdate, [this]) } beforeSetDimensions() { d(this.options.beforeSetDimensions, [this]) } setDimensions() { this.isHorizontal() ? (this.width = this.maxWidth, this.left = 0, this.right = this.width) : (this.height = this.maxHeight, this.top = 0, this.bottom = this.height), this.paddingLeft = 0, this.paddingTop = 0, this.paddingRight = 0, this.paddingBottom = 0 } afterSetDimensions() { d(this.options.afterSetDimensions, [this]) } _callHooks(t) { this.chart.notifyPlugins(t, this.getContext()), d(this.options[t], [this]) } beforeDataLimits() { this._callHooks("beforeDataLimits") } determineDataLimits() { } afterDataLimits() { this._callHooks("afterDataLimits") } beforeBuildTicks() { this._callHooks("beforeBuildTicks") } buildTicks() { return [] } afterBuildTicks() { this._callHooks("afterBuildTicks") } beforeTickToLabelConversion() { d(this.options.beforeTickToLabelConversion, [this]) } generateTickLabels(t) { const e = this.options.ticks; let i, s, n; for (i = 0, s = t.length; i < s; i++)n = t[i], n.label = d(e.callback, [n.value, i, t], this) } afterTickToLabelConversion() { d(this.options.afterTickToLabelConversion, [this]) } beforeCalculateLabelRotation() { d(this.options.beforeCalculateLabelRotation, [this]) } calculateLabelRotation() { const t = this.options, e = t.ticks, i = qs(this.ticks.length, t.ticks.maxTicksLimit), s = e.minRotation || 0, n = e.maxRotation; let o, a, r, l = s; if (!this._isVisible() || !e.display || s >= n || i <= 1 || !this.isHorizontal()) return void (this.labelRotation = s); const h = this._getLabelSizes(), c = h.widest.width, d = h.highest.height, u = Z(this.chart.width - c, 0, this.maxWidth); o = t.offset ? this.maxWidth / i : u / (i - 1), c + 6 > o && (o = u / (i - (t.offset ? .5 : 1)), a = this.maxHeight - Js(t.grid) - e.padding - Zs(t.title, this.chart.options.font), r = Math.sqrt(c * c + d * d), l = Y(Math.min(Math.asin(Z((h.highest.height + 6) / o, -1, 1)), Math.asin(Z(a / r, -1, 1)) - Math.asin(Z(d / r, -1, 1)))), l = Math.max(s, Math.min(n, l))), this.labelRotation = l } afterCalculateLabelRotation() { d(this.options.afterCalculateLabelRotation, [this]) } afterAutoSkip() { } beforeFit() { d(this.options.beforeFit, [this]) } fit() { const t = { width: 0, height: 0 }, { chart: e, options: { ticks: i, title: s, grid: n } } = this, o = this._isVisible(), a = this.isHorizontal(); if (o) { const o = Zs(s, e.options.font); if (a ? (t.width = this.maxWidth, t.height = Js(n) + o) : (t.height = this.maxHeight, t.width = Js(n) + o), i.display && this.ticks.length) { const { first: e, last: s, widest: n, highest: o } = this._getLabelSizes(), r = 2 * i.padding, l = $(this.labelRotation), h = Math.cos(l), c = Math.sin(l); if (a) { const e = i.mirror ? 0 : c * n.width + h * o.height; t.height = Math.min(this.maxHeight, t.height + e + r) } else { const e = i.mirror ? 0 : h * n.width + c * o.height; t.width = Math.min(this.maxWidth, t.width + e + r) } this._calculatePadding(e, s, c, h) } } this._handleMargins(), a ? (this.width = this._length = e.width - this._margins.left - this._margins.right, this.height = t.height) : (this.width = t.width, this.height = this._length = e.height - this._margins.top - this._margins.bottom) } _calculatePadding(t, e, i, s) { const { ticks: { align: n, padding: o }, position: a } = this.options, r = 0 !== this.labelRotation, l = "top" !== a && "x" === this.axis; if (this.isHorizontal()) { const a = this.getPixelForTick(0) - this.left, h = this.right - this.getPixelForTick(this.ticks.length - 1); let c = 0, d = 0; r ? l ? (c = s * t.width, d = i * e.height) : (c = i * t.height, d = s * e.width) : "start" === n ? d = e.width : "end" === n ? c = t.width : "inner" !== n && (c = t.width / 2, d = e.width / 2), this.paddingLeft = Math.max((c - a + o) * this.width / (this.width - a), 0), this.paddingRight = Math.max((d - h + o) * this.width / (this.width - h), 0) } else { let i = e.height / 2, s = t.height / 2; "start" === n ? (i = 0, s = t.height) : "end" === n && (i = e.height, s = 0), this.paddingTop = i + o, this.paddingBottom = s + o } } _handleMargins() { this._margins && (this._margins.left = Math.max(this.paddingLeft, this._margins.left), this._margins.top = Math.max(this.paddingTop, this._margins.top), this._margins.right = Math.max(this.paddingRight, this._margins.right), this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom)) } afterFit() { d(this.options.afterFit, [this]) } isHorizontal() { const { axis: t, position: e } = this.options; return "top" === e || "bottom" === e || "x" === t } isFullSize() { return this.options.fullSize } _convertTicksToLabels(t) { let e, i; for (this.beforeTickToLabelConversion(), this.generateTickLabels(t), e = 0, i = t.length; e < i; e++)s(t[e].label) && (t.splice(e, 1), i--, e--); this.afterTickToLabelConversion() } _getLabelSizes() { let t = this._labelSizes; if (!t) { const e = this.options.ticks.sampleSize; let i = this.ticks; e < i.length && (i = Ks(i, e)), this._labelSizes = t = this._computeLabelSizes(i, i.length, this.options.ticks.maxTicksLimit) } return t } _computeLabelSizes(t, e, i) { const { ctx: o, _longestTextCache: a } = this, r = [], l = [], h = Math.floor(e / qs(e, i)); let c, d, f, g, p, m, x, b, _, y, v, M = 0, w = 0; for (c = 0; c < e; c += h) { if (g = t[c].label, p = this._resolveTickFontOptions(c), o.font = m = p.string, x = a[m] = a[m] || { data: {}, gc: [] }, b = p.lineHeight, _ = y = 0, s(g) || n(g)) { if (n(g)) for (d = 0, f = g.length; d < f; ++d)v = g[d], s(v) || n(v) || (_ = Ce(o, x.data, x.gc, _, v), y += b) } else _ = Ce(o, x.data, x.gc, _, g), y = b; r.push(_), l.push(y), M = Math.max(_, M), w = Math.max(y, w) } !function (t, e) { u(t, (t => { const i = t.gc, s = i.length / 2; let n; if (s > e) { for (n = 0; n < s; ++n)delete t.data[i[n]]; i.splice(0, s) } })) }(a, e); const k = r.indexOf(M), S = l.indexOf(w), P = t => ({ width: r[t] || 0, height: l[t] || 0 }); return { first: P(0), last: P(e - 1), widest: P(k), highest: P(S), widths: r, heights: l } } getLabelForValue(t) { return t } getPixelForValue(t, e) { return NaN } getValueForPixel(t) { } getPixelForTick(t) { const e = this.ticks; return t < 0 || t > e.length - 1 ? null : this.getPixelForValue(e[t].value) } getPixelForDecimal(t) { this._reversePixels && (t = 1 - t); const e = this._startPixel + t * this._length; return Q(this._alignToPixels ? Ae(this.chart, e, 0) : e) } getDecimalForPixel(t) { const e = (t - this._startPixel) / this._length; return this._reversePixels ? 1 - e : e } getBasePixel() { return this.getPixelForValue(this.getBaseValue()) } getBaseValue() { const { min: t, max: e } = this; return t < 0 && e < 0 ? e : t > 0 && e > 0 ? t : 0 } getContext(t) { const e = this.ticks || []; if (t >= 0 && t < e.length) { const i = e[t]; return i.$context || (i.$context = function (t, e, i) { return Ci(t, { tick: i, index: e, type: "tick" }) }(this.getContext(), t, i)) } return this.$context || (this.$context = Ci(this.chart.getContext(), { scale: this, type: "scale" })) } _tickSize() { const t = this.options.ticks, e = $(this.labelRotation), i = Math.abs(Math.cos(e)), s = Math.abs(Math.sin(e)), n = this._getLabelSizes(), o = t.autoSkipPadding || 0, a = n ? n.widest.width + o : 0, r = n ? n.highest.height + o : 0; return this.isHorizontal() ? r * i > a * s ? a / i : r / s : r * s < a * i ? r / i : a / s } _isVisible() { const t = this.options.display; return "auto" !== t ? !!t : this.getMatchingVisibleMetas().length > 0 } _computeGridLineItems(t) { const e = this.axis, i = this.chart, s = this.options, { grid: n, position: a, border: r } = s, h = n.offset, c = this.isHorizontal(), d = this.ticks.length + (h ? 1 : 0), u = Js(n), f = [], g = r.setContext(this.getContext()), p = g.display ? g.width : 0, m = p / 2, x = function (t) { return Ae(i, t, p) }; let b, _, y, v, M, w, k, S, P, D, C, O; if ("top" === a) b = x(this.bottom), w = this.bottom - u, S = b - m, D = x(t.top) + m, O = t.bottom; else if ("bottom" === a) b = x(this.top), D = t.top, O = x(t.bottom) - m, w = b + m, S = this.top + u; else if ("left" === a) b = x(this.right), M = this.right - u, k = b - m, P = x(t.left) + m, C = t.right; else if ("right" === a) b = x(this.left), P = t.left, C = x(t.right) - m, M = b + m, k = this.left + u; else if ("x" === e) { if ("center" === a) b = x((t.top + t.bottom) / 2 + .5); else if (o(a)) { const t = Object.keys(a)[0], e = a[t]; b = x(this.chart.scales[t].getPixelForValue(e)) } D = t.top, O = t.bottom, w = b + m, S = w + u } else if ("y" === e) { if ("center" === a) b = x((t.left + t.right) / 2); else if (o(a)) { const t = Object.keys(a)[0], e = a[t]; b = x(this.chart.scales[t].getPixelForValue(e)) } M = b - m, k = M - u, P = t.left, C = t.right } const A = l(s.ticks.maxTicksLimit, d), T = Math.max(1, Math.ceil(d / A)); for (_ = 0; _ < d; _ += T) { const t = this.getContext(_), e = n.setContext(t), s = r.setContext(t), o = e.lineWidth, a = e.color, l = s.dash || [], d = s.dashOffset, u = e.tickWidth, g = e.tickColor, p = e.tickBorderDash || [], m = e.tickBorderDashOffset; y = Gs(this, _, h), void 0 !== y && (v = Ae(i, y, o), c ? M = k = P = C = v : w = S = D = O = v, f.push({ tx1: M, ty1: w, tx2: k, ty2: S, x1: P, y1: D, x2: C, y2: O, width: o, color: a, borderDash: l, borderDashOffset: d, tickWidth: u, tickColor: g, tickBorderDash: p, tickBorderDashOffset: m })) } return this._ticksLength = d, this._borderValue = b, f } _computeLabelItems(t) { const e = this.axis, i = this.options, { position: s, ticks: a } = i, r = this.isHorizontal(), l = this.ticks, { align: h, crossAlign: c, padding: d, mirror: u } = a, f = Js(i.grid), g = f + d, p = u ? -d : g, m = -$(this.labelRotation), x = []; let b, _, y, v, M, w, k, S, P, D, C, O, A = "middle"; if ("top" === s) w = this.bottom - p, k = this._getXAxisLabelAlignment(); else if ("bottom" === s) w = this.top + p, k = this._getXAxisLabelAlignment(); else if ("left" === s) { const t = this._getYAxisLabelAlignment(f); k = t.textAlign, M = t.x } else if ("right" === s) { const t = this._getYAxisLabelAlignment(f); k = t.textAlign, M = t.x } else if ("x" === e) { if ("center" === s) w = (t.top + t.bottom) / 2 + g; else if (o(s)) { const t = Object.keys(s)[0], e = s[t]; w = this.chart.scales[t].getPixelForValue(e) + g } k = this._getXAxisLabelAlignment() } else if ("y" === e) { if ("center" === s) M = (t.left + t.right) / 2 - g; else if (o(s)) { const t = Object.keys(s)[0], e = s[t]; M = this.chart.scales[t].getPixelForValue(e) } k = this._getYAxisLabelAlignment(f).textAlign } "y" === e && ("start" === h ? A = "top" : "end" === h && (A = "bottom")); const T = this._getLabelSizes(); for (b = 0, _ = l.length; b < _; ++b) { y = l[b], v = y.label; const t = a.setContext(this.getContext(b)); S = this.getPixelForTick(b) + a.labelOffset, P = this._resolveTickFontOptions(b), D = P.lineHeight, C = n(v) ? v.length : 1; const e = C / 2, i = t.color, o = t.textStrokeColor, h = t.textStrokeWidth; let d, f = k; if (r ? (M = S, "inner" === k && (f = b === _ - 1 ? this.options.reverse ? "left" : "right" : 0 === b ? this.options.reverse ? "right" : "left" : "center"), O = "top" === s ? "near" === c || 0 !== m ? -C * D + D / 2 : "center" === c ? -T.highest.height / 2 - e * D + D : -T.highest.height + D / 2 : "near" === c || 0 !== m ? D / 2 : "center" === c ? T.highest.height / 2 - e * D : T.highest.height - C * D, u && (O *= -1), 0 === m || t.showLabelBackdrop || (M += D / 2 * Math.sin(m))) : (w = S, O = (1 - C) * D / 2), t.showLabelBackdrop) { const e = ki(t.backdropPadding), i = T.heights[b], s = T.widths[b]; let n = O - e.top, o = 0 - e.left; switch (A) { case "middle": n -= i / 2; break; case "bottom": n -= i }switch (k) { case "center": o -= s / 2; break; case "right": o -= s; break; case "inner": b === _ - 1 ? o -= s : b > 0 && (o -= s / 2) }d = { left: o, top: n, width: s + e.width, height: i + e.height, color: t.backdropColor } } x.push({ label: v, font: P, textOffset: O, options: { rotation: m, color: i, strokeColor: o, strokeWidth: h, textAlign: f, textBaseline: A, translation: [M, w], backdrop: d } }) } return x } _getXAxisLabelAlignment() { const { position: t, ticks: e } = this.options; if (-$(this.labelRotation)) return "top" === t ? "left" : "right"; let i = "center"; return "start" === e.align ? i = "left" : "end" === e.align ? i = "right" : "inner" === e.align && (i = "inner"), i } _getYAxisLabelAlignment(t) { const { position: e, ticks: { crossAlign: i, mirror: s, padding: n } } = this.options, o = t + n, a = this._getLabelSizes().widest.width; let r, l; return "left" === e ? s ? (l = this.right + n, "near" === i ? r = "left" : "center" === i ? (r = "center", l += a / 2) : (r = "right", l += a)) : (l = this.right - o, "near" === i ? r = "right" : "center" === i ? (r = "center", l -= a / 2) : (r = "left", l = this.left)) : "right" === e ? s ? (l = this.left + n, "near" === i ? r = "right" : "center" === i ? (r = "center", l -= a / 2) : (r = "left", l -= a)) : (l = this.left + o, "near" === i ? r = "left" : "center" === i ? (r = "center", l += a / 2) : (r = "right", l = this.right)) : r = "right", { textAlign: r, x: l } } _computeLabelArea() { if (this.options.ticks.mirror) return; const t = this.chart, e = this.options.position; return "left" === e || "right" === e ? { top: 0, left: this.left, bottom: t.height, right: this.right } : "top" === e || "bottom" === e ? { top: this.top, left: 0, bottom: this.bottom, right: t.width } : void 0 } drawBackground() { const { ctx: t, options: { backgroundColor: e }, left: i, top: s, width: n, height: o } = this; e && (t.save(), t.fillStyle = e, t.fillRect(i, s, n, o), t.restore()) } getLineWidthForValue(t) { const e = this.options.grid; if (!this._isVisible() || !e.display) return 0; const i = this.ticks.findIndex((e => e.value === t)); if (i >= 0) { return e.setContext(this.getContext(i)).lineWidth } return 0 } drawGrid(t) { const e = this.options.grid, i = this.ctx, s = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(t)); let n, o; const a = (t, e, s) => { s.width && s.color && (i.save(), i.lineWidth = s.width, i.strokeStyle = s.color, i.setLineDash(s.borderDash || []), i.lineDashOffset = s.borderDashOffset, i.beginPath(), i.moveTo(t.x, t.y), i.lineTo(e.x, e.y), i.stroke(), i.restore()) }; if (e.display) for (n = 0, o = s.length; n < o; ++n) { const t = s[n]; e.drawOnChartArea && a({ x: t.x1, y: t.y1 }, { x: t.x2, y: t.y2 }, t), e.drawTicks && a({ x: t.tx1, y: t.ty1 }, { x: t.tx2, y: t.ty2 }, { color: t.tickColor, width: t.tickWidth, borderDash: t.tickBorderDash, borderDashOffset: t.tickBorderDashOffset }) } } drawBorder() { const { chart: t, ctx: e, options: { border: i, grid: s } } = this, n = i.setContext(this.getContext()), o = i.display ? n.width : 0; if (!o) return; const a = s.setContext(this.getContext(0)).lineWidth, r = this._borderValue; let l, h, c, d; this.isHorizontal() ? (l = Ae(t, this.left, o) - o / 2, h = Ae(t, this.right, a) + a / 2, c = d = r) : (c = Ae(t, this.top, o) - o / 2, d = Ae(t, this.bottom, a) + a / 2, l = h = r), e.save(), e.lineWidth = n.width, e.strokeStyle = n.color, e.beginPath(), e.moveTo(l, c), e.lineTo(h, d), e.stroke(), e.restore() } drawLabels(t) { if (!this.options.ticks.display) return; const e = this.ctx, i = this._computeLabelArea(); i && Ie(e, i); const s = this.getLabelItems(t); for (const t of s) { const i = t.options, s = t.font; Ne(e, t.label, 0, t.textOffset, s, i) } i && ze(e) } drawTitle() { const { ctx: t, options: { position: e, title: i, reverse: s } } = this; if (!i.display) return; const a = Si(i.font), r = ki(i.padding), l = i.align; let h = a.lineHeight / 2; "bottom" === e || "center" === e || o(e) ? (h += r.bottom, n(i.text) && (h += a.lineHeight * (i.text.length - 1))) : h += r.top; const { titleX: c, titleY: d, maxWidth: u, rotation: f } = function (t, e, i, s) { const { top: n, left: a, bottom: r, right: l, chart: h } = t, { chartArea: c, scales: d } = h; let u, f, g, p = 0; const m = r - n, x = l - a; if (t.isHorizontal()) { if (f = ft(s, a, l), o(i)) { const t = Object.keys(i)[0], s = i[t]; g = d[t].getPixelForValue(s) + m - e } else g = "center" === i ? (c.bottom + c.top) / 2 + m - e : Xs(t, i, e); u = l - a } else { if (o(i)) { const t = Object.keys(i)[0], s = i[t]; f = d[t].getPixelForValue(s) - x + e } else f = "center" === i ? (c.left + c.right) / 2 - x + e : Xs(t, i, e); g = ft(s, r, n), p = "left" === i ? -E : E } return { titleX: f, titleY: g, maxWidth: u, rotation: p } }(this, h, e, l); Ne(t, i.text, 0, 0, a, { color: i.color, maxWidth: u, rotation: f, textAlign: Qs(l, e, s), textBaseline: "middle", translation: [c, d] }) } draw(t) { this._isVisible() && (this.drawBackground(), this.drawGrid(t), this.drawBorder(), this.drawTitle(), this.drawLabels(t)) } _layers() { const t = this.options, e = t.ticks && t.ticks.z || 0, i = l(t.grid && t.grid.z, -1), s = l(t.border && t.border.z, 0); return this._isVisible() && this.draw === tn.prototype.draw ? [{ z: i, draw: t => { this.drawBackground(), this.drawGrid(t), this.drawTitle() } }, { z: s, draw: () => { this.drawBorder() } }, { z: e, draw: t => { this.drawLabels(t) } }] : [{ z: e, draw: t => { this.draw(t) } }] } getMatchingVisibleMetas(t) { const e = this.chart.getSortedVisibleDatasetMetas(), i = this.axis + "AxisID", s = []; let n, o; for (n = 0, o = e.length; n < o; ++n) { const o = e[n]; o[i] !== this.id || t && o.type !== t || s.push(o) } return s } _resolveTickFontOptions(t) { return Si(this.options.ticks.setContext(this.getContext(t)).font) } _maxDigits() { const t = this._resolveTickFontOptions(0).lineHeight; return (this.isHorizontal() ? this.width : this.height) / t } } class en { constructor(t, e, i) { this.type = t, this.scope = e, this.override = i, this.items = Object.create(null) } isForType(t) { return Object.prototype.isPrototypeOf.call(this.type.prototype, t.prototype) } register(t) { const e = Object.getPrototypeOf(t); let i; (function (t) { return "id" in t && "defaults" in t })(e) && (i = this.register(e)); const s = this.items, n = t.id, o = this.scope + "." + n; if (!n) throw new Error("class does not have id: " + t); return n in s || (s[n] = t, function (t, e, i) { const s = x(Object.create(null), [i ? ue.get(i) : {}, ue.get(e), t.defaults]); ue.set(e, s), t.defaultRoutes && function (t, e) { Object.keys(e).forEach((i => { const s = i.split("."), n = s.pop(), o = [t].concat(s).join("."), a = e[i].split("."), r = a.pop(), l = a.join("."); ue.route(o, n, l, r) })) }(e, t.defaultRoutes); t.descriptors && ue.describe(e, t.descriptors) }(t, o, i), this.override && ue.override(t.id, t.overrides)), o } get(t) { return this.items[t] } unregister(t) { const e = this.items, i = t.id, s = this.scope; i in e && delete e[i], s && i in ue[s] && (delete ue[s][i], this.override && delete re[i]) } } class sn { constructor() { this.controllers = new en(js, "datasets", !0), this.elements = new en($s, "elements"), this.plugins = new en(Object, "plugins"), this.scales = new en(tn, "scales"), this._typedRegistries = [this.controllers, this.scales, this.elements] } add(...t) { this._each("register", t) } remove(...t) { this._each("unregister", t) } addControllers(...t) { this._each("register", t, this.controllers) } addElements(...t) { this._each("register", t, this.elements) } addPlugins(...t) { this._each("register", t, this.plugins) } addScales(...t) { this._each("register", t, this.scales) } getController(t) { return this._get(t, this.controllers, "controller") } getElement(t) { return this._get(t, this.elements, "element") } getPlugin(t) { return this._get(t, this.plugins, "plugin") } getScale(t) { return this._get(t, this.scales, "scale") } removeControllers(...t) { this._each("unregister", t, this.controllers) } removeElements(...t) { this._each("unregister", t, this.elements) } removePlugins(...t) { this._each("unregister", t, this.plugins) } removeScales(...t) { this._each("unregister", t, this.scales) } _each(t, e, i) { [...e].forEach((e => { const s = i || this._getRegistryForType(e); i || s.isForType(e) || s === this.plugins && e.id ? this._exec(t, s, e) : u(e, (e => { const s = i || this._getRegistryForType(e); this._exec(t, s, e) })) })) } _exec(t, e, i) { const s = w(t); d(i["before" + s], [], i), e[t](i), d(i["after" + s], [], i) } _getRegistryForType(t) { for (let e = 0; e < this._typedRegistries.length; e++) { const i = this._typedRegistries[e]; if (i.isForType(t)) return i } return this.plugins } _get(t, e, i) { const s = e.get(t); if (void 0 === s) throw new Error('"' + t + '" is not a registered ' + i + "."); return s } } var nn = new sn; class on { constructor() { this._init = void 0 } notify(t, e, i, s) { if ("beforeInit" === e && (this._init = this._createDescriptors(t, !0), this._notify(this._init, t, "install")), void 0 === this._init) return; const n = s ? this._descriptors(t).filter(s) : this._descriptors(t), o = this._notify(n, t, e, i); return "afterDestroy" === e && (this._notify(n, t, "stop"), this._notify(this._init, t, "uninstall"), this._init = void 0), o } _notify(t, e, i, s) { s = s || {}; for (const n of t) { const t = n.plugin; if (!1 === d(t[i], [e, s, n.options], t) && s.cancelable) return !1 } return !0 } invalidate() { s(this._cache) || (this._oldCache = this._cache, this._cache = void 0) } _descriptors(t) { if (this._cache) return this._cache; const e = this._cache = this._createDescriptors(t); return this._notifyStateChanges(t), e } _createDescriptors(t, e) { const i = t && t.config, s = l(i.options && i.options.plugins, {}), n = function (t) { const e = {}, i = [], s = Object.keys(nn.plugins.items); for (let t = 0; t < s.length; t++)i.push(nn.getPlugin(s[t])); const n = t.plugins || []; for (let t = 0; t < n.length; t++) { const s = n[t]; -1 === i.indexOf(s) && (i.push(s), e[s.id] = !0) } return { plugins: i, localIds: e } }(i); return !1 !== s || e ? function (t, { plugins: e, localIds: i }, s, n) { const o = [], a = t.getContext(); for (const r of e) { const e = r.id, l = an(s[e], n); null !== l && o.push({ plugin: r, options: rn(t.config, { plugin: r, local: i[e] }, l, a) }) } return o }(t, n, s, e) : [] } _notifyStateChanges(t) { const e = this._oldCache || [], i = this._cache, s = (t, e) => t.filter((t => !e.some((e => t.plugin.id === e.plugin.id)))); this._notify(s(e, i), t, "stop"), this._notify(s(i, e), t, "start") } } function an(t, e) { return e || !1 !== t ? !0 === t ? {} : t : null } function rn(t, { plugin: e, local: i }, s, n) { const o = t.pluginScopeKeys(e), a = t.getOptionScopes(s, o); return i && e.defaults && a.push(e.defaults), t.createResolver(a, n, [""], { scriptable: !1, indexable: !1, allKeys: !0 }) } function ln(t, e) { const i = ue.datasets[t] || {}; return ((e.datasets || {})[t] || {}).indexAxis || e.indexAxis || i.indexAxis || "x" } function hn(t) { if ("x" === t || "y" === t || "r" === t) return t } function cn(t, ...e) { if (hn(t)) return t; for (const s of e) { const e = s.axis || ("top" === (i = s.position) || "bottom" === i ? "x" : "left" === i || "right" === i ? "y" : void 0) || t.length > 1 && hn(t[0].toLowerCase()); if (e) return e } var i; throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`) } function dn(t, e, i) { if (i[e + "AxisID"] === t) return { axis: e } } function un(t, e) { const i = re[t.type] || { scales: {} }, s = e.scales || {}, n = ln(t.type, e), a = Object.create(null); return Object.keys(s).forEach((e => { const r = s[e]; if (!o(r)) return console.error(`Invalid scale configuration for scale: ${e}`); if (r._proxy) return console.warn(`Ignoring resolver passed as options for scale: ${e}`); const l = cn(e, r, function (t, e) { if (e.data && e.data.datasets) { const i = e.data.datasets.filter((e => e.xAxisID === t || e.yAxisID === t)); if (i.length) return dn(t, "x", i[0]) || dn(t, "y", i[0]) } return {} }(e, t), ue.scales[r.type]), h = function (t, e) { return t === e ? "_index_" : "_value_" }(l, n), c = i.scales || {}; a[e] = b(Object.create(null), [{ axis: l }, r, c[l], c[h]]) })), t.data.datasets.forEach((i => { const n = i.type || t.type, o = i.indexAxis || ln(n, e), r = (re[n] || {}).scales || {}; Object.keys(r).forEach((t => { const e = function (t, e) { let i = t; return "_index_" === t ? i = e : "_value_" === t && (i = "x" === e ? "y" : "x"), i }(t, o), n = i[e + "AxisID"] || e; a[n] = a[n] || Object.create(null), b(a[n], [{ axis: e }, s[n], r[t]]) })) })), Object.keys(a).forEach((t => { const e = a[t]; b(e, [ue.scales[e.type], ue.scale]) })), a } function fn(t) { const e = t.options || (t.options = {}); e.plugins = l(e.plugins, {}), e.scales = un(t, e) } function gn(t) { return (t = t || {}).datasets = t.datasets || [], t.labels = t.labels || [], t } const pn = new Map, mn = new Set; function xn(t, e) { let i = pn.get(t); return i || (i = e(), pn.set(t, i), mn.add(i)), i } const bn = (t, e, i) => { const s = M(e, i); void 0 !== s && t.add(s) }; class _n { constructor(t) { this._config = function (t) { return (t = t || {}).data = gn(t.data), fn(t), t }(t), this._scopeCache = new Map, this._resolverCache = new Map } get platform() { return this._config.platform } get type() { return this._config.type } set type(t) { this._config.type = t } get data() { return this._config.data } set data(t) { this._config.data = gn(t) } get options() { return this._config.options } set options(t) { this._config.options = t } get plugins() { return this._config.plugins } update() { const t = this._config; this.clearCache(), fn(t) } clearCache() { this._scopeCache.clear(), this._resolverCache.clear() } datasetScopeKeys(t) { return xn(t, (() => [[`datasets.${t}`, ""]])) } datasetAnimationScopeKeys(t, e) { return xn(`${t}.transition.${e}`, (() => [[`datasets.${t}.transitions.${e}`, `transitions.${e}`], [`datasets.${t}`, ""]])) } datasetElementScopeKeys(t, e) { return xn(`${t}-${e}`, (() => [[`datasets.${t}.elements.${e}`, `datasets.${t}`, `elements.${e}`, ""]])) } pluginScopeKeys(t) { const e = t.id; return xn(`${this.type}-plugin-${e}`, (() => [[`plugins.${e}`, ...t.additionalOptionScopes || []]])) } _cachedScopes(t, e) { const i = this._scopeCache; let s = i.get(t); return s && !e || (s = new Map, i.set(t, s)), s } getOptionScopes(t, e, i) { const { options: s, type: n } = this, o = this._cachedScopes(t, i), a = o.get(e); if (a) return a; const r = new Set; e.forEach((e => { t && (r.add(t), e.forEach((e => bn(r, t, e)))), e.forEach((t => bn(r, s, t))), e.forEach((t => bn(r, re[n] || {}, t))), e.forEach((t => bn(r, ue, t))), e.forEach((t => bn(r, le, t))) })); const l = Array.from(r); return 0 === l.length && l.push(Object.create(null)), mn.has(e) && o.set(e, l), l } chartOptionScopes() { const { options: t, type: e } = this; return [t, re[e] || {}, ue.datasets[e] || {}, { type: e }, ue, le] } resolveNamedOptions(t, e, i, s = [""]) { const o = { $shared: !0 }, { resolver: a, subPrefixes: r } = yn(this._resolverCache, t, s); let l = a; if (function (t, e) { const { isScriptable: i, isIndexable: s } = Ye(t); for (const o of e) { const e = i(o), a = s(o), r = (a || e) && t[o]; if (e && (S(r) || vn(r)) || a && n(r)) return !0 } return !1 }(a, e)) { o.$shared = !1; l = $e(a, i = S(i) ? i() : i, this.createResolver(t, i, r)) } for (const t of e) o[t] = l[t]; return o } createResolver(t, e, i = [""], s) { const { resolver: n } = yn(this._resolverCache, t, i); return o(e) ? $e(n, e, void 0, s) : n } } function yn(t, e, i) { let s = t.get(e); s || (s = new Map, t.set(e, s)); const n = i.join(); let o = s.get(n); if (!o) { o = { resolver: je(e, i), subPrefixes: i.filter((t => !t.toLowerCase().includes("hover"))) }, s.set(n, o) } return o } const vn = t => o(t) && Object.getOwnPropertyNames(t).some((e => S(t[e]))); const Mn = ["top", "bottom", "left", "right", "chartArea"]; function wn(t, e) { return "top" === t || "bottom" === t || -1 === Mn.indexOf(t) && "x" === e } function kn(t, e) { return function (i, s) { return i[t] === s[t] ? i[e] - s[e] : i[t] - s[t] } } function Sn(t) { const e = t.chart, i = e.options.animation; e.notifyPlugins("afterRender"), d(i && i.onComplete, [t], e) } function Pn(t) { const e = t.chart, i = e.options.animation; d(i && i.onProgress, [t], e) } function Dn(t) { return fe() && "string" == typeof t ? t = document.getElementById(t) : t && t.length && (t = t[0]), t && t.canvas && (t = t.canvas), t } const Cn = {}, On = t => { const e = Dn(t); return Object.values(Cn).filter((t => t.canvas === e)).pop() }; function An(t, e, i) { const s = Object.keys(t); for (const n of s) { const s = +n; if (s >= e) { const o = t[n]; delete t[n], (i > 0 || s > e) && (t[s + i] = o) } } } class Tn { static defaults = ue; static instances = Cn; static overrides = re; static registry = nn; static version = "4.5.1"; static getChart = On; static register(...t) { nn.add(...t), Ln() } static unregister(...t) { nn.remove(...t), Ln() } constructor(t, e) { const s = this.config = new _n(e), n = Dn(t), o = On(n); if (o) throw new Error("Canvas is already in use. Chart with ID '" + o.id + "' must be destroyed before the canvas with ID '" + o.canvas.id + "' can be reused."); const a = s.createResolver(s.chartOptionScopes(), this.getContext()); this.platform = new (s.platform || Ps(n)), this.platform.updateConfig(s); const r = this.platform.acquireContext(n, a.aspectRatio), l = r && r.canvas, h = l && l.height, c = l && l.width; this.id = i(), this.ctx = r, this.canvas = l, this.width = c, this.height = h, this._options = a, this._aspectRatio = this.aspectRatio, this._layers = [], this._metasets = [], this._stacks = void 0, this.boxes = [], this.currentDevicePixelRatio = void 0, this.chartArea = void 0, this._active = [], this._lastEvent = void 0, this._listeners = {}, this._responsiveListeners = void 0, this._sortedMetasets = [], this.scales = {}, this._plugins = new on, this.$proxies = {}, this._hiddenIndices = {}, this.attached = !1, this._animationsDisabled = void 0, this.$context = void 0, this._doResize = dt((t => this.update(t)), a.resizeDelay || 0), this._dataChanges = [], Cn[this.id] = this, r && l ? (bt.listen(this, "complete", Sn), bt.listen(this, "progress", Pn), this._initialize(), this.attached && this.update()) : console.error("Failed to create chart: can't acquire context from the given item") } get aspectRatio() { const { options: { aspectRatio: t, maintainAspectRatio: e }, width: i, height: n, _aspectRatio: o } = this; return s(t) ? e && o ? o : n ? i / n : null : t } get data() { return this.config.data } set data(t) { this.config.data = t } get options() { return this._options } set options(t) { this.config.options = t } get registry() { return nn } _initialize() { return this.notifyPlugins("beforeInit"), this.options.responsive ? this.resize() : ke(this, this.options.devicePixelRatio), this.bindEvents(), this.notifyPlugins("afterInit"), this } clear() { return Te(this.canvas, this.ctx), this } stop() { return bt.stop(this), this } resize(t, e) { bt.running(this) ? this._resizeBeforeDraw = { width: t, height: e } : this._resize(t, e) } _resize(t, e) { const i = this.options, s = this.canvas, n = i.maintainAspectRatio && this.aspectRatio, o = this.platform.getMaximumSize(s, t, e, n), a = i.devicePixelRatio || this.platform.getDevicePixelRatio(), r = this.width ? "resize" : "attach"; this.width = o.width, this.height = o.height, this._aspectRatio = this.aspectRatio, ke(this, a, !0) && (this.notifyPlugins("resize", { size: o }), d(i.onResize, [this, o], this), this.attached && this._doResize(r) && this.render()) } ensureScalesHaveIDs() { u(this.options.scales || {}, ((t, e) => { t.id = e })) } buildOrUpdateScales() { const t = this.options, e = t.scales, i = this.scales, s = Object.keys(i).reduce(((t, e) => (t[e] = !1, t)), {}); let n = []; e && (n = n.concat(Object.keys(e).map((t => { const i = e[t], s = cn(t, i), n = "r" === s, o = "x" === s; return { options: i, dposition: n ? "chartArea" : o ? "bottom" : "left", dtype: n ? "radialLinear" : o ? "category" : "linear" } })))), u(n, (e => { const n = e.options, o = n.id, a = cn(o, n), r = l(n.type, e.dtype); void 0 !== n.position && wn(n.position, a) === wn(e.dposition) || (n.position = e.dposition), s[o] = !0; let h = null; if (o in i && i[o].type === r) h = i[o]; else { h = new (nn.getScale(r))({ id: o, type: r, ctx: this.ctx, chart: this }), i[h.id] = h } h.init(n, t) })), u(s, ((t, e) => { t || delete i[e] })), u(i, (t => { ls.configure(this, t, t.options), ls.addBox(this, t) })) } _updateMetasets() { const t = this._metasets, e = this.data.datasets.length, i = t.length; if (t.sort(((t, e) => t.index - e.index)), i > e) { for (let t = e; t < i; ++t)this._destroyDatasetMeta(t); t.splice(e, i - e) } this._sortedMetasets = t.slice(0).sort(kn("order", "index")) } _removeUnreferencedMetasets() { const { _metasets: t, data: { datasets: e } } = this; t.length > e.length && delete this._stacks, t.forEach(((t, i) => { 0 === e.filter((e => e === t._dataset)).length && this._destroyDatasetMeta(i) })) } buildOrUpdateControllers() { const t = [], e = this.data.datasets; let i, s; for (this._removeUnreferencedMetasets(), i = 0, s = e.length; i < s; i++) { const s = e[i]; let n = this.getDatasetMeta(i); const o = s.type || this.config.type; if (n.type && n.type !== o && (this._destroyDatasetMeta(i), n = this.getDatasetMeta(i)), n.type = o, n.indexAxis = s.indexAxis || ln(o, this.options), n.order = s.order || 0, n.index = i, n.label = "" + s.label, n.visible = this.isDatasetVisible(i), n.controller) n.controller.updateIndex(i), n.controller.linkScales(); else { const e = nn.getController(o), { datasetElementType: s, dataElementType: a } = ue.datasets[o]; Object.assign(e, { dataElementType: nn.getElement(a), datasetElementType: s && nn.getElement(s) }), n.controller = new e(this, i), t.push(n.controller) } } return this._updateMetasets(), t } _resetElements() { u(this.data.datasets, ((t, e) => { this.getDatasetMeta(e).controller.reset() }), this) } reset() { this._resetElements(), this.notifyPlugins("reset") } update(t) { const e = this.config; e.update(); const i = this._options = e.createResolver(e.chartOptionScopes(), this.getContext()), s = this._animationsDisabled = !i.animation; if (this._updateScales(), this._checkEventBindings(), this._updateHiddenIndices(), this._plugins.invalidate(), !1 === this.notifyPlugins("beforeUpdate", { mode: t, cancelable: !0 })) return; const n = this.buildOrUpdateControllers(); this.notifyPlugins("beforeElementsUpdate"); let o = 0; for (let t = 0, e = this.data.datasets.length; t < e; t++) { const { controller: e } = this.getDatasetMeta(t), i = !s && -1 === n.indexOf(e); e.buildOrUpdateElements(i), o = Math.max(+e.getMaxOverflow(), o) } o = this._minPadding = i.layout.autoPadding ? o : 0, this._updateLayout(o), s || u(n, (t => { t.reset() })), this._updateDatasets(t), this.notifyPlugins("afterUpdate", { mode: t }), this._layers.sort(kn("z", "_idx")); const { _active: a, _lastEvent: r } = this; r ? this._eventHandler(r, !0) : a.length && this._updateHoverStyles(a, a, !0), this.render() } _updateScales() { u(this.scales, (t => { ls.removeBox(this, t) })), this.ensureScalesHaveIDs(), this.buildOrUpdateScales() } _checkEventBindings() { const t = this.options, e = new Set(Object.keys(this._listeners)), i = new Set(t.events); P(e, i) && !!this._responsiveListeners === t.responsive || (this.unbindEvents(), this.bindEvents()) } _updateHiddenIndices() { const { _hiddenIndices: t } = this, e = this._getUniformDataChanges() || []; for (const { method: i, start: s, count: n } of e) { An(t, s, "_removeElements" === i ? -n : n) } } _getUniformDataChanges() { const t = this._dataChanges; if (!t || !t.length) return; this._dataChanges = []; const e = this.data.datasets.length, i = e => new Set(t.filter((t => t[0] === e)).map(((t, e) => e + "," + t.splice(1).join(",")))), s = i(0); for (let t = 1; t < e; t++)if (!P(s, i(t))) return; return Array.from(s).map((t => t.split(","))).map((t => ({ method: t[1], start: +t[2], count: +t[3] }))) } _updateLayout(t) { if (!1 === this.notifyPlugins("beforeLayout", { cancelable: !0 })) return; ls.update(this, this.width, this.height, t); const e = this.chartArea, i = e.width <= 0 || e.height <= 0; this._layers = [], u(this.boxes, (t => { i && "chartArea" === t.position || (t.configure && t.configure(), this._layers.push(...t._layers())) }), this), this._layers.forEach(((t, e) => { t._idx = e })), this.notifyPlugins("afterLayout") } _updateDatasets(t) { if (!1 !== this.notifyPlugins("beforeDatasetsUpdate", { mode: t, cancelable: !0 })) { for (let t = 0, e = this.data.datasets.length; t < e; ++t)this.getDatasetMeta(t).controller.configure(); for (let e = 0, i = this.data.datasets.length; e < i; ++e)this._updateDataset(e, S(t) ? t({ datasetIndex: e }) : t); this.notifyPlugins("afterDatasetsUpdate", { mode: t }) } } _updateDataset(t, e) { const i = this.getDatasetMeta(t), s = { meta: i, index: t, mode: e, cancelable: !0 }; !1 !== this.notifyPlugins("beforeDatasetUpdate", s) && (i.controller._update(e), s.cancelable = !1, this.notifyPlugins("afterDatasetUpdate", s)) } render() { !1 !== this.notifyPlugins("beforeRender", { cancelable: !0 }) && (bt.has(this) ? this.attached && !bt.running(this) && bt.start(this) : (this.draw(), Sn({ chart: this }))) } draw() { let t; if (this._resizeBeforeDraw) { const { width: t, height: e } = this._resizeBeforeDraw; this._resizeBeforeDraw = null, this._resize(t, e) } if (this.clear(), this.width <= 0 || this.height <= 0) return; if (!1 === this.notifyPlugins("beforeDraw", { cancelable: !0 })) return; const e = this._layers; for (t = 0; t < e.length && e[t].z <= 0; ++t)e[t].draw(this.chartArea); for (this._drawDatasets(); t < e.length; ++t)e[t].draw(this.chartArea); this.notifyPlugins("afterDraw") } _getSortedDatasetMetas(t) { const e = this._sortedMetasets, i = []; let s, n; for (s = 0, n = e.length; s < n; ++s) { const n = e[s]; t && !n.visible || i.push(n) } return i } getSortedVisibleDatasetMetas() { return this._getSortedDatasetMetas(!0) } _drawDatasets() { if (!1 === this.notifyPlugins("beforeDatasetsDraw", { cancelable: !0 })) return; const t = this.getSortedVisibleDatasetMetas(); for (let e = t.length - 1; e >= 0; --e)this._drawDataset(t[e]); this.notifyPlugins("afterDatasetsDraw") } _drawDataset(t) { const e = this.ctx, i = { meta: t, index: t.index, cancelable: !0 }, s = Ni(this, t); !1 !== this.notifyPlugins("beforeDatasetDraw", i) && (s && Ie(e, s), t.controller.draw(), s && ze(e), i.cancelable = !1, this.notifyPlugins("afterDatasetDraw", i)) } isPointInArea(t) { return Re(t, this.chartArea, this._minPadding) } getElementsAtEventForMode(t, e, i, s) { const n = Ki.modes[e]; return "function" == typeof n ? n(this, t, i, s) : [] } getDatasetMeta(t) { const e = this.data.datasets[t], i = this._metasets; let s = i.filter((t => t && t._dataset === e)).pop(); return s || (s = { type: null, data: [], dataset: null, controller: null, hidden: null, xAxisID: null, yAxisID: null, order: e && e.order || 0, index: t, _dataset: e, _parsed: [], _sorted: !1 }, i.push(s)), s } getContext() { return this.$context || (this.$context = Ci(null, { chart: this, type: "chart" })) } getVisibleDatasetCount() { return this.getSortedVisibleDatasetMetas().length } isDatasetVisible(t) { const e = this.data.datasets[t]; if (!e) return !1; const i = this.getDatasetMeta(t); return "boolean" == typeof i.hidden ? !i.hidden : !e.hidden } setDatasetVisibility(t, e) { this.getDatasetMeta(t).hidden = !e } toggleDataVisibility(t) { this._hiddenIndices[t] = !this._hiddenIndices[t] } getDataVisibility(t) { return !this._hiddenIndices[t] } _updateVisibility(t, e, i) { const s = i ? "show" : "hide", n = this.getDatasetMeta(t), o = n.controller._resolveAnimations(void 0, s); k(e) ? (n.data[e].hidden = !i, this.update()) : (this.setDatasetVisibility(t, i), o.update(n, { visible: i }), this.update((e => e.datasetIndex === t ? s : void 0))) } hide(t, e) { this._updateVisibility(t, e, !1) } show(t, e) { this._updateVisibility(t, e, !0) } _destroyDatasetMeta(t) { const e = this._metasets[t]; e && e.controller && e.controller._destroy(), delete this._metasets[t] } _stop() { let t, e; for (this.stop(), bt.remove(this), t = 0, e = this.data.datasets.length; t < e; ++t)this._destroyDatasetMeta(t) } destroy() { this.notifyPlugins("beforeDestroy"); const { canvas: t, ctx: e } = this; this._stop(), this.config.clearCache(), t && (this.unbindEvents(), Te(t, e), this.platform.releaseContext(e), this.canvas = null, this.ctx = null), delete Cn[this.id], this.notifyPlugins("afterDestroy") } toBase64Image(...t) { return this.canvas.toDataURL(...t) } bindEvents() { this.bindUserEvents(), this.options.responsive ? this.bindResponsiveEvents() : this.attached = !0 } bindUserEvents() { const t = this._listeners, e = this.platform, i = (i, s) => { e.addEventListener(this, i, s), t[i] = s }, s = (t, e, i) => { t.offsetX = e, t.offsetY = i, this._eventHandler(t) }; u(this.options.events, (t => i(t, s))) } bindResponsiveEvents() { this._responsiveListeners || (this._responsiveListeners = {}); const t = this._responsiveListeners, e = this.platform, i = (i, s) => { e.addEventListener(this, i, s), t[i] = s }, s = (i, s) => { t[i] && (e.removeEventListener(this, i, s), delete t[i]) }, n = (t, e) => { this.canvas && this.resize(t, e) }; let o; const a = () => { s("attach", a), this.attached = !0, this.resize(), i("resize", n), i("detach", o) }; o = () => { this.attached = !1, s("resize", n), this._stop(), this._resize(0, 0), i("attach", a) }, e.isAttached(this.canvas) ? a() : o() } unbindEvents() { u(this._listeners, ((t, e) => { this.platform.removeEventListener(this, e, t) })), this._listeners = {}, u(this._responsiveListeners, ((t, e) => { this.platform.removeEventListener(this, e, t) })), this._responsiveListeners = void 0 } updateHoverStyle(t, e, i) { const s = i ? "set" : "remove"; let n, o, a, r; for ("dataset" === e && (n = this.getDatasetMeta(t[0].datasetIndex), n.controller["_" + s + "DatasetHoverStyle"]()), a = 0, r = t.length; a < r; ++a) { o = t[a]; const e = o && this.getDatasetMeta(o.datasetIndex).controller; e && e[s + "HoverStyle"](o.element, o.datasetIndex, o.index) } } getActiveElements() { return this._active || [] } setActiveElements(t) { const e = this._active || [], i = t.map((({ datasetIndex: t, index: e }) => { const i = this.getDatasetMeta(t); if (!i) throw new Error("No dataset found at index " + t); return { datasetIndex: t, element: i.data[e], index: e } })); !f(i, e) && (this._active = i, this._lastEvent = null, this._updateHoverStyles(i, e)) } notifyPlugins(t, e, i) { return this._plugins.notify(this, t, e, i) } isPluginEnabled(t) { return 1 === this._plugins._cache.filter((e => e.plugin.id === t)).length } _updateHoverStyles(t, e, i) { const s = this.options.hover, n = (t, e) => t.filter((t => !e.some((e => t.datasetIndex === e.datasetIndex && t.index === e.index)))), o = n(e, t), a = i ? t : n(t, e); o.length && this.updateHoverStyle(o, s.mode, !1), a.length && s.mode && this.updateHoverStyle(a, s.mode, !0) } _eventHandler(t, e) { const i = { event: t, replay: e, cancelable: !0, inChartArea: this.isPointInArea(t) }, s = e => (e.options.events || this.options.events).includes(t.native.type); if (!1 === this.notifyPlugins("beforeEvent", i, s)) return; const n = this._handleEvent(t, e, i.inChartArea); return i.cancelable = !1, this.notifyPlugins("afterEvent", i, s), (n || i.changed) && this.render(), this } _handleEvent(t, e, i) { const { _active: s = [], options: n } = this, o = e, a = this._getActiveElements(t, s, i, o), r = D(t), l = function (t, e, i, s) { return i && "mouseout" !== t.type ? s ? e : t : null }(t, this._lastEvent, i, r); i && (this._lastEvent = null, d(n.onHover, [t, a, this], this), r && d(n.onClick, [t, a, this], this)); const h = !f(a, s); return (h || e) && (this._active = a, this._updateHoverStyles(a, s, e)), this._lastEvent = l, h } _getActiveElements(t, e, i, s) { if ("mouseout" === t.type) return []; if (!i) return e; const n = this.options.hover; return this.getElementsAtEventForMode(t, n.mode, n, s) } } function Ln() { return u(Tn.instances, (t => t._plugins.invalidate())) } function En() { throw new Error("This method is not implemented: Check that a complete date adapter is provided.") } class Rn { static override(t) { Object.assign(Rn.prototype, t) } options; constructor(t) { this.options = t || {} } init() { } formats() { return En() } parse() { return En() } format() { return En() } add() { return En() } diff() { return En() } startOf() { return En() } endOf() { return En() } } var In = { _date: Rn }; function zn(t) { const e = t.iScale, i = function (t, e) { if (!t._cache.$bar) { const i = t.getMatchingVisibleMetas(e); let s = []; for (let e = 0, n = i.length; e < n; e++)s = s.concat(i[e].controller.getAllParsedValues(t)); t._cache.$bar = lt(s.sort(((t, e) => t - e))) } return t._cache.$bar }(e, t.type); let s, n, o, a, r = e._length; const l = () => { 32767 !== o && -32768 !== o && (k(a) && (r = Math.min(r, Math.abs(o - a) || r)), a = o) }; for (s = 0, n = i.length; s < n; ++s)o = e.getPixelForValue(i[s]), l(); for (a = void 0, s = 0, n = e.ticks.length; s < n; ++s)o = e.getPixelForTick(s), l(); return r } function Fn(t, e, i, s) { return n(t) ? function (t, e, i, s) { const n = i.parse(t[0], s), o = i.parse(t[1], s), a = Math.min(n, o), r = Math.max(n, o); let l = a, h = r; Math.abs(a) > Math.abs(r) && (l = r, h = a), e[i.axis] = h, e._custom = { barStart: l, barEnd: h, start: n, end: o, min: a, max: r } }(t, e, i, s) : e[i.axis] = i.parse(t, s), e } function Vn(t, e, i, s) { const n = t.iScale, o = t.vScale, a = n.getLabels(), r = n === o, l = []; let h, c, d, u; for (h = i, c = i + s; h < c; ++h)u = e[h], d = {}, d[n.axis] = r || n.parse(a[h], h), l.push(Fn(u, d, o, h)); return l } function Bn(t) { return t && void 0 !== t.barStart && void 0 !== t.barEnd } function Wn(t, e, i, s) { let n = e.borderSkipped; const o = {}; if (!n) return void (t.borderSkipped = o); if (!0 === n) return void (t.borderSkipped = { top: !0, right: !0, bottom: !0, left: !0 }); const { start: a, end: r, reverse: l, top: h, bottom: c } = function (t) { let e, i, s, n, o; return t.horizontal ? (e = t.base > t.x, i = "left", s = "right") : (e = t.base < t.y, i = "bottom", s = "top"), e ? (n = "end", o = "start") : (n = "start", o = "end"), { start: i, end: s, reverse: e, top: n, bottom: o } }(t); "middle" === n && i && (t.enableBorderRadius = !0, (i._top || 0) === s ? n = h : (i._bottom || 0) === s ? n = c : (o[Nn(c, a, r, l)] = !0, n = h)), o[Nn(n, a, r, l)] = !0, t.borderSkipped = o } function Nn(t, e, i, s) { var n, o, a; return s ? (a = i, t = Hn(t = (n = t) === (o = e) ? a : n === a ? o : n, i, e)) : t = Hn(t, e, i), t } function Hn(t, e, i) { return "start" === t ? e : "end" === t ? i : t } function jn(t, { inflateAmount: e }, i) { t.inflateAmount = "auto" === e ? 1 === i ? .33 : 0 : e } class $n extends js { static id = "doughnut"; static defaults = { datasetElementType: !1, dataElementType: "arc", animation: { animateRotate: !0, animateScale: !1 }, animations: { numbers: { type: "number", properties: ["circumference", "endAngle", "innerRadius", "outerRadius", "startAngle", "x", "y", "offset", "borderWidth", "spacing"] } }, cutout: "50%", rotation: 0, circumference: 360, radius: "100%", spacing: 0, indexAxis: "r" }; static descriptors = { _scriptable: t => "spacing" !== t, _indexable: t => "spacing" !== t && !t.startsWith("borderDash") && !t.startsWith("hoverBorderDash") }; static overrides = { aspectRatio: 1, plugins: { legend: { labels: { generateLabels(t) { const e = t.data, { labels: { pointStyle: i, textAlign: s, color: n, useBorderRadius: o, borderRadius: a } } = t.legend.options; return e.labels.length && e.datasets.length ? e.labels.map(((e, r) => { const l = t.getDatasetMeta(0).controller.getStyle(r); return { text: e, fillStyle: l.backgroundColor, fontColor: n, hidden: !t.getDataVisibility(r), lineDash: l.borderDash, lineDashOffset: l.borderDashOffset, lineJoin: l.borderJoinStyle, lineWidth: l.borderWidth, strokeStyle: l.borderColor, textAlign: s, pointStyle: i, borderRadius: o && (a || l.borderRadius), index: r } })) : [] } }, onClick(t, e, i) { i.chart.toggleDataVisibility(e.index), i.chart.update() } } } }; constructor(t, e) { super(t, e), this.enableOptionSharing = !0, this.innerRadius = void 0, this.outerRadius = void 0, this.offsetX = void 0, this.offsetY = void 0 } linkScales() { } parse(t, e) { const i = this.getDataset().data, s = this._cachedMeta; if (!1 === this._parsing) s._parsed = i; else { let n, a, r = t => +i[t]; if (o(i[t])) { const { key: t = "value" } = this._parsing; r = e => +M(i[e], t) } for (n = t, a = t + e; n < a; ++n)s._parsed[n] = r(n) } } _getRotation() { return $(this.options.rotation - 90) } _getCircumference() { return $(this.options.circumference) } _getRotationExtents() { let t = O, e = -O; for (let i = 0; i < this.chart.data.datasets.length; ++i)if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) { const s = this.chart.getDatasetMeta(i).controller, n = s._getRotation(), o = s._getCircumference(); t = Math.min(t, n), e = Math.max(e, n + o) } return { rotation: t, circumference: e - t } } update(t) { const e = this.chart, { chartArea: i } = e, s = this._cachedMeta, n = s.data, o = this.getMaxBorderWidth() + this.getMaxOffset(n) + this.options.spacing, a = Math.max((Math.min(i.width, i.height) - o) / 2, 0), r = Math.min(h(this.options.cutout, a), 1), l = this._getRingWeight(this.index), { circumference: d, rotation: u } = this._getRotationExtents(), { ratioX: f, ratioY: g, offsetX: p, offsetY: m } = function (t, e, i) { let s = 1, n = 1, o = 0, a = 0; if (e < O) { const r = t, l = r + e, h = Math.cos(r), c = Math.sin(r), d = Math.cos(l), u = Math.sin(l), f = (t, e, s) => J(t, r, l, !0) ? 1 : Math.max(e, e * i, s, s * i), g = (t, e, s) => J(t, r, l, !0) ? -1 : Math.min(e, e * i, s, s * i), p = f(0, h, d), m = f(E, c, u), x = g(C, h, d), b = g(C + E, c, u); s = (p - x) / 2, n = (m - b) / 2, o = -(p + x) / 2, a = -(m + b) / 2 } return { ratioX: s, ratioY: n, offsetX: o, offsetY: a } }(u, d, r), x = (i.width - o) / f, b = (i.height - o) / g, _ = Math.max(Math.min(x, b) / 2, 0), y = c(this.options.radius, _), v = (y - Math.max(y * r, 0)) / this._getVisibleDatasetWeightTotal(); this.offsetX = p * y, this.offsetY = m * y, s.total = this.calculateTotal(), this.outerRadius = y - v * this._getRingWeightOffset(this.index), this.innerRadius = Math.max(this.outerRadius - v * l, 0), this.updateElements(n, 0, n.length, t) } _circumference(t, e) { const i = this.options, s = this._cachedMeta, n = this._getCircumference(); return e && i.animation.animateRotate || !this.chart.getDataVisibility(t) || null === s._parsed[t] || s.data[t].hidden ? 0 : this.calculateCircumference(s._parsed[t] * n / O) } updateElements(t, e, i, s) { const n = "reset" === s, o = this.chart, a = o.chartArea, r = o.options.animation, l = (a.left + a.right) / 2, h = (a.top + a.bottom) / 2, c = n && r.animateScale, d = c ? 0 : this.innerRadius, u = c ? 0 : this.outerRadius, { sharedOptions: f, includeOptions: g } = this._getSharedOptions(e, s); let p, m = this._getRotation(); for (p = 0; p < e; ++p)m += this._circumference(p, n); for (p = e; p < e + i; ++p) { const e = this._circumference(p, n), i = t[p], o = { x: l + this.offsetX, y: h + this.offsetY, startAngle: m, endAngle: m + e, circumference: e, outerRadius: u, innerRadius: d }; g && (o.options = f || this.resolveDataElementOptions(p, i.active ? "active" : s)), m += e, this.updateElement(i, p, o, s) } } calculateTotal() { const t = this._cachedMeta, e = t.data; let i, s = 0; for (i = 0; i < e.length; i++) { const n = t._parsed[i]; null === n || isNaN(n) || !this.chart.getDataVisibility(i) || e[i].hidden || (s += Math.abs(n)) } return s } calculateCircumference(t) { const e = this._cachedMeta.total; return e > 0 && !isNaN(t) ? O * (Math.abs(t) / e) : 0 } getLabelAndValue(t) { const e = this._cachedMeta, i = this.chart, s = i.data.labels || [], n = ne(e._parsed[t], i.options.locale); return { label: s[t] || "", value: n } } getMaxBorderWidth(t) { let e = 0; const i = this.chart; let s, n, o, a, r; if (!t) for (s = 0, n = i.data.datasets.length; s < n; ++s)if (i.isDatasetVisible(s)) { o = i.getDatasetMeta(s), t = o.data, a = o.controller; break } if (!t) return 0; for (s = 0, n = t.length; s < n; ++s)r = a.resolveDataElementOptions(s), "inner" !== r.borderAlign && (e = Math.max(e, r.borderWidth || 0, r.hoverBorderWidth || 0)); return e } getMaxOffset(t) { let e = 0; for (let i = 0, s = t.length; i < s; ++i) { const t = this.resolveDataElementOptions(i); e = Math.max(e, t.offset || 0, t.hoverOffset || 0) } return e } _getRingWeightOffset(t) { let e = 0; for (let i = 0; i < t; ++i)this.chart.isDatasetVisible(i) && (e += this._getRingWeight(i)); return e } _getRingWeight(t) { return Math.max(l(this.chart.data.datasets[t].weight, 1), 0) } _getVisibleDatasetWeightTotal() { return this._getRingWeightOffset(this.chart.data.datasets.length) || 1 } } class Yn extends js { static id = "polarArea"; static defaults = { dataElementType: "arc", animation: { animateRotate: !0, animateScale: !0 }, animations: { numbers: { type: "number", properties: ["x", "y", "startAngle", "endAngle", "innerRadius", "outerRadius"] } }, indexAxis: "r", startAngle: 0 }; static overrides = { aspectRatio: 1, plugins: { legend: { labels: { generateLabels(t) { const e = t.data; if (e.labels.length && e.datasets.length) { const { labels: { pointStyle: i, color: s } } = t.legend.options; return e.labels.map(((e, n) => { const o = t.getDatasetMeta(0).controller.getStyle(n); return { text: e, fillStyle: o.backgroundColor, strokeStyle: o.borderColor, fontColor: s, lineWidth: o.borderWidth, pointStyle: i, hidden: !t.getDataVisibility(n), index: n } })) } return [] } }, onClick(t, e, i) { i.chart.toggleDataVisibility(e.index), i.chart.update() } } }, scales: { r: { type: "radialLinear", angleLines: { display: !1 }, beginAtZero: !0, grid: { circular: !0 }, pointLabels: { display: !1 }, startAngle: 0 } } }; constructor(t, e) { super(t, e), this.innerRadius = void 0, this.outerRadius = void 0 } getLabelAndValue(t) { const e = this._cachedMeta, i = this.chart, s = i.data.labels || [], n = ne(e._parsed[t].r, i.options.locale); return { label: s[t] || "", value: n } } parseObjectData(t, e, i, s) { return ii.bind(this)(t, e, i, s) } update(t) { const e = this._cachedMeta.data; this._updateRadius(), this.updateElements(e, 0, e.length, t) } getMinMax() { const t = this._cachedMeta, e = { min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY }; return t.data.forEach(((t, i) => { const s = this.getParsed(i).r; !isNaN(s) && this.chart.getDataVisibility(i) && (s < e.min && (e.min = s), s > e.max && (e.max = s)) })), e } _updateRadius() { const t = this.chart, e = t.chartArea, i = t.options, s = Math.min(e.right - e.left, e.bottom - e.top), n = Math.max(s / 2, 0), o = (n - Math.max(i.cutoutPercentage ? n / 100 * i.cutoutPercentage : 1, 0)) / t.getVisibleDatasetCount(); this.outerRadius = n - o * this.index, this.innerRadius = this.outerRadius - o } updateElements(t, e, i, s) { const n = "reset" === s, o = this.chart, a = o.options.animation, r = this._cachedMeta.rScale, l = r.xCenter, h = r.yCenter, c = r.getIndexAngle(0) - .5 * C; let d, u = c; const f = 360 / this.countVisibleElements(); for (d = 0; d < e; ++d)u += this._computeAngle(d, s, f); for (d = e; d < e + i; d++) { const e = t[d]; let i = u, g = u + this._computeAngle(d, s, f), p = o.getDataVisibility(d) ? r.getDistanceFromCenterForValue(this.getParsed(d).r) : 0; u = g, n && (a.animateScale && (p = 0), a.animateRotate && (i = g = c)); const m = { x: l, y: h, innerRadius: 0, outerRadius: p, startAngle: i, endAngle: g, options: this.resolveDataElementOptions(d, e.active ? "active" : s) }; this.updateElement(e, d, m, s) } } countVisibleElements() { const t = this._cachedMeta; let e = 0; return t.data.forEach(((t, i) => { !isNaN(this.getParsed(i).r) && this.chart.getDataVisibility(i) && e++ })), e } _computeAngle(t, e, i) { return this.chart.getDataVisibility(t) ? $(this.resolveDataElementOptions(t, e).angle || i) : 0 } } var Un = Object.freeze({ __proto__: null, BarController: class extends js { static id = "bar"; static defaults = { datasetElementType: !1, dataElementType: "bar", categoryPercentage: .8, barPercentage: .9, grouped: !0, animations: { numbers: { type: "number", properties: ["x", "y", "base", "width", "height"] } } }; static overrides = { scales: { _index_: { type: "category", offset: !0, grid: { offset: !0 } }, _value_: { type: "linear", beginAtZero: !0 } } }; parsePrimitiveData(t, e, i, s) { return Vn(t, e, i, s) } parseArrayData(t, e, i, s) { return Vn(t, e, i, s) } parseObjectData(t, e, i, s) { const { iScale: n, vScale: o } = t, { xAxisKey: a = "x", yAxisKey: r = "y" } = this._parsing, l = "x" === n.axis ? a : r, h = "x" === o.axis ? a : r, c = []; let d, u, f, g; for (d = i, u = i + s; d < u; ++d)g = e[d], f = {}, f[n.axis] = n.parse(M(g, l), d), c.push(Fn(M(g, h), f, o, d)); return c } updateRangeFromParsed(t, e, i, s) { super.updateRangeFromParsed(t, e, i, s); const n = i._custom; n && e === this._cachedMeta.vScale && (t.min = Math.min(t.min, n.min), t.max = Math.max(t.max, n.max)) } getMaxOverflow() { return 0 } getLabelAndValue(t) { const e = this._cachedMeta, { iScale: i, vScale: s } = e, n = this.getParsed(t), o = n._custom, a = Bn(o) ? "[" + o.start + ", " + o.end + "]" : "" + s.getLabelForValue(n[s.axis]); return { label: "" + i.getLabelForValue(n[i.axis]), value: a } } initialize() { this.enableOptionSharing = !0, super.initialize(); this._cachedMeta.stack = this.getDataset().stack } update(t) { const e = this._cachedMeta; this.updateElements(e.data, 0, e.data.length, t) } updateElements(t, e, i, n) { const o = "reset" === n, { index: a, _cachedMeta: { vScale: r } } = this, l = r.getBasePixel(), h = r.isHorizontal(), c = this._getRuler(), { sharedOptions: d, includeOptions: u } = this._getSharedOptions(e, n); for (let f = e; f < e + i; f++) { const e = this.getParsed(f), i = o || s(e[r.axis]) ? { base: l, head: l } : this._calculateBarValuePixels(f), g = this._calculateBarIndexPixels(f, c), p = (e._stacks || {})[r.axis], m = { horizontal: h, base: i.base, enableBorderRadius: !p || Bn(e._custom) || a === p._top || a === p._bottom, x: h ? i.head : g.center, y: h ? g.center : i.head, height: h ? g.size : Math.abs(i.size), width: h ? Math.abs(i.size) : g.size }; u && (m.options = d || this.resolveDataElementOptions(f, t[f].active ? "active" : n)); const x = m.options || t[f].options; Wn(m, x, p, a), jn(m, x, c.ratio), this.updateElement(t[f], f, m, n) } } _getStacks(t, e) { const { iScale: i } = this._cachedMeta, n = i.getMatchingVisibleMetas(this._type).filter((t => t.controller.options.grouped)), o = i.options.stacked, a = [], r = this._cachedMeta.controller.getParsed(e), l = r && r[i.axis], h = t => { const e = t._parsed.find((t => t[i.axis] === l)), n = e && e[t.vScale.axis]; if (s(n) || isNaN(n)) return !0 }; for (const i of n) if ((void 0 === e || !h(i)) && ((!1 === o || -1 === a.indexOf(i.stack) || void 0 === o && void 0 === i.stack) && a.push(i.stack), i.index === t)) break; return a.length || a.push(void 0), a } _getStackCount(t) { return this._getStacks(void 0, t).length } _getAxisCount() { return this._getAxis().length } getFirstScaleIdForIndexAxis() { const t = this.chart.scales, e = this.chart.options.indexAxis; return Object.keys(t).filter((i => t[i].axis === e)).shift() } _getAxis() { const t = {}, e = this.getFirstScaleIdForIndexAxis(); for (const i of this.chart.data.datasets) t[l("x" === this.chart.options.indexAxis ? i.xAxisID : i.yAxisID, e)] = !0; return Object.keys(t) } _getStackIndex(t, e, i) { const s = this._getStacks(t, i), n = void 0 !== e ? s.indexOf(e) : -1; return -1 === n ? s.length - 1 : n } _getRuler() { const t = this.options, e = this._cachedMeta, i = e.iScale, s = []; let n, o; for (n = 0, o = e.data.length; n < o; ++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis], n)); const a = t.barThickness; return { min: a || zn(e), pixels: s, start: i._startPixel, end: i._endPixel, stackCount: this._getStackCount(), scale: i, grouped: t.grouped, ratio: a ? 1 : t.categoryPercentage * t.barPercentage } } _calculateBarValuePixels(t) { const { _cachedMeta: { vScale: e, _stacked: i, index: n }, options: { base: o, minBarLength: a } } = this, r = o || 0, l = this.getParsed(t), h = l._custom, c = Bn(h); let d, u, f = l[e.axis], g = 0, p = i ? this.applyStack(e, l, i) : f; p !== f && (g = p - f, p = f), c && (f = h.barStart, p = h.barEnd - h.barStart, 0 !== f && F(f) !== F(h.barEnd) && (g = 0), g += f); const m = s(o) || c ? g : o; let x = e.getPixelForValue(m); if (d = this.chart.getDataVisibility(t) ? e.getPixelForValue(g + p) : x, u = d - x, Math.abs(u) < a) { u = function (t, e, i) { return 0 !== t ? F(t) : (e.isHorizontal() ? 1 : -1) * (e.min >= i ? 1 : -1) }(u, e, r) * a, f === r && (x -= u / 2); const t = e.getPixelForDecimal(0), s = e.getPixelForDecimal(1), o = Math.min(t, s), h = Math.max(t, s); x = Math.max(Math.min(x, h), o), d = x + u, i && !c && (l._stacks[e.axis]._visualValues[n] = e.getValueForPixel(d) - e.getValueForPixel(x)) } if (x === e.getPixelForValue(r)) { const t = F(u) * e.getLineWidthForValue(r) / 2; x += t, u -= t } return { size: u, base: x, head: d, center: d + u / 2 } } _calculateBarIndexPixels(t, e) { const i = e.scale, n = this.options, o = n.skipNull, a = l(n.maxBarThickness, 1 / 0); let r, h; const c = this._getAxisCount(); if (e.grouped) { const i = o ? this._getStackCount(t) : e.stackCount, d = "flex" === n.barThickness ? function (t, e, i, s) { const n = e.pixels, o = n[t]; let a = t > 0 ? n[t - 1] : null, r = t < n.length - 1 ? n[t + 1] : null; const l = i.categoryPercentage; null === a && (a = o - (null === r ? e.end - e.start : r - o)), null === r && (r = o + o - a); const h = o - (o - Math.min(a, r)) / 2 * l; return { chunk: Math.abs(r - a) / 2 * l / s, ratio: i.barPercentage, start: h } }(t, e, n, i * c) : function (t, e, i, n) { const o = i.barThickness; let a, r; return s(o) ? (a = e.min * i.categoryPercentage, r = i.barPercentage) : (a = o * n, r = 1), { chunk: a / n, ratio: r, start: e.pixels[t] - a / 2 } }(t, e, n, i * c), u = "x" === this.chart.options.indexAxis ? this.getDataset().xAxisID : this.getDataset().yAxisID, f = this._getAxis().indexOf(l(u, this.getFirstScaleIdForIndexAxis())), g = this._getStackIndex(this.index, this._cachedMeta.stack, o ? t : void 0) + f; r = d.start + d.chunk * g + d.chunk / 2, h = Math.min(a, d.chunk * d.ratio) } else r = i.getPixelForValue(this.getParsed(t)[i.axis], t), h = Math.min(a, e.min * e.ratio); return { base: r - h / 2, head: r + h / 2, center: r, size: h } } draw() { const t = this._cachedMeta, e = t.vScale, i = t.data, s = i.length; let n = 0; for (; n < s; ++n)null === this.getParsed(n)[e.axis] || i[n].hidden || i[n].draw(this._ctx) } }, BubbleController: class extends js { static id = "bubble"; static defaults = { datasetElementType: !1, dataElementType: "point", animations: { numbers: { type: "number", properties: ["x", "y", "borderWidth", "radius"] } } }; static overrides = { scales: { x: { type: "linear" }, y: { type: "linear" } } }; initialize() { this.enableOptionSharing = !0, super.initialize() } parsePrimitiveData(t, e, i, s) { const n = super.parsePrimitiveData(t, e, i, s); for (let t = 0; t < n.length; t++)n[t]._custom = this.resolveDataElementOptions(t + i).radius; return n } parseArrayData(t, e, i, s) { const n = super.parseArrayData(t, e, i, s); for (let t = 0; t < n.length; t++) { const s = e[i + t]; n[t]._custom = l(s[2], this.resolveDataElementOptions(t + i).radius) } return n } parseObjectData(t, e, i, s) { const n = super.parseObjectData(t, e, i, s); for (let t = 0; t < n.length; t++) { const s = e[i + t]; n[t]._custom = l(s && s.r && +s.r, this.resolveDataElementOptions(t + i).radius) } return n } getMaxOverflow() { const t = this._cachedMeta.data; let e = 0; for (let i = t.length - 1; i >= 0; --i)e = Math.max(e, t[i].size(this.resolveDataElementOptions(i)) / 2); return e > 0 && e } getLabelAndValue(t) { const e = this._cachedMeta, i = this.chart.data.labels || [], { xScale: s, yScale: n } = e, o = this.getParsed(t), a = s.getLabelForValue(o.x), r = n.getLabelForValue(o.y), l = o._custom; return { label: i[t] || "", value: "(" + a + ", " + r + (l ? ", " + l : "") + ")" } } update(t) { const e = this._cachedMeta.data; this.updateElements(e, 0, e.length, t) } updateElements(t, e, i, s) { const n = "reset" === s, { iScale: o, vScale: a } = this._cachedMeta, { sharedOptions: r, includeOptions: l } = this._getSharedOptions(e, s), h = o.axis, c = a.axis; for (let d = e; d < e + i; d++) { const e = t[d], i = !n && this.getParsed(d), u = {}, f = u[h] = n ? o.getPixelForDecimal(.5) : o.getPixelForValue(i[h]), g = u[c] = n ? a.getBasePixel() : a.getPixelForValue(i[c]); u.skip = isNaN(f) || isNaN(g), l && (u.options = r || this.resolveDataElementOptions(d, e.active ? "active" : s), n && (u.options.radius = 0)), this.updateElement(e, d, u, s) } } resolveDataElementOptions(t, e) { const i = this.getParsed(t); let s = super.resolveDataElementOptions(t, e); s.$shared && (s = Object.assign({}, s, { $shared: !1 })); const n = s.radius; return "active" !== e && (s.radius = 0), s.radius += l(i && i._custom, n), s } }, DoughnutController: $n, LineController: class extends js { static id = "line"; static defaults = { datasetElementType: "line", dataElementType: "point", showLine: !0, spanGaps: !1 }; static overrides = { scales: { _index_: { type: "category" }, _value_: { type: "linear" } } }; initialize() { this.enableOptionSharing = !0, this.supportsDecimation = !0, super.initialize() } update(t) { const e = this._cachedMeta, { dataset: i, data: s = [], _dataset: n } = e, o = this.chart._animationsDisabled; let { start: a, count: r } = pt(e, s, o); this._drawStart = a, this._drawCount = r, mt(e) && (a = 0, r = s.length), i._chart = this.chart, i._datasetIndex = this.index, i._decimated = !!n._decimated, i.points = s; const l = this.resolveDatasetElementOptions(t); this.options.showLine || (l.borderWidth = 0), l.segment = this.options.segment, this.updateElement(i, void 0, { animated: !o, options: l }, t), this.updateElements(s, a, r, t) } updateElements(t, e, i, n) { const o = "reset" === n, { iScale: a, vScale: r, _stacked: l, _dataset: h } = this._cachedMeta, { sharedOptions: c, includeOptions: d } = this._getSharedOptions(e, n), u = a.axis, f = r.axis, { spanGaps: g, segment: p } = this.options, m = N(g) ? g : Number.POSITIVE_INFINITY, x = this.chart._animationsDisabled || o || "none" === n, b = e + i, _ = t.length; let y = e > 0 && this.getParsed(e - 1); for (let i = 0; i < _; ++i) { const g = t[i], _ = x ? g : {}; if (i < e || i >= b) { _.skip = !0; continue } const v = this.getParsed(i), M = s(v[f]), w = _[u] = a.getPixelForValue(v[u], i), k = _[f] = o || M ? r.getBasePixel() : r.getPixelForValue(l ? this.applyStack(r, v, l) : v[f], i); _.skip = isNaN(w) || isNaN(k) || M, _.stop = i > 0 && Math.abs(v[u] - y[u]) > m, p && (_.parsed = v, _.raw = h.data[i]), d && (_.options = c || this.resolveDataElementOptions(i, g.active ? "active" : n)), x || this.updateElement(g, i, _, n), y = v } } getMaxOverflow() { const t = this._cachedMeta, e = t.dataset, i = e.options && e.options.borderWidth || 0, s = t.data || []; if (!s.length) return i; const n = s[0].size(this.resolveDataElementOptions(0)), o = s[s.length - 1].size(this.resolveDataElementOptions(s.length - 1)); return Math.max(i, n, o) / 2 } draw() { const t = this._cachedMeta; t.dataset.updateControlPoints(this.chart.chartArea, t.iScale.axis), super.draw() } }, PieController: class extends $n { static id = "pie"; static defaults = { cutout: 0, rotation: 0, circumference: 360, radius: "100%" } }, PolarAreaController: Yn, RadarController: class extends js { static id = "radar"; static defaults = { datasetElementType: "line", dataElementType: "point", indexAxis: "r", showLine: !0, elements: { line: { fill: "start" } } }; static overrides = { aspectRatio: 1, scales: { r: { type: "radialLinear" } } }; getLabelAndValue(t) { const e = this._cachedMeta.vScale, i = this.getParsed(t); return { label: e.getLabels()[t], value: "" + e.getLabelForValue(i[e.axis]) } } parseObjectData(t, e, i, s) { return ii.bind(this)(t, e, i, s) } update(t) { const e = this._cachedMeta, i = e.dataset, s = e.data || [], n = e.iScale.getLabels(); if (i.points = s, "resize" !== t) { const e = this.resolveDatasetElementOptions(t); this.options.showLine || (e.borderWidth = 0); const o = { _loop: !0, _fullLoop: n.length === s.length, options: e }; this.updateElement(i, void 0, o, t) } this.updateElements(s, 0, s.length, t) } updateElements(t, e, i, s) { const n = this._cachedMeta.rScale, o = "reset" === s; for (let a = e; a < e + i; a++) { const e = t[a], i = this.resolveDataElementOptions(a, e.active ? "active" : s), r = n.getPointPositionForValue(a, this.getParsed(a).r), l = o ? n.xCenter : r.x, h = o ? n.yCenter : r.y, c = { x: l, y: h, angle: r.angle, skip: isNaN(l) || isNaN(h), options: i }; this.updateElement(e, a, c, s) } } }, ScatterController: class extends js { static id = "scatter"; static defaults = { datasetElementType: !1, dataElementType: "point", showLine: !1, fill: !1 }; static overrides = { interaction: { mode: "point" }, scales: { x: { type: "linear" }, y: { type: "linear" } } }; getLabelAndValue(t) { const e = this._cachedMeta, i = this.chart.data.labels || [], { xScale: s, yScale: n } = e, o = this.getParsed(t), a = s.getLabelForValue(o.x), r = n.getLabelForValue(o.y); return { label: i[t] || "", value: "(" + a + ", " + r + ")" } } update(t) { const e = this._cachedMeta, { data: i = [] } = e, s = this.chart._animationsDisabled; let { start: n, count: o } = pt(e, i, s); if (this._drawStart = n, this._drawCount = o, mt(e) && (n = 0, o = i.length), this.options.showLine) { this.datasetElementType || this.addElements(); const { dataset: n, _dataset: o } = e; n._chart = this.chart, n._datasetIndex = this.index, n._decimated = !!o._decimated, n.points = i; const a = this.resolveDatasetElementOptions(t); a.segment = this.options.segment, this.updateElement(n, void 0, { animated: !s, options: a }, t) } else this.datasetElementType && (delete e.dataset, this.datasetElementType = !1); this.updateElements(i, n, o, t) } addElements() { const { showLine: t } = this.options; !this.datasetElementType && t && (this.datasetElementType = this.chart.registry.getElement("line")), super.addElements() } updateElements(t, e, i, n) { const o = "reset" === n, { iScale: a, vScale: r, _stacked: l, _dataset: h } = this._cachedMeta, c = this.resolveDataElementOptions(e, n), d = this.getSharedOptions(c), u = this.includeOptions(n, d), f = a.axis, g = r.axis, { spanGaps: p, segment: m } = this.options, x = N(p) ? p : Number.POSITIVE_INFINITY, b = this.chart._animationsDisabled || o || "none" === n; let _ = e > 0 && this.getParsed(e - 1); for (let c = e; c < e + i; ++c) { const e = t[c], i = this.getParsed(c), p = b ? e : {}, y = s(i[g]), v = p[f] = a.getPixelForValue(i[f], c), M = p[g] = o || y ? r.getBasePixel() : r.getPixelForValue(l ? this.applyStack(r, i, l) : i[g], c); p.skip = isNaN(v) || isNaN(M) || y, p.stop = c > 0 && Math.abs(i[f] - _[f]) > x, m && (p.parsed = i, p.raw = h.data[c]), u && (p.options = d || this.resolveDataElementOptions(c, e.active ? "active" : n)), b || this.updateElement(e, c, p, n), _ = i } this.updateSharedOptions(d, n, c) } getMaxOverflow() { const t = this._cachedMeta, e = t.data || []; if (!this.options.showLine) { let t = 0; for (let i = e.length - 1; i >= 0; --i)t = Math.max(t, e[i].size(this.resolveDataElementOptions(i)) / 2); return t > 0 && t } const i = t.dataset, s = i.options && i.options.borderWidth || 0; if (!e.length) return s; const n = e[0].size(this.resolveDataElementOptions(0)), o = e[e.length - 1].size(this.resolveDataElementOptions(e.length - 1)); return Math.max(s, n, o) / 2 } } }); function Xn(t, e, i, s) { const n = vi(t.options.borderRadius, ["outerStart", "outerEnd", "innerStart", "innerEnd"]); const o = (i - e) / 2, a = Math.min(o, s * e / 2), r = t => { const e = (i - Math.min(o, t)) * s / 2; return Z(t, 0, Math.min(o, e)) }; return { outerStart: r(n.outerStart), outerEnd: r(n.outerEnd), innerStart: Z(n.innerStart, 0, a), innerEnd: Z(n.innerEnd, 0, a) } } function qn(t, e, i, s) { return { x: i + t * Math.cos(e), y: s + t * Math.sin(e) } } function Kn(t, e, i, s, n, o) { const { x: a, y: r, startAngle: l, pixelMargin: h, innerRadius: c } = e, d = Math.max(e.outerRadius + s + i - h, 0), u = c > 0 ? c + s + i + h : 0; let f = 0; const g = n - l; if (s) { const t = ((c > 0 ? c - s : 0) + (d > 0 ? d - s : 0)) / 2; f = (g - (0 !== t ? g * t / (t + s) : g)) / 2 } const p = (g - Math.max(.001, g * d - i / C) / d) / 2, m = l + p + f, x = n - p - f, { outerStart: b, outerEnd: _, innerStart: y, innerEnd: v } = Xn(e, u, d, x - m), M = d - b, w = d - _, k = m + b / M, S = x - _ / w, P = u + y, D = u + v, O = m + y / P, A = x - v / D; if (t.beginPath(), o) { const e = (k + S) / 2; if (t.arc(a, r, d, k, e), t.arc(a, r, d, e, S), _ > 0) { const e = qn(w, S, a, r); t.arc(e.x, e.y, _, S, x + E) } const i = qn(D, x, a, r); if (t.lineTo(i.x, i.y), v > 0) { const e = qn(D, A, a, r); t.arc(e.x, e.y, v, x + E, A + Math.PI) } const s = (x - v / u + (m + y / u)) / 2; if (t.arc(a, r, u, x - v / u, s, !0), t.arc(a, r, u, s, m + y / u, !0), y > 0) { const e = qn(P, O, a, r); t.arc(e.x, e.y, y, O + Math.PI, m - E) } const n = qn(M, m, a, r); if (t.lineTo(n.x, n.y), b > 0) { const e = qn(M, k, a, r); t.arc(e.x, e.y, b, m - E, k) } } else { t.moveTo(a, r); const e = Math.cos(k) * d + a, i = Math.sin(k) * d + r; t.lineTo(e, i); const s = Math.cos(S) * d + a, n = Math.sin(S) * d + r; t.lineTo(s, n) } t.closePath() } function Gn(t, e, i, s, n) { const { fullCircles: o, startAngle: a, circumference: r, options: l } = e, { borderWidth: h, borderJoinStyle: c, borderDash: d, borderDashOffset: u, borderRadius: f } = l, g = "inner" === l.borderAlign; if (!h) return; t.setLineDash(d || []), t.lineDashOffset = u, g ? (t.lineWidth = 2 * h, t.lineJoin = c || "round") : (t.lineWidth = h, t.lineJoin = c || "bevel"); let p = e.endAngle; if (o) { Kn(t, e, i, s, p, n); for (let e = 0; e < o; ++e)t.stroke(); isNaN(r) || (p = a + (r % O || O)) } g && function (t, e, i) { const { startAngle: s, pixelMargin: n, x: o, y: a, outerRadius: r, innerRadius: l } = e; let h = n / r; t.beginPath(), t.arc(o, a, r, s - h, i + h), l > n ? (h = n / l, t.arc(o, a, l, i + h, s - h, !0)) : t.arc(o, a, n, i + E, s - E), t.closePath(), t.clip() }(t, e, p), l.selfJoin && p - a >= C && 0 === f && "miter" !== c && function (t, e, i) { const { startAngle: s, x: n, y: o, outerRadius: a, innerRadius: r, options: l } = e, { borderWidth: h, borderJoinStyle: c } = l, d = Math.min(h / a, G(s - i)); if (t.beginPath(), t.arc(n, o, a - h / 2, s + d / 2, i - d / 2), r > 0) { const e = Math.min(h / r, G(s - i)); t.arc(n, o, r + h / 2, i - e / 2, s + e / 2, !0) } else { const e = Math.min(h / 2, a * G(s - i)); if ("round" === c) t.arc(n, o, e, i - C / 2, s + C / 2, !0); else if ("bevel" === c) { const a = 2 * e * e, r = -a * Math.cos(i + C / 2) + n, l = -a * Math.sin(i + C / 2) + o, h = a * Math.cos(s + C / 2) + n, c = a * Math.sin(s + C / 2) + o; t.lineTo(r, l), t.lineTo(h, c) } } t.closePath(), t.moveTo(0, 0), t.rect(0, 0, t.canvas.width, t.canvas.height), t.clip("evenodd") }(t, e, p), o || (Kn(t, e, i, s, p, n), t.stroke()) } function Jn(t, e, i = e) { t.lineCap = l(i.borderCapStyle, e.borderCapStyle), t.setLineDash(l(i.borderDash, e.borderDash)), t.lineDashOffset = l(i.borderDashOffset, e.borderDashOffset), t.lineJoin = l(i.borderJoinStyle, e.borderJoinStyle), t.lineWidth = l(i.borderWidth, e.borderWidth), t.strokeStyle = l(i.borderColor, e.borderColor) } function Zn(t, e, i) { t.lineTo(i.x, i.y) } function Qn(t, e, i = {}) { const s = t.length, { start: n = 0, end: o = s - 1 } = i, { start: a, end: r } = e, l = Math.max(n, a), h = Math.min(o, r), c = n < a && o < a || n > r && o > r; return { count: s, start: l, loop: e.loop, ilen: h < l && !c ? s + h - l : h - l } } function to(t, e, i, s) { const { points: n, options: o } = e, { count: a, start: r, loop: l, ilen: h } = Qn(n, i, s), c = function (t) { return t.stepped ? Fe : t.tension || "monotone" === t.cubicInterpolationMode ? Ve : Zn }(o); let d, u, f, { move: g = !0, reverse: p } = s || {}; for (d = 0; d <= h; ++d)u = n[(r + (p ? h - d : d)) % a], u.skip || (g ? (t.moveTo(u.x, u.y), g = !1) : c(t, f, u, p, o.stepped), f = u); return l && (u = n[(r + (p ? h : 0)) % a], c(t, f, u, p, o.stepped)), !!l } function eo(t, e, i, s) { const n = e.points, { count: o, start: a, ilen: r } = Qn(n, i, s), { move: l = !0, reverse: h } = s || {}; let c, d, u, f, g, p, m = 0, x = 0; const b = t => (a + (h ? r - t : t)) % o, _ = () => { f !== g && (t.lineTo(m, g), t.lineTo(m, f), t.lineTo(m, p)) }; for (l && (d = n[b(0)], t.moveTo(d.x, d.y)), c = 0; c <= r; ++c) { if (d = n[b(c)], d.skip) continue; const e = d.x, i = d.y, s = 0 | e; s === u ? (i < f ? f = i : i > g && (g = i), m = (x * m + e) / ++x) : (_(), t.lineTo(e, i), u = s, x = 0, f = g = i), p = i } _() } function io(t) { const e = t.options, i = e.borderDash && e.borderDash.length; return !(t._decimated || t._loop || e.tension || "monotone" === e.cubicInterpolationMode || e.stepped || i) ? eo : to } const so = "function" == typeof Path2D; function no(t, e, i, s) { so && !e.options.segment ? function (t, e, i, s) { let n = e._path; n || (n = e._path = new Path2D, e.path(n, i, s) && n.closePath()), Jn(t, e.options), t.stroke(n) }(t, e, i, s) : function (t, e, i, s) { const { segments: n, options: o } = e, a = io(e); for (const r of n) Jn(t, o, r.style), t.beginPath(), a(t, e, r, { start: i, end: i + s - 1 }) && t.closePath(), t.stroke() }(t, e, i, s) } class oo extends $s { static id = "line"; static defaults = { borderCapStyle: "butt", borderDash: [], borderDashOffset: 0, borderJoinStyle: "miter", borderWidth: 3, capBezierPoints: !0, cubicInterpolationMode: "default", fill: !1, spanGaps: !1, stepped: !1, tension: 0 }; static defaultRoutes = { backgroundColor: "backgroundColor", borderColor: "borderColor" }; static descriptors = { _scriptable: !0, _indexable: t => "borderDash" !== t && "fill" !== t }; constructor(t) { super(), this.animated = !0, this.options = void 0, this._chart = void 0, this._loop = void 0, this._fullLoop = void 0, this._path = void 0, this._points = void 0, this._segments = void 0, this._decimated = !1, this._pointsUpdated = !1, this._datasetIndex = void 0, t && Object.assign(this, t) } updateControlPoints(t, e) { const i = this.options; if ((i.tension || "monotone" === i.cubicInterpolationMode) && !i.stepped && !this._pointsUpdated) { const s = i.spanGaps ? this._loop : this._fullLoop; hi(this._points, i, t, s, e), this._pointsUpdated = !0 } } set points(t) { this._points = t, delete this._segments, delete this._path, this._pointsUpdated = !1 } get points() { return this._points } get segments() { return this._segments || (this._segments = zi(this, this.options.segment)) } first() { const t = this.segments, e = this.points; return t.length && e[t[0].start] } last() { const t = this.segments, e = this.points, i = t.length; return i && e[t[i - 1].end] } interpolate(t, e) { const i = this.options, s = t[e], n = this.points, o = Ii(this, { property: e, start: s, end: s }); if (!o.length) return; const a = [], r = function (t) { return t.stepped ? pi : t.tension || "monotone" === t.cubicInterpolationMode ? mi : gi }(i); let l, h; for (l = 0, h = o.length; l < h; ++l) { const { start: h, end: c } = o[l], d = n[h], u = n[c]; if (d === u) { a.push(d); continue } const f = r(d, u, Math.abs((s - d[e]) / (u[e] - d[e])), i.stepped); f[e] = t[e], a.push(f) } return 1 === a.length ? a[0] : a } pathSegment(t, e, i) { return io(this)(t, this, e, i) } path(t, e, i) { const s = this.segments, n = io(this); let o = this._loop; e = e || 0, i = i || this.points.length - e; for (const a of s) o &= n(t, this, a, { start: e, end: e + i - 1 }); return !!o } draw(t, e, i, s) { const n = this.options || {}; (this.points || []).length && n.borderWidth && (t.save(), no(t, this, i, s), t.restore()), this.animated && (this._pointsUpdated = !1, this._path = void 0) } } function ao(t, e, i, s) { const n = t.options, { [i]: o } = t.getProps([i], s); return Math.abs(e - o) < n.radius + n.hitRadius } function ro(t, e) { const { x: i, y: s, base: n, width: o, height: a } = t.getProps(["x", "y", "base", "width", "height"], e); let r, l, h, c, d; return t.horizontal ? (d = a / 2, r = Math.min(i, n), l = Math.max(i, n), h = s - d, c = s + d) : (d = o / 2, r = i - d, l = i + d, h = Math.min(s, n), c = Math.max(s, n)), { left: r, top: h, right: l, bottom: c } } function lo(t, e, i, s) { return t ? 0 : Z(e, i, s) } function ho(t) { const e = ro(t), i = e.right - e.left, s = e.bottom - e.top, n = function (t, e, i) { const s = t.options.borderWidth, n = t.borderSkipped, o = Mi(s); return { t: lo(n.top, o.top, 0, i), r: lo(n.right, o.right, 0, e), b: lo(n.bottom, o.bottom, 0, i), l: lo(n.left, o.left, 0, e) } }(t, i / 2, s / 2), a = function (t, e, i) { const { enableBorderRadius: s } = t.getProps(["enableBorderRadius"]), n = t.options.borderRadius, a = wi(n), r = Math.min(e, i), l = t.borderSkipped, h = s || o(n); return { topLeft: lo(!h || l.top || l.left, a.topLeft, 0, r), topRight: lo(!h || l.top || l.right, a.topRight, 0, r), bottomLeft: lo(!h || l.bottom || l.left, a.bottomLeft, 0, r), bottomRight: lo(!h || l.bottom || l.right, a.bottomRight, 0, r) } }(t, i / 2, s / 2); return { outer: { x: e.left, y: e.top, w: i, h: s, radius: a }, inner: { x: e.left + n.l, y: e.top + n.t, w: i - n.l - n.r, h: s - n.t - n.b, radius: { topLeft: Math.max(0, a.topLeft - Math.max(n.t, n.l)), topRight: Math.max(0, a.topRight - Math.max(n.t, n.r)), bottomLeft: Math.max(0, a.bottomLeft - Math.max(n.b, n.l)), bottomRight: Math.max(0, a.bottomRight - Math.max(n.b, n.r)) } } } } function co(t, e, i, s) { const n = null === e, o = null === i, a = t && !(n && o) && ro(t, s); return a && (n || tt(e, a.left, a.right)) && (o || tt(i, a.top, a.bottom)) } function uo(t, e) { t.rect(e.x, e.y, e.w, e.h) } function fo(t, e, i = {}) { const s = t.x !== i.x ? -e : 0, n = t.y !== i.y ? -e : 0, o = (t.x + t.w !== i.x + i.w ? e : 0) - s, a = (t.y + t.h !== i.y + i.h ? e : 0) - n; return { x: t.x + s, y: t.y + n, w: t.w + o, h: t.h + a, radius: t.radius } } var go = Object.freeze({ __proto__: null, ArcElement: class extends $s { static id = "arc"; static defaults = { borderAlign: "center", borderColor: "#fff", borderDash: [], borderDashOffset: 0, borderJoinStyle: void 0, borderRadius: 0, borderWidth: 2, offset: 0, spacing: 0, angle: void 0, circular: !0, selfJoin: !1 }; static defaultRoutes = { backgroundColor: "backgroundColor" }; static descriptors = { _scriptable: !0, _indexable: t => "borderDash" !== t }; circumference; endAngle; fullCircles; innerRadius; outerRadius; pixelMargin; startAngle; constructor(t) { super(), this.options = void 0, this.circumference = void 0, this.startAngle = void 0, this.endAngle = void 0, this.innerRadius = void 0, this.outerRadius = void 0, this.pixelMargin = 0, this.fullCircles = 0, t && Object.assign(this, t) } inRange(t, e, i) { const s = this.getProps(["x", "y"], i), { angle: n, distance: o } = X(s, { x: t, y: e }), { startAngle: a, endAngle: r, innerRadius: h, outerRadius: c, circumference: d } = this.getProps(["startAngle", "endAngle", "innerRadius", "outerRadius", "circumference"], i), u = (this.options.spacing + this.options.borderWidth) / 2, f = l(d, r - a), g = J(n, a, r) && a !== r, p = f >= O || g, m = tt(o, h + u, c + u); return p && m } getCenterPoint(t) { const { x: e, y: i, startAngle: s, endAngle: n, innerRadius: o, outerRadius: a } = this.getProps(["x", "y", "startAngle", "endAngle", "innerRadius", "outerRadius"], t), { offset: r, spacing: l } = this.options, h = (s + n) / 2, c = (o + a + l + r) / 2; return { x: e + Math.cos(h) * c, y: i + Math.sin(h) * c } } tooltipPosition(t) { return this.getCenterPoint(t) } draw(t) { const { options: e, circumference: i } = this, s = (e.offset || 0) / 4, n = (e.spacing || 0) / 2, o = e.circular; if (this.pixelMargin = "inner" === e.borderAlign ? .33 : 0, this.fullCircles = i > O ? Math.floor(i / O) : 0, 0 === i || this.innerRadius < 0 || this.outerRadius < 0) return; t.save(); const a = (this.startAngle + this.endAngle) / 2; t.translate(Math.cos(a) * s, Math.sin(a) * s); const r = s * (1 - Math.sin(Math.min(C, i || 0))); t.fillStyle = e.backgroundColor, t.strokeStyle = e.borderColor, function (t, e, i, s, n) { const { fullCircles: o, startAngle: a, circumference: r } = e; let l = e.endAngle; if (o) { Kn(t, e, i, s, l, n); for (let e = 0; e < o; ++e)t.fill(); isNaN(r) || (l = a + (r % O || O)) } Kn(t, e, i, s, l, n), t.fill() }(t, this, r, n, o), Gn(t, this, r, n, o), t.restore() } }, BarElement: class extends $s { static id = "bar"; static defaults = { borderSkipped: "start", borderWidth: 0, borderRadius: 0, inflateAmount: "auto", pointStyle: void 0 }; static defaultRoutes = { backgroundColor: "backgroundColor", borderColor: "borderColor" }; constructor(t) { super(), this.options = void 0, this.horizontal = void 0, this.base = void 0, this.width = void 0, this.height = void 0, this.inflateAmount = void 0, t && Object.assign(this, t) } draw(t) { const { inflateAmount: e, options: { borderColor: i, backgroundColor: s } } = this, { inner: n, outer: o } = ho(this), a = (r = o.radius).topLeft || r.topRight || r.bottomLeft || r.bottomRight ? He : uo; var r; t.save(), o.w === n.w && o.h === n.h || (t.beginPath(), a(t, fo(o, e, n)), t.clip(), a(t, fo(n, -e, o)), t.fillStyle = i, t.fill("evenodd")), t.beginPath(), a(t, fo(n, e)), t.fillStyle = s, t.fill(), t.restore() } inRange(t, e, i) { return co(this, t, e, i) } inXRange(t, e) { return co(this, t, null, e) } inYRange(t, e) { return co(this, null, t, e) } getCenterPoint(t) { const { x: e, y: i, base: s, horizontal: n } = this.getProps(["x", "y", "base", "horizontal"], t); return { x: n ? (e + s) / 2 : e, y: n ? i : (i + s) / 2 } } getRange(t) { return "x" === t ? this.width / 2 : this.height / 2 } }, LineElement: oo, PointElement: class extends $s { static id = "point"; parsed; skip; stop; static defaults = { borderWidth: 1, hitRadius: 1, hoverBorderWidth: 1, hoverRadius: 4, pointStyle: "circle", radius: 3, rotation: 0 }; static defaultRoutes = { backgroundColor: "backgroundColor", borderColor: "borderColor" }; constructor(t) { super(), this.options = void 0, this.parsed = void 0, this.skip = void 0, this.stop = void 0, t && Object.assign(this, t) } inRange(t, e, i) { const s = this.options, { x: n, y: o } = this.getProps(["x", "y"], i); return Math.pow(t - n, 2) + Math.pow(e - o, 2) < Math.pow(s.hitRadius + s.radius, 2) } inXRange(t, e) { return ao(this, t, "x", e) } inYRange(t, e) { return ao(this, t, "y", e) } getCenterPoint(t) { const { x: e, y: i } = this.getProps(["x", "y"], t); return { x: e, y: i } } size(t) { let e = (t = t || this.options || {}).radius || 0; e = Math.max(e, e && t.hoverRadius || 0); return 2 * (e + (e && t.borderWidth || 0)) } draw(t, e) { const i = this.options; this.skip || i.radius < .1 || !Re(this, e, this.size(i) / 2) || (t.strokeStyle = i.borderColor, t.lineWidth = i.borderWidth, t.fillStyle = i.backgroundColor, Le(t, i, this.x, this.y)) } getRange() { const t = this.options || {}; return t.radius + t.hitRadius } } }); function po(t, e, i, s) { const n = t.indexOf(e); if (-1 === n) return ((t, e, i, s) => ("string" == typeof e ? (i = t.push(e) - 1, s.unshift({ index: i, label: e })) : isNaN(e) && (i = null), i))(t, e, i, s); return n !== t.lastIndexOf(e) ? i : n } function mo(t) { const e = this.getLabels(); return t >= 0 && t < e.length ? e[t] : t } function xo(t, e, { horizontal: i, minRotation: s }) { const n = $(s), o = (i ? Math.sin(n) : Math.cos(n)) || .001, a = .75 * e * ("" + t).length; return Math.min(e / o, a) } class bo extends tn { constructor(t) { super(t), this.start = void 0, this.end = void 0, this._startValue = void 0, this._endValue = void 0, this._valueRange = 0 } parse(t, e) { return s(t) || ("number" == typeof t || t instanceof Number) && !isFinite(+t) ? null : +t } handleTickRangeOptions() { const { beginAtZero: t } = this.options, { minDefined: e, maxDefined: i } = this.getUserBounds(); let { min: s, max: n } = this; const o = t => s = e ? s : t, a = t => n = i ? n : t; if (t) { const t = F(s), e = F(n); t < 0 && e < 0 ? a(0) : t > 0 && e > 0 && o(0) } if (s === n) { let e = 0 === n ? 1 : Math.abs(.05 * n); a(n + e), t || o(s - e) } this.min = s, this.max = n } getTickLimit() { const t = this.options.ticks; let e, { maxTicksLimit: i, stepSize: s } = t; return s ? (e = Math.ceil(this.max / s) - Math.floor(this.min / s) + 1, e > 1e3 && (console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`), e = 1e3)) : (e = this.computeTickLimit(), i = i || 11), i && (e = Math.min(i, e)), e } computeTickLimit() { return Number.POSITIVE_INFINITY } buildTicks() { const t = this.options, e = t.ticks; let i = this.getTickLimit(); i = Math.max(2, i); const n = function (t, e) { const i = [], { bounds: n, step: o, min: a, max: r, precision: l, count: h, maxTicks: c, maxDigits: d, includeBounds: u } = t, f = o || 1, g = c - 1, { min: p, max: m } = e, x = !s(a), b = !s(r), _ = !s(h), y = (m - p) / (d + 1); let v, M, w, k, S = B((m - p) / g / f) * f; if (S < 1e-14 && !x && !b) return [{ value: p }, { value: m }]; k = Math.ceil(m / S) - Math.floor(p / S), k > g && (S = B(k * S / g / f) * f), s(l) || (v = Math.pow(10, l), S = Math.ceil(S * v) / v), "ticks" === n ? (M = Math.floor(p / S) * S, w = Math.ceil(m / S) * S) : (M = p, w = m), x && b && o && H((r - a) / o, S / 1e3) ? (k = Math.round(Math.min((r - a) / S, c)), S = (r - a) / k, M = a, w = r) : _ ? (M = x ? a : M, w = b ? r : w, k = h - 1, S = (w - M) / k) : (k = (w - M) / S, k = V(k, Math.round(k), S / 1e3) ? Math.round(k) : Math.ceil(k)); const P = Math.max(U(S), U(M)); v = Math.pow(10, s(l) ? P : l), M = Math.round(M * v) / v, w = Math.round(w * v) / v; let D = 0; for (x && (u && M !== a ? (i.push({ value: a }), M < a && D++, V(Math.round((M + D * S) * v) / v, a, xo(a, y, t)) && D++) : M < a && D++); D < k; ++D) { const t = Math.round((M + D * S) * v) / v; if (b && t > r) break; i.push({ value: t }) } return b && u && w !== r ? i.length && V(i[i.length - 1].value, r, xo(r, y, t)) ? i[i.length - 1].value = r : i.push({ value: r }) : b && w !== r || i.push({ value: w }), i }({ maxTicks: i, bounds: t.bounds, min: t.min, max: t.max, precision: e.precision, step: e.stepSize, count: e.count, maxDigits: this._maxDigits(), horizontal: this.isHorizontal(), minRotation: e.minRotation || 0, includeBounds: !1 !== e.includeBounds }, this._range || this); return "ticks" === t.bounds && j(n, this, "value"), t.reverse ? (n.reverse(), this.start = this.max, this.end = this.min) : (this.start = this.min, this.end = this.max), n } configure() { const t = this.ticks; let e = this.min, i = this.max; if (super.configure(), this.options.offset && t.length) { const s = (i - e) / Math.max(t.length - 1, 1) / 2; e -= s, i += s } this._startValue = e, this._endValue = i, this._valueRange = i - e } getLabelForValue(t) { return ne(t, this.chart.options.locale, this.options.ticks.format) } } class _o extends bo { static id = "linear"; static defaults = { ticks: { callback: ae.formatters.numeric } }; determineDataLimits() { const { min: t, max: e } = this.getMinMax(!0); this.min = a(t) ? t : 0, this.max = a(e) ? e : 1, this.handleTickRangeOptions() } computeTickLimit() { const t = this.isHorizontal(), e = t ? this.width : this.height, i = $(this.options.ticks.minRotation), s = (t ? Math.sin(i) : Math.cos(i)) || .001, n = this._resolveTickFontOptions(0); return Math.ceil(e / Math.min(40, n.lineHeight / s)) } getPixelForValue(t) { return null === t ? NaN : this.getPixelForDecimal((t - this._startValue) / this._valueRange) } getValueForPixel(t) { return this._startValue + this.getDecimalForPixel(t) * this._valueRange } } const yo = t => Math.floor(z(t)), vo = (t, e) => Math.pow(10, yo(t) + e); function Mo(t) { return 1 === t / Math.pow(10, yo(t)) } function wo(t, e, i) { const s = Math.pow(10, i), n = Math.floor(t / s); return Math.ceil(e / s) - n } function ko(t, { min: e, max: i }) { e = r(t.min, e); const s = [], n = yo(e); let o = function (t, e) { let i = yo(e - t); for (; wo(t, e, i) > 10;)i++; for (; wo(t, e, i) < 10;)i--; return Math.min(i, yo(t)) }(e, i), a = o < 0 ? Math.pow(10, Math.abs(o)) : 1; const l = Math.pow(10, o), h = n > o ? Math.pow(10, n) : 0, c = Math.round((e - h) * a) / a, d = Math.floor((e - h) / l / 10) * l * 10; let u = Math.floor((c - d) / Math.pow(10, o)), f = r(t.min, Math.round((h + d + u * Math.pow(10, o)) * a) / a); for (; f < i;)s.push({ value: f, major: Mo(f), significand: u }), u >= 10 ? u = u < 15 ? 15 : 20 : u++, u >= 20 && (o++, u = 2, a = o >= 0 ? 1 : a), f = Math.round((h + d + u * Math.pow(10, o)) * a) / a; const g = r(t.max, f); return s.push({ value: g, major: Mo(g), significand: u }), s } class So extends tn { static id = "logarithmic"; static defaults = { ticks: { callback: ae.formatters.logarithmic, major: { enabled: !0 } } }; constructor(t) { super(t), this.start = void 0, this.end = void 0, this._startValue = void 0, this._valueRange = 0 } parse(t, e) { const i = bo.prototype.parse.apply(this, [t, e]); if (0 !== i) return a(i) && i > 0 ? i : null; this._zero = !0 } determineDataLimits() { const { min: t, max: e } = this.getMinMax(!0); this.min = a(t) ? Math.max(0, t) : null, this.max = a(e) ? Math.max(0, e) : null, this.options.beginAtZero && (this._zero = !0), this._zero && this.min !== this._suggestedMin && !a(this._userMin) && (this.min = t === vo(this.min, 0) ? vo(this.min, -1) : vo(this.min, 0)), this.handleTickRangeOptions() } handleTickRangeOptions() { const { minDefined: t, maxDefined: e } = this.getUserBounds(); let i = this.min, s = this.max; const n = e => i = t ? i : e, o = t => s = e ? s : t; i === s && (i <= 0 ? (n(1), o(10)) : (n(vo(i, -1)), o(vo(s, 1)))), i <= 0 && n(vo(s, -1)), s <= 0 && o(vo(i, 1)), this.min = i, this.max = s } buildTicks() { const t = this.options, e = ko({ min: this._userMin, max: this._userMax }, this); return "ticks" === t.bounds && j(e, this, "value"), t.reverse ? (e.reverse(), this.start = this.max, this.end = this.min) : (this.start = this.min, this.end = this.max), e } getLabelForValue(t) { return void 0 === t ? "0" : ne(t, this.chart.options.locale, this.options.ticks.format) } configure() { const t = this.min; super.configure(), this._startValue = z(t), this._valueRange = z(this.max) - z(t) } getPixelForValue(t) { return void 0 !== t && 0 !== t || (t = this.min), null === t || isNaN(t) ? NaN : this.getPixelForDecimal(t === this.min ? 0 : (z(t) - this._startValue) / this._valueRange) } getValueForPixel(t) { const e = this.getDecimalForPixel(t); return Math.pow(10, this._startValue + e * this._valueRange) } } function Po(t) { const e = t.ticks; if (e.display && t.display) { const t = ki(e.backdropPadding); return l(e.font && e.font.size, ue.font.size) + t.height } return 0 } function Do(t, e, i, s, n) { return t === s || t === n ? { start: e - i / 2, end: e + i / 2 } : t < s || t > n ? { start: e - i, end: e } : { start: e, end: e + i } } function Co(t) { const e = { l: t.left + t._padding.left, r: t.right - t._padding.right, t: t.top + t._padding.top, b: t.bottom - t._padding.bottom }, i = Object.assign({}, e), s = [], o = [], a = t._pointLabels.length, r = t.options.pointLabels, l = r.centerPointLabels ? C / a : 0; for (let u = 0; u < a; u++) { const a = r.setContext(t.getPointLabelContext(u)); o[u] = a.padding; const f = t.getPointPosition(u, t.drawingArea + o[u], l), g = Si(a.font), p = (h = t.ctx, c = g, d = n(d = t._pointLabels[u]) ? d : [d], { w: Oe(h, c.string, d), h: d.length * c.lineHeight }); s[u] = p; const m = G(t.getIndexAngle(u) + l), x = Math.round(Y(m)); Oo(i, e, m, Do(x, f.x, p.w, 0, 180), Do(x, f.y, p.h, 90, 270)) } var h, c, d; t.setCenterPoint(e.l - i.l, i.r - e.r, e.t - i.t, i.b - e.b), t._pointLabelItems = function (t, e, i) { const s = [], n = t._pointLabels.length, o = t.options, { centerPointLabels: a, display: r } = o.pointLabels, l = { extra: Po(o) / 2, additionalAngle: a ? C / n : 0 }; let h; for (let o = 0; o < n; o++) { l.padding = i[o], l.size = e[o]; const n = Ao(t, o, l); s.push(n), "auto" === r && (n.visible = To(n, h), n.visible && (h = n)) } return s }(t, s, o) } function Oo(t, e, i, s, n) { const o = Math.abs(Math.sin(i)), a = Math.abs(Math.cos(i)); let r = 0, l = 0; s.start < e.l ? (r = (e.l - s.start) / o, t.l = Math.min(t.l, e.l - r)) : s.end > e.r && (r = (s.end - e.r) / o, t.r = Math.max(t.r, e.r + r)), n.start < e.t ? (l = (e.t - n.start) / a, t.t = Math.min(t.t, e.t - l)) : n.end > e.b && (l = (n.end - e.b) / a, t.b = Math.max(t.b, e.b + l)) } function Ao(t, e, i) { const s = t.drawingArea, { extra: n, additionalAngle: o, padding: a, size: r } = i, l = t.getPointPosition(e, s + n + a, o), h = Math.round(Y(G(l.angle + E))), c = function (t, e, i) { 90 === i || 270 === i ? t -= e / 2 : (i > 270 || i < 90) && (t -= e); return t }(l.y, r.h, h), d = function (t) { if (0 === t || 180 === t) return "center"; if (t < 180) return "left"; return "right" }(h), u = function (t, e, i) { "right" === i ? t -= e : "center" === i && (t -= e / 2); return t }(l.x, r.w, d); return { visible: !0, x: l.x, y: c, textAlign: d, left: u, top: c, right: u + r.w, bottom: c + r.h } } function To(t, e) { if (!e) return !0; const { left: i, top: s, right: n, bottom: o } = t; return !(Re({ x: i, y: s }, e) || Re({ x: i, y: o }, e) || Re({ x: n, y: s }, e) || Re({ x: n, y: o }, e)) } function Lo(t, e, i) { const { left: n, top: o, right: a, bottom: r } = i, { backdropColor: l } = e; if (!s(l)) { const i = wi(e.borderRadius), s = ki(e.backdropPadding); t.fillStyle = l; const h = n - s.left, c = o - s.top, d = a - n + s.width, u = r - o + s.height; Object.values(i).some((t => 0 !== t)) ? (t.beginPath(), He(t, { x: h, y: c, w: d, h: u, radius: i }), t.fill()) : t.fillRect(h, c, d, u) } } function Eo(t, e, i, s) { const { ctx: n } = t; if (i) n.arc(t.xCenter, t.yCenter, e, 0, O); else { let i = t.getPointPosition(0, e); n.moveTo(i.x, i.y); for (let o = 1; o < s; o++)i = t.getPointPosition(o, e), n.lineTo(i.x, i.y) } } class Ro extends bo { static id = "radialLinear"; static defaults = { display: !0, animate: !0, position: "chartArea", angleLines: { display: !0, lineWidth: 1, borderDash: [], borderDashOffset: 0 }, grid: { circular: !1 }, startAngle: 0, ticks: { showLabelBackdrop: !0, callback: ae.formatters.numeric }, pointLabels: { backdropColor: void 0, backdropPadding: 2, display: !0, font: { size: 10 }, callback: t => t, padding: 5, centerPointLabels: !1 } }; static defaultRoutes = { "angleLines.color": "borderColor", "pointLabels.color": "color", "ticks.color": "color" }; static descriptors = { angleLines: { _fallback: "grid" } }; constructor(t) { super(t), this.xCenter = void 0, this.yCenter = void 0, this.drawingArea = void 0, this._pointLabels = [], this._pointLabelItems = [] } setDimensions() { const t = this._padding = ki(Po(this.options) / 2), e = this.width = this.maxWidth - t.width, i = this.height = this.maxHeight - t.height; this.xCenter = Math.floor(this.left + e / 2 + t.left), this.yCenter = Math.floor(this.top + i / 2 + t.top), this.drawingArea = Math.floor(Math.min(e, i) / 2) } determineDataLimits() { const { min: t, max: e } = this.getMinMax(!1); this.min = a(t) && !isNaN(t) ? t : 0, this.max = a(e) && !isNaN(e) ? e : 0, this.handleTickRangeOptions() } computeTickLimit() { return Math.ceil(this.drawingArea / Po(this.options)) } generateTickLabels(t) { bo.prototype.generateTickLabels.call(this, t), this._pointLabels = this.getLabels().map(((t, e) => { const i = d(this.options.pointLabels.callback, [t, e], this); return i || 0 === i ? i : "" })).filter(((t, e) => this.chart.getDataVisibility(e))) } fit() { const t = this.options; t.display && t.pointLabels.display ? Co(this) : this.setCenterPoint(0, 0, 0, 0) } setCenterPoint(t, e, i, s) { this.xCenter += Math.floor((t - e) / 2), this.yCenter += Math.floor((i - s) / 2), this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(t, e, i, s)) } getIndexAngle(t) { return G(t * (O / (this._pointLabels.length || 1)) + $(this.options.startAngle || 0)) } getDistanceFromCenterForValue(t) { if (s(t)) return NaN; const e = this.drawingArea / (this.max - this.min); return this.options.reverse ? (this.max - t) * e : (t - this.min) * e } getValueForDistanceFromCenter(t) { if (s(t)) return NaN; const e = t / (this.drawingArea / (this.max - this.min)); return this.options.reverse ? this.max - e : this.min + e } getPointLabelContext(t) { const e = this._pointLabels || []; if (t >= 0 && t < e.length) { const i = e[t]; return function (t, e, i) { return Ci(t, { label: i, index: e, type: "pointLabel" }) }(this.getContext(), t, i) } } getPointPosition(t, e, i = 0) { const s = this.getIndexAngle(t) - E + i; return { x: Math.cos(s) * e + this.xCenter, y: Math.sin(s) * e + this.yCenter, angle: s } } getPointPositionForValue(t, e) { return this.getPointPosition(t, this.getDistanceFromCenterForValue(e)) } getBasePosition(t) { return this.getPointPositionForValue(t || 0, this.getBaseValue()) } getPointLabelPosition(t) { const { left: e, top: i, right: s, bottom: n } = this._pointLabelItems[t]; return { left: e, top: i, right: s, bottom: n } } drawBackground() { const { backgroundColor: t, grid: { circular: e } } = this.options; if (t) { const i = this.ctx; i.save(), i.beginPath(), Eo(this, this.getDistanceFromCenterForValue(this._endValue), e, this._pointLabels.length), i.closePath(), i.fillStyle = t, i.fill(), i.restore() } } drawGrid() { const t = this.ctx, e = this.options, { angleLines: i, grid: s, border: n } = e, o = this._pointLabels.length; let a, r, l; if (e.pointLabels.display && function (t, e) { const { ctx: i, options: { pointLabels: s } } = t; for (let n = e - 1; n >= 0; n--) { const e = t._pointLabelItems[n]; if (!e.visible) continue; const o = s.setContext(t.getPointLabelContext(n)); Lo(i, o, e); const a = Si(o.font), { x: r, y: l, textAlign: h } = e; Ne(i, t._pointLabels[n], r, l + a.lineHeight / 2, a, { color: o.color, textAlign: h, textBaseline: "middle" }) } }(this, o), s.display && this.ticks.forEach(((t, e) => { if (0 !== e || 0 === e && this.min < 0) { r = this.getDistanceFromCenterForValue(t.value); const i = this.getContext(e), a = s.setContext(i), l = n.setContext(i); !function (t, e, i, s, n) { const o = t.ctx, a = e.circular, { color: r, lineWidth: l } = e; !a && !s || !r || !l || i < 0 || (o.save(), o.strokeStyle = r, o.lineWidth = l, o.setLineDash(n.dash || []), o.lineDashOffset = n.dashOffset, o.beginPath(), Eo(t, i, a, s), o.closePath(), o.stroke(), o.restore()) }(this, a, r, o, l) } })), i.display) { for (t.save(), a = o - 1; a >= 0; a--) { const s = i.setContext(this.getPointLabelContext(a)), { color: n, lineWidth: o } = s; o && n && (t.lineWidth = o, t.strokeStyle = n, t.setLineDash(s.borderDash), t.lineDashOffset = s.borderDashOffset, r = this.getDistanceFromCenterForValue(e.reverse ? this.min : this.max), l = this.getPointPosition(a, r), t.beginPath(), t.moveTo(this.xCenter, this.yCenter), t.lineTo(l.x, l.y), t.stroke()) } t.restore() } } drawBorder() { } drawLabels() { const t = this.ctx, e = this.options, i = e.ticks; if (!i.display) return; const s = this.getIndexAngle(0); let n, o; t.save(), t.translate(this.xCenter, this.yCenter), t.rotate(s), t.textAlign = "center", t.textBaseline = "middle", this.ticks.forEach(((s, a) => { if (0 === a && this.min >= 0 && !e.reverse) return; const r = i.setContext(this.getContext(a)), l = Si(r.font); if (n = this.getDistanceFromCenterForValue(this.ticks[a].value), r.showLabelBackdrop) { t.font = l.string, o = t.measureText(s.label).width, t.fillStyle = r.backdropColor; const e = ki(r.backdropPadding); t.fillRect(-o / 2 - e.left, -n - l.size / 2 - e.top, o + e.width, l.size + e.height) } Ne(t, s.label, 0, -n, l, { color: r.color, strokeColor: r.textStrokeColor, strokeWidth: r.textStrokeWidth }) })), t.restore() } drawTitle() { } } const Io = { millisecond: { common: !0, size: 1, steps: 1e3 }, second: { common: !0, size: 1e3, steps: 60 }, minute: { common: !0, size: 6e4, steps: 60 }, hour: { common: !0, size: 36e5, steps: 24 }, day: { common: !0, size: 864e5, steps: 30 }, week: { common: !1, size: 6048e5, steps: 4 }, month: { common: !0, size: 2628e6, steps: 12 }, quarter: { common: !1, size: 7884e6, steps: 4 }, year: { common: !0, size: 3154e7 } }, zo = Object.keys(Io); function Fo(t, e) { return t - e } function Vo(t, e) { if (s(e)) return null; const i = t._adapter, { parser: n, round: o, isoWeekday: r } = t._parseOpts; let l = e; return "function" == typeof n && (l = n(l)), a(l) || (l = "string" == typeof n ? i.parse(l, n) : i.parse(l)), null === l ? null : (o && (l = "week" !== o || !N(r) && !0 !== r ? i.startOf(l, o) : i.startOf(l, "isoWeek", r)), +l) } function Bo(t, e, i, s) { const n = zo.length; for (let o = zo.indexOf(t); o < n - 1; ++o) { const t = Io[zo[o]], n = t.steps ? t.steps : Number.MAX_SAFE_INTEGER; if (t.common && Math.ceil((i - e) / (n * t.size)) <= s) return zo[o] } return zo[n - 1] } function Wo(t, e, i) { if (i) { if (i.length) { const { lo: s, hi: n } = et(i, e); t[i[s] >= e ? i[s] : i[n]] = !0 } } else t[e] = !0 } function No(t, e, i) { const s = [], n = {}, o = e.length; let a, r; for (a = 0; a < o; ++a)r = e[a], n[r] = a, s.push({ value: r, major: !1 }); return 0 !== o && i ? function (t, e, i, s) { const n = t._adapter, o = +n.startOf(e[0].value, s), a = e[e.length - 1].value; let r, l; for (r = o; r <= a; r = +n.add(r, 1, s))l = i[r], l >= 0 && (e[l].major = !0); return e }(t, s, n, i) : s } class Ho extends tn { static id = "time"; static defaults = { bounds: "data", adapters: {}, time: { parser: !1, unit: !1, round: !1, isoWeekday: !1, minUnit: "millisecond", displayFormats: {} }, ticks: { source: "auto", callback: !1, major: { enabled: !1 } } }; constructor(t) { super(t), this._cache = { data: [], labels: [], all: [] }, this._unit = "day", this._majorUnit = void 0, this._offsets = {}, this._normalized = !1, this._parseOpts = void 0 } init(t, e = {}) { const i = t.time || (t.time = {}), s = this._adapter = new In._date(t.adapters.date); s.init(e), b(i.displayFormats, s.formats()), this._parseOpts = { parser: i.parser, round: i.round, isoWeekday: i.isoWeekday }, super.init(t), this._normalized = e.normalized } parse(t, e) { return void 0 === t ? null : Vo(this, t) } beforeLayout() { super.beforeLayout(), this._cache = { data: [], labels: [], all: [] } } determineDataLimits() { const t = this.options, e = this._adapter, i = t.time.unit || "day"; let { min: s, max: n, minDefined: o, maxDefined: r } = this.getUserBounds(); function l(t) { o || isNaN(t.min) || (s = Math.min(s, t.min)), r || isNaN(t.max) || (n = Math.max(n, t.max)) } o && r || (l(this._getLabelBounds()), "ticks" === t.bounds && "labels" === t.ticks.source || l(this.getMinMax(!1))), s = a(s) && !isNaN(s) ? s : +e.startOf(Date.now(), i), n = a(n) && !isNaN(n) ? n : +e.endOf(Date.now(), i) + 1, this.min = Math.min(s, n - 1), this.max = Math.max(s + 1, n) } _getLabelBounds() { const t = this.getLabelTimestamps(); let e = Number.POSITIVE_INFINITY, i = Number.NEGATIVE_INFINITY; return t.length && (e = t[0], i = t[t.length - 1]), { min: e, max: i } } buildTicks() { const t = this.options, e = t.time, i = t.ticks, s = "labels" === i.source ? this.getLabelTimestamps() : this._generate(); "ticks" === t.bounds && s.length && (this.min = this._userMin || s[0], this.max = this._userMax || s[s.length - 1]); const n = this.min, o = nt(s, n, this.max); return this._unit = e.unit || (i.autoSkip ? Bo(e.minUnit, this.min, this.max, this._getLabelCapacity(n)) : function (t, e, i, s, n) { for (let o = zo.length - 1; o >= zo.indexOf(i); o--) { const i = zo[o]; if (Io[i].common && t._adapter.diff(n, s, i) >= e - 1) return i } return zo[i ? zo.indexOf(i) : 0] }(this, o.length, e.minUnit, this.min, this.max)), this._majorUnit = i.major.enabled && "year" !== this._unit ? function (t) { for (let e = zo.indexOf(t) + 1, i = zo.length; e < i; ++e)if (Io[zo[e]].common) return zo[e] }(this._unit) : void 0, this.initOffsets(s), t.reverse && o.reverse(), No(this, o, this._majorUnit) } afterAutoSkip() { this.options.offsetAfterAutoskip && this.initOffsets(this.ticks.map((t => +t.value))) } initOffsets(t = []) { let e, i, s = 0, n = 0; this.options.offset && t.length && (e = this.getDecimalForValue(t[0]), s = 1 === t.length ? 1 - e : (this.getDecimalForValue(t[1]) - e) / 2, i = this.getDecimalForValue(t[t.length - 1]), n = 1 === t.length ? i : (i - this.getDecimalForValue(t[t.length - 2])) / 2); const o = t.length < 3 ? .5 : .25; s = Z(s, 0, o), n = Z(n, 0, o), this._offsets = { start: s, end: n, factor: 1 / (s + 1 + n) } } _generate() { const t = this._adapter, e = this.min, i = this.max, s = this.options, n = s.time, o = n.unit || Bo(n.minUnit, e, i, this._getLabelCapacity(e)), a = l(s.ticks.stepSize, 1), r = "week" === o && n.isoWeekday, h = N(r) || !0 === r, c = {}; let d, u, f = e; if (h && (f = +t.startOf(f, "isoWeek", r)), f = +t.startOf(f, h ? "day" : o), t.diff(i, e, o) > 1e5 * a) throw new Error(e + " and " + i + " are too far apart with stepSize of " + a + " " + o); const g = "data" === s.ticks.source && this.getDataTimestamps(); for (d = f, u = 0; d < i; d = +t.add(d, a, o), u++)Wo(c, d, g); return d !== i && "ticks" !== s.bounds && 1 !== u || Wo(c, d, g), Object.keys(c).sort(Fo).map((t => +t)) } getLabelForValue(t) { const e = this._adapter, i = this.options.time; return i.tooltipFormat ? e.format(t, i.tooltipFormat) : e.format(t, i.displayFormats.datetime) } format(t, e) { const i = this.options.time.displayFormats, s = this._unit, n = e || i[s]; return this._adapter.format(t, n) } _tickFormatFunction(t, e, i, s) { const n = this.options, o = n.ticks.callback; if (o) return d(o, [t, e, i], this); const a = n.time.displayFormats, r = this._unit, l = this._majorUnit, h = r && a[r], c = l && a[l], u = i[e], f = l && c && u && u.major; return this._adapter.format(t, s || (f ? c : h)) } generateTickLabels(t) { let e, i, s; for (e = 0, i = t.length; e < i; ++e)s = t[e], s.label = this._tickFormatFunction(s.value, e, t) } getDecimalForValue(t) { return null === t ? NaN : (t - this.min) / (this.max - this.min) } getPixelForValue(t) { const e = this._offsets, i = this.getDecimalForValue(t); return this.getPixelForDecimal((e.start + i) * e.factor) } getValueForPixel(t) { const e = this._offsets, i = this.getDecimalForPixel(t) / e.factor - e.end; return this.min + i * (this.max - this.min) } _getLabelSize(t) { const e = this.options.ticks, i = this.ctx.measureText(t).width, s = $(this.isHorizontal() ? e.maxRotation : e.minRotation), n = Math.cos(s), o = Math.sin(s), a = this._resolveTickFontOptions(0).size; return { w: i * n + a * o, h: i * o + a * n } } _getLabelCapacity(t) { const e = this.options.time, i = e.displayFormats, s = i[e.unit] || i.millisecond, n = this._tickFormatFunction(t, 0, No(this, [t], this._majorUnit), s), o = this._getLabelSize(n), a = Math.floor(this.isHorizontal() ? this.width / o.w : this.height / o.h) - 1; return a > 0 ? a : 1 } getDataTimestamps() { let t, e, i = this._cache.data || []; if (i.length) return i; const s = this.getMatchingVisibleMetas(); if (this._normalized && s.length) return this._cache.data = s[0].controller.getAllParsedValues(this); for (t = 0, e = s.length; t < e; ++t)i = i.concat(s[t].controller.getAllParsedValues(this)); return this._cache.data = this.normalize(i) } getLabelTimestamps() { const t = this._cache.labels || []; let e, i; if (t.length) return t; const s = this.getLabels(); for (e = 0, i = s.length; e < i; ++e)t.push(Vo(this, s[e])); return this._cache.labels = this._normalized ? t : this.normalize(t) } normalize(t) { return lt(t.sort(Fo)) } } function jo(t, e, i) { let s, n, o, a, r = 0, l = t.length - 1; i ? (e >= t[r].pos && e <= t[l].pos && ({ lo: r, hi: l } = it(t, "pos", e)), ({ pos: s, time: o } = t[r]), ({ pos: n, time: a } = t[l])) : (e >= t[r].time && e <= t[l].time && ({ lo: r, hi: l } = it(t, "time", e)), ({ time: s, pos: o } = t[r]), ({ time: n, pos: a } = t[l])); const h = n - s; return h ? o + (a - o) * (e - s) / h : o } var $o = Object.freeze({ __proto__: null, CategoryScale: class extends tn { static id = "category"; static defaults = { ticks: { callback: mo } }; constructor(t) { super(t), this._startValue = void 0, this._valueRange = 0, this._addedLabels = [] } init(t) { const e = this._addedLabels; if (e.length) { const t = this.getLabels(); for (const { index: i, label: s } of e) t[i] === s && t.splice(i, 1); this._addedLabels = [] } super.init(t) } parse(t, e) { if (s(t)) return null; const i = this.getLabels(); return ((t, e) => null === t ? null : Z(Math.round(t), 0, e))(e = isFinite(e) && i[e] === t ? e : po(i, t, l(e, t), this._addedLabels), i.length - 1) } determineDataLimits() { const { minDefined: t, maxDefined: e } = this.getUserBounds(); let { min: i, max: s } = this.getMinMax(!0); "ticks" === this.options.bounds && (t || (i = 0), e || (s = this.getLabels().length - 1)), this.min = i, this.max = s } buildTicks() { const t = this.min, e = this.max, i = this.options.offset, s = []; let n = this.getLabels(); n = 0 === t && e === n.length - 1 ? n : n.slice(t, e + 1), this._valueRange = Math.max(n.length - (i ? 0 : 1), 1), this._startValue = this.min - (i ? .5 : 0); for (let i = t; i <= e; i++)s.push({ value: i }); return s } getLabelForValue(t) { return mo.call(this, t) } configure() { super.configure(), this.isHorizontal() || (this._reversePixels = !this._reversePixels) } getPixelForValue(t) { return "number" != typeof t && (t = this.parse(t)), null === t ? NaN : this.getPixelForDecimal((t - this._startValue) / this._valueRange) } getPixelForTick(t) { const e = this.ticks; return t < 0 || t > e.length - 1 ? null : this.getPixelForValue(e[t].value) } getValueForPixel(t) { return Math.round(this._startValue + this.getDecimalForPixel(t) * this._valueRange) } getBasePixel() { return this.bottom } }, LinearScale: _o, LogarithmicScale: So, RadialLinearScale: Ro, TimeScale: Ho, TimeSeriesScale: class extends Ho { static id = "timeseries"; static defaults = Ho.defaults; constructor(t) { super(t), this._table = [], this._minPos = void 0, this._tableRange = void 0 } initOffsets() { const t = this._getTimestampsForTable(), e = this._table = this.buildLookupTable(t); this._minPos = jo(e, this.min), this._tableRange = jo(e, this.max) - this._minPos, super.initOffsets(t) } buildLookupTable(t) { const { min: e, max: i } = this, s = [], n = []; let o, a, r, l, h; for (o = 0, a = t.length; o < a; ++o)l = t[o], l >= e && l <= i && s.push(l); if (s.length < 2) return [{ time: e, pos: 0 }, { time: i, pos: 1 }]; for (o = 0, a = s.length; o < a; ++o)h = s[o + 1], r = s[o - 1], l = s[o], Math.round((h + r) / 2) !== l && n.push({ time: l, pos: o / (a - 1) }); return n } _generate() { const t = this.min, e = this.max; let i = super.getDataTimestamps(); return i.includes(t) && i.length || i.splice(0, 0, t), i.includes(e) && 1 !== i.length || i.push(e), i.sort(((t, e) => t - e)) } _getTimestampsForTable() { let t = this._cache.all || []; if (t.length) return t; const e = this.getDataTimestamps(), i = this.getLabelTimestamps(); return t = e.length && i.length ? this.normalize(e.concat(i)) : e.length ? e : i, t = this._cache.all = t, t } getDecimalForValue(t) { return (jo(this._table, t) - this._minPos) / this._tableRange } getValueForPixel(t) { const e = this._offsets, i = this.getDecimalForPixel(t) / e.factor - e.end; return jo(this._table, i * this._tableRange + this._minPos, !0) } } }); const Yo = ["rgb(54, 162, 235)", "rgb(255, 99, 132)", "rgb(255, 159, 64)", "rgb(255, 205, 86)", "rgb(75, 192, 192)", "rgb(153, 102, 255)", "rgb(201, 203, 207)"], Uo = Yo.map((t => t.replace("rgb(", "rgba(").replace(")", ", 0.5)"))); function Xo(t) { return Yo[t % Yo.length] } function qo(t) { return Uo[t % Uo.length] } function Ko(t) { let e = 0; return (i, s) => { const n = t.getDatasetMeta(s).controller; n instanceof $n ? e = function (t, e) { return t.backgroundColor = t.data.map((() => Xo(e++))), e }(i, e) : n instanceof Yn ? e = function (t, e) { return t.backgroundColor = t.data.map((() => qo(e++))), e }(i, e) : n && (e = function (t, e) { return t.borderColor = Xo(e), t.backgroundColor = qo(e), ++e }(i, e)) } } function Go(t) { let e; for (e in t) if (t[e].borderColor || t[e].backgroundColor) return !0; return !1 } var Jo = { id: "colors", defaults: { enabled: !0, forceOverride: !1 }, beforeLayout(t, e, i) { if (!i.enabled) return; const { data: { datasets: s }, options: n } = t.config, { elements: o } = n, a = Go(s) || (r = n) && (r.borderColor || r.backgroundColor) || o && Go(o) || "rgba(0,0,0,0.1)" !== ue.borderColor || "rgba(0,0,0,0.1)" !== ue.backgroundColor; var r; if (!i.forceOverride && a) return; const l = Ko(t); s.forEach(l) } }; function Zo(t) { if (t._decimated) { const e = t._data; delete t._decimated, delete t._data, Object.defineProperty(t, "data", { configurable: !0, enumerable: !0, writable: !0, value: e }) } } function Qo(t) { t.data.datasets.forEach((t => { Zo(t) })) } var ta = { id: "decimation", defaults: { algorithm: "min-max", enabled: !1 }, beforeElementsUpdate: (t, e, i) => { if (!i.enabled) return void Qo(t); const n = t.width; t.data.datasets.forEach(((e, o) => { const { _data: a, indexAxis: r } = e, l = t.getDatasetMeta(o), h = a || e.data; if ("y" === Pi([r, t.options.indexAxis])) return; if (!l.controller.supportsDecimation) return; const c = t.scales[l.xAxisID]; if ("linear" !== c.type && "time" !== c.type) return; if (t.options.parsing) return; let { start: d, count: u } = function (t, e) { const i = e.length; let s, n = 0; const { iScale: o } = t, { min: a, max: r, minDefined: l, maxDefined: h } = o.getUserBounds(); return l && (n = Z(it(e, o.axis, a).lo, 0, i - 1)), s = h ? Z(it(e, o.axis, r).hi + 1, n, i) - n : i - n, { start: n, count: s } }(l, h); if (u <= (i.threshold || 4 * n)) return void Zo(e); let f; switch (s(a) && (e._data = h, delete e.data, Object.defineProperty(e, "data", { configurable: !0, enumerable: !0, get: function () { return this._decimated }, set: function (t) { this._data = t } })), i.algorithm) { case "lttb": f = function (t, e, i, s, n) { const o = n.samples || s; if (o >= i) return t.slice(e, e + i); const a = [], r = (i - 2) / (o - 2); let l = 0; const h = e + i - 1; let c, d, u, f, g, p = e; for (a[l++] = t[p], c = 0; c < o - 2; c++) { let s, n = 0, o = 0; const h = Math.floor((c + 1) * r) + 1 + e, m = Math.min(Math.floor((c + 2) * r) + 1, i) + e, x = m - h; for (s = h; s < m; s++)n += t[s].x, o += t[s].y; n /= x, o /= x; const b = Math.floor(c * r) + 1 + e, _ = Math.min(Math.floor((c + 1) * r) + 1, i) + e, { x: y, y: v } = t[p]; for (u = f = -1, s = b; s < _; s++)f = .5 * Math.abs((y - n) * (t[s].y - v) - (y - t[s].x) * (o - v)), f > u && (u = f, d = t[s], g = s); a[l++] = d, p = g } return a[l++] = t[h], a }(h, d, u, n, i); break; case "min-max": f = function (t, e, i, n) { let o, a, r, l, h, c, d, u, f, g, p = 0, m = 0; const x = [], b = e + i - 1, _ = t[e].x, y = t[b].x - _; for (o = e; o < e + i; ++o) { a = t[o], r = (a.x - _) / y * n, l = a.y; const e = 0 | r; if (e === h) l < f ? (f = l, c = o) : l > g && (g = l, d = o), p = (m * p + a.x) / ++m; else { const i = o - 1; if (!s(c) && !s(d)) { const e = Math.min(c, d), s = Math.max(c, d); e !== u && e !== i && x.push({ ...t[e], x: p }), s !== u && s !== i && x.push({ ...t[s], x: p }) } o > 0 && i !== u && x.push(t[i]), x.push(a), h = e, m = 0, f = g = l, c = d = u = o } } return x }(h, d, u, n); break; default: throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`) }e._decimated = f })) }, destroy(t) { Qo(t) } }; function ea(t, e, i, s) { if (s) return; let n = e[t], o = i[t]; return "angle" === t && (n = G(n), o = G(o)), { property: t, start: n, end: o } } function ia(t, e, i) { for (; e > t; e--) { const t = i[e]; if (!isNaN(t.x) && !isNaN(t.y)) break } return e } function sa(t, e, i, s) { return t && e ? s(t[i], e[i]) : t ? t[i] : e ? e[i] : 0 } function na(t, e) { let i = [], s = !1; return n(t) ? (s = !0, i = t) : i = function (t, e) { const { x: i = null, y: s = null } = t || {}, n = e.points, o = []; return e.segments.forEach((({ start: t, end: e }) => { e = ia(t, e, n); const a = n[t], r = n[e]; null !== s ? (o.push({ x: a.x, y: s }), o.push({ x: r.x, y: s })) : null !== i && (o.push({ x: i, y: a.y }), o.push({ x: i, y: r.y })) })), o }(t, e), i.length ? new oo({ points: i, options: { tension: 0 }, _loop: s, _fullLoop: s }) : null } function oa(t) { return t && !1 !== t.fill } function aa(t, e, i) { let s = t[e].fill; const n = [e]; let o; if (!i) return s; for (; !1 !== s && -1 === n.indexOf(s);) { if (!a(s)) return s; if (o = t[s], !o) return !1; if (o.visible) return s; n.push(s), s = o.fill } return !1 } function ra(t, e, i) { const s = function (t) { const e = t.options, i = e.fill; let s = l(i && i.target, i); void 0 === s && (s = !!e.backgroundColor); if (!1 === s || null === s) return !1; if (!0 === s) return "origin"; return s }(t); if (o(s)) return !isNaN(s.value) && s; let n = parseFloat(s); return a(n) && Math.floor(n) === n ? function (t, e, i, s) { "-" !== t && "+" !== t || (i = e + i); if (i === e || i < 0 || i >= s) return !1; return i }(s[0], e, n, i) : ["origin", "start", "end", "stack", "shape"].indexOf(s) >= 0 && s } function la(t, e, i) { const s = []; for (let n = 0; n < i.length; n++) { const o = i[n], { first: a, last: r, point: l } = ha(o, e, "x"); if (!(!l || a && r)) if (a) s.unshift(l); else if (t.push(l), !r) break } t.push(...s) } function ha(t, e, i) { const s = t.interpolate(e, i); if (!s) return {}; const n = s[i], o = t.segments, a = t.points; let r = !1, l = !1; for (let t = 0; t < o.length; t++) { const e = o[t], s = a[e.start][i], h = a[e.end][i]; if (tt(n, s, h)) { r = n === s, l = n === h; break } } return { first: r, last: l, point: s } } class ca { constructor(t) { this.x = t.x, this.y = t.y, this.radius = t.radius } pathSegment(t, e, i) { const { x: s, y: n, radius: o } = this; return e = e || { start: 0, end: O }, t.arc(s, n, o, e.end, e.start, !0), !i.bounds } interpolate(t) { const { x: e, y: i, radius: s } = this, n = t.angle; return { x: e + Math.cos(n) * s, y: i + Math.sin(n) * s, angle: n } } } function da(t) { const { chart: e, fill: i, line: s } = t; if (a(i)) return function (t, e) { const i = t.getDatasetMeta(e), s = i && t.isDatasetVisible(e); return s ? i.dataset : null }(e, i); if ("stack" === i) return function (t) { const { scale: e, index: i, line: s } = t, n = [], o = s.segments, a = s.points, r = function (t, e) { const i = [], s = t.getMatchingVisibleMetas("line"); for (let t = 0; t < s.length; t++) { const n = s[t]; if (n.index === e) break; n.hidden || i.unshift(n.dataset) } return i }(e, i); r.push(na({ x: null, y: e.bottom }, s)); for (let t = 0; t < o.length; t++) { const e = o[t]; for (let t = e.start; t <= e.end; t++)la(n, a[t], r) } return new oo({ points: n, options: {} }) }(t); if ("shape" === i) return !0; const n = function (t) { const e = t.scale || {}; if (e.getPointPositionForValue) return function (t) { const { scale: e, fill: i } = t, s = e.options, n = e.getLabels().length, a = s.reverse ? e.max : e.min, r = function (t, e, i) { let s; return s = "start" === t ? i : "end" === t ? e.options.reverse ? e.min : e.max : o(t) ? t.value : e.getBaseValue(), s }(i, e, a), l = []; if (s.grid.circular) { const t = e.getPointPositionForValue(0, a); return new ca({ x: t.x, y: t.y, radius: e.getDistanceFromCenterForValue(r) }) } for (let t = 0; t < n; ++t)l.push(e.getPointPositionForValue(t, r)); return l }(t); return function (t) { const { scale: e = {}, fill: i } = t, s = function (t, e) { let i = null; return "start" === t ? i = e.bottom : "end" === t ? i = e.top : o(t) ? i = e.getPixelForValue(t.value) : e.getBasePixel && (i = e.getBasePixel()), i }(i, e); if (a(s)) { const t = e.isHorizontal(); return { x: t ? s : null, y: t ? null : s } } return null }(t) }(t); return n instanceof ca ? n : na(n, s) } function ua(t, e, i) { const s = da(e), { chart: n, index: o, line: a, scale: r, axis: l } = e, h = a.options, c = h.fill, d = h.backgroundColor, { above: u = d, below: f = d } = c || {}, g = n.getDatasetMeta(o), p = Ni(n, g); s && a.points.length && (Ie(t, i), function (t, e) { const { line: i, target: s, above: n, below: o, area: a, scale: r, clip: l } = e, h = i._loop ? "angle" : e.axis; t.save(); let c = o; o !== n && ("x" === h ? (fa(t, s, a.top), pa(t, { line: i, target: s, color: n, scale: r, property: h, clip: l }), t.restore(), t.save(), fa(t, s, a.bottom)) : "y" === h && (ga(t, s, a.left), pa(t, { line: i, target: s, color: o, scale: r, property: h, clip: l }), t.restore(), t.save(), ga(t, s, a.right), c = n)); pa(t, { line: i, target: s, color: c, scale: r, property: h, clip: l }), t.restore() }(t, { line: a, target: s, above: u, below: f, area: i, scale: r, axis: l, clip: p }), ze(t)) } function fa(t, e, i) { const { segments: s, points: n } = e; let o = !0, a = !1; t.beginPath(); for (const r of s) { const { start: s, end: l } = r, h = n[s], c = n[ia(s, l, n)]; o ? (t.moveTo(h.x, h.y), o = !1) : (t.lineTo(h.x, i), t.lineTo(h.x, h.y)), a = !!e.pathSegment(t, r, { move: a }), a ? t.closePath() : t.lineTo(c.x, i) } t.lineTo(e.first().x, i), t.closePath(), t.clip() } function ga(t, e, i) { const { segments: s, points: n } = e; let o = !0, a = !1; t.beginPath(); for (const r of s) { const { start: s, end: l } = r, h = n[s], c = n[ia(s, l, n)]; o ? (t.moveTo(h.x, h.y), o = !1) : (t.lineTo(i, h.y), t.lineTo(h.x, h.y)), a = !!e.pathSegment(t, r, { move: a }), a ? t.closePath() : t.lineTo(i, c.y) } t.lineTo(i, e.first().y), t.closePath(), t.clip() } function pa(t, e) { const { line: i, target: s, property: n, color: o, scale: a, clip: r } = e, l = function (t, e, i) { const s = t.segments, n = t.points, o = e.points, a = []; for (const t of s) { let { start: s, end: r } = t; r = ia(s, r, n); const l = ea(i, n[s], n[r], t.loop); if (!e.segments) { a.push({ source: t, target: l, start: n[s], end: n[r] }); continue } const h = Ii(e, l); for (const e of h) { const s = ea(i, o[e.start], o[e.end], e.loop), r = Ri(t, n, s); for (const t of r) a.push({ source: t, target: e, start: { [i]: sa(l, s, "start", Math.max) }, end: { [i]: sa(l, s, "end", Math.min) } }) } } return a }(i, s, n); for (const { source: e, target: h, start: c, end: d } of l) { const { style: { backgroundColor: l = o } = {} } = e, u = !0 !== s; t.save(), t.fillStyle = l, ma(t, a, r, u && ea(n, c, d)), t.beginPath(); const f = !!i.pathSegment(t, e); let g; if (u) { f ? t.closePath() : xa(t, s, d, n); const e = !!s.pathSegment(t, h, { move: f, reverse: !0 }); g = f && e, g || xa(t, s, c, n) } t.closePath(), t.fill(g ? "evenodd" : "nonzero"), t.restore() } } function ma(t, e, i, s) { const n = e.chart.chartArea, { property: o, start: a, end: r } = s || {}; if ("x" === o || "y" === o) { let e, s, l, h; "x" === o ? (e = a, s = n.top, l = r, h = n.bottom) : (e = n.left, s = a, l = n.right, h = r), t.beginPath(), i && (e = Math.max(e, i.left), l = Math.min(l, i.right), s = Math.max(s, i.top), h = Math.min(h, i.bottom)), t.rect(e, s, l - e, h - s), t.clip() } } function xa(t, e, i, s) { const n = e.interpolate(i, s); n && t.lineTo(n.x, n.y) } var ba = { id: "filler", afterDatasetsUpdate(t, e, i) { const s = (t.data.datasets || []).length, n = []; let o, a, r, l; for (a = 0; a < s; ++a)o = t.getDatasetMeta(a), r = o.dataset, l = null, r && r.options && r instanceof oo && (l = { visible: t.isDatasetVisible(a), index: a, fill: ra(r, a, s), chart: t, axis: o.controller.options.indexAxis, scale: o.vScale, line: r }), o.$filler = l, n.push(l); for (a = 0; a < s; ++a)l = n[a], l && !1 !== l.fill && (l.fill = aa(n, a, i.propagate)) }, beforeDraw(t, e, i) { const s = "beforeDraw" === i.drawTime, n = t.getSortedVisibleDatasetMetas(), o = t.chartArea; for (let e = n.length - 1; e >= 0; --e) { const i = n[e].$filler; i && (i.line.updateControlPoints(o, i.axis), s && i.fill && ua(t.ctx, i, o)) } }, beforeDatasetsDraw(t, e, i) { if ("beforeDatasetsDraw" !== i.drawTime) return; const s = t.getSortedVisibleDatasetMetas(); for (let e = s.length - 1; e >= 0; --e) { const i = s[e].$filler; oa(i) && ua(t.ctx, i, t.chartArea) } }, beforeDatasetDraw(t, e, i) { const s = e.meta.$filler; oa(s) && "beforeDatasetDraw" === i.drawTime && ua(t.ctx, s, t.chartArea) }, defaults: { propagate: !0, drawTime: "beforeDatasetDraw" } }; const _a = (t, e) => { let { boxHeight: i = e, boxWidth: s = e } = t; return t.usePointStyle && (i = Math.min(i, e), s = t.pointStyleWidth || Math.min(s, e)), { boxWidth: s, boxHeight: i, itemHeight: Math.max(e, i) } }; class ya extends $s { constructor(t) { super(), this._added = !1, this.legendHitBoxes = [], this._hoveredItem = null, this.doughnutMode = !1, this.chart = t.chart, this.options = t.options, this.ctx = t.ctx, this.legendItems = void 0, this.columnSizes = void 0, this.lineWidths = void 0, this.maxHeight = void 0, this.maxWidth = void 0, this.top = void 0, this.bottom = void 0, this.left = void 0, this.right = void 0, this.height = void 0, this.width = void 0, this._margins = void 0, this.position = void 0, this.weight = void 0, this.fullSize = void 0 } update(t, e, i) { this.maxWidth = t, this.maxHeight = e, this._margins = i, this.setDimensions(), this.buildLabels(), this.fit() } setDimensions() { this.isHorizontal() ? (this.width = this.maxWidth, this.left = this._margins.left, this.right = this.width) : (this.height = this.maxHeight, this.top = this._margins.top, this.bottom = this.height) } buildLabels() { const t = this.options.labels || {}; let e = d(t.generateLabels, [this.chart], this) || []; t.filter && (e = e.filter((e => t.filter(e, this.chart.data)))), t.sort && (e = e.sort(((e, i) => t.sort(e, i, this.chart.data)))), this.options.reverse && e.reverse(), this.legendItems = e } fit() { const { options: t, ctx: e } = this; if (!t.display) return void (this.width = this.height = 0); const i = t.labels, s = Si(i.font), n = s.size, o = this._computeTitleHeight(), { boxWidth: a, itemHeight: r } = _a(i, n); let l, h; e.font = s.string, this.isHorizontal() ? (l = this.maxWidth, h = this._fitRows(o, n, a, r) + 10) : (h = this.maxHeight, l = this._fitCols(o, s, a, r) + 10), this.width = Math.min(l, t.maxWidth || this.maxWidth), this.height = Math.min(h, t.maxHeight || this.maxHeight) } _fitRows(t, e, i, s) { const { ctx: n, maxWidth: o, options: { labels: { padding: a } } } = this, r = this.legendHitBoxes = [], l = this.lineWidths = [0], h = s + a; let c = t; n.textAlign = "left", n.textBaseline = "middle"; let d = -1, u = -h; return this.legendItems.forEach(((t, f) => { const g = i + e / 2 + n.measureText(t.text).width; (0 === f || l[l.length - 1] + g + 2 * a > o) && (c += h, l[l.length - (f > 0 ? 0 : 1)] = 0, u += h, d++), r[f] = { left: 0, top: u, row: d, width: g, height: s }, l[l.length - 1] += g + a })), c } _fitCols(t, e, i, s) { const { ctx: n, maxHeight: o, options: { labels: { padding: a } } } = this, r = this.legendHitBoxes = [], l = this.columnSizes = [], h = o - t; let c = a, d = 0, u = 0, f = 0, g = 0; return this.legendItems.forEach(((t, o) => { const { itemWidth: p, itemHeight: m } = function (t, e, i, s, n) { const o = function (t, e, i, s) { let n = t.text; n && "string" != typeof n && (n = n.reduce(((t, e) => t.length > e.length ? t : e))); return e + i.size / 2 + s.measureText(n).width }(s, t, e, i), a = function (t, e, i) { let s = t; "string" != typeof e.text && (s = va(e, i)); return s }(n, s, e.lineHeight); return { itemWidth: o, itemHeight: a } }(i, e, n, t, s); o > 0 && u + m + 2 * a > h && (c += d + a, l.push({ width: d, height: u }), f += d + a, g++, d = u = 0), r[o] = { left: f, top: u, col: g, width: p, height: m }, d = Math.max(d, p), u += m + a })), c += d, l.push({ width: d, height: u }), c } adjustHitBoxes() { if (!this.options.display) return; const t = this._computeTitleHeight(), { legendHitBoxes: e, options: { align: i, labels: { padding: s }, rtl: n } } = this, o = Oi(n, this.left, this.width); if (this.isHorizontal()) { let n = 0, a = ft(i, this.left + s, this.right - this.lineWidths[n]); for (const r of e) n !== r.row && (n = r.row, a = ft(i, this.left + s, this.right - this.lineWidths[n])), r.top += this.top + t + s, r.left = o.leftForLtr(o.x(a), r.width), a += r.width + s } else { let n = 0, a = ft(i, this.top + t + s, this.bottom - this.columnSizes[n].height); for (const r of e) r.col !== n && (n = r.col, a = ft(i, this.top + t + s, this.bottom - this.columnSizes[n].height)), r.top = a, r.left += this.left + s, r.left = o.leftForLtr(o.x(r.left), r.width), a += r.height + s } } isHorizontal() { return "top" === this.options.position || "bottom" === this.options.position } draw() { if (this.options.display) { const t = this.ctx; Ie(t, this), this._draw(), ze(t) } } _draw() { const { options: t, columnSizes: e, lineWidths: i, ctx: s } = this, { align: n, labels: o } = t, a = ue.color, r = Oi(t.rtl, this.left, this.width), h = Si(o.font), { padding: c } = o, d = h.size, u = d / 2; let f; this.drawTitle(), s.textAlign = r.textAlign("left"), s.textBaseline = "middle", s.lineWidth = .5, s.font = h.string; const { boxWidth: g, boxHeight: p, itemHeight: m } = _a(o, d), x = this.isHorizontal(), b = this._computeTitleHeight(); f = x ? { x: ft(n, this.left + c, this.right - i[0]), y: this.top + c + b, line: 0 } : { x: this.left + c, y: ft(n, this.top + b + c, this.bottom - e[0].height), line: 0 }, Ai(this.ctx, t.textDirection); const _ = m + c; this.legendItems.forEach(((y, v) => { s.strokeStyle = y.fontColor, s.fillStyle = y.fontColor; const M = s.measureText(y.text).width, w = r.textAlign(y.textAlign || (y.textAlign = o.textAlign)), k = g + u + M; let S = f.x, P = f.y; r.setWidth(this.width), x ? v > 0 && S + k + c > this.right && (P = f.y += _, f.line++, S = f.x = ft(n, this.left + c, this.right - i[f.line])) : v > 0 && P + _ > this.bottom && (S = f.x = S + e[f.line].width + c, f.line++, P = f.y = ft(n, this.top + b + c, this.bottom - e[f.line].height)); if (function (t, e, i) { if (isNaN(g) || g <= 0 || isNaN(p) || p < 0) return; s.save(); const n = l(i.lineWidth, 1); if (s.fillStyle = l(i.fillStyle, a), s.lineCap = l(i.lineCap, "butt"), s.lineDashOffset = l(i.lineDashOffset, 0), s.lineJoin = l(i.lineJoin, "miter"), s.lineWidth = n, s.strokeStyle = l(i.strokeStyle, a), s.setLineDash(l(i.lineDash, [])), o.usePointStyle) { const a = { radius: p * Math.SQRT2 / 2, pointStyle: i.pointStyle, rotation: i.rotation, borderWidth: n }, l = r.xPlus(t, g / 2); Ee(s, a, l, e + u, o.pointStyleWidth && g) } else { const o = e + Math.max((d - p) / 2, 0), a = r.leftForLtr(t, g), l = wi(i.borderRadius); s.beginPath(), Object.values(l).some((t => 0 !== t)) ? He(s, { x: a, y: o, w: g, h: p, radius: l }) : s.rect(a, o, g, p), s.fill(), 0 !== n && s.stroke() } s.restore() }(r.x(S), P, y), S = gt(w, S + g + u, x ? S + k : this.right, t.rtl), function (t, e, i) { Ne(s, i.text, t, e + m / 2, h, { strikethrough: i.hidden, textAlign: r.textAlign(i.textAlign) }) }(r.x(S), P, y), x) f.x += k + c; else if ("string" != typeof y.text) { const t = h.lineHeight; f.y += va(y, t) + c } else f.y += _ })), Ti(this.ctx, t.textDirection) } drawTitle() { const t = this.options, e = t.title, i = Si(e.font), s = ki(e.padding); if (!e.display) return; const n = Oi(t.rtl, this.left, this.width), o = this.ctx, a = e.position, r = i.size / 2, l = s.top + r; let h, c = this.left, d = this.width; if (this.isHorizontal()) d = Math.max(...this.lineWidths), h = this.top + l, c = ft(t.align, c, this.right - d); else { const e = this.columnSizes.reduce(((t, e) => Math.max(t, e.height)), 0); h = l + ft(t.align, this.top, this.bottom - e - t.labels.padding - this._computeTitleHeight()) } const u = ft(a, c, c + d); o.textAlign = n.textAlign(ut(a)), o.textBaseline = "middle", o.strokeStyle = e.color, o.fillStyle = e.color, o.font = i.string, Ne(o, e.text, u, h, i) } _computeTitleHeight() { const t = this.options.title, e = Si(t.font), i = ki(t.padding); return t.display ? e.lineHeight + i.height : 0 } _getLegendItemAt(t, e) { let i, s, n; if (tt(t, this.left, this.right) && tt(e, this.top, this.bottom)) for (n = this.legendHitBoxes, i = 0; i < n.length; ++i)if (s = n[i], tt(t, s.left, s.left + s.width) && tt(e, s.top, s.top + s.height)) return this.legendItems[i]; return null } handleEvent(t) { const e = this.options; if (!function (t, e) { if (("mousemove" === t || "mouseout" === t) && (e.onHover || e.onLeave)) return !0; if (e.onClick && ("click" === t || "mouseup" === t)) return !0; return !1 }(t.type, e)) return; const i = this._getLegendItemAt(t.x, t.y); if ("mousemove" === t.type || "mouseout" === t.type) { const o = this._hoveredItem, a = (n = i, null !== (s = o) && null !== n && s.datasetIndex === n.datasetIndex && s.index === n.index); o && !a && d(e.onLeave, [t, o, this], this), this._hoveredItem = i, i && !a && d(e.onHover, [t, i, this], this) } else i && d(e.onClick, [t, i, this], this); var s, n } } function va(t, e) { return e * (t.text ? t.text.length : 0) } var Ma = { id: "legend", _element: ya, start(t, e, i) { const s = t.legend = new ya({ ctx: t.ctx, options: i, chart: t }); ls.configure(t, s, i), ls.addBox(t, s) }, stop(t) { ls.removeBox(t, t.legend), delete t.legend }, beforeUpdate(t, e, i) { const s = t.legend; ls.configure(t, s, i), s.options = i }, afterUpdate(t) { const e = t.legend; e.buildLabels(), e.adjustHitBoxes() }, afterEvent(t, e) { e.replay || t.legend.handleEvent(e.event) }, defaults: { display: !0, position: "top", align: "center", fullSize: !0, reverse: !1, weight: 1e3, onClick(t, e, i) { const s = e.datasetIndex, n = i.chart; n.isDatasetVisible(s) ? (n.hide(s), e.hidden = !0) : (n.show(s), e.hidden = !1) }, onHover: null, onLeave: null, labels: { color: t => t.chart.options.color, boxWidth: 40, padding: 10, generateLabels(t) { const e = t.data.datasets, { labels: { usePointStyle: i, pointStyle: s, textAlign: n, color: o, useBorderRadius: a, borderRadius: r } } = t.legend.options; return t._getSortedDatasetMetas().map((t => { const l = t.controller.getStyle(i ? 0 : void 0), h = ki(l.borderWidth); return { text: e[t.index].label, fillStyle: l.backgroundColor, fontColor: o, hidden: !t.visible, lineCap: l.borderCapStyle, lineDash: l.borderDash, lineDashOffset: l.borderDashOffset, lineJoin: l.borderJoinStyle, lineWidth: (h.width + h.height) / 4, strokeStyle: l.borderColor, pointStyle: s || l.pointStyle, rotation: l.rotation, textAlign: n || l.textAlign, borderRadius: a && (r || l.borderRadius), datasetIndex: t.index } }), this) } }, title: { color: t => t.chart.options.color, display: !1, position: "center", text: "" } }, descriptors: { _scriptable: t => !t.startsWith("on"), labels: { _scriptable: t => !["generateLabels", "filter", "sort"].includes(t) } } }; class wa extends $s { constructor(t) { super(), this.chart = t.chart, this.options = t.options, this.ctx = t.ctx, this._padding = void 0, this.top = void 0, this.bottom = void 0, this.left = void 0, this.right = void 0, this.width = void 0, this.height = void 0, this.position = void 0, this.weight = void 0, this.fullSize = void 0 } update(t, e) { const i = this.options; if (this.left = 0, this.top = 0, !i.display) return void (this.width = this.height = this.right = this.bottom = 0); this.width = this.right = t, this.height = this.bottom = e; const s = n(i.text) ? i.text.length : 1; this._padding = ki(i.padding); const o = s * Si(i.font).lineHeight + this._padding.height; this.isHorizontal() ? this.height = o : this.width = o } isHorizontal() { const t = this.options.position; return "top" === t || "bottom" === t } _drawArgs(t) { const { top: e, left: i, bottom: s, right: n, options: o } = this, a = o.align; let r, l, h, c = 0; return this.isHorizontal() ? (l = ft(a, i, n), h = e + t, r = n - i) : ("left" === o.position ? (l = i + t, h = ft(a, s, e), c = -.5 * C) : (l = n - t, h = ft(a, e, s), c = .5 * C), r = s - e), { titleX: l, titleY: h, maxWidth: r, rotation: c } } draw() { const t = this.ctx, e = this.options; if (!e.display) return; const i = Si(e.font), s = i.lineHeight / 2 + this._padding.top, { titleX: n, titleY: o, maxWidth: a, rotation: r } = this._drawArgs(s); Ne(t, e.text, 0, 0, i, { color: e.color, maxWidth: a, rotation: r, textAlign: ut(e.align), textBaseline: "middle", translation: [n, o] }) } } var ka = { id: "title", _element: wa, start(t, e, i) { !function (t, e) { const i = new wa({ ctx: t.ctx, options: e, chart: t }); ls.configure(t, i, e), ls.addBox(t, i), t.titleBlock = i }(t, i) }, stop(t) { const e = t.titleBlock; ls.removeBox(t, e), delete t.titleBlock }, beforeUpdate(t, e, i) { const s = t.titleBlock; ls.configure(t, s, i), s.options = i }, defaults: { align: "center", display: !1, font: { weight: "bold" }, fullSize: !0, padding: 10, position: "top", text: "", weight: 2e3 }, defaultRoutes: { color: "color" }, descriptors: { _scriptable: !0, _indexable: !1 } }; const Sa = new WeakMap; var Pa = { id: "subtitle", start(t, e, i) { const s = new wa({ ctx: t.ctx, options: i, chart: t }); ls.configure(t, s, i), ls.addBox(t, s), Sa.set(t, s) }, stop(t) { ls.removeBox(t, Sa.get(t)), Sa.delete(t) }, beforeUpdate(t, e, i) { const s = Sa.get(t); ls.configure(t, s, i), s.options = i }, defaults: { align: "center", display: !1, font: { weight: "normal" }, fullSize: !0, padding: 0, position: "top", text: "", weight: 1500 }, defaultRoutes: { color: "color" }, descriptors: { _scriptable: !0, _indexable: !1 } }; const Da = { average(t) { if (!t.length) return !1; let e, i, s = new Set, n = 0, o = 0; for (e = 0, i = t.length; e < i; ++e) { const i = t[e].element; if (i && i.hasValue()) { const t = i.tooltipPosition(); s.add(t.x), n += t.y, ++o } } if (0 === o || 0 === s.size) return !1; return { x: [...s].reduce(((t, e) => t + e)) / s.size, y: n / o } }, nearest(t, e) { if (!t.length) return !1; let i, s, n, o = e.x, a = e.y, r = Number.POSITIVE_INFINITY; for (i = 0, s = t.length; i < s; ++i) { const s = t[i].element; if (s && s.hasValue()) { const t = q(e, s.getCenterPoint()); t < r && (r = t, n = s) } } if (n) { const t = n.tooltipPosition(); o = t.x, a = t.y } return { x: o, y: a } } }; function Ca(t, e) { return e && (n(e) ? Array.prototype.push.apply(t, e) : t.push(e)), t } function Oa(t) { return ("string" == typeof t || t instanceof String) && t.indexOf("\n") > -1 ? t.split("\n") : t } function Aa(t, e) { const { element: i, datasetIndex: s, index: n } = e, o = t.getDatasetMeta(s).controller, { label: a, value: r } = o.getLabelAndValue(n); return { chart: t, label: a, parsed: o.getParsed(n), raw: t.data.datasets[s].data[n], formattedValue: r, dataset: o.getDataset(), dataIndex: n, datasetIndex: s, element: i } } function Ta(t, e) { const i = t.chart.ctx, { body: s, footer: n, title: o } = t, { boxWidth: a, boxHeight: r } = e, l = Si(e.bodyFont), h = Si(e.titleFont), c = Si(e.footerFont), d = o.length, f = n.length, g = s.length, p = ki(e.padding); let m = p.height, x = 0, b = s.reduce(((t, e) => t + e.before.length + e.lines.length + e.after.length), 0); if (b += t.beforeBody.length + t.afterBody.length, d && (m += d * h.lineHeight + (d - 1) * e.titleSpacing + e.titleMarginBottom), b) { m += g * (e.displayColors ? Math.max(r, l.lineHeight) : l.lineHeight) + (b - g) * l.lineHeight + (b - 1) * e.bodySpacing } f && (m += e.footerMarginTop + f * c.lineHeight + (f - 1) * e.footerSpacing); let _ = 0; const y = function (t) { x = Math.max(x, i.measureText(t).width + _) }; return i.save(), i.font = h.string, u(t.title, y), i.font = l.string, u(t.beforeBody.concat(t.afterBody), y), _ = e.displayColors ? a + 2 + e.boxPadding : 0, u(s, (t => { u(t.before, y), u(t.lines, y), u(t.after, y) })), _ = 0, i.font = c.string, u(t.footer, y), i.restore(), x += p.width, { width: x, height: m } } function La(t, e, i, s) { const { x: n, width: o } = i, { width: a, chartArea: { left: r, right: l } } = t; let h = "center"; return "center" === s ? h = n <= (r + l) / 2 ? "left" : "right" : n <= o / 2 ? h = "left" : n >= a - o / 2 && (h = "right"), function (t, e, i, s) { const { x: n, width: o } = s, a = i.caretSize + i.caretPadding; return "left" === t && n + o + a > e.width || "right" === t && n - o - a < 0 || void 0 }(h, t, e, i) && (h = "center"), h } function Ea(t, e, i) { const s = i.yAlign || e.yAlign || function (t, e) { const { y: i, height: s } = e; return i < s / 2 ? "top" : i > t.height - s / 2 ? "bottom" : "center" }(t, i); return { xAlign: i.xAlign || e.xAlign || La(t, e, i, s), yAlign: s } } function Ra(t, e, i, s) { const { caretSize: n, caretPadding: o, cornerRadius: a } = t, { xAlign: r, yAlign: l } = i, h = n + o, { topLeft: c, topRight: d, bottomLeft: u, bottomRight: f } = wi(a); let g = function (t, e) { let { x: i, width: s } = t; return "right" === e ? i -= s : "center" === e && (i -= s / 2), i }(e, r); const p = function (t, e, i) { let { y: s, height: n } = t; return "top" === e ? s += i : s -= "bottom" === e ? n + i : n / 2, s }(e, l, h); return "center" === l ? "left" === r ? g += h : "right" === r && (g -= h) : "left" === r ? g -= Math.max(c, u) + n : "right" === r && (g += Math.max(d, f) + n), { x: Z(g, 0, s.width - e.width), y: Z(p, 0, s.height - e.height) } } function Ia(t, e, i) { const s = ki(i.padding); return "center" === e ? t.x + t.width / 2 : "right" === e ? t.x + t.width - s.right : t.x + s.left } function za(t) { return Ca([], Oa(t)) } function Fa(t, e) { const i = e && e.dataset && e.dataset.tooltip && e.dataset.tooltip.callbacks; return i ? t.override(i) : t } const Va = { beforeTitle: e, title(t) { if (t.length > 0) { const e = t[0], i = e.chart.data.labels, s = i ? i.length : 0; if (this && this.options && "dataset" === this.options.mode) return e.dataset.label || ""; if (e.label) return e.label; if (s > 0 && e.dataIndex < s) return i[e.dataIndex] } return "" }, afterTitle: e, beforeBody: e, beforeLabel: e, label(t) { if (this && this.options && "dataset" === this.options.mode) return t.label + ": " + t.formattedValue || t.formattedValue; let e = t.dataset.label || ""; e && (e += ": "); const i = t.formattedValue; return s(i) || (e += i), e }, labelColor(t) { const e = t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex); return { borderColor: e.borderColor, backgroundColor: e.backgroundColor, borderWidth: e.borderWidth, borderDash: e.borderDash, borderDashOffset: e.borderDashOffset, borderRadius: 0 } }, labelTextColor() { return this.options.bodyColor }, labelPointStyle(t) { const e = t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex); return { pointStyle: e.pointStyle, rotation: e.rotation } }, afterLabel: e, afterBody: e, beforeFooter: e, footer: e, afterFooter: e }; function Ba(t, e, i, s) { const n = t[e].call(i, s); return void 0 === n ? Va[e].call(i, s) : n } class Wa extends $s { static positioners = Da; constructor(t) { super(), this.opacity = 0, this._active = [], this._eventPosition = void 0, this._size = void 0, this._cachedAnimations = void 0, this._tooltipItems = [], this.$animations = void 0, this.$context = void 0, this.chart = t.chart, this.options = t.options, this.dataPoints = void 0, this.title = void 0, this.beforeBody = void 0, this.body = void 0, this.afterBody = void 0, this.footer = void 0, this.xAlign = void 0, this.yAlign = void 0, this.x = void 0, this.y = void 0, this.height = void 0, this.width = void 0, this.caretX = void 0, this.caretY = void 0, this.labelColors = void 0, this.labelPointStyles = void 0, this.labelTextColors = void 0 } initialize(t) { this.options = t, this._cachedAnimations = void 0, this.$context = void 0 } _resolveAnimations() { const t = this._cachedAnimations; if (t) return t; const e = this.chart, i = this.options.setContext(this.getContext()), s = i.enabled && e.options.animation && i.animations, n = new Ts(this.chart, s); return s._cacheable && (this._cachedAnimations = Object.freeze(n)), n } getContext() { return this.$context || (this.$context = (t = this.chart.getContext(), e = this, i = this._tooltipItems, Ci(t, { tooltip: e, tooltipItems: i, type: "tooltip" }))); var t, e, i } getTitle(t, e) { const { callbacks: i } = e, s = Ba(i, "beforeTitle", this, t), n = Ba(i, "title", this, t), o = Ba(i, "afterTitle", this, t); let a = []; return a = Ca(a, Oa(s)), a = Ca(a, Oa(n)), a = Ca(a, Oa(o)), a } getBeforeBody(t, e) { return za(Ba(e.callbacks, "beforeBody", this, t)) } getBody(t, e) { const { callbacks: i } = e, s = []; return u(t, (t => { const e = { before: [], lines: [], after: [] }, n = Fa(i, t); Ca(e.before, Oa(Ba(n, "beforeLabel", this, t))), Ca(e.lines, Ba(n, "label", this, t)), Ca(e.after, Oa(Ba(n, "afterLabel", this, t))), s.push(e) })), s } getAfterBody(t, e) { return za(Ba(e.callbacks, "afterBody", this, t)) } getFooter(t, e) { const { callbacks: i } = e, s = Ba(i, "beforeFooter", this, t), n = Ba(i, "footer", this, t), o = Ba(i, "afterFooter", this, t); let a = []; return a = Ca(a, Oa(s)), a = Ca(a, Oa(n)), a = Ca(a, Oa(o)), a } _createItems(t) { const e = this._active, i = this.chart.data, s = [], n = [], o = []; let a, r, l = []; for (a = 0, r = e.length; a < r; ++a)l.push(Aa(this.chart, e[a])); return t.filter && (l = l.filter(((e, s, n) => t.filter(e, s, n, i)))), t.itemSort && (l = l.sort(((e, s) => t.itemSort(e, s, i)))), u(l, (e => { const i = Fa(t.callbacks, e); s.push(Ba(i, "labelColor", this, e)), n.push(Ba(i, "labelPointStyle", this, e)), o.push(Ba(i, "labelTextColor", this, e)) })), this.labelColors = s, this.labelPointStyles = n, this.labelTextColors = o, this.dataPoints = l, l } update(t, e) { const i = this.options.setContext(this.getContext()), s = this._active; let n, o = []; if (s.length) { const t = Da[i.position].call(this, s, this._eventPosition); o = this._createItems(i), this.title = this.getTitle(o, i), this.beforeBody = this.getBeforeBody(o, i), this.body = this.getBody(o, i), this.afterBody = this.getAfterBody(o, i), this.footer = this.getFooter(o, i); const e = this._size = Ta(this, i), a = Object.assign({}, t, e), r = Ea(this.chart, i, a), l = Ra(i, a, r, this.chart); this.xAlign = r.xAlign, this.yAlign = r.yAlign, n = { opacity: 1, x: l.x, y: l.y, width: e.width, height: e.height, caretX: t.x, caretY: t.y } } else 0 !== this.opacity && (n = { opacity: 0 }); this._tooltipItems = o, this.$context = void 0, n && this._resolveAnimations().update(this, n), t && i.external && i.external.call(this, { chart: this.chart, tooltip: this, replay: e }) } drawCaret(t, e, i, s) { const n = this.getCaretPosition(t, i, s); e.lineTo(n.x1, n.y1), e.lineTo(n.x2, n.y2), e.lineTo(n.x3, n.y3) } getCaretPosition(t, e, i) { const { xAlign: s, yAlign: n } = this, { caretSize: o, cornerRadius: a } = i, { topLeft: r, topRight: l, bottomLeft: h, bottomRight: c } = wi(a), { x: d, y: u } = t, { width: f, height: g } = e; let p, m, x, b, _, y; return "center" === n ? (_ = u + g / 2, "left" === s ? (p = d, m = p - o, b = _ + o, y = _ - o) : (p = d + f, m = p + o, b = _ - o, y = _ + o), x = p) : (m = "left" === s ? d + Math.max(r, h) + o : "right" === s ? d + f - Math.max(l, c) - o : this.caretX, "top" === n ? (b = u, _ = b - o, p = m - o, x = m + o) : (b = u + g, _ = b + o, p = m + o, x = m - o), y = b), { x1: p, x2: m, x3: x, y1: b, y2: _, y3: y } } drawTitle(t, e, i) { const s = this.title, n = s.length; let o, a, r; if (n) { const l = Oi(i.rtl, this.x, this.width); for (t.x = Ia(this, i.titleAlign, i), e.textAlign = l.textAlign(i.titleAlign), e.textBaseline = "middle", o = Si(i.titleFont), a = i.titleSpacing, e.fillStyle = i.titleColor, e.font = o.string, r = 0; r < n; ++r)e.fillText(s[r], l.x(t.x), t.y + o.lineHeight / 2), t.y += o.lineHeight + a, r + 1 === n && (t.y += i.titleMarginBottom - a) } } _drawColorBox(t, e, i, s, n) { const a = this.labelColors[i], r = this.labelPointStyles[i], { boxHeight: l, boxWidth: h } = n, c = Si(n.bodyFont), d = Ia(this, "left", n), u = s.x(d), f = l < c.lineHeight ? (c.lineHeight - l) / 2 : 0, g = e.y + f; if (n.usePointStyle) { const e = { radius: Math.min(h, l) / 2, pointStyle: r.pointStyle, rotation: r.rotation, borderWidth: 1 }, i = s.leftForLtr(u, h) + h / 2, o = g + l / 2; t.strokeStyle = n.multiKeyBackground, t.fillStyle = n.multiKeyBackground, Le(t, e, i, o), t.strokeStyle = a.borderColor, t.fillStyle = a.backgroundColor, Le(t, e, i, o) } else { t.lineWidth = o(a.borderWidth) ? Math.max(...Object.values(a.borderWidth)) : a.borderWidth || 1, t.strokeStyle = a.borderColor, t.setLineDash(a.borderDash || []), t.lineDashOffset = a.borderDashOffset || 0; const e = s.leftForLtr(u, h), i = s.leftForLtr(s.xPlus(u, 1), h - 2), r = wi(a.borderRadius); Object.values(r).some((t => 0 !== t)) ? (t.beginPath(), t.fillStyle = n.multiKeyBackground, He(t, { x: e, y: g, w: h, h: l, radius: r }), t.fill(), t.stroke(), t.fillStyle = a.backgroundColor, t.beginPath(), He(t, { x: i, y: g + 1, w: h - 2, h: l - 2, radius: r }), t.fill()) : (t.fillStyle = n.multiKeyBackground, t.fillRect(e, g, h, l), t.strokeRect(e, g, h, l), t.fillStyle = a.backgroundColor, t.fillRect(i, g + 1, h - 2, l - 2)) } t.fillStyle = this.labelTextColors[i] } drawBody(t, e, i) { const { body: s } = this, { bodySpacing: n, bodyAlign: o, displayColors: a, boxHeight: r, boxWidth: l, boxPadding: h } = i, c = Si(i.bodyFont); let d = c.lineHeight, f = 0; const g = Oi(i.rtl, this.x, this.width), p = function (i) { e.fillText(i, g.x(t.x + f), t.y + d / 2), t.y += d + n }, m = g.textAlign(o); let x, b, _, y, v, M, w; for (e.textAlign = o, e.textBaseline = "middle", e.font = c.string, t.x = Ia(this, m, i), e.fillStyle = i.bodyColor, u(this.beforeBody, p), f = a && "right" !== m ? "center" === o ? l / 2 + h : l + 2 + h : 0, y = 0, M = s.length; y < M; ++y) { for (x = s[y], b = this.labelTextColors[y], e.fillStyle = b, u(x.before, p), _ = x.lines, a && _.length && (this._drawColorBox(e, t, y, g, i), d = Math.max(c.lineHeight, r)), v = 0, w = _.length; v < w; ++v)p(_[v]), d = c.lineHeight; u(x.after, p) } f = 0, d = c.lineHeight, u(this.afterBody, p), t.y -= n } drawFooter(t, e, i) { const s = this.footer, n = s.length; let o, a; if (n) { const r = Oi(i.rtl, this.x, this.width); for (t.x = Ia(this, i.footerAlign, i), t.y += i.footerMarginTop, e.textAlign = r.textAlign(i.footerAlign), e.textBaseline = "middle", o = Si(i.footerFont), e.fillStyle = i.footerColor, e.font = o.string, a = 0; a < n; ++a)e.fillText(s[a], r.x(t.x), t.y + o.lineHeight / 2), t.y += o.lineHeight + i.footerSpacing } } drawBackground(t, e, i, s) { const { xAlign: n, yAlign: o } = this, { x: a, y: r } = t, { width: l, height: h } = i, { topLeft: c, topRight: d, bottomLeft: u, bottomRight: f } = wi(s.cornerRadius); e.fillStyle = s.backgroundColor, e.strokeStyle = s.borderColor, e.lineWidth = s.borderWidth, e.beginPath(), e.moveTo(a + c, r), "top" === o && this.drawCaret(t, e, i, s), e.lineTo(a + l - d, r), e.quadraticCurveTo(a + l, r, a + l, r + d), "center" === o && "right" === n && this.drawCaret(t, e, i, s), e.lineTo(a + l, r + h - f), e.quadraticCurveTo(a + l, r + h, a + l - f, r + h), "bottom" === o && this.drawCaret(t, e, i, s), e.lineTo(a + u, r + h), e.quadraticCurveTo(a, r + h, a, r + h - u), "center" === o && "left" === n && this.drawCaret(t, e, i, s), e.lineTo(a, r + c), e.quadraticCurveTo(a, r, a + c, r), e.closePath(), e.fill(), s.borderWidth > 0 && e.stroke() } _updateAnimationTarget(t) { const e = this.chart, i = this.$animations, s = i && i.x, n = i && i.y; if (s || n) { const i = Da[t.position].call(this, this._active, this._eventPosition); if (!i) return; const o = this._size = Ta(this, t), a = Object.assign({}, i, this._size), r = Ea(e, t, a), l = Ra(t, a, r, e); s._to === l.x && n._to === l.y || (this.xAlign = r.xAlign, this.yAlign = r.yAlign, this.width = o.width, this.height = o.height, this.caretX = i.x, this.caretY = i.y, this._resolveAnimations().update(this, l)) } } _willRender() { return !!this.opacity } draw(t) { const e = this.options.setContext(this.getContext()); let i = this.opacity; if (!i) return; this._updateAnimationTarget(e); const s = { width: this.width, height: this.height }, n = { x: this.x, y: this.y }; i = Math.abs(i) < .001 ? 0 : i; const o = ki(e.padding), a = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length; e.enabled && a && (t.save(), t.globalAlpha = i, this.drawBackground(n, t, s, e), Ai(t, e.textDirection), n.y += o.top, this.drawTitle(n, t, e), this.drawBody(n, t, e), this.drawFooter(n, t, e), Ti(t, e.textDirection), t.restore()) } getActiveElements() { return this._active || [] } setActiveElements(t, e) { const i = this._active, s = t.map((({ datasetIndex: t, index: e }) => { const i = this.chart.getDatasetMeta(t); if (!i) throw new Error("Cannot find a dataset at index " + t); return { datasetIndex: t, element: i.data[e], index: e } })), n = !f(i, s), o = this._positionChanged(s, e); (n || o) && (this._active = s, this._eventPosition = e, this._ignoreReplayEvents = !0, this.update(!0)) } handleEvent(t, e, i = !0) { if (e && this._ignoreReplayEvents) return !1; this._ignoreReplayEvents = !1; const s = this.options, n = this._active || [], o = this._getActiveElements(t, n, e, i), a = this._positionChanged(o, t), r = e || !f(o, n) || a; return r && (this._active = o, (s.enabled || s.external) && (this._eventPosition = { x: t.x, y: t.y }, this.update(!0, e))), r } _getActiveElements(t, e, i, s) { const n = this.options; if ("mouseout" === t.type) return []; if (!s) return e.filter((t => this.chart.data.datasets[t.datasetIndex] && void 0 !== this.chart.getDatasetMeta(t.datasetIndex).controller.getParsed(t.index))); const o = this.chart.getElementsAtEventForMode(t, n.mode, n, i); return n.reverse && o.reverse(), o } _positionChanged(t, e) { const { caretX: i, caretY: s, options: n } = this, o = Da[n.position].call(this, t, e); return !1 !== o && (i !== o.x || s !== o.y) } } var Na = { id: "tooltip", _element: Wa, positioners: Da, afterInit(t, e, i) { i && (t.tooltip = new Wa({ chart: t, options: i })) }, beforeUpdate(t, e, i) { t.tooltip && t.tooltip.initialize(i) }, reset(t, e, i) { t.tooltip && t.tooltip.initialize(i) }, afterDraw(t) { const e = t.tooltip; if (e && e._willRender()) { const i = { tooltip: e }; if (!1 === t.notifyPlugins("beforeTooltipDraw", { ...i, cancelable: !0 })) return; e.draw(t.ctx), t.notifyPlugins("afterTooltipDraw", i) } }, afterEvent(t, e) { if (t.tooltip) { const i = e.replay; t.tooltip.handleEvent(e.event, i, e.inChartArea) && (e.changed = !0) } }, defaults: { enabled: !0, external: null, position: "average", backgroundColor: "rgba(0,0,0,0.8)", titleColor: "#fff", titleFont: { weight: "bold" }, titleSpacing: 2, titleMarginBottom: 6, titleAlign: "left", bodyColor: "#fff", bodySpacing: 2, bodyFont: {}, bodyAlign: "left", footerColor: "#fff", footerSpacing: 2, footerMarginTop: 6, footerFont: { weight: "bold" }, footerAlign: "left", padding: 6, caretPadding: 2, caretSize: 5, cornerRadius: 6, boxHeight: (t, e) => e.bodyFont.size, boxWidth: (t, e) =>
53 e.bodyFont.size, multiKeyBackground: "#fff", displayColors: !0, boxPadding: 0, borderColor: "rgba(0,0,0,0)", borderWidth: 0, animation: { duration: 400, easing: "easeOutQuart" }, animations: { numbers: { type: "number", properties: ["x", "y", "width", "height", "caretX", "caretY"] }, opacity: { easing: "linear", duration: 200 } }, callbacks: Va }, defaultRoutes: { bodyFont: "font", footerFont: "font", titleFont: "font" }, descriptors: { _scriptable: t => "filter" !== t && "itemSort" !== t && "external" !== t, _indexable: !1, callbacks: { _scriptable: !1, _indexable: !1 }, animation: { _fallback: !1 }, animations: { _fallback: "animation" } }, additionalOptionScopes: ["interaction"] }; return Tn.register(Un, $o, go, t), Tn.helpers = { ...Hi }, Tn._adapters = In, Tn.Animation = As, Tn.Animations = Ts, Tn.animator = bt, Tn.controllers = nn.controllers.items, Tn.DatasetController = js, Tn.Element = $s, Tn.elements = go, Tn.Interaction = Ki, Tn.layouts = ls, Tn.platforms = Ds, Tn.Scale = tn, Tn.Ticks = ae, Object.assign(Tn, Un, $o, go, t, Ds), Tn.Chart = Tn, "undefined" != typeof window && (window.Chart = Tn), Tn 54})); 55//# sourceMappingURL=chart.umd.min.js.map; 56(function(n,t){function u(){return new Date(Date.UTC.apply(Date,arguments))}function e(){var n=new Date;return u(n.getFullYear(),n.getMonth(),n.getDate())}function c(n){return function(){return this[n].apply(this,arguments)}}function y(t,i){function s(n,t){return t.toLowerCase()}var u=n(t).data(),f={},e,o=new RegExp("^"+i.toLowerCase()+"([A-Z])"),r;i=new RegExp("^"+i.toLowerCase());for(r in u)i.test(r)&&(e=r.replace(o,s),f[e]=u[r]);return f}function p(t){var u={},i;if(r[t]||(t=t.split("-")[0],r[t]))return i=r[t],n.each(v,function(n,t){t in i&&(u[t]=i[t])}),u}var s=n(window),l=function(){var t={get:function(n){return this.slice(n)[0]},contains:function(n){for(var i=n&&n.valueOf(),t=0,r=this.length;t<r;t++)if(this[t].valueOf()===i)return t;return-1},remove:function(n){this.splice(n,1)},replace:function(t){t&&(n.isArray(t)||(t=[t]),this.clear(),this.push.apply(this,t))},clear:function(){this.splice(0)},copy:function(){var n=new l;return n.replace(this),n}};return function(){var i=[];return i.push.apply(i,arguments),n.extend(i,t),i}}(),f=function(t,r){this.dates=new l;this.viewDate=e();this.focusDate=null;this._process_options(r);this.element=n(t);this.isInline=!1;this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".add-on, .input-group-addon, .btn"):!1;this.hasInput=this.component&&this.element.find("input").length;this.component&&this.component.length===0&&(this.component=!1);this.picker=n(i.template);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.viewMode=this.o.startView;this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(n,t){return parseInt(t)+1});this._allow_update=!1;this.setStartDate(this._o.startDate);this.setEndDate(this._o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.fillDow();this.fillMonths();this._allow_update=!0;this.update();this.showMode();this.isInline&&this.show()},h,a,o,v,r,i;f.prototype={constructor:f,_process_options:function(t){var u,e,h,f,s;this._o=n.extend({},this._o,t);u=this.o=n.extend({},this._o);e=u.language;r[e]||(e=e.split("-")[0],r[e]||(e=o.language));u.language=e;switch(u.startView){case 2:case"decade":u.startView=2;break;case 1:case"year":u.startView=1;break;default:u.startView=0}switch(u.minViewMode){case 1:case"months":u.minViewMode=1;break;case 2:case"years":u.minViewMode=2;break;default:u.minViewMode=0}if(u.startView=Math.max(u.startView,u.minViewMode),u.multidate!==!0&&(u.multidate=Number(u.multidate)||!1,u.multidate=u.multidate!==!1?Math.max(0,u.multidate):1),u.multidateSeparator=String(u.multidateSeparator),u.weekStart%=7,u.weekEnd=(u.weekStart+6)%7,h=i.parseFormat(u.format),u.startDate!==-Infinity&&(u.startDate=u.startDate?u.startDate instanceof Date?this._local_to_utc(this._zero_time(u.startDate)):i.parseDate(u.startDate,h,u.language):-Infinity),u.endDate!==Infinity&&(u.endDate=u.endDate?u.endDate instanceof Date?this._local_to_utc(this._zero_time(u.endDate)):i.parseDate(u.endDate,h,u.language):Infinity),u.daysOfWeekDisabled=u.daysOfWeekDisabled||[],n.isArray(u.daysOfWeekDisabled)||(u.daysOfWeekDisabled=u.daysOfWeekDisabled.split(/[,\s]*/)),u.daysOfWeekDisabled=n.map(u.daysOfWeekDisabled,function(n){return parseInt(n,10)}),f=String(u.orientation).toLowerCase().split(/\s+/g),s=u.orientation.toLowerCase(),f=n.grep(f,function(n){return/^auto|left|right|top|bottom$/.test(n)}),u.orientation={x:"auto",y:"auto"},s&&s!=="auto")if(f.length===1)switch(f[0]){case"top":case"bottom":u.orientation.y=f[0];break;case"left":case"right":u.orientation.x=f[0]}else s=n.grep(f,function(n){return/^left|right$/.test(n)}),u.orientation.x=s[0]||"auto",s=n.grep(f,function(n){return/^top|bottom$/.test(n)}),u.orientation.y=s[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(n){for(var i=0,f,r,u;i<n.length;i++){f=n[i][0];n[i].length===2?(r=t,u=n[i][1]):n[i].length===3&&(r=n[i][1],u=n[i][2]);f.on(u,r)}},_unapplyEvents:function(n){for(var i=0,f,r,u;i<n.length;i++)f=n[i][0],n[i].length===2?(u=t,r=n[i][1]):n[i].length===3&&(u=n[i][1],r=n[i][2]),f.off(r,u)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:n.proxy(this.show,this),keyup:n.proxy(function(t){n.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:n.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:n.proxy(this.show,this),keyup:n.proxy(function(t){n.inArray(t.keyCode,[27,37,39,38,40,32,13,9])===-1&&this.update()},this),keydown:n.proxy(this.keydown,this)}],[this.component,{click:n.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:n.proxy(this.show,this)}]];this._events.push([this.element,"*",{blur:n.proxy(function(n){this._focused_from=n.target},this)}],[this.element,{blur:n.proxy(function(n){this._focused_from=n.target},this)}]);this._secondaryEvents=[[this.picker,{click:n.proxy(this.click,this)}],[n(window),{resize:n.proxy(this.place,this)}],[n(document),{"mousedown touchstart":n.proxy(function(n){this.element.is(n.target)||this.element.find(n.target).length||this.picker.is(n.target)||this.picker.find(n.target).length||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(t,r){var u=r||this.dates.get(-1),f=this._utc_to_local(u);this.element.trigger({type:t,date:f,dates:n.map(this.dates,this._utc_to_local),format:n.proxy(function(n,t){arguments.length===0?(n=this.dates.length-1,t=this.o.format):typeof n=="string"&&(t=n,n=this.dates.length-1);t=t||this.o.format;var r=this.dates.get(n);return i.formatDate(r,t,this.o.language)},this)})},show:function(){this.isInline||this.picker.appendTo("body");this.picker.show();this.place();this._attachSecondaryEvents();this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide();this._detachEvents();this._detachSecondaryEvents();this.picker.remove();delete this.element.data().datepicker;this.isInput||delete this.element.data().date},_utc_to_local:function(n){return n&&new Date(n.getTime()+n.getTimezoneOffset()*6e4)},_local_to_utc:function(n){return n&&new Date(n.getTime()-n.getTimezoneOffset()*6e4)},_zero_time:function(n){return n&&new Date(n.getFullYear(),n.getMonth(),n.getDate())},_zero_utc_time:function(n){return n&&new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))},getDates:function(){return n.map(this.dates,this._utc_to_local)},getUTCDates:function(){return n.map(this.dates,function(n){return new Date(n)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return new Date(this.dates.get(-1))},setDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,t);this._trigger("changeDate");this.setValue()},setUTCDates:function(){var t=n.isArray(arguments[0])?arguments[0]:arguments;this.update.apply(this,n.map(t,this._utc_to_local));this._trigger("changeDate");this.setValue()},setDate:c("setDates"),setUTCDate:c("setUTCDates"),setValue:function(){var n=this.getFormattedDate();this.isInput?this.element.val(n).change():this.component&&this.element.find("input").val(n).change()},getFormattedDate:function(r){r===t&&(r=this.o.format);var u=this.o.language;return n.map(this.dates,function(n){return i.formatDate(n,r,u)}).join(this.o.multidateSeparator)},setStartDate:function(n){this._process_options({startDate:n});this.update();this.updateNavArrows()},setEndDate:function(n){this._process_options({endDate:n});this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(n){this._process_options({daysOfWeekDisabled:n});this.update();this.updateNavArrows()},place:function(){var i,v,o;if(!this.isInline){var u=this.picker.outerWidth(),f=this.picker.outerHeight(),h=10,c=s.width(),y=s.height(),l=s.scrollTop(),p=parseInt(this.element.parents().filter(function(){return n(this).css("z-index")!=="auto"}).first().css("z-index"))+10,t=this.component?this.component.parent().offset():this.element.offset(),a=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),w=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),r=t.left,e=t.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left");this.o.orientation.x!=="auto"?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(r-=u-w)):(this.picker.addClass("datepicker-orient-left"),t.left<0?r-=t.left-h:t.left+u>c&&(r=c-u-h));i=this.o.orientation.y;i==="auto"&&(v=-l+t.top-f,o=l+y-(t.top+a+f),i=Math.max(v,o)===o?"top":"bottom");this.picker.addClass("datepicker-orient-"+i);i==="top"?e+=a:e-=f+parseInt(this.picker.css("padding-top"));this.picker.css({top:e,left:r,zIndex:p})}},_allow_update:!0,update:function(){if(this._allow_update){var r=this.dates.copy(),t=[],u=!1;arguments.length?(n.each(arguments,n.proxy(function(n,i){i instanceof Date&&(i=this._local_to_utc(i));t.push(i)},this)),u=!0):(t=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),t=t&&this.o.multidate?t.split(this.o.multidateSeparator):[t],delete this.element.data().date);t=n.map(t,n.proxy(function(n){return i.parseDate(n,this.o.format,this.o.language)},this));t=n.grep(t,n.proxy(function(n){return n<this.o.startDate||n>this.o.endDate||!n},this),!0);this.dates.replace(t);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));u?this.setValue():t.length&&String(r)!==String(this.dates)&&this._trigger("changeDate");!this.dates.length&&r.length&&this._trigger("clearDate");this.fill()}},fillDow:function(){var i=this.o.weekStart,n="<tr>",t;for(this.o.calendarWeeks&&(t='<th class="cw"> <\/th>',n+=t,this.picker.find(".datepicker-days thead tr:first-child").prepend(t));i<this.o.weekStart+7;)n+='<th class="dow">'+r[this.o.language].daysMin[i++%7]+"<\/th>";n+="<\/tr>";this.picker.find(".datepicker-days thead").append(n)},fillMonths:function(){for(var n="",t=0;t<12;)n+='<span class="month">'+r[this.o.language].monthsShort[t++]+"<\/span>";this.picker.find(".datepicker-months td").html(n)},setRange:function(t){t&&t.length?this.range=n.map(t,function(n){return n.valueOf()}):delete this.range;this.fill()},getClassNames:function(t){var i=[],r=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),u=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()===r&&t.getUTCMonth()<f?i.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()===r&&t.getUTCMonth()>f)&&i.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&t.getUTCFullYear()===u.getFullYear()&&t.getUTCMonth()===u.getMonth()&&t.getUTCDate()===u.getDate()&&i.push("today"),this.dates.contains(t)!==-1&&i.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||n.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&i.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&i.push("range"),n.inArray(t.valueOf(),this.range)!==-1&&i.push("selected")),i},fill:function(){var d=new Date(this.viewDate),f=d.getUTCFullYear(),g=d.getUTCMonth(),y=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,ut=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,p=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,ft=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,et=r[this.o.language].today||r.en.today||"",ot=r[this.o.language].clear||r.en.clear||"",w,e,b,c,s,h,o,a,it,rt,l,v;for(this.picker.find(".datepicker-days thead th.datepicker-switch").text(r[this.o.language].months[g]+" "+f),this.picker.find("tfoot th.today").text(et).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(ot).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths(),e=u(f,g-1,28),b=i.getDaysInMonth(e.getUTCFullYear(),e.getUTCMonth()),e.setUTCDate(b),e.setUTCDate(b-(e.getUTCDay()-this.o.weekStart+7)%7),c=new Date(e),c.setUTCDate(c.getUTCDate()+42),c=c.valueOf(),s=[];e.valueOf()<c;){if(e.getUTCDay()===this.o.weekStart&&(s.push("<tr>"),this.o.calendarWeeks)){var nt=new Date(+e+(this.o.weekStart-e.getUTCDay()-7)%7*864e5),tt=new Date(Number(nt)+(11-nt.getUTCDay())%7*864e5),k=new Date(Number(k=u(tt.getUTCFullYear(),0,1))+(11-k.getUTCDay())%7*864e5),st=(tt-k)/6048e5+1;s.push('<td class="cw">'+st+"<\/td>")}h=this.getClassNames(e);h.push("day");this.o.beforeShowDay!==n.noop&&(o=this.o.beforeShowDay(this._utc_to_local(e)),o===t?o={}:typeof o=="boolean"?o={enabled:o}
56:typeof o=="string"&&(o={classes:o}),o.enabled===!1&&h.push("disabled"),o.classes&&(h=h.concat(o.classes.split(/\s+/))),o.tooltip&&(w=o.tooltip));h=n.unique(h);s.push('<td class="'+h.join(" ")+'"'+(w?' title="'+w+'"':"")+">"+e.getUTCDate()+"<\/td>");e.getUTCDay()===this.o.weekEnd&&s.push("<\/tr>");e.setUTCDate(e.getUTCDate()+1)}for(this.picker.find(".datepicker-days tbody").empty().append(s.join("")),a=this.picker.find(".datepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active"),n.each(this.dates,function(n,t){t.getUTCFullYear()===f&&a.eq(t.getUTCMonth()).addClass("active")}),(f<y||f>p)&&a.addClass("disabled"),f===y&&a.slice(0,ut).addClass("disabled"),f===p&&a.slice(ft+1).addClass("disabled"),s="",f=parseInt(f/10,10)*10,it=this.picker.find(".datepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td"),f-=1,rt=n.map(this.dates,function(n){return n.getUTCFullYear()}),v=-1;v<11;v++)l=["year"],v===-1?l.push("old"):v===10&&l.push("new"),n.inArray(f,rt)!==-1&&l.push("active"),(f<y||f>p)&&l.push("disabled"),s+='<span class="'+l.join(" ")+'">'+f+"<\/span>",f+=1;it.html(s)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(t){var r,e,f,o,c,s,l,h;if(t.preventDefault(),r=n(t.target).closest("span, td, th"),r.length===1)switch(r[0].nodeName.toLowerCase()){case"th":switch(r[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":c=i.modes[this.viewMode].navStep*(r[0].className==="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,c);this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,c);this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":s=new Date;s=u(s.getFullYear(),s.getMonth(),s.getDate(),0,0,0);this.showMode(-2);l=this.o.todayBtn==="linked"?null:"view";this._setDate(s,l);break;case"clear":this.isInput?h=this.element:this.component&&(h=this.element.find("input"));h&&h.val("").change();this.update();this._trigger("changeDate");this.o.autoclose&&this.hide()}break;case"span":r.is(".disabled")||(this.viewDate.setUTCDate(1),r.is(".month")?(o=1,f=r.parent().find("span").index(r),e=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(f),this._trigger("changeMonth",this.viewDate),this.o.minViewMode===1&&this._setDate(u(e,f,o))):(o=1,f=0,e=parseInt(r.text(),10)||0,this.viewDate.setUTCFullYear(e),this._trigger("changeYear",this.viewDate),this.o.minViewMode===2&&this._setDate(u(e,f,o))),this.showMode(-1),this.fill());break;case"td":r.is(".day")&&!r.is(".disabled")&&(o=parseInt(r.text(),10)||1,e=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),r.is(".old")?f===0?(f=11,e-=1):f-=1:r.is(".new")&&(f===11?(f=0,e+=1):f+=1),this._setDate(u(e,f,o)))}this.picker.is(":visible")&&this._focused_from&&n(this._focused_from).focus();delete this._focused_from},_toggle_multidate:function(n){var t=this.dates.contains(n);if(n?t!==-1?this.dates.remove(t):this.dates.push(n):this.dates.clear(),typeof this.o.multidate=="number")while(this.dates.length>this.o.multidate)this.dates.remove(0)},_setDate:function(n,t){t&&t!=="date"||this._toggle_multidate(n&&new Date(n));t&&t!=="view"||(this.viewDate=n&&new Date(n));this.fill();this.setValue();this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&i.change();this.o.autoclose&&(!t||t==="date")&&this.hide()},moveMonth:function(n,i){var e;if(!n)return t;if(!i)return n;var r=new Date(n.valueOf()),o=r.getUTCDate(),s=r.getUTCMonth(),h=Math.abs(i),u,f;if(i=i>0?1:-1,h===1)f=i===-1?function(){return r.getUTCMonth()===s}:function(){return r.getUTCMonth()!==u},u=s+i,r.setUTCMonth(u),(u<0||u>11)&&(u=(u+12)%12);else{for(e=0;e<h;e++)r=this.moveMonth(r,i);u=r.getUTCMonth();r.setUTCDate(o);f=function(){return u!==r.getUTCMonth()}}while(f())r.setUTCDate(--o),r.setUTCMonth(u);return r},moveYear:function(n,t){return this.moveMonth(n,t*12)},dateWithinRange:function(n){return n>=this.o.startDate&&n<=this.o.endDate},keydown:function(n){var o,t,i,u,r,f;if(this.picker.is(":not(:visible)")){n.keyCode===27&&this.show();return}o=!1;r=this.focusDate||this.viewDate;switch(n.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide();n.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;t=n.keyCode===37?-1:1;n.ctrlKey?(i=this.moveYear(this.dates.get(-1)||e(),t),u=this.moveYear(r,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.dates.get(-1)||e(),t),u=this.moveMonth(r,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||e()),i.setUTCDate(i.getUTCDate()+t),u=new Date(r),u.setUTCDate(r.getUTCDate()+t));this.dateWithinRange(i)&&(this.focusDate=this.viewDate=u,this.setValue(),this.fill(),n.preventDefault());break;case 38:case 40:if(!this.o.keyboardNavigation)break;t=n.keyCode===38?-1:1;n.ctrlKey?(i=this.moveYear(this.dates.get(-1)||e(),t),u=this.moveYear(r,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.dates.get(-1)||e(),t),u=this.moveMonth(r,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.dates.get(-1)||e()),i.setUTCDate(i.getUTCDate()+t*7),u=new Date(r),u.setUTCDate(r.getUTCDate()+t*7));this.dateWithinRange(i)&&(this.focusDate=this.viewDate=u,this.setValue(),this.fill(),n.preventDefault());break;case 13:r=this.focusDate||this.dates.get(-1)||this.viewDate;this._toggle_multidate(r);o=!0;this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.setValue();this.fill();this.picker.is(":visible")&&(n.preventDefault(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null;this.viewDate=this.dates.get(-1)||this.viewDate;this.fill();this.hide()}o&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change())},showMode:function(n){n&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+n)));this.picker.find(">div").hide().filter(".datepicker-"+i.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}};h=function(t,i){this.element=n(t);this.inputs=n.map(i.inputs,function(n){return n.jquery?n[0]:n}
56);delete i.inputs;n(this.inputs).datepicker(i).bind("changeDate",n.proxy(this.dateUpdated,this));this.pickers=n.map(this.inputs,function(t){return n(t).data("datepicker")});this.updateDates()};h.prototype={updateDates:function(){this.dates=n.map(this.pickers,function(n){return n.getUTCDate()});this.updateRanges()},updateRanges:function(){var t=n.map(this.dates,function(n){return n.valueOf()});n.each(this.pickers,function(n,i){i.setRange(t)})},dateUpdated:function(t){if(!this.updating){this.updating=!0;var u=n(t.target).data("datepicker"),r=u.getUTCDate(),i=n.inArray(t.target,this.inputs),f=this.inputs.length;if(i!==-1){if(n.each(this.pickers,function(n,t){t.getUTCDate()||t.setUTCDate(r)}),r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<f&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates();delete this.updating}}},remove:function(){n.map(this.pickers,function(n){n.remove()});delete this.element.data().datepicker}};a=n.fn.datepicker;n.fn.datepicker=function(i){var u=Array.apply(null,arguments),r;return u.shift(),this.each(function(){var s=n(this),e=s.data("datepicker"),l=typeof i=="object"&&i,v;if(!e){var a=y(this,"date"),w=n.extend({},o,a,l),b=p(w.language),c=n.extend({},o,b,a,l);s.is(".input-daterange")||c.inputs?(v={inputs:c.inputs||s.find("input").toArray()},s.data("datepicker",e=new h(this,n.extend(c,v)))):s.data("datepicker",e=new f(this,c))}if(typeof i=="string"&&typeof e[i]=="function"&&(r=e[i].apply(e,u),r!==t))return!1}),r!==t?r:this};o=n.fn.datepicker.defaults={autoclose:!1,beforeShowDay:n.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"mm/dd/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0};v=n.fn.datepicker.locale_opts=["format","rtl","weekStart"];n.fn.datepicker.Constructor=f;r=n.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],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"}};i={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,t){return[31,i.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][t]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(n){var t=n.replace(this.validParts,'\0').split('\0'),i=n.match(this.validParts);if(!t||!t.length||!i||i.length===0)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(e,o,s){function tt(){var n=this.slice(0,c[h].length),t=c[h].slice(0,n.length);return n===t}var nt,c,v,y,h,a,it,d,w;if(!e)return t;if(e instanceof Date)return e;if(typeof o=="string"&&(o=i.parseFormat(o)),nt=/([\-+]\d+)([dmwy])/,c=e.match(/([\-+]\d+)([dmwy])/g),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(e)){for(e=new Date,h=0;h<c.length;h++){v=nt.exec(c[h]);y=parseInt(v[1]);switch(v[2]){case"d":e.setUTCDate(e.getUTCDate()+y);break;case"m":e=f.prototype.moveMonth.call(f.prototype,e,y);break;case"w":e.setUTCDate(e.getUTCDate()+y*7);break;case"y":e=f.prototype.moveYear.call(f.prototype,e,y)}}return u(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),0,0,0)}c=e&&e.match(this.nonpunctuation)||[];e=new Date;var b={},g=["yyyy","yy","M","MM","m","mm","d","dd"],l={yyyy:function(n,t){return n.setUTCFullYear(t)},yy:function(n,t){return n.setUTCFullYear(2e3+t)},m:function(n,t){if(isNaN(n))return n;for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!==t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}},p,k;if(l.M=l.MM=l.mm=l.m,l.dd=l.d,e=u(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),a=o.parts.slice(),c.length!==a.length&&(a=n(a).filter(function(t,i){return n.inArray(i,g)!==-1}).toArray()),c.length===a.length){for(h=0,it=a.length;h<it;h++){if(p=parseInt(c[h],10),v=a[h],isNaN(p))switch(v){case"MM":k=n(r[s].months).filter(tt);p=n.inArray(k[0],r[s].months)+1;break;case"M":k=n(r[s].monthsShort).filter(tt);p=n.inArray(k[0],r[s].monthsShort)+1}b[v]=p}for(h=0;h<g.length;h++)w=g[h],w in b&&!isNaN(b[w])&&(d=new Date(e),l[w](d,b[w]),isNaN(d)||(e=d))}return e},formatDate:function(t,u,f){var e,s,o,h;if(!t)return"";for(typeof u=="string"&&(u=i.parseFormat(u)),e={d:t.getUTCDate(),D:r[f].daysShort[t.getUTCDay()],DD:r[f].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:r[f].monthsShort[t.getUTCMonth()],MM:r[f].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()},e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,t=[],s=n.extend([],u.separators),o=0,h=u.parts.length;o<=h;o++)s.length&&t.push(s.shift()),t.push(e[u.parts[o]]);return t.join("")},headTemplate:'<thead><tr><th class="prev">«<\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next">»<\/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>'};i.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+i.headTemplate+"<tbody><\/tbody>"+i.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+i.headTemplate+i.contTemplate+i.footTemplate+"<\/table><\/div><\/div>";n.fn.datepicker.DPGlobal=i;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=a,this};n(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var i=n(this);i.data("datepicker")||(t.preventDefault(),i.datepicker("show"))});n(function(){n('[data-provide="datepicker-inline"]').datepicker()})})(window.jQuery); 57(function(n){n.fn.datepicker.dates.en={days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
57ay","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",format:"mm/dd/yyyy",titleFormat:"MM yyyy",weekStart:0}})(jQuery); 58var Hashtable=function(){function e(t){var i;if(typeof t=="string")return t;if(typeof t.hashCode==n)return i=t.hashCode(),typeof i=="string"?i:e(i);if(typeof t.toString==n)return t.toString();try{return String(t)}catch(r){return Object.prototype.toString.call(t)}}function y(n,t){return n.equals(t)}function p(t,i){return typeof i.equals==n?i.equals(t):t===i}function o(n){return function(t){if(t===null)throw new Error("null is not a valid "+n);else if(typeof t=="undefined")throw new Error(n+" must not be undefined");}}function r(n,t,i,r){this[0]=n;this.entries=[];this.addEntry(t,i);r!==null&&(this.getEqualityFunction=function(){return r})}function u(n){return function(t){for(var r=this.entries.length,i,u=this.getEqualityFunction(t);r--;)if(i=this.entries[r],u(t,i[0]))switch(n){case h:return!0;case c:return i;case l:return[r,i[1]]}return!1}}function a(n){return function(t){for(var r=t.length,i=0,u=this.entries.length;i<u;++i)t[r+i]=this.entries[i][n]}}function w(n,t){for(var i=n.length,r;i--;)if(r=n[i],t===r[0])return i;return null}function i(n,t){var i=n[t];return i&&i instanceof r?i:null}function v(u,o){var l=this,h=[],c={},a=typeof u==n?u:e,p=typeof o==n?o:null,y;this.put=function(n,u){t(n);s(u);var o=a(n),f,e,l=null;return f=i(c,o),f?(e=f.getEntryForKey(n),e?(l=e[1],e[1]=u):f.addEntry(n,u)):(f=new r(o,n,u,p),h[h.length]=f,c[o]=f),l};this.get=function(n){var f,r,u;return(t(n),f=a(n),r=i(c,f),r&&(u=r.getEntryForKey(n),u))?u[1]:null};this.containsKey=function(n){t(n);var u=a(n),r=i(c,u);return r?r.containsKey(n):!1};this.containsValue=function(n){s(n);for(var t=h.length;t--;)if(h[t].containsValue(n))return!0;return!1};this.clear=function(){h.length=0;c={}};this.isEmpty=function(){return!h.length};y=function(n){return function(){for(var t=[],i=h.length;i--;)h[i][n](t);return t}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(n){t(n);var r=a(n),o,u=null,e=i(c,r);return e&&(u=e.removeEntryForKey(n),u!==null&&(e.entries.length||(o=w(h,r),f(h,o),delete c[r]))),u};this.size=function(){for(var n=0,t=h.length;t--;)n+=h[t].entries.length;return n};this.each=function(n){for(var i=l.entries(),r=i.length,t;r--;)t=i[r],n(t[0],t[1])};this.putAll=function(t,i){for(var e=t.entries(),f,r,u,o,s=e.length,h=typeof i==n;s--;)f=e[s],r=f[0],u=f[1],h&&(o=l.get(r))&&(u=i(r,o,u)),l.put(r,u)};this.clone=function(){var n=new v(u,o);return n.putAll(l),n}}var n="function",f=typeof Array.prototype.splice==n?function(n,t){n.splice(t,1)}:function(n,t){var r,i,u;if(t===n.length-1)n.length=t;else for(r=n.slice(t+1),n.length=t,i=0,u=r.length;i<u;++i)n[t+i]=r[i]},t=o("key"),s=o("value"),h=0,c=1,l=2;return r.prototype={getEqualityFunction:function(t){return typeof t.equals==n?y:p},getEntryForKey:u(c),getEntryAndIndexForKey:u(l),removeEntryForKey:function(n){var t=this.getEntryAndIndexForKey(n);return t?(f(this.entries,t[0]),t[1]):null},addEntry:function(n,t){this.entries[this.entries.length]=[n,t]},keys:a(0),values:a(1),getEntries:function(n){for(var i=n.length,t=0,r=this.entries.length;t<r;++t)n[i+t]=this.entries[t].slice(0)},containsKey:u(h),containsValue:function(n){for(var t=this.entries.length;t--;)if(n===this.entries[t][1])return!0;return!1}},v}(); 59(function(n){function f(n,t,i){this.dec=n;this.group=t;this.neg=i}function e(){for(var i,n=0;n<r.length;n++)for(localeGroup=r[n],i=0;i<localeGroup.length;i++)t.put(localeGroup[i],n)}function i(n,i){var o,r;t.size()==0&&e();var s=".",h=",";return i==!1&&(n.indexOf("_")!=-1?n=n.split("_")[1].toLowerCase():n.indexOf("-")!=-1&&(n=n.split("-")[1].toLowerCase())),o=t.get(n),o&&(r=u[o],r&&(s=r[0],h=r[1])),new f(s,h,"-")}var t=new Hashtable,u=[[".",","],[",","."],[","," "],[".","'"]],r=[["ae","au","ca","cn","eg","gb","hk","il","in","jp","sk","th","tw","us"],["at","br","de","dk","es","gr","it","nl","pt","tr","vn"],["cz","fi","fr","ru","se","pl"],["ch"]];n.fn.formatNumber=function(t,i,r){return this.each(function(){var f,u;return i==null&&(i=!0),r==null&&(r=!0),f=n(this).is(":input")?new String(n(this).val()):new String(n(this).text()),u=n.formatNumber(f,t),i&&(n(this).is(":input")?n(this).val(u):n(this).text(u)),r?u:void 0})};n.formatNumber=function(t,r){for(var f,c,r=n.extend({},n.fn.formatNumber.defaults,r),o=i(r.locale.toLowerCase(),r.isFullLocale),l=o.dec,a=o.group,v=o.neg,s="0#-,.",e="",h=!1,u=0;u<r.format.length;u++)if(s.indexOf(r.format.charAt(u))==-1)e=e+r.format.charAt(u);else if(u==0&&r.format.charAt(u)=="-"){h=!0;continue}else break;for(f="",u=r.format.length-1;u>=0;u--)if(s.indexOf(r.format.charAt(u))==-1)f=r.format.charAt(u)+f;else break;return r.format=r.format.substring(e.length),r.format=r.format.substring(0,r.format.length-f.length),c=new Number(t),n._formatNumber(c,r,f,e,h)};n._formatNumber=function(t,r,u,f,e){var r=n.extend({},n.fn.formatNumber.defaults,r),k=i(r.locale.toLowerCase(),r.isFullLocale),it=k.dec,rt=k.group,ut=k.neg,ft=!1,c,v,a,y,et,l,ot,p,s,h,d,g,w,o,nt,st,tt,b;if(isNaN(t))if(r.nanForceZero==!0)t=0,ft=!0;else return null;if(u=="%"&&(t=t*100),c="",r.format.indexOf(".")>-1){for(v=it,a=r.format.substring(r.format.lastIndexOf(".")+1),r.round==!0?t=new Number(t.toFixed(a.length)):(y=t.toString(),y=y.substring(0,y.lastIndexOf(".")+a.length+1),t=new Number(y)),et=t%1,l=new String(et.toFixed(a.length)),l=l.substring(l.lastIndexOf(".")+1),o=0;o<a.length;o++)if(a.charAt(o)=="#"&&l.charAt(o)!="0"){v+=l.charAt(o);continue}else if(a.charAt(o)=="#"&&l.charAt(o)=="0")if(ot=l.substring(o),ot.match("[1-9]")){v+=l.charAt(o);continue}else break;else a.charAt(o)=="0"&&(v+=l.charAt(o));c+=v}else t=Math.round(t);if(p=Math.floor(t),t<0&&(p=Math.ceil(t)),s="",s=r.format.indexOf(".")==-1?r.format:r.format.substring(0,r.format.indexOf(".")),h="",!(p==0&&s.substr(s.length-1)=="#")||ft){for(d=new String(Math.abs(p)),g=9999,s.lastIndexOf(",")!=-1&&(g=s.length-s.lastIndexOf(",")-1),w=0,o=d.length-1;o>-1;o--)h=d.charAt(o)+h,w++,w==g&&o!=0&&(h=rt+h,w=0);if(s.length>h.length&&(nt=s.indexOf("0"),nt!=-1))for(st=s.length-nt,tt=s.length-h.length-1;h.length<st;)b=s.charAt(tt),b==","&&(b=rt),h=b+h,tt--}return h||s.indexOf("0",s.length-1)===-1||(h="0"),c=h+c,t<0&&e&&f.length>0?f=ut+f:t<0&&(c=ut+c),r.decimalSeparatorAlwaysShown||c.lastIndexOf(it)==c.length-1&&(c=c.substring(0,c.length-1)),f+c+u};n.fn.parseNumber=function(t,i,r){var f,u;return i==null&&(i=!0),r==null&&(r=!0),f=n(this).is(":input")?new String(n(this).val()):new String(n(this).text()),u=n.parseNumber(f,t),u&&(i&&(n(this).is(":input")?n(this).val(u.toString()):n(this).text(u.toString())),r)?u:void 0};n.parseNumber=function(t,r){for(var r=n.extend({},n.fn.parseNumber.defaults,r),o=i(r.locale.toLowerCase(),r.isFullLocale),a=o.dec,c=o.group,v=o.neg,f,s,e,u,h,l;t.indexOf(c)>-1;)t=t.replace(c,"");for(t=t.replace(a,".").replace(v,"-"),f="",s=!1,(t.charAt(t.length-1)=="%"||r.isPercentage==!0)&&(s=!0),e=0;e<t.length;e++)"1234567890.-".indexOf(t.charAt(e))>-1&&(f=f+t.charAt(e));
59return u=new Number(f),s&&(u=u/100,h=f.indexOf("."),h!=-1?(l=f.length-h-1,u=u.toFixed(l+2)):u=u.toFixed(f.length-1)),u};n.fn.parseNumber.defaults={locale:"us",decimalSeparatorAlwaysShown:!1,isPercentage:!1,isFullLocale:!1};n.fn.formatNumber.defaults={format:"#,###.00",locale:"us",decimalSeparatorAlwaysShown:!1,nanForceZero:!0,round:!0,isFullLocale:!1};Number.prototype.toFixed=function(t){return n._roundNumber(this,t)};n._roundNumber=function(n,t){var u=Math.pow(10,t||0),r=String(Math.round(n*u)/u),i;if(t>0)for(i=r.indexOf("."),i==-1?(r+=".",i=0):i=r.length-(i+1);i<t;)r+="0",i++;return r}})(jQuery); 60var InrixWidget=function(){function l(n){var i,t,e,r,f,s;if(typeof Chart=="undefined"){$("#travel-chart").html('<div style="padding:20px;color:#c00;text-align:center;">Chart.js library not loaded. Please include Chart.js.<\/div>');return}if(i=document.getElementById("travel-chart"),i){i.tagName.toLowerCase()==="canvas"?t=i:(e=$(i),e.empty(),t=document.createElement("canvas"),t.style.width="100%",t.style.height="100%",i.appendChild(t));r=$("#travel").width()-10;r>50&&(t.width=r,t.height=r,$(t).css({width:r+"px",height:r+"px"}));u&&(u.destroy(),u=null);var h=n.length,c=["","5AM","","","8AM","","","11AM","","","2PM","","","5PM","","","8PM",""].slice(0,h),o=[];for(f=0;f<n.length;f++)o.push(n[f][1]);s=t.getContext("2d");u=new Chart(s,{type:"line",data:{labels:c,datasets:[{label:Utils.translate("Travel Time"),data:o,borderColor:"#083A81",borderWidth:2,pointBackgroun
60dColor:"#083A81",pointBorderColor:"#fff",pointBorderWidth:1,pointRadius:3,pointHoverRadius:5,tension:.2,fill:!1}]},options:{responsive:!1,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{displayColors:!1,callbacks:{label:function(n){return n.parsed.y+" "+Utils.translate("minutes")}}}},scales:{x:{grid:{color:"#e0e0e0",lineWidth:1},borderColor:"#000",ticks:{color:"#333",font:{size:11}}},y:{beginAtZero:!0,grid:{color:"#e0e0e0",lineWidth:1},borderColor:"#000",ticks:{color:"#000",precision:0,font:{size:11}},title:{display:!0,text:Utils.translate("Minutes"),color:"#000",font:{size:12},padding:{bottom:5}}}},elements:{line:{borderJoinStyle:"round"}}}})}}function f(n){var t=$(n).val();return t===$(n).attr("title")&&(t=""),t}function i(){return{address:f("#travel-work-address"),city:f("#travel-work-city"),state:f("#travel-work-state"),zip:f("#travel-work-zip")}}function a(r){var u=i(),e,f,c;for(t&&(n.workAddress=u),e=[],f=0;f<r.Entity.length;f++)e.push([f,r.Entity[f].TravelTimeMinutes]);$("#travel-chart-title b").text(u.address+", "+u.city+", "+u.state+" "+u.zip);$("#travel-form").hide();$(".travel-calculating").hide();$(".travel-submit").show();$(".travel-submit").removeClass("hide");$("#travel-results").show();$("#travel-results").removeClass("hide");l(e);var o="saddr=",s="&daddr=",h=u.address+", "+u.city+", "+u.state+" "+u.zip;$("#travel-work-to-home").is(":checked")?(o+=encodeURIComponent(h),s+=encodeURIComponent(n.listingAddress)):(o+=encodeURIComponent(n.listingAddress),s+=encodeURIComponent(h));c="http://maps.google.com/maps?"+o+s;$("#travel-view-route").attr("href",c)}function e(n){var t="<ul>",i;if(n&&n.length)for(i=0;i<n.length;i++)t+="<li>"+n[i].Value+"<\/li>";t==="<ul>"&&(t+="<li>"+Utils.translate("An error has been encountered submitting request. Please try again soon.")+"<\/li>");t+="<\/ul>";$("#travel-error-message").html(t).show().removeClass("hide");$(".travel-calculating").hide();$(".travel-submit").show();$(".travel-submit").removeClass("hide")}function r(){var r,u;$(".travel-submit").hide();$(".travel-calculating").show();$(".travel-calculating").removeClass("hide");r=i();n.disableForcedLogin&&(createCookie("travel-address",$.toJSON(r)),typeof WidgetLoginUtility.setInrixKeys!="undefined"&&WidgetLoginUtility.setInrixKeys());u={inrixVendorId:n.inrixVendorId,inrixConsumerId:n.inrixConsumerId,customerId:n.customerId,listingLat:n.listingLat,listingLon:n.listingLon,workAddress:r.address,workCity:r.city,workState:r.state,workZip:r.zip,saveWorkAddress:t,destination:o};$.ajax({type:"POST",url:Utils.AppPath+"/Include/AJAX/Api.aspx?op=GetTrafficTimes",data:{criteria:$.toJSON(u),validstamp:rbw.context.validStamp},cache:!1,dataType:"json",success:function(n){n.IsSuccess&&n.Entity&&n.Entity.length?a(n):e(n.ErrorMessages)},error:e})}function h(){var t=i(),r;n.franchiseLogin&&n.franchiseLogin.gotoBrokerLoginPage&&rbw.context.siteUrl&&rbw.context.siteUrl.indexOf("http")>-1?(r=n.franchiseLogin.referer?n.franchiseLogin.referer:"",location.href=rbw.context.siteUrl+"/account/customerlogin.aspx?referer="+encodeURIComponent(r)+"&driveTimeAddress="+encodeURIComponent($.toJSON(t))):(createCookie("travel-address",$.toJSON(t)),typeof WidgetLoginUtility.setInrixKeys=="function"&&WidgetLoginUtility.setInrixKeys(),typeof rbw.ui!="undefined"&&typeof rbw.ui.LoginSupport!="undefined"&&typeof rbw.ui.LoginSupport.loginForInrixDriveTime=="function"?rbw.ui.LoginSupport.loginForInrixDriveTime({
60samePage:!0}):($("#hiddenLink").colorbox({width:570,height:320,opacity:.7,close:"<span><\/span>",iframe:!0,scrollbars:!1,speed:0,transition:"none"}),$("#hiddenLink").attr("href",WidgetLoginUtility.getHref("login")),$("#hiddenLink").click()))}function c(){var u=i(),f=[],o;if(u.address.length===0&&f.push({Value:Utils.translate("Address is required.")}),u.city.length===0&&f.push({Value:Utils.translate("City is required.")}),u.state.length===0&&f.push({Value:Utils.translate("State is required.")}),u.zip.length===0&&f.push({Value:Utils.translate("Zip is required.")}),f.length>0){e(f);return}if(o=typeof n.disableForcedLogin!="undefined"&&n.disableForcedLogin!==null?n.disableForcedLogin:!1,n.customerId==="0"&&!o){h();return}n.workAddress.address===""&&n.workAddress.city===""&&n.workAddress.state===""&&n.workAddress.zip===""?(t=!0,r()):n.workAddress.address!==u.address||n.workAddress.city!==u.city||n.workAddress.state!==u.state||n.workAddress.zip!==u.zip?($("#travel-alert-save-msg").text(Utils.translate("Save this work address")),$("#travel-alert-save-msg2").text("("+Utils.translate("This will replace your previously saved work address")+")"),$("#travel-alert-save").show(),$("#travel-alert-save").removeClass("hide")):r()}var t=!1,o="work",s=!1,u=null,n={chartOptions:{series:{color:"#083A81"},grid:{hoverable:!0,backgroundColor:"#fff",borderWidth:1},xaxis:{ticks:[[0,""],[1,"5AM"],[2,""],[3,""],[4,"8AM"],[5,""],[6,""],[7,"11AM"],[8,""],[9,""],[10,"2PM"],[11,""],[12,""],[13,"5PM"],[14,""],[15,""],[16,"8PM"],[17,""]],tickLength:5},yaxis:{ticks:7,tickDecimals:0,position:"left",axisLabel:Utils.translate("Minutes"),axisLabelPadding:1,color:"#000"},tooltip:!0,tooltipOpts:{content:"%y "+Utils.translate("minutes")}}};return{init:function(u){var e,f,l;n=$.extend({},n,u);s=typeof n.disableForcedLogin!="undefined"&&n.disableForcedLogin!==null?n.disableForcedLogin:!1;$("#travel-button").on("click",c);$("#travel-alert-save-yes").on("click",function(){t=!0;$("#travel-alert-save").hide();r()});$("#travel-alert-save-no").on("click",function(){t=!1;$("#travel-alert-save").hide();r()});$("input[name='travel-direction']").on("change",function(){o=$("#travel-home-to-work").is(":checked")?"work":"home";r()});$("#travel-back-to-form").on("click",function(){$("#travel-results").hide();$("#travel-form").show();$("#travel-form").removeClass("hide")});$("#travel-overlay-register").on("click",function(){$.colorbox.close();h()});$("#travel a").css("cursor","pointer");e=readCookie("travel-address");e&&e.length>0&&(eraseCookie("travel-address"),f=$.evalJSON(e),$("#travel-work-address").val(f.address),$("#travel-work-city").val(f.city),$("#travel-work-state").val(f.state),$("#travel-work-zip").val(f.zip));n.customerId!=="0"&&$("#travel-sample").hide();l=i();l.city.length>0&&(n.customerId!=="0"||s)&&c()}}}(); 61var ContactMe=function(){return{submitRequestInfoForm:function(n,t,i){$.ajax({type:"POST",url:rbw.context.siteUrl+"/Include/AJAX/ContactMe.aspx?op=SendContactMe",crossDomain:!0,data:{formValues:$.toJSON(n)},cache:!1,dataType:"json",success:function(n){n.IsSuccess?t():i(n.Messages)},error:i})}}}(); 62function NearbySalesCarousel(){function r(r){var u,f,e;for($("."+n+"-listing").hide(),t+=r,f=t*3,e=Math.min(t*3+3,i.length),u=f;u<e;u++)$("#listing"+i[u]).show();t===0&&($("#"+n+"-prev").hide(),$("#"+n+"-seeall").hide(),$("#"+n+"-spacer").hide(),i.length>3?$("#"+n+"-next").show():$("#"+n+"-next").hide());t===1&&($("#"+n+"-prev").show(),$("#"+n+"-seeall").hide(),i.length>6?($("#"+n+"-spacer").show(),$("#"+n+"-next").show()):($("#"+n+"-spacer").hide(),$("#"+n+"-next").hide()));t===2&&($("#"+n+"-prev").show(),$("#"+n+"-next").hide(),i.length>=9?($("#"+n+"-spacer").show(),$("#"+n+"-seeall").show()):$("#"+n+"-spacer").show())}var t=0,n="",i=[];this.pushListing=function(n){i.push(n)};this.init=function(u){n=u.displayMode;t=0;$("#"+n+"-prev").on("click",function(){r(-1)});$("#"+n+"-next").on("click",function(){r(1)});$("#"+n+"-seeall").on("click",function(){var t=Utils.AppPath+"/listing/processradiussearch.aspx?mode="+n+"&lat="+u.latitude+"&lon="+u.longitude+"&distance=2.0";window.open(t,"_blank")});$("#"+n+"-save").on("click",function(){SaveSearchUtility.launchOverlay(u.listingId,n)});
62$("#"+n+"-next").css("cursor","pointer");$("#"+n+"-prev").css("cursor","pointer");$("#"+n+"-seeall").css("cursor","pointer");i.length===0?$("#"+n+"-container").hide():r(0)}}; 63var listingNote=function(n){"use strict";function t(t){var r=t.css("font-size"),i=t.css("line-height"),u=t.height();if(r=r.replace("px",""),i=i==="normal"?r*1.25:i.replace("px",""),u>i*1.5){t.css({height:i,overflow:"hidden"});t.find(".note").first().css({"max-width":"90%"});t.find(".note").first().after('<a hef="#" class="note-more-link" style="vertical-align:top;">more...<\/a>');t.find(".note").last().append('<a hef="#" class="note-less-link" style="display:none;">less...<\/a>');t.find(".note-more-link").on("click",function(){t.css({height:"auto"});n(this).hide();t.find(".note-less-link").show()});t.find(".note-less-link").on("click",function(){t.css({height:i});n(this).hide();t.find(".note-more-link").show()})}}function i(n,t){var i,r,f,u;for(n.empty(),i=0;i<t.length;i+=1)r=new Date(t[i].CreatedDtm),f=r.getMonth()+1+"/"+r.getDate()+"/"+r.getFullYear(),u=i===0?"<div class='note first-note'>":"<div class='note'>",u+=" <strong>"+t[i].FirstName+" said on "+f+":<\/strong> "+t[i].Note,u+="<\/div>",n.append(u)}function r(r,u,f,e,o,s){(rbw.context.isLoggedIn()||rbw.utils.isAdminSite())&&n.ajax({type:"GET",url:rbw.serviceUrl,data:"op=GetListingNotes&recoId="+u+"&listingId="+f+"&customerId="+e+"&personId="+o+"&listingNumber="+s,dataType:"json",contentType:"application/json; charset=utf-8",success:function(n){i(r,n);t(r)}})}function u(){n(function(){n(".listing-notes").each(function(){var t=n(this);r(t,t.attr("data-recoid"),t.attr("data-listingid"),t.attr("data-customerid"),t.attr("data-personid"),t.attr("data-listing-number"))})})}return{showNotes:u}}(jQuery); 64var InrixDriveTimeUtility=new function(){function n(){$("#criteria-toggle-filters").trigger("click")}this.refreshParent=!0;this.launchSearchcriteriaBox=n;this.launchSearchFilters=function(){if($("#hiddenLink").length===0&&($("body").append("<a id='hiddenLink' class='iframe'><\/a>"),console.log($("#hiddenLink").length)),$("#hiddenLink").colorbox({width:570,height:320,opacity:.7,close:"<span><\/span>",iframe:!0,scrollbars:!1,speed:0,transition:"none"}),rbw.context.isLoggedIn()||rbw.utils.isAdminSite())$(document).one("maploaded",n);else if(WidgetLoginUtility.setInrixKeys("launchSearchcriteriaBox"),typeof rbw.ui!="undefined"&&typeof rbw.ui.LoginSupport!="undefined"&&typeof rbw.ui.LoginSupport.loginForInrixDriveTime=="function")rbw.ui.LoginSupport.loginForInrixDriveTime();else{var t=WidgetLoginUtility.getHref("login");rbw.context.recoId===1198?window.location.href=t:($("#hiddenLink").attr("href",t),$("#hiddenLink").click())}}};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.