diff --git a/dist/js/genomap.min.js b/dist/js/genomap.min.js index 0f1a9b2..dd6a5c1 100644 --- a/dist/js/genomap.min.js +++ b/dist/js/genomap.min.js @@ -1 +1 @@ -var GENEMAP;(GENEMAP=GENEMAP||{}).AnnotationXMLReader=function(){var t=function(t,e){var n=t.getElementsByTagName(e);return n&&n.length>0?n[0].childNodes[0].nodeValue:null},e=function(e){for(var n,o,a,i,r={features:[]},l=e.getElementsByTagName("feature"),s=0;s=e.showThreshold),e.maxSize&&a>e.maxSize&&(o.size=e.maxSize/n.scale)}return o};return{decorateGenome:function(t){var e=t,a=n.width*(1-n.margin.left-n.margin.right),i=n.height*(1-n.margin.top-n.margin.bottom),r=Math.min(n.numberPerRow,e.chromosomes.length),l=Math.ceil(e.chromosomes.length/r);log.trace("numberPerRow= "+n.numberPerRow+", chromosomes.length= "+e.chromosomes.length),log.trace("Cols= "+r+", rows= "+l);var s={width:a/r,height:i/l},c={top:s.height*n.cellMargin.top,bottom:s.height*n.cellMargin.bottom,left:s.width*n.cellMargin.left,right:s.width*n.cellMargin.right},u=n.labelHeight*s.height,d=n.labelHeight*s.height,h=s.height-u-d-c.top-c.bottom,p=Math.min(65/n.scale,h*n.chromosomeAspectRatio),m=(s.width-p-c.left-c.right)/2,f=Math.max.apply(null,e.chromosomes.map((function(t){return t.length}))),g={label:_.pick(n.annotations.label,["size","show"]),marker:_.pick(n.annotations.marker,["size","show"])};g.label=o(g.label,n.annotations.label),g.marker=o(g.marker,n.annotations.marker);var y={chromosomePosition:{height:h,width:p,x:c.left+m,y:c.top+u},labelPosition:{height:u,width:s.width-c.left-c.right,chromosomeWidth:p,x:c.left,y:c.top},sizeLabelPosition:{cellHeight:h,height:d,width:s.width-c.left-c.right,x:c.left,y:c.top+u},qtlAnnotationPosition:{height:h,width:m,chromosomeWidth:p,x:c.left,y:c.top+u},geneAnnotationPosition:{height:h,width:m,x:c.left+m+p,y:c.top+u},longestChromosome:f,annotations:g,scale:n.scale};return 1==e.chromosomes.length&&(y.chromosomePosition.x=c.left+.5*m,y.geneAnnotationPosition.x=c.left+.5*m+p,y.qtlAnnotationPosition.width=.5*m,y.geneAnnotationPosition.width=1.5*m,y.labelPosition.x=c.left+.5*m,y.labelPosition.width=p,y.sizeLabelPosition.x=c.left+.5*m,y.sizeLabelPosition.width=p),e.drawing=_.pick(n,["width","height"]),e.drawing.margin={top:n.margin.top*e.drawing.height,left:n.margin.left*e.drawing.width,bottom:n.margin.bottom*e.drawing.height,right:n.margin.right*e.drawing.width},e.chromosomes.forEach((function(t,e){var o=e%n.numberPerRow,a=Math.floor(e/n.numberPerRow);t.cell={y:a*s.height+n.margin.top*n.height,x:o*s.width+n.margin.left*n.width,width:s.width,height:s.height}})),e.cellLayout=y,e},width:function(t){return arguments.length?(n.width=t,this):n.width},height:function(t){return arguments.length?(n.height=t,this):n.height},numberPerRow:function(t){return arguments.length?(n.numberPerRow=t,this):n.numberPerRow},margin:function(t){return arguments.length?(n.margin=_.merge(n.margin,t),this):n.margin},labelHeight:function(t){return arguments.length?(n.labelHeight=t,this):n.labelHeight},cellMargin:function(t){return arguments.length?(n.cellMargin=t,this):n.cellMargin},chromosomeAspectRatio:function(t){return arguments.length?(n.chromosomeAspectRatio=t,this):n.chromosomeAspectRatio},scale:function(t){return arguments.length?(n.scale=t,this):n.scale}}},(GENEMAP=GENEMAP||{}).BasemapXmlReader=function(){var t=function(t){return{index:t.getAttribute("index"),start:t.getElementsByTagName("start")[0].childNodes[0].nodeValue,end:t.getElementsByTagName("end")[0].childNodes[0].nodeValue,color:t.getElementsByTagName("color")[0].childNodes[0].nodeValue}},e=function(e){for(var n={index:e.getAttribute("index"),length:e.getAttribute("length"),number:e.getAttribute("number"),bands:[]},o=e.getElementsByTagName("band"),a=0;a').appendTo(document.body),"static"!=this.options.backdrop&&this.$backdrop.click(t.proxy(this.hide,this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),o?this.$backdrop.one(t.support.transition.end,e):e(),this.bodyIsOverflowing&&this.$navbar.css({paddingRight:this.scrollbarWidth})}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(t.support.transition.end,t.proxy(this.removeBackdrop,this)):this.removeBackdrop(),this.$body.removeClass("modal-open"),this.$navbar.css({paddingRight:0}),this.$body.css({paddingRight:0})):e&&e()}}),t.fn.modalPopover=function(n){return this.each((function(){var o=t(this),a="string"==typeof n?o.data("modal-popover"):void 0,i=t.extend({},t.fn.modalPopover.defaults,o.data(),"object"==typeof n&&n);i.$parent=i.$parent||a&&a.$parent||t(i.target),a||o.data("modal-popover",a=new e(this,i)),"string"==typeof n&&a[n]()}))},t.fn.modalPopover.Constructor=e,t.fn.modalPopover.defaults=t.extend({},t.fn.modal.defaults,{placement:"right",modalPosition:"body",keyboard:!0,backdrop:!0}),t((function(){t("body").on("click.modal-popover.data-api",'[data-toggle="modal-popover"]',(function(e){var n=t(this),o=n.attr("href"),a=t(n.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,"")),i=a.data("modal-popover")?"toggle":t.extend({remote:!/#/.test(o)&&o},a.data(),n.data());i.$parent=n,e.preventDefault(),a.modalPopover(i).modalPopover("show").one("hide",(function(){n.focus()}))}))}))}(window.jQuery),(GENEMAP=GENEMAP||{}).Chromosome=function(t){var e={border:!1,longestChromosome:100,bands:"basemap",layout:{width:10,height:100,x:0,y:0},scale:1,onAnnotationSelectFunction:$.noop(),drawing:null},n=_.merge({},e,t),o=function(){return d3.scale.linear().range([0,n.layout.height]).domain([0,n.longestChromosome])},a=function(t){var e=o(),a=e(t.length),l=d3.select(this);l.attr({id:"chromosome_"+t.number,transform:"translate("+n.layout.x+","+n.layout.y+")"}),l.select("defs").html("").append("mask").attr({id:"chromosome_mask_"+t.number}).append("rect").attr({class:"mask_rect"}),l.select("#chromosome_mask_"+t.number).attr({width:n.layout.width,height:a});var s={width:n.layout.width,height:a,rx:Math.min(.25*n.layout.width,.01*n.layout.height),ry:Math.min(.25*n.layout.width,.01*n.layout.height)};l.select(".mask_rect").attr(s),l.select("rect.background").attr(s),l.select("rect.outline").attr(s);var c=[],u=function(){var t=l.selectAll("rect.selection").data(c);t.enter().append("rect").attr("class","selection").style({fill:"gray",opacity:.2}),t.attr({x:0,y:function(t){return Math.min(t.start,t.end)},width:n.layout.width,height:function(t){return Math.abs(t.end-t.start)}}),t.exit().remove()},d=d3.behavior.drag().on("dragstart",(function(t){var e=d3.mouse(this);c.push({start:e[1],end:e[1]}),u(),d3.event.sourceEvent.stopPropagation()})).on("drag",(function(t){c[0].end=d3.event.y,u(),d3.event.sourceEvent.stopPropagation(),d3.event.sourceEvent.preventDefault()})).on("dragend",(function(o){d3.event.sourceEvent.stopPropagation();var a=e.invert(c[0].start),i=e.invert(c[0].end);if(a>i){var r=a;a=i,i=r}t.layout.geneBandNodes.filter((function(t){return t.data.midpoint>a&&t.data.midpoint2?o={y:t(e.start),height:a}:(height=Math.min(2/n.scale,2),o={y:t(e.midpoint)-height/2,height:height}),o.fill=e.color,o.width=n.layout.width,o["fill-opacity"]=.8,o["stroke-dasharray"]=[0,n.layout.width,o.height,n.layout.width+o.height],o["stroke-width"]=n.layout.width/5,o}(a,t),d3.select(this).attr(attribs)})),r.classed("selected",(function(t){return t.data.selected})),i.data(e.bands).attr({width:n.layout.width,y:function(t){return a(t.start)},height:function(t){return a(t.end-t.start)},fill:function(t){return t.color}}),r.on("click",(function(t){"gene"==t.data.type&&(log.info("gene annotation click"),!t.data.displayed||t.data.visible||t.data.hidden?t.data.visible=!t.data.visible:(t.data.visible=!1,t.data.hidden=!0),n.onAnnotationSelectFunction()),"geneslist"==t.data.type&&(log.info("geneslist annotation click"),clusterCurrentlyHidden=t.data.genesList.some((function(t){return!t.displayed})),t.data.genesList.forEach((function(t){t.visible=clusterCurrentlyHidden,t.hidden=!clusterCurrentlyHidden})),n.onAnnotationSelectFunction())})),r.exit().remove()};function l(t){t.each((function(t){var e=d3.select(this).selectAll(".chromosome").data([t]),o=e.enter().append("g").attr("class","chromosome");o.append("defs"),o.append("rect").classed("background",!0),o.append("g").classed("bands_container",!0),o.append("rect").classed("outline",!0),n.border&&o.append("rect").classed("border",!0),e.each(a),e.exit().remove()}))}return l.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,l):n.onAnnotationSelectFunction},l.layout=function(t){return arguments.length?(n.layout=t,l):n.layout},l.drawing=function(t){return arguments.length?(n.drawing=t,l):n.drawing},l.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,l):n.longestChromosome},l.bands=function(t){return arguments.length?(n.bands=t,l):n.bands},l.scale=function(t){return arguments.length?(n.scale=t,l):n.scale},l.infoBoxManager=function(t){return arguments.length?(n.infoBoxManager=t,l):n.infoBoxManager},l},(GENEMAP=GENEMAP||{}).ChromosomeCell=function(t){var e={border:!1,onAnnotationSelectFunction:$.noop(),onExpandClusterFunction:$.noop(),onLabelSelectFunction:$.noop(),maxAnnotationLayers:3,maxSnpPValue:1,svg:null},n=_.merge({},e,t);function o(t){t.each((function(t){var e=t.cellLayout,o=d3.select(this).selectAll(".chromosome-cell").data(t.chromosomes),a=o.enter().append("g").attr("class","chromosome-cell");n.border&&a.append("rect").classed("border",!0),o.attr({transform:function(t){return"translate("+t.cell.x+","+t.cell.y+")"}}),n.border&&o.select("rect").attr({x:0,y:0,width:function(t){return t.cell.width},height:function(t){return t.cell.height}});t.chromosomes.length;var i=GENEMAP.GeneAnnotations().onAnnotationSelectFunction(n.onAnnotationSelectFunction).onExpandClusterFunction(n.onExpandClusterFunction).layout(e.geneAnnotationPosition).longestChromosome(e.longestChromosome).chromosomeWidth(e.chromosomePosition.width).annotationLabelSize(e.annotations.label.size).annotationMarkerSize(e.annotations.marker.size).drawing(n.svg).scale(e.scale);o.call(i);var r=GENEMAP.Chromosome().layout(e.chromosomePosition).longestChromosome(e.longestChromosome).onAnnotationSelectFunction(n.onAnnotationSelectFunction).scale(e.scale).bands("genes").drawing(n.svg);o.call(r);var l=GENEMAP.ChromosomeLabel().layout(e.labelPosition).sizeLayout(e.sizeLabelPosition).onLabelSelectFunction(n.onLabelSelectFunction).longestChromosome(e.longestChromosome).scale(e.scale);o.call(l);var s=GENEMAP.QtlAnnotations().onAnnotationSelectFunction(n.onAnnotationSelectFunction).layout(e.qtlAnnotationPosition).longestChromosome(e.longestChromosome).chromosomeWidth(e.chromosomePosition.width).annotationLabelSize(e.annotations.label.size).annotationMarkerSize(e.annotations.marker.size).showAnnotationLabels(e.annotations.label.show).maxSnpPValue(n.maxSnpPValue).drawing(n.svg).scale(e.scale);o.call(s),o.exit().remove()}))}return o.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,o):n.onAnnotationSelectFunction},o.onExpandClusterFunction=function(t){return arguments.length?(n.onExpandClusterFunction=t,o):n.onExpandClusterFunction},o.onLabelSelectFunction=function(t){return arguments.length?(n.onLabelSelectFunction=t,o):n.onLabelSelectFunction},o.infoBoxManager=function(t){return arguments.length?(n.infoBoxManager=t,o):n.infoBoxManager},o.maxAnnotationLayers=function(t){return arguments.length?(n.maxAnnotationLayers=t,o):n.maxAnnotationLayers},o.maxSnpPValue=function(t){return arguments.length?(n.maxSnpPValue=t,o):n.maxSnpPValue},o.svg=function(t){return arguments.length?(n.svg=t,o):n.svg},o},(GENEMAP=GENEMAP||{}).ChromosomeLabel=function(t){var e={border:!1,layout:{width:100,height:20,x:0,y:0},sizeLayout:{width:100,height:20,x:0,y:0},scale:1,onLabelSelectFunction:function(t){alert("Click"+t.number)},labelSize:10,longestChromosome:100},n=_.merge({},e,t);function o(t){t.each((function(t){var e=d3.select(this).selectAll(".chromosome-label").data([t]);(o=e.enter().append("g").attr("class","chromosome-label")).append("text"),n.border&&o.append("rect").classed("border",!0),e.attr({transform:"translate("+n.layout.x+","+n.layout.y+")"}),e.select("text").attr({x:.5*n.layout.width,y:.5*n.layout.height}).style({"font-size":Math.max(14/n.scale,1.2*n.layout.chromosomeWidth)+"px"}).text(t.number).on("click",n.onLabelSelectFunction),n.border&&e.select("rect").attr({width:n.layout.width,height:n.layout.height}),e.exit().remove();var o,a=d3.select(this).selectAll(".chromosome-size-label").data([t]);(o=a.enter().append("g").attr("class","chromosome-size-label")).append("text");var i,r=n.sizeLayout.y+n.sizeLayout.cellHeight*t.length/n.longestChromosome,l=1.2*n.labelSize/Math.min(5,n.scale)+"px";a.attr({transform:"translate("+n.sizeLayout.x+","+r+")"}),a.select("text").attr({x:.5*n.sizeLayout.width,y:0,dy:"1em"}).style({"font-size":l}).text((i=t.length)<1e3?i:i<1e6?(i/1e3).toFixed(1)+"Kb":(i/1e6).toFixed(1)+"Mb"),a.exit().remove()}))}return o.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,o):n.longestChromosome},o.layout=function(t){return arguments.length?(n.layout=t,o):n.layout},o.sizeLayout=function(t){return arguments.length?(n.sizeLayout=t,o):n.sizeLayout},o.scale=function(t){return arguments.length?(n.scale=t,o):n.scale},o.onLabelSelectFunction=function(t){return arguments.length?(n.onLabelSelectFunction=t,o):n.onLabelSelectFunction},o},(GENEMAP=GENEMAP||{}).GeneAnnotationLayout=function(t){var e=_.merge({},{longestChromosome:100,layout:{width:10,height:100,x:0,y:0},autoLabels:!0,manualLabels:!0,annotationMarkerSize:5,annotationLabelSize:5,doCluster:!0,nClusters:6,nGenesToDisplay:1e3,maxAnnotationLayers:3,displayedFontSize:13,scale:1},t),n=function(t,n,o,a,i){return par={},par.scale=t,par.availableHeight=i,par.lineSpacing=1,par.layerGap=n*(.1+.1/t),par.spaceForLabel=n-par.layerGap,par.setFontSize=Math.min(par.spaceForLabel/o*3.5,a/e.scale),par.nodeSpacing=par.setFontSize,par.nLabels=.4*i/(par.nodeSpacing+par.lineSpacing),par.density=1,par},o=function(t,e,n,o){o.forEach((function(t){t.displayed=!0,t.fontSize=n.setFontSize}));var a=o.map((function(t){return new labella.Node(e(t.midpoint),n.setFontSize,t)}));try{t.nodes(a).compute()}catch(t){if(t instanceof RangeError)return null;throw t}return a},a=function(t){allGenes=t.annotations.allGenes.filter((function(t){return t.globalIndexo;return r?2:(r=(i=(a=e-e*(.1+.1/t))/n*4)*t>o)?1:0}(e.scale,i,l,s);2==u?a=function(t,n,o,a,i){var r={};return r.scale=t,r.availableHeight=i,r.lineSpacing=1,r.setFontSize=Math.min(n/3/o*3.5,a/e.scale),r.nodeSpacing=r.setFontSize,r.spaceForLabel=1.3*o*r.setFontSize/3.5,r.layerGap=Math.min(5*r.setFontSize,n/3),r.density=.9,r.nLabels=.6*i/(r.nodeSpacing+r.lineSpacing),r}(e.scale,i,l,c,r):1==u?a=n(e.scale,i,l,c,r):0==u&&((a=n(e.scale,i,l,c,r)).nLabels=0);var d=d3.scale.linear().range([0,e.layout.height]).domain([0,e.longestChromosome]);forceConfig={nodeSpacing:a.nodeSpacing,lineSpacing:a.lineSpacing,algorithm:"overlap",minPos:0,maxPos:a.availableHeight,density:a.density};var h=new labella.Force(forceConfig);allGenes.forEach((function(t){t.displayed=!1}));var p=e.manualLabels?new Set(allGenes.filter((function(t){return t.visible}))):new Set;e.autoLabels&&allGenes.slice(0,a.nLabels).filter((function(t){return!t.hidden})).forEach((function(t){p.add(t)}));var m,f=Array.from(p),g=o(h,d,a,f);if(g||(h.options({algorithm:"simple"}),g=o(h,d,a,f)),g){var y=g.map((function(t){return t.getLayerIndex()}));m=Math.max.apply(null,y)}if(!g||m>3){log.trace("Too many lables to display - clustering instead");var b=GENEMAP.GeneClusterer().nClusters(Math.max(a.nLabels,1));try{var v=b.createClustersFromGenes(f)}catch(t){log.info(f),v=[]}g=o(h,d,a,v)}renderConfig={direction:"right",layerGap:a.layerGap,nodeHeight:a.spaceForLabel};var x=new labella.Renderer(renderConfig);return x.layout(g),g.forEach((function(t){t.data.path=x.generatePath(t)})),g};return my={},my.layoutChromosome=function(t){t.layout.annotationNodes=a(t)||t.layout.annotationNodes},my.computeChromosomeClusters=function(t){t.layout.annotationClusters=function(t){var e=GENEMAP.GeneClusterer(),n=t.annotations.genes;return e.createClustersFromGenes(n)}(t),t.layout.annotationDisplayClusters=t.layout.annotationClusters.slice()},my.expandAllChromosomeClusters=function(t){t.layout.annotationDisplayClusters=t.annotations.genes},my.collapseAllChromosomeClusters=function(t){t.layout.annotationDisplayClusters=t.layout.annotationClusters.slice()},my.expandAChromosomeCluster=function(t,e){t.layout.annotationDisplayClusters=t.layout.annotationClusters.slice(),e.genesList.forEach((function(e){t.layout.annotationDisplayClusters.push(e)}));var n=t.layout.annotationDisplayClusters.indexOf(e);t.layout.annotationDisplayClusters.splice(n,1)},my.computeNormalisedGeneScores=function(t){var e=t.reduce((function(t,e){return t.concat(e.annotations.genes.filter((function(t){return t.displayed})))}),[]);if(e.every((function(t){return t.score}))){var n=e.reduce((function(t,e){return Math.max(t,e.score)}),0),o=e.reduce((function(t,e){return Math.min(t,e.score)}),0);e.forEach((function(t){t.normedScore=.5*(t.score-o)/(n-o)+.5}))}else e.forEach((function(t){t.normedScore=null}))},my},(GENEMAP=GENEMAP||{}).GeneAnnotationPopup=function(t){var e={onAnnotationSelectFunction:$.noop(),drawing:null,popoverId:""},n=_.merge({},e,t),o={show:function(t){t.visible=!0},hide:function(t){t.visible=!1,t.hidden=!0},auto:function(t){t.visible=!1,t.hidden=!1}},a=function(t,e){t.select("span.genelabel").text((function(t){return t.label})).style("font-weight",(function(t){return t.selected?"bold":"normal"})).style("opacity",(function(t){return t.visible||t.selected?1:t.normedScore?t.normedScore:t.importance})).style("color",(function(t){return e.visible||e.selected?e.color:null}));var n=t.select("div.btn-group");footerLinks=n.selectAll("a").data(["show","hide","auto"]),footerLinks.classed("disabled",(function(t){return"show"==t&&e.visible||"hide"==t&&e.hidden&&!e.visible||"auto"==t&&!e.hidden&&!e.visible}))},i={};return i.geneAnnotationsPopoverFunction=function(t){var e="geneslist"==t.data.type;log.trace("Gene Annotation Context Menu"),d3.select(n.popoverId).attr("class","popover"),popoverTitle=d3.select(n.popoverId).select(".popover-title"),popoverContent=d3.select(n.popoverId).select(".popover-content"),popoverTitle.selectAll("*").remove(),popoverTitle.text(""),popoverContent.selectAll("*").remove(),popoverContent.text(""),e?function(t,e,i){var r=i.data.genesList,l=e.selectAll("p").data(r);t.append("span").text("Cluster"),links=t.append("div.btn-group").selectAll("a").data(["show","hide","auto"]),links.enter().append("a").attr("href","#").text((function(t){return t})).classed("btn btn-small",!0).on("click",(function(t){var e=o[t];r.forEach(e),l.each((function(t){var e=d3.select(this);a(e,t)})),d3.event.preventDefault(),n.onAnnotationSelectFunction()}));var s=l.enter().append("p");s.append("span").classed("genelabel",!0),s.append("div").classed("btn-group",!0),l.each((function(t){var e=d3.select(this),i=e.select("div.btn-group");footerLinks=i.selectAll("a").data(["show","hide","auto"]),footerLinks.enter().append("a").attr("href","#").text((function(t){return t})).classed("btn btn-small",!0).on("click",(function(i){(0,o[i])(t),n.onAnnotationSelectFunction(),d3.event.preventDefault(),a(e,t)}))})),l.each((function(t){var e=d3.select(this);a(e,t)}))}(popoverTitle,popoverContent,t):function(t,e,a){var i=a.data;t.append("a").attr({href:i.link}).text(i.label),e.append("p").text("Chromosome "+i.chromosome+": "+i.start+"-"+i.end),i.score&&e.append("p").text("Score: "+parseFloat(i.score).toFixed(3)),e.append("hr");var r=e.append("p").style("float","right"),l=function(){footerLinks=r.selectAll("a").data(["show","hide","auto"]),footerLinks.enter().append("a").attr("href","#").text((function(t){return t})).classed("btn btn-small",!0).on("click",(function(t){(0,o[t])(i),n.onAnnotationSelectFunction(),d3.event.preventDefault(),l()})),footerLinks.classed("disabled",(function(t){return"show"==t&&i.visible||"hide"==t&&i.hidden&&!i.visible||"auto"==t&&!i.hidden&&!i.visible}))};l()}(popoverTitle,popoverContent,t);var i=d3.select(this).select("text");$(n.popoverId).modalPopover({target:$(i[0]),parent:$(i[0]),"modal-position":"relative",placement:"right",boundingSize:n.drawing}),$(n.popoverId).modalPopover("show"),$(n.popoverId).on("mousedown mousewheel",(function(t){log.trace("popover click"),t.stopPropagation()}))},i},(GENEMAP=GENEMAP||{}).GeneAnnotations=function(t){var e={border:!1,labelRectangles:!1,onAnnotationSelectFunction:$.noop(),onExpandClusterFunction:$.noop(),longestChromosome:100,layout:{width:10,height:100,x:0,y:0},chromosomeWidth:20,annotationMarkerSize:5,annotationLabelSize:5,scale:null,drawing:null},n=_.merge({},e,t),o=null,a=function(t,e){_.pick(n,["onAnnotationSelectFunction","drawing"]);n.popoverId="#clusterPopover",o=GENEMAP.GeneAnnotationPopup(n),log.trace("setupGeneAnnotations");var a=d3.scale.linear().range([0,n.layout.height]).domain([0,n.longestChromosome]),i=t.selectAll("g.gene-annotation").data(e.layout.annotationNodes,(function(t){return t.data.id})),r=i.enter().append("g").classed("gene-annotation",!0);r.append("line").classed("midpoint-line",!0),r.append("path").classed("link",!0).attr({d:function(t){return t.data.path}}),n.labelRectangles&&r.append("rect").classed("labella",!0),r.append("text").attr({x:function(t){return t.x+.1*n.annotationLabelSize},y:function(t){return t.y+.4*n.annotationLabelSize}}),i.attr("id",(function(t){return"feature_"+t.data.id})),i.classed("selected",(function(t){return t.data.selected})),i.select("line.midpoint-line").attr({x1:-.5*n.chromosomeWidth,y1:function(t){return a(t.data.midpoint)},y2:function(t){return a(t.data.midpoint)},x2:0}),i.select("text").text((function(t){return"gene"==t.data.type?t.data.label:"geneslist"==t.data.type?"("+t.data.genesList.length+")":void 0})),n.labelRectangles&&i.select("rect.labella").attr({fill:"pink",stroke:"none",x:function(t){return t.x},y:function(t){return t.y-t.dy/2},width:function(t){return t.dx},height:function(t){return t.dy}});var l="0.5";GENEMAP.vectorEffectSupport||(l=.5/n.scale),i.select("path.link").style("opacity",(function(t){return t.data.visible||t.data.selected?1:t.data.normedScore?t.data.normedScore:t.data.importance})).style("stroke-width",(function(t){return l})).style("stroke",(function(t){return t.data.visible||t.data.selected?t.data.color:"gray"})),i.select("text").style("font-size",(function(t){return(t.data.selected?.2:0)+t.data.fontSize+"px"})).style("font-weight",(function(t){return t.data.selected?"bold":"normal"})).style("opacity",(function(t){return t.data.visible||t.data.selected?1:t.data.normedScore?t.data.normedScore:t.data.importance})).style("fill",(function(t){return t.data.visible||t.data.selected?t.data.color:null})),i.select("text").transition().duration(300).attr({x:function(t){return t.x+.1*n.annotationLabelSize},y:function(t){return t.y+.4*n.annotationLabelSize}}),i.select("path.link").transition().duration(300).attr({d:function(t){return t.data.path}}),i.on("click",(function(t){"gene"==t.data.type&&(log.info("gene annotation click"),t.data.selected=!t.data.selected,t.data.selected&&(t.data.visible=!0),n.onAnnotationSelectFunction()),"geneslist"==t.data.type&&(log.trace("geneslist annotation click"),n.onExpandClusterFunction(e,t.data))})),i.on("contextmenu",o.geneAnnotationsPopoverFunction),i.exit().remove()};function i(t){t.each((function(t){var e,o=d3.select(this).selectAll(".gene-annotations").data([t]);o.enter().append("g").attr("class","gene-annotations"),o.attr({transform:"translate("+n.layout.x+","+n.layout.y+")",id:function(t){return"annotation_"+t.number}}),a(o,t),n.border&&((e=o).select("rect.border").empty()&&e.append("rect").classed("border",!0),e.select("rect.border").attr({width:n.layout.width,height:n.layout.height})),o.exit().remove()}))}return i.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,i):n.onAnnotationSelectFunction},i.onExpandClusterFunction=function(t){return arguments.length?(n.onExpandClusterFunction=t,i):n.onExpandClusterFunction},i.layout=function(t){return arguments.length?(n.layout=t,i):n.layout},i.drawing=function(t){return arguments.length?(n.drawing=t,i):n.drawing},i.scale=function(t){return arguments.length?(n.scale=t,i):n.scale},i.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,i):n.longestChromosome},i.chromosomeWidth=function(t){return arguments.length?(n.chromosomeWidth=t,i):n.chromosomeWidth},i.annotationLabelSize=function(t){return arguments.length?(n.annotationLabelSize=t,i):n.annotationLabelSize},i.annotationMarkerSize=function(t){return arguments.length?(n.annotationMarkerSize=t,i):n.annotationMarkerSize},i},(GENEMAP=GENEMAP||{}).GeneBandsLayout=function(t){var e=_.merge({},{longestChromosome:100,layout:{width:10,height:100,x:0,y:0},doCluster:!0,nClusters:6,scale:1,nGenesToDisplay:1e3},t),n=function(t){if("gene"==t.type){var e=t;return result={start:e.start,end:e.end,midpoint:e.midpoint,color:e.color,data:e},result}if("geneslist"==t.type)return maxPosition=t.genesList.reduce((function(t,e){return Math.max(t,e.end)}),0),minPosition=t.genesList.reduce((function(t,e){return Math.min(t,e.start)}),1/0),result={start:minPosition,end:maxPosition,midpoint:t.midpoint,color:"#0000FF",data:t},result;log.error("unregconized cluster type"),log.info(t)},o=function(t){return d3.scale.linear().range([0,e.layout.height]).domain([0,e.longestChromosome]),t.layout.geneBandDisplayClusters.map(n)};return my={},my.layoutChromosome=function(t){t.layout.geneBandNodes=o(t)},my.computeChromosomeClusters=function(t){ly=t.layout,ly.geneBandClusters=function(t){var n=t.annotations.allGenes.filter((function(t){return t.globalIndex=0||t.height.toString().indexOf("%")>=0){var n=d3.select(e).select("svg").node().getBoundingClientRect();t.width.toString().indexOf("%")>=0&&(t.width=n.width),t.height.toString().indexOf("%")>=0&&(t.height=n.height)}return t},C=function(){var t=!1;return r&&(t=0!==r.translate()[0]||0!==r.translate()[1]||t,t=1!==r.scale()||t),t},L=function(){1==r.scale()&&_.isEqual(r.translate(),[0,0])||(r.translate([0,0]),r.scale(1),o.attr("transform","translate("+r.translate()+")scale("+r.scale()+")"),h.setFitButtonEnabled(C()),I(),H())},k=function(){log.info("Exporting whole canvas to png, scale is "+r.scale()),o.attr("transform","translate(0,0)scale(1)"),saveSvgAsPng(o[0][0],"genemap.png",{scale:r.scale()*y.pngScale}),o.attr("transform","translate("+r.translate()+")scale("+r.scale()+")")},A=function(){log.info("Exporting view to png, scale is "+r.scale()),saveSvgAsPng(n[0][0],"genemap.png",{scale:y.pngScale})};l=function(){var t=d3.event.translate;if(c){var e=n.node().getBoundingClientRect(),i=-c.drawing.width*d3.event.scale+e.width*(1-y.extraPanArea)+c.drawing.margin.right*d3.event.scale,l=e.width*y.extraPanArea-c.drawing.margin.left*d3.event.scale;t[0]=_.clamp(t[0],i,l);var u=-c.drawing.height*d3.event.scale+e.height*(1-y.extraPanArea)+c.drawing.margin.bottom*d3.event.scale,d=e.height*y.extraPanArea-c.drawing.margin.top*d3.event.scale;t[1]=_.clamp(t[1],u,d)}r.translate(t),r.scale()!=s&&(log.trace("New zoom"),I(),H()),s=r.scale(),h.setFitButtonEnabled(C()),o.attr("transform","translate("+r.translate()+")scale("+d3.event.scale+")"),a.text("translate: [ "+r.translate()[0].toFixed(1)+","+r.translate()[1].toFixed(1)+"] zoom:"+r.scale().toFixed(2))};var E=function(){log.trace("mouse down"),n.classed("dragging",!0)},S=function(){log.trace("mouse up"),n.classed("dragging",!1)},M=function(){log.trace("context click"),d3.event.preventDefault()},z=function(t){$("#clusterPopover").modalPopover("hide"),$(".genemap-advanced-menu").modalPopover("hide")},G=function(t){"auto"==t?(p=!0,m=!0,c.chromosomes.forEach((function(t){t.annotations.genes.forEach((function(t){1==t.selected&&(t.visible=!0)}))}))):"show"==t?(p=!1,m=!0):"hide"==t&&(p=!1,m=!1),c.chromosomes.forEach((function(e){e.annotations.genes.forEach((function(e){"auto"===t?delete e.showLabel:e.showLabel=t}))})),I(),H()},N=function(){var t=c.chromosomes.some((function(t){return t.annotations.genes.some((function(t){return t.selected}))}));I(),H(),d3.select(".network-btn").classed("disabled",!t)},B=function(t){d?(c=u,d=!1):(c={chromosomes:[t]},d=!0),L(),I(),H()},F=function(){var t=_.flatMap(c.chromosomes.map((function(t){return t.annotations.genes.filter((function(t){return t.selected})).map((function(t){var e=t.link,n=e.substring(e.indexOf("list="),e.length).split("=")[1];return decodeURIComponent(n.replace(/\+/g," "))}))}))),e=y.apiUrl+"/network";log.info("selected labels: "+t),generateCyJSNetwork(e,{list:t,keyword:$("#keywords").val()})},T=function(){var t,e=h.getTagButtonState();t="auto"===e?"show":"show"===e?"hide":"auto",h.setTabButtonState(t),G(t),H()},D=function(){log.info("Reset Labels"),c.chromosomes.forEach((function(t){t.annotations.allGenes.forEach((function(t){t.selected=!1,t.visible=!1,t.hidden=!1}))})),I(),H()},R=function(t){log.trace("Number per row:",t),y.layout.numberPerRow=t,V(),I(),H()},q=function(t){log.info("onToggleQTLDisplay"),"all"==t?(f=!0,g=!0):"selected"==t?(f=!1,g="true"):(f=!1,g=!1),W(),I(),H()},Q=function(){var t=GENEMAP.AutoLayoutDecorator(y.layout).width(P().width).height(P().height).scale(r.scale());c=t.decorateGenome(c)},V=function(){c.chromosomes.forEach((function(t){t.layout=t.layout||{},t.layout.annotationDisplayClusters=null,t.layout.geneBandDisplayClusters=null}))},W=function(){c.chromosomes.forEach((function(t){t.layout=t.layout||{},t.layout.qtlDisplayClusters=null}))},I=function(){Q();c.chromosomes.length;var t=GENEMAP.GeneAnnotationLayout({longestChromosome:c.cellLayout.longestChromosome,layout:c.cellLayout.geneAnnotationPosition,annotationMarkerSize:c.cellLayout.annotations.marker.size,annotationLabelSize:c.cellLayout.annotations.label.size,scale:r.scale(),autoLabels:p,manualLabels:m,nGenesToDisplay:y.nGenesToDisplay,displayedFontSize:y.annotationLabelSize}),e=GENEMAP.GeneBandsLayout({longestChromosome:c.cellLayout.longestChromosome,layout:c.cellLayout.geneAnnotationPosition,nClusters:50,scale:r.scale(),nGenesToDisplay:y.nGenesToDisplay}),n=GENEMAP.QTLAnnotationLayout({longestChromosome:c.cellLayout.longestChromosome,layout:c.cellLayout.qtlAnnotationPosition,scale:r.scale(),showAllQTLs:f,showSelectedQTLs:g,showAutoQTLLabels:f,showSelectedQTLLabels:g,annotationLabelSize:c.cellLayout.annotations.label.size});c.chromosomes.forEach((function(o){o.layout=o.layout||{},o.layout.annotationDisplayClusters||t.computeChromosomeClusters(o),t.layoutChromosome(o),o.layout.geneBandDisplayClusters||e.computeChromosomeClusters(o),e.layoutChromosome(o),o.layout.qtlDisplayClusters||n.computeChromosomeClusters(o),n.layoutChromosome(o)})),t.computeNormalisedGeneScores(c.chromosomes)},X=function(t){var n,o=t.append("svg").attr({width:y.width,height:y.height,class:"mapview"});a=t.append("div").append("span").attr({class:"logger",id:"logbar"}),i=t.append("div").attr({class:"key",id:"keybar"}),GENEMAP.vectorEffectSupport="vectorEffect"in o[0][0].style,n="mousedown mousewheel DOMMouseScroll touchstart ",$(e).off(n).on(n,(function(t){"undefined"!==t.target&&"a"===t.target.tagName.toLowerCase()||$(t.target).closest(".genemap-advanced-menu").length>0||z(t)})),$("body").on("click",(function(t){$(t.target).closest(e).length<1&&1==b&&w()})),o.on("mousedown",E).on("mouseup",S).on("contextmenu",M),o.append("g").classed("zoom_window",!0).append("rect").classed("drawing_outline",!0),y.contentBorder&&t.select(".zoom_window").append("rect").classed("drawing_margin",!0),s=1,(r=d3.behavior.zoom().scaleExtent([1,50])).on("zoom",l),t.select("svg").call(r);var c=t.append("div").attr({id:"clusterPopover",class:"popover"});return c.append("div").attr({class:"arrow"}),c.append("h3").attr({class:"popover-title"}).text("Cluster"),c.append("div").attr({class:"popover-content"}),o},H=function(){var t,i;d3.select(e).select("svg").node()?(n=d3.select(e).select("svg")).attr({width:y.width,height:y.height}):n=X(d3.select(e)),a.text("translate: [ "+r.translate()[0].toFixed(1)+","+r.translate()[1].toFixed(1)+"] zoom:"+r.scale().toFixed(2)),Q(),c.chromosomes.every((function(t){return t.layout}))||I(),n.datum(c),(o=n.select(".zoom_window")).select(".drawing_outline").attr({width:c.drawing.width,height:c.drawing.height}),y.contentBorder&&(t=c.drawing,i=c.margin,o.select(".drawing_margin").attr({x:i.left,y:i.top,width:t.width-i.left-i.right,height:t.height-i.top-i.bottom}));var l=GENEMAP.ChromosomeCell().onAnnotationSelectFunction(N).onLabelSelectFunction(B).maxAnnotationLayers(y.layout.maxAnnotationLayers).maxSnpPValue(y.maxSnpPValue).svg(n);o.call(l)};function O(t){t.each((function(t){e=this,c=u=t,d=!1,h||(h=GENEMAP.MenuBar().onTagBtnClick(T).onFitBtnClick(L).onLabelBtnClick(G).onQtlBtnClick(q).onNetworkBtnClick(F).onResetBtnClick(D).onSetNumberPerRowClick(R).initialMaxGenes(y.nGenesToDisplay).initialNPerRow(y.layout.numberPerRow).onExportBtnClick(A).onExportAllBtnClick(k).onExpandBtnClick(w).maxSnpPValueProperty(O.maxSnpPValue).nGenesToDisplayProperty(O.nGenesToDisplay).annotationLabelSizeProperty(O.annotationLabelSize)),d3.select(e).call(h),h.setNetworkButtonEnabled(!1),h.setFitButtonEnabled(!1),h.setTabButtonState("auto"),H()}))}return O.resetZoom=L,O.width=function(t){return arguments.length?(y.width=t,O):y.width},O.height=function(t){return arguments.length?(y.height=t,O):y.height},O.layout=function(t){return arguments.length?(y.layout=_.merge(y.layout,t),O):y.layout},O.draw=function(t,e,n){GENEMAP.XmlDataReader().readXMLData(e,n).then((function(e){O._draw(t,e)}))},O.drawFromRawAnnotationXML=function(t,e,n){GENEMAP.XmlDataReader().readXMLDataFromRawAnnotationXML(e,n).then((function(e){O._draw(t,e)}))},O._draw=function(t,n){d3.select(t).selectAll("div").data(["genemap-target"]).enter().append("div").attr("id",(function(t){return t})),e=d3.select(t).select("#genemap-target")[0][0],log.info("drawing genome to target"),d3.select(e).datum(n).call(O),O.nGenesToDisplay(y.initialMaxGenes),L(),function(t,e){var n=new Set,o=[];e.chromosomes.forEach((function(t){t.annotations.snps.forEach((function(t){n.has(t.trait)||null!=t.trait&&o.push({trait:t.trait,color:t.color}),n.add(t.trait)}))})),o.length>0?t.text("SNP legend: "):t.text("");var a=t.selectAll("span").data(o),i=a.enter().append("span").classed("key-item",!0);i.append("span").style("background-color",(function(t){return t.color})).classed("colorbox",!0).append("svg"),i.append("span").text((function(t){return t.trait})),a.exit().remove()}(i,c)},O.redraw=function(t){e=d3.select(t).select("#genemap-target")[0][0],x(),d3.select(e).call(O),z()},O.setGeneLabels=function(t){e&&G(t)},O.maxSnpPValue=GENEMAP.Listener(y.maxSnpPValue).addListener((function(t){var e=Number(t);log.info("Setting max PValue for SNPs to",t,"(",e,")"),isNaN(e)&&(log.info("Can't parse max PValue"),O.maxSnpPValue(y.maxSnpPValue)),y.maxSnpPValue=Number(t),I(),H()})),O.nGenesToDisplay=GENEMAP.Listener(y.nGenesToDisplay).addListener((function(t){log.info("Setting nGenes to ",t);var e=y.nGenesToDisplay;y.nGenesToDisplay=t,t!=e&&(V(),I(),H())})),O.annotationLabelSize=GENEMAP.Listener(y.annotationLabelSize).addListener((function(t){log.info("Setting annotation label size to",t),y.annotationLabelSize=t,V(),I(),H()})),O.setQtlLabels=function(t){e&&d3.select(e).datum().chromosomes.forEach((function(e){e.annotations.qtls.forEach((function(e){"auto"===t?delete e.showLabel:e.showLabel=t}))}))},O.loggingOn=function(){a.style("display","initial")},O.loggingOff=function(){a.style("display","none")},O},function(t){var e=function(t,e,n){this.distance=t,this.linkage=e,this.threshold=null==n?1/0:n};e.prototype={cluster:function(t,e,n){this.clusters=[],this.dists=[],this.mins=[],this.index=[];for(var o=0;o=this.threshold)return!1;var a=this.index[t],i=this.index[this.mins[t]],r={left:a,right:i,key:a.key,size:a.size+i.size};this.clusters[a.index]=r,this.clusters.splice(i.index,1),this.index[a.key]=r;for(n=0;nthis.dists[i.key][s.key]&&(l=this.dists[i.key][s.key])):"complete"==this.linkage?(l=this.dists[a.key][s.key],this.dists[a.key][s.key]n.maxSnpPValue)})),r=function(t){var e=new Set;return t.map((function(t){e.add(t.trait)})),Array.from(e).sort()}(i),l=d3.select(this).selectAll(".qtl-annotations").data([t]);l.enter().append("g").attr("class","qtl-annotations"),l.attr({transform:"translate("+n.layout.x+","+n.layout.y+")"}),a(l,t,r.length),n.border&&((e=l).select("rect.border").empty()&&e.append("rect").classed("border",!0),e.select("rect.border").attr({width:n.layout.width,height:n.layout.height})),l.exit().remove();var s=d3.select(this).selectAll(".snp-annotations").data([t]);s.enter().append("g").attr("class","snp-annotations"),s.attr({transform:"translate("+n.layout.x+","+n.layout.y+")"}),function(t,e,a,i){var r={};i.map((function(t,e){r[t]=e}));var l=o(),s=t.selectAll("rect.snp-annotation").data(a,(function(t){return t.id})),c=function(t){return n.layout.width-.2*n.layout.chromosomeWidth*(1+r[t.trait])},u=function(t){return l(t.midpoint)-.5*Math.max(4/n.scale,l(10))},d=Math.max(4/n.scale,l(10)),h=.2*n.layout.chromosomeWidth;s.attr({x:c,y:u,width:h,height:d}),s.enter().append("rect").attr({fill:function(t){return t.color},opacity:function(t){return t.importance},class:"snp-annotation",x:c,y:u,width:h,height:d}),s.exit().remove(),s.on("contextmenu",(function(t){log.trace("SNP Context Menu");var o=d3.select("#clusterPopover");o.attr("class","popover");var a=o.select(".popover-title");a.selectAll("*").remove(),a.text("");var i=o.select(".popover-content");i.selectAll("*").remove(),i.text(""),a.append("span").text("SNP: "),a.append("a").attr("href",t.link).text(t.label),i.selectAll("p").data([["Chromsome "+e.number,t.midpoint],["p-value",Number(t.pvalue).toExponential()],["Trait",t.trait]]).enter().append("p").classed("popover-annotation",!0).text((function(t){return t[0]+": "+t[1]})),$clusterPopover=$("#clusterPopover"),$clusterPopover.modalPopover({target:$(this),$parent:$(this),"modal-position":"body",placement:"left",boundingSize:n.drawing}),$clusterPopover.modalPopover("show"),$clusterPopover.on("mousedown mousewheel",(function(t){log.info("popover click"),t.stopPropagation()}))}))}(s,t,i,r),s.exit().remove()}))}return i.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,i):n.onAnnotationSelectFunction},i.layout=function(t){return arguments.length?(n.layout=t,i):n.layout},i.drawing=function(t){return arguments.length?(n.drawing=t,i):n.drawing},i.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,i):n.longestChromosome},i.chromosomeWidth=function(t){return arguments.length?(n.chromosomeWidth=t,i):n.chromosomeWidth},i.annotationLabelSize=function(t){return arguments.length?(n.annotationLabelSize=t,i):n.annotationLabelSize},i.annotationMarkerSize=function(t){return arguments.length?(n.annotationMarkerSize=t,i):n.annotationMarkerSize},i.showAnnotationLabels=function(t){return arguments.length?(n.showAnnotationLabels=t,i):n.showAnnotationLabels},i.maxSnpPValue=function(t){return arguments.length?(n.maxSnpPValue=t,i):n.maxSnpPValue},i.infoBoxManager=function(t){return arguments.length?(n.infoBoxManager=t,i):n.infoBoxManager},i.scale=function(t){return arguments.length?(n.scale=t,i):n.scale},i},(GENEMAP=GENEMAP||{}).QTLAnnotationLayout=function(t){var e=_.merge({},{scale:1,longestChromosome:1e3,showAllQTLs:!0,showSelectedQTLs:!0,showAutoQTLLabels:!0,showSelectedQTLLabels:!0,annotationLabelSize:5},t),n=GENEMAP.QtlPositioner(),o=function(){return d3.scale.linear().range([0,e.layout.height]).domain([0,e.longestChromosome])},a=function(t){return t.map((function(t){var e=s(t),n=e.reduce((function(t,e){return Math.min(t,e.start)}),1/0),o=e.reduce((function(t,e){return Math.max(t,e.end)}),0),a=e.reduce((function(t,e){return t+(t?"|":"")+e.start+"-"+e.end}),""),i=(n+o)/2;if(1==e.length)(r=e[0]).type="qtl",r.index=t.index,r.parentIndex=t.parentIndex;else var r={cluster:t,index:t.index,parentIndex:t.parentIndex,qtlList:e,color:e[0].color,count:e.length,start:n,end:o,midpoint:i,chromosome:e[0].chromosome,type:"qtllist",id:a};return r}))},i=function(t){log.trace("---START---");var i=function(t){var o=[];if(e.showAllQTLs){t.layout.qtlDisplayClusters=t.layout.qtlClusters.slice();for(var i=t.layout.qtlDisplayClusters,r=Math.ceil(Math.floor(e.scale-.1)/2);r--;)i=l(i);for(var s=i.length;(o=a(i),(o=n.sortQTLAnnotations(o)).reduce((function(t,e){return Math.max(t,e.position)}),0)<2)&&s!=(i=l(i)).length;)s=i.length}else e.showSelectedQTLs&&(t.layout.qtlDisplayClusters=t.annotations.qtls.filter((function(t){return t.selected})),o=(i=t.layout.qtlDisplayClusters).map((function(t){return result=t,result.type="qtl",result})));return o}(t);i.forEach((function(t){t.displayLabel=!1}));var r=i.filter((function(t){return"qtl"==t.type}));if(e.showAutoQTLLabels){var s=(i=n.sortQTLAnnotations(i)).reduce((function(t,e){return Math.max(t,e.position)}),0);log.trace("maxPosition",s),r.forEach((function(t){t.label.length>15?t.screenLabel=t.label.substring(0,12)+"...":t.screenLabel=t.label}));var c=(d=14/e.scale)>.6*e.layout.chromosomeWidth;s>3||c?r.forEach((function(t){t.displayLabel=!1})):(!function(t){log.trace("Do label layout");var a=_.groupBy(t,"position");_.forOwn(a,(function(t,a){log.trace("-Col ",a),log.trace("positions ",t.map((function(t){return t.position})));var i=14/e.scale,r=o(),l=(t=n.sortQTLLabels(t,r,i)).reduce((function(t,e){return Math.max(e.labelPosition,t)}),0);log.trace("labelPositions ",t.map((function(t){return t.labelPosition}))),log.trace("maxLabelPosition",l),t.forEach((function(t){t.labelPosition>1?t.displayLabel=!1:(t.displayLabel=!0,t.labelPosition=t.position+.4)})),log.trace("labelPositions",t.map((function(t){return t.labelPosition})))}))}(r),r.forEach((function(t){t.fontSize=d})))}if(e.showSelectedQTLLabels&&!e.showAutoQTLLabels){var u=i.filter((function(t){return t.selected})),d=14/e.scale,h=.3*e.layout.chromosomeWidth;u.forEach((function(t){t.displayLabel=!0,t.screenLabel=t.label,t.fontSize=Math.min(d,2*h)})),(u=n.sortQTLAnnotationsWithLabels(u,o(),e.annotationLabelSize)).forEach((function(t){t.position=t.comboPosition,t.labelPosition=t.comboPosition+.4}))}return i},r=function(t,e){if(t.index=e.index,e.index=e.index+1,t.value)t.unit=!0,t.start=t.value.start,t.end=t.value.end;else{var n=t.left,o=t.right;n.parentIndex=t.index,o.parentIndex=t.index,r(n,e),r(o,e),t.unit=n.unit&&o.unit&&n.start==o.start&&n.end==o.end,t.start=Math.min(t.left.start,t.right.start),t.end=Math.max(t.left.end,t.right.end)}},l=function(t){var e=[];return t.forEach((function(t){if(t.value||t.unit)e.push(t);else{var n=t.left,o=t.right;e.push(n),e.push(o)}})),e},s=function(t){return 1==t.size?[t.value]:s(t.left).concat(s(t.right))};return my={},my.layoutChromosome=function(t){t.layout.qtlNodes=i(t)||t.layout.qtlNodes},my.computeChromosomeClusters=function(t){t.layout.qtlClusters=function(t){var e=hcluster.hcluster(t.annotations.qtls,(function(t,e){if(t.end==e.end&&t.start==e.start)return 0;var n=Math.min(t.end,e.end)-Math.max(t.start,e.start),o=t.end-t.start,a=e.end-e.start,i=n,r=Math.abs(o-a);return Math.max(.1,r-i)}),"single",null),n={index:0};return e.forEach((function(t){r(t,n)})),e}(t)},my},(GENEMAP=GENEMAP||{}).QtlPositioner=function(){var t={positionAnnotations:function(t,e,n,o,a,i){for(var r,l,s=o,c=i,u=a,d=t.sort((function(t,e){return u(t)-u(e)})),h=[],p=0;p0?n[0].childNodes[0].nodeValue:null},e=function(e){for(var n,o,a,i,r={features:[]},l=e.getElementsByTagName("feature"),s=0;s=n.showThreshold),n.maxSize&&a>n.maxSize&&(o.size=n.maxSize/e.scale)}return o};return{decorateGenome:function(t){var o=t,a=e.width*(1-e.margin.left-e.margin.right),i=e.height*(1-e.margin.top-e.margin.bottom),r=Math.min(e.numberPerRow,o.chromosomes.length),l=Math.ceil(o.chromosomes.length/r);log.trace("numberPerRow= "+e.numberPerRow+", chromosomes.length= "+o.chromosomes.length),log.trace("Cols= "+r+", rows= "+l);var s={width:a/r,height:i/l},c={top:s.height*e.cellMargin.top,bottom:s.height*e.cellMargin.bottom,left:s.width*e.cellMargin.left,right:s.width*e.cellMargin.right},u=e.labelHeight*s.height,d=e.labelHeight*s.height,h=s.height-u-d-c.top-c.bottom,p=Math.min(65/e.scale,h*e.chromosomeAspectRatio),m=(s.width-p-c.left-c.right)/2,f=Math.max.apply(null,o.chromosomes.map((function(t){return t.length}))),g={label:_.pick(e.annotations.label,["size","show"]),marker:_.pick(e.annotations.marker,["size","show"])};g.label=n(g.label,e.annotations.label),g.marker=n(g.marker,e.annotations.marker);var y={chromosomePosition:{height:h,width:p,x:c.left+m,y:c.top+u},labelPosition:{height:u,width:s.width-c.left-c.right,chromosomeWidth:p,x:c.left,y:c.top},sizeLabelPosition:{cellHeight:h,height:d,width:s.width-c.left-c.right,x:c.left,y:c.top+u},qtlAnnotationPosition:{height:h,width:m,chromosomeWidth:p,x:c.left,y:c.top+u},geneAnnotationPosition:{height:h,width:m,x:c.left+m+p,y:c.top+u},longestChromosome:f,annotations:g,scale:e.scale};return 1==o.chromosomes.length&&(y.chromosomePosition.x=c.left+.5*m,y.geneAnnotationPosition.x=c.left+.5*m+p,y.qtlAnnotationPosition.width=.5*m,y.geneAnnotationPosition.width=1.5*m,y.labelPosition.x=c.left+.5*m,y.labelPosition.width=p,y.sizeLabelPosition.x=c.left+.5*m,y.sizeLabelPosition.width=p),o.drawing=_.pick(e,["width","height"]),o.drawing.margin={top:e.margin.top*o.drawing.height,left:e.margin.left*o.drawing.width,bottom:e.margin.bottom*o.drawing.height,right:e.margin.right*o.drawing.width},o.chromosomes.forEach((function(t,n){var o=n%e.numberPerRow,a=Math.floor(n/e.numberPerRow);t.cell={y:a*s.height+e.margin.top*e.height,x:o*s.width+e.margin.left*e.width,width:s.width,height:s.height}})),o.cellLayout=y,o},width:function(t){return arguments.length?(e.width=t,this):e.width},height:function(t){return arguments.length?(e.height=t,this):e.height},numberPerRow:function(t){return arguments.length?(e.numberPerRow=t,this):e.numberPerRow},margin:function(t){return arguments.length?(e.margin=_.merge(e.margin,t),this):e.margin},labelHeight:function(t){return arguments.length?(e.labelHeight=t,this):e.labelHeight},cellMargin:function(t){return arguments.length?(e.cellMargin=t,this):e.cellMargin},chromosomeAspectRatio:function(t){return arguments.length?(e.chromosomeAspectRatio=t,this):e.chromosomeAspectRatio},scale:function(t){return arguments.length?(e.scale=t,this):e.scale}}},(GENEMAP=GENEMAP||{}).BasemapXmlReader=function(){var t=function(t){return{index:t.getAttribute("index"),start:t.getElementsByTagName("start")[0].childNodes[0].nodeValue,end:t.getElementsByTagName("end")[0].childNodes[0].nodeValue,color:t.getElementsByTagName("color")[0].childNodes[0].nodeValue}},e=function(e){for(var n={index:e.getAttribute("index"),length:e.getAttribute("length"),number:e.getAttribute("number"),bands:[]},o=e.getElementsByTagName("band"),a=0;a').appendTo(document.body),"static"!=this.options.backdrop&&this.$backdrop.click(t.proxy(this.hide,this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),o?this.$backdrop.one(t.support.transition.end,e):e(),this.bodyIsOverflowing&&this.$navbar.css({paddingRight:this.scrollbarWidth})}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(t.support.transition.end,t.proxy(this.removeBackdrop,this)):this.removeBackdrop(),this.$body.removeClass("modal-open"),this.$navbar.css({paddingRight:0}),this.$body.css({paddingRight:0})):e&&e()}}),t.fn.modalPopover=function(n){return this.each((function(){var o=t(this),a="string"==typeof n?o.data("modal-popover"):void 0,i=t.extend({},t.fn.modalPopover.defaults,o.data(),"object"==typeof n&&n);i.$parent=i.$parent||a&&a.$parent||t(i.target),a||o.data("modal-popover",a=new e(this,i)),"string"==typeof n&&a[n]()}))},t.fn.modalPopover.Constructor=e,t.fn.modalPopover.defaults=t.extend({},t.fn.modal.defaults,{placement:"right",modalPosition:"body",keyboard:!0,backdrop:!0}),t((function(){t("body").on("click.modal-popover.data-api",'[data-toggle="modal-popover"]',(function(e){var n=t(this),o=n.attr("href"),a=t(n.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,"")),i=a.data("modal-popover")?"toggle":t.extend({remote:!/#/.test(o)&&o},a.data(),n.data());i.$parent=n,e.preventDefault(),a.modalPopover(i).modalPopover("show").one("hide",(function(){n.focus()}))}))}))}(window.jQuery),(GENEMAP=GENEMAP||{}).Chromosome=function(t){var e={border:!1,longestChromosome:100,bands:"basemap",layout:{width:10,height:100,x:0,y:0},scale:1,onAnnotationSelectFunction:$.noop(),drawing:null},n=_.merge({},e,t),o=function(){return d3.scale.linear().range([0,n.layout.height]).domain([0,n.longestChromosome])},a=function(t){var e=o(),a=e(t.length),l=d3.select(this);l.attr({id:"chromosome_"+t.number,transform:"translate("+n.layout.x+","+n.layout.y+")"}),l.select("defs").html("").append("mask").attr({id:"chromosome_mask_"+t.number}).append("rect").attr({class:"mask_rect"}),l.select("#chromosome_mask_"+t.number).attr({width:n.layout.width,height:a});var s={width:n.layout.width,height:a,rx:Math.min(.25*n.layout.width,.01*n.layout.height),ry:Math.min(.25*n.layout.width,.01*n.layout.height)};l.select(".mask_rect").attr(s),l.select("rect.background").attr(s),l.select("rect.outline").attr(s);var c=[],u=function(){var t=l.selectAll("rect.selection").data(c);t.enter().append("rect").attr("class","selection").style({fill:"gray",opacity:.2}),t.attr({x:0,y:function(t){return Math.min(t.start,t.end)},width:n.layout.width,height:function(t){return Math.abs(t.end-t.start)}}),t.exit().remove()},d=d3.behavior.drag().on("dragstart",(function(t){var e=d3.mouse(this);c.push({start:e[1],end:e[1]}),u(),d3.event.sourceEvent.stopPropagation()})).on("drag",(function(t){c[0].end=d3.event.y,u(),d3.event.sourceEvent.stopPropagation(),d3.event.sourceEvent.preventDefault()})).on("dragend",(function(o){d3.event.sourceEvent.stopPropagation();var a=e.invert(c[0].start),i=e.invert(c[0].end);if(a>i){var r=a;a=i,i=r}t.layout.geneBandNodes.filter((function(t){return t.data.midpoint>a&&t.data.midpoint2?o={y:t(e.start),height:a}:(height=Math.min(2/n.scale,2),o={y:t(e.midpoint)-height/2,height:height}),o.fill=e.color,o.width=n.layout.width,o["fill-opacity"]=.8,o["stroke-dasharray"]=[0,n.layout.width,o.height,n.layout.width+o.height],o["stroke-width"]=n.layout.width/5,o}(a,t),d3.select(this).attr(attribs)})),r.classed("selected",(function(t){return t.data.selected})),i.data(e.bands).attr({width:n.layout.width,y:function(t){return a(t.start)},height:function(t){return a(t.end-t.start)},fill:function(t){return t.color}}),r.on("click",(function(t){"gene"==t.data.type&&(log.info("gene annotation click"),!t.data.displayed||t.data.visible||t.data.hidden?t.data.visible=!t.data.visible:(t.data.visible=!1,t.data.hidden=!0),n.onAnnotationSelectFunction()),"geneslist"==t.data.type&&(log.info("geneslist annotation click"),clusterCurrentlyHidden=t.data.genesList.some((function(t){return!t.displayed})),t.data.genesList.forEach((function(t){t.visible=clusterCurrentlyHidden,t.hidden=!clusterCurrentlyHidden})),n.onAnnotationSelectFunction())})),r.exit().remove()};function l(t){t.each((function(t){var e=d3.select(this).selectAll(".chromosome").data([t]),o=e.enter().append("g").attr("class","chromosome");o.append("defs"),o.append("rect").classed("background",!0),o.append("g").classed("bands_container",!0),o.append("rect").classed("outline",!0),n.border&&o.append("rect").classed("border",!0),e.each(a),e.exit().remove()}))}return l.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,l):n.onAnnotationSelectFunction},l.layout=function(t){return arguments.length?(n.layout=t,l):n.layout},l.drawing=function(t){return arguments.length?(n.drawing=t,l):n.drawing},l.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,l):n.longestChromosome},l.bands=function(t){return arguments.length?(n.bands=t,l):n.bands},l.scale=function(t){return arguments.length?(n.scale=t,l):n.scale},l.infoBoxManager=function(t){return arguments.length?(n.infoBoxManager=t,l):n.infoBoxManager},l},(GENEMAP=GENEMAP||{}).ChromosomeCell=function(t){var e={border:!1,onAnnotationSelectFunction:$.noop(),onExpandClusterFunction:$.noop(),onLabelSelectFunction:$.noop(),maxAnnotationLayers:3,maxSnpPValue:1,svg:null},n=_.merge({},e,t);function o(t){t.each((function(t){var e=t.cellLayout,o=d3.select(this).selectAll(".chromosome-cell").data(t.chromosomes),a=o.enter().append("g").attr("class","chromosome-cell");n.border&&a.append("rect").classed("border",!0),o.attr({transform:function(t){return"translate("+t.cell.x+","+t.cell.y+")"}}),n.border&&o.select("rect").attr({x:0,y:0,width:function(t){return t.cell.width},height:function(t){return t.cell.height}});t.chromosomes.length;var i=GENEMAP.GeneAnnotations().onAnnotationSelectFunction(n.onAnnotationSelectFunction).onExpandClusterFunction(n.onExpandClusterFunction).layout(e.geneAnnotationPosition).longestChromosome(e.longestChromosome).chromosomeWidth(e.chromosomePosition.width).annotationLabelSize(e.annotations.label.size).annotationMarkerSize(e.annotations.marker.size).drawing(n.svg).scale(e.scale);o.call(i);var r=GENEMAP.Chromosome().layout(e.chromosomePosition).longestChromosome(e.longestChromosome).onAnnotationSelectFunction(n.onAnnotationSelectFunction).scale(e.scale).bands("genes").drawing(n.svg);o.call(r);var l=GENEMAP.ChromosomeLabel().layout(e.labelPosition).sizeLayout(e.sizeLabelPosition).onLabelSelectFunction(n.onLabelSelectFunction).longestChromosome(e.longestChromosome).scale(e.scale);o.call(l);var s=GENEMAP.QtlAnnotations().onAnnotationSelectFunction(n.onAnnotationSelectFunction).layout(e.qtlAnnotationPosition).longestChromosome(e.longestChromosome).chromosomeWidth(e.chromosomePosition.width).annotationLabelSize(e.annotations.label.size).annotationMarkerSize(e.annotations.marker.size).showAnnotationLabels(e.annotations.label.show).maxSnpPValue(n.maxSnpPValue).drawing(n.svg).scale(e.scale);o.call(s),o.exit().remove()}))}return o.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,o):n.onAnnotationSelectFunction},o.onExpandClusterFunction=function(t){return arguments.length?(n.onExpandClusterFunction=t,o):n.onExpandClusterFunction},o.onLabelSelectFunction=function(t){return arguments.length?(n.onLabelSelectFunction=t,o):n.onLabelSelectFunction},o.infoBoxManager=function(t){return arguments.length?(n.infoBoxManager=t,o):n.infoBoxManager},o.maxAnnotationLayers=function(t){return arguments.length?(n.maxAnnotationLayers=t,o):n.maxAnnotationLayers},o.maxSnpPValue=function(t){return arguments.length?(n.maxSnpPValue=t,o):n.maxSnpPValue},o.svg=function(t){return arguments.length?(n.svg=t,o):n.svg},o},(GENEMAP=GENEMAP||{}).ChromosomeLabel=function(t){var e={border:!1,layout:{width:100,height:20,x:0,y:0},sizeLayout:{width:100,height:20,x:0,y:0},scale:1,onLabelSelectFunction:function(t){alert("Click"+t.number)},labelSize:10,longestChromosome:100},n=_.merge({},e,t);function o(t){t.each((function(t){var e=d3.select(this).selectAll(".chromosome-label").data([t]);(o=e.enter().append("g").attr("class","chromosome-label")).append("text"),n.border&&o.append("rect").classed("border",!0),e.attr({transform:"translate("+n.layout.x+","+n.layout.y+")"}),e.select("text").attr({x:.5*n.layout.width,y:.5*n.layout.height}).style({"font-size":Math.max(14/n.scale,1.2*n.layout.chromosomeWidth)+"px"}).text(t.number).on("click",n.onLabelSelectFunction),n.border&&e.select("rect").attr({width:n.layout.width,height:n.layout.height}),e.exit().remove();var o,a=d3.select(this).selectAll(".chromosome-size-label").data([t]);(o=a.enter().append("g").attr("class","chromosome-size-label")).append("text");var i,r=n.sizeLayout.y+n.sizeLayout.cellHeight*t.length/n.longestChromosome,l=1.2*n.labelSize/Math.min(5,n.scale)+"px";a.attr({transform:"translate("+n.sizeLayout.x+","+r+")"}),a.select("text").attr({x:.5*n.sizeLayout.width,y:0,dy:"1em"}).style({"font-size":l}).text((i=t.length)<1e3?i:i<1e6?(i/1e3).toFixed(1)+"Kb":(i/1e6).toFixed(1)+"Mb"),a.exit().remove()}))}return o.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,o):n.longestChromosome},o.layout=function(t){return arguments.length?(n.layout=t,o):n.layout},o.sizeLayout=function(t){return arguments.length?(n.sizeLayout=t,o):n.sizeLayout},o.scale=function(t){return arguments.length?(n.scale=t,o):n.scale},o.onLabelSelectFunction=function(t){return arguments.length?(n.onLabelSelectFunction=t,o):n.onLabelSelectFunction},o},(GENEMAP=GENEMAP||{}).GeneAnnotationLayout=function(t){var e=_.merge({},{longestChromosome:100,layout:{width:10,height:100,x:0,y:0},autoLabels:!0,manualLabels:!0,annotationMarkerSize:5,annotationLabelSize:5,doCluster:!0,nClusters:6,nGenesToDisplay:1e3,maxAnnotationLayers:3,displayedFontSize:13,scale:1},t),n=function(t,n,o,a,i){return par={},par.scale=t,par.availableHeight=i,par.lineSpacing=1,par.layerGap=n*(.1+.1/t),par.spaceForLabel=n-par.layerGap,par.setFontSize=Math.min(par.spaceForLabel/o*3.5,a/e.scale),par.nodeSpacing=par.setFontSize,par.nLabels=.4*i/(par.nodeSpacing+par.lineSpacing),par.density=1,par},o=function(t,e,n,o){o.forEach((function(t){t.displayed=!0,t.fontSize=n.setFontSize}));var a=o.map((function(t){return new labella.Node(e(t.midpoint),n.setFontSize,t)}));try{t.nodes(a).compute()}catch(t){if(t instanceof RangeError)return null;throw t}return a},a=function(t){allGenes=t.annotations.allGenes.filter((function(t){return t.globalIndexo;return r?2:(r=(i=(a=e-e*(.1+.1/t))/n*4)*t>o)?1:0}(e.scale,i,l,s);2==u?a=function(t,n,o,a,i){var r={};return r.scale=t,r.availableHeight=i,r.lineSpacing=1,r.setFontSize=Math.min(n/3/o*3.5,a/e.scale),r.nodeSpacing=r.setFontSize,r.spaceForLabel=1.3*o*r.setFontSize/3.5,r.layerGap=Math.min(5*r.setFontSize,n/3),r.density=.9,r.nLabels=.6*i/(r.nodeSpacing+r.lineSpacing),r}(e.scale,i,l,c,r):1==u?a=n(e.scale,i,l,c,r):0==u&&((a=n(e.scale,i,l,c,r)).nLabels=0);var d=d3.scale.linear().range([0,e.layout.height]).domain([0,e.longestChromosome]);forceConfig={nodeSpacing:a.nodeSpacing,lineSpacing:a.lineSpacing,algorithm:"overlap",minPos:0,maxPos:a.availableHeight,density:a.density};var h=new labella.Force(forceConfig);allGenes.forEach((function(t){t.displayed=!1}));var p=e.manualLabels?new Set(allGenes.filter((function(t){return t.visible}))):new Set;e.autoLabels&&allGenes.slice(0,a.nLabels).filter((function(t){return!t.hidden})).forEach((function(t){p.add(t)}));var m,f=Array.from(p),g=o(h,d,a,f);if(g||(h.options({algorithm:"simple"}),g=o(h,d,a,f)),g){var y=g.map((function(t){return t.getLayerIndex()}));m=Math.max.apply(null,y)}if(!g||m>3){log.trace("Too many lables to display - clustering instead");var b=GENEMAP.GeneClusterer().nClusters(Math.max(a.nLabels,1));try{var v=b.createClustersFromGenes(f)}catch(t){log.info(f),v=[]}g=o(h,d,a,v)}renderConfig={direction:"right",layerGap:a.layerGap,nodeHeight:a.spaceForLabel};var x=new labella.Renderer(renderConfig);return x.layout(g),g.forEach((function(t){t.data.path=x.generatePath(t)})),g};return my={},my.layoutChromosome=function(t){t.layout.annotationNodes=a(t)||t.layout.annotationNodes},my.computeChromosomeClusters=function(t){t.layout.annotationClusters=function(t){var e=GENEMAP.GeneClusterer(),n=t.annotations.genes;return e.createClustersFromGenes(n)}(t),t.layout.annotationDisplayClusters=t.layout.annotationClusters.slice()},my.expandAllChromosomeClusters=function(t){t.layout.annotationDisplayClusters=t.annotations.genes},my.collapseAllChromosomeClusters=function(t){t.layout.annotationDisplayClusters=t.layout.annotationClusters.slice()},my.expandAChromosomeCluster=function(t,e){t.layout.annotationDisplayClusters=t.layout.annotationClusters.slice(),e.genesList.forEach((function(e){t.layout.annotationDisplayClusters.push(e)}));var n=t.layout.annotationDisplayClusters.indexOf(e);t.layout.annotationDisplayClusters.splice(n,1)},my.computeNormalisedGeneScores=function(t){var e=t.reduce((function(t,e){return t.concat(e.annotations.genes.filter((function(t){return t.displayed})))}),[]);if(e.every((function(t){return t.score}))){var n=e.reduce((function(t,e){return Math.max(t,e.score)}),0),o=e.reduce((function(t,e){return Math.min(t,e.score)}),0);e.forEach((function(t){t.normedScore=.5*(t.score-o)/(n-o)+.5}))}else e.forEach((function(t){t.normedScore=null}))},my},(GENEMAP=GENEMAP||{}).GeneAnnotationPopup=function(t){var e={onAnnotationSelectFunction:$.noop(),drawing:null,popoverId:""},n=_.merge({},e,t),o={show:function(t){t.visible=!0},hide:function(t){t.visible=!1,t.hidden=!0},auto:function(t){t.visible=!1,t.hidden=!1}},a=function(t,e){t.select("span.genelabel").text((function(t){return t.label})).style("font-weight",(function(t){return t.selected?"bold":"normal"})).style("opacity",(function(t){return t.visible||t.selected?1:t.normedScore?t.normedScore:t.importance})).style("color",(function(t){return e.visible||e.selected?e.color:null}));var n=t.select("div.btn-group");footerLinks=n.selectAll("a").data(["show","hide","auto"]),footerLinks.classed("disabled",(function(t){return"show"==t&&e.visible||"hide"==t&&e.hidden&&!e.visible||"auto"==t&&!e.hidden&&!e.visible}))},i={};return i.geneAnnotationsPopoverFunction=function(t){var e="geneslist"==t.data.type;log.trace("Gene Annotation Context Menu"),d3.select(n.popoverId).attr("class","popover"),popoverTitle=d3.select(n.popoverId).select(".popover-title"),popoverContent=d3.select(n.popoverId).select(".popover-content"),popoverTitle.selectAll("*").remove(),popoverTitle.text(""),popoverContent.selectAll("*").remove(),popoverContent.text(""),e?function(t,e,i){var r=i.data.genesList,l=e.selectAll("p").data(r);t.append("span").text("Cluster"),links=t.append("div.btn-group").selectAll("a").data(["show","hide","auto"]),links.enter().append("a").attr("href","#").text((function(t){return t})).classed("btn btn-small",!0).on("click",(function(t){var e=o[t];r.forEach(e),l.each((function(t){var e=d3.select(this);a(e,t)})),d3.event.preventDefault(),n.onAnnotationSelectFunction()}));var s=l.enter().append("p");s.append("span").classed("genelabel",!0),s.append("div").classed("btn-group",!0),l.each((function(t){var e=d3.select(this),i=e.select("div.btn-group");footerLinks=i.selectAll("a").data(["show","hide","auto"]),footerLinks.enter().append("a").attr("href","#").text((function(t){return t})).classed("btn btn-small",!0).on("click",(function(i){(0,o[i])(t),n.onAnnotationSelectFunction(),d3.event.preventDefault(),a(e,t)}))})),l.each((function(t){var e=d3.select(this);a(e,t)}))}(popoverTitle,popoverContent,t):function(t,e,a){var i=a.data;t.append("a").attr({href:i.link}).text(i.label),e.append("p").text("Chromosome "+i.chromosome+": "+i.start+"-"+i.end),i.score&&e.append("p").text("Score: "+parseFloat(i.score).toFixed(3)),e.append("hr");var r=e.append("p").style("float","right"),l=function(){footerLinks=r.selectAll("a").data(["show","hide","auto"]),footerLinks.enter().append("a").attr("href","#").text((function(t){return t})).classed("btn btn-small",!0).on("click",(function(t){(0,o[t])(i),n.onAnnotationSelectFunction(),d3.event.preventDefault(),l()})),footerLinks.classed("disabled",(function(t){return"show"==t&&i.visible||"hide"==t&&i.hidden&&!i.visible||"auto"==t&&!i.hidden&&!i.visible}))};l()}(popoverTitle,popoverContent,t);var i=d3.select(this).select("text");$(n.popoverId).modalPopover({target:$(i[0]),parent:$(i[0]),"modal-position":"relative",placement:"right",boundingSize:n.drawing}),$(n.popoverId).modalPopover("show"),$(n.popoverId).on("mousedown mousewheel",(function(t){log.trace("popover click"),t.stopPropagation()}))},i},(GENEMAP=GENEMAP||{}).GeneAnnotations=function(t){var e={border:!1,labelRectangles:!1,onAnnotationSelectFunction:$.noop(),onExpandClusterFunction:$.noop(),longestChromosome:100,layout:{width:10,height:100,x:0,y:0},chromosomeWidth:20,annotationMarkerSize:5,annotationLabelSize:5,scale:null,drawing:null},n=_.merge({},e,t),o=null,a=function(t,e){_.pick(n,["onAnnotationSelectFunction","drawing"]);n.popoverId="#clusterPopover",o=GENEMAP.GeneAnnotationPopup(n),log.trace("setupGeneAnnotations");var a=d3.scale.linear().range([0,n.layout.height]).domain([0,n.longestChromosome]),i=t.selectAll("g.gene-annotation").data(e.layout.annotationNodes,(function(t){return t.data.id})),r=i.enter().append("g").classed("gene-annotation",!0);r.append("line").classed("midpoint-line",!0),r.append("path").classed("link",!0).attr({d:function(t){return t.data.path}}),n.labelRectangles&&r.append("rect").classed("labella",!0),r.append("text").attr({x:function(t){return t.x+.1*n.annotationLabelSize},y:function(t){return t.y+.4*n.annotationLabelSize}}),i.attr("id",(function(t){return"feature_"+t.data.id})),i.classed("selected",(function(t){return t.data.selected})),i.select("line.midpoint-line").attr({x1:-.5*n.chromosomeWidth,y1:function(t){return a(t.data.midpoint)},y2:function(t){return a(t.data.midpoint)},x2:0}),i.select("text").text((function(t){return"gene"==t.data.type?t.data.label:"geneslist"==t.data.type?"("+t.data.genesList.length+")":void 0})),n.labelRectangles&&i.select("rect.labella").attr({fill:"pink",stroke:"none",x:function(t){return t.x},y:function(t){return t.y-t.dy/2},width:function(t){return t.dx},height:function(t){return t.dy}});var l="0.5";GENEMAP.vectorEffectSupport||(l=.5/n.scale),i.select("path.link").style("opacity",(function(t){return t.data.visible||t.data.selected?1:t.data.normedScore?t.data.normedScore:t.data.importance})).style("stroke-width",(function(t){return l})).style("stroke",(function(t){return t.data.visible||t.data.selected?t.data.color:"gray"})),i.select("text").style("font-size",(function(t){return(t.data.selected?.2:0)+t.data.fontSize+"px"})).style("font-weight",(function(t){return t.data.selected?"bold":"normal"})).style("opacity",(function(t){return t.data.visible||t.data.selected?1:t.data.normedScore?t.data.normedScore:t.data.importance})).style("fill",(function(t){return t.data.visible||t.data.selected?t.data.color:null})),i.select("text").transition().duration(300).attr({x:function(t){return t.x+.1*n.annotationLabelSize},y:function(t){return t.y+.4*n.annotationLabelSize}}),i.select("path.link").transition().duration(300).attr({d:function(t){return t.data.path}}),i.on("click",(function(t){"gene"==t.data.type&&(log.info("gene annotation click"),t.data.selected=!t.data.selected,t.data.selected&&(t.data.visible=!0),n.onAnnotationSelectFunction()),"geneslist"==t.data.type&&(log.trace("geneslist annotation click"),n.onExpandClusterFunction(e,t.data))})),i.on("contextmenu",o.geneAnnotationsPopoverFunction),i.exit().remove()};function i(t){t.each((function(t){var e,o=d3.select(this).selectAll(".gene-annotations").data([t]);o.enter().append("g").attr("class","gene-annotations"),o.attr({transform:"translate("+n.layout.x+","+n.layout.y+")",id:function(t){return"annotation_"+t.number}}),a(o,t),n.border&&((e=o).select("rect.border").empty()&&e.append("rect").classed("border",!0),e.select("rect.border").attr({width:n.layout.width,height:n.layout.height})),o.exit().remove()}))}return i.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,i):n.onAnnotationSelectFunction},i.onExpandClusterFunction=function(t){return arguments.length?(n.onExpandClusterFunction=t,i):n.onExpandClusterFunction},i.layout=function(t){return arguments.length?(n.layout=t,i):n.layout},i.drawing=function(t){return arguments.length?(n.drawing=t,i):n.drawing},i.scale=function(t){return arguments.length?(n.scale=t,i):n.scale},i.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,i):n.longestChromosome},i.chromosomeWidth=function(t){return arguments.length?(n.chromosomeWidth=t,i):n.chromosomeWidth},i.annotationLabelSize=function(t){return arguments.length?(n.annotationLabelSize=t,i):n.annotationLabelSize},i.annotationMarkerSize=function(t){return arguments.length?(n.annotationMarkerSize=t,i):n.annotationMarkerSize},i},(GENEMAP=GENEMAP||{}).GeneBandsLayout=function(t){var e=_.merge({},{longestChromosome:100,layout:{width:10,height:100,x:0,y:0},doCluster:!0,nClusters:6,scale:1,nGenesToDisplay:1e3},t),n=function(t){if("gene"==t.type){var e=t;return result={start:e.start,end:e.end,midpoint:e.midpoint,color:e.color,data:e},result}if("geneslist"==t.type)return maxPosition=t.genesList.reduce((function(t,e){return Math.max(t,e.end)}),0),minPosition=t.genesList.reduce((function(t,e){return Math.min(t,e.start)}),1/0),result={start:minPosition,end:maxPosition,midpoint:t.midpoint,color:"#0000FF",data:t},result;log.error("unregconized cluster type"),log.info(t)},o=function(t){return d3.scale.linear().range([0,e.layout.height]).domain([0,e.longestChromosome]),t.layout.geneBandDisplayClusters.map(n)};return my={},my.layoutChromosome=function(t){t.layout.geneBandNodes=o(t)},my.computeChromosomeClusters=function(t){ly=t.layout,ly.geneBandClusters=function(t){var n=t.annotations.allGenes.filter((function(t){return t.globalIndex=0||t.height.toString().indexOf("%")>=0){var n=d3.select(e).select("svg").node().getBoundingClientRect();t.width.toString().indexOf("%")>=0&&(t.width=n.width),t.height.toString().indexOf("%")>=0&&(t.height=n.height)}return t},C=function(){var t=!1;return r&&(t=0!==r.translate()[0]||0!==r.translate()[1]||t,t=1!==r.scale()||t),t},L=function(){1==r.scale()&&_.isEqual(r.translate(),[0,0])||(r.translate([0,0]),r.scale(1),o.attr("transform","translate("+r.translate()+")scale("+r.scale()+")"),h.setFitButtonEnabled(C()),I(),H())},k=function(){log.info("Exporting whole canvas to png, scale is "+r.scale()),o.attr("transform","translate(0,0)scale(1)"),saveSvgAsPng(o[0][0],"genemap.png",{scale:r.scale()*y.pngScale}),o.attr("transform","translate("+r.translate()+")scale("+r.scale()+")")},A=function(){log.info("Exporting view to png, scale is "+r.scale()),saveSvgAsPng(n[0][0],"genemap.png",{scale:y.pngScale})};l=function(){var t=d3.event.translate;if(c){var e=n.node().getBoundingClientRect(),i=-c.drawing.width*d3.event.scale+e.width*(1-y.extraPanArea)+c.drawing.margin.right*d3.event.scale,l=e.width*y.extraPanArea-c.drawing.margin.left*d3.event.scale;t[0]=_.clamp(t[0],i,l);var u=-c.drawing.height*d3.event.scale+e.height*(1-y.extraPanArea)+c.drawing.margin.bottom*d3.event.scale,d=e.height*y.extraPanArea-c.drawing.margin.top*d3.event.scale;t[1]=_.clamp(t[1],u,d)}r.translate(t),r.scale()!=s&&(log.trace("New zoom"),I(),H()),s=r.scale(),h.setFitButtonEnabled(C()),o.attr("transform","translate("+r.translate()+")scale("+d3.event.scale+")"),a.text("translate: [ "+r.translate()[0].toFixed(1)+","+r.translate()[1].toFixed(1)+"] zoom:"+r.scale().toFixed(2))};var E=function(){log.trace("mouse down"),n.classed("dragging",!0)},S=function(){log.trace("mouse up"),n.classed("dragging",!1)},M=function(){log.trace("context click"),d3.event.preventDefault()},z=function(t){$("#clusterPopover").modalPopover("hide"),$(".genemap-advanced-menu").modalPopover("hide")},G=function(t){"auto"==t?(p=!0,m=!0,c.chromosomes.forEach((function(t){t.annotations.genes.forEach((function(t){1==t.selected&&(t.visible=!0)}))}))):"show"==t?(p=!1,m=!0):"hide"==t&&(p=!1,m=!1),c.chromosomes.forEach((function(e){e.annotations.genes.forEach((function(e){"auto"===t?delete e.showLabel:e.showLabel=t}))})),I(),H()},N=function(){var t=c.chromosomes.some((function(t){return t.annotations.genes.some((function(t){return t.selected}))}));I(),H(),d3.select(".network-btn").classed("disabled",!t)},B=function(t){d?(c=u,d=!1):(c={chromosomes:[t]},d=!0),L(),I(),H()},F=function(){var t=_.flatMap(c.chromosomes.map((function(t){return t.annotations.genes.filter((function(t){return t.selected})).map((function(t){var e=t.link,n=e.substring(e.indexOf("list="),e.length).split("=")[1];return decodeURIComponent(n.replace(/\+/g," "))}))}))),e=y.apiUrl+"/network";log.info("selected labels: "+t),generateCyJSNetwork(e,{list:t,keyword:$("#keywords").val()})},T=function(){var t,e=h.getTagButtonState();t="auto"===e?"show":"show"===e?"hide":"auto",h.setTabButtonState(t),G(t),H()},D=function(){log.info("Reset Labels"),c.chromosomes.forEach((function(t){t.annotations.allGenes.forEach((function(t){t.selected=!1,t.visible=!1,t.hidden=!1}))})),I(),H()},R=function(t){log.trace("Number per row:",t),y.layout.numberPerRow=t,V(),I(),H()},q=function(t){log.info("onToggleQTLDisplay"),"all"==t?(f=!0,g=!0):"selected"==t?(f=!1,g="true"):(f=!1,g=!1),W(),I(),H()},Q=function(){var t=GENEMAP.AutoLayoutDecorator(y.layout).width(P().width).height(P().height).scale(r.scale());c=t.decorateGenome(c)},V=function(){c.chromosomes.forEach((function(t){t.layout=t.layout||{},t.layout.annotationDisplayClusters=null,t.layout.geneBandDisplayClusters=null}))},W=function(){c.chromosomes.forEach((function(t){t.layout=t.layout||{},t.layout.qtlDisplayClusters=null}))},I=function(){Q();c.chromosomes.length;var t=GENEMAP.GeneAnnotationLayout({longestChromosome:c.cellLayout.longestChromosome,layout:c.cellLayout.geneAnnotationPosition,annotationMarkerSize:c.cellLayout.annotations.marker.size,annotationLabelSize:c.cellLayout.annotations.label.size,scale:r.scale(),autoLabels:p,manualLabels:m,nGenesToDisplay:y.nGenesToDisplay,displayedFontSize:y.annotationLabelSize}),e=GENEMAP.GeneBandsLayout({longestChromosome:c.cellLayout.longestChromosome,layout:c.cellLayout.geneAnnotationPosition,nClusters:50,scale:r.scale(),nGenesToDisplay:y.nGenesToDisplay}),n=GENEMAP.QTLAnnotationLayout({longestChromosome:c.cellLayout.longestChromosome,layout:c.cellLayout.qtlAnnotationPosition,scale:r.scale(),showAllQTLs:f,showSelectedQTLs:g,showAutoQTLLabels:f,showSelectedQTLLabels:g,annotationLabelSize:c.cellLayout.annotations.label.size});c.chromosomes.forEach((function(o){o.layout=o.layout||{},o.layout.annotationDisplayClusters||t.computeChromosomeClusters(o),t.layoutChromosome(o),o.layout.geneBandDisplayClusters||e.computeChromosomeClusters(o),e.layoutChromosome(o),o.layout.qtlDisplayClusters||n.computeChromosomeClusters(o),n.layoutChromosome(o)})),t.computeNormalisedGeneScores(c.chromosomes)},X=function(t){var n,o=t.append("svg").attr({width:y.width,height:y.height,class:"mapview"});a=t.append("div").append("span").attr({class:"logger",id:"logbar"}),i=t.append("div").attr({class:"key",id:"keybar"}),GENEMAP.vectorEffectSupport="vectorEffect"in o[0][0].style,n="mousedown mousewheel DOMMouseScroll touchstart ",$(e).off(n).on(n,(function(t){"undefined"!==t.target&&"a"===t.target.tagName.toLowerCase()||$(t.target).closest(".genemap-advanced-menu").length>0||z(t)})),$("body").on("click",(function(t){$(t.target).closest(e).length<1&&1==b&&w()})),o.on("mousedown",E).on("mouseup",S).on("contextmenu",M),o.append("g").classed("zoom_window",!0).append("rect").classed("drawing_outline",!0),y.contentBorder&&t.select(".zoom_window").append("rect").classed("drawing_margin",!0),s=1,(r=d3.behavior.zoom().scaleExtent([1,50])).on("zoom",l),t.select("svg").call(r);var c=t.append("div").attr({id:"clusterPopover",class:"popover"});return c.append("div").attr({class:"arrow"}),c.append("h3").attr({class:"popover-title"}).text("Cluster"),c.append("div").attr({class:"popover-content"}),o},H=function(){var t,i;d3.select(e).select("svg").node()?(n=d3.select(e).select("svg")).attr({width:y.width,height:y.height}):n=X(d3.select(e)),a.text("translate: [ "+r.translate()[0].toFixed(1)+","+r.translate()[1].toFixed(1)+"] zoom:"+r.scale().toFixed(2)),Q(),c.chromosomes.every((function(t){return t.layout}))||I(),n.datum(c),(o=n.select(".zoom_window")).select(".drawing_outline").attr({width:c.drawing.width,height:c.drawing.height}),y.contentBorder&&(t=c.drawing,i=c.margin,o.select(".drawing_margin").attr({x:i.left,y:i.top,width:t.width-i.left-i.right,height:t.height-i.top-i.bottom}));var l=GENEMAP.ChromosomeCell().onAnnotationSelectFunction(N).onLabelSelectFunction(B).maxAnnotationLayers(y.layout.maxAnnotationLayers).maxSnpPValue(y.maxSnpPValue).svg(n);o.call(l)};function O(t){t.each((function(t){e=this,c=u=t,d=!1,h||(h=GENEMAP.MenuBar().onTagBtnClick(T).onFitBtnClick(L).onLabelBtnClick(G).onQtlBtnClick(q).onNetworkBtnClick(F).onResetBtnClick(D).onSetNumberPerRowClick(R).initialMaxGenes(y.nGenesToDisplay).initialNPerRow(y.layout.numberPerRow).onExportBtnClick(A).onExportAllBtnClick(k).onExpandBtnClick(w).maxSnpPValueProperty(O.maxSnpPValue).nGenesToDisplayProperty(O.nGenesToDisplay).annotationLabelSizeProperty(O.annotationLabelSize)),d3.select(e).call(h),h.setNetworkButtonEnabled(!1),h.setFitButtonEnabled(!1),h.setTabButtonState("auto"),H()}))}return O.resetZoom=L,O.width=function(t){return arguments.length?(y.width=t,O):y.width},O.height=function(t){return arguments.length?(y.height=t,O):y.height},O.layout=function(t){return arguments.length?(y.layout=_.merge(y.layout,t),O):y.layout},O.draw=function(t,e,n){GENEMAP.XmlDataReader().readXMLData(e,n).then((function(e){O._draw(t,e)}))},O.drawFromRawAnnotationXML=function(t,e,n){GENEMAP.XmlDataReader().readXMLDataFromRawAnnotationXML(e,n).then((function(e){O._draw(t,e)}))},O._draw=function(t,n){d3.select(t).selectAll("div").data(["genemap-target"]).enter().append("div").attr("id",(function(t){return t})),e=d3.select(t).select("#genemap-target")[0][0],log.info("drawing genome to target"),d3.select(e).datum(n).call(O),O.nGenesToDisplay(y.initialMaxGenes),L(),function(t,e){var n=new Set,o=[];e.chromosomes.forEach((function(t){t.annotations.snps.forEach((function(t){n.has(t.trait)||null!=t.trait&&o.push({trait:t.trait,color:t.color}),n.add(t.trait)}))})),o.length>0?t.text("SNP legend: "):t.text("");var a=t.selectAll("span").data(o),i=a.enter().append("span").classed("key-item",!0);i.append("span").style("background-color",(function(t){return t.color})).classed("colorbox",!0).append("svg"),i.append("span").text((function(t){return t.trait})),a.exit().remove()}(i,c)},O.redraw=function(t){e=d3.select(t).select("#genemap-target")[0][0],x(),d3.select(e).call(O),z()},O.setGeneLabels=function(t){e&&G(t)},O.maxSnpPValue=GENEMAP.Listener(y.maxSnpPValue).addListener((function(t){var e=Number(t);log.info("Setting max PValue for SNPs to",t,"(",e,")"),isNaN(e)&&(log.info("Can't parse max PValue"),O.maxSnpPValue(y.maxSnpPValue)),y.maxSnpPValue=Number(t),I(),H()})),O.nGenesToDisplay=GENEMAP.Listener(y.nGenesToDisplay).addListener((function(t){log.info("Setting nGenes to ",t);var e=y.nGenesToDisplay;y.nGenesToDisplay=t,t!=e&&(V(),I(),H())})),O.annotationLabelSize=GENEMAP.Listener(y.annotationLabelSize).addListener((function(t){log.info("Setting annotation label size to",t),y.annotationLabelSize=t,V(),I(),H()})),O.setQtlLabels=function(t){e&&d3.select(e).datum().chromosomes.forEach((function(e){e.annotations.qtls.forEach((function(e){"auto"===t?delete e.showLabel:e.showLabel=t}))}))},O.loggingOn=function(){a.style("display","initial")},O.loggingOff=function(){a.style("display","none")},O},function(t){var e=function(t,e,n){this.distance=t,this.linkage=e,this.threshold=null==n?1/0:n};e.prototype={cluster:function(t,e,n){this.clusters=[],this.dists=[],this.mins=[],this.index=[];for(var o=0;o=this.threshold)return!1;var a=this.index[t],i=this.index[this.mins[t]],r={left:a,right:i,key:a.key,size:a.size+i.size};this.clusters[a.index]=r,this.clusters.splice(i.index,1),this.index[a.key]=r;for(n=0;nthis.dists[i.key][s.key]&&(l=this.dists[i.key][s.key])):"complete"==this.linkage?(l=this.dists[a.key][s.key],this.dists[a.key][s.key]n.maxSnpPValue)})),r=function(t){var e=new Set;return t.map((function(t){e.add(t.trait)})),Array.from(e).sort()}(i),l=d3.select(this).selectAll(".qtl-annotations").data([t]);l.enter().append("g").attr("class","qtl-annotations"),l.attr({transform:"translate("+n.layout.x+","+n.layout.y+")"}),a(l,t,r.length),n.border&&((e=l).select("rect.border").empty()&&e.append("rect").classed("border",!0),e.select("rect.border").attr({width:n.layout.width,height:n.layout.height})),l.exit().remove();var s=d3.select(this).selectAll(".snp-annotations").data([t]);s.enter().append("g").attr("class","snp-annotations"),s.attr({transform:"translate("+n.layout.x+","+n.layout.y+")"}),function(t,e,a,i){var r={};i.map((function(t,e){r[t]=e}));var l=o(),s=t.selectAll("rect.snp-annotation").data(a,(function(t){return t.id})),c=function(t){return n.layout.width-.2*n.layout.chromosomeWidth*(1+r[t.trait])},u=function(t){return l(t.midpoint)-.5*Math.max(4/n.scale,l(10))},d=Math.max(4/n.scale,l(10)),h=.2*n.layout.chromosomeWidth;s.attr({x:c,y:u,width:h,height:d}),s.enter().append("rect").attr({fill:function(t){return t.color},opacity:function(t){return t.importance},class:"snp-annotation",x:c,y:u,width:h,height:d}),s.exit().remove(),s.on("contextmenu",(function(t){log.trace("SNP Context Menu");var o=d3.select("#clusterPopover");o.attr("class","popover");var a=o.select(".popover-title");a.selectAll("*").remove(),a.text("");var i=o.select(".popover-content");i.selectAll("*").remove(),i.text(""),a.append("span").text("SNP: "),a.append("a").attr("href",t.link).text(t.label),i.selectAll("p").data([["Chromsome "+e.number,t.midpoint],["p-value",Number(t.pvalue).toExponential()],["Trait",t.trait]]).enter().append("p").classed("popover-annotation",!0).text((function(t){return t[0]+": "+t[1]})),$clusterPopover=$("#clusterPopover"),$clusterPopover.modalPopover({target:$(this),$parent:$(this),"modal-position":"body",placement:"left",boundingSize:n.drawing}),$clusterPopover.modalPopover("show"),$clusterPopover.on("mousedown mousewheel",(function(t){log.info("popover click"),t.stopPropagation()}))}))}(s,t,i,r),s.exit().remove()}))}return i.onAnnotationSelectFunction=function(t){return arguments.length?(n.onAnnotationSelectFunction=t,i):n.onAnnotationSelectFunction},i.layout=function(t){return arguments.length?(n.layout=t,i):n.layout},i.drawing=function(t){return arguments.length?(n.drawing=t,i):n.drawing},i.longestChromosome=function(t){return arguments.length?(n.longestChromosome=t,i):n.longestChromosome},i.chromosomeWidth=function(t){return arguments.length?(n.chromosomeWidth=t,i):n.chromosomeWidth},i.annotationLabelSize=function(t){return arguments.length?(n.annotationLabelSize=t,i):n.annotationLabelSize},i.annotationMarkerSize=function(t){return arguments.length?(n.annotationMarkerSize=t,i):n.annotationMarkerSize},i.showAnnotationLabels=function(t){return arguments.length?(n.showAnnotationLabels=t,i):n.showAnnotationLabels},i.maxSnpPValue=function(t){return arguments.length?(n.maxSnpPValue=t,i):n.maxSnpPValue},i.infoBoxManager=function(t){return arguments.length?(n.infoBoxManager=t,i):n.infoBoxManager},i.scale=function(t){return arguments.length?(n.scale=t,i):n.scale},i},(GENEMAP=GENEMAP||{}).QTLAnnotationLayout=function(t){var e=_.merge({},{scale:1,longestChromosome:1e3,showAllQTLs:!0,showSelectedQTLs:!0,showAutoQTLLabels:!0,showSelectedQTLLabels:!0,annotationLabelSize:5},t),n=GENEMAP.QtlPositioner(),o=function(){return d3.scale.linear().range([0,e.layout.height]).domain([0,e.longestChromosome])},a=function(t){return t.map((function(t){var e=s(t),n=e.reduce((function(t,e){return Math.min(t,e.start)}),1/0),o=e.reduce((function(t,e){return Math.max(t,e.end)}),0),a=e.reduce((function(t,e){return t+(t?"|":"")+e.start+"-"+e.end}),""),i=(n+o)/2;if(1==e.length)(r=e[0]).type="qtl",r.index=t.index,r.parentIndex=t.parentIndex;else var r={cluster:t,index:t.index,parentIndex:t.parentIndex,qtlList:e,color:e[0].color,count:e.length,start:n,end:o,midpoint:i,chromosome:e[0].chromosome,type:"qtllist",id:a};return r}))},i=function(t){log.trace("---START---");var i=function(t){var o=[];if(e.showAllQTLs){t.layout.qtlDisplayClusters=t.layout.qtlClusters.slice();for(var i=t.layout.qtlDisplayClusters,r=Math.ceil(Math.floor(e.scale-.1)/2);r--;)i=l(i);for(var s=i.length;(o=a(i),(o=n.sortQTLAnnotations(o)).reduce((function(t,e){return Math.max(t,e.position)}),0)<2)&&s!=(i=l(i)).length;)s=i.length}else e.showSelectedQTLs&&(t.layout.qtlDisplayClusters=t.annotations.qtls.filter((function(t){return t.selected})),o=(i=t.layout.qtlDisplayClusters).map((function(t){return result=t,result.type="qtl",result})));return o}(t);i.forEach((function(t){t.displayLabel=!1}));var r=i.filter((function(t){return"qtl"==t.type}));if(e.showAutoQTLLabels){var s=(i=n.sortQTLAnnotations(i)).reduce((function(t,e){return Math.max(t,e.position)}),0);log.trace("maxPosition",s),r.forEach((function(t){t.label.length>15?t.screenLabel=t.label.substring(0,12)+"...":t.screenLabel=t.label}));var c=(d=14/e.scale)>.6*e.layout.chromosomeWidth;s>3||c?r.forEach((function(t){t.displayLabel=!1})):(!function(t){log.trace("Do label layout");var a=_.groupBy(t,"position");_.forOwn(a,(function(t,a){log.trace("-Col ",a),log.trace("positions ",t.map((function(t){return t.position})));var i=14/e.scale,r=o(),l=(t=n.sortQTLLabels(t,r,i)).reduce((function(t,e){return Math.max(e.labelPosition,t)}),0);log.trace("labelPositions ",t.map((function(t){return t.labelPosition}))),log.trace("maxLabelPosition",l),t.forEach((function(t){t.labelPosition>1?t.displayLabel=!1:(t.displayLabel=!0,t.labelPosition=t.position+.4)})),log.trace("labelPositions",t.map((function(t){return t.labelPosition})))}))}(r),r.forEach((function(t){t.fontSize=d})))}if(e.showSelectedQTLLabels&&!e.showAutoQTLLabels){var u=i.filter((function(t){return t.selected})),d=14/e.scale,h=.3*e.layout.chromosomeWidth;u.forEach((function(t){t.displayLabel=!0,t.screenLabel=t.label,t.fontSize=Math.min(d,2*h)})),(u=n.sortQTLAnnotationsWithLabels(u,o(),e.annotationLabelSize)).forEach((function(t){t.position=t.comboPosition,t.labelPosition=t.comboPosition+.4}))}return i},r=function(t,e){if(t.index=e.index,e.index=e.index+1,t.value)t.unit=!0,t.start=t.value.start,t.end=t.value.end;else{var n=t.left,o=t.right;n.parentIndex=t.index,o.parentIndex=t.index,r(n,e),r(o,e),t.unit=n.unit&&o.unit&&n.start==o.start&&n.end==o.end,t.start=Math.min(t.left.start,t.right.start),t.end=Math.max(t.left.end,t.right.end)}},l=function(t){var e=[];return t.forEach((function(t){if(t.value||t.unit)e.push(t);else{var n=t.left,o=t.right;e.push(n),e.push(o)}})),e},s=function(t){return 1==t.size?[t.value]:s(t.left).concat(s(t.right))};return my={},my.layoutChromosome=function(t){t.layout.qtlNodes=i(t)||t.layout.qtlNodes},my.computeChromosomeClusters=function(t){t.layout.qtlClusters=function(t){var e=hcluster.hcluster(t.annotations.qtls,(function(t,e){if(t.end==e.end&&t.start==e.start)return 0;var n=Math.min(t.end,e.end)-Math.max(t.start,e.start),o=t.end-t.start,a=e.end-e.start,i=n,r=Math.abs(o-a);return Math.max(.1,r-i)}),"single",null),n={index:0};return e.forEach((function(t){r(t,n)})),e}(t)},my},(GENEMAP=GENEMAP||{}).QtlPositioner=function(){var t={positionAnnotations:function(t,e,n,o,a,i){for(var r,l,s=o,c=i,u=a,d=t.sort((function(t,e){return u(t)-u(e)})),h=[],p=0;p=0&&n<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(o=n,!1!==i&&function(e){var t=(a[e]||"silent").toUpperCase();try{return void(window.localStorage[c]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+t+";"}catch(e){}}(n),s.call(l,n,e),typeof console===t&&n=0&&n<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(a=n,!1!==i&&function(e){var t=(r[e]||"silent").toUpperCase();try{return void(window.localStorage[c]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+t+";"}catch(e){}}(n),o.call(l,n,e),typeof console===t&&n+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),U=new RegExp("=[\\x20\\t\\r\\n\\f]*([^\\]'\"]*?)[\\x20\\t\\r\\n\\f]*\\]","g"),V=new RegExp(_),X=new RegExp("^"+P+"$"),G={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+_),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}[\\x20\\t\\r\\n\\f]?|([\\x20\\t\\r\\n\\f])|.)","ig"),ne=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ie=function(){p()};try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){O.apply(e,H.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function oe(e,t,i,o){var s,a,c,u,d,f,v,y,T=t&&t.ownerDocument,C=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==C&&9!==C&&11!==C)return i;if(!o&&((t?t.ownerDocument||t:w)!==h&&p(t),t=t||h,m)){if(11!==C&&(f=J.exec(e)))if(s=f[1]){if(9===C){if(!(c=t.getElementById(s)))return i;if(c.id===s)return i.push(c),i}else if(T&&(c=T.getElementById(s))&&b(t,c)&&c.id===s)return i.push(c),i}else{if(f[2])return L.apply(i,t.getElementsByTagName(e)),i;if((s=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(i,t.getElementsByClassName(s)),i}if(n.qsa&&!S[e+" "]&&(!g||!g.test(e))){if(1!==C)T=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(ee,"\\$&"):t.setAttribute("id",u=x),a=(v=r(e)).length,d=X.test(u)?"#"+u:"[id='"+u+"']";a--;)v[a]=d+" "+me(v[a]);y=v.join(","),T=Z.test(e)&&he(t.parentNode)||t}if(y)try{return L.apply(i,T.querySelectorAll(y)),i}catch(e){}finally{u===x&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,i,o)}function se(){var e=[];return function t(n,o){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function re(e){return e[x]=!0,e}function ae(e){var t=h.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=t}function ce(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||I)-(~e.sourceIndex||I);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ue(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return re((function(t){return t=+t,re((function(n,i){for(var o,s=e([],n.length,t),r=s.length;r--;)n[o=s[r]]&&(n[o]=!(i[o]=n[o]))}))}))}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},s=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,o,r=e?e.ownerDocument||e:w;return r!==h&&9===r.nodeType&&r.documentElement?(f=(h=r).documentElement,m=!s(h),(o=h.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),n.attributes=ae((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ae((function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Y.test(h.getElementsByClassName),n.getById=ae((function(e){return f.appendChild(e).id=x,!h.getElementsByName||!h.getElementsByName(x).length})),n.getById?(i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}},i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],o=0,s=t.getElementsByTagName(e);if("*"===e){for(;n=s[o++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Y.test(h.querySelectorAll))&&(ae((function(e){f.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+z+")"),e.querySelectorAll("[id~="+x+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+x+"+*").length||g.push(".#.+[+~]")})),ae((function(e){var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Y.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ae((function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),v.push("!=",_)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Y.test(f.compareDocumentPosition),b=t||Y.test(f.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},$=t?function(e,t){if(e===t)return d=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===h||e.ownerDocument===w&&b(w,e)?-1:t===h||t.ownerDocument===w&&b(w,t)?1:u?j(u,e)-j(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,r=[e],a=[t];if(!o||!s)return e===h?-1:t===h?1:o?-1:s?1:u?j(u,e)-j(u,t):0;if(o===s)return ce(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;r[i]===a[i];)i++;return i?ce(r[i],a[i]):r[i]===w?-1:a[i]===w?1:0},h):h},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&p(e),t=t.replace(U,"='$1']"),n.matchesSelector&&m&&!S[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return oe(t,h,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==h&&p(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==h&&p(e);var o=i.attrHandle[t.toLowerCase()],s=o&&N.call(i.attrHandle,t.toLowerCase())?o(e,t,!m):void 0;return void 0!==s?s:n.attributes||!m?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,i=[],o=0,s=0;if(d=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort($),d){for(;t=e[s++];)t===e[s]&&(o=i.push(s));for(;o--;)e.splice(i[o],1)}return u=null,e},o=oe.getText=function(e){var t,n="",i=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[i++];)n+=o(t);return n},i=oe.selectors={cacheLength:50,createPseudo:re,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=k[e+" "];return t||(t=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+e+"("+R+"|$)"))&&k(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var o=oe.attr(i,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(W," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,o){var s="nth"!==e.slice(0,3),r="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===o?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,h,f,m=s!==r?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(g){if(s){for(;m;){for(p=t;p=p[m];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[r?g.firstChild:g.lastChild],r&&y){for(b=(h=(c=(u=(d=(p=g)[x]||(p[x]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===T&&c[1])&&c[2],p=h&&g.childNodes[h];p=++h&&p&&p[m]||(b=h=0)||f.pop();)if(1===p.nodeType&&++b&&p===t){u[e]=[T,h,b];break}}else if(y&&(b=h=(c=(u=(d=(p=t)[x]||(p[x]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===T&&c[1]),!1===b)for(;(p=++h&&p&&p[m]||(b=h=0)||f.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++b||(y&&((u=(d=p[x]||(p[x]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[T,b]),p!==t)););return(b-=o)===i||b%i==0&&b/i>=0}}},PSEUDO:function(e,t){var n,o=i.pseudos[e]||i.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return o[x]?o(t):o.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?re((function(e,n){for(var i,s=o(e,t),r=s.length;r--;)e[i=j(e,s[r])]=!(n[i]=s[r])})):function(e){return o(e,0,n)}):o}},pseudos:{not:re((function(e){var t=[],n=[],i=a(e.replace(B,"$1"));return i[x]?re((function(e,t,n,o){for(var s,r=i(e,null,o,[]),a=e.length;a--;)(s=r[a])&&(e[a]=!(t[a]=s))})):function(e,o,s){return t[0]=e,i(t,null,s,n),t[0]=null,!n.pop()}})),has:re((function(e){return function(t){return oe(e,t).length>0}})),contains:re((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}})),lang:re((function(e){return X.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe((function(){return[0]})),last:pe((function(e,t){return[t-1]})),eq:pe((function(e,t,n){return[n<0?n+t:n]})),even:pe((function(e,t){for(var n=0;n=0;)e.push(i);return e})),gt:pe((function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,i){for(var o=e.length;o--;)if(!e[o](t,n,i))return!1;return!0}:e[0]}function ye(e,t,n,i,o){for(var s,r=[],a=0,l=e.length,c=null!=t;a-1&&(s[c]=!(r[c]=d))}}else v=ye(v===r?v.splice(f,v.length):v),o?o(null,r,v,l):L.apply(r,v)}))}function xe(e){for(var t,n,o,s=e.length,r=i.relative[e[0].type],a=r||i.relative[" "],l=r?1:0,u=ge((function(e){return e===t}),a,!0),d=ge((function(e){return j(t,e)>-1}),a,!0),p=[function(e,n,i){var o=!r&&(i||n!==c)||((t=n).nodeType?u(e,n,i):d(e,n,i));return t=null,o}];l1&&ve(p),l>1&&me(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),n,l0,o=e.length>0,s=function(s,r,a,l,u){var d,f,g,v=0,y="0",b=s&&[],x=[],w=c,C=s||o&&i.find.TAG("*",u),k=T+=null==w?1:Math.random()||.1,E=C.length;for(u&&(c=r===h||r||u);y!==E&&null!=(d=C[y]);y++){if(o&&d){for(f=0,r||d.ownerDocument===h||(p(d),a=!m);g=e[f++];)if(g(d,r||h,a)){l.push(d);break}u&&(T=k)}n&&((d=!g&&d)&&v--,s&&b.push(d))}if(v+=y,n&&y!==v){for(f=0;g=t[f++];)g(b,x,r,a);if(s){if(v>0)for(;y--;)b[y]||x[y]||(x[y]=D.call(l));x=ye(x)}L.apply(l,x),u&&!s&&x.length>0&&v+t.length>1&&oe.uniqueSort(l)}return u&&(T=k,c=w),b};return n?re(s):s}(s,o)),a.selector=e}return a},l=oe.select=function(e,t,o,s){var l,c,u,d,p,h="function"==typeof e&&e,f=!s&&r(e=h.selector||e);if(o=o||[],1===f.length){if((c=f[0]=f[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&n.getById&&9===t.nodeType&&m&&i.relative[c[1].type]){if(!(t=(i.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return o;h&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(l=G.needsContext.test(e)?0:c.length;l--&&(u=c[l],!i.relative[d=u.type]);)if((p=i.find[d])&&(s=p(u.matches[0].replace(te,ne),Z.test(c[0].type)&&he(t.parentNode)||t))){if(c.splice(l,1),!(e=s.length&&me(c)))return L.apply(o,s),o;break}}return(h||a(e,f))(s,t,!m,o,!t||Z.test(e)&&he(t.parentNode)||t),o},n.sortStable=x.split("").sort($).join("")===x,n.detectDuplicates=!!d,p(),n.sortDetached=ae((function(e){return 1&e.compareDocumentPosition(h.createElement("div"))})),ae((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||le("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ae((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||le("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ae((function(e){return null==e.getAttribute("disabled")}))||le(z,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),oe}(e);h.find=b,h.expr=b.selectors,h.expr[":"]=h.expr.pseudos,h.uniqueSort=h.unique=b.uniqueSort,h.text=b.getText,h.isXMLDoc=b.isXML,h.contains=b.contains;var x=function(e,t,n){for(var i=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&h(e).is(n))break;i.push(e)}return i},w=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=h.expr.match.needsContext,C=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,k=/^.[^:#\[\.,]*$/;function E(e,t,n){if(h.isFunction(t))return h.grep(e,(function(e,i){return!!t.call(e,i,e)!==n}));if(t.nodeType)return h.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(k.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,(function(e){return h.inArray(e,t)>-1!==n}))}h.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?h.find.matchesSelector(i,e)?[i]:[]:h.find.matches(e,h.grep(t,(function(e){return 1===e.nodeType})))},h.fn.extend({find:function(e){var t,n=[],i=this,o=i.length;if("string"!=typeof e)return this.pushStack(h(e).filter((function(){for(t=0;t1?h.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(E(this,e||[],!1))},not:function(e){return this.pushStack(E(this,e||[],!0))},is:function(e){return!!E(this,"string"==typeof e&&T.test(e)?h(e):e||[],!1).length}});var S,$=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(h.fn.init=function(e,t,n){var o,s;if(!e)return this;if(n=n||S,"string"==typeof e){if(!(o="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:$.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof h?t[0]:t,h.merge(this,h.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:i,!0)),C.test(o[1])&&h.isPlainObject(t))for(o in t)h.isFunction(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}if((s=i.getElementById(o[2]))&&s.parentNode){if(s.id!==o[2])return S.find(e);this.length=1,this[0]=s}return this.context=i,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):h.isFunction(e)?void 0!==n.ready?n.ready(e):e(h):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),h.makeArray(e,this))}).prototype=h.fn,S=h(i);var I=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}h.fn.extend({has:function(e){var t,n=h(e,this),i=n.length;return this.filter((function(){for(t=0;t-1:1===n.nodeType&&h.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?h.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?h.inArray(this[0],h(e)):h.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(h.uniqueSort(h.merge(this.get(),h(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),h.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x(e,"parentNode")},parentsUntil:function(e,t,n){return x(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return x(e,"nextSibling")},prevAll:function(e){return x(e,"previousSibling")},nextUntil:function(e,t,n){return x(e,"nextSibling",n)},prevUntil:function(e,t,n){return x(e,"previousSibling",n)},siblings:function(e){return w((e.parentNode||{}).firstChild,e)},children:function(e){return w(e.firstChild)},contents:function(e){return h.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:h.merge([],e.childNodes)}},(function(e,t){h.fn[e]=function(n,i){var o=h.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=h.filter(i,o)),this.length>1&&(N[e]||(o=h.uniqueSort(o)),I.test(e)&&(o=o.reverse())),this.pushStack(o)}}));var D,O,L=/\S+/g;function H(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",j),e.removeEventListener("load",j)):(i.detachEvent("onreadystatechange",j),e.detachEvent("onload",j))}function j(){(i.addEventListener||"load"===e.event.type||"complete"===i.readyState)&&(H(),h.ready())}for(O in h.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return h.each(e.match(L)||[],(function(e,n){t[n]=!0})),t}(e):h.extend({},e);var t,n,i,o,s=[],r=[],a=-1,l=function(){for(o=e.once,i=t=!0;r.length;a=-1)for(n=r.shift();++a-1;)s.splice(n,1),n<=a&&a--})),this},has:function(e){return e?h.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=r=[],s=n="",this},disabled:function(){return!s},lock:function(){return o=!0,n||c.disable(),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],r.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},h.extend({Deferred:function(e){var t=[["resolve","done",h.Callbacks("once memory"),"resolved"],["reject","fail",h.Callbacks("once memory"),"rejected"],["notify","progress",h.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return h.Deferred((function(n){h.each(t,(function(t,s){var r=h.isFunction(e[t])&&e[t];o[s[1]]((function(){var e=r&&r.apply(this,arguments);e&&h.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[s[0]+"With"](this===i?n.promise():this,r?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?h.extend(e,i):i}},o={};return i.pipe=i.then,h.each(t,(function(e,s){var r=s[2],a=s[3];i[s[1]]=r.add,a&&r.add((function(){n=a}),t[1^e][2].disable,t[2][2].lock),o[s[0]]=function(){return o[s[0]+"With"](this===o?i:this,arguments),this},o[s[0]+"With"]=r.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t,n,i,s=0,r=o.call(arguments),a=r.length,l=1!==a||e&&h.isFunction(e.promise)?a:0,c=1===l?e:h.Deferred(),u=function(e,n,i){return function(s){n[e]=this,i[e]=arguments.length>1?o.call(arguments):s,i===t?c.notifyWith(n,i):--l||c.resolveWith(n,i)}};if(a>1)for(t=new Array(a),n=new Array(a),i=new Array(a);s0||(D.resolveWith(i,[h]),h.fn.triggerHandler&&(h(i).triggerHandler("ready"),h(i).off("ready"))))}}),h.ready.promise=function(t){if(!D)if(D=h.Deferred(),"complete"===i.readyState||"loading"!==i.readyState&&!i.documentElement.doScroll)e.setTimeout(h.ready);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",j),e.addEventListener("load",j);else{i.attachEvent("onreadystatechange",j),e.attachEvent("onload",j);var n=!1;try{n=null==e.frameElement&&i.documentElement}catch(e){}n&&n.doScroll&&function t(){if(!h.isReady){try{n.doScroll("left")}catch(n){return e.setTimeout(t,50)}H(),h.ready()}}()}return D.promise(t)},h.ready.promise(),h(d))break;d.ownFirst="0"===O,d.inlineBlockNeedsLayout=!1,h((function(){var e,t,n,o;(n=i.getElementsByTagName("body")[0])&&n.style&&(t=i.createElement("div"),(o=i.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(o).appendChild(t),void 0!==t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",d.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(o))})),function(){var e=i.createElement("div");d.deleteExpando=!0;try{delete e.test}catch(e){d.deleteExpando=!1}e=null}();var z,R=function(e){var t=h.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)},P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,M=/([A-Z])/g;function _(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(M,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:P.test(n)?h.parseJSON(n):n)}catch(e){}h.data(e,t,n)}else n=void 0}return n}function W(e){var t;for(t in e)if(("data"!==t||!h.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function B(e,t,i,o){if(R(e)){var s,r,a=h.expando,l=e.nodeType,c=l?h.cache:e,u=l?e[a]:e[a]&&a;if(u&&c[u]&&(o||c[u].data)||void 0!==i||"string"!=typeof t)return u||(u=l?e[a]=n.pop()||h.guid++:a),c[u]||(c[u]=l?{}:{toJSON:h.noop}),"object"!=typeof t&&"function"!=typeof t||(o?c[u]=h.extend(c[u],t):c[u].data=h.extend(c[u].data,t)),r=c[u],o||(r.data||(r.data={}),r=r.data),void 0!==i&&(r[h.camelCase(t)]=i),"string"==typeof t?null==(s=r[t])&&(s=r[h.camelCase(t)]):s=r,s}}function F(e,t,n){if(R(e)){var i,o,s=e.nodeType,r=s?h.cache:e,a=s?e[h.expando]:h.expando;if(r[a]){if(t&&(i=n?r[a]:r[a].data)){o=(t=h.isArray(t)?t.concat(h.map(t,h.camelCase)):t in i||(t=h.camelCase(t))in i?[t]:t.split(" ")).length;for(;o--;)delete i[t[o]];if(n?!W(i):!h.isEmptyObject(i))return}(n||(delete r[a].data,W(r[a])))&&(s?h.cleanData([e],!0):d.deleteExpando||r!=r.window?delete r[a]:r[a]=void 0)}}}h.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?h.cache[e[h.expando]]:e[h.expando])&&!W(e)},data:function(e,t,n){return B(e,t,n)},removeData:function(e,t){return F(e,t)},_data:function(e,t,n){return B(e,t,n,!0)},_removeData:function(e,t){return F(e,t,!0)}}),h.fn.extend({data:function(e,t){var n,i,o,s=this[0],r=s&&s.attributes;if(void 0===e){if(this.length&&(o=h.data(s),1===s.nodeType&&!h._data(s,"parsedAttrs"))){for(n=r.length;n--;)r[n]&&0===(i=r[n].name).indexOf("data-")&&_(s,i=h.camelCase(i.slice(5)),o[i]);h._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each((function(){h.data(this,e)})):arguments.length>1?this.each((function(){h.data(this,e,t)})):s?_(s,e,h.data(s,e)):void 0},removeData:function(e){return this.each((function(){h.removeData(this,e)}))}}),h.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=h._data(e,t),n&&(!i||h.isArray(n)?i=h._data(e,t,h.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=h.queue(e,t),i=n.length,o=n.shift(),s=h._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),i--),o&&("fx"===t&&n.unshift("inprogress"),delete s.stop,o.call(e,(function(){h.dequeue(e,t)}),s)),!i&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return h._data(e,n)||h._data(e,n,{empty:h.Callbacks("once memory").add((function(){h._removeData(e,t+"queue"),h._removeData(e,n)}))})}}),h.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
a",d.leadingWhitespace=3===Q.firstChild.nodeType,d.tbody=!Q.getElementsByTagName("tbody").length,d.htmlSerialize=!!Q.getElementsByTagName("link").length,d.html5Clone="<:nav>"!==i.createElement("nav").cloneNode(!0).outerHTML,Y.type="checkbox",Y.checked=!0,K.appendChild(Y),d.appendChecked=Y.checked,Q.innerHTML="",d.noCloneChecked=!!Q.cloneNode(!0).lastChild.defaultValue,K.appendChild(Q),(Y=i.createElement("input")).setAttribute("type","radio"),Y.setAttribute("checked","checked"),Y.setAttribute("name","t"),Q.appendChild(Y),d.checkClone=Q.cloneNode(!0).cloneNode(!0).lastChild.checked,d.noCloneEvent=!!Q.addEventListener,Q[h.expando]=1,d.attributes=!Q.getAttribute(h.expando);var se={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:d.htmlSerialize?[0,"",""]:[1,"X
","
"]};function re(e,t){var n,i,o=0,s=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!s)for(s=[],n=e.childNodes||e;null!=(i=n[o]);o++)!t||h.nodeName(i,t)?s.push(i):h.merge(s,re(i,t));return void 0===t||t&&h.nodeName(e,t)?h.merge([e],s):s}function ae(e,t){for(var n,i=0;null!=(n=e[i]);i++)h._data(n,"globalEval",!t||h._data(t[i],"globalEval"))}se.optgroup=se.option,se.tbody=se.tfoot=se.colgroup=se.caption=se.thead,se.th=se.td;var le=/<|&#?\w+;/,ce=/"!==p[1]||ce.test(r)?0:l:l.firstChild)&&r.childNodes.length;s--;)h.nodeName(u=r.childNodes[s],"tbody")&&!u.childNodes.length&&r.removeChild(u);for(h.merge(g,l.childNodes),l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=m.lastChild}else g.push(t.createTextNode(r));for(l&&m.removeChild(l),d.appendChecked||h.grep(re(g,"input"),ue),v=0;r=g[v++];)if(i&&h.inArray(r,i)>-1)o&&o.push(r);else if(a=h.contains(r.ownerDocument,r),l=re(m.appendChild(r),"script"),a&&ae(l),n)for(s=0;r=l[s++];)te.test(r.type||"")&&n.push(r);return l=null,m}!function(){var t,n,o=i.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(d[t]=n in e)||(o.setAttribute(n,"t"),d[t]=!1===o.attributes[n].expando);o=null}();var pe=/^(?:input|select|textarea)$/i,he=/^key/,fe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,me=/^(?:focusinfocus|focusoutblur)$/,ge=/^([^.]*)(?:\.(.+)|)/;function ve(){return!0}function ye(){return!1}function be(){try{return i.activeElement}catch(e){}}function xe(e,t,n,i,o,s){var r,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)xe(e,a,n,i,t[a],s);return e}if(null==i&&null==o?(o=n,i=n=void 0):null==o&&("string"==typeof n?(o=i,i=void 0):(o=i,i=n,n=void 0)),!1===o)o=ye;else if(!o)return e;return 1===s&&(r=o,o=function(e){return h().off(e),r.apply(this,arguments)},o.guid=r.guid||(r.guid=h.guid++)),e.each((function(){h.event.add(this,t,o,i,n)}))}h.event={global:{},add:function(e,t,n,i,o){var s,r,a,l,c,u,d,p,f,m,g,v=h._data(e);if(v){for(n.handler&&(n=(l=n).handler,o=l.selector),n.guid||(n.guid=h.guid++),(r=v.events)||(r=v.events={}),(u=v.handle)||(u=v.handle=function(e){return void 0===h||e&&h.event.triggered===e.type?void 0:h.event.dispatch.apply(u.elem,arguments)},u.elem=e),a=(t=(t||"").match(L)||[""]).length;a--;)f=g=(s=ge.exec(t[a])||[])[1],m=(s[2]||"").split(".").sort(),f&&(c=h.event.special[f]||{},f=(o?c.delegateType:c.bindType)||f,c=h.event.special[f]||{},d=h.extend({type:f,origType:g,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&h.expr.match.needsContext.test(o),namespace:m.join(".")},l),(p=r[f])||((p=r[f]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,i,m,u)||(e.addEventListener?e.addEventListener(f,u,!1):e.attachEvent&&e.attachEvent("on"+f,u))),c.add&&(c.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,d):p.push(d),h.event.global[f]=!0);e=null}},remove:function(e,t,n,i,o){var s,r,a,l,c,u,d,p,f,m,g,v=h.hasData(e)&&h._data(e);if(v&&(u=v.events)){for(c=(t=(t||"").match(L)||[""]).length;c--;)if(f=g=(a=ge.exec(t[c])||[])[1],m=(a[2]||"").split(".").sort(),f){for(d=h.event.special[f]||{},p=u[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=s=p.length;s--;)r=p[s],!o&&g!==r.origType||n&&n.guid!==r.guid||a&&!a.test(r.namespace)||i&&i!==r.selector&&("**"!==i||!r.selector)||(p.splice(s,1),r.selector&&p.delegateCount--,d.remove&&d.remove.call(e,r));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,v.handle)||h.removeEvent(e,f,v.handle),delete u[f])}else for(f in u)h.event.remove(e,f+t[c],n,i,!0);h.isEmptyObject(u)&&(delete v.handle,h._removeData(e,"events"))}},trigger:function(t,n,o,s){var r,a,l,c,d,p,f,m=[o||i],g=u.call(t,"type")?t.type:t,v=u.call(t,"namespace")?t.namespace.split("."):[];if(l=p=o=o||i,3!==o.nodeType&&8!==o.nodeType&&!me.test(g+h.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),a=g.indexOf(":")<0&&"on"+g,(t=t[h.expando]?t:new h.Event(g,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=o),n=null==n?[t]:h.makeArray(n,[t]),d=h.event.special[g]||{},s||!d.trigger||!1!==d.trigger.apply(o,n))){if(!s&&!d.noBubble&&!h.isWindow(o)){for(c=d.delegateType||g,me.test(c+g)||(l=l.parentNode);l;l=l.parentNode)m.push(l),p=l;p===(o.ownerDocument||i)&&m.push(p.defaultView||p.parentWindow||e)}for(f=0;(l=m[f++])&&!t.isPropagationStopped();)t.type=f>1?c:d.bindType||g,(r=(h._data(l,"events")||{})[t.type]&&h._data(l,"handle"))&&r.apply(l,n),(r=a&&l[a])&&r.apply&&R(l)&&(t.result=r.apply(l,n),!1===t.result&&t.preventDefault());if(t.type=g,!s&&!t.isDefaultPrevented()&&(!d._default||!1===d._default.apply(m.pop(),n))&&R(o)&&a&&o[g]&&!h.isWindow(o)){(p=o[a])&&(o[a]=null),h.event.triggered=g;try{o[g]()}catch(e){}h.event.triggered=void 0,p&&(o[a]=p)}return t.result}},dispatch:function(e){e=h.event.fix(e);var t,n,i,s,r,a=[],l=o.call(arguments),c=(h._data(this,"events")||{})[e.type]||[],u=h.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(a=h.event.handlers.call(this,e,c),t=0;(s=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=s.elem,n=0;(r=s.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(r.namespace)||(e.handleObj=r,e.data=r.data,void 0!==(i=((h.event.special[r.origType]||{}).handle||r.handler).apply(s.elem,l))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,o,s,r=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],n=0;n-1:h.find(o,this,null,[l]).length),i[o]&&i.push(s);i.length&&r.push({elem:l,handlers:i})}return a]","i"),Ce=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ke=/\s*$/g,Ie=oe(i).appendChild(i.createElement("div"));function Ne(e,t){return h.nodeName(e,"table")&&h.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ae(e){return e.type=(null!==h.find.attr(e,"type"))+"/"+e.type,e}function De(e){var t=Se.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Oe(e,t){if(1===t.nodeType&&h.hasData(e)){var n,i,o,s=h._data(e),r=h._data(t,s),a=s.events;if(a)for(n in delete r.handle,r.events={},a)for(i=0,o=a[n].length;i1&&"string"==typeof g&&!d.checkClone&&Ee.test(g))return e.each((function(o){var s=e.eq(o);v&&(t[0]=g.call(this,o,s.html())),He(s,t,n,i)}));if(f&&(o=(u=de(t,e[0].ownerDocument,!1,e,i)).firstChild,1===u.childNodes.length&&(u=o),o||i)){for(a=(l=h.map(re(u,"script"),Ae)).length;p")},clone:function(e,t,n){var i,o,s,r,a,l=h.contains(e.ownerDocument,e);if(d.html5Clone||h.isXMLDoc(e)||!Te.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(Ie.innerHTML=e.outerHTML,Ie.removeChild(s=Ie.firstChild)),!(d.noCloneEvent&&d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||h.isXMLDoc(e)))for(i=re(s),a=re(e),r=0;null!=(o=a[r]);++r)i[r]&&Le(o,i[r]);if(t)if(n)for(a=a||re(e),i=i||re(s),r=0;null!=(o=a[r]);r++)Oe(o,i[r]);else Oe(e,s);return(i=re(s,"script")).length>0&&ae(i,!l&&re(e,"script")),i=a=o=null,s},cleanData:function(e,t){for(var i,o,s,r,a=0,l=h.expando,c=h.cache,u=d.attributes,p=h.event.special;null!=(i=e[a]);a++)if((t||R(i))&&(r=(s=i[l])&&c[s])){if(r.events)for(o in r.events)p[o]?h.event.remove(i,o):h.removeEvent(i,o,r.handle);c[s]&&(delete c[s],u||void 0===i.removeAttribute?i[l]=void 0:i.removeAttribute(l),n.push(s))}}}),h.fn.extend({domManip:He,detach:function(e){return je(this,e,!0)},remove:function(e){return je(this,e)},text:function(e){return J(this,(function(e){return void 0===e?h.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))}),null,e,arguments.length)},append:function(){return He(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ne(this,e).appendChild(e)}))},prepend:function(){return He(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ne(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return He(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return He(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&h.cleanData(re(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&h.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return h.clone(this,e,t)}))},html:function(e){return J(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(we,""):void 0;if("string"==typeof e&&!ke.test(e)&&(d.htmlSerialize||!Te.test(e))&&(d.leadingWhitespace||!ne.test(e))&&!se[(ee.exec(e)||["",""])[1].toLowerCase()]){e=h.htmlPrefilter(e);try{for(;n")).appendTo(t.documentElement))[0].contentWindow||ze[0].contentDocument).document).write(),t.close(),n=Pe(e,t),ze.detach()),Re[e]=n),n}var _e=/^margin/,We=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),Be=function(e,t,n,i){var o,s,r={};for(s in t)r[s]=e.style[s],e.style[s]=t[s];for(s in o=n.apply(e,i||[]),t)e.style[s]=r[s];return o},Fe=i.documentElement;!function(){var t,n,o,s,r,a,l=i.createElement("div"),c=i.createElement("div");function u(){var u,d,p=i.documentElement;p.appendChild(l),c.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",t=o=a=!1,n=r=!0,e.getComputedStyle&&(d=e.getComputedStyle(c),t="1%"!==(d||{}).top,a="2px"===(d||{}).marginLeft,o="4px"===(d||{width:"4px"}).width,c.style.marginRight="50%",n="4px"===(d||{marginRight:"4px"}).marginRight,(u=c.appendChild(i.createElement("div"))).style.cssText=c.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",u.style.marginRight=u.style.width="0",c.style.width="1px",r=!parseFloat((e.getComputedStyle(u)||{}).marginRight),c.removeChild(u)),c.style.display="none",(s=0===c.getClientRects().length)&&(c.style.display="",c.innerHTML="
t
",c.childNodes[0].style.borderCollapse="separate",(u=c.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(s=0===u[0].offsetHeight)&&(u[0].style.display="",u[1].style.display="none",s=0===u[0].offsetHeight)),p.removeChild(l)}c.style&&(c.style.cssText="float:left;opacity:.5",d.opacity="0.5"===c.style.opacity,d.cssFloat=!!c.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,(l=i.createElement("div")).style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",c.innerHTML="",l.appendChild(c),d.boxSizing=""===c.style.boxSizing||""===c.style.MozBoxSizing||""===c.style.WebkitBoxSizing,h.extend(d,{reliableHiddenOffsets:function(){return null==t&&u(),s},boxSizingReliable:function(){return null==t&&u(),o},pixelMarginRight:function(){return null==t&&u(),n},pixelPosition:function(){return null==t&&u(),t},reliableMarginRight:function(){return null==t&&u(),r},reliableMarginLeft:function(){return null==t&&u(),a}}))}();var qe,Ue,Ve=/^(top|right|bottom|left)$/;function Xe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}e.getComputedStyle?(qe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Ue=function(e,t,n){var i,o,s,r,a=e.style;return""!==(r=(n=n||qe(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==r||h.contains(e.ownerDocument,e)||(r=h.style(e,t)),n&&!d.pixelMarginRight()&&We.test(r)&&_e.test(t)&&(i=a.width,o=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=i,a.minWidth=o,a.maxWidth=s),void 0===r?r:r+""}):Fe.currentStyle&&(qe=function(e){return e.currentStyle},Ue=function(e,t,n){var i,o,s,r,a=e.style;return null==(r=(n=n||qe(e))?n[t]:void 0)&&a&&a[t]&&(r=a[t]),We.test(r)&&!Ve.test(t)&&(i=a.left,(s=(o=e.runtimeStyle)&&o.left)&&(o.left=e.currentStyle.left),a.left="fontSize"===t?"1em":r,r=a.pixelLeft+"px",a.left=i,s&&(o.left=s)),void 0===r?r:r+""||"auto"});var Ge=/alpha\([^)]*\)/i,Qe=/opacity\s*=\s*([^)]*)/i,Ke=/^(none|table(?!-c[ea]).+)/,Ye=new RegExp("^("+q+")(.*)$","i"),Je={position:"absolute",visibility:"hidden",display:"block"},Ze={letterSpacing:"0",fontWeight:"400"},et=["Webkit","O","Moz","ms"],tt=i.createElement("div").style;function nt(e){if(e in tt)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=et.length;n--;)if((e=et[n]+t)in tt)return e}function it(e,t){for(var n,i,o,s=[],r=0,a=e.length;r=1||""===t)&&""===h.trim(s.replace(Ge,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||i&&!i.filter)||(n.filter=Ge.test(s)?s.replace(Ge,o):s+" "+o)}}),h.cssHooks.marginRight=Xe(d.reliableMarginRight,(function(e,t){if(t)return Be(e,{display:"inline-block"},Ue,[e,"marginRight"])})),h.cssHooks.marginLeft=Xe(d.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ue(e,"marginLeft"))||(h.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-Be(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})):0))+"px"})),h.each({margin:"",padding:"",border:"Width"},(function(e,t){h.cssHooks[e+t]={expand:function(n){for(var i=0,o={},s="string"==typeof n?n.split(" "):[n];i<4;i++)o[e+V[i]+t]=s[i]||s[i-2]||s[0];return o}},_e.test(e)||(h.cssHooks[e+t].set=ot)})),h.fn.extend({css:function(e,t){return J(this,(function(e,t,n){var i,o,s={},r=0;if(h.isArray(t)){for(i=qe(e),o=t.length;r1)},show:function(){return it(this,!0)},hide:function(){return it(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){X(this)?h(this).show():h(this).hide()}))}}),h.Tween=at,at.prototype={constructor:at,init:function(e,t,n,i,o,s){this.elem=e,this.prop=n,this.easing=o||h.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=s||(h.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=h.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}},at.prototype.init.prototype=at.prototype,at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=h.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){h.fx.step[e.prop]?h.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[h.cssProps[e.prop]]&&!h.cssHooks[e.prop]?e.elem[e.prop]=e.now:h.style(e.elem,e.prop,e.now+e.unit)}}},at.propHooks.scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},h.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},h.fx=at.prototype.init,h.fx.step={};var lt,ct,ut=/^(?:toggle|show|hide)$/,dt=/queueHooks$/;function pt(){return e.setTimeout((function(){lt=void 0})),lt=h.now()}function ht(e,t){var n,i={height:e},o=0;for(t=t?1:0;o<4;o+=2-t)i["margin"+(n=V[o])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var i,o=(mt.tweeners[t]||[]).concat(mt.tweeners["*"]),s=0,r=o.length;s
a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),(e=n.getElementsByTagName("a")[0]).style.cssText="top:1px",d.getSetAttribute="t"!==n.className,d.style=/top/.test(e.getAttribute("style")),d.hrefNormalized="/a"===e.getAttribute("href"),d.checkOn=!!t.value,d.optSelected=s.selected,d.enctype=!!i.createElement("form").enctype,o.disabled=!0,d.optDisabled=!s.disabled,(t=i.createElement("input")).setAttribute("value",""),d.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),d.radioValue="t"===t.value}();var gt=/\r/g,vt=/[\x20\t\r\n\f]+/g;h.fn.extend({val:function(e){var t,n,i,o=this[0];return arguments.length?(i=h.isFunction(e),this.each((function(n){var o;1===this.nodeType&&(null==(o=i?e.call(this,n,h(this).val()):e)?o="":"number"==typeof o?o+="":h.isArray(o)&&(o=h.map(o,(function(e){return null==e?"":e+""}))),(t=h.valHooks[this.type]||h.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))}))):o?(t=h.valHooks[o.type]||h.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(gt,""):null==n?"":n:void 0}}),h.extend({valHooks:{option:{get:function(e){var t=h.find.attr(e,"value");return null!=t?t:h.trim(h.text(e)).replace(vt," ")}},select:{get:function(e){for(var t,n,i=e.options,o=e.selectedIndex,s="select-one"===e.type||o<0,r=s?null:[],a=s?o+1:i.length,l=o<0?a:s?o:0;l-1)try{i.selected=n=!0}catch(e){i.scrollHeight}else i.selected=!1;return n||(e.selectedIndex=-1),o}}}}),h.each(["radio","checkbox"],(function(){h.valHooks[this]={set:function(e,t){if(h.isArray(t))return e.checked=h.inArray(h(e).val(),t)>-1}},d.checkOn||(h.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var yt,bt,xt=h.expr.attrHandle,wt=/^(?:checked|selected)$/i,Tt=d.getSetAttribute,Ct=d.input;h.fn.extend({attr:function(e,t){return J(this,h.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){h.removeAttr(this,e)}))}}),h.extend({attr:function(e,t,n){var i,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?h.prop(e,t,n):(1===s&&h.isXMLDoc(e)||(t=t.toLowerCase(),o=h.attrHooks[t]||(h.expr.match.bool.test(t)?bt:yt)),void 0!==n?null===n?void h.removeAttr(e,t):o&&"set"in o&&void 0!==(i=o.set(e,n,t))?i:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(i=o.get(e,t))?i:null==(i=h.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&h.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i,o=0,s=t&&t.match(L);if(s&&1===e.nodeType)for(;n=s[o++];)i=h.propFix[n]||n,h.expr.match.bool.test(n)?Ct&&Tt||!wt.test(n)?e[i]=!1:e[h.camelCase("default-"+n)]=e[i]=!1:h.attr(e,n,""),e.removeAttribute(Tt?n:i)}}),bt={set:function(e,t,n){return!1===t?h.removeAttr(e,n):Ct&&Tt||!wt.test(n)?e.setAttribute(!Tt&&h.propFix[n]||n,n):e[h.camelCase("default-"+n)]=e[n]=!0,n}},h.each(h.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=xt[t]||h.find.attr;Ct&&Tt||!wt.test(t)?xt[t]=function(e,t,i){var o,s;return i||(s=xt[t],xt[t]=o,o=null!=n(e,t,i)?t.toLowerCase():null,xt[t]=s),o}:xt[t]=function(e,t,n){if(!n)return e[h.camelCase("default-"+t)]?t.toLowerCase():null}})),Ct&&Tt||(h.attrHooks.value={set:function(e,t,n){if(!h.nodeName(e,"input"))return yt&&yt.set(e,t,n);e.defaultValue=t}}),Tt||(yt={set:function(e,t,n){var i=e.getAttributeNode(n);if(i||e.setAttributeNode(i=e.ownerDocument.createAttribute(n)),i.value=t+="","value"===n||t===e.getAttribute(n))return t}},xt.id=xt.name=xt.coords=function(e,t,n){var i;if(!n)return(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},h.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:yt.set},h.attrHooks.contenteditable={set:function(e,t,n){yt.set(e,""!==t&&t,n)}},h.each(["width","height"],(function(e,t){h.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}}))),d.style||(h.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var kt=/^(?:input|select|textarea|button|object)$/i,Et=/^(?:a|area)$/i;h.fn.extend({prop:function(e,t){return J(this,h.prop,e,t,arguments.length>1)},removeProp:function(e){return e=h.propFix[e]||e,this.each((function(){try{this[e]=void 0,delete this[e]}catch(e){}}))}}),h.extend({prop:function(e,t,n){var i,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&h.isXMLDoc(e)||(t=h.propFix[t]||t,o=h.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(i=o.set(e,n,t))?i:e[t]=n:o&&"get"in o&&null!==(i=o.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=h.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||Et.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.hrefNormalized||h.each(["href","src"],(function(e,t){h.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),d.optSelected||(h.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),h.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){h.propFix[this.toLowerCase()]=this})),d.enctype||(h.propFix.enctype="encoding");var St=/[\t\r\n\f]/g;function $t(e){return h.attr(e,"class")||""}h.fn.extend({addClass:function(e){var t,n,i,o,s,r,a,l=0;if(h.isFunction(e))return this.each((function(t){h(this).addClass(e.call(this,t,$t(this)))}));if("string"==typeof e&&e)for(t=e.match(L)||[];n=this[l++];)if(o=$t(n),i=1===n.nodeType&&(" "+o+" ").replace(St," ")){for(r=0;s=t[r++];)i.indexOf(" "+s+" ")<0&&(i+=s+" ");o!==(a=h.trim(i))&&h.attr(n,"class",a)}return this},removeClass:function(e){var t,n,i,o,s,r,a,l=0;if(h.isFunction(e))return this.each((function(t){h(this).removeClass(e.call(this,t,$t(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(L)||[];n=this[l++];)if(o=$t(n),i=1===n.nodeType&&(" "+o+" ").replace(St," ")){for(r=0;s=t[r++];)for(;i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");o!==(a=h.trim(i))&&h.attr(n,"class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):h.isFunction(e)?this.each((function(n){h(this).toggleClass(e.call(this,n,$t(this),t),t)})):this.each((function(){var t,i,o,s;if("string"===n)for(i=0,o=h(this),s=e.match(L)||[];t=s[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=$t(this))&&h._data(this,"__className__",t),h.attr(this,"class",t||!1===e?"":h._data(this,"__className__")||""))}))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+$t(n)+" ").replace(St," ").indexOf(t)>-1)return!0;return!1}}),h.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){h.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),h.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var It=e.location,Nt=h.now(),At=/\?/,Dt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;h.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,i=null,o=h.trim(t+"");return o&&!h.trim(o.replace(Dt,(function(e,t,o,s){return n&&t&&(i=0),0===i?e:(n=o||t,i+=!s-!o,"")})))?Function("return "+o)():h.error("Invalid JSON: "+t)},h.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?n=(new e.DOMParser).parseFromString(t,"text/xml"):((n=new e.ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||h.error("Invalid XML: "+t),n};var Ot=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,jt=/^(?:GET|HEAD)$/,zt=/^\/\//,Rt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Pt={},Mt={},_t="*/".concat("*"),Wt=It.href,Bt=Rt.exec(Wt.toLowerCase())||[];function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,o=0,s=t.toLowerCase().match(L)||[];if(h.isFunction(n))for(;i=s[o++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function qt(e,t,n,i){var o={},s=e===Mt;function r(a){var l;return o[a]=!0,h.each(e[a]||[],(function(e,a){var c=a(t,n,i);return"string"!=typeof c||s||o[c]?s?!(l=c):void 0:(t.dataTypes.unshift(c),r(c),!1)})),l}return r(t.dataTypes[0])||!o["*"]&&r("*")}function Ut(e,t){var n,i,o=h.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((o[i]?e:n||(n={}))[i]=t[i]);return n&&h.extend(!0,e,n),e}function Vt(e){return e.style&&e.style.display||h.css(e,"display")}h.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Wt,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Bt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":h.parseJSON,"text xml":h.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,h.ajaxSettings),t):Ut(h.ajaxSettings,e)},ajaxPrefilter:Ft(Pt),ajaxTransport:Ft(Mt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,r,a,l,c,u,d=h.ajaxSetup({},n),p=d.context||d,f=d.context&&(p.nodeType||p.jquery)?h(p):h.event,m=h.Deferred(),g=h.Callbacks("once memory"),v=d.statusCode||{},y={},b={},x=0,w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!u)for(u={};t=Ht.exec(r);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?r:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(x<2)for(t in e)v[t]=[v[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||w;return c&&c.abort(t),C(0,t),this}};if(m.promise(T).complete=g.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||Wt)+"").replace(Ot,"").replace(zt,Bt[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=h.trim(d.dataType||"*").toLowerCase().match(L)||[""],null==d.crossDomain&&(i=Rt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===Bt[1]&&i[2]===Bt[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(Bt[3]||("http:"===Bt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=h.param(d.data,d.traditional)),qt(Pt,d,n,T),2===x)return T;for(o in(l=h.event&&d.global)&&0==h.active++&&h.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!jt.test(d.type),s=d.url,d.hasContent||(d.data&&(s=d.url+=(At.test(s)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=Lt.test(s)?s.replace(Lt,"$1_="+Nt++):s+(At.test(s)?"&":"?")+"_="+Nt++)),d.ifModified&&(h.lastModified[s]&&T.setRequestHeader("If-Modified-Since",h.lastModified[s]),h.etag[s]&&T.setRequestHeader("If-None-Match",h.etag[s])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+_t+"; q=0.01":""):d.accepts["*"]),d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(!1===d.beforeSend.call(p,T,d)||2===x))return T.abort();for(o in w="abort",{success:1,error:1,complete:1})T[o](d[o]);if(c=qt(Mt,d,n,T)){if(T.readyState=1,l&&f.trigger("ajaxSend",[T,d]),2===x)return T;d.async&&d.timeout>0&&(a=e.setTimeout((function(){T.abort("timeout")}),d.timeout));try{x=1,c.send(y,C)}catch(e){if(!(x<2))throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,n,i,o){var u,y,b,w,C,k=n;2!==x&&(x=2,a&&e.clearTimeout(a),c=void 0,r=o||"",T.readyState=t>0?4:0,u=t>=200&&t<300||304===t,i&&(w=function(e,t,n){for(var i,o,s,r,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader("Content-Type"));if(o)for(r in a)if(a[r]&&a[r].test(o)){l.unshift(r);break}if(l[0]in n)s=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){s=r;break}i||(i=r)}s=s||i}if(s)return s!==l[0]&&l.unshift(s),n[s]}(d,T,i)),w=function(e,t,n,i){var o,s,r,a,l,c={},u=e.dataTypes.slice();if(u[1])for(r in e.converters)c[r.toLowerCase()]=e.converters[r];for(s=u.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=u.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(r=c[l+" "+s]||c["* "+s]))for(o in c)if((a=o.split(" "))[1]===s&&(r=c[l+" "+a[0]]||c["* "+a[0]])){!0===r?r=c[o]:!0!==c[o]&&(s=a[0],u.unshift(a[1]));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}(d,w,T,u),u?(d.ifModified&&((C=T.getResponseHeader("Last-Modified"))&&(h.lastModified[s]=C),(C=T.getResponseHeader("etag"))&&(h.etag[s]=C)),204===t||"HEAD"===d.type?k="nocontent":304===t?k="notmodified":(k=w.state,y=w.data,u=!(b=w.error))):(b=k,!t&&k||(k="error",t<0&&(t=0))),T.status=t,T.statusText=(n||k)+"",u?m.resolveWith(p,[y,k,T]):m.rejectWith(p,[T,k,b]),T.statusCode(v),v=void 0,l&&f.trigger(u?"ajaxSuccess":"ajaxError",[T,d,u?y:b]),g.fireWith(p,[T,k]),l&&(f.trigger("ajaxComplete",[T,d]),--h.active||h.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return h.get(e,t,n,"json")},getScript:function(e,t){return h.get(e,void 0,t,"script")}}),h.each(["get","post"],(function(e,t){h[t]=function(e,n,i,o){return h.isFunction(n)&&(o=o||i,i=n,n=void 0),h.ajax(h.extend({url:e,type:t,dataType:o,data:n,success:i},h.isPlainObject(e)&&e))}})),h._evalUrl=function(e){return h.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},h.fn.extend({wrapAll:function(e){if(h.isFunction(e))return this.each((function(t){h(this).wrapAll(e.call(this,t))}));if(this[0]){var t=h(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e})).append(this)}return this},wrapInner:function(e){return h.isFunction(e)?this.each((function(t){h(this).wrapInner(e.call(this,t))})):this.each((function(){var t=h(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=h.isFunction(e);return this.each((function(n){h(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){h.nodeName(this,"body")||h(this).replaceWith(this.childNodes)})).end()}}),h.expr.filters.hidden=function(e){return d.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:function(e){if(!h.contains(e.ownerDocument||i,e))return!0;for(;e&&1===e.nodeType;){if("none"===Vt(e)||"hidden"===e.type)return!0;e=e.parentNode}return!1}(e)},h.expr.filters.visible=function(e){return!h.expr.filters.hidden(e)};var Xt=/%20/g,Gt=/\[\]$/,Qt=/\r?\n/g,Kt=/^(?:submit|button|image|reset|file)$/i,Yt=/^(?:input|select|textarea|keygen)/i;function Jt(e,t,n,i){var o;if(h.isArray(t))h.each(t,(function(t,o){n||Gt.test(e)?i(e,o):Jt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,i)}));else if(n||"object"!==h.type(t))i(e,t);else for(o in t)Jt(e+"["+o+"]",t[o],n,i)}h.param=function(e,t){var n,i=[],o=function(e,t){t=h.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=h.ajaxSettings&&h.ajaxSettings.traditional),h.isArray(e)||e.jquery&&!h.isPlainObject(e))h.each(e,(function(){o(this.name,this.value)}));else for(n in e)Jt(n,e[n],t,o);return i.join("&").replace(Xt,"+")},h.fn.extend({serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=h.prop(this,"elements");return e?h.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!h(this).is(":disabled")&&Yt.test(this.nodeName)&&!Kt.test(e)&&(this.checked||!Z.test(e))})).map((function(e,t){var n=h(this).val();return null==n?null:h.isArray(n)?h.map(n,(function(e){return{name:t.name,value:e.replace(Qt,"\r\n")}})):{name:t.name,value:n.replace(Qt,"\r\n")}})).get()}}),h.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?on():i.documentMode>8?nn():/^(get|post|head|put|delete|options)$/i.test(this.type)&&nn()||on()}:nn;var Zt=0,en={},tn=h.ajaxSettings.xhr();function nn(){try{return new e.XMLHttpRequest}catch(e){}}function on(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}e.attachEvent&&e.attachEvent("onunload",(function(){for(var e in en)en[e](void 0,!0)})),d.cors=!!tn&&"withCredentials"in tn,(tn=d.ajax=!!tn)&&h.ajaxTransport((function(t){var n;if(!t.crossDomain||d.cors)return{send:function(i,o){var s,r=t.xhr(),a=++Zt;if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)r[s]=t.xhrFields[s];for(s in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)void 0!==i[s]&&r.setRequestHeader(s,i[s]+"");r.send(t.hasContent&&t.data||null),n=function(e,i){var s,l,c;if(n&&(i||4===r.readyState))if(delete en[a],n=void 0,r.onreadystatechange=h.noop,i)4!==r.readyState&&r.abort();else{c={},s=r.status,"string"==typeof r.responseText&&(c.text=r.responseText);try{l=r.statusText}catch(e){l=""}s||!t.isLocal||t.crossDomain?1223===s&&(s=204):s=c.text?200:404}c&&o(s,l,c,r.getAllResponseHeaders())},t.async?4===r.readyState?e.setTimeout(n):r.onreadystatechange=en[a]=n:n()},abort:function(){n&&n(void 0,!0)}}})),h.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return h.globalEval(e),e}}}),h.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)})),h.ajaxTransport("script",(function(e){if(e.crossDomain){var t,n=i.head||h("head")[0]||i.documentElement;return{send:function(o,s){(t=i.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||s(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}}));var sn=[],rn=/(=)\?(?=&|$)|\?\?/;h.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=sn.pop()||h.expando+"_"+Nt++;return this[e]=!0,e}}),h.ajaxPrefilter("json jsonp",(function(t,n,i){var o,s,r,a=!1!==t.jsonp&&(rn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&rn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=h.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(rn,"$1"+o):!1!==t.jsonp&&(t.url+=(At.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return r||h.error(o+" was not called"),r[0]},t.dataTypes[0]="json",s=e[o],e[o]=function(){r=arguments},i.always((function(){void 0===s?h(e).removeProp(o):e[o]=s,t[o]&&(t.jsonpCallback=n.jsonpCallback,sn.push(o)),r&&h.isFunction(s)&&s(r[0]),r=s=void 0})),"script"})),h.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||i;var o=C.exec(e),s=!n&&[];return o?[t.createElement(o[1])]:(o=de([e],t,s),s&&s.length&&h(s).remove(),h.merge([],o.childNodes))};var an=h.fn.load;function ln(e){return h.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}h.fn.load=function(e,t,n){if("string"!=typeof e&&an)return an.apply(this,arguments);var i,o,s,r=this,a=e.indexOf(" ");return a>-1&&(i=h.trim(e.slice(a,e.length)),e=e.slice(0,a)),h.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),r.length>0&&h.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done((function(e){s=arguments,r.html(i?h("
").append(h.parseHTML(e)).find(i):e)})).always(n&&function(e,t){r.each((function(){n.apply(this,s||[e.responseText,t,e])}))}),this},h.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){h.fn[t]=function(e){return this.on(t,e)}})),h.expr.filters.animated=function(e){return h.grep(h.timers,(function(t){return e===t.elem})).length},h.offset={setOffset:function(e,t,n){var i,o,s,r,a,l,c=h.css(e,"position"),u=h(e),d={};"static"===c&&(e.style.position="relative"),a=u.offset(),s=h.css(e,"top"),l=h.css(e,"left"),("absolute"===c||"fixed"===c)&&h.inArray("auto",[s,l])>-1?(r=(i=u.position()).top,o=i.left):(r=parseFloat(s)||0,o=parseFloat(l)||0),h.isFunction(t)&&(t=t.call(e,n,h.extend({},a))),null!=t.top&&(d.top=t.top-a.top+r),null!=t.left&&(d.left=t.left-a.left+o),"using"in t?t.using.call(e,d):u.css(d)}},h.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){h.offset.setOffset(this,e,t)}));var t,n,i={top:0,left:0},o=this[0],s=o&&o.ownerDocument;return s?(t=s.documentElement,h.contains(t,o)?(void 0!==o.getBoundingClientRect&&(i=o.getBoundingClientRect()),n=ln(s),{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):i):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},i=this[0];return"fixed"===h.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),h.nodeName(e[0],"html")||(n=e.offset()),n.top+=h.css(e[0],"borderTopWidth",!0),n.left+=h.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-h.css(i,"marginTop",!0),left:t.left-n.left-h.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&!h.nodeName(e,"html")&&"static"===h.css(e,"position");)e=e.offsetParent;return e||Fe}))}}),h.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n=/Y/.test(t);h.fn[e]=function(i){return J(this,(function(e,i,o){var s=ln(e);if(void 0===o)return s?t in s?s[t]:s.document.documentElement[i]:e[i];s?s.scrollTo(n?h(s).scrollLeft():o,n?o:h(s).scrollTop()):e[i]=o}),e,i,arguments.length,null)}})),h.each(["top","left"],(function(e,t){h.cssHooks[t]=Xe(d.pixelPosition,(function(e,n){if(n)return n=Ue(e,t),We.test(n)?h(e).position()[t]+"px":n}))})),h.each({Height:"height",Width:"width"},(function(e,t){h.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){h.fn[i]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),r=n||(!0===i||!0===o?"margin":"border");return J(this,(function(t,n,i){var o;return h.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?h.css(t,n,r):h.style(t,n,i,r)}),t,s?i:void 0,s,null)}}))})),h.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),h.fn.size=function(){return this.length},h.fn.andSelf=h.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return h}));var cn=e.jQuery,un=e.$;return h.noConflict=function(t){return e.$===h&&(e.$=un),t&&e.jQuery===h&&(e.jQuery=cn),h},t||(e.jQuery=e.$=h),h})),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(e){"use strict";var t=jQuery.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(e){"use strict";e.fn.emulateTransitionEnd=function(t){var n=!1,i=this;e(this).one("bsTransitionEnd",(function(){n=!0}));return setTimeout((function(){n||e(i).trigger(e.support.transition.end)}),t),this},e((function(){e.support.transition=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})}))}(jQuery),function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.VERSION="3.4.1",n.TRANSITION_DURATION=150,n.prototype.close=function(t){var i=e(this),o=i.attr("data-target");o||(o=(o=i.attr("href"))&&o.replace(/.*(?=#[^\s]*$)/,"")),o="#"===o?[]:o;var s=e(document).find(o);function r(){s.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),s.length||(s=i.closest(".alert")),s.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(s.removeClass("in"),e.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",r).emulateTransitionEnd(n.TRANSITION_DURATION):r())};var i=e.fn.alert;e.fn.alert=function(t){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||i.data("bs.alert",o=new n(this)),"string"==typeof t&&o[t].call(i)}))},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(jQuery),function(e){"use strict";var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.isLoading=!1};function n(n){return this.each((function(){var i=e(this),o=i.data("bs.button"),s="object"==typeof n&&n;o||i.data("bs.button",o=new t(this,s)),"toggle"==n?o.toggle():n&&o.setState(n)}))}t.VERSION="3.4.1",t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(t){var n="disabled",i=this.$element,o=i.is("input")?"val":"html",s=i.data();t+="Text",null==s.resetText&&i.data("resetText",i[o]()),setTimeout(e.proxy((function(){i[o](null==s[t]?this.options[t]:s[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(n).removeAttr(n).prop(n,!1))}),this),0)},t.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var i=e.fn.button;e.fn.button=n,e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=i,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var i=e(t.target).closest(".btn");n.call(i,"toggle"),e(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),i.is("input,button")?i.trigger("focus"):i.find("input:visible,button:visible").first().trigger("focus"))})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))}))}(jQuery),function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};function n(n){return this.each((function(){var i=e(this),o=i.data("bs.carousel"),s=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n),r="string"==typeof n?n:s.slide;o||i.data("bs.carousel",o=new t(this,s)),"number"==typeof n?o.to(n):r?o[r]():s.interval&&o.pause().cycle()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=600,t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},t.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},t.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t);if(("prev"==e&&0===n||"next"==e&&n==this.$items.length-1)&&!this.options.wrap)return t;var i=(n+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(i)},t.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){t.to(e)})):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){if(!this.sliding)return this.slide("next")},t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},t.prototype.slide=function(n,i){var o=this.$element.find(".item.active"),s=i||this.getItemForDirection(n,o),r=this.interval,a="next"==n?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],u=e.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(u),!u.isDefaultPrevented()){if(this.sliding=!0,r&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=e(this.$indicators.children()[this.getItemIndex(s)]);d&&d.addClass("active")}var p=e.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return e.support.transition&&this.$element.hasClass("slide")?(s.addClass(n),"object"==typeof s&&s.length&&s[0].offsetWidth,o.addClass(a),s.addClass(a),o.one("bsTransitionEnd",(function(){s.removeClass([n,a].join(" ")).addClass("active"),o.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout((function(){l.$element.trigger(p)}),0)})).emulateTransitionEnd(t.TRANSITION_DURATION)):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(p)),r&&this.cycle(),this}};var i=e.fn.carousel;e.fn.carousel=n,e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=i,this};var o=function(t){var i=e(this),o=i.attr("href");o&&(o=o.replace(/.*(?=#[^\s]+$)/,""));var s=i.attr("data-target")||o,r=e(document).find(s);if(r.hasClass("carousel")){var a=e.extend({},r.data(),i.data()),l=i.attr("data-slide-to");l&&(a.interval=!1),n.call(r,a),l&&r.data("bs.carousel").to(l),t.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",o).on("click.bs.carousel.data-api","[data-slide-to]",o),e(window).on("load",(function(){e('[data-ride="carousel"]').each((function(){var t=e(this);n.call(t,t.data())}))}))}(jQuery),function(e){"use strict";var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.$trigger=e('[data-toggle="collapse"][href="#'+n.id+'"],[data-toggle="collapse"][data-target="#'+n.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var n,i=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(document).find(i)}function i(n){return this.each((function(){var i=e(this),o=i.data("bs.collapse"),s=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n);!o&&s.toggle&&/show|hide/.test(n)&&(s.toggle=!1),o||i.data("bs.collapse",o=new t(this,s)),"string"==typeof n&&o[n]()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=350,t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},t.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n,o=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(o&&o.length&&(n=o.data("bs.collapse"))&&n.transitioning)){var s=e.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){o&&o.length&&(i.call(o,"hide"),n||o.data("bs.collapse",null));var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return a.call(this);var l=e.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",e.proxy(a,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[r](this.$element[0][l])}}}},t.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var n=e.Event("hide.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return o.call(this);this.$element[i](0).one("bsTransitionEnd",e.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)}}},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},t.prototype.getParent=function(){return e(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy((function(t,i){var o=e(i);this.addAriaAndCollapsedClass(n(o),o)}),this)).end()},t.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var o=e.fn.collapse;e.fn.collapse=i,e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=o,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){var o=e(this);o.attr("data-target")||t.preventDefault();var s=n(o),r=s.data("bs.collapse")?"toggle":o.data();i.call(s,r)}))}(jQuery),function(e){"use strict";var t='[data-toggle="dropdown"]',n=function(t){e(t).on("click.bs.dropdown",this.toggle)};function i(t){var n=t.attr("data-target");n||(n=(n=t.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==n?e(document).find(n):null;return i&&i.length?i:t.parent()}function o(n){n&&3===n.which||(e(".dropdown-backdrop").remove(),e(t).each((function(){var t=e(this),o=i(t),s={relatedTarget:this};o.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(o[0],n.target)||(o.trigger(n=e.Event("hide.bs.dropdown",s)),n.isDefaultPrevented()||(t.attr("aria-expanded","false"),o.removeClass("open").trigger(e.Event("hidden.bs.dropdown",s)))))})))}n.VERSION="3.4.1",n.prototype.toggle=function(t){var n=e(this);if(!n.is(".disabled, :disabled")){var s=i(n),r=s.hasClass("open");if(o(),!r){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",o);var a={relatedTarget:this};if(s.trigger(t=e.Event("show.bs.dropdown",a)),t.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(e.Event("shown.bs.dropdown",a))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var o=e(this);if(n.preventDefault(),n.stopPropagation(),!o.is(".disabled, :disabled")){var s=i(o),r=s.hasClass("open");if(!r&&27!=n.which||r&&27==n.which)return 27==n.which&&s.find(t).trigger("focus"),o.trigger("click");var a=s.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var l=a.index(n.target);38==n.which&&l>0&&l--,40==n.which&&ldocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},t.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:i},l.prototype.init=function(t,n,i){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&e(document).find(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),s=o.length;s--;){var r=o[s];if("click"==r)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",l="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},l.prototype.getDefaults=function(){return l.DEFAULTS},l.prototype.getOptions=function(n){var i=this.$element.data();for(var o in i)i.hasOwnProperty(o)&&-1!==e.inArray(o,t)&&delete i[o];return(n=e.extend({},this.getDefaults(),i,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=a(n.template,n.whiteList,n.sanitizeFn)),n},l.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,(function(e,i){n[e]!=i&&(t[e]=i)})),t},l.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},l.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},l.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},l.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var n=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!n)return;var i=this,o=this.tip(),s=this.getUID(this.type);this.setContent(),o.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&o.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,c=a.test(r);c&&(r=r.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?o.appendTo(e(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=o[0].offsetWidth,p=o[0].offsetHeight;if(c){var h=r,f=this.getPosition(this.$viewport);r="bottom"==r&&u.bottom+p>f.bottom?"top":"top"==r&&u.top-pf.width?"left":"left"==r&&u.left-dr.top+r.height&&(o.top=r.top+r.height-l)}else{var c=t.left-s,u=t.left+s+n;cr.right&&(o.left=r.left+r.width-u)}return o},l.prototype.getTitle=function(){var e=this.$element,t=this.options;return e.attr("data-original-title")||("function"==typeof t.title?t.title.call(e[0]):t.title)},l.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},l.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},l.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},l.prototype.enable=function(){this.enabled=!0},l.prototype.disable=function(){this.enabled=!1},l.prototype.toggleEnabled=function(){this.enabled=!this.enabled},l.prototype.toggle=function(t){var n=this;t&&((n=e(t.currentTarget).data("bs."+this.type))||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},l.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide((function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null}))},l.prototype.sanitizeHtml=function(e){return a(e,this.options.whiteList,this.options.sanitizeFn)};var c=e.fn.tooltip;e.fn.tooltip=function(t){return this.each((function(){var n=e(this),i=n.data("bs.tooltip"),o="object"==typeof t&&t;!i&&/destroy|hide/.test(t)||(i||n.data("bs.tooltip",i=new l(this,o)),"string"==typeof t&&i[t]())}))},e.fn.tooltip.Constructor=l,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=c,this}}(jQuery),function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.4.1",t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),(t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype)).constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();if(this.options.html){var i=typeof n;this.options.sanitize&&(t=this.sanitizeHtml(t),"string"===i&&(n=this.sanitizeHtml(n))),e.find(".popover-title").html(t),e.find(".popover-content").children().detach().end()["string"===i?"html":"append"](n)}else e.find(".popover-title").text(t),e.find(".popover-content").children().detach().end().text(n);e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var n=e.fn.popover;e.fn.popover=function(n){return this.each((function(){var i=e(this),o=i.data("bs.popover"),s="object"==typeof n&&n;!o&&/destroy|hide/.test(n)||(o||i.data("bs.popover",o=new t(this,s)),"string"==typeof n&&o[n]())}))},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(jQuery),function(e){"use strict";function t(n,i){this.$body=e(document.body),this.$scrollElement=e(n).is(document.body)?e(window):e(n),this.options=e.extend({},t.DEFAULTS,i),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each((function(){var i=e(this),o=i.data("bs.scrollspy"),s="object"==typeof n&&n;o||i.data("bs.scrollspy",o=new t(this,s)),"string"==typeof n&&o[n]()}))}t.VERSION="3.4.1",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",i=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",i=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var t=e(this),o=t.data("target")||t.attr("href"),s=/^#./.test(o)&&e(o);return s&&s.length&&s.is(":visible")&&[[s[n]().top+i,o]]||null})).sort((function(e,t){return e[0]-t[0]})).each((function(){t.offsets.push(this[0]),t.targets.push(this[1])}))},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),o=this.offsets,s=this.targets,r=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=i)return r!=(e=s[s.length-1])&&this.activate(e);if(r&&t=o[e]&&(void 0===o[e+1]||t .active"),r=o&&e.support.transition&&(s.length&&s.hasClass("fade")||!!i.find("> .fade").length);function a(){s.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),n.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(n[0].offsetWidth,n.addClass("in")):n.removeClass("fade"),n.parent(".dropdown-menu").length&&n.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),o&&o()}s.length&&r?s.one("bsTransitionEnd",a).emulateTransitionEnd(t.TRANSITION_DURATION):a(),s.removeClass("in")};var i=e.fn.tab;e.fn.tab=n,e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=i,this};var o=function(t){t.preventDefault(),n.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',o).on("click.bs.tab.data-api",'[data-toggle="pill"]',o)}(jQuery),function(e){"use strict";var t=function(n,i){this.options=e.extend({},t.DEFAULTS,i);var o=this.options.target===t.DEFAULTS.target?e(this.options.target):e(document).find(this.options.target);this.$target=o.on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var i=e(this),o=i.data("bs.affix"),s="object"==typeof n&&n;o||i.data("bs.affix",o=new t(this,s)),"string"==typeof n&&o[n]()}))}t.VERSION="3.4.1",t.RESET="affix affix-top affix-bottom",t.DEFAULTS={offset:0,target:window},t.prototype.getState=function(e,t,n,i){var o=this.$target.scrollTop(),s=this.$element.offset(),r=this.$target.height();if(null!=n&&"top"==this.affixed)return o=e-i&&"bottom"},t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var e=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-e},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),i=this.options.offset,o=i.top,s=i.bottom,r=Math.max(e(document).height(),e(document.body).height());"object"!=typeof i&&(s=o=i),"function"==typeof o&&(o=i.top(this.$element)),"function"==typeof s&&(s=i.bottom(this.$element));var a=this.getState(r,n,o,s);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=e.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:r-n-s})}};var i=e.fn.affix;e.fn.affix=n,e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=i,this},e(window).on("load",(function(){e('[data-spy="affix"]').each((function(){var t=e(this),i=t.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),n.call(t,i)}))}))}(jQuery), +function(e){var t,n,i,o,s,r,a,l,c,u,d,p,h,f,m,g,v,y,b,w="sizzle"+1*new Date,x=e.document,T=0,C=0,k=se(),E=se(),S=se(),$=function(e,t){return e===t&&(d=!0),0},I=1<<31,N={}.hasOwnProperty,A=[],D=A.pop,O=A.push,L=A.push,H=A.slice,j=function(e,t){for(var n=0,i=e.length;n+~]|"+R+")"+R+"*"),U=new RegExp("="+R+"*([^\\]'\"]*?)"+R+"*\\]","g"),V=new RegExp(_),X=new RegExp("^"+P+"$"),G={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+_),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),bool:new RegExp("^(?:"+z+")$","i"),needsContext:new RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/[+~]/,ee=/'|\\/g,te=new RegExp("\\\\([\\da-f]{1,6}"+R+"?|("+R+")|.)","ig"),ne=function(e,t,n){var i="0x"+t-65536;return i!=i||n?t:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},ie=function(){p()};try{L.apply(A=H.call(x.childNodes),x.childNodes),A[x.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){O.apply(e,H.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}function oe(e,t,i,o){var s,a,c,u,d,f,v,y,T=t&&t.ownerDocument,C=t?t.nodeType:9;if(i=i||[],"string"!=typeof e||!e||1!==C&&9!==C&&11!==C)return i;if(!o&&((t?t.ownerDocument||t:x)!==h&&p(t),t=t||h,m)){if(11!==C&&(f=J.exec(e)))if(s=f[1]){if(9===C){if(!(c=t.getElementById(s)))return i;if(c.id===s)return i.push(c),i}else if(T&&(c=T.getElementById(s))&&b(t,c)&&c.id===s)return i.push(c),i}else{if(f[2])return L.apply(i,t.getElementsByTagName(e)),i;if((s=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(i,t.getElementsByClassName(s)),i}if(n.qsa&&!S[e+" "]&&(!g||!g.test(e))){if(1!==C)T=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((u=t.getAttribute("id"))?u=u.replace(ee,"\\$&"):t.setAttribute("id",u=w),a=(v=r(e)).length,d=X.test(u)?"#"+u:"[id='"+u+"']";a--;)v[a]=d+" "+me(v[a]);y=v.join(","),T=Z.test(e)&&he(t.parentNode)||t}if(y)try{return L.apply(i,T.querySelectorAll(y)),i}catch(e){}finally{u===w&&t.removeAttribute("id")}}}return l(e.replace(B,"$1"),t,i,o)}function se(){var e=[];return function t(n,o){return e.push(n+" ")>i.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function re(e){return e[w]=!0,e}function ae(e){var t=h.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),o=n.length;o--;)i.attrHandle[n[o]]=t}function ce(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||I)-(~e.sourceIndex||I);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function ue(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function de(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pe(e){return re((function(t){return t=+t,re((function(n,i){for(var o,s=e([],n.length,t),r=s.length;r--;)n[o=s[r]]&&(n[o]=!(i[o]=n[o]))}))}))}function he(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=oe.support={},s=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,o,r=e?e.ownerDocument||e:x;return r!==h&&9===r.nodeType&&r.documentElement?(f=(h=r).documentElement,m=!s(h),(o=h.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",ie,!1):o.attachEvent&&o.attachEvent("onunload",ie)),n.attributes=ae((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ae((function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=Y.test(h.getElementsByClassName),n.getById=ae((function(e){return f.appendChild(e).id=w,!h.getElementsByName||!h.getElementsByName(w).length})),n.getById?(i.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}},i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],o=0,s=t.getElementsByTagName(e);if("*"===e){for(;n=s[o++];)1===n.nodeType&&i.push(n);return i}return s},i.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},v=[],g=[],(n.qsa=Y.test(h.querySelectorAll))&&(ae((function(e){f.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+R+"*(?:value|"+z+")"),e.querySelectorAll("[id~="+w+"-]").length||g.push("~="),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]")})),ae((function(e){var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+R+"*[*^$|!~]?="),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Y.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ae((function(e){n.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),v.push("!=",_)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),t=Y.test(f.compareDocumentPosition),b=t||Y.test(f.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},$=t?function(e,t){if(e===t)return d=!0,0;var i=!e.compareDocumentPosition-!t.compareDocumentPosition;return i||(1&(i=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===i?e===h||e.ownerDocument===x&&b(x,e)?-1:t===h||t.ownerDocument===x&&b(x,t)?1:u?j(u,e)-j(u,t):0:4&i?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,i=0,o=e.parentNode,s=t.parentNode,r=[e],a=[t];if(!o||!s)return e===h?-1:t===h?1:o?-1:s?1:u?j(u,e)-j(u,t):0;if(o===s)return ce(e,t);for(n=e;n=n.parentNode;)r.unshift(n);for(n=t;n=n.parentNode;)a.unshift(n);for(;r[i]===a[i];)i++;return i?ce(r[i],a[i]):r[i]===x?-1:a[i]===x?1:0},h):h},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==h&&p(e),t=t.replace(U,"='$1']"),n.matchesSelector&&m&&!S[t+" "]&&(!v||!v.test(t))&&(!g||!g.test(t)))try{var i=y.call(e,t);if(i||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){}return oe(t,h,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==h&&p(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==h&&p(e);var o=i.attrHandle[t.toLowerCase()],s=o&&N.call(i.attrHandle,t.toLowerCase())?o(e,t,!m):void 0;return void 0!==s?s:n.attributes||!m?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,i=[],o=0,s=0;if(d=!n.detectDuplicates,u=!n.sortStable&&e.slice(0),e.sort($),d){for(;t=e[s++];)t===e[s]&&(o=i.push(s));for(;o--;)e.splice(i[o],1)}return u=null,e},o=oe.getText=function(e){var t,n="",i=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[i++];)n+=o(t);return n},i=oe.selectors={cacheLength:50,createPseudo:re,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&V.test(n)&&(t=r(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=k[e+" "];return t||(t=new RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&k(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(i){var o=oe.attr(i,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(W," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,i,o){var s="nth"!==e.slice(0,3),r="last"!==e.slice(-4),a="of-type"===t;return 1===i&&0===o?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,p,h,f,m=s!==r?"nextSibling":"previousSibling",g=t.parentNode,v=a&&t.nodeName.toLowerCase(),y=!l&&!a,b=!1;if(g){if(s){for(;m;){for(p=t;p=p[m];)if(a?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[r?g.firstChild:g.lastChild],r&&y){for(b=(h=(c=(u=(d=(p=g)[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===T&&c[1])&&c[2],p=h&&g.childNodes[h];p=++h&&p&&p[m]||(b=h=0)||f.pop();)if(1===p.nodeType&&++b&&p===t){u[e]=[T,h,b];break}}else if(y&&(b=h=(c=(u=(d=(p=t)[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]||[])[0]===T&&c[1]),!1===b)for(;(p=++h&&p&&p[m]||(b=h=0)||f.pop())&&((a?p.nodeName.toLowerCase()!==v:1!==p.nodeType)||!++b||(y&&((u=(d=p[w]||(p[w]={}))[p.uniqueID]||(d[p.uniqueID]={}))[e]=[T,b]),p!==t)););return(b-=o)===i||b%i==0&&b/i>=0}}},PSEUDO:function(e,t){var n,o=i.pseudos[e]||i.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return o[w]?o(t):o.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?re((function(e,n){for(var i,s=o(e,t),r=s.length;r--;)e[i=j(e,s[r])]=!(n[i]=s[r])})):function(e){return o(e,0,n)}):o}},pseudos:{not:re((function(e){var t=[],n=[],i=a(e.replace(B,"$1"));return i[w]?re((function(e,t,n,o){for(var s,r=i(e,null,o,[]),a=e.length;a--;)(s=r[a])&&(e[a]=!(t[a]=s))})):function(e,o,s){return t[0]=e,i(t,null,s,n),t[0]=null,!n.pop()}})),has:re((function(e){return function(t){return oe(e,t).length>0}})),contains:re((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}})),lang:re((function(e){return X.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:pe((function(){return[0]})),last:pe((function(e,t){return[t-1]})),eq:pe((function(e,t,n){return[n<0?n+t:n]})),even:pe((function(e,t){for(var n=0;n=0;)e.push(i);return e})),gt:pe((function(e,t,n){for(var i=n<0?n+t:n;++i1?function(t,n,i){for(var o=e.length;o--;)if(!e[o](t,n,i))return!1;return!0}:e[0]}function ye(e,t,n,i,o){for(var s,r=[],a=0,l=e.length,c=null!=t;a-1&&(s[c]=!(r[c]=d))}}else v=ye(v===r?v.splice(f,v.length):v),o?o(null,r,v,l):L.apply(r,v)}))}function we(e){for(var t,n,o,s=e.length,r=i.relative[e[0].type],a=r||i.relative[" "],l=r?1:0,u=ge((function(e){return e===t}),a,!0),d=ge((function(e){return j(t,e)>-1}),a,!0),p=[function(e,n,i){var o=!r&&(i||n!==c)||((t=n).nodeType?u(e,n,i):d(e,n,i));return t=null,o}];l1&&ve(p),l>1&&me(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(B,"$1"),n,l0,o=e.length>0,s=function(s,r,a,l,u){var d,f,g,v=0,y="0",b=s&&[],w=[],x=c,C=s||o&&i.find.TAG("*",u),k=T+=null==x?1:Math.random()||.1,E=C.length;for(u&&(c=r===h||r||u);y!==E&&null!=(d=C[y]);y++){if(o&&d){for(f=0,r||d.ownerDocument===h||(p(d),a=!m);g=e[f++];)if(g(d,r||h,a)){l.push(d);break}u&&(T=k)}n&&((d=!g&&d)&&v--,s&&b.push(d))}if(v+=y,n&&y!==v){for(f=0;g=t[f++];)g(b,w,r,a);if(s){if(v>0)for(;y--;)b[y]||w[y]||(w[y]=D.call(l));w=ye(w)}L.apply(l,w),u&&!s&&w.length>0&&v+t.length>1&&oe.uniqueSort(l)}return u&&(T=k,c=x),b};return n?re(s):s}(s,o)),a.selector=e}return a},l=oe.select=function(e,t,o,s){var l,c,u,d,p,h="function"==typeof e&&e,f=!s&&r(e=h.selector||e);if(o=o||[],1===f.length){if((c=f[0]=f[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&n.getById&&9===t.nodeType&&m&&i.relative[c[1].type]){if(!(t=(i.find.ID(u.matches[0].replace(te,ne),t)||[])[0]))return o;h&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(l=G.needsContext.test(e)?0:c.length;l--&&(u=c[l],!i.relative[d=u.type]);)if((p=i.find[d])&&(s=p(u.matches[0].replace(te,ne),Z.test(c[0].type)&&he(t.parentNode)||t))){if(c.splice(l,1),!(e=s.length&&me(c)))return L.apply(o,s),o;break}}return(h||a(e,f))(s,t,!m,o,!t||Z.test(e)&&he(t.parentNode)||t),o},n.sortStable=w.split("").sort($).join("")===w,n.detectDuplicates=!!d,p(),n.sortDetached=ae((function(e){return 1&e.compareDocumentPosition(h.createElement("div"))})),ae((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||le("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ae((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||le("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ae((function(e){return null==e.getAttribute("disabled")}))||le(z,(function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null})),oe}(e);h.find=b,h.expr=b.selectors,h.expr[":"]=h.expr.pseudos,h.uniqueSort=h.unique=b.uniqueSort,h.text=b.getText,h.isXMLDoc=b.isXML,h.contains=b.contains;var w=function(e,t,n){for(var i=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&h(e).is(n))break;i.push(e)}return i},x=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},T=h.expr.match.needsContext,C=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,k=/^.[^:#\[\.,]*$/;function E(e,t,n){if(h.isFunction(t))return h.grep(e,(function(e,i){return!!t.call(e,i,e)!==n}));if(t.nodeType)return h.grep(e,(function(e){return e===t!==n}));if("string"==typeof t){if(k.test(t))return h.filter(t,e,n);t=h.filter(t,e)}return h.grep(e,(function(e){return h.inArray(e,t)>-1!==n}))}h.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?h.find.matchesSelector(i,e)?[i]:[]:h.find.matches(e,h.grep(t,(function(e){return 1===e.nodeType})))},h.fn.extend({find:function(e){var t,n=[],i=this,o=i.length;if("string"!=typeof e)return this.pushStack(h(e).filter((function(){for(t=0;t1?h.unique(n):n)).selector=this.selector?this.selector+" "+e:e,n},filter:function(e){return this.pushStack(E(this,e||[],!1))},not:function(e){return this.pushStack(E(this,e||[],!0))},is:function(e){return!!E(this,"string"==typeof e&&T.test(e)?h(e):e||[],!1).length}});var S,$=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(h.fn.init=function(e,t,n){var o,s;if(!e)return this;if(n=n||S,"string"==typeof e){if(!(o="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:$.exec(e))||!o[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(o[1]){if(t=t instanceof h?t[0]:t,h.merge(this,h.parseHTML(o[1],t&&t.nodeType?t.ownerDocument||t:i,!0)),C.test(o[1])&&h.isPlainObject(t))for(o in t)h.isFunction(this[o])?this[o](t[o]):this.attr(o,t[o]);return this}if((s=i.getElementById(o[2]))&&s.parentNode){if(s.id!==o[2])return S.find(e);this.length=1,this[0]=s}return this.context=i,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):h.isFunction(e)?void 0!==n.ready?n.ready(e):e(h):(void 0!==e.selector&&(this.selector=e.selector,this.context=e.context),h.makeArray(e,this))}).prototype=h.fn,S=h(i);var I=/^(?:parents|prev(?:Until|All))/,N={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e}h.fn.extend({has:function(e){var t,n=h(e,this),i=n.length;return this.filter((function(){for(t=0;t-1:1===n.nodeType&&h.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?h.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?h.inArray(this[0],h(e)):h.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(h.uniqueSort(h.merge(this.get(),h(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),h.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return w(e,"parentNode")},parentsUntil:function(e,t,n){return w(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return w(e,"nextSibling")},prevAll:function(e){return w(e,"previousSibling")},nextUntil:function(e,t,n){return w(e,"nextSibling",n)},prevUntil:function(e,t,n){return w(e,"previousSibling",n)},siblings:function(e){return x((e.parentNode||{}).firstChild,e)},children:function(e){return x(e.firstChild)},contents:function(e){return h.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:h.merge([],e.childNodes)}},(function(e,t){h.fn[e]=function(n,i){var o=h.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(o=h.filter(i,o)),this.length>1&&(N[e]||(o=h.uniqueSort(o)),I.test(e)&&(o=o.reverse())),this.pushStack(o)}}));var D,O,L=/\S+/g;function H(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",j),e.removeEventListener("load",j)):(i.detachEvent("onreadystatechange",j),e.detachEvent("onload",j))}function j(){(i.addEventListener||"load"===e.event.type||"complete"===i.readyState)&&(H(),h.ready())}for(O in h.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return h.each(e.match(L)||[],(function(e,n){t[n]=!0})),t}(e):h.extend({},e);var t,n,i,o,s=[],r=[],a=-1,l=function(){for(o=e.once,i=t=!0;r.length;a=-1)for(n=r.shift();++a-1;)s.splice(n,1),n<=a&&a--})),this},has:function(e){return e?h.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=r=[],s=n="",this},disabled:function(){return!s},lock:function(){return o=!0,n||c.disable(),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],r.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},h.extend({Deferred:function(e){var t=[["resolve","done",h.Callbacks("once memory"),"resolved"],["reject","fail",h.Callbacks("once memory"),"rejected"],["notify","progress",h.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var e=arguments;return h.Deferred((function(n){h.each(t,(function(t,s){var r=h.isFunction(e[t])&&e[t];o[s[1]]((function(){var e=r&&r.apply(this,arguments);e&&h.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[s[0]+"With"](this===i?n.promise():this,r?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?h.extend(e,i):i}},o={};return i.pipe=i.then,h.each(t,(function(e,s){var r=s[2],a=s[3];i[s[1]]=r.add,a&&r.add((function(){n=a}),t[1^e][2].disable,t[2][2].lock),o[s[0]]=function(){return o[s[0]+"With"](this===o?i:this,arguments),this},o[s[0]+"With"]=r.fireWith})),i.promise(o),e&&e.call(o,o),o},when:function(e){var t,n,i,s=0,r=o.call(arguments),a=r.length,l=1!==a||e&&h.isFunction(e.promise)?a:0,c=1===l?e:h.Deferred(),u=function(e,n,i){return function(s){n[e]=this,i[e]=arguments.length>1?o.call(arguments):s,i===t?c.notifyWith(n,i):--l||c.resolveWith(n,i)}};if(a>1)for(t=new Array(a),n=new Array(a),i=new Array(a);s0||(D.resolveWith(i,[h]),h.fn.triggerHandler&&(h(i).triggerHandler("ready"),h(i).off("ready"))))}}),h.ready.promise=function(t){if(!D)if(D=h.Deferred(),"complete"===i.readyState||"loading"!==i.readyState&&!i.documentElement.doScroll)e.setTimeout(h.ready);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",j),e.addEventListener("load",j);else{i.attachEvent("onreadystatechange",j),e.attachEvent("onload",j);var n=!1;try{n=null==e.frameElement&&i.documentElement}catch(e){}n&&n.doScroll&&function t(){if(!h.isReady){try{n.doScroll("left")}catch(n){return e.setTimeout(t,50)}H(),h.ready()}}()}return D.promise(t)},h.ready.promise(),h(d))break;d.ownFirst="0"===O,d.inlineBlockNeedsLayout=!1,h((function(){var e,t,n,o;(n=i.getElementsByTagName("body")[0])&&n.style&&(t=i.createElement("div"),(o=i.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(o).appendChild(t),void 0!==t.style.zoom&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",d.inlineBlockNeedsLayout=e=3===t.offsetWidth,e&&(n.style.zoom=1)),n.removeChild(o))})),function(){var e=i.createElement("div");d.deleteExpando=!0;try{delete e.test}catch(e){d.deleteExpando=!1}e=null}();var z,R=function(e){var t=h.noData[(e.nodeName+" ").toLowerCase()],n=+e.nodeType||1;return(1===n||9===n)&&(!t||!0!==t&&e.getAttribute("classid")===t)},P=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,M=/([A-Z])/g;function _(e,t,n){if(void 0===n&&1===e.nodeType){var i="data-"+t.replace(M,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:P.test(n)?h.parseJSON(n):n)}catch(e){}h.data(e,t,n)}else n=void 0}return n}function W(e){var t;for(t in e)if(("data"!==t||!h.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}function B(e,t,i,o){if(R(e)){var s,r,a=h.expando,l=e.nodeType,c=l?h.cache:e,u=l?e[a]:e[a]&&a;if(u&&c[u]&&(o||c[u].data)||void 0!==i||"string"!=typeof t)return u||(u=l?e[a]=n.pop()||h.guid++:a),c[u]||(c[u]=l?{}:{toJSON:h.noop}),"object"!=typeof t&&"function"!=typeof t||(o?c[u]=h.extend(c[u],t):c[u].data=h.extend(c[u].data,t)),r=c[u],o||(r.data||(r.data={}),r=r.data),void 0!==i&&(r[h.camelCase(t)]=i),"string"==typeof t?null==(s=r[t])&&(s=r[h.camelCase(t)]):s=r,s}}function F(e,t,n){if(R(e)){var i,o,s=e.nodeType,r=s?h.cache:e,a=s?e[h.expando]:h.expando;if(r[a]){if(t&&(i=n?r[a]:r[a].data)){o=(t=h.isArray(t)?t.concat(h.map(t,h.camelCase)):t in i||(t=h.camelCase(t))in i?[t]:t.split(" ")).length;for(;o--;)delete i[t[o]];if(n?!W(i):!h.isEmptyObject(i))return}(n||(delete r[a].data,W(r[a])))&&(s?h.cleanData([e],!0):d.deleteExpando||r!=r.window?delete r[a]:r[a]=void 0)}}}h.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return!!(e=e.nodeType?h.cache[e[h.expando]]:e[h.expando])&&!W(e)},data:function(e,t,n){return B(e,t,n)},removeData:function(e,t){return F(e,t)},_data:function(e,t,n){return B(e,t,n,!0)},_removeData:function(e,t){return F(e,t,!0)}}),h.fn.extend({data:function(e,t){var n,i,o,s=this[0],r=s&&s.attributes;if(void 0===e){if(this.length&&(o=h.data(s),1===s.nodeType&&!h._data(s,"parsedAttrs"))){for(n=r.length;n--;)r[n]&&0===(i=r[n].name).indexOf("data-")&&_(s,i=h.camelCase(i.slice(5)),o[i]);h._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each((function(){h.data(this,e)})):arguments.length>1?this.each((function(){h.data(this,e,t)})):s?_(s,e,h.data(s,e)):void 0},removeData:function(e){return this.each((function(){h.removeData(this,e)}))}}),h.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=h._data(e,t),n&&(!i||h.isArray(n)?i=h._data(e,t,h.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=h.queue(e,t),i=n.length,o=n.shift(),s=h._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),i--),o&&("fx"===t&&n.unshift("inprogress"),delete s.stop,o.call(e,(function(){h.dequeue(e,t)}),s)),!i&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return h._data(e,n)||h._data(e,n,{empty:h.Callbacks("once memory").add((function(){h._removeData(e,t+"queue"),h._removeData(e,n)}))})}}),h.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length
a",d.leadingWhitespace=3===Q.firstChild.nodeType,d.tbody=!Q.getElementsByTagName("tbody").length,d.htmlSerialize=!!Q.getElementsByTagName("link").length,d.html5Clone="<:nav>"!==i.createElement("nav").cloneNode(!0).outerHTML,Y.type="checkbox",Y.checked=!0,K.appendChild(Y),d.appendChecked=Y.checked,Q.innerHTML="",d.noCloneChecked=!!Q.cloneNode(!0).lastChild.defaultValue,K.appendChild(Q),(Y=i.createElement("input")).setAttribute("type","radio"),Y.setAttribute("checked","checked"),Y.setAttribute("name","t"),Q.appendChild(Y),d.checkClone=Q.cloneNode(!0).cloneNode(!0).lastChild.checked,d.noCloneEvent=!!Q.addEventListener,Q[h.expando]=1,d.attributes=!Q.getAttribute(h.expando);var se={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:d.htmlSerialize?[0,"",""]:[1,"X
","
"]};function re(e,t){var n,i,o=0,s=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):void 0;if(!s)for(s=[],n=e.childNodes||e;null!=(i=n[o]);o++)!t||h.nodeName(i,t)?s.push(i):h.merge(s,re(i,t));return void 0===t||t&&h.nodeName(e,t)?h.merge([e],s):s}function ae(e,t){for(var n,i=0;null!=(n=e[i]);i++)h._data(n,"globalEval",!t||h._data(t[i],"globalEval"))}se.optgroup=se.option,se.tbody=se.tfoot=se.colgroup=se.caption=se.thead,se.th=se.td;var le=/<|&#?\w+;/,ce=/"!==p[1]||ce.test(r)?0:l:l.firstChild)&&r.childNodes.length;s--;)h.nodeName(u=r.childNodes[s],"tbody")&&!u.childNodes.length&&r.removeChild(u);for(h.merge(g,l.childNodes),l.textContent="";l.firstChild;)l.removeChild(l.firstChild);l=m.lastChild}else g.push(t.createTextNode(r));for(l&&m.removeChild(l),d.appendChecked||h.grep(re(g,"input"),ue),v=0;r=g[v++];)if(i&&h.inArray(r,i)>-1)o&&o.push(r);else if(a=h.contains(r.ownerDocument,r),l=re(m.appendChild(r),"script"),a&&ae(l),n)for(s=0;r=l[s++];)te.test(r.type||"")&&n.push(r);return l=null,m}!function(){var t,n,o=i.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})n="on"+t,(d[t]=n in e)||(o.setAttribute(n,"t"),d[t]=!1===o.attributes[n].expando);o=null}();var pe=/^(?:input|select|textarea)$/i,he=/^key/,fe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,me=/^(?:focusinfocus|focusoutblur)$/,ge=/^([^.]*)(?:\.(.+)|)/;function ve(){return!0}function ye(){return!1}function be(){try{return i.activeElement}catch(e){}}function we(e,t,n,i,o,s){var r,a;if("object"==typeof t){for(a in"string"!=typeof n&&(i=i||n,n=void 0),t)we(e,a,n,i,t[a],s);return e}if(null==i&&null==o?(o=n,i=n=void 0):null==o&&("string"==typeof n?(o=i,i=void 0):(o=i,i=n,n=void 0)),!1===o)o=ye;else if(!o)return e;return 1===s&&(r=o,o=function(e){return h().off(e),r.apply(this,arguments)},o.guid=r.guid||(r.guid=h.guid++)),e.each((function(){h.event.add(this,t,o,i,n)}))}h.event={global:{},add:function(e,t,n,i,o){var s,r,a,l,c,u,d,p,f,m,g,v=h._data(e);if(v){for(n.handler&&(n=(l=n).handler,o=l.selector),n.guid||(n.guid=h.guid++),(r=v.events)||(r=v.events={}),(u=v.handle)||(u=v.handle=function(e){return void 0===h||e&&h.event.triggered===e.type?void 0:h.event.dispatch.apply(u.elem,arguments)},u.elem=e),a=(t=(t||"").match(L)||[""]).length;a--;)f=g=(s=ge.exec(t[a])||[])[1],m=(s[2]||"").split(".").sort(),f&&(c=h.event.special[f]||{},f=(o?c.delegateType:c.bindType)||f,c=h.event.special[f]||{},d=h.extend({type:f,origType:g,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&h.expr.match.needsContext.test(o),namespace:m.join(".")},l),(p=r[f])||((p=r[f]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(e,i,m,u)||(e.addEventListener?e.addEventListener(f,u,!1):e.attachEvent&&e.attachEvent("on"+f,u))),c.add&&(c.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,d):p.push(d),h.event.global[f]=!0);e=null}},remove:function(e,t,n,i,o){var s,r,a,l,c,u,d,p,f,m,g,v=h.hasData(e)&&h._data(e);if(v&&(u=v.events)){for(c=(t=(t||"").match(L)||[""]).length;c--;)if(f=g=(a=ge.exec(t[c])||[])[1],m=(a[2]||"").split(".").sort(),f){for(d=h.event.special[f]||{},p=u[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=s=p.length;s--;)r=p[s],!o&&g!==r.origType||n&&n.guid!==r.guid||a&&!a.test(r.namespace)||i&&i!==r.selector&&("**"!==i||!r.selector)||(p.splice(s,1),r.selector&&p.delegateCount--,d.remove&&d.remove.call(e,r));l&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,m,v.handle)||h.removeEvent(e,f,v.handle),delete u[f])}else for(f in u)h.event.remove(e,f+t[c],n,i,!0);h.isEmptyObject(u)&&(delete v.handle,h._removeData(e,"events"))}},trigger:function(t,n,o,s){var r,a,l,c,d,p,f,m=[o||i],g=u.call(t,"type")?t.type:t,v=u.call(t,"namespace")?t.namespace.split("."):[];if(l=p=o=o||i,3!==o.nodeType&&8!==o.nodeType&&!me.test(g+h.event.triggered)&&(g.indexOf(".")>-1&&(v=g.split("."),g=v.shift(),v.sort()),a=g.indexOf(":")<0&&"on"+g,(t=t[h.expando]?t:new h.Event(g,"object"==typeof t&&t)).isTrigger=s?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=o),n=null==n?[t]:h.makeArray(n,[t]),d=h.event.special[g]||{},s||!d.trigger||!1!==d.trigger.apply(o,n))){if(!s&&!d.noBubble&&!h.isWindow(o)){for(c=d.delegateType||g,me.test(c+g)||(l=l.parentNode);l;l=l.parentNode)m.push(l),p=l;p===(o.ownerDocument||i)&&m.push(p.defaultView||p.parentWindow||e)}for(f=0;(l=m[f++])&&!t.isPropagationStopped();)t.type=f>1?c:d.bindType||g,(r=(h._data(l,"events")||{})[t.type]&&h._data(l,"handle"))&&r.apply(l,n),(r=a&&l[a])&&r.apply&&R(l)&&(t.result=r.apply(l,n),!1===t.result&&t.preventDefault());if(t.type=g,!s&&!t.isDefaultPrevented()&&(!d._default||!1===d._default.apply(m.pop(),n))&&R(o)&&a&&o[g]&&!h.isWindow(o)){(p=o[a])&&(o[a]=null),h.event.triggered=g;try{o[g]()}catch(e){}h.event.triggered=void 0,p&&(o[a]=p)}return t.result}},dispatch:function(e){e=h.event.fix(e);var t,n,i,s,r,a,l=o.call(arguments),c=(h._data(this,"events")||{})[e.type]||[],u=h.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(a=h.event.handlers.call(this,e,c),t=0;(s=a[t++])&&!e.isPropagationStopped();)for(e.currentTarget=s.elem,n=0;(r=s.handlers[n++])&&!e.isImmediatePropagationStopped();)e.rnamespace&&!e.rnamespace.test(r.namespace)||(e.handleObj=r,e.data=r.data,void 0!==(i=((h.event.special[r.origType]||{}).handle||r.handler).apply(s.elem,l))&&!1===(e.result=i)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,i,o,s,r=[],a=t.delegateCount,l=e.target;if(a&&l.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],n=0;n-1:h.find(o,this,null,[l]).length),i[o]&&i.push(s);i.length&&r.push({elem:l,handlers:i})}return a]","i"),Ce=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ke=/\s*$/g,Ie=oe(i).appendChild(i.createElement("div"));function Ne(e,t){return h.nodeName(e,"table")&&h.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ae(e){return e.type=(null!==h.find.attr(e,"type"))+"/"+e.type,e}function De(e){var t=Se.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Oe(e,t){if(1===t.nodeType&&h.hasData(e)){var n,i,o,s=h._data(e),r=h._data(t,s),a=s.events;if(a)for(n in delete r.handle,r.events={},a)for(i=0,o=a[n].length;i1&&"string"==typeof g&&!d.checkClone&&Ee.test(g))return e.each((function(o){var s=e.eq(o);v&&(t[0]=g.call(this,o,s.html())),He(s,t,n,i)}));if(f&&(o=(u=de(t,e[0].ownerDocument,!1,e,i)).firstChild,1===u.childNodes.length&&(u=o),o||i)){for(a=(l=h.map(re(u,"script"),Ae)).length;p")},clone:function(e,t,n){var i,o,s,r,a,l=h.contains(e.ownerDocument,e);if(d.html5Clone||h.isXMLDoc(e)||!Te.test("<"+e.nodeName+">")?s=e.cloneNode(!0):(Ie.innerHTML=e.outerHTML,Ie.removeChild(s=Ie.firstChild)),!(d.noCloneEvent&&d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||h.isXMLDoc(e)))for(i=re(s),a=re(e),r=0;null!=(o=a[r]);++r)i[r]&&Le(o,i[r]);if(t)if(n)for(a=a||re(e),i=i||re(s),r=0;null!=(o=a[r]);r++)Oe(o,i[r]);else Oe(e,s);return(i=re(s,"script")).length>0&&ae(i,!l&&re(e,"script")),i=a=o=null,s},cleanData:function(e,t){for(var i,o,s,r,a=0,l=h.expando,c=h.cache,u=d.attributes,p=h.event.special;null!=(i=e[a]);a++)if((t||R(i))&&(r=(s=i[l])&&c[s])){if(r.events)for(o in r.events)p[o]?h.event.remove(i,o):h.removeEvent(i,o,r.handle);c[s]&&(delete c[s],u||void 0===i.removeAttribute?i[l]=void 0:i.removeAttribute(l),n.push(s))}}}),h.fn.extend({domManip:He,detach:function(e){return je(this,e,!0)},remove:function(e){return je(this,e)},text:function(e){return J(this,(function(e){return void 0===e?h.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))}),null,e,arguments.length)},append:function(){return He(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ne(this,e).appendChild(e)}))},prepend:function(){return He(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Ne(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return He(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return He(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&h.cleanData(re(e,!1));e.firstChild;)e.removeChild(e.firstChild);e.options&&h.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return h.clone(this,e,t)}))},html:function(e){return J(this,(function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e)return 1===t.nodeType?t.innerHTML.replace(xe,""):void 0;if("string"==typeof e&&!ke.test(e)&&(d.htmlSerialize||!Te.test(e))&&(d.leadingWhitespace||!ne.test(e))&&!se[(ee.exec(e)||["",""])[1].toLowerCase()]){e=h.htmlPrefilter(e);try{for(;n")).appendTo(t.documentElement))[0].contentWindow||ze[0].contentDocument).document).write(),t.close(),n=Pe(e,t),ze.detach()),Re[e]=n),n}var _e=/^margin/,We=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),Be=function(e,t,n,i){var o,s,r={};for(s in t)r[s]=e.style[s],e.style[s]=t[s];for(s in o=n.apply(e,i||[]),t)e.style[s]=r[s];return o},Fe=i.documentElement;!function(){var t,n,o,s,r,a,l=i.createElement("div"),c=i.createElement("div");function u(){var u,d,p=i.documentElement;p.appendChild(l),c.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",t=o=a=!1,n=r=!0,e.getComputedStyle&&(d=e.getComputedStyle(c),t="1%"!==(d||{}).top,a="2px"===(d||{}).marginLeft,o="4px"===(d||{width:"4px"}).width,c.style.marginRight="50%",n="4px"===(d||{marginRight:"4px"}).marginRight,(u=c.appendChild(i.createElement("div"))).style.cssText=c.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",u.style.marginRight=u.style.width="0",c.style.width="1px",r=!parseFloat((e.getComputedStyle(u)||{}).marginRight),c.removeChild(u)),c.style.display="none",(s=0===c.getClientRects().length)&&(c.style.display="",c.innerHTML="
t
",c.childNodes[0].style.borderCollapse="separate",(u=c.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(s=0===u[0].offsetHeight)&&(u[0].style.display="",u[1].style.display="none",s=0===u[0].offsetHeight)),p.removeChild(l)}c.style&&(c.style.cssText="float:left;opacity:.5",d.opacity="0.5"===c.style.opacity,d.cssFloat=!!c.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===c.style.backgroundClip,(l=i.createElement("div")).style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",c.innerHTML="",l.appendChild(c),d.boxSizing=""===c.style.boxSizing||""===c.style.MozBoxSizing||""===c.style.WebkitBoxSizing,h.extend(d,{reliableHiddenOffsets:function(){return null==t&&u(),s},boxSizingReliable:function(){return null==t&&u(),o},pixelMarginRight:function(){return null==t&&u(),n},pixelPosition:function(){return null==t&&u(),t},reliableMarginRight:function(){return null==t&&u(),r},reliableMarginLeft:function(){return null==t&&u(),a}}))}();var qe,Ue,Ve=/^(top|right|bottom|left)$/;function Xe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}e.getComputedStyle?(qe=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Ue=function(e,t,n){var i,o,s,r,a=e.style;return""!==(r=(n=n||qe(e))?n.getPropertyValue(t)||n[t]:void 0)&&void 0!==r||h.contains(e.ownerDocument,e)||(r=h.style(e,t)),n&&!d.pixelMarginRight()&&We.test(r)&&_e.test(t)&&(i=a.width,o=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=n.width,a.width=i,a.minWidth=o,a.maxWidth=s),void 0===r?r:r+""}):Fe.currentStyle&&(qe=function(e){return e.currentStyle},Ue=function(e,t,n){var i,o,s,r,a=e.style;return null==(r=(n=n||qe(e))?n[t]:void 0)&&a&&a[t]&&(r=a[t]),We.test(r)&&!Ve.test(t)&&(i=a.left,(s=(o=e.runtimeStyle)&&o.left)&&(o.left=e.currentStyle.left),a.left="fontSize"===t?"1em":r,r=a.pixelLeft+"px",a.left=i,s&&(o.left=s)),void 0===r?r:r+""||"auto"});var Ge=/alpha\([^)]*\)/i,Qe=/opacity\s*=\s*([^)]*)/i,Ke=/^(none|table(?!-c[ea]).+)/,Ye=new RegExp("^("+q+")(.*)$","i"),Je={position:"absolute",visibility:"hidden",display:"block"},Ze={letterSpacing:"0",fontWeight:"400"},et=["Webkit","O","Moz","ms"],tt=i.createElement("div").style;function nt(e){if(e in tt)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=et.length;n--;)if((e=et[n]+t)in tt)return e}function it(e,t){for(var n,i,o,s=[],r=0,a=e.length;r=1||""===t)&&""===h.trim(s.replace(Ge,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||i&&!i.filter)||(n.filter=Ge.test(s)?s.replace(Ge,o):s+" "+o)}}),h.cssHooks.marginRight=Xe(d.reliableMarginRight,(function(e,t){if(t)return Be(e,{display:"inline-block"},Ue,[e,"marginRight"])})),h.cssHooks.marginLeft=Xe(d.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ue(e,"marginLeft"))||(h.contains(e.ownerDocument,e)?e.getBoundingClientRect().left-Be(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})):0))+"px"})),h.each({margin:"",padding:"",border:"Width"},(function(e,t){h.cssHooks[e+t]={expand:function(n){for(var i=0,o={},s="string"==typeof n?n.split(" "):[n];i<4;i++)o[e+V[i]+t]=s[i]||s[i-2]||s[0];return o}},_e.test(e)||(h.cssHooks[e+t].set=ot)})),h.fn.extend({css:function(e,t){return J(this,(function(e,t,n){var i,o,s={},r=0;if(h.isArray(t)){for(i=qe(e),o=t.length;r1)},show:function(){return it(this,!0)},hide:function(){return it(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){X(this)?h(this).show():h(this).hide()}))}}),h.Tween=at,at.prototype={constructor:at,init:function(e,t,n,i,o,s){this.elem=e,this.prop=n,this.easing=o||h.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=s||(h.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=h.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}},at.prototype.init.prototype=at.prototype,at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=h.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){h.fx.step[e.prop]?h.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[h.cssProps[e.prop]]&&!h.cssHooks[e.prop]?e.elem[e.prop]=e.now:h.style(e.elem,e.prop,e.now+e.unit)}}},at.propHooks.scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},h.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},h.fx=at.prototype.init,h.fx.step={};var lt,ct,ut=/^(?:toggle|show|hide)$/,dt=/queueHooks$/;function pt(){return e.setTimeout((function(){lt=void 0})),lt=h.now()}function ht(e,t){var n,i={height:e},o=0;for(t=t?1:0;o<4;o+=2-t)i["margin"+(n=V[o])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ft(e,t,n){for(var i,o=(mt.tweeners[t]||[]).concat(mt.tweeners["*"]),s=0,r=o.length;s
a",e=n.getElementsByTagName("a")[0],t.setAttribute("type","checkbox"),n.appendChild(t),(e=n.getElementsByTagName("a")[0]).style.cssText="top:1px",d.getSetAttribute="t"!==n.className,d.style=/top/.test(e.getAttribute("style")),d.hrefNormalized="/a"===e.getAttribute("href"),d.checkOn=!!t.value,d.optSelected=s.selected,d.enctype=!!i.createElement("form").enctype,o.disabled=!0,d.optDisabled=!s.disabled,(t=i.createElement("input")).setAttribute("value",""),d.input=""===t.getAttribute("value"),t.value="t",t.setAttribute("type","radio"),d.radioValue="t"===t.value}();var gt=/\r/g,vt=/[\x20\t\r\n\f]+/g;h.fn.extend({val:function(e){var t,n,i,o=this[0];return arguments.length?(i=h.isFunction(e),this.each((function(n){var o;1===this.nodeType&&(null==(o=i?e.call(this,n,h(this).val()):e)?o="":"number"==typeof o?o+="":h.isArray(o)&&(o=h.map(o,(function(e){return null==e?"":e+""}))),(t=h.valHooks[this.type]||h.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))}))):o?(t=h.valHooks[o.type]||h.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(gt,""):null==n?"":n:void 0}}),h.extend({valHooks:{option:{get:function(e){var t=h.find.attr(e,"value");return null!=t?t:h.trim(h.text(e)).replace(vt," ")}},select:{get:function(e){for(var t,n,i=e.options,o=e.selectedIndex,s="select-one"===e.type||o<0,r=s?null:[],a=s?o+1:i.length,l=o<0?a:s?o:0;l-1)try{i.selected=n=!0}catch(e){i.scrollHeight}else i.selected=!1;return n||(e.selectedIndex=-1),o}}}}),h.each(["radio","checkbox"],(function(){h.valHooks[this]={set:function(e,t){if(h.isArray(t))return e.checked=h.inArray(h(e).val(),t)>-1}},d.checkOn||(h.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var yt,bt,wt=h.expr.attrHandle,xt=/^(?:checked|selected)$/i,Tt=d.getSetAttribute,Ct=d.input;h.fn.extend({attr:function(e,t){return J(this,h.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){h.removeAttr(this,e)}))}}),h.extend({attr:function(e,t,n){var i,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?h.prop(e,t,n):(1===s&&h.isXMLDoc(e)||(t=t.toLowerCase(),o=h.attrHooks[t]||(h.expr.match.bool.test(t)?bt:yt)),void 0!==n?null===n?void h.removeAttr(e,t):o&&"set"in o&&void 0!==(i=o.set(e,n,t))?i:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(i=o.get(e,t))?i:null==(i=h.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&h.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i,o=0,s=t&&t.match(L);if(s&&1===e.nodeType)for(;n=s[o++];)i=h.propFix[n]||n,h.expr.match.bool.test(n)?Ct&&Tt||!xt.test(n)?e[i]=!1:e[h.camelCase("default-"+n)]=e[i]=!1:h.attr(e,n,""),e.removeAttribute(Tt?n:i)}}),bt={set:function(e,t,n){return!1===t?h.removeAttr(e,n):Ct&&Tt||!xt.test(n)?e.setAttribute(!Tt&&h.propFix[n]||n,n):e[h.camelCase("default-"+n)]=e[n]=!0,n}},h.each(h.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=wt[t]||h.find.attr;Ct&&Tt||!xt.test(t)?wt[t]=function(e,t,i){var o,s;return i||(s=wt[t],wt[t]=o,o=null!=n(e,t,i)?t.toLowerCase():null,wt[t]=s),o}:wt[t]=function(e,t,n){if(!n)return e[h.camelCase("default-"+t)]?t.toLowerCase():null}})),Ct&&Tt||(h.attrHooks.value={set:function(e,t,n){if(!h.nodeName(e,"input"))return yt&&yt.set(e,t,n);e.defaultValue=t}}),Tt||(yt={set:function(e,t,n){var i=e.getAttributeNode(n);if(i||e.setAttributeNode(i=e.ownerDocument.createAttribute(n)),i.value=t+="","value"===n||t===e.getAttribute(n))return t}},wt.id=wt.name=wt.coords=function(e,t,n){var i;if(!n)return(i=e.getAttributeNode(t))&&""!==i.value?i.value:null},h.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);if(n&&n.specified)return n.value},set:yt.set},h.attrHooks.contenteditable={set:function(e,t,n){yt.set(e,""!==t&&t,n)}},h.each(["width","height"],(function(e,t){h.attrHooks[t]={set:function(e,n){if(""===n)return e.setAttribute(t,"auto"),n}}}))),d.style||(h.attrHooks.style={get:function(e){return e.style.cssText||void 0},set:function(e,t){return e.style.cssText=t+""}});var kt=/^(?:input|select|textarea|button|object)$/i,Et=/^(?:a|area)$/i;h.fn.extend({prop:function(e,t){return J(this,h.prop,e,t,arguments.length>1)},removeProp:function(e){return e=h.propFix[e]||e,this.each((function(){try{this[e]=void 0,delete this[e]}catch(e){}}))}}),h.extend({prop:function(e,t,n){var i,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&h.isXMLDoc(e)||(t=h.propFix[t]||t,o=h.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(i=o.set(e,n,t))?i:e[t]=n:o&&"get"in o&&null!==(i=o.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=h.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||Et.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),d.hrefNormalized||h.each(["href","src"],(function(e,t){h.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),d.optSelected||(h.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),h.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){h.propFix[this.toLowerCase()]=this})),d.enctype||(h.propFix.enctype="encoding");var St=/[\t\r\n\f]/g;function $t(e){return h.attr(e,"class")||""}h.fn.extend({addClass:function(e){var t,n,i,o,s,r,a,l=0;if(h.isFunction(e))return this.each((function(t){h(this).addClass(e.call(this,t,$t(this)))}));if("string"==typeof e&&e)for(t=e.match(L)||[];n=this[l++];)if(o=$t(n),i=1===n.nodeType&&(" "+o+" ").replace(St," ")){for(r=0;s=t[r++];)i.indexOf(" "+s+" ")<0&&(i+=s+" ");o!==(a=h.trim(i))&&h.attr(n,"class",a)}return this},removeClass:function(e){var t,n,i,o,s,r,a,l=0;if(h.isFunction(e))return this.each((function(t){h(this).removeClass(e.call(this,t,$t(this)))}));if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(L)||[];n=this[l++];)if(o=$t(n),i=1===n.nodeType&&(" "+o+" ").replace(St," ")){for(r=0;s=t[r++];)for(;i.indexOf(" "+s+" ")>-1;)i=i.replace(" "+s+" "," ");o!==(a=h.trim(i))&&h.attr(n,"class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):h.isFunction(e)?this.each((function(n){h(this).toggleClass(e.call(this,n,$t(this),t),t)})):this.each((function(){var t,i,o,s;if("string"===n)for(i=0,o=h(this),s=e.match(L)||[];t=s[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=$t(this))&&h._data(this,"__className__",t),h.attr(this,"class",t||!1===e?"":h._data(this,"__className__")||""))}))},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&(" "+$t(n)+" ").replace(St," ").indexOf(t)>-1)return!0;return!1}}),h.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(e,t){h.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}})),h.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}});var It=e.location,Nt=h.now(),At=/\?/,Dt=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;h.parseJSON=function(t){if(e.JSON&&e.JSON.parse)return e.JSON.parse(t+"");var n,i=null,o=h.trim(t+"");return o&&!h.trim(o.replace(Dt,(function(e,t,o,s){return n&&t&&(i=0),0===i?e:(n=o||t,i+=!s-!o,"")})))?Function("return "+o)():h.error("Invalid JSON: "+t)},h.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{e.DOMParser?n=(new e.DOMParser).parseFromString(t,"text/xml"):((n=new e.ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(t))}catch(e){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||h.error("Invalid XML: "+t),n};var Ot=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,jt=/^(?:GET|HEAD)$/,zt=/^\/\//,Rt=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Pt={},Mt={},_t="*/".concat("*"),Wt=It.href,Bt=Rt.exec(Wt.toLowerCase())||[];function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,o=0,s=t.toLowerCase().match(L)||[];if(h.isFunction(n))for(;i=s[o++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function qt(e,t,n,i){var o={},s=e===Mt;function r(a){var l;return o[a]=!0,h.each(e[a]||[],(function(e,a){var c=a(t,n,i);return"string"!=typeof c||s||o[c]?s?!(l=c):void 0:(t.dataTypes.unshift(c),r(c),!1)})),l}return r(t.dataTypes[0])||!o["*"]&&r("*")}function Ut(e,t){var n,i,o=h.ajaxSettings.flatOptions||{};for(i in t)void 0!==t[i]&&((o[i]?e:n||(n={}))[i]=t[i]);return n&&h.extend(!0,e,n),e}function Vt(e){return e.style&&e.style.display||h.css(e,"display")}h.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Wt,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Bt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":_t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":h.parseJSON,"text xml":h.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ut(Ut(e,h.ajaxSettings),t):Ut(h.ajaxSettings,e)},ajaxPrefilter:Ft(Pt),ajaxTransport:Ft(Mt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,r,a,l,c,u,d=h.ajaxSetup({},n),p=d.context||d,f=d.context&&(p.nodeType||p.jquery)?h(p):h.event,m=h.Deferred(),g=h.Callbacks("once memory"),v=d.statusCode||{},y={},b={},w=0,x="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===w){if(!u)for(u={};t=Ht.exec(r);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===w?r:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return w||(e=b[n]=b[n]||e,y[e]=t),this},overrideMimeType:function(e){return w||(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(w<2)for(t in e)v[t]=[v[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||x;return c&&c.abort(t),C(0,t),this}};if(m.promise(T).complete=g.add,T.success=T.done,T.error=T.fail,d.url=((t||d.url||Wt)+"").replace(Ot,"").replace(zt,Bt[1]+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=h.trim(d.dataType||"*").toLowerCase().match(L)||[""],null==d.crossDomain&&(i=Rt.exec(d.url.toLowerCase()),d.crossDomain=!(!i||i[1]===Bt[1]&&i[2]===Bt[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(Bt[3]||("http:"===Bt[1]?"80":"443")))),d.data&&d.processData&&"string"!=typeof d.data&&(d.data=h.param(d.data,d.traditional)),qt(Pt,d,n,T),2===w)return T;for(o in(l=h.event&&d.global)&&0==h.active++&&h.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!jt.test(d.type),s=d.url,d.hasContent||(d.data&&(s=d.url+=(At.test(s)?"&":"?")+d.data,delete d.data),!1===d.cache&&(d.url=Lt.test(s)?s.replace(Lt,"$1_="+Nt++):s+(At.test(s)?"&":"?")+"_="+Nt++)),d.ifModified&&(h.lastModified[s]&&T.setRequestHeader("If-Modified-Since",h.lastModified[s]),h.etag[s]&&T.setRequestHeader("If-None-Match",h.etag[s])),(d.data&&d.hasContent&&!1!==d.contentType||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+_t+"; q=0.01":""):d.accepts["*"]),d.headers)T.setRequestHeader(o,d.headers[o]);if(d.beforeSend&&(!1===d.beforeSend.call(p,T,d)||2===w))return T.abort();for(o in x="abort",{success:1,error:1,complete:1})T[o](d[o]);if(c=qt(Mt,d,n,T)){if(T.readyState=1,l&&f.trigger("ajaxSend",[T,d]),2===w)return T;d.async&&d.timeout>0&&(a=e.setTimeout((function(){T.abort("timeout")}),d.timeout));try{w=1,c.send(y,C)}catch(e){if(!(w<2))throw e;C(-1,e)}}else C(-1,"No Transport");function C(t,n,i,o){var u,y,b,x,C,k=n;2!==w&&(w=2,a&&e.clearTimeout(a),c=void 0,r=o||"",T.readyState=t>0?4:0,u=t>=200&&t<300||304===t,i&&(x=function(e,t,n){for(var i,o,s,r,a=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===o&&(o=e.mimeType||t.getResponseHeader("Content-Type"));if(o)for(r in a)if(a[r]&&a[r].test(o)){l.unshift(r);break}if(l[0]in n)s=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){s=r;break}i||(i=r)}s=s||i}if(s)return s!==l[0]&&l.unshift(s),n[s]}(d,T,i)),x=function(e,t,n,i){var o,s,r,a,l,c={},u=e.dataTypes.slice();if(u[1])for(r in e.converters)c[r.toLowerCase()]=e.converters[r];for(s=u.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=s,s=u.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(r=c[l+" "+s]||c["* "+s]))for(o in c)if((a=o.split(" "))[1]===s&&(r=c[l+" "+a[0]]||c["* "+a[0]])){!0===r?r=c[o]:!0!==c[o]&&(s=a[0],u.unshift(a[1]));break}if(!0!==r)if(r&&e.throws)t=r(t);else try{t=r(t)}catch(e){return{state:"parsererror",error:r?e:"No conversion from "+l+" to "+s}}}return{state:"success",data:t}}(d,x,T,u),u?(d.ifModified&&((C=T.getResponseHeader("Last-Modified"))&&(h.lastModified[s]=C),(C=T.getResponseHeader("etag"))&&(h.etag[s]=C)),204===t||"HEAD"===d.type?k="nocontent":304===t?k="notmodified":(k=x.state,y=x.data,u=!(b=x.error))):(b=k,!t&&k||(k="error",t<0&&(t=0))),T.status=t,T.statusText=(n||k)+"",u?m.resolveWith(p,[y,k,T]):m.rejectWith(p,[T,k,b]),T.statusCode(v),v=void 0,l&&f.trigger(u?"ajaxSuccess":"ajaxError",[T,d,u?y:b]),g.fireWith(p,[T,k]),l&&(f.trigger("ajaxComplete",[T,d]),--h.active||h.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return h.get(e,t,n,"json")},getScript:function(e,t){return h.get(e,void 0,t,"script")}}),h.each(["get","post"],(function(e,t){h[t]=function(e,n,i,o){return h.isFunction(n)&&(o=o||i,i=n,n=void 0),h.ajax(h.extend({url:e,type:t,dataType:o,data:n,success:i},h.isPlainObject(e)&&e))}})),h._evalUrl=function(e){return h.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},h.fn.extend({wrapAll:function(e){if(h.isFunction(e))return this.each((function(t){h(this).wrapAll(e.call(this,t))}));if(this[0]){var t=h(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;)e=e.firstChild;return e})).append(this)}return this},wrapInner:function(e){return h.isFunction(e)?this.each((function(t){h(this).wrapInner(e.call(this,t))})):this.each((function(){var t=h(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=h.isFunction(e);return this.each((function(n){h(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){h.nodeName(this,"body")||h(this).replaceWith(this.childNodes)})).end()}}),h.expr.filters.hidden=function(e){return d.reliableHiddenOffsets()?e.offsetWidth<=0&&e.offsetHeight<=0&&!e.getClientRects().length:function(e){if(!h.contains(e.ownerDocument||i,e))return!0;for(;e&&1===e.nodeType;){if("none"===Vt(e)||"hidden"===e.type)return!0;e=e.parentNode}return!1}(e)},h.expr.filters.visible=function(e){return!h.expr.filters.hidden(e)};var Xt=/%20/g,Gt=/\[\]$/,Qt=/\r?\n/g,Kt=/^(?:submit|button|image|reset|file)$/i,Yt=/^(?:input|select|textarea|keygen)/i;function Jt(e,t,n,i){var o;if(h.isArray(t))h.each(t,(function(t,o){n||Gt.test(e)?i(e,o):Jt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,i)}));else if(n||"object"!==h.type(t))i(e,t);else for(o in t)Jt(e+"["+o+"]",t[o],n,i)}h.param=function(e,t){var n,i=[],o=function(e,t){t=h.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(void 0===t&&(t=h.ajaxSettings&&h.ajaxSettings.traditional),h.isArray(e)||e.jquery&&!h.isPlainObject(e))h.each(e,(function(){o(this.name,this.value)}));else for(n in e)Jt(n,e[n],t,o);return i.join("&").replace(Xt,"+")},h.fn.extend({serialize:function(){return h.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=h.prop(this,"elements");return e?h.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!h(this).is(":disabled")&&Yt.test(this.nodeName)&&!Kt.test(e)&&(this.checked||!Z.test(e))})).map((function(e,t){var n=h(this).val();return null==n?null:h.isArray(n)?h.map(n,(function(e){return{name:t.name,value:e.replace(Qt,"\r\n")}})):{name:t.name,value:n.replace(Qt,"\r\n")}})).get()}}),h.ajaxSettings.xhr=void 0!==e.ActiveXObject?function(){return this.isLocal?on():i.documentMode>8?nn():/^(get|post|head|put|delete|options)$/i.test(this.type)&&nn()||on()}:nn;var Zt=0,en={},tn=h.ajaxSettings.xhr();function nn(){try{return new e.XMLHttpRequest}catch(e){}}function on(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}e.attachEvent&&e.attachEvent("onunload",(function(){for(var e in en)en[e](void 0,!0)})),d.cors=!!tn&&"withCredentials"in tn,(tn=d.ajax=!!tn)&&h.ajaxTransport((function(t){var n;if(!t.crossDomain||d.cors)return{send:function(i,o){var s,r=t.xhr(),a=++Zt;if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)r[s]=t.xhrFields[s];for(s in t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)void 0!==i[s]&&r.setRequestHeader(s,i[s]+"");r.send(t.hasContent&&t.data||null),n=function(e,i){var s,l,c;if(n&&(i||4===r.readyState))if(delete en[a],n=void 0,r.onreadystatechange=h.noop,i)4!==r.readyState&&r.abort();else{c={},s=r.status,"string"==typeof r.responseText&&(c.text=r.responseText);try{l=r.statusText}catch(e){l=""}s||!t.isLocal||t.crossDomain?1223===s&&(s=204):s=c.text?200:404}c&&o(s,l,c,r.getAllResponseHeaders())},t.async?4===r.readyState?e.setTimeout(n):r.onreadystatechange=en[a]=n:n()},abort:function(){n&&n(void 0,!0)}}})),h.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return h.globalEval(e),e}}}),h.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)})),h.ajaxTransport("script",(function(e){if(e.crossDomain){var t,n=i.head||h("head")[0]||i.documentElement;return{send:function(o,s){(t=i.createElement("script")).async=!0,e.scriptCharset&&(t.charset=e.scriptCharset),t.src=e.url,t.onload=t.onreadystatechange=function(e,n){(n||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,n||s(200,"success"))},n.insertBefore(t,n.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}}));var sn=[],rn=/(=)\?(?=&|$)|\?\?/;h.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=sn.pop()||h.expando+"_"+Nt++;return this[e]=!0,e}}),h.ajaxPrefilter("json jsonp",(function(t,n,i){var o,s,r,a=!1!==t.jsonp&&(rn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&rn.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return o=t.jsonpCallback=h.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(rn,"$1"+o):!1!==t.jsonp&&(t.url+=(At.test(t.url)?"&":"?")+t.jsonp+"="+o),t.converters["script json"]=function(){return r||h.error(o+" was not called"),r[0]},t.dataTypes[0]="json",s=e[o],e[o]=function(){r=arguments},i.always((function(){void 0===s?h(e).removeProp(o):e[o]=s,t[o]&&(t.jsonpCallback=n.jsonpCallback,sn.push(o)),r&&h.isFunction(s)&&s(r[0]),r=s=void 0})),"script"})),h.parseHTML=function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||i;var o=C.exec(e),s=!n&&[];return o?[t.createElement(o[1])]:(o=de([e],t,s),s&&s.length&&h(s).remove(),h.merge([],o.childNodes))};var an=h.fn.load;function ln(e){return h.isWindow(e)?e:9===e.nodeType&&(e.defaultView||e.parentWindow)}h.fn.load=function(e,t,n){if("string"!=typeof e&&an)return an.apply(this,arguments);var i,o,s,r=this,a=e.indexOf(" ");return a>-1&&(i=h.trim(e.slice(a,e.length)),e=e.slice(0,a)),h.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),r.length>0&&h.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done((function(e){s=arguments,r.html(i?h("
").append(h.parseHTML(e)).find(i):e)})).always(n&&function(e,t){r.each((function(){n.apply(this,s||[e.responseText,t,e])}))}),this},h.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){h.fn[t]=function(e){return this.on(t,e)}})),h.expr.filters.animated=function(e){return h.grep(h.timers,(function(t){return e===t.elem})).length},h.offset={setOffset:function(e,t,n){var i,o,s,r,a,l,c=h.css(e,"position"),u=h(e),d={};"static"===c&&(e.style.position="relative"),a=u.offset(),s=h.css(e,"top"),l=h.css(e,"left"),("absolute"===c||"fixed"===c)&&h.inArray("auto",[s,l])>-1?(r=(i=u.position()).top,o=i.left):(r=parseFloat(s)||0,o=parseFloat(l)||0),h.isFunction(t)&&(t=t.call(e,n,h.extend({},a))),null!=t.top&&(d.top=t.top-a.top+r),null!=t.left&&(d.left=t.left-a.left+o),"using"in t?t.using.call(e,d):u.css(d)}},h.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){h.offset.setOffset(this,e,t)}));var t,n,i={top:0,left:0},o=this[0],s=o&&o.ownerDocument;return s?(t=s.documentElement,h.contains(t,o)?(void 0!==o.getBoundingClientRect&&(i=o.getBoundingClientRect()),n=ln(s),{top:i.top+(n.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(n.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):i):void 0},position:function(){if(this[0]){var e,t,n={top:0,left:0},i=this[0];return"fixed"===h.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),h.nodeName(e[0],"html")||(n=e.offset()),n.top+=h.css(e[0],"borderTopWidth",!0),n.left+=h.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-h.css(i,"marginTop",!0),left:t.left-n.left-h.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&!h.nodeName(e,"html")&&"static"===h.css(e,"position");)e=e.offsetParent;return e||Fe}))}}),h.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n=/Y/.test(t);h.fn[e]=function(i){return J(this,(function(e,i,o){var s=ln(e);if(void 0===o)return s?t in s?s[t]:s.document.documentElement[i]:e[i];s?s.scrollTo(n?h(s).scrollLeft():o,n?o:h(s).scrollTop()):e[i]=o}),e,i,arguments.length,null)}})),h.each(["top","left"],(function(e,t){h.cssHooks[t]=Xe(d.pixelPosition,(function(e,n){if(n)return n=Ue(e,t),We.test(n)?h(e).position()[t]+"px":n}))})),h.each({Height:"height",Width:"width"},(function(e,t){h.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,i){h.fn[i]=function(i,o){var s=arguments.length&&(n||"boolean"!=typeof i),r=n||(!0===i||!0===o?"margin":"border");return J(this,(function(t,n,i){var o;return h.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?h.css(t,n,r):h.style(t,n,i,r)}),t,s?i:void 0,s,null)}}))})),h.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),h.fn.size=function(){return this.length},h.fn.andSelf=h.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],(function(){return h}));var cn=e.jQuery,un=e.$;return h.noConflict=function(t){return e.$===h&&(e.$=un),t&&e.jQuery===h&&(e.jQuery=cn),h},t||(e.jQuery=e.$=h),h})),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(e){"use strict";var t=jQuery.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(e){"use strict";e.fn.emulateTransitionEnd=function(t){var n=!1,i=this;e(this).one("bsTransitionEnd",(function(){n=!0}));return setTimeout((function(){n||e(i).trigger(e.support.transition.end)}),t),this},e((function(){e.support.transition=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})}))}(jQuery),function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.VERSION="3.4.1",n.TRANSITION_DURATION=150,n.prototype.close=function(t){var i=e(this),o=i.attr("data-target");o||(o=(o=i.attr("href"))&&o.replace(/.*(?=#[^\s]*$)/,"")),o="#"===o?[]:o;var s=e(document).find(o);function r(){s.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),s.length||(s=i.closest(".alert")),s.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(s.removeClass("in"),e.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",r).emulateTransitionEnd(n.TRANSITION_DURATION):r())};var i=e.fn.alert;e.fn.alert=function(t){return this.each((function(){var i=e(this),o=i.data("bs.alert");o||i.data("bs.alert",o=new n(this)),"string"==typeof t&&o[t].call(i)}))},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(jQuery),function(e){"use strict";var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.isLoading=!1};function n(n){return this.each((function(){var i=e(this),o=i.data("bs.button"),s="object"==typeof n&&n;o||i.data("bs.button",o=new t(this,s)),"toggle"==n?o.toggle():n&&o.setState(n)}))}t.VERSION="3.4.1",t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(t){var n="disabled",i=this.$element,o=i.is("input")?"val":"html",s=i.data();t+="Text",null==s.resetText&&i.data("resetText",i[o]()),setTimeout(e.proxy((function(){i[o](null==s[t]?this.options[t]:s[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(n).removeAttr(n).prop(n,!1))}),this),0)},t.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var i=e.fn.button;e.fn.button=n,e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=i,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(t){var i=e(t.target).closest(".btn");n.call(i,"toggle"),e(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),i.is("input,button")?i.trigger("focus"):i.find("input:visible,button:visible").first().trigger("focus"))})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))}))}(jQuery),function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};function n(n){return this.each((function(){var i=e(this),o=i.data("bs.carousel"),s=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n),r="string"==typeof n?n:s.slide;o||i.data("bs.carousel",o=new t(this,s)),"number"==typeof n?o.to(n):r?o[r]():s.interval&&o.pause().cycle()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=600,t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},t.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},t.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},t.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t);if(("prev"==e&&0===n||"next"==e&&n==this.$items.length-1)&&!this.options.wrap)return t;var i=(n+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(i)},t.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){t.to(e)})):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},t.prototype.next=function(){if(!this.sliding)return this.slide("next")},t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},t.prototype.slide=function(n,i){var o=this.$element.find(".item.active"),s=i||this.getItemForDirection(n,o),r=this.interval,a="next"==n?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],u=e.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(u),!u.isDefaultPrevented()){if(this.sliding=!0,r&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=e(this.$indicators.children()[this.getItemIndex(s)]);d&&d.addClass("active")}var p=e.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return e.support.transition&&this.$element.hasClass("slide")?(s.addClass(n),"object"==typeof s&&s.length&&s[0].offsetWidth,o.addClass(a),s.addClass(a),o.one("bsTransitionEnd",(function(){s.removeClass([n,a].join(" ")).addClass("active"),o.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout((function(){l.$element.trigger(p)}),0)})).emulateTransitionEnd(t.TRANSITION_DURATION)):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(p)),r&&this.cycle(),this}};var i=e.fn.carousel;e.fn.carousel=n,e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=i,this};var o=function(t){var i=e(this),o=i.attr("href");o&&(o=o.replace(/.*(?=#[^\s]+$)/,""));var s=i.attr("data-target")||o,r=e(document).find(s);if(r.hasClass("carousel")){var a=e.extend({},r.data(),i.data()),l=i.attr("data-slide-to");l&&(a.interval=!1),n.call(r,a),l&&r.data("bs.carousel").to(l),t.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",o).on("click.bs.carousel.data-api","[data-slide-to]",o),e(window).on("load",(function(){e('[data-ride="carousel"]').each((function(){var t=e(this);n.call(t,t.data())}))}))}(jQuery),function(e){"use strict";var t=function(n,i){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,i),this.$trigger=e('[data-toggle="collapse"][href="#'+n.id+'"],[data-toggle="collapse"][data-target="#'+n.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var n,i=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(document).find(i)}function i(n){return this.each((function(){var i=e(this),o=i.data("bs.collapse"),s=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n);!o&&s.toggle&&/show|hide/.test(n)&&(s.toggle=!1),o||i.data("bs.collapse",o=new t(this,s)),"string"==typeof n&&o[n]()}))}t.VERSION="3.4.1",t.TRANSITION_DURATION=350,t.DEFAULTS={toggle:!0},t.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},t.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n,o=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(o&&o.length&&(n=o.data("bs.collapse"))&&n.transitioning)){var s=e.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){o&&o.length&&(i.call(o,"hide"),n||o.data("bs.collapse",null));var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return a.call(this);var l=e.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",e.proxy(a,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[r](this.$element[0][l])}}}},t.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var n=e.Event("hide.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return o.call(this);this.$element[i](0).one("bsTransitionEnd",e.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)}}},t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},t.prototype.getParent=function(){return e(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy((function(t,i){var o=e(i);this.addAriaAndCollapsedClass(n(o),o)}),this)).end()},t.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var o=e.fn.collapse;e.fn.collapse=i,e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=o,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(t){var o=e(this);o.attr("data-target")||t.preventDefault();var s=n(o),r=s.data("bs.collapse")?"toggle":o.data();i.call(s,r)}))}(jQuery),function(e){"use strict";var t='[data-toggle="dropdown"]',n=function(t){e(t).on("click.bs.dropdown",this.toggle)};function i(t){var n=t.attr("data-target");n||(n=(n=t.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==n?e(document).find(n):null;return i&&i.length?i:t.parent()}function o(n){n&&3===n.which||(e(".dropdown-backdrop").remove(),e(t).each((function(){var t=e(this),o=i(t),s={relatedTarget:this};o.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(o[0],n.target)||(o.trigger(n=e.Event("hide.bs.dropdown",s)),n.isDefaultPrevented()||(t.attr("aria-expanded","false"),o.removeClass("open").trigger(e.Event("hidden.bs.dropdown",s)))))})))}n.VERSION="3.4.1",n.prototype.toggle=function(t){var n=e(this);if(!n.is(".disabled, :disabled")){var s=i(n),r=s.hasClass("open");if(o(),!r){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",o);var a={relatedTarget:this};if(s.trigger(t=e.Event("show.bs.dropdown",a)),t.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(e.Event("shown.bs.dropdown",a))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var o=e(this);if(n.preventDefault(),n.stopPropagation(),!o.is(".disabled, :disabled")){var s=i(o),r=s.hasClass("open");if(!r&&27!=n.which||r&&27==n.which)return 27==n.which&&s.find(t).trigger("focus"),o.trigger("click");var a=s.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var l=a.index(n.target);38==n.which&&l>0&&l--,40==n.which&&ldocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},t.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:i},l.prototype.init=function(t,n,i){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&e(document).find(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),s=o.length;s--;){var r=o[s];if("click"==r)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",l="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},l.prototype.getDefaults=function(){return l.DEFAULTS},l.prototype.getOptions=function(n){var i=this.$element.data();for(var o in i)i.hasOwnProperty(o)&&-1!==e.inArray(o,t)&&delete i[o];return(n=e.extend({},this.getDefaults(),i,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=a(n.template,n.whiteList,n.sanitizeFn)),n},l.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,(function(e,i){n[e]!=i&&(t[e]=i)})),t},l.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},l.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},l.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},l.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var n=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!n)return;var i=this,o=this.tip(),s=this.getUID(this.type);this.setContent(),o.attr("id",s),this.$element.attr("aria-describedby",s),this.options.animation&&o.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,c=a.test(r);c&&(r=r.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?o.appendTo(e(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=o[0].offsetWidth,p=o[0].offsetHeight;if(c){var h=r,f=this.getPosition(this.$viewport);r="bottom"==r&&u.bottom+p>f.bottom?"top":"top"==r&&u.top-pf.width?"left":"left"==r&&u.left-dr.top+r.height&&(o.top=r.top+r.height-l)}else{var c=t.left-s,u=t.left+s+n;cr.right&&(o.left=r.left+r.width-u)}return o},l.prototype.getTitle=function(){var e=this.$element,t=this.options;return e.attr("data-original-title")||("function"==typeof t.title?t.title.call(e[0]):t.title)},l.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},l.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},l.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},l.prototype.enable=function(){this.enabled=!0},l.prototype.disable=function(){this.enabled=!1},l.prototype.toggleEnabled=function(){this.enabled=!this.enabled},l.prototype.toggle=function(t){var n=this;t&&((n=e(t.currentTarget).data("bs."+this.type))||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},l.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide((function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null}))},l.prototype.sanitizeHtml=function(e){return a(e,this.options.whiteList,this.options.sanitizeFn)};var c=e.fn.tooltip;e.fn.tooltip=function(t){return this.each((function(){var n=e(this),i=n.data("bs.tooltip"),o="object"==typeof t&&t;!i&&/destroy|hide/.test(t)||(i||n.data("bs.tooltip",i=new l(this,o)),"string"==typeof t&&i[t]())}))},e.fn.tooltip.Constructor=l,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=c,this}}(jQuery),function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.4.1",t.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),(t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype)).constructor=t,t.prototype.getDefaults=function(){return t.DEFAULTS},t.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();if(this.options.html){var i=typeof n;this.options.sanitize&&(t=this.sanitizeHtml(t),"string"===i&&(n=this.sanitizeHtml(n))),e.find(".popover-title").html(t),e.find(".popover-content").children().detach().end()["string"===i?"html":"append"](n)}else e.find(".popover-title").text(t),e.find(".popover-content").children().detach().end().text(n);e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},t.prototype.hasContent=function(){return this.getTitle()||this.getContent()},t.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var n=e.fn.popover;e.fn.popover=function(n){return this.each((function(){var i=e(this),o=i.data("bs.popover"),s="object"==typeof n&&n;!o&&/destroy|hide/.test(n)||(o||i.data("bs.popover",o=new t(this,s)),"string"==typeof n&&o[n]())}))},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(jQuery),function(e){"use strict";function t(n,i){this.$body=e(document.body),this.$scrollElement=e(n).is(document.body)?e(window):e(n),this.options=e.extend({},t.DEFAULTS,i),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each((function(){var i=e(this),o=i.data("bs.scrollspy"),s="object"==typeof n&&n;o||i.data("bs.scrollspy",o=new t(this,s)),"string"==typeof n&&o[n]()}))}t.VERSION="3.4.1",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",i=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",i=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var t=e(this),o=t.data("target")||t.attr("href"),s=/^#./.test(o)&&e(o);return s&&s.length&&s.is(":visible")&&[[s[n]().top+i,o]]||null})).sort((function(e,t){return e[0]-t[0]})).each((function(){t.offsets.push(this[0]),t.targets.push(this[1])}))},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),o=this.offsets,s=this.targets,r=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=i)return r!=(e=s[s.length-1])&&this.activate(e);if(r&&t=o[e]&&(void 0===o[e+1]||t .active"),r=o&&e.support.transition&&(s.length&&s.hasClass("fade")||!!i.find("> .fade").length);function a(){s.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),n.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(n[0].offsetWidth,n.addClass("in")):n.removeClass("fade"),n.parent(".dropdown-menu").length&&n.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),o&&o()}s.length&&r?s.one("bsTransitionEnd",a).emulateTransitionEnd(t.TRANSITION_DURATION):a(),s.removeClass("in")};var i=e.fn.tab;e.fn.tab=n,e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=i,this};var o=function(t){t.preventDefault(),n.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',o).on("click.bs.tab.data-api",'[data-toggle="pill"]',o)}(jQuery),function(e){"use strict";var t=function(n,i){this.options=e.extend({},t.DEFAULTS,i);var o=this.options.target===t.DEFAULTS.target?e(this.options.target):e(document).find(this.options.target);this.$target=o.on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var i=e(this),o=i.data("bs.affix"),s="object"==typeof n&&n;o||i.data("bs.affix",o=new t(this,s)),"string"==typeof n&&o[n]()}))}t.VERSION="3.4.1",t.RESET="affix affix-top affix-bottom",t.DEFAULTS={offset:0,target:window},t.prototype.getState=function(e,t,n,i){var o=this.$target.scrollTop(),s=this.$element.offset(),r=this.$target.height();if(null!=n&&"top"==this.affixed)return o=e-i&&"bottom"},t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var e=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-e},t.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},t.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),i=this.options.offset,o=i.top,s=i.bottom,r=Math.max(e(document).height(),e(document.body).height());"object"!=typeof i&&(s=o=i),"function"==typeof o&&(o=i.top(this.$element)),"function"==typeof s&&(s=i.bottom(this.$element));var a=this.getState(r,n,o,s);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=e.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:r-n-s})}};var i=e.fn.affix;e.fn.affix=n,e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=i,this},e(window).on("load",(function(){e('[data-spy="affix"]').each((function(){var t=e(this),i=t.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),n.call(t,i)}))}))}(jQuery), /*! * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select) * * Copyright 2012-2020 SnapAppointments, LLC * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ -function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],(function(e){return t(e)})):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,(function(e){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],i={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},o=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,s=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function r(t,i){var r=t.nodeName.toLowerCase();if(-1!==e.inArray(r,i))return-1===e.inArray(r,n)||Boolean(t.nodeValue.match(o)||t.nodeValue.match(s));for(var a=e(i).filter((function(e,t){return t instanceof RegExp})),l=0,c=a.length;l1?arguments[1]:void 0,r=s?Number(s):0;r!=r&&(r=0);var a=Math.min(Math.max(r,0),n);if(o+a>n)return!1;for(var l=-1;++l]+>/g,"")),i&&(l=S(l)),l=l.toUpperCase(),s="contains"===n?l.indexOf(t)>=0:l.startsWith(t)))break}return s}function w(e){return parseInt(e,10)||0}e.fn.triggerNative=function(e){var t,n=this[0];n.dispatchEvent?(b?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),n.dispatchEvent(t)):n.fireEvent?((t=document.createEventObject()).eventType=e,n.fireEvent("on"+e,t)):this.trigger(e)};var T={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},C=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,k=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function E(e){return T[e]}function S(e){return(e=e.toString())&&e.replace(C,E).replace(k,"")}var $,I,N,A,D,O=($={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},I=function(e){return $[e]},N="(?:"+Object.keys($).join("|")+")",A=RegExp(N),D=RegExp(N,"g"),function(e){return e=null==e?"":""+e,A.test(e)?e.replace(D,I):e}),L={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},H=27,j=13,z=32,R=9,P=38,M=40,_={success:!1,major:"3"};try{_.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),_.major=_.full[0],_.success=!0}catch(e){}var W=0,B=".bs.select",F={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},q={MENU:"."+F.MENU},U={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};U.noResults=U.li.cloneNode(!1),U.noResults.className="no-results",U.a.setAttribute("role","option"),U.a.className="dropdown-item",U.subtext.className="text-muted",U.text=U.span.cloneNode(!1),U.text.className="text",U.checkMark=U.span.cloneNode(!1);var V=new RegExp(P+"|"+M),X=new RegExp("^"+R+"$|"+H),G={li:function(e,t,n){var i=U.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?i.appendChild(e):i.innerHTML=e),void 0!==t&&""!==t&&(i.className=t),null!=n&&i.classList.add("optgroup-"+n),i},a:function(e,t,n){var i=U.a.cloneNode(!0);return e&&(11===e.nodeType?i.appendChild(e):i.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&i.classList.add.apply(i.classList,t.split(/\s+/)),n&&i.setAttribute("style",n),i},text:function(e,t){var n,i,o=U.text.cloneNode(!1);if(e.content)o.innerHTML=e.content;else{if(o.textContent=e.text,e.icon){var s=U.whitespace.cloneNode(!1);(i=(!0===t?U.i:U.span).cloneNode(!1)).className=this.options.iconBase+" "+e.icon,U.fragment.appendChild(i),U.fragment.appendChild(s)}e.subtext&&((n=U.subtext.cloneNode(!1)).textContent=e.subtext,o.appendChild(n))}if(!0===t)for(;o.childNodes.length>0;)U.fragment.appendChild(o.childNodes[0]);else U.fragment.appendChild(o);return U.fragment},label:function(e){var t,n,i=U.text.cloneNode(!1);if(i.innerHTML=e.display,e.icon){var o=U.whitespace.cloneNode(!1);(n=U.span.cloneNode(!1)).className=this.options.iconBase+" "+e.icon,U.fragment.appendChild(n),U.fragment.appendChild(o)}return e.subtext&&((t=U.subtext.cloneNode(!1)).textContent=e.subtext,i.appendChild(t)),U.fragment.appendChild(i),U.fragment}};function Q(e,t){e.length||(U.noResults.innerHTML=this.options.noneResultsText.replace("{0}",'"'+O(t)+'"'),this.$menuInner[0].firstChild.appendChild(U.noResults))}var K=function(t,n){var i=this;v.useDefault||(e.valHooks.select.set=v._set,v.useDefault=!0),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.options=n,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){i.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var o=this.options.windowPadding;"number"==typeof o&&(this.options.windowPadding=[o,o,o,o]),this.val=K.prototype.val,this.render=K.prototype.render,this.refresh=K.prototype.refresh,this.setStyle=K.prototype.setStyle,this.selectAll=K.prototype.selectAll,this.deselectAll=K.prototype.deselectAll,this.destroy=K.prototype.destroy,this.remove=K.prototype.remove,this.show=K.prototype.show,this.hide=K.prototype.hide,this.init()};function Y(n){var i,o=arguments,s=n;if([].shift.apply(o),!_.success){try{_.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(e){K.BootstrapVersion?_.full=K.BootstrapVersion.split(" ")[0].split("."):(_.full=[_.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",e))}_.major=_.full[0],_.success=!0}if("4"===_.major){var r=[];K.DEFAULTS.style===F.BUTTONCLASS&&r.push({name:"style",className:"BUTTONCLASS"}),K.DEFAULTS.iconBase===F.ICONBASE&&r.push({name:"iconBase",className:"ICONBASE"}),K.DEFAULTS.tickIcon===F.TICKICON&&r.push({name:"tickIcon",className:"TICKICON"}),F.DIVIDER="dropdown-divider",F.SHOW="show",F.BUTTONCLASS="btn-light",F.POPOVERHEADER="popover-header",F.ICONBASE="",F.TICKICON="bs-ok-default";for(var a=0;a'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:i},K.prototype={constructor:K,init:function(){var e=this,t=this.$element.attr("id"),n=this.$element[0],i=n.form;W++,this.selectId="bs-select-"+W,n.classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),n.classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),i&&null===n.form&&(i.id||(i.id="form-"+this.selectId),n.setAttribute("form",i.id)),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(q.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),n.classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(F.MENURIGHT),void 0!==t&&this.$button.attr("data-id",t),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide.bs.select",(function(){if(e.isVirtual()){var t=e.$menuInner[0],n=t.firstChild.cloneNode(!1);t.replaceChild(n,t.firstChild),t.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(t){e.$element.trigger("hide.bs.select",t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden.bs.select",t)},"show.bs.dropdown":function(t){e.$element.trigger("show.bs.select",t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown.bs.select",t)}}),n.hasAttribute("required")&&this.$element.on("invalid.bs.select",(function(){e.$button[0].classList.add("bs-invalid"),e.$element.on("shown.bs.select.invalid",(function(){e.$element.val(e.$element.val()).off("shown.bs.select.invalid")})).on("rendered.bs.select",(function(){this.validity.valid&&e.$button[0].classList.remove("bs-invalid"),e.$element.off("rendered.bs.select")})),e.$button.on("blur.bs.select",(function(){e.$element.trigger("focus").trigger("blur"),e.$button.off("blur.bs.select")}))})),setTimeout((function(){e.buildList(),e.$element.trigger("loaded.bs.select")}))},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",n=this.multiple?' aria-multiselectable="true"':"",i="",o=this.autofocus?" autofocus":"";_.major<4&&this.$element.parent().hasClass("input-group")&&(i=" input-group-btn");var s,r="",a="",l="",c="";return this.options.header&&(r='
'+this.options.header+"
"),this.options.liveSearch&&(a=''),this.multiple&&this.options.actionsBox&&(l='
"),this.multiple&&this.options.doneButton&&(c='
"),s='",e(s)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0,this.selectpicker.view.firstHighlightIndex=!1;for(var e=0;e=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(t,n,i){var o,s,r=this,l=0,c=[];if(this.selectpicker.isSearching=t,this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),n)if(i)l=this.$menuInner[0].scrollTop;else if(!r.multiple){var u=r.$element[0],d=(u.options[u.selectedIndex]||{}).liIndex;if("number"==typeof d&&!1!==r.options.size){var p=r.selectpicker.main.data[d],h=p&&p.position;h&&(l=h-(r.sizeInfo.menuInnerHeight+r.sizeInfo.liHeight)/2)}}function f(e,n){var i,l,u,d,p,h,f,m,g,v,y=r.selectpicker.current.elements.length,b=[],x=!0,w=r.isVirtual();r.selectpicker.view.scrollTop=e,i=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),l=Math.round(y/i)||1;for(var T=0;Ty-1?0:r.selectpicker.current.data[y-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,S.firstChild.style.marginTop=k+"px",S.firstChild.style.marginBottom=E+"px"):(S.firstChild.style.marginTop=0,S.firstChild.style.marginBottom=0),S.firstChild.appendChild($),!0===w&&r.sizeInfo.hasScrollBar){var j=S.firstChild.offsetWidth;if(n&&jr.sizeInfo.selectWidth)S.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px";else if(j>r.sizeInfo.menuInnerInnerWidth){r.$menu[0].style.minWidth=0;var z=S.firstChild.offsetWidth;z>r.sizeInfo.menuInnerInnerWidth&&(r.sizeInfo.menuInnerInnerWidth=z,S.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px"),r.$menu[0].style.minWidth=""}}}if(r.prevActiveIndex=r.activeIndex,r.options.liveSearch){if(t&&n){var R,P=0;r.selectpicker.view.canHighlight[P]||(P=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),R=r.selectpicker.view.visibleElements[P],r.defocusItem(r.selectpicker.view.currentActive),r.activeIndex=(r.selectpicker.current.data[P]||{}).index,r.focusItem(R)}}else r.$menuInner.trigger("focus")}f(l,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(e,t){r.noScroll||f(this.scrollTop,t),r.noScroll=!1})),e(window).off("resize.bs.select."+this.selectId+".createView").on("resize.bs.select."+this.selectId+".createView",(function(){r.$newElement.hasClass(F.SHOW)&&f(r.$menuInner[0].scrollTop)}))},focusItem:function(e,t,n){if(e){t=t||this.selectpicker.main.data[this.activeIndex];var i=e.firstChild;i&&(i.setAttribute("aria-setsize",this.selectpicker.view.size),i.setAttribute("aria-posinset",t.posinset),!0!==n&&(this.focusedParent.setAttribute("aria-activedescendant",i.id),e.classList.add("active"),i.classList.add("active")))}},defocusItem:function(e){e&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"))},setPlaceholder:function(){var e=this,t=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),t=!0;var n=this.$element[0],i=!1,o=!this.selectpicker.view.titleOption.parentNode,s=n.selectedIndex,r=n.options[s],a=window.performance&&window.performance.getEntriesByType("navigation"),l=a&&a.length?"back_forward"!==a[0].type:2!==window.performance.navigation.type;o&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",i=!r||0===s&&!1===r.defaultSelected&&void 0===this.$element.data("selected")),(o||0!==this.selectpicker.view.titleOption.index)&&n.insertBefore(this.selectpicker.view.titleOption,n.firstChild),i&&l?n.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){e.selectpicker.view.displayedValue!==n.value&&e.render()}))}return t},buildData:function(){var e=':not([hidden]):not([data-hidden="true"])',t=[],n=0,i=this.setPlaceholder()?1:0;this.options.hideDisabled&&(e+=":not(:disabled)");var o=this.$element[0].querySelectorAll("select > *"+e);function s(e){var n=t[t.length-1];n&&"divider"===n.type&&(n.optID||e.optID)||((e=e||{}).type="divider",t.push(e))}function r(e,n){if((n=n||{}).divider="true"===e.getAttribute("data-divider"),n.divider)s({optID:n.optID});else{var i=t.length,o=e.style.cssText,r=o?O(o):"",a=(e.className||"")+(n.optgroupClass||"");n.optID&&(a="opt "+a),n.optionClass=a.trim(),n.inlineStyle=r,n.text=e.textContent,n.content=e.getAttribute("data-content"),n.tokens=e.getAttribute("data-tokens"),n.subtext=e.getAttribute("data-subtext"),n.icon=e.getAttribute("data-icon"),e.liIndex=i,n.display=n.content||n.text,n.type="option",n.index=i,n.option=e,n.selected=!!e.selected,n.disabled=n.disabled||!!e.disabled,t.push(n)}}function a(o,a){var l=a[o],c=!(o-1i&&(i=s,e.selectpicker.view.widestOption=n[n.length-1])}!e.options.showTick&&!e.multiple||U.checkMark.parentNode||(U.checkMark.className=this.options.iconBase+" "+e.options.tickIcon+" check-mark",U.a.appendChild(U.checkMark));for(var s=t.length,r=0;r li")},render:function(){var e,t,n=this,i=this.$element[0],o=this.setPlaceholder()&&0===i.selectedIndex,s=m(i,this.options.hideDisabled),r=s.length,l=this.$button[0],c=l.querySelector(".filter-option-inner-inner"),u=document.createTextNode(this.options.multipleSeparator),d=U.fragment.cloneNode(!1),p=!1;if(l.classList.toggle("bs-placeholder",n.multiple?!r:!g(i,s)),n.multiple||1!==s.length||(n.selectpicker.view.displayedValue=g(i,s)),"static"===this.options.selectedTextFormat)d=G.text.call(this,{text:this.options.title},!0);else if((e=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&r>1)&&(e=(t=this.options.selectedTextFormat.split(">")).length>1&&r>t[1]||1===t.length&&r>=2),!1===e){if(!o){for(var h=0;h0&&d.appendChild(u.cloneNode(!1)),f.title?y.text=f.title:v&&(v.content&&n.options.showContent?(y.content=v.content.toString(),p=!0):(n.options.showIcon&&(y.icon=v.icon),n.options.showSubtext&&!n.multiple&&v.subtext&&(y.subtext=" "+v.subtext),y.text=f.textContent.trim())),d.appendChild(G.text.call(this,y,!0))}r>49&&d.appendChild(document.createTextNode("..."))}}else{var b=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(b+=":not(:disabled)");var x=this.$element[0].querySelectorAll("select > option"+b+", optgroup"+b+" option"+b).length,w="function"==typeof this.options.countSelectedText?this.options.countSelectedText(r,x):this.options.countSelectedText;d=G.text.call(this,{text:w.replace("{0}",r.toString()).replace("{1}",x.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),d.childNodes.length||(d=G.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),l.title=d.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&p&&a([d],n.options.whiteList,n.options.sanitizeFn),c.innerHTML="",c.appendChild(d),_.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var T=l.querySelector(".filter-expand"),C=c.cloneNode(!0);C.className="filter-expand",T?l.replaceChild(C,T):l.appendChild(C)}this.$element.trigger("rendered.bs.select")},setStyle:function(e,t){var n,i=this.$button[0],o=this.$newElement[0],s=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),_.major<4&&(o.classList.add("bs3"),o.parentNode.classList&&o.parentNode.classList.contains("input-group")&&(o.previousElementSibling||o.nextElementSibling)&&(o.previousElementSibling||o.nextElementSibling).classList.contains("input-group-addon")&&o.classList.add("bs3-has-addon")),n=e?e.trim():s,"add"==t?n&&i.classList.add.apply(i.classList,n.split(" ")):"remove"==t?n&&i.classList.remove.apply(i.classList,n.split(" ")):(s&&i.classList.remove.apply(i.classList,s.split(" ")),n&&i.classList.add.apply(i.classList,n.split(" ")))},liHeight:function(t){if(t||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var n,i=U.div.cloneNode(!1),o=U.div.cloneNode(!1),s=U.div.cloneNode(!1),r=document.createElement("ul"),a=U.li.cloneNode(!1),l=U.li.cloneNode(!1),c=U.a.cloneNode(!1),u=U.span.cloneNode(!1),d=this.options.header&&this.$menu.find("."+F.POPOVERHEADER).length>0?this.$menu.find("."+F.POPOVERHEADER)[0].cloneNode(!0):null,p=this.options.liveSearch?U.div.cloneNode(!1):null,h=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,f=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,u.className="text",c.className="dropdown-item "+(m?m.className:""),i.className=this.$menu[0].parentNode.className+" "+F.SHOW,i.style.width=0,"auto"===this.options.width&&(o.style.minWidth=0),o.className=F.MENU+" "+F.SHOW,s.className="inner "+F.SHOW,r.className=F.MENU+" inner "+("4"===_.major?F.SHOW:""),a.className=F.DIVIDER,l.className="dropdown-header",u.appendChild(document.createTextNode("​")),this.selectpicker.current.data.length)for(var g=0;gthis.sizeInfo.menuExtras.vert&&a+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(l=this.selectpicker.dropup),this.$newElement.toggleClass(F.DROPUP,l),this.selectpicker.dropup=l),"auto"===this.options.size)o=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,n=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,i=o+d+p+h+f,r=Math.max(o-g.vert,0),this.$newElement.hasClass(F.DROPUP)&&(n=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),s=n,t=n-d-p-h-f-g.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var y=0;ythis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(F.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&i.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+".bs.select."+this.selectId+".setMenuSize")}this.createView(!1,!0,t)},setWidth:function(){var e=this;"auto"===this.options.width?requestAnimationFrame((function(){e.$menu.css("min-width","0"),e.$element.on("loaded.bs.select",(function(){e.liHeight(),e.setMenuSize();var t=e.$newElement.clone().appendTo("body"),n=t.css("width","auto").children("button").outerWidth();t.remove(),e.sizeInfo.selectWidth=Math.max(e.sizeInfo.totalMenuWidth,n),e.$newElement.css("width",e.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=e('
');var t,n,i,o=this,s=e(this.options.container),r=function(r){var a={},l=o.options.display||!!e.fn.dropdown.Constructor.Default&&e.fn.dropdown.Constructor.Default.display;o.$bsContainer.addClass(r.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(F.DROPUP,r.hasClass(F.DROPUP)),t=r.offset(),s.is("body")?n={top:0,left:0}:((n=s.offset()).top+=parseInt(s.css("borderTopWidth"))-s.scrollTop(),n.left+=parseInt(s.css("borderLeftWidth"))-s.scrollLeft()),i=r.hasClass(F.DROPUP)?0:r[0].offsetHeight,(_.major<4||"static"===l)&&(a.top=t.top-n.top+i,a.left=t.left-n.left),a.width=r[0].offsetWidth,o.$bsContainer.css(a)};this.$button.on("click.bs.dropdown.data-api",(function(){o.isDisabled()||(r(o.$newElement),o.$bsContainer.appendTo(o.options.container).toggleClass(F.SHOW,!o.$button.hasClass(F.SHOW)).append(o.$menu))})),e(window).off("resize.bs.select."+this.selectId+" scroll"+".bs.select."+this.selectId).on("resize.bs.select."+this.selectId+" scroll"+".bs.select."+this.selectId,(function(){o.$newElement.hasClass(F.SHOW)&&r(o.$newElement)})),this.$element.on("hide.bs.select",(function(){o.$menu.data("height",o.$menu.height()),o.$bsContainer.detach()}))},setOptionStatus:function(e){var t=this;if(t.noScroll=!1,t.selectpicker.view.visibleElements&&t.selectpicker.view.visibleElements.length)for(var n=0;n3&&!t.dropdown&&(t.dropdown=t.$button.data("bs.dropdown"),t.dropdown._menu=t.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){t.$newElement.hasClass(F.SHOW)||t.setSize()})),this.$element.on("shown.bs.select",(function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop),_.major>3?requestAnimationFrame(o):i()})),this.$menuInner.on("mouseenter","li a",(function(e){var n=this.parentElement,i=t.isVirtual()?t.selectpicker.view.position0:0,o=Array.prototype.indexOf.call(n.parentElement.children,n),s=t.selectpicker.current.data[o+i];t.focusItem(n,s,!0)})),this.$menuInner.on("click","li a",(function(n,i){var o=e(this),s=t.$element[0],r=t.isVirtual()?t.selectpicker.view.position0:0,a=t.selectpicker.current.data[o.parent().index()+r],l=a.index,c=g(s),u=s.selectedIndex,d=s.options[u],p=!0;if(t.multiple&&1!==t.options.maxOptions&&n.stopPropagation(),n.preventDefault(),!t.isDisabled()&&!o.parent().hasClass(F.DISABLED)){var h=a.option,f=e(h),v=h.selected,b=f.parent("optgroup"),x=b.find("option"),w=t.options.maxOptions,T=b.data("maxOptions")||!1;if(l===t.activeIndex&&(i=!0),i||(t.prevActiveIndex=t.activeIndex,t.activeIndex=void 0),t.multiple){if(h.selected=!v,t.setSelected(l,!v),t.focusedParent.focus(),!1!==w||!1!==T){var C=w
');I[2]&&(N=N.replace("{var}",I[2][w>1?0:1]),A=A.replace("{var}",I[2][T>1?0:1])),h.selected=!1,t.$menu.append(D),w&&C&&(D.append(e("
"+N+"
")),p=!1,t.$element.trigger("maxReached.bs.select")),T&&k&&(D.append(e("
"+A+"
")),p=!1,t.$element.trigger("maxReachedGrp.bs.select")),setTimeout((function(){t.setSelected(l,!1)}),10),D[0].classList.add("fadeOut"),setTimeout((function(){D.remove()}),1050)}}}else d&&(d.selected=!1),h.selected=!0,t.setSelected(l,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.trigger("focus"):t.options.liveSearch&&t.$searchbox.trigger("focus"),p&&(t.multiple||u!==s.selectedIndex)&&(y=[h.index,f.prop("selected"),c],t.$element.triggerNative("change"))}})),this.$menu.on("click","li."+F.DISABLED+" a, ."+F.POPOVERHEADER+", ."+F.POPOVERHEADER+" :not(.close)",(function(n){n.currentTarget==this&&(n.preventDefault(),n.stopPropagation(),t.options.liveSearch&&!e(n.target).hasClass("close")?t.$searchbox.trigger("focus"):t.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus")})),this.$menu.on("click","."+F.POPOVERHEADER+" .close",(function(){t.$button.trigger("click")})),this.$searchbox.on("click",(function(e){e.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(n){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus"),n.preventDefault(),n.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()})),this.$button.on("focus.bs.select",(function(e){var n=t.$element[0].getAttribute("tabindex");void 0!==n&&e.originalEvent&&e.originalEvent.isTrusted&&(this.setAttribute("tabindex",n),t.$element[0].setAttribute("tabindex",-1),t.selectpicker.view.tabindex=n)})).on("blur.bs.select",(function(e){void 0!==t.selectpicker.view.tabindex&&e.originalEvent&&e.originalEvent.isTrusted&&(t.$element[0].setAttribute("tabindex",t.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),t.selectpicker.view.tabindex=void 0)})),this.$element.on("change.bs.select",(function(){t.render(),t.$element.trigger("changed.bs.select",y),y=null})).on("focus.bs.select",(function(){t.options.mobile||t.$button[0].focus()}))},liveSearchListener:function(){var e=this;this.$button.on("click.bs.dropdown.data-api",(function(){e.$searchbox.val()&&(e.$searchbox.val(""),e.selectpicker.search.previousValue=void 0)})),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(e){e.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var t=e.$searchbox[0].value;if(e.selectpicker.search.elements=[],e.selectpicker.search.data=[],t){var n=[],i=t.toUpperCase(),o={},s=[],r=e._searchStyle(),a=e.options.liveSearchNormalize;a&&(i=S(i));for(var l=0;l0&&(o[c.headerIndex-1]=!0,s.push(c.headerIndex-1)),o[c.headerIndex]=!0,s.push(c.headerIndex),o[c.lastIndex+1]=!0),o[l]&&"optgroup-label"!==c.type&&s.push(l)}l=0;for(var u=s.length;l=112&&t.which<=123))if(!(i=c.$newElement.hasClass(F.SHOW))&&(h||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105||t.which>=65&&t.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(t.which===H&&i&&(t.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),h){if(!u.length)return;-1!==(n=(o=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(o.parentElement.children,o):-1)&&c.defocusItem(o),t.which===P?(-1!==n&&n--,n+m<0&&(n+=u.length),c.selectpicker.view.canHighlight[n+m]||-1===(n=c.selectpicker.view.canHighlight.slice(0,n+m).lastIndexOf(!0)-m)&&(n=u.length-1)):(t.which===M||p)&&(++n+m>=c.selectpicker.view.canHighlight.length&&(n=c.selectpicker.view.firstHighlightIndex),c.selectpicker.view.canHighlight[n+m]||(n=n+1+c.selectpicker.view.canHighlight.slice(n+m+1).indexOf(!0))),t.preventDefault();var g=m+n;t.which===P?0===m&&n===u.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,g=c.selectpicker.current.elements.length-1):d=(r=(s=c.selectpicker.current.data[g]).position-s.height)f),o=c.selectpicker.current.elements[g],c.activeIndex=c.selectpicker.current.data[g].index,c.focusItem(o),c.selectpicker.view.currentActive=o,d&&(c.$menuInner[0].scrollTop=r),c.options.liveSearch?c.$searchbox.trigger("focus"):a.trigger("focus")}else if(!a.is("input")&&!X.test(t.which)||t.which===z&&c.selectpicker.keydown.keyHistory){var v,y,b=[];t.preventDefault(),c.selectpicker.keydown.keyHistory+=L[t.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),y=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(y)&&(y=y.charAt(0));for(var w=0;w0?(r=s.position-s.height,d=!0):(r=s.position-c.sizeInfo.menuInnerHeight,d=s.position>f+c.sizeInfo.menuInnerHeight),o=c.selectpicker.main.elements[v],c.activeIndex=b[C],c.focusItem(o),o&&o.firstChild.focus(),d&&(c.$menuInner[0].scrollTop=r),a.trigger("focus")}}i&&(t.which===z&&!c.selectpicker.keydown.keyHistory||t.which===j||t.which===R&&c.options.selectOnTab)&&(t.which!==z&&t.preventDefault(),c.options.liveSearch&&t.which===z||(c.$menuInner.find(".active a").trigger("click",!0),a.trigger("focus"),c.options.liveSearch||(t.preventDefault(),e(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var t=e.extend({},this.options,this.$element.data());this.options=t,this.checkDisabled(),this.buildData(),this.setStyle(),this.render(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.selectpicker.view.titleOption&&this.selectpicker.view.titleOption.parentNode&&this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption),this.$element.off(B).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),e(window).off(".bs.select."+this.selectId)}};var J=e.fn.selectpicker;function Z(){if(e.fn.dropdown){var t=e.fn.dropdown.Constructor._dataApiKeydownHandler||e.fn.dropdown.Constructor.prototype.keydown;return t.apply(this,arguments)}}e.fn.selectpicker=Y,e.fn.selectpicker.Constructor=K,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=J,this},e(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',Z).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",Z).on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',K.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(e){e.stopPropagation()})),e(window).on("load.bs.select.data-api",(function(){e(".selectpicker").each((function(){var t=e(this);Y.call(t,t.data())}))}))}(e)})),function(e){"use strict";var t=0;function n(t,n){return e.map(t,(function(e){return function(e,t){return e+".touchspin_"+t}(e,n)}))}e.fn.TouchSpin=function(i){if("destroy"!==i){var o={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalupclass:"glyphicon glyphicon-chevron-up",verticaldownclass:"glyphicon glyphicon-chevron-down",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-default",buttonup_class:"btn btn-default",buttondown_txt:"-",buttonup_txt:"+"},s={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each((function(){var r,a,l,c,u,d,p,h,f=e(this),m=f.data(),g=0,v=!1;function y(){var e,t,n;""!==(e=f.val())?r.decimals>0&&"."===e||(t=parseFloat(e),isNaN(t)&&(t=""!==r.replacementval?r.replacementval:0),n=t,t.toString()!==e&&(n=t),tr.max&&(n=r.max),n=function(e){switch(r.forcestepdivisibility){case"round":return(Math.round(e/r.step)*r.step).toFixed(r.decimals);case"floor":return(Math.floor(e/r.step)*r.step).toFixed(r.decimals);case"ceil":return(Math.ceil(e/r.step)*r.step).toFixed(r.decimals);default:return e}}(n),Number(e).toString()!==n.toString()&&(f.val(n),f.trigger("change"))):""!==r.replacementval&&(f.val(r.replacementval),f.trigger("change"))}function b(){if(r.booster){var e=Math.pow(2,Math.floor(g/r.boostat))*r.step;return r.maxboostedstep&&e>r.maxboostedstep&&(e=r.maxboostedstep,c=Math.round(c/e)*e),Math.max(r.step,e)}return r.step}function x(){y(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var e=c,t=b();(c+=t)>r.max&&(c=r.max,f.trigger("touchspin.on.max"),k()),l.input.val(Number(c).toFixed(r.decimals)),e!==c&&f.trigger("change")}function w(){y(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var e=c,t=b();(c-=t)'+r.prefix+"",c=''+r.postfix+"";o.hasClass("input-group-btn")?(n='",o.append(n)):(n='",e(n).insertBefore(f));s.hasClass("input-group-btn")?(i='",s.prepend(i)):(i='",e(i).insertAfter(f));e(l).insertBefore(f),e(c).insertAfter(f),a=t}(n):function(){var t;t=r.verticalbuttons?'
'+r.prefix+''+r.postfix+'
':'
'+r.prefix+''+r.postfix+'
";a=e(t).insertBefore(f),e(".bootstrap-touchspin-prefix",a).after(f),f.hasClass("input-sm")?a.addClass("input-group-sm"):f.hasClass("input-lg")&&a.addClass("input-group-lg")}()}(),l={down:e(".bootstrap-touchspin-down",a),up:e(".bootstrap-touchspin-up",a),input:e("input",a),prefix:e(".bootstrap-touchspin-prefix",a).addClass(r.prefix_extraclass),postfix:e(".bootstrap-touchspin-postfix",a).addClass(r.postfix_extraclass)},function(){""===r.prefix&&l.prefix.hide();""===r.postfix&&l.postfix.hide()}(),f.on("keydown",(function(e){var t=e.keyCode||e.which;38===t?("up"!==v&&(x(),C()),e.preventDefault()):40===t&&("down"!==v&&(w(),T()),e.preventDefault())})),f.on("keyup",(function(e){var t=e.keyCode||e.which;(38===t||40===t)&&k()})),f.on("blur",(function(){y()})),l.down.on("keydown",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||("down"!==v&&(w(),T()),e.preventDefault())})),l.down.on("keyup",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||k()})),l.up.on("keydown",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||("up"!==v&&(x(),C()),e.preventDefault())})),l.up.on("keyup",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||k()})),l.down.on("mousedown.touchspin",(function(e){l.down.off("touchstart.touchspin"),f.is(":disabled")||(w(),T(),e.preventDefault(),e.stopPropagation())})),l.down.on("touchstart.touchspin",(function(e){l.down.off("mousedown.touchspin"),f.is(":disabled")||(w(),T(),e.preventDefault(),e.stopPropagation())})),l.up.on("mousedown.touchspin",(function(e){l.up.off("touchstart.touchspin"),f.is(":disabled")||(x(),C(),e.preventDefault(),e.stopPropagation())})),l.up.on("touchstart.touchspin",(function(e){l.up.off("mousedown.touchspin"),f.is(":disabled")||(x(),C(),e.preventDefault(),e.stopPropagation())})),l.up.on("mouseout touchleave touchend touchcancel",(function(e){v&&(e.stopPropagation(),k())})),l.down.on("mouseout touchleave touchend touchcancel",(function(e){v&&(e.stopPropagation(),k())})),l.down.on("mousemove touchmove",(function(e){v&&(e.stopPropagation(),e.preventDefault())})),l.up.on("mousemove touchmove",(function(e){v&&(e.stopPropagation(),e.preventDefault())})),e(document).on(n(["mouseup","touchend","touchcancel"],t).join(" "),(function(e){v&&(e.preventDefault(),k())})),e(document).on(n(["mousemove","touchmove","scroll","scrollstart"],t).join(" "),(function(e){v&&(e.preventDefault(),k())})),f.on("mousewheel DOMMouseScroll",(function(e){if(r.mousewheel&&f.is(":focus")){var t=e.originalEvent.wheelDelta||-e.originalEvent.deltaY||-e.originalEvent.detail;e.stopPropagation(),e.preventDefault(),t<0?w():x()}})),f.on("touchspin.uponce",(function(){k(),x()})),f.on("touchspin.downonce",(function(){k(),w()})),f.on("touchspin.startupspin",(function(){C()})),f.on("touchspin.startdownspin",(function(){T()})),f.on("touchspin.stopspin",(function(){k()})),f.on("touchspin.updatesettings",(function(t,n){!function(t){(function(t){r=e.extend({},r,t)})(t),y();var n=l.input.val();""!==n&&(n=Number(l.input.val()),l.input.val(n.toFixed(r.decimals)))}(n)})),l.input.css("display","block");var c}()}))}this.each((function(){var t=e(this).data();e(document).off(n(["mouseup","touchend","touchcancel","mousemove","touchmove","scroll","scrollstart"],t.spinnerid).join(" "))}))}}(jQuery); \ No newline at end of file +function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],(function(e){return t(e)})):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,(function(e){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],i={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},o=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,s=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function r(t,i){var r=t.nodeName.toLowerCase();if(-1!==e.inArray(r,i))return-1===e.inArray(r,n)||Boolean(t.nodeValue.match(o)||t.nodeValue.match(s));for(var a=e(i).filter((function(e,t){return t instanceof RegExp})),l=0,c=a.length;l1?arguments[1]:void 0,r=s?Number(s):0;r!=r&&(r=0);var a=Math.min(Math.max(r,0),n);if(o+a>n)return!1;for(var l=-1;++l]+>/g,"")),i&&(l=S(l)),l=l.toUpperCase(),s="contains"===n?l.indexOf(t)>=0:l.startsWith(t)))break}return s}function x(e){return parseInt(e,10)||0}e.fn.triggerNative=function(e){var t,n=this[0];n.dispatchEvent?(b?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),n.dispatchEvent(t)):n.fireEvent?((t=document.createEventObject()).eventType=e,n.fireEvent("on"+e,t)):this.trigger(e)};var T={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},C=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,k=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function E(e){return T[e]}function S(e){return(e=e.toString())&&e.replace(C,E).replace(k,"")}var $,I,N,A,D,O=($={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},I=function(e){return $[e]},N="(?:"+Object.keys($).join("|")+")",A=RegExp(N),D=RegExp(N,"g"),function(e){return e=null==e?"":""+e,A.test(e)?e.replace(D,I):e}),L={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},H=27,j=13,z=32,R=9,P=38,M=40,_={success:!1,major:"3"};try{_.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),_.major=_.full[0],_.success=!0}catch(e){}var W=0,B=".bs.select",F={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},q={MENU:"."+F.MENU},U={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};U.noResults=U.li.cloneNode(!1),U.noResults.className="no-results",U.a.setAttribute("role","option"),U.a.className="dropdown-item",U.subtext.className="text-muted",U.text=U.span.cloneNode(!1),U.text.className="text",U.checkMark=U.span.cloneNode(!1);var V=new RegExp(P+"|"+M),X=new RegExp("^"+R+"$|"+H),G={li:function(e,t,n){var i=U.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?i.appendChild(e):i.innerHTML=e),void 0!==t&&""!==t&&(i.className=t),null!=n&&i.classList.add("optgroup-"+n),i},a:function(e,t,n){var i=U.a.cloneNode(!0);return e&&(11===e.nodeType?i.appendChild(e):i.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&i.classList.add.apply(i.classList,t.split(/\s+/)),n&&i.setAttribute("style",n),i},text:function(e,t){var n,i,o=U.text.cloneNode(!1);if(e.content)o.innerHTML=e.content;else{if(o.textContent=e.text,e.icon){var s=U.whitespace.cloneNode(!1);(i=(!0===t?U.i:U.span).cloneNode(!1)).className=this.options.iconBase+" "+e.icon,U.fragment.appendChild(i),U.fragment.appendChild(s)}e.subtext&&((n=U.subtext.cloneNode(!1)).textContent=e.subtext,o.appendChild(n))}if(!0===t)for(;o.childNodes.length>0;)U.fragment.appendChild(o.childNodes[0]);else U.fragment.appendChild(o);return U.fragment},label:function(e){var t,n,i=U.text.cloneNode(!1);if(i.innerHTML=e.display,e.icon){var o=U.whitespace.cloneNode(!1);(n=U.span.cloneNode(!1)).className=this.options.iconBase+" "+e.icon,U.fragment.appendChild(n),U.fragment.appendChild(o)}return e.subtext&&((t=U.subtext.cloneNode(!1)).textContent=e.subtext,i.appendChild(t)),U.fragment.appendChild(i),U.fragment}};function Q(e,t){e.length||(U.noResults.innerHTML=this.options.noneResultsText.replace("{0}",'"'+O(t)+'"'),this.$menuInner[0].firstChild.appendChild(U.noResults))}var K=function(t,n){var i=this;v.useDefault||(e.valHooks.select.set=v._set,v.useDefault=!0),this.$element=e(t),this.$newElement=null,this.$button=null,this.$menu=null,this.options=n,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){i.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var o=this.options.windowPadding;"number"==typeof o&&(this.options.windowPadding=[o,o,o,o]),this.val=K.prototype.val,this.render=K.prototype.render,this.refresh=K.prototype.refresh,this.setStyle=K.prototype.setStyle,this.selectAll=K.prototype.selectAll,this.deselectAll=K.prototype.deselectAll,this.destroy=K.prototype.destroy,this.remove=K.prototype.remove,this.show=K.prototype.show,this.hide=K.prototype.hide,this.init()};function Y(n){var i,o=arguments,s=n;if([].shift.apply(o),!_.success){try{_.full=(e.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(e){K.BootstrapVersion?_.full=K.BootstrapVersion.split(" ")[0].split("."):(_.full=[_.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",e))}_.major=_.full[0],_.success=!0}if("4"===_.major){var r=[];K.DEFAULTS.style===F.BUTTONCLASS&&r.push({name:"style",className:"BUTTONCLASS"}),K.DEFAULTS.iconBase===F.ICONBASE&&r.push({name:"iconBase",className:"ICONBASE"}),K.DEFAULTS.tickIcon===F.TICKICON&&r.push({name:"tickIcon",className:"TICKICON"}),F.DIVIDER="dropdown-divider",F.SHOW="show",F.BUTTONCLASS="btn-light",F.POPOVERHEADER="popover-header",F.ICONBASE="",F.TICKICON="bs-ok-default";for(var a=0;a'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:i},K.prototype={constructor:K,init:function(){var e=this,t=this.$element.attr("id"),n=this.$element[0],i=n.form;W++,this.selectId="bs-select-"+W,n.classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),n.classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),i&&null===n.form&&(i.id||(i.id="form-"+this.selectId),n.setAttribute("form",i.id)),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(q.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),n.classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(F.MENURIGHT),void 0!==t&&this.$button.attr("data-id",t),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+B,(function(){if(e.isVirtual()){var t=e.$menuInner[0],n=t.firstChild.cloneNode(!1);t.replaceChild(n,t.firstChild),t.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(t){e.$element.trigger("hide"+B,t)},"hidden.bs.dropdown":function(t){e.$element.trigger("hidden"+B,t)},"show.bs.dropdown":function(t){e.$element.trigger("show"+B,t)},"shown.bs.dropdown":function(t){e.$element.trigger("shown"+B,t)}}),n.hasAttribute("required")&&this.$element.on("invalid"+B,(function(){e.$button[0].classList.add("bs-invalid"),e.$element.on("shown"+B+".invalid",(function(){e.$element.val(e.$element.val()).off("shown"+B+".invalid")})).on("rendered"+B,(function(){this.validity.valid&&e.$button[0].classList.remove("bs-invalid"),e.$element.off("rendered"+B)})),e.$button.on("blur"+B,(function(){e.$element.trigger("focus").trigger("blur"),e.$button.off("blur"+B)}))})),setTimeout((function(){e.buildList(),e.$element.trigger("loaded"+B)}))},createDropdown:function(){var t=this.multiple||this.options.showTick?" show-tick":"",n=this.multiple?' aria-multiselectable="true"':"",i="",o=this.autofocus?" autofocus":"";_.major<4&&this.$element.parent().hasClass("input-group")&&(i=" input-group-btn");var s,r="",a="",l="",c="";return this.options.header&&(r='
'+this.options.header+"
"),this.options.liveSearch&&(a=''),this.multiple&&this.options.actionsBox&&(l='
"),this.multiple&&this.options.doneButton&&(c='
"),s='",e(s)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0,this.selectpicker.view.firstHighlightIndex=!1;for(var e=0;e=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(t,n,i){var o,s,r=this,l=0,c=[];if(this.selectpicker.isSearching=t,this.selectpicker.current=t?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),n)if(i)l=this.$menuInner[0].scrollTop;else if(!r.multiple){var u=r.$element[0],d=(u.options[u.selectedIndex]||{}).liIndex;if("number"==typeof d&&!1!==r.options.size){var p=r.selectpicker.main.data[d],h=p&&p.position;h&&(l=h-(r.sizeInfo.menuInnerHeight+r.sizeInfo.liHeight)/2)}}function f(e,n){var i,l,u,d,p,h,f,m,g,v,y=r.selectpicker.current.elements.length,b=[],w=!0,x=r.isVirtual();r.selectpicker.view.scrollTop=e,i=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),l=Math.round(y/i)||1;for(var T=0;Ty-1?0:r.selectpicker.current.data[y-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,S.firstChild.style.marginTop=k+"px",S.firstChild.style.marginBottom=E+"px"):(S.firstChild.style.marginTop=0,S.firstChild.style.marginBottom=0),S.firstChild.appendChild($),!0===x&&r.sizeInfo.hasScrollBar){var j=S.firstChild.offsetWidth;if(n&&jr.sizeInfo.selectWidth)S.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px";else if(j>r.sizeInfo.menuInnerInnerWidth){r.$menu[0].style.minWidth=0;var z=S.firstChild.offsetWidth;z>r.sizeInfo.menuInnerInnerWidth&&(r.sizeInfo.menuInnerInnerWidth=z,S.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px"),r.$menu[0].style.minWidth=""}}}if(r.prevActiveIndex=r.activeIndex,r.options.liveSearch){if(t&&n){var R,P=0;r.selectpicker.view.canHighlight[P]||(P=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),R=r.selectpicker.view.visibleElements[P],r.defocusItem(r.selectpicker.view.currentActive),r.activeIndex=(r.selectpicker.current.data[P]||{}).index,r.focusItem(R)}}else r.$menuInner.trigger("focus")}f(l,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(e,t){r.noScroll||f(this.scrollTop,t),r.noScroll=!1})),e(window).off("resize"+B+"."+this.selectId+".createView").on("resize"+B+"."+this.selectId+".createView",(function(){r.$newElement.hasClass(F.SHOW)&&f(r.$menuInner[0].scrollTop)}))},focusItem:function(e,t,n){if(e){t=t||this.selectpicker.main.data[this.activeIndex];var i=e.firstChild;i&&(i.setAttribute("aria-setsize",this.selectpicker.view.size),i.setAttribute("aria-posinset",t.posinset),!0!==n&&(this.focusedParent.setAttribute("aria-activedescendant",i.id),e.classList.add("active"),i.classList.add("active")))}},defocusItem:function(e){e&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"))},setPlaceholder:function(){var e=this,t=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),t=!0;var n=this.$element[0],i=!1,o=!this.selectpicker.view.titleOption.parentNode,s=n.selectedIndex,r=n.options[s],a=window.performance&&window.performance.getEntriesByType("navigation"),l=a&&a.length?"back_forward"!==a[0].type:2!==window.performance.navigation.type;o&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",i=!r||0===s&&!1===r.defaultSelected&&void 0===this.$element.data("selected")),(o||0!==this.selectpicker.view.titleOption.index)&&n.insertBefore(this.selectpicker.view.titleOption,n.firstChild),i&&l?n.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){e.selectpicker.view.displayedValue!==n.value&&e.render()}))}return t},buildData:function(){var e=':not([hidden]):not([data-hidden="true"])',t=[],n=0,i=this.setPlaceholder()?1:0;this.options.hideDisabled&&(e+=":not(:disabled)");var o=this.$element[0].querySelectorAll("select > *"+e);function s(e){var n=t[t.length-1];n&&"divider"===n.type&&(n.optID||e.optID)||((e=e||{}).type="divider",t.push(e))}function r(e,n){if((n=n||{}).divider="true"===e.getAttribute("data-divider"),n.divider)s({optID:n.optID});else{var i=t.length,o=e.style.cssText,r=o?O(o):"",a=(e.className||"")+(n.optgroupClass||"");n.optID&&(a="opt "+a),n.optionClass=a.trim(),n.inlineStyle=r,n.text=e.textContent,n.content=e.getAttribute("data-content"),n.tokens=e.getAttribute("data-tokens"),n.subtext=e.getAttribute("data-subtext"),n.icon=e.getAttribute("data-icon"),e.liIndex=i,n.display=n.content||n.text,n.type="option",n.index=i,n.option=e,n.selected=!!e.selected,n.disabled=n.disabled||!!e.disabled,t.push(n)}}function a(o,a){var l=a[o],c=!(o-1i&&(i=s,e.selectpicker.view.widestOption=n[n.length-1])}!e.options.showTick&&!e.multiple||U.checkMark.parentNode||(U.checkMark.className=this.options.iconBase+" "+e.options.tickIcon+" check-mark",U.a.appendChild(U.checkMark));for(var s=t.length,r=0;r li")},render:function(){var e,t,n=this,i=this.$element[0],o=this.setPlaceholder()&&0===i.selectedIndex,s=m(i,this.options.hideDisabled),r=s.length,l=this.$button[0],c=l.querySelector(".filter-option-inner-inner"),u=document.createTextNode(this.options.multipleSeparator),d=U.fragment.cloneNode(!1),p=!1;if(l.classList.toggle("bs-placeholder",n.multiple?!r:!g(i,s)),n.multiple||1!==s.length||(n.selectpicker.view.displayedValue=g(i,s)),"static"===this.options.selectedTextFormat)d=G.text.call(this,{text:this.options.title},!0);else if((e=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&r>1)&&(e=(t=this.options.selectedTextFormat.split(">")).length>1&&r>t[1]||1===t.length&&r>=2),!1===e){if(!o){for(var h=0;h0&&d.appendChild(u.cloneNode(!1)),f.title?y.text=f.title:v&&(v.content&&n.options.showContent?(y.content=v.content.toString(),p=!0):(n.options.showIcon&&(y.icon=v.icon),n.options.showSubtext&&!n.multiple&&v.subtext&&(y.subtext=" "+v.subtext),y.text=f.textContent.trim())),d.appendChild(G.text.call(this,y,!0))}r>49&&d.appendChild(document.createTextNode("..."))}}else{var b=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(b+=":not(:disabled)");var w=this.$element[0].querySelectorAll("select > option"+b+", optgroup"+b+" option"+b).length,x="function"==typeof this.options.countSelectedText?this.options.countSelectedText(r,w):this.options.countSelectedText;d=G.text.call(this,{text:x.replace("{0}",r.toString()).replace("{1}",w.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),d.childNodes.length||(d=G.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),l.title=d.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&p&&a([d],n.options.whiteList,n.options.sanitizeFn),c.innerHTML="",c.appendChild(d),_.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var T=l.querySelector(".filter-expand"),C=c.cloneNode(!0);C.className="filter-expand",T?l.replaceChild(C,T):l.appendChild(C)}this.$element.trigger("rendered"+B)},setStyle:function(e,t){var n,i=this.$button[0],o=this.$newElement[0],s=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),_.major<4&&(o.classList.add("bs3"),o.parentNode.classList&&o.parentNode.classList.contains("input-group")&&(o.previousElementSibling||o.nextElementSibling)&&(o.previousElementSibling||o.nextElementSibling).classList.contains("input-group-addon")&&o.classList.add("bs3-has-addon")),n=e?e.trim():s,"add"==t?n&&i.classList.add.apply(i.classList,n.split(" ")):"remove"==t?n&&i.classList.remove.apply(i.classList,n.split(" ")):(s&&i.classList.remove.apply(i.classList,s.split(" ")),n&&i.classList.add.apply(i.classList,n.split(" ")))},liHeight:function(t){if(t||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var n,i=U.div.cloneNode(!1),o=U.div.cloneNode(!1),s=U.div.cloneNode(!1),r=document.createElement("ul"),a=U.li.cloneNode(!1),l=U.li.cloneNode(!1),c=U.a.cloneNode(!1),u=U.span.cloneNode(!1),d=this.options.header&&this.$menu.find("."+F.POPOVERHEADER).length>0?this.$menu.find("."+F.POPOVERHEADER)[0].cloneNode(!0):null,p=this.options.liveSearch?U.div.cloneNode(!1):null,h=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,f=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,u.className="text",c.className="dropdown-item "+(m?m.className:""),i.className=this.$menu[0].parentNode.className+" "+F.SHOW,i.style.width=0,"auto"===this.options.width&&(o.style.minWidth=0),o.className=F.MENU+" "+F.SHOW,s.className="inner "+F.SHOW,r.className=F.MENU+" inner "+("4"===_.major?F.SHOW:""),a.className=F.DIVIDER,l.className="dropdown-header",u.appendChild(document.createTextNode("​")),this.selectpicker.current.data.length)for(var g=0;gthis.sizeInfo.menuExtras.vert&&a+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(l=this.selectpicker.dropup),this.$newElement.toggleClass(F.DROPUP,l),this.selectpicker.dropup=l),"auto"===this.options.size)o=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,n=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,i=o+d+p+h+f,r=Math.max(o-g.vert,0),this.$newElement.hasClass(F.DROPUP)&&(n=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),s=n,t=n-d-p-h-f-g.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var y=0;ythis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(F.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&i.off("resize"+B+"."+this.selectId+".setMenuSize scroll"+B+"."+this.selectId+".setMenuSize")}this.createView(!1,!0,t)},setWidth:function(){var e=this;"auto"===this.options.width?requestAnimationFrame((function(){e.$menu.css("min-width","0"),e.$element.on("loaded"+B,(function(){e.liHeight(),e.setMenuSize();var t=e.$newElement.clone().appendTo("body"),n=t.css("width","auto").children("button").outerWidth();t.remove(),e.sizeInfo.selectWidth=Math.max(e.sizeInfo.totalMenuWidth,n),e.$newElement.css("width",e.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=e('
');var t,n,i,o=this,s=e(this.options.container),r=function(r){var a={},l=o.options.display||!!e.fn.dropdown.Constructor.Default&&e.fn.dropdown.Constructor.Default.display;o.$bsContainer.addClass(r.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(F.DROPUP,r.hasClass(F.DROPUP)),t=r.offset(),s.is("body")?n={top:0,left:0}:((n=s.offset()).top+=parseInt(s.css("borderTopWidth"))-s.scrollTop(),n.left+=parseInt(s.css("borderLeftWidth"))-s.scrollLeft()),i=r.hasClass(F.DROPUP)?0:r[0].offsetHeight,(_.major<4||"static"===l)&&(a.top=t.top-n.top+i,a.left=t.left-n.left),a.width=r[0].offsetWidth,o.$bsContainer.css(a)};this.$button.on("click.bs.dropdown.data-api",(function(){o.isDisabled()||(r(o.$newElement),o.$bsContainer.appendTo(o.options.container).toggleClass(F.SHOW,!o.$button.hasClass(F.SHOW)).append(o.$menu))})),e(window).off("resize"+B+"."+this.selectId+" scroll"+B+"."+this.selectId).on("resize"+B+"."+this.selectId+" scroll"+B+"."+this.selectId,(function(){o.$newElement.hasClass(F.SHOW)&&r(o.$newElement)})),this.$element.on("hide"+B,(function(){o.$menu.data("height",o.$menu.height()),o.$bsContainer.detach()}))},setOptionStatus:function(e){var t=this;if(t.noScroll=!1,t.selectpicker.view.visibleElements&&t.selectpicker.view.visibleElements.length)for(var n=0;n3&&!t.dropdown&&(t.dropdown=t.$button.data("bs.dropdown"),t.dropdown._menu=t.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){t.$newElement.hasClass(F.SHOW)||t.setSize()})),this.$element.on("shown"+B,(function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop),_.major>3?requestAnimationFrame(o):i()})),this.$menuInner.on("mouseenter","li a",(function(e){var n=this.parentElement,i=t.isVirtual()?t.selectpicker.view.position0:0,o=Array.prototype.indexOf.call(n.parentElement.children,n),s=t.selectpicker.current.data[o+i];t.focusItem(n,s,!0)})),this.$menuInner.on("click","li a",(function(n,i){var o=e(this),s=t.$element[0],r=t.isVirtual()?t.selectpicker.view.position0:0,a=t.selectpicker.current.data[o.parent().index()+r],l=a.index,c=g(s),u=s.selectedIndex,d=s.options[u],p=!0;if(t.multiple&&1!==t.options.maxOptions&&n.stopPropagation(),n.preventDefault(),!t.isDisabled()&&!o.parent().hasClass(F.DISABLED)){var h=a.option,f=e(h),v=h.selected,b=f.parent("optgroup"),w=b.find("option"),x=t.options.maxOptions,T=b.data("maxOptions")||!1;if(l===t.activeIndex&&(i=!0),i||(t.prevActiveIndex=t.activeIndex,t.activeIndex=void 0),t.multiple){if(h.selected=!v,t.setSelected(l,!v),t.focusedParent.focus(),!1!==x||!1!==T){var C=x
');I[2]&&(N=N.replace("{var}",I[2][x>1?0:1]),A=A.replace("{var}",I[2][T>1?0:1])),h.selected=!1,t.$menu.append(D),x&&C&&(D.append(e("
"+N+"
")),p=!1,t.$element.trigger("maxReached"+B)),T&&k&&(D.append(e("
"+A+"
")),p=!1,t.$element.trigger("maxReachedGrp"+B)),setTimeout((function(){t.setSelected(l,!1)}),10),D[0].classList.add("fadeOut"),setTimeout((function(){D.remove()}),1050)}}}else d&&(d.selected=!1),h.selected=!0,t.setSelected(l,!0);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.trigger("focus"):t.options.liveSearch&&t.$searchbox.trigger("focus"),p&&(t.multiple||u!==s.selectedIndex)&&(y=[h.index,f.prop("selected"),c],t.$element.triggerNative("change"))}})),this.$menu.on("click","li."+F.DISABLED+" a, ."+F.POPOVERHEADER+", ."+F.POPOVERHEADER+" :not(.close)",(function(n){n.currentTarget==this&&(n.preventDefault(),n.stopPropagation(),t.options.liveSearch&&!e(n.target).hasClass("close")?t.$searchbox.trigger("focus"):t.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault(),e.stopPropagation(),t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus")})),this.$menu.on("click","."+F.POPOVERHEADER+" .close",(function(){t.$button.trigger("click")})),this.$searchbox.on("click",(function(e){e.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(n){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus"),n.preventDefault(),n.stopPropagation(),e(this).hasClass("bs-select-all")?t.selectAll():t.deselectAll()})),this.$button.on("focus"+B,(function(e){var n=t.$element[0].getAttribute("tabindex");void 0!==n&&e.originalEvent&&e.originalEvent.isTrusted&&(this.setAttribute("tabindex",n),t.$element[0].setAttribute("tabindex",-1),t.selectpicker.view.tabindex=n)})).on("blur"+B,(function(e){void 0!==t.selectpicker.view.tabindex&&e.originalEvent&&e.originalEvent.isTrusted&&(t.$element[0].setAttribute("tabindex",t.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),t.selectpicker.view.tabindex=void 0)})),this.$element.on("change"+B,(function(){t.render(),t.$element.trigger("changed"+B,y),y=null})).on("focus"+B,(function(){t.options.mobile||t.$button[0].focus()}))},liveSearchListener:function(){var e=this;this.$button.on("click.bs.dropdown.data-api",(function(){e.$searchbox.val()&&(e.$searchbox.val(""),e.selectpicker.search.previousValue=void 0)})),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(e){e.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var t=e.$searchbox[0].value;if(e.selectpicker.search.elements=[],e.selectpicker.search.data=[],t){var n=[],i=t.toUpperCase(),o={},s=[],r=e._searchStyle(),a=e.options.liveSearchNormalize;a&&(i=S(i));for(var l=0;l0&&(o[c.headerIndex-1]=!0,s.push(c.headerIndex-1)),o[c.headerIndex]=!0,s.push(c.headerIndex),o[c.lastIndex+1]=!0),o[l]&&"optgroup-label"!==c.type&&s.push(l)}l=0;for(var u=s.length;l=112&&t.which<=123))if(!(i=c.$newElement.hasClass(F.SHOW))&&(h||t.which>=48&&t.which<=57||t.which>=96&&t.which<=105||t.which>=65&&t.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(t.which===H&&i&&(t.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),h){if(!u.length)return;-1!==(n=(o=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(o.parentElement.children,o):-1)&&c.defocusItem(o),t.which===P?(-1!==n&&n--,n+m<0&&(n+=u.length),c.selectpicker.view.canHighlight[n+m]||-1===(n=c.selectpicker.view.canHighlight.slice(0,n+m).lastIndexOf(!0)-m)&&(n=u.length-1)):(t.which===M||p)&&(++n+m>=c.selectpicker.view.canHighlight.length&&(n=c.selectpicker.view.firstHighlightIndex),c.selectpicker.view.canHighlight[n+m]||(n=n+1+c.selectpicker.view.canHighlight.slice(n+m+1).indexOf(!0))),t.preventDefault();var g=m+n;t.which===P?0===m&&n===u.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,g=c.selectpicker.current.elements.length-1):d=(r=(s=c.selectpicker.current.data[g]).position-s.height)f),o=c.selectpicker.current.elements[g],c.activeIndex=c.selectpicker.current.data[g].index,c.focusItem(o),c.selectpicker.view.currentActive=o,d&&(c.$menuInner[0].scrollTop=r),c.options.liveSearch?c.$searchbox.trigger("focus"):a.trigger("focus")}else if(!a.is("input")&&!X.test(t.which)||t.which===z&&c.selectpicker.keydown.keyHistory){var v,y,b=[];t.preventDefault(),c.selectpicker.keydown.keyHistory+=L[t.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),y=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(y)&&(y=y.charAt(0));for(var x=0;x0?(r=s.position-s.height,d=!0):(r=s.position-c.sizeInfo.menuInnerHeight,d=s.position>f+c.sizeInfo.menuInnerHeight),o=c.selectpicker.main.elements[v],c.activeIndex=b[C],c.focusItem(o),o&&o.firstChild.focus(),d&&(c.$menuInner[0].scrollTop=r),a.trigger("focus")}}i&&(t.which===z&&!c.selectpicker.keydown.keyHistory||t.which===j||t.which===R&&c.options.selectOnTab)&&(t.which!==z&&t.preventDefault(),c.options.liveSearch&&t.which===z||(c.$menuInner.find(".active a").trigger("click",!0),a.trigger("focus"),c.options.liveSearch||(t.preventDefault(),e(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var t=e.extend({},this.options,this.$element.data());this.options=t,this.checkDisabled(),this.buildData(),this.setStyle(),this.render(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+B)},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.selectpicker.view.titleOption&&this.selectpicker.view.titleOption.parentNode&&this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption),this.$element.off(B).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),e(window).off(B+"."+this.selectId)}};var J=e.fn.selectpicker;function Z(){if(e.fn.dropdown)return(e.fn.dropdown.Constructor._dataApiKeydownHandler||e.fn.dropdown.Constructor.prototype.keydown).apply(this,arguments)}e.fn.selectpicker=Y,e.fn.selectpicker.Constructor=K,e.fn.selectpicker.noConflict=function(){return e.fn.selectpicker=J,this},e(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',Z).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",Z).on("keydown"+B,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',K.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(e){e.stopPropagation()})),e(window).on("load"+B+".data-api",(function(){e(".selectpicker").each((function(){var t=e(this);Y.call(t,t.data())}))}))}(e)})),function(e){"use strict";var t=0;function n(t,n){return e.map(t,(function(e){return function(e,t){return e+".touchspin_"+t}(e,n)}))}e.fn.TouchSpin=function(i){if("destroy"!==i){var o={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalupclass:"glyphicon glyphicon-chevron-up",verticaldownclass:"glyphicon glyphicon-chevron-down",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-default",buttonup_class:"btn btn-default",buttondown_txt:"-",buttonup_txt:"+"},s={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each((function(){var r,a,l,c,u,d,p,h,f=e(this),m=f.data(),g=0,v=!1;function y(){var e,t,n;""!==(e=f.val())?r.decimals>0&&"."===e||(t=parseFloat(e),isNaN(t)&&(t=""!==r.replacementval?r.replacementval:0),n=t,t.toString()!==e&&(n=t),tr.max&&(n=r.max),n=function(e){switch(r.forcestepdivisibility){case"round":return(Math.round(e/r.step)*r.step).toFixed(r.decimals);case"floor":return(Math.floor(e/r.step)*r.step).toFixed(r.decimals);case"ceil":return(Math.ceil(e/r.step)*r.step).toFixed(r.decimals);default:return e}}(n),Number(e).toString()!==n.toString()&&(f.val(n),f.trigger("change"))):""!==r.replacementval&&(f.val(r.replacementval),f.trigger("change"))}function b(){if(r.booster){var e=Math.pow(2,Math.floor(g/r.boostat))*r.step;return r.maxboostedstep&&e>r.maxboostedstep&&(e=r.maxboostedstep,c=Math.round(c/e)*e),Math.max(r.step,e)}return r.step}function w(){y(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var e=c,t=b();(c+=t)>r.max&&(c=r.max,f.trigger("touchspin.on.max"),k()),l.input.val(Number(c).toFixed(r.decimals)),e!==c&&f.trigger("change")}function x(){y(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var e=c,t=b();(c-=t)'+r.prefix+"",c=''+r.postfix+"";o.hasClass("input-group-btn")?(n='",o.append(n)):(n='",e(n).insertBefore(f));s.hasClass("input-group-btn")?(i='",s.prepend(i)):(i='",e(i).insertAfter(f));e(l).insertBefore(f),e(c).insertAfter(f),a=t}(n):function(){var t;t=r.verticalbuttons?'
'+r.prefix+''+r.postfix+'
':'
'+r.prefix+''+r.postfix+'
";a=e(t).insertBefore(f),e(".bootstrap-touchspin-prefix",a).after(f),f.hasClass("input-sm")?a.addClass("input-group-sm"):f.hasClass("input-lg")&&a.addClass("input-group-lg")}()}(),l={down:e(".bootstrap-touchspin-down",a),up:e(".bootstrap-touchspin-up",a),input:e("input",a),prefix:e(".bootstrap-touchspin-prefix",a).addClass(r.prefix_extraclass),postfix:e(".bootstrap-touchspin-postfix",a).addClass(r.postfix_extraclass)},function(){""===r.prefix&&l.prefix.hide();""===r.postfix&&l.postfix.hide()}(),f.on("keydown",(function(e){var t=e.keyCode||e.which;38===t?("up"!==v&&(w(),C()),e.preventDefault()):40===t&&("down"!==v&&(x(),T()),e.preventDefault())})),f.on("keyup",(function(e){var t=e.keyCode||e.which;(38===t||40===t)&&k()})),f.on("blur",(function(){y()})),l.down.on("keydown",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||("down"!==v&&(x(),T()),e.preventDefault())})),l.down.on("keyup",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||k()})),l.up.on("keydown",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||("up"!==v&&(w(),C()),e.preventDefault())})),l.up.on("keyup",(function(e){var t=e.keyCode||e.which;32!==t&&13!==t||k()})),l.down.on("mousedown.touchspin",(function(e){l.down.off("touchstart.touchspin"),f.is(":disabled")||(x(),T(),e.preventDefault(),e.stopPropagation())})),l.down.on("touchstart.touchspin",(function(e){l.down.off("mousedown.touchspin"),f.is(":disabled")||(x(),T(),e.preventDefault(),e.stopPropagation())})),l.up.on("mousedown.touchspin",(function(e){l.up.off("touchstart.touchspin"),f.is(":disabled")||(w(),C(),e.preventDefault(),e.stopPropagation())})),l.up.on("touchstart.touchspin",(function(e){l.up.off("mousedown.touchspin"),f.is(":disabled")||(w(),C(),e.preventDefault(),e.stopPropagation())})),l.up.on("mouseout touchleave touchend touchcancel",(function(e){v&&(e.stopPropagation(),k())})),l.down.on("mouseout touchleave touchend touchcancel",(function(e){v&&(e.stopPropagation(),k())})),l.down.on("mousemove touchmove",(function(e){v&&(e.stopPropagation(),e.preventDefault())})),l.up.on("mousemove touchmove",(function(e){v&&(e.stopPropagation(),e.preventDefault())})),e(document).on(n(["mouseup","touchend","touchcancel"],t).join(" "),(function(e){v&&(e.preventDefault(),k())})),e(document).on(n(["mousemove","touchmove","scroll","scrollstart"],t).join(" "),(function(e){v&&(e.preventDefault(),k())})),f.on("mousewheel DOMMouseScroll",(function(e){if(r.mousewheel&&f.is(":focus")){var t=e.originalEvent.wheelDelta||-e.originalEvent.deltaY||-e.originalEvent.detail;e.stopPropagation(),e.preventDefault(),t<0?x():w()}})),f.on("touchspin.uponce",(function(){k(),w()})),f.on("touchspin.downonce",(function(){k(),x()})),f.on("touchspin.startupspin",(function(){C()})),f.on("touchspin.startdownspin",(function(){T()})),f.on("touchspin.stopspin",(function(){k()})),f.on("touchspin.updatesettings",(function(t,n){!function(t){(function(t){r=e.extend({},r,t)})(t),y();var n=l.input.val();""!==n&&(n=Number(l.input.val()),l.input.val(n.toFixed(r.decimals)))}(n)})),l.input.css("display","block");var c}()}))}this.each((function(){var t=e(this).data();e(document).off(n(["mouseup","touchend","touchcancel","mousemove","touchmove","scroll","scrollstart"],t.spinnerid).join(" "))}))}}(jQuery); \ No newline at end of file diff --git a/dist/js/nonjquery-bstrap.js.min.js b/dist/js/nonjquery-bstrap.js.min.js index d420308..0c795f3 100644 --- a/dist/js/nonjquery-bstrap.js.min.js +++ b/dist/js/nonjquery-bstrap.js.min.js @@ -4,11 +4,11 @@ * Copyright 2011-2019 Twitter, Inc. * Licensed under the MIT license */ -if(function(t,e){"use strict";"function"==typeof define&&define.amd?define(e):"object"==typeof module&&module.exports?module.exports=e():t.log=e()}(this,(function(){"use strict";var t=function(){},e="undefined";function i(i){return typeof console!==e&&(void 0!==console[i]?n(console,i):void 0!==console.log?n(console,"log"):t)}function n(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(e){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function s(t,i,n){return function(){typeof console!==e&&(o.call(this,i,n),this[t].apply(this,arguments))}}function o(e,i){for(var n=0;n=0&&i<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+i;if(s=i,!1!==n&&function(t){var e=(a[t]||"silent").toUpperCase();try{return void(window.localStorage[c]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+e+";"}catch(t){}}(i),o.call(l,i,t),typeof console===e&&i3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",(function(){i=!0}));return setTimeout((function(){i||t(n).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(jQuery),function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.VERSION="3.4.1",i.TRANSITION_DURATION=150,i.prototype.close=function(e){var n=t(this),s=n.attr("data-target");s||(s=(s=n.attr("href"))&&s.replace(/.*(?=#[^\s]*$)/,"")),s="#"===s?[]:s;var o=t(document).find(s);function r(){o.detach().trigger("closed.bs.alert").remove()}e&&e.preventDefault(),o.length||(o=n.closest(".alert")),o.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(o.removeClass("in"),t.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",r).emulateTransitionEnd(i.TRANSITION_DURATION):r())};var n=t.fn.alert;t.fn.alert=function(e){return this.each((function(){var n=t(this),s=n.data("bs.alert");s||n.data("bs.alert",s=new i(this)),"string"==typeof e&&s[e].call(n)}))},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(jQuery),function(t){"use strict";var e=function(i,n){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,n),this.isLoading=!1};function i(i){return this.each((function(){var n=t(this),s=n.data("bs.button"),o="object"==typeof i&&i;s||n.data("bs.button",s=new e(this,o)),"toggle"==i?s.toggle():i&&s.setState(i)}))}e.VERSION="3.4.1",e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var i="disabled",n=this.$element,s=n.is("input")?"val":"html",o=n.data();e+="Text",null==o.resetText&&n.data("resetText",n[s]()),setTimeout(t.proxy((function(){n[s](null==o[e]?this.options[e]:o[e]),"loadingText"==e?(this.isLoading=!0,n.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,n.removeClass(i).removeAttr(i).prop(i,!1))}),this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var n=t.fn.button;t.fn.button=i,t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=n,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(e){var n=t(e.target).closest(".btn");i.call(n,"toggle"),t(e.target).is('input[type="radio"], input[type="checkbox"]')||(e.preventDefault(),n.is("input,button")?n.trigger("focus"):n.find("input:visible,button:visible").first().trigger("focus"))})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))}))}(jQuery),function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};function i(i){return this.each((function(){var n=t(this),s=n.data("bs.carousel"),o=t.extend({},e.DEFAULTS,n.data(),"object"==typeof i&&i),r="string"==typeof i?i:o.slide;s||n.data("bs.carousel",s=new e(this,o)),"number"==typeof i?s.to(i):r?s[r]():o.interval&&s.pause().cycle()}))}e.VERSION="3.4.1",e.TRANSITION_DURATION=600,e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},e.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},e.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var n=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(n)},e.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){e.to(t)})):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){if(!this.sliding)return this.slide("next")},e.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},e.prototype.slide=function(i,n){var s=this.$element.find(".item.active"),o=n||this.getItemForDirection(i,s),r=this.interval,a="next"==i?"left":"right",l=this;if(o.hasClass("active"))return this.sliding=!1;var c=o[0],d=t.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,r&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(o)]);p&&p.addClass("active")}var h=t.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return t.support.transition&&this.$element.hasClass("slide")?(o.addClass(i),"object"==typeof o&&o.length&&o[0].offsetWidth,s.addClass(a),o.addClass(a),s.one("bsTransitionEnd",(function(){o.removeClass([i,a].join(" ")).addClass("active"),s.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout((function(){l.$element.trigger(h)}),0)})).emulateTransitionEnd(e.TRANSITION_DURATION)):(s.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(h)),r&&this.cycle(),this}};var n=t.fn.carousel;t.fn.carousel=i,t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=n,this};var s=function(e){var n=t(this),s=n.attr("href");s&&(s=s.replace(/.*(?=#[^\s]+$)/,""));var o=n.attr("data-target")||s,r=t(document).find(o);if(r.hasClass("carousel")){var a=t.extend({},r.data(),n.data()),l=n.attr("data-slide-to");l&&(a.interval=!1),i.call(r,a),l&&r.data("bs.carousel").to(l),e.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",s).on("click.bs.carousel.data-api","[data-slide-to]",s),t(window).on("load",(function(){t('[data-ride="carousel"]').each((function(){var e=t(this);i.call(e,e.data())}))}))}(jQuery),function(t){"use strict";var e=function(i,n){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,n),this.$trigger=t('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function i(e){var i,n=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(document).find(n)}function n(i){return this.each((function(){var n=t(this),s=n.data("bs.collapse"),o=t.extend({},e.DEFAULTS,n.data(),"object"==typeof i&&i);!s&&o.toggle&&/show|hide/.test(i)&&(o.toggle=!1),s||n.data("bs.collapse",s=new e(this,o)),"string"==typeof i&&s[i]()}))}e.VERSION="3.4.1",e.TRANSITION_DURATION=350,e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i,s=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(s&&s.length&&(i=s.data("bs.collapse"))&&i.transitioning)){var o=t.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){s&&s.length&&(n.call(s,"hide"),i||s.data("bs.collapse",null));var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var l=t.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(e.TRANSITION_DURATION)[r](this.$element[0][l])}}}},e.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var s=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return s.call(this);this.$element[n](0).one("bsTransitionEnd",t.proxy(s,this)).emulateTransitionEnd(e.TRANSITION_DURATION)}}},e.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},e.prototype.getParent=function(){return t(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy((function(e,n){var s=t(n);this.addAriaAndCollapsedClass(i(s),s)}),this)).end()},e.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var s=t.fn.collapse;t.fn.collapse=n,t.fn.collapse.Constructor=e,t.fn.collapse.noConflict=function(){return t.fn.collapse=s,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(e){var s=t(this);s.attr("data-target")||e.preventDefault();var o=i(s),r=o.data("bs.collapse")?"toggle":s.data();n.call(o,r)}))}(jQuery),function(t){"use strict";var e='[data-toggle="dropdown"]',i=function(e){t(e).on("click.bs.dropdown",this.toggle)};function n(e){var i=e.attr("data-target");i||(i=(i=e.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n="#"!==i?t(document).find(i):null;return n&&n.length?n:e.parent()}function s(i){i&&3===i.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=t(this),s=n(e),o={relatedTarget:this};s.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(s[0],i.target)||(s.trigger(i=t.Event("hide.bs.dropdown",o)),i.isDefaultPrevented()||(e.attr("aria-expanded","false"),s.removeClass("open").trigger(t.Event("hidden.bs.dropdown",o)))))})))}i.VERSION="3.4.1",i.prototype.toggle=function(e){var i=t(this);if(!i.is(".disabled, :disabled")){var o=n(i),r=o.hasClass("open");if(s(),!r){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s);var a={relatedTarget:this};if(o.trigger(e=t.Event("show.bs.dropdown",a)),e.isDefaultPrevented())return;i.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(t.Event("shown.bs.dropdown",a))}return!1}},i.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var s=t(this);if(i.preventDefault(),i.stopPropagation(),!s.is(".disabled, :disabled")){var o=n(s),r=o.hasClass("open");if(!r&&27!=i.which||r&&27==i.which)return 27==i.which&&o.find(e).trigger("focus"),s.trigger("click");var a=o.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var l=a.index(i.target);38==i.which&&l>0&&l--,40==i.which&&ldocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},e.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},e.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:n},l.prototype.init=function(e,i,n){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var s=this.options.trigger.split(" "),o=s.length;o--;){var r=s[o];if("click"==r)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",l="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},l.prototype.getDefaults=function(){return l.DEFAULTS},l.prototype.getOptions=function(i){var n=this.$element.data();for(var s in n)n.hasOwnProperty(s)&&-1!==t.inArray(s,e)&&delete n[s];return(i=t.extend({},this.getDefaults(),n,i)).delay&&"number"==typeof i.delay&&(i.delay={show:i.delay,hide:i.delay}),i.sanitize&&(i.template=a(i.template,i.whiteList,i.sanitizeFn)),i},l.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,(function(t,n){i[t]!=n&&(e[t]=n)})),e},l.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState)i.hoverState="in";else{if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout((function(){"in"==i.hoverState&&i.show()}),i.options.delay.show)}},l.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},l.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout((function(){"out"==i.hoverState&&i.hide()}),i.options.delay.hide)}},l.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var i=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!i)return;var n=this,s=this.tip(),o=this.getUID(this.type);this.setContent(),s.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,c=a.test(r);c&&(r=r.replace(a,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(t(document).find(this.options.container)):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),p=s[0].offsetWidth,h=s[0].offsetHeight;if(c){var u=r,f=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+h>f.bottom?"top":"top"==r&&d.top-hf.width?"left":"left"==r&&d.left-pr.top+r.height&&(s.top=r.top+r.height-l)}else{var c=e.left-o,d=e.left+o+i;cr.right&&(s.left=r.left+r.width-d)}return s},l.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},l.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},l.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},l.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},l.prototype.enable=function(){this.enabled=!0},l.prototype.disable=function(){this.enabled=!1},l.prototype.toggleEnabled=function(){this.enabled=!this.enabled},l.prototype.toggle=function(e){var i=this;e&&((i=t(e.currentTarget).data("bs."+this.type))||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},l.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},l.prototype.sanitizeHtml=function(t){return a(t,this.options.whiteList,this.options.sanitizeFn)};var c=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var i=t(this),n=i.data("bs.tooltip"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||i.data("bs.tooltip",n=new l(this,s)),"string"==typeof e&&n[e]())}))},t.fn.tooltip.Constructor=l,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=c,this}}(jQuery),function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.VERSION="3.4.1",e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),(e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype)).constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var n=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===n&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===n?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var i=t.fn.popover;t.fn.popover=function(i){return this.each((function(){var n=t(this),s=n.data("bs.popover"),o="object"==typeof i&&i;!s&&/destroy|hide/.test(i)||(s||n.data("bs.popover",s=new e(this,o)),"string"==typeof i&&s[i]())}))},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(jQuery),function(t){"use strict";function e(i,n){this.$body=t(document.body),this.$scrollElement=t(i).is(document.body)?t(window):t(i),this.options=t.extend({},e.DEFAULTS,n),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each((function(){var n=t(this),s=n.data("bs.scrollspy"),o="object"==typeof i&&i;s||n.data("bs.scrollspy",s=new e(this,o)),"string"==typeof i&&s[i]()}))}e.VERSION="3.4.1",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var e=t(this),s=e.data("target")||e.attr("href"),o=/^#./.test(s)&&t(s);return o&&o.length&&o.is(":visible")&&[[o[i]().top+n,s]]||null})).sort((function(t,e){return t[0]-e[0]})).each((function(){e.offsets.push(this[0]),e.targets.push(this[1])}))},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),n=this.options.offset+i-this.$scrollElement.height(),s=this.offsets,o=this.targets,r=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=n)return r!=(t=o[o.length-1])&&this.activate(t);if(r&&e=s[t]&&(void 0===s[t+1]||e .active"),r=s&&t.support.transition&&(o.length&&o.hasClass("fade")||!!n.find("> .fade").length);function a(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade"),i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),s&&s()}o.length&&r?o.one("bsTransitionEnd",a).emulateTransitionEnd(e.TRANSITION_DURATION):a(),o.removeClass("in")};var n=t.fn.tab;t.fn.tab=i,t.fn.tab.Constructor=e,t.fn.tab.noConflict=function(){return t.fn.tab=n,this};var s=function(e){e.preventDefault(),i.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',s).on("click.bs.tab.data-api",'[data-toggle="pill"]',s)}(jQuery),function(t){"use strict";var e=function(i,n){this.options=t.extend({},e.DEFAULTS,n);var s=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=s.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(i),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(i){return this.each((function(){var n=t(this),s=n.data("bs.affix"),o="object"==typeof i&&i;s||n.data("bs.affix",s=new e(this,o)),"string"==typeof i&&s[i]()}))}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,i,n){var s=this.$target.scrollTop(),o=this.$element.offset(),r=this.$target.height();if(null!=i&&"top"==this.affixed)return s=t-n&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var i=this.$element.height(),n=this.options.offset,s=n.top,o=n.bottom,r=Math.max(t(document).height(),t(document.body).height());"object"!=typeof n&&(o=s=n),"function"==typeof s&&(s=n.top(this.$element)),"function"==typeof o&&(o=n.bottom(this.$element));var a=this.getState(r,i,s,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:r-i-o})}};var n=t.fn.affix;t.fn.affix=i,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=n,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),n=e.data();n.offset=n.offset||{},null!=n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!=n.offsetTop&&(n.offset.top=n.offsetTop),i.call(e,n)}))}))}(jQuery), +if(function(t,e){"use strict";"function"==typeof define&&define.amd?define(e):"object"==typeof module&&module.exports?module.exports=e():t.log=e()}(this,(function(){"use strict";var t=function(){},e="undefined";function i(t,e){var i=t[e];if("function"==typeof i.bind)return i.bind(t);try{return Function.prototype.bind.call(i,t)}catch(e){return function(){return Function.prototype.apply.apply(i,[t,arguments])}}}function n(t,i,n){return function(){typeof console!==e&&(s.call(this,i,n),this[t].apply(this,arguments))}}function s(e,i){for(var n=0;n=0&&i<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+i;if(a=i,!1!==n&&function(t){var e=(r[t]||"silent").toUpperCase();try{return void(window.localStorage[c]=e)}catch(t){}try{window.document.cookie=encodeURIComponent(c)+"="+e+";"}catch(t){}}(i),s.call(l,i,t),typeof console===e&&i3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var i=!1,n=this;t(this).one("bsTransitionEnd",(function(){i=!0}));return setTimeout((function(){i||t(n).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(jQuery),function(t){"use strict";var e='[data-dismiss="alert"]',i=function(i){t(i).on("click",e,this.close)};i.VERSION="3.4.1",i.TRANSITION_DURATION=150,i.prototype.close=function(e){var n=t(this),s=n.attr("data-target");s||(s=(s=n.attr("href"))&&s.replace(/.*(?=#[^\s]*$)/,"")),s="#"===s?[]:s;var o=t(document).find(s);function r(){o.detach().trigger("closed.bs.alert").remove()}e&&e.preventDefault(),o.length||(o=n.closest(".alert")),o.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(o.removeClass("in"),t.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",r).emulateTransitionEnd(i.TRANSITION_DURATION):r())};var n=t.fn.alert;t.fn.alert=function(e){return this.each((function(){var n=t(this),s=n.data("bs.alert");s||n.data("bs.alert",s=new i(this)),"string"==typeof e&&s[e].call(n)}))},t.fn.alert.Constructor=i,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",e,i.prototype.close)}(jQuery),function(t){"use strict";var e=function(i,n){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,n),this.isLoading=!1};function i(i){return this.each((function(){var n=t(this),s=n.data("bs.button"),o="object"==typeof i&&i;s||n.data("bs.button",s=new e(this,o)),"toggle"==i?s.toggle():i&&s.setState(i)}))}e.VERSION="3.4.1",e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var i="disabled",n=this.$element,s=n.is("input")?"val":"html",o=n.data();e+="Text",null==o.resetText&&n.data("resetText",n[s]()),setTimeout(t.proxy((function(){n[s](null==o[e]?this.options[e]:o[e]),"loadingText"==e?(this.isLoading=!0,n.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,n.removeClass(i).removeAttr(i).prop(i,!1))}),this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var n=t.fn.button;t.fn.button=i,t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=n,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',(function(e){var n=t(e.target).closest(".btn");i.call(n,"toggle"),t(e.target).is('input[type="radio"], input[type="checkbox"]')||(e.preventDefault(),n.is("input,button")?n.trigger("focus"):n.find("input:visible,button:visible").first().trigger("focus"))})).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',(function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))}))}(jQuery),function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};function i(i){return this.each((function(){var n=t(this),s=n.data("bs.carousel"),o=t.extend({},e.DEFAULTS,n.data(),"object"==typeof i&&i),r="string"==typeof i?i:o.slide;s||n.data("bs.carousel",s=new e(this,o)),"number"==typeof i?s.to(i):r?s[r]():o.interval&&s.pause().cycle()}))}e.VERSION="3.4.1",e.TRANSITION_DURATION=600,e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},e.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},e.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var n=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(n)},e.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",(function(){e.to(t)})):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){if(!this.sliding)return this.slide("next")},e.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},e.prototype.slide=function(i,n){var s=this.$element.find(".item.active"),o=n||this.getItemForDirection(i,s),r=this.interval,a="next"==i?"left":"right",l=this;if(o.hasClass("active"))return this.sliding=!1;var c=o[0],d=t.Event("slide.bs.carousel",{relatedTarget:c,direction:a});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,r&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(o)]);p&&p.addClass("active")}var h=t.Event("slid.bs.carousel",{relatedTarget:c,direction:a});return t.support.transition&&this.$element.hasClass("slide")?(o.addClass(i),"object"==typeof o&&o.length&&o[0].offsetWidth,s.addClass(a),o.addClass(a),s.one("bsTransitionEnd",(function(){o.removeClass([i,a].join(" ")).addClass("active"),s.removeClass(["active",a].join(" ")),l.sliding=!1,setTimeout((function(){l.$element.trigger(h)}),0)})).emulateTransitionEnd(e.TRANSITION_DURATION)):(s.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(h)),r&&this.cycle(),this}};var n=t.fn.carousel;t.fn.carousel=i,t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=n,this};var s=function(e){var n=t(this),s=n.attr("href");s&&(s=s.replace(/.*(?=#[^\s]+$)/,""));var o=n.attr("data-target")||s,r=t(document).find(o);if(r.hasClass("carousel")){var a=t.extend({},r.data(),n.data()),l=n.attr("data-slide-to");l&&(a.interval=!1),i.call(r,a),l&&r.data("bs.carousel").to(l),e.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",s).on("click.bs.carousel.data-api","[data-slide-to]",s),t(window).on("load",(function(){t('[data-ride="carousel"]').each((function(){var e=t(this);i.call(e,e.data())}))}))}(jQuery),function(t){"use strict";var e=function(i,n){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,n),this.$trigger=t('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function i(e){var i,n=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(document).find(n)}function n(i){return this.each((function(){var n=t(this),s=n.data("bs.collapse"),o=t.extend({},e.DEFAULTS,n.data(),"object"==typeof i&&i);!s&&o.toggle&&/show|hide/.test(i)&&(o.toggle=!1),s||n.data("bs.collapse",s=new e(this,o)),"string"==typeof i&&s[i]()}))}e.VERSION="3.4.1",e.TRANSITION_DURATION=350,e.DEFAULTS={toggle:!0},e.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},e.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i,s=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(s&&s.length&&(i=s.data("bs.collapse"))&&i.transitioning)){var o=t.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){s&&s.length&&(n.call(s,"hide"),i||s.data("bs.collapse",null));var r=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[r](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var l=t.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(e.TRANSITION_DURATION)[r](this.$element[0][l])}}}},e.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var s=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!t.support.transition)return s.call(this);this.$element[n](0).one("bsTransitionEnd",t.proxy(s,this)).emulateTransitionEnd(e.TRANSITION_DURATION)}}},e.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},e.prototype.getParent=function(){return t(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy((function(e,n){var s=t(n);this.addAriaAndCollapsedClass(i(s),s)}),this)).end()},e.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var s=t.fn.collapse;t.fn.collapse=n,t.fn.collapse.Constructor=e,t.fn.collapse.noConflict=function(){return t.fn.collapse=s,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',(function(e){var s=t(this);s.attr("data-target")||e.preventDefault();var o=i(s),r=o.data("bs.collapse")?"toggle":s.data();n.call(o,r)}))}(jQuery),function(t){"use strict";var e='[data-toggle="dropdown"]',i=function(e){t(e).on("click.bs.dropdown",this.toggle)};function n(e){var i=e.attr("data-target");i||(i=(i=e.attr("href"))&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n="#"!==i?t(document).find(i):null;return n&&n.length?n:e.parent()}function s(i){i&&3===i.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=t(this),s=n(e),o={relatedTarget:this};s.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(s[0],i.target)||(s.trigger(i=t.Event("hide.bs.dropdown",o)),i.isDefaultPrevented()||(e.attr("aria-expanded","false"),s.removeClass("open").trigger(t.Event("hidden.bs.dropdown",o)))))})))}i.VERSION="3.4.1",i.prototype.toggle=function(e){var i=t(this);if(!i.is(".disabled, :disabled")){var o=n(i),r=o.hasClass("open");if(s(),!r){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",s);var a={relatedTarget:this};if(o.trigger(e=t.Event("show.bs.dropdown",a)),e.isDefaultPrevented())return;i.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(t.Event("shown.bs.dropdown",a))}return!1}},i.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var s=t(this);if(i.preventDefault(),i.stopPropagation(),!s.is(".disabled, :disabled")){var o=n(s),r=o.hasClass("open");if(!r&&27!=i.which||r&&27==i.which)return 27==i.which&&o.find(e).trigger("focus"),s.trigger("click");var a=o.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var l=a.index(i.target);38==i.which&&l>0&&l--,40==i.which&&ldocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},e.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},e.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:n},l.prototype.init=function(e,i,n){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(n),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var s=this.options.trigger.split(" "),o=s.length;o--;){var r=s[o];if("click"==r)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=r){var a="hover"==r?"mouseenter":"focusin",l="hover"==r?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},l.prototype.getDefaults=function(){return l.DEFAULTS},l.prototype.getOptions=function(i){var n=this.$element.data();for(var s in n)n.hasOwnProperty(s)&&-1!==t.inArray(s,e)&&delete n[s];return(i=t.extend({},this.getDefaults(),n,i)).delay&&"number"==typeof i.delay&&(i.delay={show:i.delay,hide:i.delay}),i.sanitize&&(i.template=a(i.template,i.whiteList,i.sanitizeFn)),i},l.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,(function(t,n){i[t]!=n&&(e[t]=n)})),e},l.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState)i.hoverState="in";else{if(clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout((function(){"in"==i.hoverState&&i.show()}),i.options.delay.show)}},l.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},l.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),!i.isInStateTrue()){if(clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout((function(){"out"==i.hoverState&&i.hide()}),i.options.delay.hide)}},l.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var i=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!i)return;var n=this,s=this.tip(),o=this.getUID(this.type);this.setContent(),s.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,c=a.test(r);c&&(r=r.replace(a,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(t(document).find(this.options.container)):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),p=s[0].offsetWidth,h=s[0].offsetHeight;if(c){var u=r,f=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+h>f.bottom?"top":"top"==r&&d.top-hf.width?"left":"left"==r&&d.left-pr.top+r.height&&(s.top=r.top+r.height-l)}else{var c=e.left-o,d=e.left+o+i;cr.right&&(s.left=r.left+r.width-d)}return s},l.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},l.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},l.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},l.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},l.prototype.enable=function(){this.enabled=!0},l.prototype.disable=function(){this.enabled=!1},l.prototype.toggleEnabled=function(){this.enabled=!this.enabled},l.prototype.toggle=function(e){var i=this;e&&((i=t(e.currentTarget).data("bs."+this.type))||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},l.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},l.prototype.sanitizeHtml=function(t){return a(t,this.options.whiteList,this.options.sanitizeFn)};var c=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var i=t(this),n=i.data("bs.tooltip"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||i.data("bs.tooltip",n=new l(this,s)),"string"==typeof e&&n[e]())}))},t.fn.tooltip.Constructor=l,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=c,this}}(jQuery),function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.VERSION="3.4.1",e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),(e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype)).constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var n=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===n&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===n?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var i=t.fn.popover;t.fn.popover=function(i){return this.each((function(){var n=t(this),s=n.data("bs.popover"),o="object"==typeof i&&i;!s&&/destroy|hide/.test(i)||(s||n.data("bs.popover",s=new e(this,o)),"string"==typeof i&&s[i]())}))},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(jQuery),function(t){"use strict";function e(i,n){this.$body=t(document.body),this.$scrollElement=t(i).is(document.body)?t(window):t(i),this.options=t.extend({},e.DEFAULTS,n),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each((function(){var n=t(this),s=n.data("bs.scrollspy"),o="object"==typeof i&&i;s||n.data("bs.scrollspy",s=new e(this,o)),"string"==typeof i&&s[i]()}))}e.VERSION="3.4.1",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map((function(){var e=t(this),s=e.data("target")||e.attr("href"),o=/^#./.test(s)&&t(s);return o&&o.length&&o.is(":visible")&&[[o[i]().top+n,s]]||null})).sort((function(t,e){return t[0]-e[0]})).each((function(){e.offsets.push(this[0]),e.targets.push(this[1])}))},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),n=this.options.offset+i-this.$scrollElement.height(),s=this.offsets,o=this.targets,r=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=n)return r!=(t=o[o.length-1])&&this.activate(t);if(r&&e=s[t]&&(void 0===s[t+1]||e .active"),r=s&&t.support.transition&&(o.length&&o.hasClass("fade")||!!n.find("> .fade").length);function a(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade"),i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),s&&s()}o.length&&r?o.one("bsTransitionEnd",a).emulateTransitionEnd(e.TRANSITION_DURATION):a(),o.removeClass("in")};var n=t.fn.tab;t.fn.tab=i,t.fn.tab.Constructor=e,t.fn.tab.noConflict=function(){return t.fn.tab=n,this};var s=function(e){e.preventDefault(),i.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',s).on("click.bs.tab.data-api",'[data-toggle="pill"]',s)}(jQuery),function(t){"use strict";var e=function(i,n){this.options=t.extend({},e.DEFAULTS,n);var s=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=s.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(i),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(i){return this.each((function(){var n=t(this),s=n.data("bs.affix"),o="object"==typeof i&&i;s||n.data("bs.affix",s=new e(this,o)),"string"==typeof i&&s[i]()}))}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,i,n){var s=this.$target.scrollTop(),o=this.$element.offset(),r=this.$target.height();if(null!=i&&"top"==this.affixed)return s=t-n&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var i=this.$element.height(),n=this.options.offset,s=n.top,o=n.bottom,r=Math.max(t(document).height(),t(document.body).height());"object"!=typeof n&&(o=s=n),"function"==typeof s&&(s=n.top(this.$element)),"function"==typeof o&&(o=n.bottom(this.$element));var a=this.getState(r,i,s,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var l="affix"+(a?"-"+a:""),c=t.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:r-i-o})}};var n=t.fn.affix;t.fn.affix=i,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=n,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),n=e.data();n.offset=n.offset||{},null!=n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!=n.offsetTop&&(n.offset.top=n.offsetTop),i.call(e,n)}))}))}(jQuery), /*! * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select) * * Copyright 2012-2020 SnapAppointments, LLC * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE) */ -function(t,e){void 0===t&&void 0!==window&&(t=window),"function"==typeof define&&define.amd?define(["jquery"],(function(t){return e(t)})):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(t.jQuery)}(this,(function(t){!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],i=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],n={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},s=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function r(e,n){var r=e.nodeName.toLowerCase();if(-1!==t.inArray(r,n))return-1===t.inArray(r,i)||Boolean(e.nodeValue.match(s)||e.nodeValue.match(o));for(var a=t(n).filter((function(t,e){return e instanceof RegExp})),l=0,c=a.length;l1?arguments[1]:void 0,r=o?Number(o):0;r!=r&&(r=0);var a=Math.min(Math.max(r,0),i);if(s+a>i)return!1;for(var l=-1;++l]+>/g,"")),n&&(l=T(l)),l=l.toUpperCase(),o="contains"===i?l.indexOf(e)>=0:l.startsWith(e)))break}return o}function x(t){return parseInt(t,10)||0}t.fn.triggerNative=function(t){var e,i=this[0];i.dispatchEvent?(w?e=new Event(t,{bubbles:!0}):(e=document.createEvent("Event")).initEvent(t,!0,!1),i.dispatchEvent(e)):i.fireEvent?((e=document.createEventObject()).eventType=t,i.fireEvent("on"+t,e)):this.trigger(t)};var $={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},I=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,k=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function C(t){return $[t]}function T(t){return(t=t.toString())&&t.replace(I,C).replace(k,"")}var E,S,O,N,A,D=(E={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},S=function(t){return E[t]},O="(?:"+Object.keys(E).join("|")+")",N=RegExp(O),A=RegExp(O,"g"),function(t){return t=null==t?"":""+t,N.test(t)?t.replace(A,S):t}),L={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},z=27,H=13,R=32,P=9,U=38,W=40,B={success:!1,major:"3"};try{B.full=(t.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),B.major=B.full[0],B.success=!0}catch(t){}var j=0,M=".bs.select",_={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},F={MENU:"."+_.MENU},V={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};V.noResults=V.li.cloneNode(!1),V.noResults.className="no-results",V.a.setAttribute("role","option"),V.a.className="dropdown-item",V.subtext.className="text-muted",V.text=V.span.cloneNode(!1),V.text.className="text",V.checkMark=V.span.cloneNode(!1);var q=new RegExp(U+"|"+W),G=new RegExp("^"+P+"$|"+z),Q={li:function(t,e,i){var n=V.li.cloneNode(!1);return t&&(1===t.nodeType||11===t.nodeType?n.appendChild(t):n.innerHTML=t),void 0!==e&&""!==e&&(n.className=e),null!=i&&n.classList.add("optgroup-"+i),n},a:function(t,e,i){var n=V.a.cloneNode(!0);return t&&(11===t.nodeType?n.appendChild(t):n.insertAdjacentHTML("beforeend",t)),void 0!==e&&""!==e&&n.classList.add.apply(n.classList,e.split(/\s+/)),i&&n.setAttribute("style",i),n},text:function(t,e){var i,n,s=V.text.cloneNode(!1);if(t.content)s.innerHTML=t.content;else{if(s.textContent=t.text,t.icon){var o=V.whitespace.cloneNode(!1);(n=(!0===e?V.i:V.span).cloneNode(!1)).className=this.options.iconBase+" "+t.icon,V.fragment.appendChild(n),V.fragment.appendChild(o)}t.subtext&&((i=V.subtext.cloneNode(!1)).textContent=t.subtext,s.appendChild(i))}if(!0===e)for(;s.childNodes.length>0;)V.fragment.appendChild(s.childNodes[0]);else V.fragment.appendChild(s);return V.fragment},label:function(t){var e,i,n=V.text.cloneNode(!1);if(n.innerHTML=t.display,t.icon){var s=V.whitespace.cloneNode(!1);(i=V.span.cloneNode(!1)).className=this.options.iconBase+" "+t.icon,V.fragment.appendChild(i),V.fragment.appendChild(s)}return t.subtext&&((e=V.subtext.cloneNode(!1)).textContent=t.subtext,n.appendChild(e)),V.fragment.appendChild(n),V.fragment}};function K(t,e){t.length||(V.noResults.innerHTML=this.options.noneResultsText.replace("{0}",'"'+D(e)+'"'),this.$menuInner[0].firstChild.appendChild(V.noResults))}var Y=function(e,i){var n=this;g.useDefault||(t.valHooks.select.set=g._set,g.useDefault=!0),this.$element=t(e),this.$newElement=null,this.$button=null,this.$menu=null,this.options=i,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){n.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var s=this.options.windowPadding;"number"==typeof s&&(this.options.windowPadding=[s,s,s,s]),this.val=Y.prototype.val,this.render=Y.prototype.render,this.refresh=Y.prototype.refresh,this.setStyle=Y.prototype.setStyle,this.selectAll=Y.prototype.selectAll,this.deselectAll=Y.prototype.deselectAll,this.destroy=Y.prototype.destroy,this.remove=Y.prototype.remove,this.show=Y.prototype.show,this.hide=Y.prototype.hide,this.init()};function J(i){var n,s=arguments,o=i;if([].shift.apply(s),!B.success){try{B.full=(t.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(t){Y.BootstrapVersion?B.full=Y.BootstrapVersion.split(" ")[0].split("."):(B.full=[B.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",t))}B.major=B.full[0],B.success=!0}if("4"===B.major){var r=[];Y.DEFAULTS.style===_.BUTTONCLASS&&r.push({name:"style",className:"BUTTONCLASS"}),Y.DEFAULTS.iconBase===_.ICONBASE&&r.push({name:"iconBase",className:"ICONBASE"}),Y.DEFAULTS.tickIcon===_.TICKICON&&r.push({name:"tickIcon",className:"TICKICON"}),_.DIVIDER="dropdown-divider",_.SHOW="show",_.BUTTONCLASS="btn-light",_.POPOVERHEADER="popover-header",_.ICONBASE="",_.TICKICON="bs-ok-default";for(var a=0;a'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:n},Y.prototype={constructor:Y,init:function(){var t=this,e=this.$element.attr("id"),i=this.$element[0],n=i.form;j++,this.selectId="bs-select-"+j,i.classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),i.classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),n&&null===i.form&&(n.id||(n.id="form-"+this.selectId),i.setAttribute("form",n.id)),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(F.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),i.classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(_.MENURIGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide.bs.select",(function(){if(t.isVirtual()){var e=t.$menuInner[0],i=e.firstChild.cloneNode(!1);e.replaceChild(i,e.firstChild),e.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){t.$element.trigger("hide.bs.select",e)},"hidden.bs.dropdown":function(e){t.$element.trigger("hidden.bs.select",e)},"show.bs.dropdown":function(e){t.$element.trigger("show.bs.select",e)},"shown.bs.dropdown":function(e){t.$element.trigger("shown.bs.select",e)}}),i.hasAttribute("required")&&this.$element.on("invalid.bs.select",(function(){t.$button[0].classList.add("bs-invalid"),t.$element.on("shown.bs.select.invalid",(function(){t.$element.val(t.$element.val()).off("shown.bs.select.invalid")})).on("rendered.bs.select",(function(){this.validity.valid&&t.$button[0].classList.remove("bs-invalid"),t.$element.off("rendered.bs.select")})),t.$button.on("blur.bs.select",(function(){t.$element.trigger("focus").trigger("blur"),t.$button.off("blur.bs.select")}))})),setTimeout((function(){t.buildList(),t.$element.trigger("loaded.bs.select")}))},createDropdown:function(){var e=this.multiple||this.options.showTick?" show-tick":"",i=this.multiple?' aria-multiselectable="true"':"",n="",s=this.autofocus?" autofocus":"";B.major<4&&this.$element.parent().hasClass("input-group")&&(n=" input-group-btn");var o,r="",a="",l="",c="";return this.options.header&&(r='
'+this.options.header+"
"),this.options.liveSearch&&(a=''),this.multiple&&this.options.actionsBox&&(l='
"),this.multiple&&this.options.doneButton&&(c='
"),o='",t(o)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0,this.selectpicker.view.firstHighlightIndex=!1;for(var t=0;t=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(e,i,n){var s,o,r=this,l=0,c=[];if(this.selectpicker.isSearching=e,this.selectpicker.current=e?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),i)if(n)l=this.$menuInner[0].scrollTop;else if(!r.multiple){var d=r.$element[0],p=(d.options[d.selectedIndex]||{}).liIndex;if("number"==typeof p&&!1!==r.options.size){var h=r.selectpicker.main.data[p],u=h&&h.position;u&&(l=u-(r.sizeInfo.menuInnerHeight+r.sizeInfo.liHeight)/2)}}function f(t,i){var n,l,d,p,h,u,f,m,v,g,b=r.selectpicker.current.elements.length,w=[],y=!0,x=r.isVirtual();r.selectpicker.view.scrollTop=t,n=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),l=Math.round(b/n)||1;for(var $=0;$b-1?0:r.selectpicker.current.data[b-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,T.firstChild.style.marginTop=k+"px",T.firstChild.style.marginBottom=C+"px"):(T.firstChild.style.marginTop=0,T.firstChild.style.marginBottom=0),T.firstChild.appendChild(E),!0===x&&r.sizeInfo.hasScrollBar){var H=T.firstChild.offsetWidth;if(i&&Hr.sizeInfo.selectWidth)T.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px";else if(H>r.sizeInfo.menuInnerInnerWidth){r.$menu[0].style.minWidth=0;var R=T.firstChild.offsetWidth;R>r.sizeInfo.menuInnerInnerWidth&&(r.sizeInfo.menuInnerInnerWidth=R,T.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px"),r.$menu[0].style.minWidth=""}}}if(r.prevActiveIndex=r.activeIndex,r.options.liveSearch){if(e&&i){var P,U=0;r.selectpicker.view.canHighlight[U]||(U=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),P=r.selectpicker.view.visibleElements[U],r.defocusItem(r.selectpicker.view.currentActive),r.activeIndex=(r.selectpicker.current.data[U]||{}).index,r.focusItem(P)}}else r.$menuInner.trigger("focus")}f(l,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(t,e){r.noScroll||f(this.scrollTop,e),r.noScroll=!1})),t(window).off("resize.bs.select."+this.selectId+".createView").on("resize.bs.select."+this.selectId+".createView",(function(){r.$newElement.hasClass(_.SHOW)&&f(r.$menuInner[0].scrollTop)}))},focusItem:function(t,e,i){if(t){e=e||this.selectpicker.main.data[this.activeIndex];var n=t.firstChild;n&&(n.setAttribute("aria-setsize",this.selectpicker.view.size),n.setAttribute("aria-posinset",e.posinset),!0!==i&&(this.focusedParent.setAttribute("aria-activedescendant",n.id),t.classList.add("active"),n.classList.add("active")))}},defocusItem:function(t){t&&(t.classList.remove("active"),t.firstChild&&t.firstChild.classList.remove("active"))},setPlaceholder:function(){var t=this,e=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),e=!0;var i=this.$element[0],n=!1,s=!this.selectpicker.view.titleOption.parentNode,o=i.selectedIndex,r=i.options[o],a=window.performance&&window.performance.getEntriesByType("navigation"),l=a&&a.length?"back_forward"!==a[0].type:2!==window.performance.navigation.type;s&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",n=!r||0===o&&!1===r.defaultSelected&&void 0===this.$element.data("selected")),(s||0!==this.selectpicker.view.titleOption.index)&&i.insertBefore(this.selectpicker.view.titleOption,i.firstChild),n&&l?i.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){t.selectpicker.view.displayedValue!==i.value&&t.render()}))}return e},buildData:function(){var t=':not([hidden]):not([data-hidden="true"])',e=[],i=0,n=this.setPlaceholder()?1:0;this.options.hideDisabled&&(t+=":not(:disabled)");var s=this.$element[0].querySelectorAll("select > *"+t);function o(t){var i=e[e.length-1];i&&"divider"===i.type&&(i.optID||t.optID)||((t=t||{}).type="divider",e.push(t))}function r(t,i){if((i=i||{}).divider="true"===t.getAttribute("data-divider"),i.divider)o({optID:i.optID});else{var n=e.length,s=t.style.cssText,r=s?D(s):"",a=(t.className||"")+(i.optgroupClass||"");i.optID&&(a="opt "+a),i.optionClass=a.trim(),i.inlineStyle=r,i.text=t.textContent,i.content=t.getAttribute("data-content"),i.tokens=t.getAttribute("data-tokens"),i.subtext=t.getAttribute("data-subtext"),i.icon=t.getAttribute("data-icon"),t.liIndex=n,i.display=i.content||i.text,i.type="option",i.index=n,i.option=t,i.selected=!!t.selected,i.disabled=i.disabled||!!t.disabled,e.push(i)}}function a(s,a){var l=a[s],c=!(s-1n&&(n=o,t.selectpicker.view.widestOption=i[i.length-1])}!t.options.showTick&&!t.multiple||V.checkMark.parentNode||(V.checkMark.className=this.options.iconBase+" "+t.options.tickIcon+" check-mark",V.a.appendChild(V.checkMark));for(var o=e.length,r=0;r li")},render:function(){var t,e,i=this,n=this.$element[0],s=this.setPlaceholder()&&0===n.selectedIndex,o=m(n,this.options.hideDisabled),r=o.length,l=this.$button[0],c=l.querySelector(".filter-option-inner-inner"),d=document.createTextNode(this.options.multipleSeparator),p=V.fragment.cloneNode(!1),h=!1;if(l.classList.toggle("bs-placeholder",i.multiple?!r:!v(n,o)),i.multiple||1!==o.length||(i.selectpicker.view.displayedValue=v(n,o)),"static"===this.options.selectedTextFormat)p=Q.text.call(this,{text:this.options.title},!0);else if((t=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&r>1)&&(t=(e=this.options.selectedTextFormat.split(">")).length>1&&r>e[1]||1===e.length&&r>=2),!1===t){if(!s){for(var u=0;u0&&p.appendChild(d.cloneNode(!1)),f.title?b.text=f.title:g&&(g.content&&i.options.showContent?(b.content=g.content.toString(),h=!0):(i.options.showIcon&&(b.icon=g.icon),i.options.showSubtext&&!i.multiple&&g.subtext&&(b.subtext=" "+g.subtext),b.text=f.textContent.trim())),p.appendChild(Q.text.call(this,b,!0))}r>49&&p.appendChild(document.createTextNode("..."))}}else{var w=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(w+=":not(:disabled)");var y=this.$element[0].querySelectorAll("select > option"+w+", optgroup"+w+" option"+w).length,x="function"==typeof this.options.countSelectedText?this.options.countSelectedText(r,y):this.options.countSelectedText;p=Q.text.call(this,{text:x.replace("{0}",r.toString()).replace("{1}",y.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),p.childNodes.length||(p=Q.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),l.title=p.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&h&&a([p],i.options.whiteList,i.options.sanitizeFn),c.innerHTML="",c.appendChild(p),B.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var $=l.querySelector(".filter-expand"),I=c.cloneNode(!0);I.className="filter-expand",$?l.replaceChild(I,$):l.appendChild(I)}this.$element.trigger("rendered.bs.select")},setStyle:function(t,e){var i,n=this.$button[0],s=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),B.major<4&&(s.classList.add("bs3"),s.parentNode.classList&&s.parentNode.classList.contains("input-group")&&(s.previousElementSibling||s.nextElementSibling)&&(s.previousElementSibling||s.nextElementSibling).classList.contains("input-group-addon")&&s.classList.add("bs3-has-addon")),i=t?t.trim():o,"add"==e?i&&n.classList.add.apply(n.classList,i.split(" ")):"remove"==e?i&&n.classList.remove.apply(n.classList,i.split(" ")):(o&&n.classList.remove.apply(n.classList,o.split(" ")),i&&n.classList.add.apply(n.classList,i.split(" ")))},liHeight:function(e){if(e||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var i,n=V.div.cloneNode(!1),s=V.div.cloneNode(!1),o=V.div.cloneNode(!1),r=document.createElement("ul"),a=V.li.cloneNode(!1),l=V.li.cloneNode(!1),c=V.a.cloneNode(!1),d=V.span.cloneNode(!1),p=this.options.header&&this.$menu.find("."+_.POPOVERHEADER).length>0?this.$menu.find("."+_.POPOVERHEADER)[0].cloneNode(!0):null,h=this.options.liveSearch?V.div.cloneNode(!1):null,u=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,f=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,d.className="text",c.className="dropdown-item "+(m?m.className:""),n.className=this.$menu[0].parentNode.className+" "+_.SHOW,n.style.width=0,"auto"===this.options.width&&(s.style.minWidth=0),s.className=_.MENU+" "+_.SHOW,o.className="inner "+_.SHOW,r.className=_.MENU+" inner "+("4"===B.major?_.SHOW:""),a.className=_.DIVIDER,l.className="dropdown-header",d.appendChild(document.createTextNode("​")),this.selectpicker.current.data.length)for(var v=0;vthis.sizeInfo.menuExtras.vert&&a+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(l=this.selectpicker.dropup),this.$newElement.toggleClass(_.DROPUP,l),this.selectpicker.dropup=l),"auto"===this.options.size)s=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,i=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,n=s+p+h+u+f,r=Math.max(s-v.vert,0),this.$newElement.hasClass(_.DROPUP)&&(i=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),o=i,e=i-p-h-u-f-v.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var b=0;bthis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(_.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&n.off("resize.bs.select."+this.selectId+".setMenuSize scroll"+".bs.select."+this.selectId+".setMenuSize")}this.createView(!1,!0,e)},setWidth:function(){var t=this;"auto"===this.options.width?requestAnimationFrame((function(){t.$menu.css("min-width","0"),t.$element.on("loaded.bs.select",(function(){t.liHeight(),t.setMenuSize();var e=t.$newElement.clone().appendTo("body"),i=e.css("width","auto").children("button").outerWidth();e.remove(),t.sizeInfo.selectWidth=Math.max(t.sizeInfo.totalMenuWidth,i),t.$newElement.css("width",t.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=t('
');var e,i,n,s=this,o=t(this.options.container),r=function(r){var a={},l=s.options.display||!!t.fn.dropdown.Constructor.Default&&t.fn.dropdown.Constructor.Default.display;s.$bsContainer.addClass(r.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(_.DROPUP,r.hasClass(_.DROPUP)),e=r.offset(),o.is("body")?i={top:0,left:0}:((i=o.offset()).top+=parseInt(o.css("borderTopWidth"))-o.scrollTop(),i.left+=parseInt(o.css("borderLeftWidth"))-o.scrollLeft()),n=r.hasClass(_.DROPUP)?0:r[0].offsetHeight,(B.major<4||"static"===l)&&(a.top=e.top-i.top+n,a.left=e.left-i.left),a.width=r[0].offsetWidth,s.$bsContainer.css(a)};this.$button.on("click.bs.dropdown.data-api",(function(){s.isDisabled()||(r(s.$newElement),s.$bsContainer.appendTo(s.options.container).toggleClass(_.SHOW,!s.$button.hasClass(_.SHOW)).append(s.$menu))})),t(window).off("resize.bs.select."+this.selectId+" scroll"+".bs.select."+this.selectId).on("resize.bs.select."+this.selectId+" scroll"+".bs.select."+this.selectId,(function(){s.$newElement.hasClass(_.SHOW)&&r(s.$newElement)})),this.$element.on("hide.bs.select",(function(){s.$menu.data("height",s.$menu.height()),s.$bsContainer.detach()}))},setOptionStatus:function(t){var e=this;if(e.noScroll=!1,e.selectpicker.view.visibleElements&&e.selectpicker.view.visibleElements.length)for(var i=0;i3&&!e.dropdown&&(e.dropdown=e.$button.data("bs.dropdown"),e.dropdown._menu=e.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){e.$newElement.hasClass(_.SHOW)||e.setSize()})),this.$element.on("shown.bs.select",(function(){e.$menuInner[0].scrollTop!==e.selectpicker.view.scrollTop&&(e.$menuInner[0].scrollTop=e.selectpicker.view.scrollTop),B.major>3?requestAnimationFrame(s):n()})),this.$menuInner.on("mouseenter","li a",(function(t){var i=this.parentElement,n=e.isVirtual()?e.selectpicker.view.position0:0,s=Array.prototype.indexOf.call(i.parentElement.children,i),o=e.selectpicker.current.data[s+n];e.focusItem(i,o,!0)})),this.$menuInner.on("click","li a",(function(i,n){var s=t(this),o=e.$element[0],r=e.isVirtual()?e.selectpicker.view.position0:0,a=e.selectpicker.current.data[s.parent().index()+r],l=a.index,c=v(o),d=o.selectedIndex,p=o.options[d],h=!0;if(e.multiple&&1!==e.options.maxOptions&&i.stopPropagation(),i.preventDefault(),!e.isDisabled()&&!s.parent().hasClass(_.DISABLED)){var u=a.option,f=t(u),g=u.selected,w=f.parent("optgroup"),y=w.find("option"),x=e.options.maxOptions,$=w.data("maxOptions")||!1;if(l===e.activeIndex&&(n=!0),n||(e.prevActiveIndex=e.activeIndex,e.activeIndex=void 0),e.multiple){if(u.selected=!g,e.setSelected(l,!g),e.focusedParent.focus(),!1!==x||!1!==$){var I=x
');S[2]&&(O=O.replace("{var}",S[2][x>1?0:1]),N=N.replace("{var}",S[2][$>1?0:1])),u.selected=!1,e.$menu.append(A),x&&I&&(A.append(t("
"+O+"
")),h=!1,e.$element.trigger("maxReached.bs.select")),$&&k&&(A.append(t("
"+N+"
")),h=!1,e.$element.trigger("maxReachedGrp.bs.select")),setTimeout((function(){e.setSelected(l,!1)}),10),A[0].classList.add("fadeOut"),setTimeout((function(){A.remove()}),1050)}}}else p&&(p.selected=!1),u.selected=!0,e.setSelected(l,!0);!e.multiple||e.multiple&&1===e.options.maxOptions?e.$button.trigger("focus"):e.options.liveSearch&&e.$searchbox.trigger("focus"),h&&(e.multiple||d!==o.selectedIndex)&&(b=[u.index,f.prop("selected"),c],e.$element.triggerNative("change"))}})),this.$menu.on("click","li."+_.DISABLED+" a, ."+_.POPOVERHEADER+", ."+_.POPOVERHEADER+" :not(.close)",(function(i){i.currentTarget==this&&(i.preventDefault(),i.stopPropagation(),e.options.liveSearch&&!t(i.target).hasClass("close")?e.$searchbox.trigger("focus"):e.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(t){t.preventDefault(),t.stopPropagation(),e.options.liveSearch?e.$searchbox.trigger("focus"):e.$button.trigger("focus")})),this.$menu.on("click","."+_.POPOVERHEADER+" .close",(function(){e.$button.trigger("click")})),this.$searchbox.on("click",(function(t){t.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(i){e.options.liveSearch?e.$searchbox.trigger("focus"):e.$button.trigger("focus"),i.preventDefault(),i.stopPropagation(),t(this).hasClass("bs-select-all")?e.selectAll():e.deselectAll()})),this.$button.on("focus.bs.select",(function(t){var i=e.$element[0].getAttribute("tabindex");void 0!==i&&t.originalEvent&&t.originalEvent.isTrusted&&(this.setAttribute("tabindex",i),e.$element[0].setAttribute("tabindex",-1),e.selectpicker.view.tabindex=i)})).on("blur.bs.select",(function(t){void 0!==e.selectpicker.view.tabindex&&t.originalEvent&&t.originalEvent.isTrusted&&(e.$element[0].setAttribute("tabindex",e.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),e.selectpicker.view.tabindex=void 0)})),this.$element.on("change.bs.select",(function(){e.render(),e.$element.trigger("changed.bs.select",b),b=null})).on("focus.bs.select",(function(){e.options.mobile||e.$button[0].focus()}))},liveSearchListener:function(){var t=this;this.$button.on("click.bs.dropdown.data-api",(function(){t.$searchbox.val()&&(t.$searchbox.val(""),t.selectpicker.search.previousValue=void 0)})),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(t){t.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var e=t.$searchbox[0].value;if(t.selectpicker.search.elements=[],t.selectpicker.search.data=[],e){var i=[],n=e.toUpperCase(),s={},o=[],r=t._searchStyle(),a=t.options.liveSearchNormalize;a&&(n=T(n));for(var l=0;l0&&(s[c.headerIndex-1]=!0,o.push(c.headerIndex-1)),s[c.headerIndex]=!0,o.push(c.headerIndex),s[c.lastIndex+1]=!0),s[l]&&"optgroup-label"!==c.type&&o.push(l)}l=0;for(var d=o.length;l=112&&e.which<=123))if(!(n=c.$newElement.hasClass(_.SHOW))&&(u||e.which>=48&&e.which<=57||e.which>=96&&e.which<=105||e.which>=65&&e.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(e.which===z&&n&&(e.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),u){if(!d.length)return;-1!==(i=(s=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(s.parentElement.children,s):-1)&&c.defocusItem(s),e.which===U?(-1!==i&&i--,i+m<0&&(i+=d.length),c.selectpicker.view.canHighlight[i+m]||-1===(i=c.selectpicker.view.canHighlight.slice(0,i+m).lastIndexOf(!0)-m)&&(i=d.length-1)):(e.which===W||h)&&(++i+m>=c.selectpicker.view.canHighlight.length&&(i=c.selectpicker.view.firstHighlightIndex),c.selectpicker.view.canHighlight[i+m]||(i=i+1+c.selectpicker.view.canHighlight.slice(i+m+1).indexOf(!0))),e.preventDefault();var v=m+i;e.which===U?0===m&&i===d.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,v=c.selectpicker.current.elements.length-1):p=(r=(o=c.selectpicker.current.data[v]).position-o.height)f),s=c.selectpicker.current.elements[v],c.activeIndex=c.selectpicker.current.data[v].index,c.focusItem(s),c.selectpicker.view.currentActive=s,p&&(c.$menuInner[0].scrollTop=r),c.options.liveSearch?c.$searchbox.trigger("focus"):a.trigger("focus")}else if(!a.is("input")&&!G.test(e.which)||e.which===R&&c.selectpicker.keydown.keyHistory){var g,b,w=[];e.preventDefault(),c.selectpicker.keydown.keyHistory+=L[e.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),b=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(b)&&(b=b.charAt(0));for(var x=0;x0?(r=o.position-o.height,p=!0):(r=o.position-c.sizeInfo.menuInnerHeight,p=o.position>f+c.sizeInfo.menuInnerHeight),s=c.selectpicker.main.elements[g],c.activeIndex=w[I],c.focusItem(s),s&&s.firstChild.focus(),p&&(c.$menuInner[0].scrollTop=r),a.trigger("focus")}}n&&(e.which===R&&!c.selectpicker.keydown.keyHistory||e.which===H||e.which===P&&c.options.selectOnTab)&&(e.which!==R&&e.preventDefault(),c.options.liveSearch&&e.which===R||(c.$menuInner.find(".active a").trigger("click",!0),a.trigger("focus"),c.options.liveSearch||(e.preventDefault(),t(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var e=t.extend({},this.options,this.$element.data());this.options=e,this.checkDisabled(),this.buildData(),this.setStyle(),this.render(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed.bs.select")},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.selectpicker.view.titleOption&&this.selectpicker.view.titleOption.parentNode&&this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption),this.$element.off(M).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),t(window).off(".bs.select."+this.selectId)}};var Z=t.fn.selectpicker;function X(){if(t.fn.dropdown){var e=t.fn.dropdown.Constructor._dataApiKeydownHandler||t.fn.dropdown.Constructor.prototype.keydown;return e.apply(this,arguments)}}t.fn.selectpicker=J,t.fn.selectpicker.Constructor=Y,t.fn.selectpicker.noConflict=function(){return t.fn.selectpicker=Z,this},t(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',X).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",X).on("keydown.bs.select",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',Y.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(t){t.stopPropagation()})),t(window).on("load.bs.select.data-api",(function(){t(".selectpicker").each((function(){var e=t(this);J.call(e,e.data())}))}))}(t)})),function(t){"use strict";var e=0;function i(e,i){return t.map(e,(function(t){return function(t,e){return t+".touchspin_"+e}(t,i)}))}t.fn.TouchSpin=function(n){if("destroy"!==n){var s={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalupclass:"glyphicon glyphicon-chevron-up",verticaldownclass:"glyphicon glyphicon-chevron-down",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-default",buttonup_class:"btn btn-default",buttondown_txt:"-",buttonup_txt:"+"},o={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each((function(){var r,a,l,c,d,p,h,u,f=t(this),m=f.data(),v=0,g=!1;function b(){var t,e,i;""!==(t=f.val())?r.decimals>0&&"."===t||(e=parseFloat(t),isNaN(e)&&(e=""!==r.replacementval?r.replacementval:0),i=e,e.toString()!==t&&(i=e),er.max&&(i=r.max),i=function(t){switch(r.forcestepdivisibility){case"round":return(Math.round(t/r.step)*r.step).toFixed(r.decimals);case"floor":return(Math.floor(t/r.step)*r.step).toFixed(r.decimals);case"ceil":return(Math.ceil(t/r.step)*r.step).toFixed(r.decimals);default:return t}}(i),Number(t).toString()!==i.toString()&&(f.val(i),f.trigger("change"))):""!==r.replacementval&&(f.val(r.replacementval),f.trigger("change"))}function w(){if(r.booster){var t=Math.pow(2,Math.floor(v/r.boostat))*r.step;return r.maxboostedstep&&t>r.maxboostedstep&&(t=r.maxboostedstep,c=Math.round(c/t)*t),Math.max(r.step,t)}return r.step}function y(){b(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var t=c,e=w();(c+=e)>r.max&&(c=r.max,f.trigger("touchspin.on.max"),k()),l.input.val(Number(c).toFixed(r.decimals)),t!==c&&f.trigger("change")}function x(){b(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var t=c,e=w();(c-=e)'+r.prefix+"",c=''+r.postfix+"";s.hasClass("input-group-btn")?(i='",s.append(i)):(i='",t(i).insertBefore(f));o.hasClass("input-group-btn")?(n='",o.prepend(n)):(n='",t(n).insertAfter(f));t(l).insertBefore(f),t(c).insertAfter(f),a=e}(i):function(){var e;e=r.verticalbuttons?'
'+r.prefix+''+r.postfix+'
':'
'+r.prefix+''+r.postfix+'
";a=t(e).insertBefore(f),t(".bootstrap-touchspin-prefix",a).after(f),f.hasClass("input-sm")?a.addClass("input-group-sm"):f.hasClass("input-lg")&&a.addClass("input-group-lg")}()}(),l={down:t(".bootstrap-touchspin-down",a),up:t(".bootstrap-touchspin-up",a),input:t("input",a),prefix:t(".bootstrap-touchspin-prefix",a).addClass(r.prefix_extraclass),postfix:t(".bootstrap-touchspin-postfix",a).addClass(r.postfix_extraclass)},function(){""===r.prefix&&l.prefix.hide();""===r.postfix&&l.postfix.hide()}(),f.on("keydown",(function(t){var e=t.keyCode||t.which;38===e?("up"!==g&&(y(),I()),t.preventDefault()):40===e&&("down"!==g&&(x(),$()),t.preventDefault())})),f.on("keyup",(function(t){var e=t.keyCode||t.which;(38===e||40===e)&&k()})),f.on("blur",(function(){b()})),l.down.on("keydown",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||("down"!==g&&(x(),$()),t.preventDefault())})),l.down.on("keyup",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||k()})),l.up.on("keydown",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||("up"!==g&&(y(),I()),t.preventDefault())})),l.up.on("keyup",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||k()})),l.down.on("mousedown.touchspin",(function(t){l.down.off("touchstart.touchspin"),f.is(":disabled")||(x(),$(),t.preventDefault(),t.stopPropagation())})),l.down.on("touchstart.touchspin",(function(t){l.down.off("mousedown.touchspin"),f.is(":disabled")||(x(),$(),t.preventDefault(),t.stopPropagation())})),l.up.on("mousedown.touchspin",(function(t){l.up.off("touchstart.touchspin"),f.is(":disabled")||(y(),I(),t.preventDefault(),t.stopPropagation())})),l.up.on("touchstart.touchspin",(function(t){l.up.off("mousedown.touchspin"),f.is(":disabled")||(y(),I(),t.preventDefault(),t.stopPropagation())})),l.up.on("mouseout touchleave touchend touchcancel",(function(t){g&&(t.stopPropagation(),k())})),l.down.on("mouseout touchleave touchend touchcancel",(function(t){g&&(t.stopPropagation(),k())})),l.down.on("mousemove touchmove",(function(t){g&&(t.stopPropagation(),t.preventDefault())})),l.up.on("mousemove touchmove",(function(t){g&&(t.stopPropagation(),t.preventDefault())})),t(document).on(i(["mouseup","touchend","touchcancel"],e).join(" "),(function(t){g&&(t.preventDefault(),k())})),t(document).on(i(["mousemove","touchmove","scroll","scrollstart"],e).join(" "),(function(t){g&&(t.preventDefault(),k())})),f.on("mousewheel DOMMouseScroll",(function(t){if(r.mousewheel&&f.is(":focus")){var e=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail;t.stopPropagation(),t.preventDefault(),e<0?x():y()}})),f.on("touchspin.uponce",(function(){k(),y()})),f.on("touchspin.downonce",(function(){k(),x()})),f.on("touchspin.startupspin",(function(){I()})),f.on("touchspin.startdownspin",(function(){$()})),f.on("touchspin.stopspin",(function(){k()})),f.on("touchspin.updatesettings",(function(e,i){!function(e){(function(e){r=t.extend({},r,e)})(e),b();var i=l.input.val();""!==i&&(i=Number(l.input.val()),l.input.val(i.toFixed(r.decimals)))}(i)})),l.input.css("display","block");var c}()}))}this.each((function(){var e=t(this).data();t(document).off(i(["mouseup","touchend","touchcancel","mousemove","touchmove","scroll","scrollstart"],e.spinnerid).join(" "))}))}}(jQuery); \ No newline at end of file +function(t,e){void 0===t&&void 0!==window&&(t=window),"function"==typeof define&&define.amd?define(["jquery"],(function(t){return e(t)})):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(t.jQuery)}(this,(function(t){!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],i=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],n={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},s=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,o=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function r(e,n){var r=e.nodeName.toLowerCase();if(-1!==t.inArray(r,n))return-1===t.inArray(r,i)||Boolean(e.nodeValue.match(s)||e.nodeValue.match(o));for(var a=t(n).filter((function(t,e){return e instanceof RegExp})),l=0,c=a.length;l1?arguments[1]:void 0,r=o?Number(o):0;r!=r&&(r=0);var a=Math.min(Math.max(r,0),i);if(s+a>i)return!1;for(var l=-1;++l]+>/g,"")),n&&(l=T(l)),l=l.toUpperCase(),o="contains"===i?l.indexOf(e)>=0:l.startsWith(e)))break}return o}function x(t){return parseInt(t,10)||0}t.fn.triggerNative=function(t){var e,i=this[0];i.dispatchEvent?(w?e=new Event(t,{bubbles:!0}):(e=document.createEvent("Event")).initEvent(t,!0,!1),i.dispatchEvent(e)):i.fireEvent?((e=document.createEventObject()).eventType=t,i.fireEvent("on"+t,e)):this.trigger(t)};var $={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},I=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,k=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function C(t){return $[t]}function T(t){return(t=t.toString())&&t.replace(I,C).replace(k,"")}var E,S,O,N,A,D=(E={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},S=function(t){return E[t]},O="(?:"+Object.keys(E).join("|")+")",N=RegExp(O),A=RegExp(O,"g"),function(t){return t=null==t?"":""+t,N.test(t)?t.replace(A,S):t}),L={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},z=27,H=13,R=32,P=9,U=38,W=40,B={success:!1,major:"3"};try{B.full=(t.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),B.major=B.full[0],B.success=!0}catch(t){}var j=0,M=".bs.select",_={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},F={MENU:"."+_.MENU},V={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};V.noResults=V.li.cloneNode(!1),V.noResults.className="no-results",V.a.setAttribute("role","option"),V.a.className="dropdown-item",V.subtext.className="text-muted",V.text=V.span.cloneNode(!1),V.text.className="text",V.checkMark=V.span.cloneNode(!1);var q=new RegExp(U+"|"+W),G=new RegExp("^"+P+"$|"+z),Q={li:function(t,e,i){var n=V.li.cloneNode(!1);return t&&(1===t.nodeType||11===t.nodeType?n.appendChild(t):n.innerHTML=t),void 0!==e&&""!==e&&(n.className=e),null!=i&&n.classList.add("optgroup-"+i),n},a:function(t,e,i){var n=V.a.cloneNode(!0);return t&&(11===t.nodeType?n.appendChild(t):n.insertAdjacentHTML("beforeend",t)),void 0!==e&&""!==e&&n.classList.add.apply(n.classList,e.split(/\s+/)),i&&n.setAttribute("style",i),n},text:function(t,e){var i,n,s=V.text.cloneNode(!1);if(t.content)s.innerHTML=t.content;else{if(s.textContent=t.text,t.icon){var o=V.whitespace.cloneNode(!1);(n=(!0===e?V.i:V.span).cloneNode(!1)).className=this.options.iconBase+" "+t.icon,V.fragment.appendChild(n),V.fragment.appendChild(o)}t.subtext&&((i=V.subtext.cloneNode(!1)).textContent=t.subtext,s.appendChild(i))}if(!0===e)for(;s.childNodes.length>0;)V.fragment.appendChild(s.childNodes[0]);else V.fragment.appendChild(s);return V.fragment},label:function(t){var e,i,n=V.text.cloneNode(!1);if(n.innerHTML=t.display,t.icon){var s=V.whitespace.cloneNode(!1);(i=V.span.cloneNode(!1)).className=this.options.iconBase+" "+t.icon,V.fragment.appendChild(i),V.fragment.appendChild(s)}return t.subtext&&((e=V.subtext.cloneNode(!1)).textContent=t.subtext,n.appendChild(e)),V.fragment.appendChild(n),V.fragment}};function K(t,e){t.length||(V.noResults.innerHTML=this.options.noneResultsText.replace("{0}",'"'+D(e)+'"'),this.$menuInner[0].firstChild.appendChild(V.noResults))}var Y=function(e,i){var n=this;g.useDefault||(t.valHooks.select.set=g._set,g.useDefault=!0),this.$element=t(e),this.$newElement=null,this.$button=null,this.$menu=null,this.options=i,this.selectpicker={main:{},search:{},current:{},view:{},isSearching:!1,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){n.selectpicker.keydown.keyHistory=""}),800)}}}},this.sizeInfo={},null===this.options.title&&(this.options.title=this.$element.attr("title"));var s=this.options.windowPadding;"number"==typeof s&&(this.options.windowPadding=[s,s,s,s]),this.val=Y.prototype.val,this.render=Y.prototype.render,this.refresh=Y.prototype.refresh,this.setStyle=Y.prototype.setStyle,this.selectAll=Y.prototype.selectAll,this.deselectAll=Y.prototype.deselectAll,this.destroy=Y.prototype.destroy,this.remove=Y.prototype.remove,this.show=Y.prototype.show,this.hide=Y.prototype.hide,this.init()};function J(i){var n,s=arguments,o=i;if([].shift.apply(s),!B.success){try{B.full=(t.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split(".")}catch(t){Y.BootstrapVersion?B.full=Y.BootstrapVersion.split(" ")[0].split("."):(B.full=[B.major,"0","0"],console.warn("There was an issue retrieving Bootstrap's version. Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.",t))}B.major=B.full[0],B.success=!0}if("4"===B.major){var r=[];Y.DEFAULTS.style===_.BUTTONCLASS&&r.push({name:"style",className:"BUTTONCLASS"}),Y.DEFAULTS.iconBase===_.ICONBASE&&r.push({name:"iconBase",className:"ICONBASE"}),Y.DEFAULTS.tickIcon===_.TICKICON&&r.push({name:"tickIcon",className:"TICKICON"}),_.DIVIDER="dropdown-divider",_.SHOW="show",_.BUTTONCLASS="btn-light",_.POPOVERHEADER="popover-header",_.ICONBASE="",_.TICKICON="bs-ok-default";for(var a=0;a'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:n},Y.prototype={constructor:Y,init:function(){var t=this,e=this.$element.attr("id"),i=this.$element[0],n=i.form;j++,this.selectId="bs-select-"+j,i.classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),i.classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.buildData(),this.$element.after(this.$newElement).prependTo(this.$newElement),n&&null===i.form&&(n.id||(n.id="form-"+this.selectId),i.setAttribute("form",n.id)),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(F.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),i.classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(_.MENURIGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+M,(function(){if(t.isVirtual()){var e=t.$menuInner[0],i=e.firstChild.cloneNode(!1);e.replaceChild(i,e.firstChild),e.scrollTop=0}})),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){t.$element.trigger("hide"+M,e)},"hidden.bs.dropdown":function(e){t.$element.trigger("hidden"+M,e)},"show.bs.dropdown":function(e){t.$element.trigger("show"+M,e)},"shown.bs.dropdown":function(e){t.$element.trigger("shown"+M,e)}}),i.hasAttribute("required")&&this.$element.on("invalid"+M,(function(){t.$button[0].classList.add("bs-invalid"),t.$element.on("shown"+M+".invalid",(function(){t.$element.val(t.$element.val()).off("shown"+M+".invalid")})).on("rendered"+M,(function(){this.validity.valid&&t.$button[0].classList.remove("bs-invalid"),t.$element.off("rendered"+M)})),t.$button.on("blur"+M,(function(){t.$element.trigger("focus").trigger("blur"),t.$button.off("blur"+M)}))})),setTimeout((function(){t.buildList(),t.$element.trigger("loaded"+M)}))},createDropdown:function(){var e=this.multiple||this.options.showTick?" show-tick":"",i=this.multiple?' aria-multiselectable="true"':"",n="",s=this.autofocus?" autofocus":"";B.major<4&&this.$element.parent().hasClass("input-group")&&(n=" input-group-btn");var o,r="",a="",l="",c="";return this.options.header&&(r='
'+this.options.header+"
"),this.options.liveSearch&&(a=''),this.multiple&&this.options.actionsBox&&(l='
"),this.multiple&&this.options.doneButton&&(c='
"),o='",t(o)},setPositionData:function(){this.selectpicker.view.canHighlight=[],this.selectpicker.view.size=0,this.selectpicker.view.firstHighlightIndex=!1;for(var t=0;t=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(e,i,n){var s,o,r=this,l=0,c=[];if(this.selectpicker.isSearching=e,this.selectpicker.current=e?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),i)if(n)l=this.$menuInner[0].scrollTop;else if(!r.multiple){var d=r.$element[0],p=(d.options[d.selectedIndex]||{}).liIndex;if("number"==typeof p&&!1!==r.options.size){var h=r.selectpicker.main.data[p],u=h&&h.position;u&&(l=u-(r.sizeInfo.menuInnerHeight+r.sizeInfo.liHeight)/2)}}function f(t,i){var n,l,d,p,h,u,f,m,v,g,b=r.selectpicker.current.elements.length,w=[],y=!0,x=r.isVirtual();r.selectpicker.view.scrollTop=t,n=Math.ceil(r.sizeInfo.menuInnerHeight/r.sizeInfo.liHeight*1.5),l=Math.round(b/n)||1;for(var $=0;$b-1?0:r.selectpicker.current.data[b-1].position-r.selectpicker.current.data[r.selectpicker.view.position1-1].position,T.firstChild.style.marginTop=k+"px",T.firstChild.style.marginBottom=C+"px"):(T.firstChild.style.marginTop=0,T.firstChild.style.marginBottom=0),T.firstChild.appendChild(E),!0===x&&r.sizeInfo.hasScrollBar){var H=T.firstChild.offsetWidth;if(i&&Hr.sizeInfo.selectWidth)T.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px";else if(H>r.sizeInfo.menuInnerInnerWidth){r.$menu[0].style.minWidth=0;var R=T.firstChild.offsetWidth;R>r.sizeInfo.menuInnerInnerWidth&&(r.sizeInfo.menuInnerInnerWidth=R,T.firstChild.style.minWidth=r.sizeInfo.menuInnerInnerWidth+"px"),r.$menu[0].style.minWidth=""}}}if(r.prevActiveIndex=r.activeIndex,r.options.liveSearch){if(e&&i){var P,U=0;r.selectpicker.view.canHighlight[U]||(U=1+r.selectpicker.view.canHighlight.slice(1).indexOf(!0)),P=r.selectpicker.view.visibleElements[U],r.defocusItem(r.selectpicker.view.currentActive),r.activeIndex=(r.selectpicker.current.data[U]||{}).index,r.focusItem(P)}}else r.$menuInner.trigger("focus")}f(l,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",(function(t,e){r.noScroll||f(this.scrollTop,e),r.noScroll=!1})),t(window).off("resize"+M+"."+this.selectId+".createView").on("resize"+M+"."+this.selectId+".createView",(function(){r.$newElement.hasClass(_.SHOW)&&f(r.$menuInner[0].scrollTop)}))},focusItem:function(t,e,i){if(t){e=e||this.selectpicker.main.data[this.activeIndex];var n=t.firstChild;n&&(n.setAttribute("aria-setsize",this.selectpicker.view.size),n.setAttribute("aria-posinset",e.posinset),!0!==i&&(this.focusedParent.setAttribute("aria-activedescendant",n.id),t.classList.add("active"),n.classList.add("active")))}},defocusItem:function(t){t&&(t.classList.remove("active"),t.firstChild&&t.firstChild.classList.remove("active"))},setPlaceholder:function(){var t=this,e=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),e=!0;var i=this.$element[0],n=!1,s=!this.selectpicker.view.titleOption.parentNode,o=i.selectedIndex,r=i.options[o],a=window.performance&&window.performance.getEntriesByType("navigation"),l=a&&a.length?"back_forward"!==a[0].type:2!==window.performance.navigation.type;s&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",n=!r||0===o&&!1===r.defaultSelected&&void 0===this.$element.data("selected")),(s||0!==this.selectpicker.view.titleOption.index)&&i.insertBefore(this.selectpicker.view.titleOption,i.firstChild),n&&l?i.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){t.selectpicker.view.displayedValue!==i.value&&t.render()}))}return e},buildData:function(){var t=':not([hidden]):not([data-hidden="true"])',e=[],i=0,n=this.setPlaceholder()?1:0;this.options.hideDisabled&&(t+=":not(:disabled)");var s=this.$element[0].querySelectorAll("select > *"+t);function o(t){var i=e[e.length-1];i&&"divider"===i.type&&(i.optID||t.optID)||((t=t||{}).type="divider",e.push(t))}function r(t,i){if((i=i||{}).divider="true"===t.getAttribute("data-divider"),i.divider)o({optID:i.optID});else{var n=e.length,s=t.style.cssText,r=s?D(s):"",a=(t.className||"")+(i.optgroupClass||"");i.optID&&(a="opt "+a),i.optionClass=a.trim(),i.inlineStyle=r,i.text=t.textContent,i.content=t.getAttribute("data-content"),i.tokens=t.getAttribute("data-tokens"),i.subtext=t.getAttribute("data-subtext"),i.icon=t.getAttribute("data-icon"),t.liIndex=n,i.display=i.content||i.text,i.type="option",i.index=n,i.option=t,i.selected=!!t.selected,i.disabled=i.disabled||!!t.disabled,e.push(i)}}function a(s,a){var l=a[s],c=!(s-1n&&(n=o,t.selectpicker.view.widestOption=i[i.length-1])}!t.options.showTick&&!t.multiple||V.checkMark.parentNode||(V.checkMark.className=this.options.iconBase+" "+t.options.tickIcon+" check-mark",V.a.appendChild(V.checkMark));for(var o=e.length,r=0;r li")},render:function(){var t,e,i=this,n=this.$element[0],s=this.setPlaceholder()&&0===n.selectedIndex,o=m(n,this.options.hideDisabled),r=o.length,l=this.$button[0],c=l.querySelector(".filter-option-inner-inner"),d=document.createTextNode(this.options.multipleSeparator),p=V.fragment.cloneNode(!1),h=!1;if(l.classList.toggle("bs-placeholder",i.multiple?!r:!v(n,o)),i.multiple||1!==o.length||(i.selectpicker.view.displayedValue=v(n,o)),"static"===this.options.selectedTextFormat)p=Q.text.call(this,{text:this.options.title},!0);else if((t=this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&r>1)&&(t=(e=this.options.selectedTextFormat.split(">")).length>1&&r>e[1]||1===e.length&&r>=2),!1===t){if(!s){for(var u=0;u0&&p.appendChild(d.cloneNode(!1)),f.title?b.text=f.title:g&&(g.content&&i.options.showContent?(b.content=g.content.toString(),h=!0):(i.options.showIcon&&(b.icon=g.icon),i.options.showSubtext&&!i.multiple&&g.subtext&&(b.subtext=" "+g.subtext),b.text=f.textContent.trim())),p.appendChild(Q.text.call(this,b,!0))}r>49&&p.appendChild(document.createTextNode("..."))}}else{var w=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';this.options.hideDisabled&&(w+=":not(:disabled)");var y=this.$element[0].querySelectorAll("select > option"+w+", optgroup"+w+" option"+w).length,x="function"==typeof this.options.countSelectedText?this.options.countSelectedText(r,y):this.options.countSelectedText;p=Q.text.call(this,{text:x.replace("{0}",r.toString()).replace("{1}",y.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),p.childNodes.length||(p=Q.text.call(this,{text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),l.title=p.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&h&&a([p],i.options.whiteList,i.options.sanitizeFn),c.innerHTML="",c.appendChild(p),B.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var $=l.querySelector(".filter-expand"),I=c.cloneNode(!0);I.className="filter-expand",$?l.replaceChild(I,$):l.appendChild(I)}this.$element.trigger("rendered"+M)},setStyle:function(t,e){var i,n=this.$button[0],s=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),B.major<4&&(s.classList.add("bs3"),s.parentNode.classList&&s.parentNode.classList.contains("input-group")&&(s.previousElementSibling||s.nextElementSibling)&&(s.previousElementSibling||s.nextElementSibling).classList.contains("input-group-addon")&&s.classList.add("bs3-has-addon")),i=t?t.trim():o,"add"==e?i&&n.classList.add.apply(n.classList,i.split(" ")):"remove"==e?i&&n.classList.remove.apply(n.classList,i.split(" ")):(o&&n.classList.remove.apply(n.classList,o.split(" ")),i&&n.classList.add.apply(n.classList,i.split(" ")))},liHeight:function(e){if(e||!1!==this.options.size&&!Object.keys(this.sizeInfo).length){var i,n=V.div.cloneNode(!1),s=V.div.cloneNode(!1),o=V.div.cloneNode(!1),r=document.createElement("ul"),a=V.li.cloneNode(!1),l=V.li.cloneNode(!1),c=V.a.cloneNode(!1),d=V.span.cloneNode(!1),p=this.options.header&&this.$menu.find("."+_.POPOVERHEADER).length>0?this.$menu.find("."+_.POPOVERHEADER)[0].cloneNode(!0):null,h=this.options.liveSearch?V.div.cloneNode(!1):null,u=this.options.actionsBox&&this.multiple&&this.$menu.find(".bs-actionsbox").length>0?this.$menu.find(".bs-actionsbox")[0].cloneNode(!0):null,f=this.options.doneButton&&this.multiple&&this.$menu.find(".bs-donebutton").length>0?this.$menu.find(".bs-donebutton")[0].cloneNode(!0):null,m=this.$element.find("option")[0];if(this.sizeInfo.selectWidth=this.$newElement[0].offsetWidth,d.className="text",c.className="dropdown-item "+(m?m.className:""),n.className=this.$menu[0].parentNode.className+" "+_.SHOW,n.style.width=0,"auto"===this.options.width&&(s.style.minWidth=0),s.className=_.MENU+" "+_.SHOW,o.className="inner "+_.SHOW,r.className=_.MENU+" inner "+("4"===B.major?_.SHOW:""),a.className=_.DIVIDER,l.className="dropdown-header",d.appendChild(document.createTextNode("​")),this.selectpicker.current.data.length)for(var v=0;vthis.sizeInfo.menuExtras.vert&&a+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot,!0===this.selectpicker.isSearching&&(l=this.selectpicker.dropup),this.$newElement.toggleClass(_.DROPUP,l),this.selectpicker.dropup=l),"auto"===this.options.size)s=this.selectpicker.current.elements.length>3?3*this.sizeInfo.liHeight+this.sizeInfo.menuExtras.vert-2:0,i=this.sizeInfo.selectOffsetBot-this.sizeInfo.menuExtras.vert,n=s+p+h+u+f,r=Math.max(s-v.vert,0),this.$newElement.hasClass(_.DROPUP)&&(i=this.sizeInfo.selectOffsetTop-this.sizeInfo.menuExtras.vert),o=i,e=i-p-h-u-f-v.vert;else if(this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size){for(var b=0;bthis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(_.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&n.off("resize"+M+"."+this.selectId+".setMenuSize scroll"+M+"."+this.selectId+".setMenuSize")}this.createView(!1,!0,e)},setWidth:function(){var t=this;"auto"===this.options.width?requestAnimationFrame((function(){t.$menu.css("min-width","0"),t.$element.on("loaded"+M,(function(){t.liHeight(),t.setMenuSize();var e=t.$newElement.clone().appendTo("body"),i=e.css("width","auto").children("button").outerWidth();e.remove(),t.sizeInfo.selectWidth=Math.max(t.sizeInfo.totalMenuWidth,i),t.$newElement.css("width",t.sizeInfo.selectWidth+"px")}))})):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=t('
');var e,i,n,s=this,o=t(this.options.container),r=function(r){var a={},l=s.options.display||!!t.fn.dropdown.Constructor.Default&&t.fn.dropdown.Constructor.Default.display;s.$bsContainer.addClass(r.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(_.DROPUP,r.hasClass(_.DROPUP)),e=r.offset(),o.is("body")?i={top:0,left:0}:((i=o.offset()).top+=parseInt(o.css("borderTopWidth"))-o.scrollTop(),i.left+=parseInt(o.css("borderLeftWidth"))-o.scrollLeft()),n=r.hasClass(_.DROPUP)?0:r[0].offsetHeight,(B.major<4||"static"===l)&&(a.top=e.top-i.top+n,a.left=e.left-i.left),a.width=r[0].offsetWidth,s.$bsContainer.css(a)};this.$button.on("click.bs.dropdown.data-api",(function(){s.isDisabled()||(r(s.$newElement),s.$bsContainer.appendTo(s.options.container).toggleClass(_.SHOW,!s.$button.hasClass(_.SHOW)).append(s.$menu))})),t(window).off("resize"+M+"."+this.selectId+" scroll"+M+"."+this.selectId).on("resize"+M+"."+this.selectId+" scroll"+M+"."+this.selectId,(function(){s.$newElement.hasClass(_.SHOW)&&r(s.$newElement)})),this.$element.on("hide"+M,(function(){s.$menu.data("height",s.$menu.height()),s.$bsContainer.detach()}))},setOptionStatus:function(t){var e=this;if(e.noScroll=!1,e.selectpicker.view.visibleElements&&e.selectpicker.view.visibleElements.length)for(var i=0;i3&&!e.dropdown&&(e.dropdown=e.$button.data("bs.dropdown"),e.dropdown._menu=e.$menu[0])})),this.$button.on("click.bs.dropdown.data-api",(function(){e.$newElement.hasClass(_.SHOW)||e.setSize()})),this.$element.on("shown"+M,(function(){e.$menuInner[0].scrollTop!==e.selectpicker.view.scrollTop&&(e.$menuInner[0].scrollTop=e.selectpicker.view.scrollTop),B.major>3?requestAnimationFrame(s):n()})),this.$menuInner.on("mouseenter","li a",(function(t){var i=this.parentElement,n=e.isVirtual()?e.selectpicker.view.position0:0,s=Array.prototype.indexOf.call(i.parentElement.children,i),o=e.selectpicker.current.data[s+n];e.focusItem(i,o,!0)})),this.$menuInner.on("click","li a",(function(i,n){var s=t(this),o=e.$element[0],r=e.isVirtual()?e.selectpicker.view.position0:0,a=e.selectpicker.current.data[s.parent().index()+r],l=a.index,c=v(o),d=o.selectedIndex,p=o.options[d],h=!0;if(e.multiple&&1!==e.options.maxOptions&&i.stopPropagation(),i.preventDefault(),!e.isDisabled()&&!s.parent().hasClass(_.DISABLED)){var u=a.option,f=t(u),g=u.selected,w=f.parent("optgroup"),y=w.find("option"),x=e.options.maxOptions,$=w.data("maxOptions")||!1;if(l===e.activeIndex&&(n=!0),n||(e.prevActiveIndex=e.activeIndex,e.activeIndex=void 0),e.multiple){if(u.selected=!g,e.setSelected(l,!g),e.focusedParent.focus(),!1!==x||!1!==$){var I=x
');S[2]&&(O=O.replace("{var}",S[2][x>1?0:1]),N=N.replace("{var}",S[2][$>1?0:1])),u.selected=!1,e.$menu.append(A),x&&I&&(A.append(t("
"+O+"
")),h=!1,e.$element.trigger("maxReached"+M)),$&&k&&(A.append(t("
"+N+"
")),h=!1,e.$element.trigger("maxReachedGrp"+M)),setTimeout((function(){e.setSelected(l,!1)}),10),A[0].classList.add("fadeOut"),setTimeout((function(){A.remove()}),1050)}}}else p&&(p.selected=!1),u.selected=!0,e.setSelected(l,!0);!e.multiple||e.multiple&&1===e.options.maxOptions?e.$button.trigger("focus"):e.options.liveSearch&&e.$searchbox.trigger("focus"),h&&(e.multiple||d!==o.selectedIndex)&&(b=[u.index,f.prop("selected"),c],e.$element.triggerNative("change"))}})),this.$menu.on("click","li."+_.DISABLED+" a, ."+_.POPOVERHEADER+", ."+_.POPOVERHEADER+" :not(.close)",(function(i){i.currentTarget==this&&(i.preventDefault(),i.stopPropagation(),e.options.liveSearch&&!t(i.target).hasClass("close")?e.$searchbox.trigger("focus"):e.$button.trigger("focus"))})),this.$menuInner.on("click",".divider, .dropdown-header",(function(t){t.preventDefault(),t.stopPropagation(),e.options.liveSearch?e.$searchbox.trigger("focus"):e.$button.trigger("focus")})),this.$menu.on("click","."+_.POPOVERHEADER+" .close",(function(){e.$button.trigger("click")})),this.$searchbox.on("click",(function(t){t.stopPropagation()})),this.$menu.on("click",".actions-btn",(function(i){e.options.liveSearch?e.$searchbox.trigger("focus"):e.$button.trigger("focus"),i.preventDefault(),i.stopPropagation(),t(this).hasClass("bs-select-all")?e.selectAll():e.deselectAll()})),this.$button.on("focus"+M,(function(t){var i=e.$element[0].getAttribute("tabindex");void 0!==i&&t.originalEvent&&t.originalEvent.isTrusted&&(this.setAttribute("tabindex",i),e.$element[0].setAttribute("tabindex",-1),e.selectpicker.view.tabindex=i)})).on("blur"+M,(function(t){void 0!==e.selectpicker.view.tabindex&&t.originalEvent&&t.originalEvent.isTrusted&&(e.$element[0].setAttribute("tabindex",e.selectpicker.view.tabindex),this.setAttribute("tabindex",-1),e.selectpicker.view.tabindex=void 0)})),this.$element.on("change"+M,(function(){e.render(),e.$element.trigger("changed"+M,b),b=null})).on("focus"+M,(function(){e.options.mobile||e.$button[0].focus()}))},liveSearchListener:function(){var t=this;this.$button.on("click.bs.dropdown.data-api",(function(){t.$searchbox.val()&&(t.$searchbox.val(""),t.selectpicker.search.previousValue=void 0)})),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(t){t.stopPropagation()})),this.$searchbox.on("input propertychange",(function(){var e=t.$searchbox[0].value;if(t.selectpicker.search.elements=[],t.selectpicker.search.data=[],e){var i=[],n=e.toUpperCase(),s={},o=[],r=t._searchStyle(),a=t.options.liveSearchNormalize;a&&(n=T(n));for(var l=0;l0&&(s[c.headerIndex-1]=!0,o.push(c.headerIndex-1)),s[c.headerIndex]=!0,o.push(c.headerIndex),s[c.lastIndex+1]=!0),s[l]&&"optgroup-label"!==c.type&&o.push(l)}l=0;for(var d=o.length;l=112&&e.which<=123))if(!(n=c.$newElement.hasClass(_.SHOW))&&(u||e.which>=48&&e.which<=57||e.which>=96&&e.which<=105||e.which>=65&&e.which<=90)&&(c.$button.trigger("click.bs.dropdown.data-api"),c.options.liveSearch))c.$searchbox.trigger("focus");else{if(e.which===z&&n&&(e.preventDefault(),c.$button.trigger("click.bs.dropdown.data-api").trigger("focus")),u){if(!d.length)return;-1!==(i=(s=c.selectpicker.main.elements[c.activeIndex])?Array.prototype.indexOf.call(s.parentElement.children,s):-1)&&c.defocusItem(s),e.which===U?(-1!==i&&i--,i+m<0&&(i+=d.length),c.selectpicker.view.canHighlight[i+m]||-1===(i=c.selectpicker.view.canHighlight.slice(0,i+m).lastIndexOf(!0)-m)&&(i=d.length-1)):(e.which===W||h)&&(++i+m>=c.selectpicker.view.canHighlight.length&&(i=c.selectpicker.view.firstHighlightIndex),c.selectpicker.view.canHighlight[i+m]||(i=i+1+c.selectpicker.view.canHighlight.slice(i+m+1).indexOf(!0))),e.preventDefault();var v=m+i;e.which===U?0===m&&i===d.length-1?(c.$menuInner[0].scrollTop=c.$menuInner[0].scrollHeight,v=c.selectpicker.current.elements.length-1):p=(r=(o=c.selectpicker.current.data[v]).position-o.height)f),s=c.selectpicker.current.elements[v],c.activeIndex=c.selectpicker.current.data[v].index,c.focusItem(s),c.selectpicker.view.currentActive=s,p&&(c.$menuInner[0].scrollTop=r),c.options.liveSearch?c.$searchbox.trigger("focus"):a.trigger("focus")}else if(!a.is("input")&&!G.test(e.which)||e.which===R&&c.selectpicker.keydown.keyHistory){var g,b,w=[];e.preventDefault(),c.selectpicker.keydown.keyHistory+=L[e.which],c.selectpicker.keydown.resetKeyHistory.cancel&&clearTimeout(c.selectpicker.keydown.resetKeyHistory.cancel),c.selectpicker.keydown.resetKeyHistory.cancel=c.selectpicker.keydown.resetKeyHistory.start(),b=c.selectpicker.keydown.keyHistory,/^(.)\1+$/.test(b)&&(b=b.charAt(0));for(var x=0;x0?(r=o.position-o.height,p=!0):(r=o.position-c.sizeInfo.menuInnerHeight,p=o.position>f+c.sizeInfo.menuInnerHeight),s=c.selectpicker.main.elements[g],c.activeIndex=w[I],c.focusItem(s),s&&s.firstChild.focus(),p&&(c.$menuInner[0].scrollTop=r),a.trigger("focus")}}n&&(e.which===R&&!c.selectpicker.keydown.keyHistory||e.which===H||e.which===P&&c.options.selectOnTab)&&(e.which!==R&&e.preventDefault(),c.options.liveSearch&&e.which===R||(c.$menuInner.find(".active a").trigger("click",!0),a.trigger("focus"),c.options.liveSearch||(e.preventDefault(),t(document).data("spaceSelect",!0))))}},mobile:function(){this.options.mobile=!0,this.$element[0].classList.add("mobile-device")},refresh:function(){var e=t.extend({},this.options,this.$element.data());this.options=e,this.checkDisabled(),this.buildData(),this.setStyle(),this.render(),this.buildList(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+M)},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.selectpicker.view.titleOption&&this.selectpicker.view.titleOption.parentNode&&this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption),this.$element.off(M).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),t(window).off(M+"."+this.selectId)}};var Z=t.fn.selectpicker;function X(){if(t.fn.dropdown)return(t.fn.dropdown.Constructor._dataApiKeydownHandler||t.fn.dropdown.Constructor.prototype.keydown).apply(this,arguments)}t.fn.selectpicker=J,t.fn.selectpicker.Constructor=Y,t.fn.selectpicker.noConflict=function(){return t.fn.selectpicker=Z,this},t(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api",':not(.bootstrap-select) > [data-toggle="dropdown"]',X).on("keydown.bs.dropdown.data-api",":not(.bootstrap-select) > .dropdown-menu",X).on("keydown"+M,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',Y.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',(function(t){t.stopPropagation()})),t(window).on("load"+M+".data-api",(function(){t(".selectpicker").each((function(){var e=t(this);J.call(e,e.data())}))}))}(t)})),function(t){"use strict";var e=0;function i(e,i){return t.map(e,(function(t){return function(t,e){return t+".touchspin_"+e}(t,i)}))}t.fn.TouchSpin=function(n){if("destroy"!==n){var s={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalupclass:"glyphicon glyphicon-chevron-up",verticaldownclass:"glyphicon glyphicon-chevron-down",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn btn-default",buttonup_class:"btn btn-default",buttondown_txt:"-",buttonup_txt:"+"},o={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each((function(){var r,a,l,c,d,p,h,u,f=t(this),m=f.data(),v=0,g=!1;function b(){var t,e,i;""!==(t=f.val())?r.decimals>0&&"."===t||(e=parseFloat(t),isNaN(e)&&(e=""!==r.replacementval?r.replacementval:0),i=e,e.toString()!==t&&(i=e),er.max&&(i=r.max),i=function(t){switch(r.forcestepdivisibility){case"round":return(Math.round(t/r.step)*r.step).toFixed(r.decimals);case"floor":return(Math.floor(t/r.step)*r.step).toFixed(r.decimals);case"ceil":return(Math.ceil(t/r.step)*r.step).toFixed(r.decimals);default:return t}}(i),Number(t).toString()!==i.toString()&&(f.val(i),f.trigger("change"))):""!==r.replacementval&&(f.val(r.replacementval),f.trigger("change"))}function w(){if(r.booster){var t=Math.pow(2,Math.floor(v/r.boostat))*r.step;return r.maxboostedstep&&t>r.maxboostedstep&&(t=r.maxboostedstep,c=Math.round(c/t)*t),Math.max(r.step,t)}return r.step}function y(){b(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var t=c,e=w();(c+=e)>r.max&&(c=r.max,f.trigger("touchspin.on.max"),k()),l.input.val(Number(c).toFixed(r.decimals)),t!==c&&f.trigger("change")}function x(){b(),c=parseFloat(l.input.val()),isNaN(c)&&(c=0);var t=c,e=w();(c-=e)'+r.prefix+"",c=''+r.postfix+"";s.hasClass("input-group-btn")?(i='",s.append(i)):(i='",t(i).insertBefore(f));o.hasClass("input-group-btn")?(n='",o.prepend(n)):(n='",t(n).insertAfter(f));t(l).insertBefore(f),t(c).insertAfter(f),a=e}(i):function(){var e;e=r.verticalbuttons?'
'+r.prefix+''+r.postfix+'
':'
'+r.prefix+''+r.postfix+'
";a=t(e).insertBefore(f),t(".bootstrap-touchspin-prefix",a).after(f),f.hasClass("input-sm")?a.addClass("input-group-sm"):f.hasClass("input-lg")&&a.addClass("input-group-lg")}()}(),l={down:t(".bootstrap-touchspin-down",a),up:t(".bootstrap-touchspin-up",a),input:t("input",a),prefix:t(".bootstrap-touchspin-prefix",a).addClass(r.prefix_extraclass),postfix:t(".bootstrap-touchspin-postfix",a).addClass(r.postfix_extraclass)},function(){""===r.prefix&&l.prefix.hide();""===r.postfix&&l.postfix.hide()}(),f.on("keydown",(function(t){var e=t.keyCode||t.which;38===e?("up"!==g&&(y(),I()),t.preventDefault()):40===e&&("down"!==g&&(x(),$()),t.preventDefault())})),f.on("keyup",(function(t){var e=t.keyCode||t.which;(38===e||40===e)&&k()})),f.on("blur",(function(){b()})),l.down.on("keydown",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||("down"!==g&&(x(),$()),t.preventDefault())})),l.down.on("keyup",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||k()})),l.up.on("keydown",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||("up"!==g&&(y(),I()),t.preventDefault())})),l.up.on("keyup",(function(t){var e=t.keyCode||t.which;32!==e&&13!==e||k()})),l.down.on("mousedown.touchspin",(function(t){l.down.off("touchstart.touchspin"),f.is(":disabled")||(x(),$(),t.preventDefault(),t.stopPropagation())})),l.down.on("touchstart.touchspin",(function(t){l.down.off("mousedown.touchspin"),f.is(":disabled")||(x(),$(),t.preventDefault(),t.stopPropagation())})),l.up.on("mousedown.touchspin",(function(t){l.up.off("touchstart.touchspin"),f.is(":disabled")||(y(),I(),t.preventDefault(),t.stopPropagation())})),l.up.on("touchstart.touchspin",(function(t){l.up.off("mousedown.touchspin"),f.is(":disabled")||(y(),I(),t.preventDefault(),t.stopPropagation())})),l.up.on("mouseout touchleave touchend touchcancel",(function(t){g&&(t.stopPropagation(),k())})),l.down.on("mouseout touchleave touchend touchcancel",(function(t){g&&(t.stopPropagation(),k())})),l.down.on("mousemove touchmove",(function(t){g&&(t.stopPropagation(),t.preventDefault())})),l.up.on("mousemove touchmove",(function(t){g&&(t.stopPropagation(),t.preventDefault())})),t(document).on(i(["mouseup","touchend","touchcancel"],e).join(" "),(function(t){g&&(t.preventDefault(),k())})),t(document).on(i(["mousemove","touchmove","scroll","scrollstart"],e).join(" "),(function(t){g&&(t.preventDefault(),k())})),f.on("mousewheel DOMMouseScroll",(function(t){if(r.mousewheel&&f.is(":focus")){var e=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail;t.stopPropagation(),t.preventDefault(),e<0?x():y()}})),f.on("touchspin.uponce",(function(){k(),y()})),f.on("touchspin.downonce",(function(){k(),x()})),f.on("touchspin.startupspin",(function(){I()})),f.on("touchspin.startdownspin",(function(){$()})),f.on("touchspin.stopspin",(function(){k()})),f.on("touchspin.updatesettings",(function(e,i){!function(e){(function(e){r=t.extend({},r,e)})(e),b();var i=l.input.val();""!==i&&(i=Number(l.input.val()),l.input.val(i.toFixed(r.decimals)))}(i)})),l.input.css("display","block");var c}()}))}this.each((function(){var e=t(this).data();t(document).off(i(["mouseup","touchend","touchcancel","mousemove","touchmove","scroll","scrollstart"],e.spinnerid).join(" "))}))}}(jQuery); \ No newline at end of file