chevereto-free/lib/Peafowl/peafowl.min.js

6 lines
156 KiB
JavaScript

function sprintf(){var t=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,e=arguments,i=0,o=e[i++],n=function(t,e,i,o){i||(i=" ");var n=t.length>=e?"":new Array(1+e-t.length>>>0).join(i);return o?t+n:n+t},r=function(t,e,i,o,r,a){var s=o-t.length;return s>0&&(t=i||!r?n(t,o,a,i):t.slice(0,e.length)+n("",s,"0",!0)+t.slice(e.length)),t},a=function(t,e,i,o,a,s,l){var c=t>>>0;return i=i&&c&&{2:"0b",8:"0",16:"0x"}[e]||"",t=i+n(c.toString(e),s||0,"0",!1),r(t,i,o,a,l)},s=function(t,e,i,o,n,a){return null!=o&&(t=t.slice(0,o)),r(t,"",e,i,n,a)},l=function(t,o,l,c,u,d,h){var f,p,g,m,b;if("%%"===t)return"%";for(var v=!1,y="",w=!1,P=!1,$=" ",F=l.length,x=0;l&&x<F;x++)switch(l.charAt(x)){case" ":y=" ";break;case"+":y="+";break;case"-":v=!0;break;case"'":$=l.charAt(x+1);break;case"0":w=!0,$="0";break;case"#":P=!0}if(c=c?"*"===c?+e[i++]:"*"==c.charAt(0)?+e[c.slice(1,-1)]:+c:0,c<0&&(c=-c,v=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"===d?+e[i++]:"*"==d.charAt(0)?+e[d.slice(1,-1)]:+d:"fFeE".indexOf(h)>-1?6:"d"===h?0:void 0,b=o?e[o.slice(0,-1)]:e[i++],h){case"s":return s(String(b),v,c,d,w,$);case"c":return s(String.fromCharCode(+b),v,c,d,w);case"b":return a(b,2,P,v,c,d,w);case"o":return a(b,8,P,v,c,d,w);case"x":return a(b,16,P,v,c,d,w);case"X":return a(b,16,P,v,c,d,w).toUpperCase();case"u":return a(b,10,P,v,c,d,w);case"i":case"d":return f=+b||0,f=Math.round(f-f%1),p=f<0?"-":y,b=p+n(String(Math.abs(f)),d,"0",!1),r(b,p,v,c,w);case"e":case"E":case"f":case"F":case"g":case"G":return f=+b,p=f<0?"-":y,g=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],b=p+Math.abs(f)[g](d),r(b,p,v,c,w)[m]();default:return t}};return o.replace(t,l)}function testPassword(t){var e=0,i="weak",o="",n=0;return t.length<5?(e+=3,o=o+"3 points for length ("+t.length+")\n"):t.length>4&&t.length<8?(e+=6,o=o+"6 points for length ("+t.length+")\n"):t.length>7&&t.length<16?(e+=12,o=o+"12 points for length ("+t.length+")\n"):t.length>15&&(e+=18,o=o+"18 point for length ("+t.length+")\n"),t.match(/[a-z]/)&&(e+=1,o+="1 point for at least one lower case char\n"),t.match(/[A-Z]/)&&(e+=5,o+="5 points for at least one upper case char\n"),t.match(/\d+/)&&(e+=5,o+="5 points for at least one number\n"),t.match(/(.*[0-9].*[0-9].*[0-9])/)&&(e+=5,o+="5 points for at least three numbers\n"),t.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)&&(e+=5,o+="5 points for at least one special char\n"),t.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)&&(e+=5,o+="5 points for at least two special chars\n"),t.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(e+=2,o+="2 combo points for upper and lower letters\n"),t.match(/([a-zA-Z])/)&&t.match(/([0-9])/)&&(e+=2,o+="2 combo points for letters and numbers\n"),t.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)&&(e+=2,o+="2 combo points for letters, numbers and special chars\n"),0==t.length&&(e=0),i=e<16?"very weak":e>15&&e<25?"weak":e>24&&e<35?"average":e>34&&e<45?"strong":"stronger",n=Math.round(Math.min(100,100*e/45))/100,{score:e,ratio:n,percent:100*n+"%",verdict:i,log:o}}$(function(){var t={url:PF.obj.config.json_api,cache:!1,dataType:"json",data:{auth_token:PF.obj.config.auth_token}};void 0!==PF.obj.config.session_id&&(t.data.session_id=PF.obj.config.session_id),$.ajaxSetup(t),$(window).bind("beforeunload",function(){if("continue"!=$("form",PF.obj.modal.selectors.root).data("beforeunload"))return $(PF.obj.modal.selectors.root).is(":visible")&&PF.fn.form_modal_has_changed()?PF.fn._s("All the changes that you have made will be lost if you continue."):void 0}),$(window).bind("hashchange",function(){"#edit"!=window.location.hash||$(PF.obj.modal.selectors.root).exists()||$("[data-modal=edit]").first().click()}),PF.fn.bindtipTip();var e,i,o=$(window).width();if($(window).on("resize",function(){PF.fn.growl.fixPosition(),PF.fn.modal.fixScrollbars();var t=PF.fn.getDeviceName(),n=["phone","phablet"],r=["tablet","laptop","desktop"];clearTimeout(e),clearTimeout(i),i=setTimeout(function(){$(".follow-scroll-wrapper, .follow-scroll-placeholder").removeClass("position-fixed").attr("style",""),$("html").hasScrollBar().vertical&&(PF.obj.follow_scroll.set(!0),PF.obj.follow_scroll.process(!0))},25);var a=PF.fn.getDeviceName();if((a!==t&&$.inArray(t,n)>=0&&-1==$.inArray(a,n)||$.inArray(t,r)>=0&&-1==$.inArray(a,r))&&PF.fn.close_pops(),$(".top-bar").css("top",""),$(PF.fn.topMenu.vars.menu).css("height",$(window).height()),$("body").css({position:"",height:""}),$(".antiscroll").removeClass("jsly").data("antiscroll",""),$(".antiscroll-inner").css({height:"",width:"",maxheight:""}),PF.fn.list_fluid_width(),o!==$(window).width()){$("[data-action=top-bar-menu-full]","#top-bar").hasClass("current")&&PF.fn.topMenu.hide(0);var s=function(){PF.fn.listing.columnizer(!0,0),$(PF.obj.listing.selectors.list_item).show()};s()}o=$(window).width()}),$(document).on("click","html",function(){PF.fn.close_pops()}),$("html").hasClass("no-svg")&&$("img.replace-svg").replace_svg(),$(document).on("keydown",".numeric-input",function(t){t.keydown_numeric()}),$(document).on("click","[data-scrollto]",function(t){var e=$(this).data("scrollto"),i=$(e.match(/^\#|\./)?e:"#"+e);i.exists()?PF.fn.scroll(i):console.log("PF scrollto error: target doesn't exists",i)}),$(document).on("click focus","[data-login-needed], [data-user-logged=must]",function(t){if(!PF.fn.is_user_logged())return t.preventDefault(),t.stopPropagation(),window.location.href=PF.obj.vars.urls.login,!1}),$(document).on("click","[data-trigger]",function(t){if(t.isPropagationStopped())return!1;var e=$(this).data("trigger"),i=$(e.match(/^\#|\./)?e:"#"+e);i.exists()?(t.stopPropagation(),t.preventDefault(),i.closest(PF.obj.modal.selectors.root).length||PF.fn.modal.close(),i.click()):console.log("PF trigger error: target doesn't exists",i)}),$("form[method=post]").each(function(){$("input[name=auth_token]",this).exists()||$(this).append($("<input>",{type:"hidden",name:"auth_token",value:PF.obj.config.auth_token}))}),$(document).on("click",".clear-form",function(){$(this).closest("form")[0].reset()}),$(document).on("submit","form[data-action=validate]",function(t){$(this).data("type");var e=!1,i=$(this).find("[required], [data-validate]");if(i.each(function(){var t=$(this).attr("type"),i=$(this).attr("pattern"),o=function(t){$(t).highlight(),e=!0};if($(this).is("[required]")&&""==$(this).val()){if($(this).is(":hidden")){var n=$($($(this).data("highlight")).exists()?$(this).data("highlight"):"#"+$(this).data("highlight"));$(n).highlight()}o(this)}if(void 0===i&&0==/mail|url/.test(t))return!0;i&&(i=new RegExp(i),i.test($(this).val())||o(this)),"email"!=t||$(this).val().isEmail()||o(this)}),e)return PF.fn.growl.expirable(PF.fn._s("Check the errors in the form to continue.")),!1}),$(document).on("change","select[data-combo]",function(){var t=$("#"+$(this).data("combo"));t.exists()&&t.children(".switch-combo").hide();var e=$("#"+$(this).closest("select").data("combo")),i=$("[data-combo-value~="+$("option:selected",this).attr("value")+"]",e);i.exists()&&i.show().find("[data-required]").each(function(){$(this).attr("required","required")}),$(".switch-combo",e).each(function(){$(this).is(":visible")||$("[required]",this).attr("data-required",!0).removeAttr("required")})}),$(document).on("keyup",function(t){$this=$(t.target),27==t.keyCode&&$(PF.obj.modal.selectors.root).is(":visible")&&!$this.is(":input")&&$("[data-action=cancel],[data-action=close-modal]",PF.obj.modal.selectors.root).first().click()}),$(document).on("change",":input",function(t){PF.fn.growl.close()}),$(document).on("keyup",":input",function(t){$(".input-warning",$(this).closest(".input-label")).html("")}),$(document).on("blur",":input",function(){var t=$.trim($(this).prop("value"));$(this).prop("value",t)}),$(document).on("click",":input[data-focus=select-all]",function(){this.select()}),$(document).on("keyup change blur",":input[type=password]",function(){var t=testPassword($(this).val()),e=$(this).closest("div");""==$(this).val()&&(t.percent=0,t.verdict=""),$("[data-content=password-meter-bar]",e).attr("data-veredict",t.verdict.replace(/ /g,"-")).width(t.percent),$("[data-text=password-meter-message]",e).removeClass("red-warning").text(""!==t.verdict?PF.fn._s(t.verdict):"")}),$(document).on("click","[rel=popup-link], .popup-link",function(t){t.preventDefault();var e=$(this)[void 0!==$(this).attr("href")?"attr":"data"]("href");if(void 0!==e)return"mailto"==e.substring(0,6)&&PF.fn.isDevice(["phone","phablet"])?(window.location=e,!1):void PF.fn.popup({href:e})}),$(window).scroll(function(){PF.obj.follow_scroll.process()}),$(document).on("click","[data-modal=simple],[data-modal=html]",function(){var t=$("[data-modal="+$(this).data("target")+"], #"+$(this).data("target")).first();PF.fn.modal.call({template:t.html(),buttons:!1})}),$(document).on("submit",PF.obj.modal.selectors.root+" form",function(t){return!$(this).data("prevented")&&(void 0!==$(this).attr("method")&&void 0)}),$(document).on("click","[data-modal=edit],[data-modal=form],[data-confirm]",function(t){t.preventDefault();var e,i=$(this);i.is("[data-confirm]")?(e=i,PF.obj.modal.type="confirm"):(e=$("[data-modal="+i.data("target")+"], #"+i.data("target")).first(),0==e.length&&(e=$("[data-modal=form-modal], #form-modal").first()),0==e.length&&console.log("PF Error: Modal target doesn't exists."),PF.obj.modal.type=i.data("modal"));var o=i.data("args"),n=window[e.data("submit-fn")],r=window[e.data("cancel-fn")],a=(window[e.data("load-fn")],e.data("submit-done")),s={url:e.data("ajax-url")||(void 0!==e.data("is-xhr")?PF.obj.config.json_api:null),deferred:window[e.data("ajax-deferred")]};if("function"!=typeof n&&e.data("submit-fn")){var l=e.data("submit-fn").split(".");n=window;for(var c=0;c<l.length;c++)n=n[l[c]]}if("function"!=typeof r&&e.data("cancel-fn")){var u=e.data("cancel-fn").split(".");r=window;for(c=0;c<u.length;c++)r=r[u[c]]}if("function"!=typeof load_function&&e.data("load-fn")){var d=e.data("load-fn").split(".");load_function=window;for(c=0;c<d.length;c++)load_function=load_function[d[c]]}if("object"!=typeof s.deferred&&e.data("ajax-deferred")){var h=e.data("ajax-deferred").split(".");s.deferred=window;for(c=0;c<h.length;c++)s.deferred=s.deferred[h[c]]}var f=window[e.data("before-fn")];if("function"!=typeof f&&e.data("before-fn")){var p=e.data("before-fn").split(".");f=window;for(c=0;c<p.length;c++)f=f[p[c]]}"function"==typeof f&&f(t);var g=$(this).data("options")||{};if(i.is("[data-confirm]")){var m={message:i.data("confirm"),confirm:"function"==typeof n?n(o):"",cancel:"function"==typeof r?r(o):"",ajax:s};i.attr("href")&&""==m.confirm&&(m.confirm=function(){return window.location.replace(i.attr("href"))}),PF.fn.modal.confirm($.extend(m,g))}else{m={template:e.html(),button_submit:$(this).is("[data-modal=edit]")?PF.fn._s("Save changes"):PF.fn._s("Submit"),confirm:function(){var t=PF.fn.form_modal_has_changed(),r=$("form",PF.obj.modal.selectors.root);if(void 0!==r.attr("action"))return r.data("prevented",!t),void PF.fn.modal.close();if($(":input[name]",r).each(function(){if($(this).is(":visible"))"required"==$(this).attr("data-required")&&$(this).prop("required",!0);else{var t=$(this).attr("required");void 0!==t&&!1!==t&&$(this).prop("required",!1).attr("data-required","required")}}),!r[0].checkValidity())return!1;if(t||g.forced){if("function"==typeof n&&(submit_fn=n(o)),"undefined"!=typeof submit_fn&&0==submit_fn)return!1;if($(":input",PF.obj.modal.selectors.root).each(function(){$(this).val($.trim($(this).val()))}),i.is("[data-modal=edit]")&&e.html($(PF.obj.modal.selectors.body,$(PF.obj.modal.selectors.root).bindFormData()).html().replace(/rel=[\'"]tooltip[\'"]/g,'rel="template-tooltip"')),void 0!==s.url)return!0;PF.fn.modal.close(function(){void 0!==a&&PF.fn.growl.expirable(""!==a?a:PF.fn._s("Changes saved successfully."))})}else PF.fn.modal.close()},cancel:function(){if("function"==typeof cancel_fn&&(cancel_fn=cancel_fn()),"undefined"!=typeof cancel_fn&&0==cancel_fn)return!1;if("skip"!=e.data("prompt")&&PF.fn.form_modal_has_changed()){if($(PF.obj.modal.selectors.changes_confirm).exists())return;$(PF.obj.modal.selectors.box,PF.obj.modal.selectors.root).css({transition:"none"}).hide(),$(PF.obj.modal.selectors.root).append('<div id="'+PF.obj.modal.selectors.changes_confirm.replace("#","")+'"><div class="content-width"><h2>'+PF.fn._s("All the changes that you have made will be lost if you continue.")+'</h2><div class="'+PF.obj.modal.selectors.btn_container.replace(".","")+' margin-bottom-0"><button class="btn btn-input default" data-action="cancel">'+PF.fn._s("Go back to form")+'</button> <span class="btn-alt">'+PF.fn._s("or")+' <a data-action="submit">'+PF.fn._s("continue anyway")+"</a></span></div></div>"),$(PF.obj.modal.selectors.changes_confirm).css("margin-top",-$(PF.obj.modal.selectors.changes_confirm).outerHeight(!0)/2).hide().fadeIn("fast")}else PF.fn.modal.close(),"#edit"==window.location.hash&&(window.location.hash="")},load:function(){"function"==typeof load_function&&load_function()},callback:function(){},ajax:s};PF.fn.modal.call($.extend(m,g))}}),PF.fn.is_user_logged()||$("[data-login-needed]:input, [data-user-logged=must]:input").each(function(){$(this).attr("readonly",!0)}),$(document).on("keydown",PF.obj.modal.selectors.root+" input",function(t){var e=$(t.target),i=t.charCode||t.keyCode;13===i?13==i&&$("[data-action=submit]",PF.obj.modal.selectors.root).exists()&&!e.is(".prevent-submit")&&$("[data-action=submit]",PF.obj.modal.selectors.root).click():PF.fn.growl.close()}),window.location.hash&&"#edit"==window.location.hash&&$("[data-modal=edit]").first().click(),$(document).on("click","[data-action=top-bar-menu-full]",function(){var t=$("[data-action=top-bar-menu-full]","#top-bar").hasClass("current");PF.fn.topMenu[t?"hide":"show"]()}),$(document).on("click","[data-action=top-bar-search]",function(){$("[data-action=top-bar-search-input]",".top-bar").removeClass("hidden").show(),$("[data-action=top-bar-search-input]:visible input").first().focus(),is_ios()&&!$(this).closest(PF.fn.topMenu.vars.menu).exists()&&$(".top-bar").css("position","absolute"),$("[data-action=top-bar-search]",".top-bar").hide()}),$(document).on("click",".input-search .icon-search",function(t){$("input",t.currentTarget.offsetParent).focus()}),$(document).on("click",".input-search .icon-close, .input-search [data-action=clear-search]",function(t){var e=$("input",t.currentTarget.offsetParent);""==e.val()?$(this).closest("[data-action=top-bar-search-input]").exists()&&($("[data-action=top-bar-search-input]",".top-bar").hide(),$("[data-action=top-bar-search]",".top-bar").removeClass("opened").show(),is_ios()&&"fixed"!==$(this).closest("#top-bar").css("position")&&$(".top-bar").css("position","fixed")):($(this).closest("[data-action=top-bar-search-input]").exists()||$(this).hide(),e.val("").change())}),$(document).on("keyup change","input.search",function(t){var e=$(this),i=$(this).closest(".input-search");if(!$(this).closest("[data-action=top-bar-search-input]").exists()){var o=""==e.val()?"hide":"show";$(".icon-close, [data-action=clear-search]",i)[o]()}}),$(document).on("click mouseenter",".pop-btn",function(t){if(!PF.fn.isDevice(["phone","phablet"])||"mouseenter"!=t.type&&!$(this).hasClass("pop-btn-desktop")){var e,i,o=$(t.target),n=$.makeArray(["phone","phablet"]),r=$(this);if(("mouseenter"!=t.type||$(this).hasClass("pop-btn-auto"))&&!$(this).hasClass("disabled")&&(!o.closest(".current").exists()||PF.fn.isDevice("phone")||o.closest(".pop-btn-show").exists())){if(PF.fn.growl.close(),t.stopPropagation(),e=$(this),i=$(".pop-box",e),e.addClass("opened"),$(".pop-box-inner",i).css("max-height",""),PF.fn.isDevice(n)){var a=$(".btn-text,.text,.pop-btn-text",e).first().text();void 0!==a&&""!=a||(a=PF.fn._s("Select")),$(".pop-box-header",i).exists()||i.prepend($("<div/>",{class:"pop-box-header",html:a+'<span class="btn-icon icon-close"></span></span>'}))}else $(".pop-box-header",i).remove(),i.css({bottom:""});if(i.hasClass("anchor-center")&&void 0===i.data("guidstr")&&(PF.fn.isDevice(n)?i.css("margin-left",""):i.css("margin-left",-i.width()/2)),o.is("[data-change]")&&($("li",i).removeClass("current"),o.closest("li").addClass("current"),$("[data-text-change]",e).text($("li.current a",i).text()),t.preventDefault()),i.exists()){r=t.istriggered?$(t.target):$(this);if(!(i.is(":visible")&&$(t.target).closest(".pop-box-inner").exists()&&r.hasClass("pop-keep-click"))){$(".pop-box:visible").not(i).hide().closest(".pop-btn").removeClass("opened");var s=function(t){if(t.is(":visible"))if(PF.fn.isDevice(n))$(".antiscroll-inner",t).height("100%");else{var e=t.css("marginLeft");void 0!==e&&(e=parseFloat(e),t.css("marginLeft",""));var i=t.getWindowCutoff();if(i&&(i.left||i.right)&&i.right<e){s="guid-"+PF.fn.guid();t.css("marginLeft",i.right+"px").addClass(s).attr("data-guidstr",s);var o=r.outerWidth()/2+r.offset().left-t.offset().left,a=[];$.each(["top","bottom"],function(t,e){$.each(["after","before"],function(t,i){a.push("."+s+".arrow-box-"+e+":"+i)})}),$('<style id="'+s+'">'+a.join()+" { left: "+o+"px; }</style>").appendTo("head")}else t.css("marginLeft",e+"px");$(".antiscroll-wrap:not(.jsly):visible",t).addClass("jsly").antiscroll()}else{var s=t.attr("data-guidstr");t.css("marginLeft","").removeClass(s).removeAttr("data-guidstr").closest(".pop-btn").removeClass("opened"),void 0!==s&&$("style#"+s).remove()}};if(PF.fn.isDevice(n)){$(this).is("[data-action=top-bar-notifications]")&&i.css({height:$(window).height()});var l=i.height()+"px",c=parseInt($(".top-bar").outerHeight())+parseInt($(".top-bar").css("top"))+parseInt($(".top-bar").css("margin-top"))+parseInt($(".top-bar").css("margin-bottom"))+"px";i.is(":visible")?($("#pop-box-mask").css({opacity:0}),i.css({transform:"none"}),r.closest(PF.fn.topMenu.vars.menu).exists()&&($(".top-bar").css({transform:"none"}),$(PF.fn.topMenu.vars.menu).css({height:$(window).height()+parseInt(c)})),setTimeout(function(){i.hide().attr("style",""),$("#pop-box-mask").remove(),s(i),r.closest(PF.fn.topMenu.vars.menu).exists()&&($(PF.fn.topMenu.vars.menu).css({height:""}),$(PF.fn.topMenu.vars.menu).animate({scrollTop:PF.fn.topMenu.vars.scrollTop},PF.obj.config.animation.normal/2))},PF.obj.config.animation.normal),$("body").data("hasOverflowHidden")||$("body").removeClass("overflow-hidden")):($("#pop-box-mask").remove(),i.parent().prepend($("<div/>",{id:"pop-box-mask",class:"fullscreen soft-black"}).css({zIndex:400,display:"block"})),PF.fn.topMenu.vars.scrollTop=$(PF.fn.topMenu.vars.menu).scrollTop(),setTimeout(function(){$("#pop-box-mask").css({opacity:1}),setTimeout(function(){i.show().css({bottom:"-"+l,maxHeight:$(window).height(),zIndex:1e3,transform:"translate(0,0)"}),setTimeout(function(){i.css({transform:"translate(0,-"+l+")"})},1),setTimeout(function(){s(i)},PF.obj.config.animation.normal),$("body").hasClass("overflow-hidden")?$("body").data("hasOverflowHidden",1):$("body").addClass("overflow-hidden"),r.closest(PF.fn.topMenu.vars.menu).exists()&&($(".top-bar").css({transform:"translate(0, -"+c+")"}),$(PF.fn.topMenu.vars.menu).css({height:$(window).height()+parseInt(c)})),$(".pop-box-inner",i).css("height",i.height()-$(".pop-box-header",i).outerHeight(!0))},1)},1))}else i[i.is(":visible")?"hide":"show"](0,function(){s(i)})}}}}}).on("mouseleave",".pop-btn",function(){if(PF.fn.isDevice(["laptop","desktop"])){var t=$(this),e=$(".pop-box",t);!t.hasClass("pop-btn-auto")||PF.fn.isDevice(["phone","phablet"])&&t.hasClass("pop-btn-auto")||(!PF.fn.isDevice(["phone","phablet","tablet"])&&$(this).hasClass("pop-btn-delayed")&&$(this).removeClass("pop-btn-auto"),e.hide().closest(".pop-btn").removeClass("opened"))}}),$(".pop-btn-delayed").delayedAction({delayedAction:function(t){if(!PF.fn.isDevice(["phone","phablet","tablet"])){var e=$(".pop-box-inner",t);e.is(":hidden")&&t.addClass("pop-btn-auto").click()}},hoverTime:2e3}),window.location.hash,$(".content-tabs").exists()){var n=$("a",".content-tabs .current");History.replaceState({href:n.attr("href"),"data-tab":n.data("tab"),pushed:"tabs",statenum:0},null,null)}var r=History.getState();void 0===r.data&&History.replaceState({scrollTop:0},document.title,window.location.href),History.Adapter.bind(window,"popstate",function(){var t=History.getState();t.data&&void 0!==t.data.scrollTop&&$(window).scrollTop()!==t.data.scrollTop&&$(window).scrollTop(t.data.scrollTop)}),$("a",".content-tabs").click(function(t){if(1==$(this).data("link")&&$(this).data("tab",!1),$(this).closest(".current,.disabled").exists())t.preventDefault();else if(void 0!==$(this).data("tab")){var e={};if($.each(this.attributes,function(){e[this.name]=this.value}),e.pushed="tabs","classic"!=$("#"+e["data-tab"]).data("load")){if(window.location.hash){var i=window.location.href;i=i.replace(window.location.hash,"")}History.pushState(e,document.title,void 0!==i?i:$(this).attr("href")),t.preventDefault()}var o=$("[data-action=tab-menu]",$(this).closest(".header"));o.find("[data-content=current-tab-label]").text($(this).text()),o.is(":visible")&&o.click()}}),$(document).on("click","[data-action=tab-menu]",function(){var t=$(this).closest(".header").find(".content-tabs"),e=t.is(":visible"),i=$(this);e||(t.data("classes",t.attr("class")),t.removeClass(function(t,e){return(e.match(/\b\w+-hide/g)||[]).join(" ")}),t.hide()),e||i.removeClass("current"),t[e?"hide":"show"](),e&&(t.css("display","").addClass(t.data("classes")),i.addClass("current"))}),$(window).bind("statechange",function(t){var e;PF.fn.growl.close(),e=History.getState().data,e&&"tabs"==e.pushed&&PF.fn.show_tab(e["data-tab"])}),$(document).on("click",".list-item a",function(t){""!=$(this).attr("src")&&History.replaceState({scrollTop:$(window).scrollTop()},document.title,window.location.href)}),$(document).on("click","[data-action=load-more]",function(t){$(this).closest(".content-listing-more").hide(),!PF.fn.is_listing()||$(this).closest(PF.obj.listing.selectors.content_listing).is(":hidden")||$(this).closest("#content-listing-template").exists()||PF.obj.listing.calling||(PF.fn.listing.queryString.stock_new(),PF.obj.listing.query_string.seek=$(this).attr("data-seek"),PF.obj.listing.query_string.page=$(PF.obj.listing.selectors.content_listing_visible).data("page"),PF.obj.listing.query_string.page++,PF.fn.listing.ajax(),t.preventDefault())}),$(PF.obj.listing.selectors.list_item).length>0&&(PF.fn.listing.show(),$(window).scroll(function(){var t=$(PF.obj.listing.selectors.content_listing_load_more,PF.obj.listing.selectors.content_listing_visible).find("button[data-action=load-more]");t.length>0&&$(window).scrollTop()+$(window).innerHeight()>$(document).height()-300&&0==PF.obj.listing.calling&&t.click()})),$(document).on("click",PF.obj.modal.selectors.root+" [data-switch]",function(){var t=$(this).closest(PF.obj.modal.selectors.root);$("[data-view=switchable]",t).hide(),$("#"+$(this).attr("data-switch"),t).show()}),$(document).on("click","[data-toggle]",function(){var t=$("[data-content="+$(this).data("toggle")+"]"),e=!t.is(":visible");$(this).html($(this).data("html-"+(e?"on":"off"))),t.toggle()}),$(document).on("click","[data-action=cookie-law-close]",function(){var t=$(this).closest("#cookie-law-banner"),e=void 0!==t.data("cookie")?t.data("cookie"):"PF_COOKIE_LAW_DISPLAY";Cookies.set(e,0,{expires:365}),t.remove()}),Clipboard=new Clipboard("[data-action=copy]",{text:function(t){var e=$(t.getAttribute("data-action-target")),i=e.is(":input")?e.val():e.text();return i.trim()}}),Clipboard.on("success",function(t){var e=$(t.trigger.getAttribute("data-action-target"));e.highlight(),t.clearSelection()})});var PF={fn:{},str:{},obj:{}};PF.obj.config={base_url:"",json_api:"/json/",listing:{items_per_page:24},animation:{easingFn:"ease",normal:400,fast:250}},PF.obj.l10n={},PF.fn._s=function(t,e){return void 0===t?t:(void 0!==PF.obj.l10n&&void 0!==PF.obj.l10n[t]?(t=PF.obj.l10n[t][0],void 0===t&&(t=t)):t=t,t=t.toString(),void 0!==e&&(t=sprintf(t,e)),t)},PF.fn._n=function(t,e,i){var o;return o=void 0!==PF.obj.l10n&&void 0!==PF.obj.l10n[t]?PF.obj.l10n[t][1==i?0:1]:1==i?t:e,o=void 0===o?t:o.toString(),void 0!==i&&(o=sprintf(o,i)),o},PF.fn.extend_lang=function(t){$.each(PF.obj.lang_strings,function(e,i){void 0!==t[e]&&$.extend(PF.obj.lang_strings[e],t[e])})},PF.fn.get_url_vars=function(){for(var t,e=/\+/g,i=/([^&=]+)=?([^&]*)/g,o=function(t){return decodeURIComponent(escape(t.replace(e," ")))},n=window.location.search.substring(1),r={};t=i.exec(n);)r[o(t[1])]=o(t[2]);return r},PF.fn.get_url_var=function(t){return PF.fn.get_url_vars()[t]},PF.fn.is_user_logged=function(){return $("#top-bar-user").exists()},PF.fn.generate_random_string=function(t){void 0===t&&(t=5);for(var e="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",o=0;o<t;o++)e+=i.charAt(Math.floor(Math.random()*i.length));return e},PF.fn.getDateTime=function(){var t=new Date,e=t.getFullYear(),i=t.getMonth()+1,o=t.getDate(),n=t.getHours(),r=t.getMinutes(),a=t.getSeconds();if(1==i.toString().length)i="0"+i;if(1==o.toString().length)o="0"+o;if(1==n.toString().length)n="0"+n;if(1==r.toString().length)r="0"+r;if(1==a.toString().length)a="0"+a;var s=e+"-"+i+"-"+o+" "+n+":"+r+":"+a;return s},PF.fn.htmlEncode=function(t){return $("<div/>").text($.trim(t)).html()},PF.fn.htmlDecode=function(t){return $("<div/>").html($.trim(t)).text()},PF.fn.nl2br=function(t){var e="<br>";return(t+"").replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g,"$1"+e+"$2")},PF.fn.versionCompare=function(t,e,i){this.php_js=this.php_js||{},this.php_js.ENV=this.php_js.ENV||{};var o=0,n=0,r=0,a={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1},s=function(t){return t=(""+t).replace(/[_\-+]/g,"."),t=t.replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,"."),t.length?t.split("."):[-8]};for(numVersion=function(t){return t?isNaN(t)?a[t]||-7:parseInt(t,10):0},t=s(t),e=s(e),n=Math.max(t.length,e.length),o=0;o<n;o++)if(t[o]!=e[o]){if(t[o]=numVersion(t[o]),e[o]=numVersion(e[o]),t[o]<e[o]){r=-1;break}if(t[o]>e[o]){r=1;break}}if(!i)return r;switch(i){case">":case"gt":return r>0;case">=":case"ge":return r>=0;case"<=":case"le":return r<=0;case"==":case"=":case"eq":return 0===r;case"<>":case"!=":case"ne":return 0!==r;case"":case"<":case"lt":return r<0;default:return null}},PF.fn.baseName=function(t){var e=new String(t).substring(t.lastIndexOf("/")+1);return-1!=e.lastIndexOf(".")&&(e=e.substring(0,e.lastIndexOf("."))),e},PF.fn.guid=function(){var t=(new Date).getTime();return"undefined"!=typeof performance&&"function"==typeof performance.now&&(t+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?i:3&i|8).toString(16)})},PF.fn.md5=function(t){return SparkMD5.hash(t)},PF.fn.dataURItoBlob=function(t){var e;e=t.split(",")[0].indexOf("base64")>=0?atob(t.split(",")[1]):unescape(t.split(",")[1]);for(var i=t.split(",")[0].split(":")[1].split(";")[0],o=new Uint8Array(e.length),n=0;n<e.length;n++)o[n]=e.charCodeAt(n);return new Blob([o],{type:i})},PF.fn.clean_facebook_hash=function(){"#_=_"==window.location.hash&&(window.location.hash="")},PF.fn.clean_facebook_hash(),Array.min=function(t){return Math.min.apply(Math,t)},Array.max=function(t){return Math.max.apply(Math,t)},Array.sum=function(t){return t.reduce(function(t,e){return e+t})},Object.size=function(t){var e,i=0;for(e in t)t.hasOwnProperty(e)&&i++;return i},Object.flatten=function(t,e){if(void 0===e)e="";var i={};return $.each(t,function(t,o){o&&("object"==typeof o?i=$.extend({},i,Object.flatten(o,e+t+"_")):i[e+t]=o)}),i},String.prototype.isNumeric=function(){return!isNaN(parseFloat(this))&&isFinite(this)},String.prototype.repeat=function(t){return new Array(t+1).join(this)},String.prototype.capitalizeFirstLetter=function(){return this.charAt(0).toUpperCase()+this.slice(1)},String.prototype.replaceAll=function(t,e){var i=this;return i.replace(new RegExp(t,"g"),e)},String.prototype.isEmail=function(){var t=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;return t.test(this)},String.prototype.getRounded=function(t,e){var i,o,n,r;if(t|=0,i=Math.pow(10,t),value=this,value*=i,r=value>0|-(value<0),n=value%1==.5*r,o=Math.floor(value),n)switch(e){case"PHP_ROUND_HALF_DOWN":value=o+(r<0);break;case"PHP_ROUND_HALF_EVEN":value=o+o%2*r;break;case"PHP_ROUND_HALF_ODD":value=o+!(o%2);break;default:value=o+(r>0)}return(n?value:Math.round(value))/i},String.prototype.getBytes=function(){var t=["KB","MB","GB","TB","PB","EB","ZB","YB"],e=this.toUpperCase().substr(-2);if(-1==t.indexOf(e))return this;var i=t.indexOf(e)+1;return parseFloat(this)*Math.pow(1e3,i)},String.prototype.formatBytes=function(t){var e=parseInt(this),i=["KB","MB","GB","TB","PB","EB","ZB","YB"];if(!$.isNumeric(this))return!1;if(e<1e3)return e+" B";if(void 0===t)t=2;for(var o=0;o<i.length;o++){var n=Math.pow(1e3,o+1),r=1e3*n;if(e<r){var a=e/n;return this.getRounded.call(a,t)+" "+i[o]}}},String.prototype.match_image_urls=function(){return this.match(/\b(?:(http[s]?|ftp[s]):\/\/)?([^:\/\s]+)(:[0-9]+)?((?:\/\w+)*\/)([\w\-\.]+[^#?\s]+)([^#\s]*)?(#[\w\-]+)?\.(?:jpe?g|gif|png|bmp)\b/gim)},String.prototype.match_urls=function(){return this.match(/\b(?:(http[s]?|ftp[s]):\/\/)?([^:\/\s]+)(:[0-9]+)?((?:\/\w+)*\/)([\w\-\.]+[^#?\s]+)([^#\s]*)?(#[\w\-]+)?\b/gim)},"indexOf"in Array.prototype||(Array.prototype.indexOf=function(t,e){void 0===e&&(e=0),e<0&&(e+=this.length),e<0&&(e=0);for(var i=this.length;e<i;e++)if(e in this&&this[e]===t)return e;return-1}),Array.prototype.array_unique=function(){var t=[];return $.each(this,function(e,i){-1==$.inArray(i,t)&&t.push(i)}),t},PF.fn.deparam=function(t){if(void 0!==t&&t){t=t.substring(t.indexOf("?")+1);for(var e={},i=t.replace(/^[\?|&]*/,"").replace(/[&|\?]*$/,"").split("&"),o=0;o<i.length;o++){var n=i[o].split("="),r=decodeURIComponent(n[0]),a=n[1]?decodeURIComponent(n[1]):null;e.hasOwnProperty(r)&&!a||(e[r]=a)}return e}},String.prototype.removeURLParameter=function(t){var e=PF.fn.deparam(this);return void 0!==e[t]&&delete e[t],decodeURIComponent($.param(e))},String.prototype.changeURLParameterValue=function(t,e){var i=this.substring(0,this.indexOf("?")),o=PF.fn.deparam(this);return void 0!==o[t]&&(o[t]=e),i+"?"+decodeURIComponent($.param(o))},String.prototype.truncate_middle=function(t){function e(t,e,i){for(var o=[" ","/","&"],n=.8*e,r=(i=void 0!==i&&i,t=i?t.split("").reverse().join(""):t,""),a=0;a<e-1&&(r+=t[a],!(a>=n&&o.indexOf(t[a])>=0));a++);return i?r.split("").reverse().join(""):r}t=void 0!==t?t:40;var i=t/2,o=this.replace(/https?:\/\//g,"");return o.length<=t?o:e(o,i,!1)+"..."+e(o,i,!0)},jQuery.extend({compare:function(t,e){var i="[object Object]",o="[object Array]",n=Object.prototype.toString.apply(t),r=Object.prototype.toString.apply(e);return n===r&&(n===i?$.compareObject(t,e):n===o?$.compareArray(t,e):t===e)},compareArray:function(t,e){var i,o,n,r,a;if(t===e)return!0;if(t.length!=e.length)return!1;for(i=jQuery.extend(!0,[],t),o=jQuery.extend(!0,[],e),i.sort(),o.sort(),n=0,l=i.length;n<l;n+=1){if(r=Object.prototype.toString.apply(i[n]),a=Object.prototype.toString.apply(o[n]),r!==a)return!1;if(!1===$.compare(i[n],o[n]))return!1}return!0},compareObject:function(t,e){var i,o,n;if(t===e)return!0;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(i in t){if(t.hasOwnProperty(i)){if(void 0===e[i])return!1;if(o=Object.prototype.toString.apply(t[i]),n=Object.prototype.toString.apply(e[i]),o!==n)return!1}if(!1===$.compare(t[i],e[i]))return!1}return!0}}),jQuery.fn.exists=function(){return this.length>0},jQuery.fn.replace_svg=function(){this.attr("src")&&$(this).each(function(){$(this).attr("src",$(this).attr("src").replace(".svg",".png"))})},jQuery.fn.is_fluid=function(){return!0},jQuery.fn.bindFormData=function(){return $(":input",this).each(function(){var t=PF.fn.htmlEncode($(this).val());if($(this).is("input")&&(this.setAttribute("value",this.value),
this.checked?this.setAttribute("checked","checked"):this.removeAttribute("checked")),$(this).is("textarea")&&$(this).html(t),$(this).is("select")){var e=this.selectedIndex,i=0;$(this).children("option").each(function(){i++!=e?this.removeAttribute("selected"):this.setAttribute("selected","selected")})}}),this},jQuery.fn.formValues=function(t){var e=$(":input",this);return"object"!=typeof t?(t={},$.each(e,function(){this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/color|date|datetime|datetime-local|email|month|range|search|tel|time|url|week|text|number|hidden|password/i.test(this.type))&&(this.name.match(/^.*\[\]$/)&&this.checked?(void 0===t[this.name]&&(t[this.name]=[]),t[this.name].push($(this).val())):t[this.name]=$(this).val())}),t):($.each(e,function(){this.name.match(/^.*\[\]$/)&&"object"==typeof t[this.name]?$(this).prop("checked",-1!==t[this.name].indexOf($(this).val())):this.name&&t[this.name]?/checkbox|radio/i.test(this.type)?$(this).prop("checked",t[this.name]==$(this).val()):$(this).val(t[this.name]):/checkbox|radio/i.test(this.type)&&$(this).removeProp("checked")}),$(this))},jQuery.fn.storeformData=function(t){return void 0===t&&void 0!==$(this).attr("id")&&(t=$(this).attr("id")),void 0!==t&&$(this).data(t,$(this).formValues()),this},jQuery.fn.is_sameformData=function(t){var e=$(this);return void 0===t&&(t=e.attr("id")),jQuery.compare(e.formValues(),e.data(t))},jQuery.Event.prototype.keydown_numeric=function(){var t=this;if(t.shiftKey)return t.preventDefault(),!1;var e=t.charCode||t.keyCode,i=t.target;""==$(i).val()||parseInt($(i).val());return 13==e||(46==e||8==e||9==e||27==e||65==e&&!0===t.ctrlKey||e>=35&&e<=40||void((e<48||e>57)&&(e<96||e>105)&&t.preventDefault()))},PF.fn.is_canvas_supported=function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},PF.fn.is_validity_supported=function(){var t=document.createElement("input");return"object"==typeof t.validity},PF.fn.getScrollBarWidth=function(){var t=document.createElement("p");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var o=t.offsetWidth;return i==o&&(o=e.clientWidth),document.body.removeChild(e),i-o},PF.str.ScrollBarWidth=PF.fn.getScrollBarWidth(),PF.fn.top_notifications_viewed=function(){var t=$("[data-action=top-bar-notifications]"),e=($(".top-bar-notifications-list",t),$(".top-btn-number",t));$(".persistent",t).exists()?e.text($(".persistent",t).length).addClass("on"):e.removeClass("on")},PF.fn.bindtipTip=function(t,e){void 0===t&&(t=$("body")),t instanceof jQuery==0&&(t=$(t));var i={delay:0,content:!1,fadeIn:0};void 0!==e&&(void 0!==e.delay&&(i.delay=e.delay),void 0!==e.content&&(i.content=e.content),void 0!==e.content&&(i.fadeIn=e.fadeIn)),"tooltip"!==t.attr("rel")&&(t=$("[rel=tooltip]",t)),t.each(function(){if((void 0!==$(this).attr("href")||void 0!==$(this).data("href"))&&PF.fn.isDevice(["phone","phablet","tablet"]))return!0;var t=void 0===$(this).data("tiptip")?"bottom":$(this).data("tiptip");PF.fn.isDevice(["phone","phablet"])&&(t="top"),$(this).tipTip({delay:i.delay,defaultPosition:t,content:i.content,fadeIn:i.fadeIn,fadeOut:0})})},PF.fn.form_modal_has_changed=function(){if(!$(PF.obj.modal.selectors.root).is(":hidden")&&void 0!==$("html").data("modal-form-values")){var t=$("html").data("modal-form-values"),e=PF.fn.deparam($(":input:visible",PF.obj.modal.selectors.root).serialize()),i=!1,o=$.extend({},t,e);for(var n in o)if(t[n]!==e[n]){i=!0;break}return i}},PF.fn.is_listing=function(){return $(PF.obj.listing.selectors.content_listing).exists()},PF.fn.is_tabs=function(){return $(".content-tabs").exists()},jQuery.fn.shake=function(t){return this.each(function(t){var e=$(this),i=e.css("position");i.match("relative|absolute|fixed")||e.css({position:"relative"});var o=parseInt(e.css("left"));if(o.toString().isNumeric()||(o=0),!e.is(":animated")){for(var n=1;n<=2;n++)e.animate({left:o-10},0).animate({left:o},30).animate({left:o+10},30).animate({left:o},30);"static"!==i&&e.css({position:i})}}),"function"==typeof t&&t(),this},jQuery.fn.highlight=function(t){if(this.is(":animated")||!this.exists())return this;void 0===t&&(t="yellow");var e=t;switch(t){case"yellow":e="#FFFBA2";break;case"red":e="#FF7F7F";break;default:e=t}var i=$(this).css("background-color");$(this).css("background");return $(this).css({background:"",backgroundColor:e}).animate({backgroundColor:i},800,function(){$(this).css("background","")}),this},jQuery.fn.pf_slideDown=function(t,e){var i,o,n,r="normal",a=$(this).length;return"function"==typeof t&&(e=t,t=r),void 0===t&&(t=r),$(this).each(function(r){var s=parseInt($(this).css("top")),l=s>0?s:0;0==t?(i={display:"block",opacity:0},o={opacity:1},n=jQuery.speed("fast").duration):(i={top:-$(this).outerHeight(!0),opacity:1,display:"block"},o={top:l},n=jQuery.speed(t).duration),$(this).data("originalTop",$(this).css("top")),$(this).css(i).animate(o,n,function(){r==a-1&&"function"==typeof e&&e()})}),this},jQuery.fn.pf_slideUp=function(t,e){var i="normal",o=$(this).length;return"function"==typeof t&&(e=t,t=i),void 0===t&&(t=i),$(this).each(function(i){$(this).animate({top:-$(this).outerHeight(!0)},jQuery.speed(t).duration,function(){$(this).css({display:"none",top:$(this).data("originalTop")}),i==o-1&&"function"==typeof e&&e()})}),this},jQuery.fn.is_in_viewport=function(){var t=$(this)[0].getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)},jQuery.fn.getWindowCutoff=function(){var t={top:$(this).offset().top,left:$(this).offset().left,width:$(this).outerWidth(),height:$(this).outerHeight()};t.right=t.left+t.width,t.bottom=t.top+t.height;var e=!1,i={top:t.top>0?0:t.top,right:document.body.clientWidth-t.right,bottom:document.body.clientHeight-t.bottom,left:t.left>0?0:t.left};for(var o in i)i[o]<0?e=!0:i[o]=0;return e?i:null},PF.fn.scroll=function(t,e){if("function"==typeof t)e=t,t="";var i=parseInt($("body").css("margin-top"));0==i&&$(".top-bar-placeholder").exists()&&(i=$(".top-bar-placeholder").height()),$(t).exists()||(t="html"),$("body,html").animate({scrollTop:$(t).offset().top-i},"normal",function(){"function"==typeof e&&e()})},PF.fn.close_pops=function(t){$(".pop-box:visible").each(function(){$(this).closest(".pop-btn").click()})},PF.fn.growl={selectors:{root:"#growl"},str:{timeout:null,timeoutcall:!1},call:function(t){if(void 0!==t&&("string"==typeof t&&(t={message:t}),void 0!==t.message)){var e,i,o,n;for(key in e={message:t.message,insertTo:"body",where:"before",color:"default",css:{},classes:"",expires:0,callback:function(){}},e)void 0!==t[key]&&(key.match("/^(callback)$/")?"function"==typeof t[key]&&(e[key]=t[key]):e[key]=t[key]);if($(e.insertTo).exists()||(e.insertTo="body"),$(PF.fn.growl.selectors.root).exists()){if($(PF.fn.growl.selectors.root).text()==e.message)return void $(PF.fn.growl.selectors.root).shake();$(PF.fn.growl.selectors.root).remove()}switch(i=$('<div id="'+PF.fn.growl.selectors.root.replace("#","")+'" class="growl">'+e.message+'<span class="icon icon-close" data-action="close"></span></div>').css(e.css).addClass(e.classes),o="body"!==e.insertTo?"static":"",e.color){case"dark":n="dark";break;default:n=""}if(i.addClass(o+" "+n),"before"==e.where?$(e.insertTo).prepend(i.hide()):$(e.insertTo).append(i.hide()),$(".fullscreen").is(":visible")&&i.css({"z-index":parseInt($(".fullscreen").css("z-index"))+1}),$(PF.obj.modal.selectors.root).is(":visible")){$(PF.obj.modal.selectors.box,PF.obj.modal.selectors.root);i.show(),i.css("top",($("#top-bar").outerHeight(!0)-i.outerHeight(!0))/2),PF.fn.growl.fixPosition(),i.hide()}i.pf_slideDown("static"==o?0:200,function(){"function"==typeof e.callback&&e.callback()}),$(document).on("click",".growl",function(t){(PF.fn.isDevice(["phone","phablet"])||$(t.target).is("[data-action=close]"))&&PF.fn.growl.close(!0)}),e.expires>0&&("number"==typeof this.str.timeout&&clearTimeout(this.str.timeout),this.str.timeout=setTimeout(function(){PF.fn.growl.str.timeoutcall=!0,PF.fn.growl.close()},e.expires)),console.log(e.message)}},expirable:function(t,e){void 0!==t&&(void 0===e&&(e=5e3),PF.fn.growl.call({message:t,expires:e}))},close:function(t,e){var i=$(PF.fn.growl.selectors.root);t&&(this.str.timeout=null,this.str.timeoutcall=!1,clearTimeout(this.str.timeout)),i.exists()&&("number"!=typeof this.str.timeout||this.str.timeoutcall)&&i.fadeOut("fast",function(){$(this).remove(),"function"==typeof e&&e()})},fixPosition:function(){var t=$(PF.fn.growl.selectors.root);if(t.exists()&&$(PF.obj.modal.selectors.root).exists()&&("scrollbar"!=t.data("fixedPosition")||!$(PF.obj.modal.selectors.root).hasScrollBar().vertical)){var e={modal:$(PF.obj.modal.selectors.box).offset().left,growl:t.offset().left},i=e.modal-e.growl,o=i<0?"-="+Math.abs(i):"-"+parseInt(t.css("width"))/2;PF.fn.isDevice(["phone","phablet"])||t.css("marginLeft",o+"px"),t.data("fixedPosition",$(PF.obj.modal.selectors.root).hasScrollBar().vertical?"scrollbar":"no-scrollbar")}}},PF.obj.modal={type:"",selectors:{root:"#fullscreen-modal",box:"#fullscreen-modal-box",body:"#fullscreen-modal-body",login:"[data-modal=login]",changes_confirm:"#fullscreen-changes-confirm",btn_container:".btn-container",close_buttons:".close-modal,.cancel-modal,[data-action=cancel],[data-action-close]",submit_button:"[data-action=submit]",growl_placeholder:"#fullscreen-growl-placeholder"},ajax:{url:"",deferred:{}},locked:!1,form_data:{},XHR:{},prevented:!1},PF.obj.modal.$close_buttons=$(PF.obj.modal.selectors.close_buttons,PF.obj.modal.selectors.root),PF.obj.modal.$submit_button=$(PF.obj.modal.selectors.submit_button,PF.obj.modal.selectors.root),PF.fn.modal={str:{transition:"all "+PF.obj.config.animation.fast+"ms ease"},call:function(t){var e,i;if(void 0!==t&&(void 0!==t.template&&void 0===t.type&&(t.type="html"),void 0!==t.title&&void 0!==t.message||"login"===t.type||"html"===t.type)){for(key in PF.fn.growl.close(),e={forced:!1,type:"confirm",title:t.title,message:t.message,html:!1,template:t.template,buttons:!0,button_submit:PF.fn._s("Submit"),txt_or:PF.fn._s("or"),button_cancel:PF.fn._s("cancel"),ajax:{url:null,data:null,deferred:{}},confirm:function(){},cancel:function(){PF.fn.modal.close()},load:function(){},callback:function(){}},e)void 0!==t[key]&&(/^cancel|confirm|callback$/.test(key)?"function"==typeof t[key]&&(e[key]=t[key]):e[key]=t[key]);void 0!==t.ajax&&!t.ajax.url&&t.ajax.deferred&&(e.ajax.url=PF.obj.config.json_api),"login"==e.type&&(e.buttons=!1),"confirm"==e.type&&(e.button_submit=PF.fn._s("Confirm"));var o="soft-black";$("html").hasClass("tone-dark")&&(o="black");var n,r=['<div id="',PF.obj.modal.selectors.root.replace("#",""),'"class="fullscreen '+o+'"><div id="',PF.obj.modal.selectors.box.replace("#",""),'"class="clickable"><div id="',PF.obj.modal.selectors.body.replace("#",""),'">%MODAL_BODY%</div>%MODAL_BUTTONS%<span class="close-modal icon-close" data-action="close-modal"></span></div></div>'].join(""),a=e.buttons?['<div class="',PF.obj.modal.selectors.btn_container.replace(".",""),'"><button class="btn btn-input default" data-action="submit" type="submit">',e.button_submit,'</button> <span class="btn-alt">',e.txt_or,'<a class="cancel" data-action="cancel">',e.button_cancel,"</a></span></div>"].join(""):"";switch("login"==e.type&&(e.template=void 0===e.template?$(PF.obj.modal.selectors.login).html():e.template),e.type){case"html":case"login":n=e.template;break;case"confirm":default:i=e.message,e.html||(i="<p>"+i+"</p>"),n="<h1>"+e.title+"</h1>"+i}if(void 0!==n){if(r=r.replace("%MODAL_BODY%",n).replace("%MODAL_BUTTONS%",a).replace(/template-tooltip/g,"tooltip"),$(PF.obj.modal.selectors.root).remove(),$("body").data("overflow-hidden",$("body").hasClass("overflow-hidden")),$("body").prepend(r).addClass("overflow-hidden"),this.fixScrollbars(),$("[rel=tooltip]",PF.obj.modal.selectors.root).each(function(){PF.fn.bindtipTip(this,{content:$(this).data("title")})}),$(":button, input[type=submit], input[type=reset]",PF.obj.modal.selectors.root).length>0){var s=$("form",PF.obj.modal.selectors.root);s.exists()?(s.append($($(PF.obj.modal.selectors.btn_container,PF.obj.modal.selectors.root).html()).wrapInner(PF.obj.modal.selectors.btn_container.replace(".",""))),$(PF.obj.modal.selectors.btn_container,PF.obj.modal.selectors.root).each(function(){$(this).closest("form").exists()||$(this).remove()})):$(PF.obj.modal.selectors.box,PF.obj.modal.selectors.root).wrapInner("<form />")}e.callback(),$(PF.obj.modal.selectors.box).css({transform:"scale(0.7)",opacity:0,transition:PF.fn.modal.str.transition}),$(PF.obj.modal.selectors.root).css({display:"block"}),setTimeout(function(){$(PF.obj.modal.selectors.root).css({opacity:1}),$(PF.obj.modal.selectors.box).css({transform:"scale(1)",opacity:1}),"undefined"!=typeof PFrecaptchaCallback&&PFrecaptchaCallback(),setTimeout(function(){$("html").data("modal-form-values",PF.fn.deparam($(":input:visible",PF.obj.modal.selectors.root).serialize())),"function"==typeof e.load&&e.load()},PF.obj.config.animation.fast)},1),$(PF.obj.modal.selectors.root).click(function(i){var o=$(i.target),n=this;if(!PF.obj.modal.locked)if(o.closest(PF.obj.modal.selectors.changes_confirm).exists()&&(o.is(PF.obj.modal.selectors.close_buttons)||o.is(PF.obj.modal.selectors.submit_button)))$(PF.obj.modal.selectors.changes_confirm).remove(),o.is(PF.obj.modal.selectors.close_buttons)?$(PF.obj.modal.selectors.box,n).fadeIn("fast",function(){$(this).css("transition",PF.fn.modal.str.transition)}):PF.fn.modal.close();else if(o.closest(".clickable").exists()&&!o.is(PF.obj.modal.selectors.close_buttons)||(PF.fn.growl.close(),e.cancel()),o.is(PF.obj.modal.selectors.submit_button)){if(!1===e.confirm())return;var r=!0;if($("input, textarea, select",PF.obj.modal.selectors.root).not(":input[type=button], :input[type=submit], :input[type=reset]").length>0&&!PF.fn.form_modal_has_changed()&&!e.forced&&(r=!1),r)if(e.ajax.url){var a,s=$(PF.obj.modal.selectors.btn_container,PF.obj.modal.selectors.root);switch(PF.obj.modal.locked=!0,s.first().clone().height(s.height()).html("").addClass("loading").appendTo(PF.obj.modal.selectors.root+" form"),s.hide(),PF.obj.modal.$close_buttons.hide(),PF.obj.modal.type){case"edit":a=PF.fn._s("Saving");break;case"confirm":case"form":default:a=PF.fn._s("Sending")}PF.fn.loading.inline($(PF.obj.modal.selectors.btn_container+".loading",PF.obj.modal.selectors.root),{size:"small",message:a,valign:"center"}),$(PF.obj.modal.selectors.root).disableForm(),(!$.isEmptyObject(PF.obj.modal.form_data)||void 0!==t.ajax&&void 0===t.ajax.data)&&(e.ajax.data=PF.obj.modal.form_data),PF.obj.modal.XHR=$.ajax({url:e.ajax.url,type:"POST",data:e.ajax.data}).complete(function(t){if(PF.obj.modal.locked=!1,200==t.status){var i=void 0!==e.ajax.deferred&&void 0!==e.ajax.deferred.success?e.ajax.deferred.success:null;"function"==typeof i?PF.fn.modal.close(function(){"function"==typeof i&&i(t)}):"object"==typeof i&&("function"==typeof i.before&&i.before(t),"function"==typeof i.done&&i.done(t))}else if($(PF.obj.modal.selectors.root).enableForm(),$(PF.obj.modal.selectors.btn_container+".loading",PF.obj.modal.selectors.root).remove(),s.css("display",""),void 0!==e.ajax.deferred&&"function"==typeof e.ajax.deferred.error)e.ajax.deferred.error(t);else{var o=PF.fn._s("An error occurred. Please try again later.");PF.fn.growl.call(o)}})}else PF.fn.modal.close(e.callback())}})}else console.log("PF Error: Modal content is empty")}},confirm:function(t){t.type="confirm",void 0===t.title&&(t.title=PF.fn._s("Confirm action")),PF.fn.modal.call(t)},simple:function(t){"string"==typeof t&&(t={message:t}),void 0===t.buttons&&(t.buttons=!1),void 0===t.title&&(t.title=PF.fn._s("information")),PF.fn.modal.call(t)},fixScrollbars:function(){if($(PF.obj.modal.selectors.root).exists()){var t={padding:$(".top-bar, .fixed, .position-fixed"),margin:$("html")},e={};PF.str.ScrollBarWidth>0&&$("html").hasScrollBar().vertical&&!$("body").data("overflow-hidden")?(e.padding=PF.str.ScrollBarWidth+"px",e.margin=PF.str.ScrollBarWidth+"px"):(e.padding="",e.margin=""),t.padding.css({paddingRight:e.padding}),t.margin.css({marginRight:e.margin})}},close:function(t){$(PF.obj.modal.selectors.root).exists()&&(PF.fn.growl.close(!0),$("[rel=tooltip]",PF.obj.modal.selectors.root).tipTip("hide"),$(PF.obj.modal.selectors.box).css({transform:"scale(0.5)",opacity:0}),$(PF.obj.modal.selectors.root).css({opacity:0}),setTimeout(function(){PF.str.ScrollBarWidth>0&&$("html").hasScrollBar().vertical&&$(".top-bar, .fixed, .position-fixed").css({paddingRight:""}),$("html").css({marginRight:""}),$("body").data("overflow-hidden")||$("body").removeClass("overflow-hidden"),$("body").removeData("overflow-hidden"),$(PF.obj.modal.selectors.root).remove(),"function"==typeof t&&t()},PF.obj.config.animation.normal))}},PF.fn.popup=function(t){var e={height:t.height||500,width:t.width||650,scrollTo:0,resizable:0,scrollbars:0,location:0};e.top=screen.height/2-e.height/2,e.left=screen.width/2-e.width/2;var i="";for(var o in e)i+=o+"="+e[o]+",";i=i.slice(0,-1),window.open(t.href,"Popup",i)},PF.fn.list_fluid_width=function(){if($("body").is_fluid()){var t=$(PF.obj.listing.selectors.content_listing_visible),e=$(PF.obj.listing.selectors.pad_content,t),i=$(PF.obj.listing.selectors.list_item,t),o=i.outerWidth(!0),n=i.outerWidth(!0)-i.width();PF.obj.listing.content_listing_ratio=parseInt((t.width()+n)/o),i.length<PF.obj.listing.content_listing_ratio?e.css("width","100%"):(PF.fn.isDevice(["tablet","laptop","desktop"]),PF.obj.follow_scroll.$node.hasClass("position-fixed")&&PF.obj.follow_scroll.$node.width($(".content-width").first().width()))}},PF.obj.tabs={hashdata:{}},PF.fn.show_tab=function(t){if(void 0!==t){var e=$("a[data-tab="+t+"]",".content-tabs");$("li",e.closest("ul")).removeClass("current"),e.closest("li").addClass("current");var i=$("#tabbed-content-group");if($target=$("#"+e.data("tab")),$(".tabbed-content",i).removeClass("visible").hide(),$($target,i).addClass("visible").show(),$("[data-content=list-selection]").removeClass("visible").addClass("hidden"),$("[data-content=list-selection][data-tab="+e.data("tab")+"]").removeClass("hidden").addClass("visible"),i.exists()){var o=$(PF.obj.listing.selectors.list_item+":not(.jsly)",$target),n=!$target.hasClass("jsly");"ajax"!=$target.data("load")||"true"===$target.data("empty")||$(PF.obj.listing.selectors.list_item,$target).exists()?(PF.fn.listing.queryString.stock_current(),PF.fn.listing.columnizer(!1,0,!1),o[n?"fadeIn":"show"]()):(PF.fn.listing.queryString.stock_load(),$target.html(PF.obj.listing.template.fill),PF.fn.loading.inline($(PF.obj.listing.selectors.content_listing_loading,$target)),PF.fn.listing.queryString.stock_new(),PF.fn.listing.ajax())}PF.fn.listing.columnizerQueue(),1==$(PF.obj.listing.selectors.content_listing_visible).data("queued")&&PF.fn.listing.columnizer(!0,0)}},PF.obj.listing={columns:"",columns_number:1,current_column:"",current_column:"",XHR:{},query_string:PF.fn.get_url_vars(),calling:!1,content_listing_ratio:1,selectors:{sort:".sort-listing .current [data-sort]",content_listing:".content-listing",content_listing_visible:".content-listing:visible",content_listing_loading:".content-listing-loading",content_listing_load_more:".content-listing-more",content_listing_pagination:".content-listing-pagination",empty_icon:".icon icon-drawer",pad_content:".pad-content-listing",list_item:".list-item"},template:{fill:$("[data-template=content-listing]").html(),empty:$("[data-template=content-listing-empty]").html(),loading:$("[data-template=content-listing-loading]").html()}},PF.fn.listing={},PF.fn.listing.show=function(t,e){$content_listing=$("#content-listing-tabs").exists()?$(PF.obj.listing.selectors.content_listing_visible,"#content-listing-tabs"):$(PF.obj.listing.selectors.content_listing),PF.fn.loading.inline(PF.obj.listing.selectors.content_listing_loading),$(PF.obj.listing.selectors.list_item+":not(.jsly)",$content_listing).each(function(){$(this).imagesLoaded(function(i){var o=PF.obj.listing.selectors.list_item,n=$(o+":visible",PF.obj.listing.selectors.content_listing_visible),r=$(i.elements);(void 0!==t&&$(t.html).length<PF.obj.config.listing.items_per_page||$(PF.obj.listing.selectors.list_item,$content_listing).length<PF.obj.config.listing.items_per_page)&&PF.fn.listing.removeLoader($content_listing),!$(PF.obj.listing.selectors.content_listing_pagination,$content_listing).is("[data-type=classic]")&&$("[data-action=load-more]",$content_listing).exists()||$(PF.obj.listing.selectors.content_listing_loading,$content_listing).remove(),0==n.length&&(r.show(),PF.fn.listing.columnizer(!1,0),PF.obj.listing.recolumnize=!0);var a=0;PF.fn.listing.columnizer(PF.obj.listing.recolumnize,a,0==n.length),r.hide(),PF.obj.listing.recolumnize=!1,PF.fn.isDevice(["laptop","desktop"])?r.each(function(){$(this).show().find(".image-container").hide();var t=$.now(),e=$(this),i=$(".image-container",e);$(".image-container",this).imagesLoaded(function(){var e=$.now()-t;0==n.length?e>PF.obj.config.animation.normal?i.fadeIn(PF.obj.config.animation.normal):i.show():i.fadeIn(PF.obj.config.animation.normal)})}):r.show(),PF.obj.listing.calling=!1;var s=$(PF.obj.listing.selectors.content_listing_loading,$content_listing).exists()&&$(PF.obj.listing.selectors.content_listing_loading,$content_listing).is_in_viewport();void 0===PF.obj.listing.show_load_more&&(PF.obj.listing.show_load_more=s),$(PF.obj.listing.selectors.content_listing_loading,$content_listing)[(s?"add":"remove")+"Class"]("visibility-hidden"),$(PF.obj.listing.selectors.content_listing_load_more,$content_listing)[PF.obj.listing.show_load_more?"show":"hide"]();var l=History.getState();l.data&&void 0!==l.data.scrollTop&&($(window).scrollTop(),l.data.scrollTop),"function"==typeof e&&e()})})},PF.fn.listing.removeLoader=function(t){var e=[PF.obj.listing.selectors.content_listing_load_more,PF.obj.listing.selectors.content_listing_loading];$(PF.obj.listing.selectors.content_listing_pagination,$content_listing).is("[data-type=endless]")&&e.push(PF.obj.listing.selectors.content_listing_pagination),$.each(e,function(e,i){$(i,t).remove()})},PF.fn.listing.queryString={stock_load:function(){var t=$(PF.obj.listing.selectors.content_listing_visible),e=PF.fn.deparam(t.data("params"));for(var i in PF.obj.listing.params_hidden=void 0!==t.data("params-hidden")?PF.fn.deparam(t.data("params-hidden")):null,void 0===PF.obj.listing.query_string.action&&(PF.obj.listing.query_string.action=t.data("action")||"list"),void 0===PF.obj.listing.query_string.list&&(PF.obj.listing.query_string.list=t.data("list")),void 0===PF.obj.listing.query_string.sort&&(void 0!==e&&void 0!==e.sort?PF.obj.listing.query_string.sort=e.sort:PF.obj.listing.query_string.sort=$(":visible"+PF.obj.listing.selectors.sort).data("sort")),void 0===PF.obj.listing.query_string.page&&(PF.obj.listing.query_string.page=1),t.data("page",PF.obj.listing.query_string.page),$(PF.obj.listing.selectors.content_listing+"[data-load=ajax]").each(function(){var t=$("[data-tab="+$(this).attr("id")+"]"+PF.obj.listing.selectors.sort),e=PF.fn.deparam($(this).data("params")),i=PF.fn.deparam($(this).data("params-hidden")),o={q:e&&e.q?e.q:null,list:$(this).data("list"),sort:t.exists()?t.data("sort"):e&&e.sort?e.sort:null,page:e&&e.page?e.page:1};for(var n in i&&i.list&&delete o.list,o)o[n]||delete o[n]}),e)0==/action|list|sort|page/.test(i)&&(PF.obj.listing.query_string[i]=e[i]);if(void 0!==PF.obj.listing.params_hidden){for(var i in PF.obj.listing.params_hidden)0==/action|list|sort|page/.test(i)&&(PF.obj.listing.query_string[i]=PF.obj.listing.params_hidden[i]);PF.obj.listing.query_string.params_hidden=PF.obj.listing.params_hidden,PF.obj.listing.params_hidden.params_hidden=null}},stock_new:function(){var t=$(PF.obj.listing.selectors.content_listing_visible),e=PF.fn.deparam(t.data("params"));t.data("offset")?PF.obj.listing.query_string.offset=t.data("offset"):delete PF.obj.listing.query_string.offset,PF.obj.listing.query_string.action=t.data("action")||"list",PF.obj.listing.query_string.list=t.data("list"),void 0!==e&&void 0!==e.sort?PF.obj.listing.query_string.sort=e.sort:PF.obj.listing.query_string.sort=$(":visible"+PF.obj.listing.selectors.sort).data("sort"),PF.obj.listing.query_string.page=1},stock_current:function(){this.stock_new(),PF.obj.listing.query_string.page=$(PF.obj.listing.selectors.content_listing_visible).data("page")}},PF.fn.listing.queryString.stock_load(),PF.fn.listing.ajax=function(){if(1!=PF.obj.listing.calling){PF.obj.listing.calling=!0;var t=$(PF.obj.listing.selectors.content_listing_visible),e=$(PF.obj.listing.selectors.pad_content,t),i=$(PF.obj.listing.selectors.content_listing_load_more,t);i.hide(),$(PF.obj.listing.selectors.content_listing_loading,t).removeClass("visibility-hidden").show(),PF.obj.listing.XHR=$.ajax({type:"POST",data:$.param($.extend({},PF.obj.listing.query_string,$.ajaxSettings.data))}).complete(function(o){var n=o.responseJSON,r=function(){$(PF.obj.listing.selectors.content_listing_loading+","+PF.obj.listing.selectors.content_listing_pagination+":not([data-visibility=visible])",t).remove()},a=function(){t.data("empty","true").html(PF.obj.listing.template.empty),$("[data-content=list-selection][data-tab="+t.attr("id")+"]").addClass("disabled")};if(4==o.readyState&&void 0!==n){if($("[data-content=list-selection][data-tab="+t.attr("id")+"]").removeClass("disabled"),200!==o.status){var s=void 0!==n.error&&void 0!==n.error.message?n.error.message:"Bad request";PF.fn.growl.call("Error: "+s),t.data("load","")}if(void 0!==n.html&&""!=n.html||0!=$(PF.obj.listing.selectors.list_item,t).length||a(),void 0===n.html||""==n.html)return r(),PF.obj.listing.calling=!1,void("function"==typeof PF.fn.listing_end&&PF.fn.listing_end());t.data({load:"",page:PF.obj.listing.query_string.page});var l=$.extend({},PF.obj.listing.query_string);for(var c in PF.obj.listing.params_hidden)void 0!==l[c]&&delete l[c];for(var c in delete l.action,l)l[c]||delete l[c];if(-1==document.URL.indexOf("?"+$.param(l))){var u=window.location.href;u=u.split("?")[0].replace(/\/$/,"")+"/?"+$.param(l),window.location.hash&&(u=u.replace(window.location.hash,"")),History.pushState({pushed:"pagination",scrollTop:$(window).scrollTop()},document.title,u)}$("a[data-tab="+t.attr("id")+"]").attr("href",document.URL),e.append(n.html),$("[data-action=load-more]",i).attr("data-seek",n.seekEnd),PF.fn.listing.show(n,function(){$(PF.obj.listing.selectors.content_listing_loading,t).addClass("visibility-hidden")})}else PF.obj.listing.calling=!1,t.data("load",""),r(),0==$(PF.obj.listing.selectors.list_item,t).length&&a(),0!==o.readyState&&PF.fn.growl.call(PF.fn._s("An error occurred. Please try again later."));"function"==typeof PF.fn.listing.ajax.callback&&PF.fn.listing.ajax.callback(o)})}},PF.fn.listing.columnizerQueue=function(){$(PF.obj.listing.selectors.content_listing+":hidden").data("queued",!0)},PF.fn.listing.refresh=function(t){PF.fn.listing.columnizer(!0,t,!1),$(PF.obj.listing.selectors.list_item).show()};var width=$(window).width();PF.fn.listing.columnizer=function(t,e,o){var n={phone:1,phablet:3,tablet:4,laptop:5,desktop:6,largescreen:7};if("boolean"!=typeof t)t=!1;if(void 0===PF.obj.listing.mode&&(t=!0),"boolean"!=typeof o){o=!1;var r=!0}else r=!1;if(!o&&r&&(width!==$(window).width()||t)&&(o=!0),void 0===e)e=PF.obj.config.animation.normal;var a=$("#content-listing-tabs").exists()?$(PF.obj.listing.selectors.content_listing_visible,"#content-listing-tabs"):$(PF.obj.listing.selectors.content_listing),s=$(PF.obj.listing.selectors.pad_content,a),l="responsive",c=$(t||o?PF.obj.listing.selectors.list_item:PF.obj.listing.selectors.list_item+":not(.jsly)",a);if(a.addClass("jsly"),void 0!==PF.obj.config.listing.device_to_columns&&(n=$.extend({},n,PF.obj.config.listing.device_to_columns)),a.data("device-columns")&&(n=$.extend({},n,a.data("device-columns"))),PF.obj.listing.mode=l,PF.obj.listing.device=PF.fn.getDeviceName(),c.exists()){if(void 0===a.data("columns")||t||o){var u=c.first();for(u.css("width",""),PF.obj.listing.columns=new Array,PF.obj.listing.columns_number=n[PF.fn.getDeviceName()],i=0;i<PF.obj.listing.columns_number;i++)PF.obj.listing.columns[i+1]=0;PF.obj.listing.current_column=1}else PF.obj.listing.columns=a.data("columns"),PF.obj.listing.columns_number=a.data("columns").length-1,PF.obj.listing.current_column=a.data("current_column");var d=1==PF.obj.listing.columns_number?"-10px":"";$("#tabbed-content-group").css({marginLeft:d,marginRight:d}),a.removeClass("small-cols").addClass(PF.obj.listing.columns_number>6?"small-cols":""),s.css("width","100%");var h=0;c.each(function(t){$(this).addClass("jsly");var i=$(".list-item-image",this),n=$(".list-item-image img",this),r=$(".list-item-thumbs",this),s=n.hasClass("jsly-loaded");n.show(),o&&($(this).css({top:"",left:"",height:"",position:""}),i.css({maxHeight:"",height:""}),n.removeClass("jsly").css({width:"",height:""}).parent().css({marginLeft:"",marginTop:""}),$("li",r).css({width:"",height:""}));var l=1==PF.obj.listing.columns_number?"100%":parseInt(1/PF.obj.listing.columns_number*(a.width()-10*(PF.obj.listing.columns_number-1))+"px");if($(this).css("width",l),PF.obj.listing.current_column>PF.obj.listing.columns_number&&(PF.obj.listing.current_column=1),$(this).attr("data-col",PF.obj.listing.current_column),!n.exists()){var u=!0;n=$(".image-container .empty",this)}var d=$(this).is(":visible");c.show();var f=i.hasClass("fixed-size"),p={w:parseInt(n.attr("width")),h:parseInt(n.attr("height"))};if(p.ratio=p.w/p.h,o&&PF.obj.listing.columns_number>1?(n.css({width:"auto",height:"auto"}),$(".image-container:not(.list-item-avatar-cover)",this).css({width:"",height:"auto"})):p.w>a.width()&&($(".image-container:not(.list-item-avatar-cover)",this).css(p.ratio<1?{maxWidth:"100%",height:"auto"}:{height:"100%",width:"auto"}),n.css(p.ratio<1?{maxWidth:"100%",height:"auto"}:{height:"100%",width:"auto"})),u||i.css("min-height")&&!n.hasClass("jsly")){parseInt(i.css("height"));var g={w:$(this).width(),h:f?$(this).width():null},m=Math.min(p.w,p.w<g.w?p.w:g.w);if(f){i.css({height:g.w}),p.ratio<=3&&(p.ratio>1||1==p.ratio)?(p.h=Math.min(p.h,p.w<g.w?p.w:g.w),p.w=p.h*p.ratio):(p.w=m,p.h=p.w/p.ratio);parseInt(i.css("min-height"));i.css("min-height",0)}else p.w=m,p.ratio>=3||p.ratio<1||1==p.ratio?p.h=p.w/p.ratio:(p.h=Math.min(p.h,p.w),p.w=p.h*p.ratio),u&&(p.h=g.w),i.css({height:p.h});n.css({width:p.w,height:p.h}),0==n.width()&&n.css({width:m,height:m/p.ratio}),$(".image-container",this).is(".list-item-avatar-cover")&&n.css(f?{width:"auto",height:"100%"}:{width:"100%",height:"auto"}),0!==n.height()&&(i.height()>n.height()||f)&&n.parent().css({marginTop:(i.outerHeight()-n.height())/2}),i.width()<n.width()&&n.parent().css({marginLeft:-(n.outerWidth()-i.width())/2+"px"});var b=Math.max(2*n.position().left,0),v=Math.max(2*n.position().top,0);if(PF.obj.listing.columns_number>6&&(b>0||v>0)){var y=b/i.width(),w=v/i.height(),P={};y<=.25&&w<=.25&&(y>w?(P.width=b+i.width(),P.height=P.width/p.ratio):(P.height=v+n.height(),P.width=P.height*p.ratio),n.css(P),n.parent().css({marginLeft:-(n.width()-i.width())/2,marginTop:0}))}r.exists()&&$("li",r).css({width:100/$("li",r).length+"%"}).css({height:$("li",r).width()}),d||c.hide()}if(!n.hasClass("jsly")&&$(this).is(":hidden")&&$(this).css("top","100%"),PF.obj.listing.columns[PF.obj.listing.current_column]+=$(this).outerHeight(!0),1==PF.obj.listing.columns_number)$(this).removeClass("position-absolute");else{$(this).is(":animated")&&(e=0),$(this).addClass("position-absolute");var F=$(this).outerWidth(!0)*(PF.obj.listing.current_column-1),x=parseInt($(this).css("left"))!=F;x&&(animate_grid=!0,$(this).animate({left:F},e))
;var _=PF.obj.listing.columns[PF.obj.listing.current_column]-$(this).outerHeight(!0);parseInt($(this).css("top"))!=_&&(animate_grid=!0,$(this).animate({top:_},e),x&&(h=1))}if(d&&c.show(),s||n.addClass("jsly").hide().imagesLoaded(function(t){$(t.elements).show().addClass("jsly-loaded")}),f)PF.obj.listing.current_column++;else{for(var j,S,k,T=1;T<=PF.obj.listing.columns_number;T++){if(k=PF.obj.listing.columns[T],void 0===S&&(S=k,j=T),0==PF.obj.listing.columns[T]){j=T;break}k<S&&(S=PF.obj.listing.columns[T],j=T)}PF.obj.listing.current_column=j}}),a.data({columns:PF.obj.listing.columns,current_column:PF.obj.listing.current_column});var f=0;if($.each(PF.obj.listing.columns,function(t,e){e>f&&(f=e)}),f>10&&(f-=10),PF.obj.listing.width=a.width(),void 0!==PF.obj.listing.height)var p=PF.obj.listing.height;PF.obj.listing.height=f;var g=void 0!==p&&p!==PF.obj.listing.height;g||(s.height(f),PF.fn.list_fluid_width()),g&&(s.height(p),setTimeout(function(){s.animate({height:f},e,function(){PF.fn.list_fluid_width()})},e*h)),a.data("list-mode",PF.obj.listing.mode),$(PF.obj.listing.selectors.content_listing_visible).data("queued",!1)}},PF.fn.loading={spin:{small:{lines:11,length:0,width:3,radius:7,speed:1,trail:45,blocksize:20},normal:{lines:11,length:0,width:5,radius:10,speed:1,trail:45,blocksize:30},big:{lines:11,length:0,width:7,radius:13,speed:1,trail:45,blocksize:40},huge:{lines:11,length:0,width:9,radius:16,speed:1,trail:45,blocksize:50}},inline:function(t,e){if(void 0!==t){if(t instanceof jQuery==0)t=$(t);var i={size:"normal",color:$("body").css("color"),center:!1,position:"absolute",shadow:!1,valign:"top"};if(void 0===e)e=i;else for(var o in i)void 0===e[o]&&(e[o]=i[o]);PF.fn.loading.spin[e.size];PF.fn.loading.spin[e.size].color=e.color,PF.fn.loading.spin[e.size].shadow=e.shadow,t.html('<span class="loading-indicator"></span>'+(void 0!==e.message?'<span class="loading-text">'+e.message+"</span>":"")).css({"line-height":PF.fn.loading.spin[e.size].blocksize+"px"}),$(".loading-indicator",t).css({width:PF.fn.loading.spin[e.size].blocksize,height:PF.fn.loading.spin[e.size].blocksize}).spin(PF.fn.loading.spin[e.size]),e.center&&$(".loading-indicator",t.css("textAlign","center")).css({position:e.position,top:"50%",left:"50%",marginTop:-PF.fn.loading.spin[e.size].blocksize/2,marginLeft:-PF.fn.loading.spin[e.size].blocksize/2}),"center"==e.valign&&$(".loading-indicator,.loading-text",t).css("marginTop",(t.height()-PF.fn.loading.spin[e.size].blocksize)/2+"px"),$(".spinner",t).css({top:PF.fn.loading.spin[e.size].blocksize/2+"px",left:PF.fn.loading.spin[e.size].blocksize/2+"px"})}},fullscreen:function(){$("body").append('<div class="fullscreen" id="pf-fullscreen-loader"><div class="fullscreen-loader black-bkg"><span class="loading-txt">'+PF.fn._s("loading")+"</span></div></div>"),$(".fullscreen-loader","#pf-fullscreen-loader").spin(PF.fn.loading.spin.huge),$("#pf-fullscreen-loader").css("opacity",1)},destroy:function(t){var e=$("#pf-fullscreen-loader"),i=$("#pf-onscreen-loader");"fullscreen"==t&&(t=e),"onscreen"==t&&(t=i),void 0!==t?t.remove():(e.remove(),i.remove())}},jQuery.fn.disableForm=function(){return $(this).data("disabled",!0),$(":input",this).each(function(){$(this).attr("disabled",!0)}),this},jQuery.fn.enableForm=function(){return $(this).data("disabled",!1),$(":input",this).removeAttr("disabled"),this},PF.obj.follow_scroll={Y:0,y:0,$node:$(".follow-scroll"),node_h:0,base_h:$(".follow-scroll").outerHeight(),set:function(t){t&&(PF.obj.follow_scroll.base_h=$(".follow-scroll").outerHeight());var e=PF.obj.follow_scroll.$node.closest(".follow-scroll-wrapper").exists();e&&PF.obj.follow_scroll.$node.closest(".follow-scroll-wrapper").css("position","static"),PF.obj.follow_scroll.y=PF.obj.follow_scroll.$node.exists()?PF.obj.follow_scroll.$node.offset().top:null,PF.obj.follow_scroll.node_h=PF.obj.follow_scroll.$node.outerHeight(),e&&PF.obj.follow_scroll.$node.closest(".follow-scroll-wrapper").css("position","")},checkDocumentHeight:function(){var t,e=document.body.clientHeight;(function i(){t=document.body.clientHeight,e!=t&&PF.obj.follow_scroll.set(),e=t,setTimeout(i,200)})()}},PF.obj.follow_scroll.set(),PF.obj.follow_scroll.process=function(t){if(t&&(PF.obj.follow_scroll.node_h=PF.obj.follow_scroll.base_h),PF.obj.follow_scroll.$node.exists()){var e=PF.obj.follow_scroll.$node.closest("[data-content=follow-scroll-parent]");e.exists()||(e=PF.obj.follow_scroll.$node.closest(".content-width"));var i=PF.obj.follow_scroll.$node.closest(".follow-scroll-wrapper"),o=PF.obj.follow_scroll.node_h,n=$(window).scrollTop()>PF.obj.follow_scroll.y-o;if("fixed"!==$("#top-bar").css("position")&&(PF.obj.follow_scroll.Y-=$(window).scrollTop(),PF.obj.follow_scroll.Y<0&&(PF.obj.follow_scroll.Y=0),n=n&&$(window).scrollTop()>PF.obj.follow_scroll.y),!(n&&i.hasClass("position-fixed")||!n&&!i.hasClass("position-fixed"))){if(i.exists()||(PF.obj.follow_scroll.$node.wrapAll('<div class="follow-scroll-wrapper" />'),i=PF.obj.follow_scroll.$node.closest(".follow-scroll-wrapper")),i.css("min-height",PF.obj.follow_scroll.node_h),PF.obj.follow_scroll.Y=$("#top-bar").outerHeight(!0)+parseFloat($("#top-bar").css("top"))-.5,n){var r=PF.obj.follow_scroll.node_h;i.addClass("position-fixed").css({top:PF.obj.follow_scroll.Y}),i.next().is(".follow-scroll-placeholder")?i.parent().find(".follow-scroll-placeholder").css("min-height",r).show():i.after($('<div class="follow-scroll-placeholder" />').css("min-height",r))}else i.removeClass("position-fixed").css({top:"",width:"",minHeight:""}),i.parent().find(".follow-scroll-placeholder").hide();$("[data-show-on=follow-scroll]")[(n?"remove":"add")+"Class"]("hidden soft-hidden"),$("html").data("top-bar-box-shadow-prevent")||$("html")[(n?"add":"remove")+"Class"]("top-bar-box-shadow-none"),PF.obj.follow_scroll.$node[(n?"add":"remove")+"Class"]("content-width")}}},PF.fn.isDevice=function(t){if("object"==typeof t)t="."+t.join(",.");else t="."+t;return $("html").is(t)},PF.fn.getDeviceName=function(){var t;return $.each(PF.obj.devices,function(e,i){if(PF.fn.isDevice(i))return t=i,!0}),t},PF.fn.topMenu={vars:{$button:$("[data-action=top-bar-menu-full]","#top-bar"),menu:"#menu-fullscreen",speed:PF.obj.config.animation.fast,menu_top:parseInt($("#top-bar").outerHeight())+parseInt($("#top-bar").css("top"))+parseInt($("#top-bar").css("margin-top"))+parseInt($("#top-bar").css("margin-bottom"))-parseInt($("#top-bar").css("border-bottom-width"))+"px"},show:function(t){if(!$("body").is(":animated")){if(void 0===t)t=this.vars.speed;this.vars.$button.addClass("current"),$("html").addClass("menu-fullscreen-visible"),$("#top-bar").css("position","fixed").append($("<div/>",{id:"menu-fullscreen",class:"touch-scroll",html:$("<ul/>",{html:$(".top-bar-left").html()+$(".top-bar-right").html()})}).css({borderTopWidth:this.vars.menu_top,left:"-100%"}));var e=$(this.vars.menu);$("li.phone-hide, li > .top-btn-text, li > .top-btn-text > span, li > a > .top-btn-text > span",e).each(function(){$(this).removeClass("phone-hide")}),$("[data-action=top-bar-menu-full]",e).remove(),$(".btn.black, .btn.default, .btn.blue, .btn.green, .btn.orange, .btn.red, .btn.transparent",e).removeClass("btn black default blue green orange red transparent"),setTimeout(function(){e.css({transform:"translate(100%, 0)"})},1),setTimeout(function(){$("html").css({backgroundColor:""})},this.vars.speed)}},hide:function(t){if(!$("body").is(":animated")&&$(this.vars.menu).is(":visible")){if(void 0===t)t=this.vars.speed;$("#top-bar").css("position",""),this.vars.$button.removeClass("current"),$("html").removeClass("menu-fullscreen-visible");var e=$(this.vars.menu);e.css({transform:"none"}),setTimeout(function(){e.remove()},t)}}},function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return-1==o.indexOf(e)&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||[];return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return-1!=o&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=0,n=i[o];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];n;){var a=r&&r[n];a&&(this.off(t,n),delete r[n]),n.apply(this,e),o+=a?0:1,n=i[o]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}(window,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function o(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i<t.length;i++)e.push(t[i]);else e.push(t);return e}function n(t,e,r){return this instanceof n?("string"==typeof t&&(t=document.querySelectorAll(t)),this.elements=o(t),this.options=i({},this.options),"function"==typeof e?r=e:i(this.options,e),r&&this.on("always",r),this.getImages(),s&&(this.jqDeferred=new s.Deferred),void setTimeout(function(){this.check()}.bind(this))):new n(t,e,r)}function r(t){this.img=t}function a(t,e){this.url=t,this.element=e,this.img=new Image}var s=t.jQuery,l=t.console;n.prototype=Object.create(e.prototype),n.prototype.options={},n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},n.prototype.addElementImages=function(t){"IMG"==t.nodeName&&this.addImage(t),!0===this.options.background&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&c[e]){for(var i=t.querySelectorAll("img"),o=0;o<i.length;o++){var n=i[o];this.addImage(n)}if("string"==typeof this.options.background){var r=t.querySelectorAll(this.options.background);for(o=0;o<r.length;o++){var a=r[o];this.addElementBackgroundImages(a)}}}};var c={1:!0,9:!0,11:!0};return n.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(e)for(var i=/url\((['"])?(.*?)\1\)/gi,o=i.exec(e.backgroundImage);null!==o;){var n=o&&o[2];n&&this.addBackground(n,t),o=i.exec(e.backgroundImage)}},n.prototype.addImage=function(t){var e=new r(t);this.images.push(e)},n.prototype.addBackground=function(t,e){var i=new a(t,e);this.images.push(i)},n.prototype.check=function(){function t(t,i,o){setTimeout(function(){e.progress(t,i,o)})}var e=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(e){e.once("progress",t),e.check()}):void this.complete()},n.prototype.progress=function(t,e,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded,this.emitEvent("progress",[this,t,e]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,t),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&l&&l.log("progress: "+i,t,e)},n.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(t,[this]),this.emitEvent("always",[this]),this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},r.prototype=Object.create(e.prototype),r.prototype.check=function(){var t=this.getIsImageComplete();return t?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&void 0!==this.img.naturalWidth},r.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.img,e])},r.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},a.prototype=Object.create(r.prototype),a.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var t=this.getIsImageComplete();t&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},a.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},a.prototype.confirm=function(t,e){this.isLoaded=t,this.emitEvent("progress",[this,this.element,e])},n.makeJQueryPlugin=function(e){e=e||t.jQuery,e&&(s=e,s.fn.imagesLoaded=function(t,e){var i=new n(this,t,e);return i.jqDeferred.promise(s(this))})},n.makeJQueryPlugin(),n}),function(t){t.fn.tipTip=function(e){var i={activation:"hover",keepAlive:!1,maxWidth:"200px",edgeOffset:6,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:!1,enter:function(){},afterEnter:function(){},exit:function(){},afterExit:function(){},cssClass:""};if(t("#tiptip_holder").length<=0){var o=t('<div id="tiptip_holder"></div>'),n=t('<div id="tiptip_content"></div>'),r=t('<div id="tiptip_arrow"></div>');t("body").append(o.html(n).prepend(r.html('<div id="tiptip_arrow_inner"></div>')))}else o=t("#tiptip_holder"),n=t("#tiptip_content"),r=t("#tiptip_arrow");return this.each(function(){function a(){var e;if(!1!==u.enter.call(l,d)&&(u.content?e=t.isFunction(u.content)?u.content.call(l,d):u.content:(e=u.content=l.attr(u.attribute),l.removeAttr(u.attribute)),e)){n.html(e),o.hide().removeAttr("class").css({margin:"0px","max-width":u.maxWidth}),u.cssClass&&o.addClass(u.cssClass),r.removeAttr("style");var i=parseInt(l.offset().top),a=parseInt(l.offset().left),s=parseInt(l.outerWidth()),c=parseInt(l.outerHeight()),f=o.outerWidth(),p=o.outerHeight(),g=Math.round((s-f)/2),m=Math.round((c-p)/2),b=Math.round(a+g),v=Math.round(i+c+u.edgeOffset),y="",w="",P=Math.round(f-12)/2;"bottom"==u.defaultPosition?y="_bottom":"top"==u.defaultPosition?y="_top":"left"==u.defaultPosition?y="_left":"right"==u.defaultPosition&&(y="_right");var $=g+a<parseInt(t(window).scrollLeft()),F=f+a>parseInt(t(window).width());$&&g<0||"_right"==y&&!F||"_left"==y&&a<f+u.edgeOffset+5?(y="_right",w=Math.round(p-13)/2,P=-12,b=Math.round(a+s+u.edgeOffset),v=Math.round(i+m)):(F&&g<0||"_left"==y&&!$)&&(y="_left",w=Math.round(p-13)/2,P=Math.round(f),b=Math.round(a-(f+u.edgeOffset+5)),v=Math.round(i+m));var x=i+c+u.edgeOffset+p+8>parseInt(t(window).height()+t(window).scrollTop()),_=i+c-(u.edgeOffset+p+8)<0;x||"_bottom"==y&&x||"_top"==y&&!_?("_top"==y||"_bottom"==y?y="_top":y+="_top",w=p,v=Math.round(i-(p+5+u.edgeOffset))):(_|("_top"==y&&_)||"_bottom"==y&&!x)&&("_top"==y||"_bottom"==y?y="_bottom":y+="_bottom",w=-12,v=Math.round(i+c+u.edgeOffset)),"_right_top"==y||"_left_top"==y?v+=5:"_right_bottom"!=y&&"_left_bottom"!=y||(v-=5),"_left_top"!=y&&"_left_bottom"!=y||(b+=5),r.css({"margin-left":P+"px","margin-top":w+"px"}),o.css({"margin-left":b+"px","margin-top":v+"px"}).addClass("tip"+y),h&&clearTimeout(h),h=setTimeout(function(){o.stop(!0,!0).fadeIn(u.fadeIn)},u.delay),u.afterEnter.call(l,d)}}function s(){!1!==u.exit.call(l,d)&&(h&&clearTimeout(h),o.fadeOut(u.fadeOut),u.afterExit.call(l,d))}var l=t(this),c=l.data("tipTip"),u=c&&c.options||t.extend(i,e),d={holder:o,content:n,arrow:r,options:u};if(c)switch(e){case"show":a();break;case"hide":s();break;case"destroy":l.unbind(".tipTip").removeData("tipTip")}else{var h=!1;l.data("tipTip",{options:u}),"hover"==u.activation?l.bind("mouseenter.tipTip",function(){a()}).bind("mouseleave.tipTip",function(){u.keepAlive?o.one("mouseleave.tipTip",function(){s()}):s()}):"focus"==u.activation?l.bind("focus.tipTip",function(){a()}).bind("blur.tipTip",function(){s()}):"click"==u.activation?l.bind("click.tipTip",function(t){return t.preventDefault(),a(),!1}).bind("mouseleave.tipTip",function(){u.keepAlive?o.one("mouseleave.tipTip",function(){s()}):s()}):u.activation}})}}(jQuery),function(t){function e(t,e){if(!(t.originalEvent.touches.length>1)){t.preventDefault();var i=t.originalEvent.changedTouches[0],o=document.createEvent("MouseEvents");o.initMouseEvent(e,!0,!0,window,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(o)}}if(t.support.touch="ontouchend"in document,t.support.touch){var i,o=t.ui.mouse.prototype,n=o._mouseInit;o._touchStart=function(t){var o=this;!i&&o._mouseCapture(t.originalEvent.changedTouches[0])&&(i=!0,o._touchMoved=!1,e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},o._touchMove=function(t){i&&(this._touchMoved=!0,e(t,"mousemove"))},o._touchEnd=function(t){i&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),i=!1)},o._mouseInit=function(){var e=this;e.element.bind("touchstart",t.proxy(e,"_touchStart")).bind("touchmove",t.proxy(e,"_touchMove")).bind("touchend",t.proxy(e,"_touchEnd")),n.call(e)}}}(jQuery),function(t){"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],t):t(jQuery)}(function(t){function e(e){return!e||void 0!==e.allowPageScroll||void 0===e.swipe&&void 0===e.swipeStatus||(e.allowPageScroll=c),void 0!==e.click&&void 0===e.tap&&(e.tap=e.click),e||(e={}),e=t.extend({},t.fn.swipe.defaults,e),this.each(function(){var o=t(this),n=o.data(_);n||(n=new i(this,e),o.data(_,n))})}function i(e,i){function j(e){if(!(st()||t(e.target).closest(i.excludedElements,Rt).length>0)){var o,n=e.originalEvent?e.originalEvent:e,r=x?n.touches[0]:n;return qt=w,x?Nt=n.touches.length:e.preventDefault(),Ht=0,Ot=null,Bt=null,At=0,Mt=0,Lt=0,Dt=1,Ut=0,Wt=ht(),zt=gt(),rt(),!x||Nt===i.fingers||i.fingers===v||z()?(ct(0,r),Qt=xt(),2==Nt&&(ct(1,n.touches[1]),Mt=Lt=vt(Wt[0].start,Wt[1].start)),(i.swipeStatus||i.pinchStatus)&&(o=H(n,qt))):o=!1,!1===o?(qt=F,H(n,qt),o):(lt(!0),null)}}function S(t){var e=t.originalEvent?t.originalEvent:t;if(qt!==$&&qt!==F&&!at()){var o,n=x?e.touches[0]:e,r=ut(n);if(Vt=xt(),x&&(Nt=e.touches.length),qt=P,2==Nt&&(0==Mt?(ct(1,e.touches[1]),Mt=Lt=vt(Wt[0].start,Wt[1].start)):(ut(e.touches[1]),Lt=vt(Wt[0].end,Wt[1].end),Bt=wt(Wt[0].end,Wt[1].end)),Dt=yt(Mt,Lt),Ut=Math.abs(Mt-Lt)),Nt===i.fingers||i.fingers===v||!x||z()){if(Ot=Ft(r.start,r.end),U(t,Ot),Ht=Pt(r.start,r.end),At=bt(),ft(Ot,Ht),(i.swipeStatus||i.pinchStatus)&&(o=H(e,qt)),!i.triggerOnTouchEnd||i.triggerOnTouchLeave){var a=!0;if(i.triggerOnTouchLeave){var s=_t(this);a=jt(r.end,s)}!i.triggerOnTouchEnd&&a?qt=E(P):i.triggerOnTouchLeave&&!a&&(qt=E($)),qt!=F&&qt!=$||H(e,qt)}}else qt=F,H(e,qt);!1===o&&(qt=F,H(e,qt))}}function k(t){var e=t.originalEvent;return x&&e.touches.length>0?(nt(),!0):(at()&&(Nt=Yt),t.preventDefault(),Vt=xt(),At=bt(),M()?(qt=F,H(e,qt)):i.triggerOnTouchEnd||0==i.triggerOnTouchEnd&&qt===P?(qt=$,H(e,qt)):!i.triggerOnTouchEnd&&G()?(qt=$,O(e,qt,f)):qt===P&&(qt=F,H(e,qt)),lt(!1),null)}function T(){Nt=0,Vt=0,Qt=0,Mt=0,Lt=0,Dt=1,rt(),lt(!1)}function C(t){var e=t.originalEvent;i.triggerOnTouchLeave&&(qt=E($),H(e,qt))}function I(){Rt.unbind(kt,j),Rt.unbind(Et,T),Rt.unbind(Tt,S),Rt.unbind(Ct,k),It&&Rt.unbind(It,C),lt(!1)}function E(t){var e=t,o=D(),n=A(),r=M();return!o||r?e=F:!n||t!=P||i.triggerOnTouchEnd&&!i.triggerOnTouchLeave?!n&&t==$&&i.triggerOnTouchLeave&&(e=F):e=$,e}function H(t,e){var i=void 0;return W()||N()?i=O(t,e,d):(R()||z())&&!1!==i&&(i=O(t,e,h)),it()&&!1!==i?i=O(t,e,p):ot()&&!1!==i?i=O(t,e,g):et()&&!1!==i&&(i=O(t,e,f)),e===F&&T(t),e===$&&(x?0==t.touches.length&&T(t):T(t)),i}function O(e,c,u){var m=void 0;if(u==d){if(Rt.trigger("swipeStatus",[c,Ot||null,Ht||0,At||0,Nt]),i.swipeStatus&&(m=i.swipeStatus.call(Rt,e,c,Ot||null,Ht||0,At||0,Nt),!1===m))return!1;if(c==$&&q()){if(Rt.trigger("swipe",[Ot,Ht,At,Nt]),i.swipe&&(m=i.swipe.call(Rt,e,Ot,Ht,At,Nt),!1===m))return!1;switch(Ot){case o:Rt.trigger("swipeLeft",[Ot,Ht,At,Nt]),i.swipeLeft&&(m=i.swipeLeft.call(Rt,e,Ot,Ht,At,Nt));break;case n:Rt.trigger("swipeRight",[Ot,Ht,At,Nt]),i.swipeRight&&(m=i.swipeRight.call(Rt,e,Ot,Ht,At,Nt));break;case r:Rt.trigger("swipeUp",[Ot,Ht,At,Nt]),i.swipeUp&&(m=i.swipeUp.call(Rt,e,Ot,Ht,At,Nt));break;case a:Rt.trigger("swipeDown",[Ot,Ht,At,Nt]),i.swipeDown&&(m=i.swipeDown.call(Rt,e,Ot,Ht,At,Nt))}}}if(u==h){if(Rt.trigger("pinchStatus",[c,Bt||null,Ut||0,At||0,Nt,Dt]),i.pinchStatus&&(m=i.pinchStatus.call(Rt,e,c,Bt||null,Ut||0,At||0,Nt,Dt),!1===m))return!1;if(c==$&&B())switch(Bt){case s:Rt.trigger("pinchIn",[Bt||null,Ut||0,At||0,Nt,Dt]),i.pinchIn&&(m=i.pinchIn.call(Rt,e,Bt||null,Ut||0,At||0,Nt,Dt));break;case l:Rt.trigger("pinchOut",[Bt||null,Ut||0,At||0,Nt,Dt]),i.pinchOut&&(m=i.pinchOut.call(Rt,e,Bt||null,Ut||0,At||0,Nt,Dt))}}return u==f?c!==F&&c!==$||(clearTimeout(Jt),Y()&&!Z()?(Xt=xt(),Jt=setTimeout(t.proxy(function(){Xt=null,Rt.trigger("tap",[e.target]),i.tap&&(m=i.tap.call(Rt,e,e.target))},this),i.doubleTapThreshold)):(Xt=null,Rt.trigger("tap",[e.target]),i.tap&&(m=i.tap.call(Rt,e,e.target)))):u==p?c!==F&&c!==$||(clearTimeout(Jt),Xt=null,Rt.trigger("doubletap",[e.target]),i.doubleTap&&(m=i.doubleTap.call(Rt,e,e.target))):u==g&&(c!==F&&c!==$||(clearTimeout(Jt),Xt=null,Rt.trigger("longtap",[e.target]),i.longTap&&(m=i.longTap.call(Rt,e,e.target)))),m}function A(){var t=!0;return null!==i.threshold&&(t=Ht>=i.threshold),t}function M(){var t=!1;return null!==i.cancelThreshold&&null!==Ot&&(t=pt(Ot)-Ht>=i.cancelThreshold),t}function L(){return null===i.pinchThreshold||Ut>=i.pinchThreshold}function D(){var t;return t=!i.maxTimeThreshold||!(At>=i.maxTimeThreshold),t}function U(t,e){if(i.allowPageScroll===c||z())t.preventDefault();else{var s=i.allowPageScroll===u;switch(e){case o:(i.swipeLeft&&s||!s&&i.allowPageScroll!=m)&&t.preventDefault();break;case n:(i.swipeRight&&s||!s&&i.allowPageScroll!=m)&&t.preventDefault();break;case r:(i.swipeUp&&s||!s&&i.allowPageScroll!=b)&&t.preventDefault();break;case a:(i.swipeDown&&s||!s&&i.allowPageScroll!=b)&&t.preventDefault()}}}function B(){var t=Q(),e=V(),i=L();return t&&e&&i}function z(){return!!(i.pinchStatus||i.pinchIn||i.pinchOut)}function R(){return!(!B()||!z())}function q(){var t=D(),e=A(),i=Q(),o=V(),n=M(),r=!n&&o&&i&&e&&t;return r}function N(){return!!(i.swipe||i.swipeStatus||i.swipeLeft||i.swipeRight||i.swipeUp||i.swipeDown)}function W(){return!(!q()||!N())}function Q(){return Nt===i.fingers||i.fingers===v||!x}function V(){return 0!==Wt[0].end.x}function G(){return!!i.tap}function Y(){return!!i.doubleTap}function X(){return!!i.longTap}function J(){if(null==Xt)return!1;var t=xt();return Y()&&t-Xt<=i.doubleTapThreshold}function Z(){return J()}function K(){return(1===Nt||!x)&&(isNaN(Ht)||0===Ht)}function tt(){return At>i.longTapThreshold&&Ht<y}function et(){return!(!K()||!G())}function it(){return!(!J()||!Y())}function ot(){return!(!tt()||!X())}function nt(){Gt=xt(),Yt=event.touches.length+1}function rt(){Gt=0,Yt=0}function at(){var t=!1;if(Gt){var e=xt()-Gt;e<=i.fingerReleaseThreshold&&(t=!0)}return t}function st(){return!(!0!==Rt.data(_+"_intouch"))}function lt(t){!0===t?(Rt.bind(Tt,S),Rt.bind(Ct,k),It&&Rt.bind(It,C)):(Rt.unbind(Tt,S,!1),Rt.unbind(Ct,k,!1),It&&Rt.unbind(It,C,!1)),Rt.data(_+"_intouch",!0===t)}function ct(t,e){var i=void 0!==e.identifier?e.identifier:0;return Wt[t].identifier=i,Wt[t].start.x=Wt[t].end.x=e.pageX||e.clientX,Wt[t].start.y=Wt[t].end.y=e.pageY||e.clientY,Wt[t]}function ut(t){var e=void 0!==t.identifier?t.identifier:0,i=dt(e);return i.end.x=t.pageX||t.clientX,i.end.y=t.pageY||t.clientY,i}function dt(t){for(var e=0;e<Wt.length;e++)if(Wt[e].identifier==t)return Wt[e]}function ht(){for(var t=[],e=0;e<=5;e++)t.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0});return t}function ft(t,e){e=Math.max(e,pt(t)),zt[t].distance=e}function pt(t){if(zt[t])return zt[t].distance}function gt(){var t={};return t[o]=mt(o),t[n]=mt(n),t[r]=mt(r),t[a]=mt(a),t}function mt(t){return{direction:t,distance:0}}function bt(){return Vt-Qt}function vt(t,e){var i=Math.abs(t.x-e.x),o=Math.abs(t.y-e.y);return Math.round(Math.sqrt(i*i+o*o))}function yt(t,e){var i=e/t*1;return i.toFixed(2)}function wt(){return Dt<1?l:s}function Pt(t,e){return Math.round(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)))}function $t(t,e){var i=t.x-e.x,o=e.y-t.y,n=Math.atan2(o,i),r=Math.round(180*n/Math.PI);return r<0&&(r=360-Math.abs(r)),r}function Ft(t,e){var i=$t(t,e);return i<=45&&i>=0?o:i<=360&&i>=315?o:i>=135&&i<=225?n:i>45&&i<135?a:r}function xt(){var t=new Date;return t.getTime()}function _t(e){e=t(e);var i=e.offset(),o={left:i.left,right:i.left+e.outerWidth(),top:i.top,bottom:i.top+e.outerHeight()};return o}function jt(t,e){return t.x>e.left&&t.x<e.right&&t.y>e.top&&t.y<e.bottom}var St=x||!i.fallbackToMouseEvents,kt=St?"touchstart":"mousedown",Tt=St?"touchmove":"mousemove",Ct=St?"touchend":"mouseup",It=St?null:"mouseleave",Et="touchcancel",Ht=0,Ot=null,At=0,Mt=0,Lt=0,Dt=1,Ut=0,Bt=0,zt=null,Rt=t(e),qt="start",Nt=0,Wt=null,Qt=0,Vt=0,Gt=0,Yt=0,Xt=0,Jt=null;try{Rt.bind(kt,j),Rt.bind(Et,T)}catch(e){t.error("events not supported "+kt+","+Et+" on jQuery.swipe")}this.enable=function(){return Rt.bind(kt,j),Rt.bind(Et,T),Rt},this.disable=function(){return I(),Rt},this.destroy=function(){return I(),Rt.data(_,null),Rt},this.option=function(e,o){if(void 0!==i[e]){if(void 0===o)return i[e];i[e]=o}else t.error("Option "+e+" does not exist on jQuery.swipe.options");return null}}var o="left",n="right",r="up",a="down",s="in",l="out",c="none",u="auto",d="swipe",h="pinch",f="tap",p="doubletap",g="longtap",m="horizontal",b="vertical",v="all",y=10,w="start",P="move",$="end",F="cancel",x="ontouchstart"in window,_="TouchSwipe",j={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,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe"};t.fn.swipe=function(i){var o=t(this),n=o.data(_);if(n&&"string"==typeof i){if(n[i])return n[i].apply(this,Array.prototype.slice.call(arguments,1));t.error("Method "+i+" does not exist on jQuery.swipe")}else if(!(n||"object"!=typeof i&&i))return e.apply(this,arguments);return o},t.fn.swipe.defaults=j,t.fn.swipe.phases={PHASE_START:w,PHASE_MOVE:P,PHASE_END:$,PHASE_CANCEL:F},t.fn.swipe.directions={LEFT:o,RIGHT:n,UP:r,DOWN:a,IN:s,OUT:l},t.fn.swipe.pageScroll={NONE:c,HORIZONTAL:m,VERTICAL:b,AUTO:u},t.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:v}}),function(t){"use strict";function e(t,i,o){var n,r=document.createElement("img");if(r.onerror=function(n){return e.onerror(r,n,t,i,o)},r.onload=function(n){return e.onload(r,n,t,i,o)},e.isInstanceOf("Blob",t)||e.isInstanceOf("File",t))n=r._objectURL=e.createObjectURL(t);else{if("string"!=typeof t)return!1;n=t,o&&o.crossOrigin&&(r.crossOrigin=o.crossOrigin)}return n?(r.src=n,r):e.readFile(t,function(t){var e=t.target;e&&e.result?r.src=e.result:i&&i(t)})}function i(t,i){!t._objectURL||i&&i.noRevoke||(e.revokeObjectURL(t._objectURL),delete t._objectURL)}var o=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;e.isInstanceOf=function(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"},e.transform=function(t,i,o,n,r){o(e.scale(t,i,r),r)},e.onerror=function(t,e,o,n,r){i(t,r),n&&n.call(t,e)},e.onload=function(t,o,n,r,a){i(t,a),r&&e.transform(t,a,r,n,{})},e.transformCoordinates=function(){},e.getTransformedOptions=function(t,e){var i,o,n,r,a=e.aspectRatio;if(!a)return e;for(o in i={},e)e.hasOwnProperty(o)&&(i[o]=e[o]);return i.crop=!0,n=t.naturalWidth||t.width,r=t.naturalHeight||t.height,n/r>a?(i.maxWidth=r*a,i.maxHeight=r):(i.maxWidth=n,i.maxHeight=n/a),i},e.renderImageToCanvas=function(t,e,i,o,n,r,a,s,l,c){return t.getContext("2d").drawImage(e,i,o,n,r,a,s,l,c),t},e.hasCanvasOption=function(t){return t.canvas||t.crop||!!t.aspectRatio},e.scale=function(t,i,o){function n(){var t=Math.max((l||P)/P,(c||$)/$);t>1&&(P*=t,$*=t)}function r(){var t=Math.min((a||P)/P,(s||$)/$);t<1&&(P*=t,$*=t)}i=i||{};var a,s,l,c,u,d,h,f,p,g,m,b=document.createElement("canvas"),v=t.getContext||e.hasCanvasOption(i)&&b.getContext,y=t.naturalWidth||t.width,w=t.naturalHeight||t.height,P=y,$=w;if(b.originalWidth=y,b.originalHeight=w,v&&(i=e.getTransformedOptions(t,i,o),h=i.left||0,f=i.top||0,i.sourceWidth?(u=i.sourceWidth,void 0!==i.right&&void 0===i.left&&(h=y-u-i.right)):u=y-h-(i.right||0),i.sourceHeight?(d=i.sourceHeight,void 0!==i.bottom&&void 0===i.top&&(f=w-d-i.bottom)):d=w-f-(i.bottom||0),P=u,$=d),a=i.maxWidth,s=i.maxHeight,l=i.minWidth,c=i.minHeight,v&&a&&s&&i.crop?(P=a,$=s,m=u/d-a/s,m<0?(d=s*u/a,void 0===i.top&&void 0===i.bottom&&(f=(w-d)/2)):m>0&&(u=a*d/s,void 0===i.left&&void 0===i.right&&(h=(y-u)/2))):((i.contain||i.cover)&&(l=a=a||l,c=s=s||c),i.cover?(r(),n()):(n(),r())),v){if(p=i.pixelRatio,p>1&&(b.style.width=P+"px",b.style.height=$+"px",P*=p,$*=p,b.getContext("2d").scale(p,p)),g=i.downsamplingRatio,g>0&&g<1&&P<u&&$<d)for(;u*g>P;)b.width=u*g,b.height=d*g,e.renderImageToCanvas(b,t,h,f,u,d,0,0,b.width,b.height),u=b.width,d=b.height,t=document.createElement("canvas"),t.width=u,t.height=d,e.renderImageToCanvas(t,b,0,0,u,d,0,0,u,d);return b.width=P,b.height=$,e.transformCoordinates(b,i),e.renderImageToCanvas(b,t,h,f,u,d,0,0,P,$)}return t.width=P,t.height=$,t},e.createObjectURL=function(t){return!!o&&o.createObjectURL(t)},e.revokeObjectURL=function(t){return!!o&&o.revokeObjectURL(t)},e.readFile=function(t,e,i){if(window.FileReader){var o=new FileReader;if(o.onload=o.onerror=e,i=i||"readAsDataURL",o[i])return o[i](t),o}return!1},"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=e:t.loadImage=e}(window),function(t){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],t):t("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)}(function(t){"use strict";var e=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);t.blobSlice=e&&function(){var t=this.slice||this.webkitSlice||this.mozSlice;return t.apply(this,arguments)},t.metaDataParsers={jpeg:{65505:[]}},t.parseMetaData=function(e,i,o,n){o=o||{},n=n||{};var r=this,a=o.maxMetaDataSize||262144,s=!(window.DataView&&e&&e.size>=12&&"image/jpeg"===e.type&&t.blobSlice);!s&&t.readFile(t.blobSlice.call(e,0,a),function(e){if(e.target.error)return console.log(e.target.error),void i(n);var a,s,l,c,u=e.target.result,d=new DataView(u),h=2,f=d.byteLength-4,p=h;if(65496===d.getUint16(0)){for(;h<f&&(a=d.getUint16(h),a>=65504&&a<=65519||65534===a);){if(s=d.getUint16(h+2)+2,h+s>d.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(l=t.metaDataParsers.jpeg[a])for(c=0;c<l.length;c+=1)l[c].call(r,d,h,s,n,o);h+=s,p=h}!o.disableImageHead&&p>6&&(u.slice?n.imageHead=u.slice(0,p):n.imageHead=new Uint8Array(u).subarray(0,p))}else console.log("Invalid JPEG file: Missing JPEG marker.");i(n)},"readAsArrayBuffer")||i(n)},t.hasMetaOption=function(t){return t.meta};var i=t.transform;t.transform=function(e,o,n,r,a){t.hasMetaOption(o||{})?t.parseMetaData(r,function(a){i.call(t,e,o,n,r,a)},o,a):i.apply(t,arguments)}}),function(t){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],t):"object"==typeof module&&module.exports?t(require("./load-image"),require("./load-image-meta")):t(window.loadImage)}(function(t){"use strict";t.ExifMap=function(){return this},t.ExifMap.prototype.map={Orientation:274},t.ExifMap.prototype.get=function(t){return this[t]||this[this.map[t]]},t.getExifThumbnail=function(t,e,i){var o,n,r;if(i&&!(e+i>t.byteLength)){for(o=[],n=0;n<i;n+=1)r=t.getUint8(e+n),
o.push((r<16?"0":"")+r.toString(16));return"data:image/jpeg,%"+o.join("%")}console.log("Invalid Exif data: Invalid thumbnail data.")},t.exifTagTypes={1:{getValue:function(t,e){return t.getUint8(e)},size:1},2:{getValue:function(t,e){return String.fromCharCode(t.getUint8(e))},size:1,ascii:!0},3:{getValue:function(t,e,i){return t.getUint16(e,i)},size:2},4:{getValue:function(t,e,i){return t.getUint32(e,i)},size:4},5:{getValue:function(t,e,i){return t.getUint32(e,i)/t.getUint32(e+4,i)},size:8},9:{getValue:function(t,e,i){return t.getInt32(e,i)},size:4},10:{getValue:function(t,e,i){return t.getInt32(e,i)/t.getInt32(e+4,i)},size:8}},t.exifTagTypes[7]=t.exifTagTypes[1],t.getExifValue=function(e,i,o,n,r,a){var s,l,c,u,d,h,f=t.exifTagTypes[n];if(f){if(s=f.size*r,l=s>4?i+e.getUint32(o+8,a):o+8,!(l+s>e.byteLength)){if(1===r)return f.getValue(e,l,a);for(c=[],u=0;u<r;u+=1)c[u]=f.getValue(e,l+u*f.size,a);if(f.ascii){for(d="",u=0;u<c.length&&(h=c[u],"\0"!==h);u+=1)d+=h;return d}return c}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")},t.parseExifTag=function(e,i,o,n,r){var a=e.getUint16(o,n);r.exif[a]=t.getExifValue(e,i,o,e.getUint16(o+2,n),e.getUint32(o+4,n),n)},t.parseExifTags=function(t,e,i,o,n){var r,a,s;if(i+6>t.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(r=t.getUint16(i,o),a=i+2+12*r,!(a+4>t.byteLength)){for(s=0;s<r;s+=1)this.parseExifTag(t,e,i+2+12*s,o,n);return t.getUint32(a,o)}console.log("Invalid Exif data: Invalid directory size.")}},t.parseExifData=function(e,i,o,n,r){if(!r.disableExif){var a,s,l,c=i+10;if(1165519206===e.getUint32(i+4)){if(c+8>e.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==e.getUint16(i+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(e.getUint16(c)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==e.getUint16(c+2,a))return void console.log("Invalid Exif data: Missing TIFF marker.");s=e.getUint32(c+4,a),n.exif=new t.ExifMap,s=t.parseExifTags(e,c,c+s,a,n),s&&!r.disableExifThumbnail&&(l={exif:{}},s=t.parseExifTags(e,c,c+s,a,l),l.exif[513]&&(n.exif.Thumbnail=t.getExifThumbnail(e,c+l.exif[513],l.exif[514]))),n.exif[34665]&&!r.disableExifSub&&t.parseExifTags(e,c,c+n.exif[34665],a,n),n.exif[34853]&&!r.disableExifGps&&t.parseExifTags(e,c,c+n.exif[34853],a,n)}}},t.metaDataParsers.jpeg[65505].push(t.parseExifData)}),function(t){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],t):"object"==typeof module&&module.exports?t(require("./load-image"),require("./load-image-exif")):t(window.loadImage)}(function(t){"use strict";t.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},t.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},t.ExifMap.prototype.getText=function(t){var e=this.get(t);switch(t){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[t][e];case"ExifVersion":case"FlashpixVersion":if(!e)return;return String.fromCharCode(e[0],e[1],e[2],e[3]);case"ComponentsConfiguration":if(!e)return;return this.stringValues[t][e[0]]+this.stringValues[t][e[1]]+this.stringValues[t][e[2]]+this.stringValues[t][e[3]];case"GPSVersionID":if(!e)return;return e[0]+"."+e[1]+"."+e[2]+"."+e[3]}return String(e)},function(t){var e,i=t.tags,o=t.map;for(e in i)i.hasOwnProperty(e)&&(o[i[e]]=e)}(t.ExifMap.prototype),t.ExifMap.prototype.getAll=function(){var t,e,i={};for(t in this)this.hasOwnProperty(t)&&(e=this.tags[t],e&&(i[e]=this.getText(e)));return i}}),function(t){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],t):t("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)}(function(t){"use strict";var e=t.hasCanvasOption,i=t.hasMetaOption,o=t.transformCoordinates,n=t.getTransformedOptions;t.hasCanvasOption=function(i){return!!i.orientation||e.call(t,i)},t.hasMetaOption=function(e){return!0===e.orientation||i.call(t,e)},t.transformCoordinates=function(e,i){o.call(t,e,i);var n=e.getContext("2d"),r=e.width,a=e.height,s=e.style.width,l=e.style.height,c=i.orientation;if(c&&!(c>8))switch(c>4&&(e.width=a,e.height=r,e.style.width=l,e.style.height=s),c){case 2:n.translate(r,0),n.scale(-1,1);break;case 3:n.translate(r,a),n.rotate(Math.PI);break;case 4:n.translate(0,a),n.scale(1,-1);break;case 5:n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:n.rotate(.5*Math.PI),n.translate(0,-a);break;case 7:n.rotate(.5*Math.PI),n.translate(r,-a),n.scale(-1,1);break;case 8:n.rotate(-.5*Math.PI),n.translate(-r,0)}},t.getTransformedOptions=function(e,i,o){var r,a,s=n.call(t,e,i),l=s.orientation;if(!0===l&&o&&o.exif&&(l=o.exif.get("Orientation")),!l||l>8||1===l)return s;for(a in r={},s)s.hasOwnProperty(a)&&(r[a]=s[a]);switch(r.orientation=l,l){case 2:r.left=s.right,r.right=s.left;break;case 3:r.left=s.right,r.top=s.bottom,r.right=s.left,r.bottom=s.top;break;case 4:r.top=s.bottom,r.bottom=s.top;break;case 5:r.left=s.top,r.top=s.left,r.right=s.bottom,r.bottom=s.right;break;case 6:r.left=s.top,r.top=s.right,r.right=s.bottom,r.bottom=s.left;break;case 7:r.left=s.bottom,r.top=s.right,r.right=s.top,r.bottom=s.left;break;case 8:r.left=s.bottom,r.top=s.left,r.right=s.top,r.bottom=s.right}return s.orientation>4&&(r.maxWidth=s.maxHeight,r.maxHeight=s.maxWidth,r.minWidth=s.minHeight,r.minHeight=s.minWidth,r.sourceWidth=s.sourceHeight,r.sourceHeight=s.sourceWidth),r}}),"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return t<10?"0"+t:t}function quote(t){return escapable.lastIndex=0,escapable.test(t)?'"'+t.replace(escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var i,o,n,r,a,s=gap,l=e[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof rep&&(l=rep.call(e,t,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(l)){for(r=l.length,i=0;i<r;i+=1)a[i]=str(i,l)||"null";return n=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,n}if(rep&&"object"==typeof rep)for(r=rep.length,i=0;i<r;i+=1)"string"==typeof rep[i]&&(o=rep[i],n=str(o,l),n&&a.push(quote(o)+(gap?": ":":")+n));else for(o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n=str(o,l),n&&a.push(quote(o)+(gap?": ":":")+n));return n=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,n}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(t){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(t){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(t,e,i){var o;if(gap="",indent="","number"==typeof i)for(o=0;o<i;o+=1)indent+=" ";else"string"==typeof i&&(indent=i);if(rep=e,!e||"function"==typeof e||"object"==typeof e&&"number"==typeof e.length)return str("",{"":t});throw new Error("JSON.stringify")}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var i,o,n=t[e];if(n&&"object"==typeof n)for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(o=walk(n,i),void 0!==o?n[i]=o:delete n[i]);return reviver.call(t,e,n)}var j;if(text=String(text),cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),function(t,e){"use strict";var i=t.History=t.History||{},o=t.jQuery;if(void 0!==i.Adapter)throw new Error("History.js Adapter has already been loaded...");i.Adapter={bind:function(t,e,i){o(t).bind(e,i)},trigger:function(t,e,i){o(t).trigger(e,i)},extractEventData:function(t,i,o){var n=i&&i.originalEvent&&i.originalEvent[t]||o&&o[t]||e;return n},onDomLoad:function(t){o(t)}},void 0!==i.init&&i.init()}(window),function(t,e){"use strict";var i=t.document,o=t.setTimeout||o,n=t.clearTimeout||n,r=t.setInterval||r,a=t.History=t.History||{};if(void 0!==a.initHtml4)throw new Error("History.js HTML4 Support has already been loaded...");a.initHtml4=function(){if(void 0!==a.initHtml4.initialized)return!1;a.initHtml4.initialized=!0,a.enabled=!0,a.savedHashes=[],a.isLastHash=function(t){var e,i=a.getHashByIndex();return e=t===i,e},a.isHashEqual=function(t,e){return t=encodeURIComponent(t).replace(/%25/g,"%"),e=encodeURIComponent(e).replace(/%25/g,"%"),t===e},a.saveHash=function(t){return!a.isLastHash(t)&&(a.savedHashes.push(t),!0)},a.getHashByIndex=function(t){var e=null;return e=void 0===t?a.savedHashes[a.savedHashes.length-1]:t<0?a.savedHashes[a.savedHashes.length+t]:a.savedHashes[t],e},a.discardedHashes={},a.discardedStates={},a.discardState=function(t,e,i){var o,n=a.getHashByState(t);return o={discardedState:t,backState:i,forwardState:e},a.discardedStates[n]=o,!0},a.discardHash=function(t,e,i){var o={discardedHash:t,backState:i,forwardState:e};return a.discardedHashes[t]=o,!0},a.discardedState=function(t){var e,i=a.getHashByState(t);return e=a.discardedStates[i]||!1,e},a.discardedHash=function(t){var e=a.discardedHashes[t]||!1;return e},a.recycleState=function(t){var e=a.getHashByState(t);return a.discardedState(t)&&delete a.discardedStates[e],!0},a.emulated.hashChange&&(a.hashChangeInit=function(){a.checkerFunction=null;var e,o,n,s,l="",c=Boolean(a.getHash());return a.isInternetExplorer()?(e="historyjs-iframe",o=i.createElement("iframe"),o.setAttribute("id",e),o.setAttribute("src","#"),o.style.display="none",i.body.appendChild(o),o.contentWindow.document.open(),o.contentWindow.document.close(),n="",s=!1,a.checkerFunction=function(){if(s)return!1;s=!0;var e=a.getHash(),i=a.getHash(o.contentWindow.document);return e!==l?(l=e,i!==e&&(n=i=e,o.contentWindow.document.open(),o.contentWindow.document.close(),o.contentWindow.document.location.hash=a.escapeHash(e)),a.Adapter.trigger(t,"hashchange")):i!==n&&(n=i,c&&""===i?a.back():a.setHash(i,!1)),s=!1,!0}):a.checkerFunction=function(){var e=a.getHash()||"";return e!==l&&(l=e,a.Adapter.trigger(t,"hashchange")),!0},a.intervalList.push(r(a.checkerFunction,a.options.hashChangeInterval)),!0},a.Adapter.onDomLoad(a.hashChangeInit)),a.emulated.pushState&&(a.onHashChange=function(e){var i,o=e&&e.newURL||a.getLocationHref(),n=a.getHashByUrl(o),r=null;return a.isLastHash(n)?(a.busy(!1),!1):(a.doubleCheckComplete(),a.saveHash(n),n&&a.isTraditionalAnchor(n)?(a.Adapter.trigger(t,"anchorchange"),a.busy(!1),!1):(r=a.extractState(a.getFullUrl(n||a.getLocationHref()),!0),a.isLastSavedState(r)?(a.busy(!1),!1):(a.getHashByState(r),i=a.discardedState(r),i?(a.getHashByIndex(-2)===a.getHashByState(i.forwardState)?a.back(!1):a.forward(!1),!1):(a.pushState(r.data,r.title,encodeURI(r.url),!1),!0))))},a.Adapter.bind(t,"hashchange",a.onHashChange),a.pushState=function(e,i,o,n){if(o=encodeURI(o).replace(/%25/g,"%"),a.getHashByUrl(o))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(!1!==n&&a.busy())return a.pushQueue({scope:a,callback:a.pushState,args:arguments,queue:n}),!1;a.busy(!0);var r=a.createStateObject(e,i,o),s=a.getHashByState(r),l=a.getState(!1),c=a.getHashByState(l),u=a.getHash(),d=a.expectedStateId==r.id;return a.storeState(r),a.expectedStateId=r.id,a.recycleState(r),a.setTitle(r),s===c?(a.busy(!1),!1):(a.saveState(r),d||a.Adapter.trigger(t,"statechange"),!a.isHashEqual(s,u)&&!a.isHashEqual(s,a.getShortUrl(a.getLocationHref()))&&a.setHash(s,!1),a.busy(!1),!0)},a.replaceState=function(e,i,o,n){if(o=encodeURI(o).replace(/%25/g,"%"),a.getHashByUrl(o))throw new Error("History.js does not support states with fragment-identifiers (hashes/anchors).");if(!1!==n&&a.busy())return a.pushQueue({scope:a,callback:a.replaceState,args:arguments,queue:n}),!1;a.busy(!0);var r=a.createStateObject(e,i,o),s=a.getHashByState(r),l=a.getState(!1),c=a.getHashByState(l),u=a.getStateByIndex(-2);return a.discardState(l,r,u),s===c?(a.storeState(r),a.expectedStateId=r.id,a.recycleState(r),a.setTitle(r),a.saveState(r),a.Adapter.trigger(t,"statechange"),a.busy(!1)):a.pushState(r.data,r.title,r.url,!1),!0}),a.emulated.pushState&&a.getHash()&&!a.emulated.hashChange&&a.Adapter.onDomLoad(function(){a.Adapter.trigger(t,"hashchange")})},void 0!==a.init&&a.init()}(window),function(t,e){"use strict";var i=t.console||e,o=t.document,n=t.navigator,r=!1,a=t.setTimeout,s=t.clearTimeout,l=t.setInterval,c=t.clearInterval,u=t.JSON,d=t.alert,h=t.History=t.History||{},f=t.history;try{r=t.sessionStorage,r.setItem("TEST","1"),r.removeItem("TEST")}catch(t){r=!1}if(u.stringify=u.stringify||u.encode,u.parse=u.parse||u.decode,void 0!==h.init)throw new Error("History.js Core has already been loaded...");h.init=function(t){return void 0!==h.Adapter&&(void 0!==h.initCore&&h.initCore(),void 0!==h.initHtml4&&h.initHtml4(),!0)},h.initCore=function(p){if(void 0!==h.initCore.initialized)return!1;if(h.initCore.initialized=!0,h.options=h.options||{},h.options.hashChangeInterval=h.options.hashChangeInterval||100,h.options.safariPollInterval=h.options.safariPollInterval||500,h.options.doubleCheckInterval=h.options.doubleCheckInterval||500,h.options.disableSuid=h.options.disableSuid||!1,h.options.storeInterval=h.options.storeInterval||1e3,h.options.busyDelay=h.options.busyDelay||250,h.options.debug=h.options.debug||!1,h.options.initialTitle=h.options.initialTitle||o.title,h.options.html4Mode=h.options.html4Mode||!1,h.options.delayInit=h.options.delayInit||!1,h.intervalList=[],h.clearAllIntervals=function(){var t,e=h.intervalList;if(null!=e){for(t=0;t<e.length;t++)c(e[t]);h.intervalList=null}},h.debug=function(){h.options.debug&&h.log.apply(h,arguments)},h.log=function(){var t,e,n,r,a,s=void 0!==i&&void 0!==i.log&&void 0!==i.log.apply,l=o.getElementById("log");for(s?(r=Array.prototype.slice.call(arguments),t=r.shift(),void 0!==i.debug?i.debug.apply(i,[t,r]):i.log.apply(i,[t,r])):t="\n"+arguments[0]+"\n",e=1,n=arguments.length;e<n;++e){if(a=arguments[e],"object"==typeof a&&void 0!==u)try{a=u.stringify(a)}catch(t){}t+="\n"+a+"\n"}return l?(l.value+=t+"\n-----\n",l.scrollTop=l.scrollHeight-l.clientHeight):s||d(t),!0},h.getInternetExplorerMajorVersion=function(){var t=h.getInternetExplorerMajorVersion.cached=void 0!==h.getInternetExplorerMajorVersion.cached?h.getInternetExplorerMajorVersion.cached:function(){for(var t=3,e=o.createElement("div"),i=e.getElementsByTagName("i");(e.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->")&&i[0];);return t>4&&t}();return t},h.isInternetExplorer=function(){var t=h.isInternetExplorer.cached=void 0!==h.isInternetExplorer.cached?h.isInternetExplorer.cached:Boolean(h.getInternetExplorerMajorVersion());return t},h.options.html4Mode?h.emulated={pushState:!0,hashChange:!0}:h.emulated={pushState:!Boolean(t.history&&t.history.pushState&&t.history.replaceState&&!/ Mobile\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))/i.test(n.userAgent)&&!/AppleWebKit\/5([0-2]|3[0-2])/i.test(n.userAgent)),hashChange:Boolean(!("onhashchange"in t||"onhashchange"in o)||h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8)},h.enabled=!h.emulated.pushState,h.bugs={setHash:Boolean(!h.emulated.pushState&&"Apple Computer, Inc."===n.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(n.userAgent)),safariPoll:Boolean(!h.emulated.pushState&&"Apple Computer, Inc."===n.vendor&&/AppleWebKit\/5([0-2]|3[0-3])/.test(n.userAgent)),ieDoubleCheck:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<8),hashEscape:Boolean(h.isInternetExplorer()&&h.getInternetExplorerMajorVersion()<7)},h.isEmptyObject=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},h.cloneObject=function(t){var e,i;return t?(e=u.stringify(t),i=u.parse(e)):i={},i},h.getRootUrl=function(){var t=o.location.protocol+"//"+(o.location.hostname||o.location.host);return o.location.port&&(t+=":"+o.location.port),t+="/",t},h.getBaseHref=function(){var t=o.getElementsByTagName("base"),e=null,i="";return 1===t.length&&(e=t[0],i=e.href.replace(/[^\/]+$/,"")),i=i.replace(/\/+$/,""),i&&(i+="/"),i},h.getBaseUrl=function(){var t=h.getBaseHref()||h.getBasePageUrl()||h.getRootUrl();return t},h.getPageUrl=function(){var t,e=h.getState(!1,!1),i=(e||{}).url||h.getLocationHref();return t=i.replace(/\/+$/,"").replace(/[^\/]+$/,function(t,e,i){return/\./.test(t)?t:t+"/"}),t},h.getBasePageUrl=function(){var t=h.getLocationHref().replace(/[#\?].*/,"").replace(/[^\/]+$/,function(t,e,i){return/[^\/]$/.test(t)?"":t}).replace(/\/+$/,"")+"/";return t},h.getFullUrl=function(t,e){var i=t,o=t.substring(0,1);return e=void 0===e||e,/[a-z]+\:\/\//.test(t)||(i="/"===o?h.getRootUrl()+t.replace(/^\/+/,""):"#"===o?h.getPageUrl().replace(/#.*/,"")+t:"?"===o?h.getPageUrl().replace(/[\?#].*/,"")+t:e?h.getBaseUrl()+t.replace(/^(\.\/)+/,""):h.getBasePageUrl()+t.replace(/^(\.\/)+/,"")),i.replace(/\#$/,"")},h.getShortUrl=function(t){var e=t,i=h.getBaseUrl(),o=h.getRootUrl();return h.emulated.pushState&&(e=e.replace(i,"")),e=e.replace(o,"/"),h.isTraditionalAnchor(e)&&(e="./"+e),e=e.replace(/^(\.\/)+/g,"./").replace(/\#$/,""),e},h.getLocationHref=function(t){return t=t||o,t.URL===t.location.href?t.location.href:t.location.href===decodeURIComponent(t.URL)?t.URL:t.location.hash&&decodeURIComponent(t.location.href.replace(/^[^#]+/,""))===t.location.hash?t.location.href:-1==t.URL.indexOf("#")&&-1!=t.location.href.indexOf("#")?t.location.href:t.URL||t.location.href},h.store={},h.idToState=h.idToState||{},h.stateToId=h.stateToId||{},h.urlToId=h.urlToId||{},h.storedStates=h.storedStates||[],h.savedStates=h.savedStates||[],h.normalizeStore=function(){h.store.idToState=h.store.idToState||{},h.store.urlToId=h.store.urlToId||{},h.store.stateToId=h.store.stateToId||{}},h.getState=function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!0);var i=h.getLastSavedState();return!i&&e&&(i=h.createStateObject()),t&&(i=h.cloneObject(i),i.url=i.cleanUrl||i.url),i},h.getIdByState=function(t){var e,i=h.extractId(t.url);if(!i)if(e=h.getStateString(t),void 0!==h.stateToId[e])i=h.stateToId[e];else if(void 0!==h.store.stateToId[e])i=h.store.stateToId[e];else{for(;i=(new Date).getTime()+String(Math.random()).replace(/\D/g,""),void 0!==h.idToState[i]||void 0!==h.store.idToState[i];);h.stateToId[e]=i,h.idToState[i]=t}return i},h.normalizeState=function(t){var e,i;return t&&"object"==typeof t||(t={}),void 0!==t.normalized?t:(t.data&&"object"==typeof t.data||(t.data={}),e={},e.normalized=!0,e.title=t.title||"",e.url=h.getFullUrl(t.url?t.url:h.getLocationHref()),e.hash=h.getShortUrl(e.url),e.data=h.cloneObject(t.data),e.id=h.getIdByState(e),e.cleanUrl=e.url.replace(/\??\&_suid.*/,""),e.url=e.cleanUrl,i=!h.isEmptyObject(e.data),(e.title||i)&&!0!==h.options.disableSuid&&(e.hash=h.getShortUrl(e.url).replace(/\??\&_suid.*/,""),/\?/.test(e.hash)||(e.hash+="?"),e.hash+="&_suid="+e.id),e.hashedUrl=h.getFullUrl(e.hash),(h.emulated.pushState||h.bugs.safariPoll)&&h.hasUrlDuplicate(e)&&(e.url=e.hashedUrl),e)},h.createStateObject=function(t,e,i){var o={data:t,title:e,url:i};return o=h.normalizeState(o),o},h.getStateById=function(t){t=String(t);var i=h.idToState[t]||h.store.idToState[t]||e;return i},h.getStateString=function(t){var e,i,o;return e=h.normalizeState(t),i={data:e.data,title:t.title,url:t.url},o=u.stringify(i),o},h.getStateId=function(t){var e,i;return e=h.normalizeState(t),i=e.id,i},h.getHashByState=function(t){var e,i;return e=h.normalizeState(t),i=e.hash,i},h.extractId=function(t){var e,i,o;return o=-1!=t.indexOf("#")?t.split("#")[0]:t,i=/(.*)\&_suid=([0-9]+)$/.exec(o),i&&i[1]||t,e=i?String(i[2]||""):"",e||!1},h.isTraditionalAnchor=function(t){var e=!/[\/\?\.]/.test(t);return e},h.extractState=function(t,e){var i,o,n=null;return e=e||!1,i=h.extractId(t),i&&(n=h.getStateById(i)),n||(o=h.getFullUrl(t),i=h.getIdByUrl(o)||!1,i&&(n=h.getStateById(i)),!n&&e&&!h.isTraditionalAnchor(t)&&(n=h.createStateObject(null,null,o))),n},h.getIdByUrl=function(t){var i=h.urlToId[t]||h.store.urlToId[t]||e;return i},h.getLastSavedState=function(){return h.savedStates[h.savedStates.length-1]||e},h.getLastStoredState=function(){return h.storedStates[h.storedStates.length-1]||e},h.hasUrlDuplicate=function(t){var e,i=!1;return e=h.extractState(t.url),i=e&&e.id!==t.id,i},h.storeState=function(t){return h.urlToId[t.url]=t.id,h.storedStates.push(h.cloneObject(t)),t},h.isLastSavedState=function(t){var e,i,o,n=!1;return h.savedStates.length&&(e=t.id,i=h.getLastSavedState(),o=i.id,n=e===o),n},h.saveState=function(t){return!h.isLastSavedState(t)&&(h.savedStates.push(h.cloneObject(t)),!0)},h.getStateByIndex=function(t){var e=null;return e=void 0===t?h.savedStates[h.savedStates.length-1]:t<0?h.savedStates[h.savedStates.length+t]:h.savedStates[t],e},h.getCurrentIndex=function(){var t=null;return t=h.savedStates.length<1?0:h.savedStates.length-1,t},h.getHash=function(t){var e,i=h.getLocationHref(t);return e=h.getHashByUrl(i),e},h.unescapeHash=function(t){var e=h.normalizeHash(t);return e=decodeURIComponent(e),e},h.normalizeHash=function(t){var e=t.replace(/[^#]*#/,"").replace(/#.*/,"");return e},h.setHash=function(t,e){var i,n;return!1!==e&&h.busy()?(h.pushQueue({scope:h,callback:h.setHash,args:arguments,queue:e}),!1):(h.busy(!0),i=h.extractState(t,!0),i&&!h.emulated.pushState?h.pushState(i.data,i.title,i.url,!1):h.getHash()!==t&&(h.bugs.setHash?(n=h.getPageUrl(),h.pushState(null,null,n+"#"+t,!1)):o.location.hash=t),h)},h.escapeHash=function(e){var i=h.normalizeHash(e);return i=t.encodeURIComponent(i),h.bugs.hashEscape||(i=i.replace(/\%21/g,"!").replace(/\%26/g,"&").replace(/\%3D/g,"=").replace(/\%3F/g,"?")),i},h.getHashByUrl=function(t){var e=String(t).replace(/([^#]*)#?([^#]*)#?(.*)/,"$2");return e=h.unescapeHash(e),e},h.setTitle=function(t){var e,i=t.title;i||(e=h.getStateByIndex(0),e&&e.url===t.url&&(i=e.title||h.options.initialTitle));try{o.getElementsByTagName("title")[0].innerHTML=i.replace("<","&lt;").replace(">","&gt;").replace(" & "," &amp; ")}catch(t){}return o.title=i,h},h.queues=[],h.busy=function(t){if(void 0!==t?h.busy.flag=t:void 0===h.busy.flag&&(h.busy.flag=!1),!h.busy.flag){s(h.busy.timeout);var e=function(){var t,i,o;if(!h.busy.flag)for(t=h.queues.length-1;t>=0;--t)i=h.queues[t],0!==i.length&&(o=i.shift(),h.fireQueueItem(o),h.busy.timeout=a(e,h.options.busyDelay))};h.busy.timeout=a(e,h.options.busyDelay)}return h.busy.flag},h.busy.flag=!1,h.fireQueueItem=function(t){return t.callback.apply(t.scope||h,t.args||[])},h.pushQueue=function(t){return h.queues[t.queue||0]=h.queues[t.queue||0]||[],h.queues[t.queue||0].push(t),h},h.queue=function(t,e){return"function"==typeof t&&(t={callback:t}),void 0!==e&&(t.queue=e),h.busy()?h.pushQueue(t):h.fireQueueItem(t),h},h.clearQueue=function(){return h.busy.flag=!1,h.queues=[],h},h.stateChanged=!1,h.doubleChecker=!1,h.doubleCheckComplete=function(){return h.stateChanged=!0,h.doubleCheckClear(),h},h.doubleCheckClear=function(){return h.doubleChecker&&(s(h.doubleChecker),h.doubleChecker=!1),h},h.doubleCheck=function(t){return h.stateChanged=!1,h.doubleCheckClear(),h.bugs.ieDoubleCheck&&(h.doubleChecker=a(function(){return h.doubleCheckClear(),h.stateChanged||t(),!0},h.options.doubleCheckInterval)),h},h.safariStatePoll=function(){var e,i=h.extractState(h.getLocationHref());if(!h.isLastSavedState(i))return e=i,e||(e=h.createStateObject()),h.Adapter.trigger(t,"popstate"),h},h.back=function(t){return!1!==t&&h.busy()?(h.pushQueue({scope:h,callback:h.back,args:arguments,queue:t}),!1):(h.busy(!0),h.doubleCheck(function(){h.back(!1)}),f.go(-1),!0)},h.forward=function(t){return!1!==t&&h.busy()?(h.pushQueue({scope:h,callback:h.forward,args:arguments,queue:t}),!1):(h.busy(!0),h.doubleCheck(function(){h.forward(!1)}),f.go(1),!0)},h.go=function(t,e){var i;if(t>0)for(i=1;i<=t;++i)h.forward(e);else{if(!(t<0))throw new Error("History.go: History.go requires a positive or negative integer passed.");for(i=-1;i>=t;--i)h.back(e)}return h},h.emulated.pushState){var g=function(){};h.pushState=h.pushState||g,h.replaceState=h.replaceState||g}else h.onPopState=function(e,i){var o,n,r=!1,a=!1;return h.doubleCheckComplete(),o=h.getHash(),o?(n=h.extractState(o||h.getLocationHref(),!0),n?h.replaceState(n.data,n.title,n.url,!1):(h.Adapter.trigger(t,"anchorchange"),h.busy(!1)),h.expectedStateId=!1,!1):(r=h.Adapter.extractEventData("state",e,i)||!1,a=r?h.getStateById(r):h.expectedStateId?h.getStateById(h.expectedStateId):h.extractState(h.getLocationHref()),a||(a=h.createStateObject(null,null,h.getLocationHref())),h.expectedStateId=!1,h.isLastSavedState(a)?(h.busy(!1),!1):(h.storeState(a),h.saveState(a),h.setTitle(a),h.Adapter.trigger(t,"statechange"),h.busy(!1),!0))},h.Adapter.bind(t,"popstate",h.onPopState),h.pushState=function(e,i,o,n){if(h.getHashByUrl(o)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(!1!==n&&h.busy())return h.pushQueue({scope:h,callback:h.pushState,args:arguments,queue:n}),!1;h.busy(!0);var r=h.createStateObject(e,i,o);return h.isLastSavedState(r)?h.busy(!1):(h.storeState(r),h.expectedStateId=r.id,
f.pushState(r.id,r.title,r.url),h.Adapter.trigger(t,"popstate")),!0},h.replaceState=function(e,i,o,n){if(h.getHashByUrl(o)&&h.emulated.pushState)throw new Error("History.js does not support states with fragement-identifiers (hashes/anchors).");if(!1!==n&&h.busy())return h.pushQueue({scope:h,callback:h.replaceState,args:arguments,queue:n}),!1;h.busy(!0);var r=h.createStateObject(e,i,o);return h.isLastSavedState(r)?h.busy(!1):(h.storeState(r),h.expectedStateId=r.id,f.replaceState(r.id,r.title,r.url),h.Adapter.trigger(t,"popstate")),!0};if(r){try{h.store=u.parse(r.getItem("History.store"))||{}}catch(t){h.store={}}h.normalizeStore()}else h.store={},h.normalizeStore();h.Adapter.bind(t,"unload",h.clearAllIntervals),h.saveState(h.storeState(h.extractState(h.getLocationHref(),!0))),r&&(h.onUnload=function(){var t,e,i;try{t=u.parse(r.getItem("History.store"))||{}}catch(e){t={}}for(e in t.idToState=t.idToState||{},t.urlToId=t.urlToId||{},t.stateToId=t.stateToId||{},h.idToState)h.idToState.hasOwnProperty(e)&&(t.idToState[e]=h.idToState[e]);for(e in h.urlToId)h.urlToId.hasOwnProperty(e)&&(t.urlToId[e]=h.urlToId[e]);for(e in h.stateToId)h.stateToId.hasOwnProperty(e)&&(t.stateToId[e]=h.stateToId[e]);h.store=t,h.normalizeStore(),i=u.stringify(t);try{r.setItem("History.store",i)}catch(t){if(t.code!==DOMException.QUOTA_EXCEEDED_ERR)throw t;r.length&&(r.removeItem("History.store"),r.setItem("History.store",i))}},h.intervalList.push(l(h.onUnload,h.options.storeInterval)),h.Adapter.bind(t,"beforeunload",h.onUnload),h.Adapter.bind(t,"unload",h.onUnload)),h.emulated.pushState||(h.bugs.safariPoll&&h.intervalList.push(l(h.safariStatePoll,h.options.safariPollInterval)),"Apple Computer, Inc."!==n.vendor&&"Mozilla"!==(n.appCodeName||"")||(h.Adapter.bind(t,"hashchange",function(){h.Adapter.trigger(t,"popstate")}),h.getHash()&&h.Adapter.onDomLoad(function(){h.Adapter.trigger(t,"hashchange")})))},(!h.options||!h.options.delayInit)&&h.init()}(window),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(window.jQuery)}(function(t){var e=0;t.ajaxTransport("iframe",function(i){var o,n,r;if(i.async)return{send:function(a,s){o=t('<form style="display:none;"></form>'),o.attr("accept-charset",i.formAcceptCharset),r=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+r+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+r+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+r+"_method=PATCH",i.type="POST"),e+=1,n=t('<iframe src="javascript:false;" name="iframe-transport-'+e+'"></iframe>').bind("load",function(){var e,r=t.isArray(i.paramName)?i.paramName:[i.paramName];n.unbind("load").bind("load",function(){var e;try{if(e=n.contents(),!e.length||!e[0].firstChild)throw new Error}catch(t){e=void 0}s(200,"success",{iframe:e}),t('<iframe src="javascript:false;"></iframe>').appendTo(o),window.setTimeout(function(){o.remove()},0)}),o.prop("target",n.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&t.each(i.formData,function(e,i){t('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(o)}),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(e=i.fileInput.clone(),i.fileInput.after(function(t){return e[t]}),i.paramName&&i.fileInput.each(function(e){t(this).prop("name",r[e]||i.paramName)}),o.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data")),o.submit(),e&&e.length&&i.fileInput.each(function(i,o){var n=t(e[i]);t(o).prop("name",n.prop("name")),n.replaceWith(o)})}),o.append(n).appendTo(document.body)},abort:function(){n&&n.unbind("load").prop("src","javascript".concat(":false;")),o&&o.remove()}}}),t.ajaxSetup({converters:{"iframe text":function(e){return e&&t(e[0].body).text()},"iframe json":function(e){return e&&t.parseJSON(t(e[0].body).text())},"iframe html":function(e){return e&&t(e[0].body).html()},"iframe xml":function(e){var i=e&&e[0];return i&&t.isXMLDoc(i)?i:t.parseXML(i.XMLDocument&&i.XMLDocument.xml||t(i.body).html())},"iframe script":function(e){return e&&t.globalEval(t(e[0].body).text())}}})}),function(t,e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Spinner=e()}(this,function(){function t(t,e){var i,o=document.createElement(t||"div");for(i in e)o[i]=e[i];return o}function e(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t}function i(t,e,i,o){var n=["opacity",e,~~(100*t),i,o].join("-"),r=.01+i/o*100,a=Math.max(1-(1-t)/e*(100-r),t),s=u.substring(0,u.indexOf("Animation")).toLowerCase(),l=s&&"-"+s+"-"||"";return f[n]||(p.insertRule("@"+l+"keyframes "+n+"{0%{opacity:"+a+"}"+r+"%{opacity:"+t+"}"+(r+.01)+"%{opacity:1}"+(r+e)%100+"%{opacity:"+t+"}100%{opacity:"+a+"}}",p.cssRules.length),f[n]=1),n}function o(t,e){var i,o,n=t.style;for(e=e.charAt(0).toUpperCase()+e.slice(1),o=0;o<h.length;o++)if(i=h[o]+e,void 0!==n[i])return i;if(void 0!==n[e])return e}function n(t,e){for(var i in e)t.style[o(t,i)||i]=e[i];return t}function r(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var o in i)void 0===t[o]&&(t[o]=i[o])}return t}function a(t){for(var e={x:t.offsetLeft,y:t.offsetTop};t=t.offsetParent;)e.x+=t.offsetLeft,e.y+=t.offsetTop;return e}function s(t,e){return"string"==typeof t?t:t[e%t.length]}function l(t){if(void 0===this)return new l(t);this.opts=r(t||{},l.defaults,g)}function c(){function i(e,i){return t("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',i)}p.addRule(".spin-vml","behavior:url(#default#VML)"),l.prototype.lines=function(t,o){function r(){return n(i("group",{coordsize:u+" "+u,coordorigin:-c+" "+-c}),{width:u,height:u})}function a(t,a,l){e(h,e(n(r(),{rotation:360/o.lines*t+"deg",left:~~a}),e(n(i("roundrect",{arcsize:o.corners}),{width:c,height:o.width,left:o.radius,top:-o.width>>1,filter:l}),i("fill",{color:s(o.color,t),opacity:o.opacity}),i("stroke",{opacity:0}))))}var l,c=o.length+o.width,u=2*c,d=2*-(o.width+o.length)+"px",h=n(r(),{position:"absolute",top:d,left:d});if(o.shadow)for(l=1;l<=o.lines;l++)a(l,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(l=1;l<=o.lines;l++)a(l);return e(t,h)},l.prototype.opacity=function(t,e,i,o){var n=t.firstChild;o=o.shadow&&o.lines||0,n&&e+o<n.childNodes.length&&(n=n.childNodes[e+o],n=n&&n.firstChild,n=n&&n.firstChild,n&&(n.opacity=i))}}var u,d,h=["webkit","Moz","ms","O"],f={},p=(d=t("style",{type:"text/css"}),e(document.getElementsByTagName("head")[0],d),d.sheet||d.styleSheet),g={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:"auto",className:"spinner",top:"auto",left:"auto",position:"relative"};l.defaults={},r(l.prototype,{spin:function(e){this.stop();var i,o,r=this,s=r.opts,l=r.el=n(t(0,{className:s.className}),{position:s.position,width:0,zIndex:s.zIndex}),c=s.radius+s.length+s.width;if(e&&(e.insertBefore(l,e.firstChild||null),o=a(e),i=a(l),n(l,{left:("auto"==s.left?o.x-i.x+(e.offsetWidth>>1):parseInt(s.left,10)+c)+"px",top:("auto"==s.top?o.y-i.y+(e.offsetHeight>>1):parseInt(s.top,10)+c)+"px"})),l.setAttribute("role","progressbar"),r.lines(l,r.opts),!u){var d,h=0,f=(s.lines-1)*(1-s.direction)/2,p=s.fps,g=p/s.speed,m=(1-s.opacity)/(g*s.trail/100),b=g/s.lines;(function t(){h++;for(var e=0;e<s.lines;e++)d=Math.max(1-(h+(s.lines-e)*b)%g*m,s.opacity),r.opacity(l,e*s.direction+f,d,s);r.timeout=r.el&&setTimeout(t,~~(1e3/p))})()}return r},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=void 0),this},lines:function(o,r){function a(e,i){return n(t(),{position:"absolute",width:r.length+r.width+"px",height:r.width+"px",background:e,boxShadow:i,transformOrigin:"left",transform:"rotate("+~~(360/r.lines*c+r.rotate)+"deg) translate("+r.radius+"px,0)",borderRadius:(r.corners*r.width>>1)+"px"})}for(var l,c=0,d=(r.lines-1)*(1-r.direction)/2;c<r.lines;c++)l=n(t(),{position:"absolute",top:1+~(r.width/2)+"px",transform:r.hwaccel?"translate3d(0,0,0)":"",opacity:r.opacity,animation:u&&i(r.opacity,r.trail,d+c*r.direction,r.lines)+" "+1/r.speed+"s linear infinite"}),r.shadow&&e(l,n(a("rgba(0,0,0,.25)","0 0 4px rgba(0,0,0,.5)"),{top:"2px"})),e(o,e(l,a(s(r.color,c),"0 0 1px rgba(0,0,0,.1)")));return o},opacity:function(t,e,i){e<t.childNodes.length&&(t.childNodes[e].style.opacity=i)}});var m=n(t("group"),{behavior:"url(#default#VML)"});return!o(m,"transform")&&m.adj?c():u=o(m,"animation"),l}),function(t){if("object"==typeof exports)t(require("jquery"),require("spin"));else if("function"==typeof define&&define.amd)define(["jquery","spin"],t);else{if(!window.Spinner)throw new Error("Spin.js not present");t(window.jQuery,window.Spinner)}}(function(t,e){t.fn.spin=function(i,o){return this.each(function(){var n=t(this),r=n.data();r.spinner&&(r.spinner.stop(),delete r.spinner),!1!==i&&(i=t.extend({color:o||n.css("color")},t.fn.spin.presets[i]||i),r.spinner=new e(i).spin(this))})},t.fn.spin.presets={tiny:{lines:8,length:2,width:2,radius:3},small:{lines:8,length:4,width:3,radius:5},large:{lines:10,length:8,width:4,radius:8}}}),function(t){t.fn.hasScrollBar=function(){var t={},e=this.get(0);return t.vertical=e.scrollHeight>e.clientHeight,t.horizontal=e.scrollWidth>e.clientWidth,t}}(jQuery),function(t){function e(e,i){this.el=t(e),this.options=i||{},this.x=!1!==this.options.x||this.options.forceHorizontal,this.y=!1!==this.options.y||this.options.forceVertical,this.autoHide=!1!==this.options.autoHide,this.padding=null==this.options.padding?2:this.options.padding,this.inner=this.el.find(".antiscroll-inner"),this.inner.css({width:"+="+(this.y?n():0),height:"+="+(this.x?n():0)}),this.refresh()}function i(e){this.pane=e,this.pane.el.append(this.el),this.innerEl=this.pane.inner.get(0),this.dragging=!1,this.enter=!1,this.shown=!1,this.pane.el.mouseenter(t.proxy(this,"mouseenter")),this.pane.el.mouseleave(t.proxy(this,"mouseleave")),this.el.mousedown(t.proxy(this,"mousedown")),this.innerPaneScrollListener=t.proxy(this,"scroll"),this.pane.inner.scroll(this.innerPaneScrollListener),this.innerPaneMouseWheelListener=t.proxy(this,"mousewheel"),this.pane.inner.bind("mousewheel",this.innerPaneMouseWheelListener);var i=this.pane.options.initialDisplay;!1!==i&&(this.show(),this.pane.autoHide&&(this.hiding=setTimeout(t.proxy(this,"hide"),parseInt(i,10)||3e3)))}function o(t,e){function i(){}i.prototype=e.prototype,t.prototype=new i}function n(){if(void 0===r){var e=t('<div class="antiscroll-inner" style="width:50px;height:50px;overflow-y:scroll;position:absolute;top:-200px;left:-200px;"><div style="height:100px;width:100%"></div>');t("body").append(e);var i=t(e).innerWidth(),o=t("div",e).innerWidth();t(e).remove(),r=i-o}return r}var r;t.fn.antiscroll=function(e){return this.each(function(){t(this).data("antiscroll")&&t(this).data("antiscroll").destroy(),t(this).data("antiscroll",new t.Antiscroll(this,e))})},t.Antiscroll=e,e.prototype.refresh=function(){var t=this.inner.get(0).scrollWidth>this.el.width()+(this.y?n():0),e=this.inner.get(0).scrollHeight>this.el.height()+(this.x?n():0);this.x&&(!this.horizontal&&t?this.horizontal=new i.Horizontal(this):this.horizontal&&!t?(this.horizontal.destroy(),this.horizontal=null):this.horizontal&&this.horizontal.update()),this.y&&(!this.vertical&&e?this.vertical=new i.Vertical(this):this.vertical&&!e?(this.vertical.destroy(),this.vertical=null):this.vertical&&this.vertical.update())},e.prototype.destroy=function(){return this.horizontal&&(this.horizontal.destroy(),this.horizontal=null),this.vertical&&(this.vertical.destroy(),this.vertical=null),this},e.prototype.rebuild=function(){return this.destroy(),this.inner.attr("style",""),e.call(this,this.el,this.options),this},i.prototype.destroy=function(){return this.el.remove(),this.pane.inner.unbind("scroll",this.innerPaneScrollListener),this.pane.inner.unbind("mousewheel",this.innerPaneMouseWheelListener),this},i.prototype.mouseenter=function(){this.enter=!0,this.show()},i.prototype.mouseleave=function(){this.enter=!1,this.dragging||this.pane.autoHide&&this.hide()},i.prototype.scroll=function(){this.shown||(this.show(),this.enter||this.dragging||this.pane.autoHide&&(this.hiding=setTimeout(t.proxy(this,"hide"),1500))),this.update()},i.prototype.mousedown=function(e){e.preventDefault(),this.dragging=!0,this.startPageY=e.pageY-parseInt(this.el.css("top"),10),this.startPageX=e.pageX-parseInt(this.el.css("left"),10),this.el[0].ownerDocument.onselectstart=function(){return!1};this.pane;var i=t.proxy(this,"mousemove"),o=this;t(this.el[0].ownerDocument).mousemove(i).mouseup(function(){o.dragging=!1,this.onselectstart=null,t(this).unbind("mousemove",i),o.enter||o.hide()})},i.prototype.show=function(t){!this.shown&&this.update()&&(this.el.addClass("antiscroll-scrollbar-shown"),this.hiding&&(clearTimeout(this.hiding),this.hiding=null),this.shown=!0)},i.prototype.hide=function(){!1!==this.pane.autoHide&&this.shown&&(this.el.removeClass("antiscroll-scrollbar-shown"),this.shown=!1)},i.Horizontal=function(e){this.el=t('<div class="antiscroll-scrollbar antiscroll-scrollbar-horizontal">',e.el),i.call(this,e)},o(i.Horizontal,i),i.Horizontal.prototype.update=function(){var t=this.pane.el.width(),e=t-2*this.pane.padding,i=this.pane.inner.get(0);return this.el.css("width",e*t/i.scrollWidth).css("left",e*i.scrollLeft/i.scrollWidth),t<i.scrollWidth},i.Horizontal.prototype.mousemove=function(t){var e=this.pane.el.width()-2*this.pane.padding,i=t.pageX-this.startPageX,o=this.el.width(),n=this.pane.inner.get(0),r=Math.min(Math.max(i,0),e-o);n.scrollLeft=(n.scrollWidth-this.pane.el.width())*r/(e-o)},i.Horizontal.prototype.mousewheel=function(t,e,i,o){if(i<0&&0==this.pane.inner.get(0).scrollLeft||i>0&&this.innerEl.scrollLeft+Math.ceil(this.pane.el.width())==this.innerEl.scrollWidth)return t.preventDefault(),!1},i.Vertical=function(e){this.el=t('<div class="antiscroll-scrollbar antiscroll-scrollbar-vertical">',e.el),i.call(this,e)},o(i.Vertical,i),i.Vertical.prototype.update=function(){var t=this.pane.el.height(),e=t-2*this.pane.padding,i=this.innerEl,o=e*t/i.scrollHeight;o=o<20?20:o;var n=e*i.scrollTop/i.scrollHeight;if(n+o>e){var r=n+o-e;n=n-r-3}return this.el.css("height",o).css("top",n),t<i.scrollHeight},i.Vertical.prototype.mousemove=function(t){var e=this.pane.el.height(),i=e-2*this.pane.padding,o=t.pageY-this.startPageY,n=this.el.height(),r=this.innerEl,a=Math.min(Math.max(o,0),i-n);r.scrollTop=(r.scrollHeight-e)*a/(i-n)},i.Vertical.prototype.mousewheel=function(t,e,i,o){if(o>0&&0==this.innerEl.scrollTop||o<0&&this.innerEl.scrollTop+Math.ceil(this.pane.el.height())==this.innerEl.scrollHeight)return t.preventDefault(),!1}}(jQuery),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t:t(jQuery)}(function(t){function e(e){var n,r=e||window.event,a=[].slice.call(arguments,1),s=0,l=0,c=0,u=0,d=0;return e=t.event.fix(r),e.type="mousewheel",r.wheelDelta&&(s=r.wheelDelta),r.detail&&(s=-1*r.detail),r.deltaY&&(c=-1*r.deltaY,s=c),r.deltaX&&(l=r.deltaX,s=-1*l),void 0!==r.wheelDeltaY&&(c=r.wheelDeltaY),void 0!==r.wheelDeltaX&&(l=-1*r.wheelDeltaX),u=Math.abs(s),(!i||u<i)&&(i=u),d=Math.max(Math.abs(c),Math.abs(l)),(!o||d<o)&&(o=d),n=s>0?"floor":"ceil",s=Math[n](s/i),l=Math[n](l/o),c=Math[n](c/o),a.unshift(e,s,l,c),(t.event.dispatch||t.event.handle).apply(this,a)}var i,o,n=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],r="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"];if(t.event.fixHooks)for(var a=n.length;a;)t.event.fixHooks[n[--a]]=t.event.mouseHooks;t.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var t=r.length;t;)this.addEventListener(r[--t],e,!1);else this.onmousewheel=e},teardown:function(){if(this.removeEventListener)for(var t=r.length;t;)this.removeEventListener(r[--t],e,!1);else this.onmousewheel=null}},t.fn.extend({mousewheel:function(t){return t?this.bind("mousewheel",t):this.trigger("mousewheel")},unmousewheel:function(t){return this.unbind("mousewheel",t)}})}),function(t){t.fn.delayedAction=function(e){var i=t.extend({},{delayedAction:function(){},cancelledAction:function(){},hoverTime:1e3},e);return this.each(function(){var e=t(this);e.hover(function(){e.data("timerId",setTimeout(function(){e.data("hover",!1),i.delayedAction(e)},i.hoverTime)),e.data("hover",!0)},function(){e.data("hover")&&(clearTimeout(e.data("timerId")),i.cancelledAction(e)),e.data("hover",!1)})})}}(jQuery),function(t){if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else{var e;try{e=window}catch(t){e=self}e.SparkMD5=t()}}(function(t){"use strict";function e(t,e,i,o,n,r){return e=v(v(e,t),v(o,r)),v(e<<n|e>>>32-n,i)}function i(t,i,o,n,r,a,s){return e(i&o|~i&n,t,i,r,a,s)}function o(t,i,o,n,r,a,s){return e(i&n|o&~n,t,i,r,a,s)}function n(t,i,o,n,r,a,s){return e(i^o^n,t,i,r,a,s)}function r(t,i,o,n,r,a,s){return e(o^(i|~n),t,i,r,a,s)}function a(t,e){var a=t[0],s=t[1],l=t[2],c=t[3];a=i(a,s,l,c,e[0],7,-680876936),c=i(c,a,s,l,e[1],12,-389564586),l=i(l,c,a,s,e[2],17,606105819),s=i(s,l,c,a,e[3],22,-1044525330),a=i(a,s,l,c,e[4],7,-176418897),c=i(c,a,s,l,e[5],12,1200080426),l=i(l,c,a,s,e[6],17,-1473231341),s=i(s,l,c,a,e[7],22,-45705983),a=i(a,s,l,c,e[8],7,1770035416),c=i(c,a,s,l,e[9],12,-1958414417),l=i(l,c,a,s,e[10],17,-42063),s=i(s,l,c,a,e[11],22,-1990404162),a=i(a,s,l,c,e[12],7,1804603682),c=i(c,a,s,l,e[13],12,-40341101),l=i(l,c,a,s,e[14],17,-1502002290),s=i(s,l,c,a,e[15],22,1236535329),a=o(a,s,l,c,e[1],5,-165796510),c=o(c,a,s,l,e[6],9,-1069501632),l=o(l,c,a,s,e[11],14,643717713),s=o(s,l,c,a,e[0],20,-373897302),a=o(a,s,l,c,e[5],5,-701558691),c=o(c,a,s,l,e[10],9,38016083),l=o(l,c,a,s,e[15],14,-660478335),s=o(s,l,c,a,e[4],20,-405537848),a=o(a,s,l,c,e[9],5,568446438),c=o(c,a,s,l,e[14],9,-1019803690),l=o(l,c,a,s,e[3],14,-187363961),s=o(s,l,c,a,e[8],20,1163531501),a=o(a,s,l,c,e[13],5,-1444681467),c=o(c,a,s,l,e[2],9,-51403784),l=o(l,c,a,s,e[7],14,1735328473),s=o(s,l,c,a,e[12],20,-1926607734),a=n(a,s,l,c,e[5],4,-378558),c=n(c,a,s,l,e[8],11,-2022574463),l=n(l,c,a,s,e[11],16,1839030562),s=n(s,l,c,a,e[14],23,-35309556),a=n(a,s,l,c,e[1],4,-1530992060),c=n(c,a,s,l,e[4],11,1272893353),l=n(l,c,a,s,e[7],16,-155497632),s=n(s,l,c,a,e[10],23,-1094730640),a=n(a,s,l,c,e[13],4,681279174),c=n(c,a,s,l,e[0],11,-358537222),l=n(l,c,a,s,e[3],16,-722521979),s=n(s,l,c,a,e[6],23,76029189),a=n(a,s,l,c,e[9],4,-640364487),c=n(c,a,s,l,e[12],11,-421815835),l=n(l,c,a,s,e[15],16,530742520),s=n(s,l,c,a,e[2],23,-995338651),a=r(a,s,l,c,e[0],6,-198630844),c=r(c,a,s,l,e[7],10,1126891415),l=r(l,c,a,s,e[14],15,-1416354905),s=r(s,l,c,a,e[5],21,-57434055),a=r(a,s,l,c,e[12],6,1700485571),c=r(c,a,s,l,e[3],10,-1894986606),l=r(l,c,a,s,e[10],15,-1051523),s=r(s,l,c,a,e[1],21,-2054922799),a=r(a,s,l,c,e[8],6,1873313359),c=r(c,a,s,l,e[15],10,-30611744),l=r(l,c,a,s,e[6],15,-1560198380),s=r(s,l,c,a,e[13],21,1309151649),a=r(a,s,l,c,e[4],6,-145523070),c=r(c,a,s,l,e[11],10,-1120210379),l=r(l,c,a,s,e[2],15,718787259),s=r(s,l,c,a,e[9],21,-343485551),t[0]=v(a,t[0]),t[1]=v(s,t[1]),t[2]=v(l,t[2]),t[3]=v(c,t[3])}function s(t){var e,i=[];for(e=0;e<64;e+=4)i[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return i}function l(t){var e,i=[];for(e=0;e<64;e+=4)i[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return i}function c(t){var e,i,o,n,r,l,c=t.length,u=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)a(u,s(t.substring(e-64,e)));for(t=t.substring(e-64),i=t.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)o[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(a(u,o),e=0;e<16;e+=1)o[e]=0;return n=8*c,n=n.toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(n[2],16),l=parseInt(n[1],16)||0,o[14]=r,o[15]=l,a(u,o),u}function u(t){var e,i,o,n,r,s,c=t.length,u=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)a(u,l(t.subarray(e-64,e)));for(t=e-64<c?t.subarray(e-64):new Uint8Array(0),i=t.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)o[e>>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(a(u,o),e=0;e<16;e+=1)o[e]=0;return n=8*c,n=n.toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(n[2],16),s=parseInt(n[1],16)||0,o[14]=r,o[15]=s,a(u,o),u}function d(t){var e,i="";for(e=0;e<4;e+=1)i+=y[t>>8*e+4&15]+y[t>>8*e&15];return i}function h(t){var e;for(e=0;e<t.length;e+=1)t[e]=d(t[e]);return t.join("")}function f(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function p(t,e){var i,o=t.length,n=new ArrayBuffer(o),r=new Uint8Array(n);for(i=0;i<o;i++)r[i]=t.charCodeAt(i);return e?r:n}function g(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function m(t,e,i){var o=new Uint8Array(t.byteLength+e.byteLength);return o.set(new Uint8Array(t)),o.set(new Uint8Array(e),t.byteLength),i?o:o.buffer}function b(){this.reset()}var v=function(t,e){return t+e&4294967295},y=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return"5d41402abc4b2a76b9719d911017c592"!==h(c("hello"))&&(v=function(t,e){var i=(65535&t)+(65535&e),o=(t>>16)+(e>>16)+(i>>16);return o<<16|65535&i}),b.prototype.append=function(t){return this.appendBinary(f(t)),this},b.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)a(this._hash,s(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},b.prototype.end=function(t){var e,i,o=this._buff,n=o.length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<n;e+=1)r[e>>2]|=o.charCodeAt(e)<<(e%4<<3);return this._finish(r,n),i=t?this._hash:h(this._hash),this.reset(),i},b.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},b.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},b.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},b.prototype._finish=function(t,e){var i,o,n,r=e;if(t[r>>2]|=128<<(r%4<<3),r>55)for(a(this._hash,t),r=0;r<16;r+=1)t[r]=0;i=8*this._length,i=i.toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(i[2],16),n=parseInt(i[1],16)||0,t[14]=o,t[15]=n,a(this._hash,t)},b.hash=function(t,e){return b.hashBinary(f(t),e)},b.hashBinary=function(t,e){var i=c(t);return e?i:h(i)},b.ArrayBuffer=function(){this.reset()},b.ArrayBuffer.prototype.append=function(t){var e,i=m(this._buff.buffer,t,!0),o=i.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)a(this._hash,l(i.subarray(e-64,e)));return this._buff=e-64<o?i.subarray(e-64):new Uint8Array(0),this},b.ArrayBuffer.prototype.end=function(t){var e,i,o=this._buff,n=o.length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<n;e+=1)r[e>>2]|=o[e]<<(e%4<<3);return this._finish(r,n),i=t?this._hash:h(this._hash),this.reset(),i},b.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},b.ArrayBuffer.prototype.getState=function(){var t=b.prototype.getState.call(this);return t.buff=g(t.buff),t},b.ArrayBuffer.prototype.setState=function(t){return t.buff=p(t.buff,!0),b.prototype.setState.call(this,t)},b.ArrayBuffer.prototype.destroy=b.prototype.destroy,b.ArrayBuffer.prototype._finish=b.prototype._finish,b.ArrayBuffer.hash=function(t,e){var i=u(new Uint8Array(t));return e?i:h(i)},b}),function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){return function t(e,i,o){function n(a,s){if(!i[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[a]={exports:{}};e[a][0].call(u.exports,function(t){var i=e[a][1][t];return n(i||t)},u,u.exports,t,e,i,o)}return i[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)n(o[a]);return n}({1:[function(t,e,i){var o=t("matches-selector");e.exports=function(t,e,i){for(var n=i?t:t.parentNode;n&&n!==document;){if(o(n,e))return n;n=n.parentNode}}},{"matches-selector":5}],2:[function(t,e,i){function o(t,e,i,o,r){var a=n.apply(this,arguments);return t.addEventListener(i,a,r),{destroy:function(){t.removeEventListener(i,a,r)}}}function n(t,e,i,o){return function(i){i.delegateTarget=r(i.target,e,!0),i.delegateTarget&&o.call(t,i)}}var r=t("closest");e.exports=o},{closest:1}],3:[function(t,e,i){i.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},i.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||i.node(t[0]))},i.string=function(t){return"string"==typeof t||t instanceof String},i.fn=function(t){var e=Object.prototype.toString.call(t);return"[object Function]"===e}},{}],4:[function(t,e,i){function o(t,e,i){if(!t&&!e&&!i)throw new Error("Missing required arguments");if(!s.string(e))throw new TypeError("Second argument must be a String");if(!s.fn(i))throw new TypeError("Third argument must be a Function");if(s.node(t))return n(t,e,i);if(s.nodeList(t))return r(t,e,i);if(s.string(t))return a(t,e,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function n(t,e,i){return t.addEventListener(e,i),{destroy:function(){t.removeEventListener(e,i)}}}function r(t,e,i){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,i)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,i)})}}}function a(t,e,i){return l(document.body,t,e,i)}var s=t("./is"),l=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,i){function o(t,e){if(r)return r.call(t,e);for(var i=t.parentNode.querySelectorAll(e),o=0;o<i.length;++o)if(i[o]==t)return!0;return!1}var n=Element.prototype,r=n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector;e.exports=o},{}],6:[function(t,e,i){function o(t){var e;if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName)t.focus(),t.setSelectionRange(0,t.value.length),e=t.value;else{t.hasAttribute("contenteditable")&&t.focus();var i=window.getSelection(),o=document.createRange();o.selectNodeContents(t),i.removeAllRanges(),i.addRange(o),e=i.toString()}return e}e.exports=o},{}],7:[function(t,e,i){function o(){}o.prototype={on:function(t,e,i){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:i}),this},once:function(t,e,i){function o(){n.off(t,o),e.apply(i,arguments)}var n=this;return o._=e,this.on(t,o,i)},emit:function(t){for(var e=[].slice.call(arguments,1),i=((this.e||(this.e={}))[t]||[]).slice(),o=0,n=i.length;n>o;o++)i[o].fn.apply(i[o].ctx,e);return this},off:function(t,e){var i=this.e||(this.e={}),o=i[t],n=[];if(o&&e)for(var r=0,a=o.length;a>r;r++)o[r].fn!==e&&o[r].fn._!==e&&n.push(o[r]);return n.length?i[t]=n:delete i[t],this}},e.exports=o},{}],8:[function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i.__esModule=!0;var r=function(){function t(t,e){for(var i=0;i<e.length;i++){var o=e[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=t("select"),s=o(a),l=function(){function t(e){n(this,t),this.resolveOptions(e),this.initSelection()}return t.prototype.resolveOptions=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action=t.action,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""},t.prototype.initSelection=function(){if(this.text&&this.target)throw new Error('Multiple attributes declared, use either "target" or "text"');if(this.text)this.selectFake();else{if(!this.target)throw new Error('Missing required attributes, use either "target" or "text"');this.selectTarget()}},t.prototype.selectFake=function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandler=document.body.addEventListener("click",function(){return t.removeFake()}),this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px",this.fakeElem.style.top=(window.pageYOffset||document.documentElement.scrollTop)+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,document.body.appendChild(this.fakeElem),this.selectedText=s.default(this.fakeElem),this.copyText()},t.prototype.removeFake=function(){this.fakeHandler&&(document.body.removeEventListener("click"),this.fakeHandler=null),this.fakeElem&&(document.body.removeChild(this.fakeElem),this.fakeElem=null)},t.prototype.selectTarget=function(){this.selectedText=s.default(this.target),this.copyText()},t.prototype.copyText=function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)},t.prototype.handleResult=function(t){t?this.emitter.emit("success",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)}):this.emitter.emit("error",{action:this.action,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})},t.prototype.clearSelection=function(){this.target&&this.target.blur(),window.getSelection().removeAllRanges()},t.prototype.destroy=function(){this.removeFake()},r(t,[{key:"action",set:function(){var t=arguments.length<=0||void 0===arguments[0]?"copy":arguments[0];if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!=typeof t||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');this._target=t}},get:function(){return this._target}}]),t}();i.default=l,e.exports=i.default},{select:6}],9:[function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t,e){var i="data-clipboard-"+t;if(e.hasAttribute(i))return e.getAttribute(i)}i.__esModule=!0;var s=t("./clipboard-action"),l=o(s),c=t("tiny-emitter"),u=o(c),d=t("good-listener"),h=o(d),f=function(t){function e(i,o){n(this,e),t.call(this),this.resolveOptions(o),this.listenClick(i)}return r(e,t),e.prototype.resolveOptions=function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText},e.prototype.listenClick=function(t){var e=this;this.listener=h.default(t,"click",function(t){return e.onClick(t)})},e.prototype.onClick=function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new l.default({action:this.action(e),target:this.target(e),text:this.text(e),trigger:e,emitter:this})},e.prototype.defaultAction=function(t){return a("action",t)},e.prototype.defaultTarget=function(t){var e=a("target",t)
;return e?document.querySelector(e):void 0},e.prototype.defaultText=function(t){return a("text",t)},e.prototype.destroy=function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)},e}(u.default);i.default=f,e.exports=i.default},{"./clipboard-action":8,"good-listener":4,"tiny-emitter":7}]},{},[9])(9)});