@basic-genomics/hivtrace-viz 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see hivtrace.js.LICENSE.txt */
2
- !function(){var e={1639:function(e,t,n){"use strict";e.exports=n(9281)},7114:function(e,t,n){"use strict";var r=n(5670),i={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:"0"},defaultClasses:{root:"algolia-autocomplete",prefix:"aa",noPrefix:!1,dropdownMenu:"dropdown-menu",input:"input",hint:"hint",suggestions:"suggestions",suggestion:"suggestion",cursor:"cursor",dataset:"dataset",empty:"empty"},appendTo:{wrapper:{position:"absolute",zIndex:"100",display:"none"},input:{},inputWithNoHint:{},dropdown:{display:"block"}}};r.isMsie()&&r.mixin(i.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),r.isMsie()&&r.isMsie()<=7&&r.mixin(i.input,{marginTop:"-1px"}),e.exports=i},3312:function(e,t,n){"use strict";var r="aaDataset",i="aaValue",o="aaDatum",a=n(5670),s=n(3855),l=n(6619),u=n(7114),c=n(6823);function d(e){var t,n,r,i;(e=e||{}).templates=e.templates||{},e.source||a.error("missing source"),e.name&&(t=e.name,!/^[_a-zA-Z0-9-]+$/.test(t))&&a.error("invalid dataset name: "+e.name),this.query=null,this._isEmpty=!0,this.highlight=!!e.highlight,this.name=void 0===e.name||null===e.name?a.getUniqueId():e.name,this.source=e.source,this.displayFn=(i=(i=e.display||e.displayKey)||"value",a.isFunction(i)?i:function(e){return e[i]}),this.debounce=e.debounce,this.cache=!1!==e.cache,this.templates=(n=e.templates,r=this.displayFn,{empty:n.empty&&a.templatify(n.empty),header:n.header&&a.templatify(n.header),footer:n.footer&&a.templatify(n.footer),suggestion:n.suggestion||function(e){return"<p>"+r(e)+"</p>"}}),this.css=a.mixin({},u,e.appendTo?u.appendTo:{}),this.cssClasses=e.cssClasses=a.mixin({},u.defaultClasses,e.cssClasses||{}),this.cssClasses.prefix=e.cssClasses.formattedPrefix||a.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix);var o=a.className(this.cssClasses.prefix,this.cssClasses.dataset);this.$el=e.$menu&&e.$menu.find(o+"-"+this.name).length>0?s.element(e.$menu.find(o+"-"+this.name)[0]):s.element(l.dataset.replace("%CLASS%",this.name).replace("%PREFIX%",this.cssClasses.prefix).replace("%DATASET%",this.cssClasses.dataset)),this.$menu=e.$menu,this.clearCachedSuggestions()}d.extractDatasetName=function(e){return s.element(e).data(r)},d.extractValue=function(e){return s.element(e).data(i)},d.extractDatum=function(e){var t=s.element(e).data(o);return"string"==typeof t&&(t=JSON.parse(t)),t},a.mixin(d.prototype,c,{_render:function(e,t){if(this.$el){var n,u=this,c=[].slice.call(arguments,2);if(this.$el.empty(),n=t&&t.length,this._isEmpty=!n,!n&&this.templates.empty)this.$el.html(function(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!0}].concat(t),u.templates.empty.apply(this,t)}.apply(this,c)).prepend(u.templates.header?d.apply(this,c):null).append(u.templates.footer?f.apply(this,c):null);else if(n)this.$el.html(function(){var e,n,c=[].slice.call(arguments,0),d=this,f=l.suggestions.replace("%PREFIX%",this.cssClasses.prefix).replace("%SUGGESTIONS%",this.cssClasses.suggestions);return e=s.element(f).css(this.css.suggestions),n=a.map(t,function(e){var t,n=l.suggestion.replace("%PREFIX%",d.cssClasses.prefix).replace("%SUGGESTION%",d.cssClasses.suggestion);return(t=s.element(n).attr({role:"option",id:["option",Math.floor(1e8*Math.random())].join("-")}).append(u.templates.suggestion.apply(this,[e].concat(c)))).data(r,u.name),t.data(i,u.displayFn(e)||void 0),t.data(o,JSON.stringify(e)),t.children().each(function(){s.element(this).css(d.css.suggestionChild)}),t}),e.append.apply(e,n),e}.apply(this,c)).prepend(u.templates.header?d.apply(this,c):null).append(u.templates.footer?f.apply(this,c):null);else if(t&&!Array.isArray(t))throw new TypeError("suggestions must be an array");this.$menu&&this.$menu.addClass(this.cssClasses.prefix+(n?"with":"without")+"-"+this.name).removeClass(this.cssClasses.prefix+(n?"without":"with")+"-"+this.name),this.trigger("rendered",e)}function d(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!n}].concat(t),u.templates.header.apply(this,t)}function f(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!n}].concat(t),u.templates.footer.apply(this,t)}},getRoot:function(){return this.$el},update:function(e){function t(t){if(!this.canceled&&e===this.query){var n=[].slice.call(arguments,1);this.cacheSuggestions(e,t,n),this._render.apply(this,[e,t].concat(n))}}if(this.query=e,this.canceled=!1,this.shouldFetchFromCache(e))t.apply(this,[this.cachedSuggestions].concat(this.cachedRenderExtraArgs));else{var n=this,r=function(){n.canceled||n.source(e,t.bind(n))};this.debounce?(clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(function(){n.debounceTimeout=null,r()},this.debounce)):r()}},cacheSuggestions:function(e,t,n){this.cachedQuery=e,this.cachedSuggestions=t,this.cachedRenderExtraArgs=n},shouldFetchFromCache:function(e){return this.cache&&this.cachedQuery===e&&this.cachedSuggestions&&this.cachedSuggestions.length},clearCachedSuggestions:function(){delete this.cachedQuery,delete this.cachedSuggestions,delete this.cachedRenderExtraArgs},cancel:function(){this.canceled=!0},clear:function(){this.$el&&(this.cancel(),this.$el.empty(),this.trigger("rendered",""))},isEmpty:function(){return this._isEmpty},destroy:function(){this.clearCachedSuggestions(),this.$el=null}}),e.exports=d},5445:function(e,t,n){"use strict";var r=n(5670),i=n(3855),o=n(6823),a=n(3312),s=n(7114);function l(e){var t,n,o,a=this;(e=e||{}).menu||r.error("menu is required"),r.isArray(e.datasets)||r.isObject(e.datasets)||r.error("1 or more datasets required"),e.datasets||r.error("datasets is required"),this.isOpen=!1,this.isEmpty=!0,this.minLength=e.minLength||0,this.templates={},this.appendTo=e.appendTo||!1,this.css=r.mixin({},s,e.appendTo?s.appendTo:{}),this.cssClasses=e.cssClasses=r.mixin({},s.defaultClasses,e.cssClasses||{}),this.cssClasses.prefix=e.cssClasses.formattedPrefix||r.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix),t=r.bind(this._onSuggestionClick,this),n=r.bind(this._onSuggestionMouseEnter,this),o=r.bind(this._onSuggestionMouseLeave,this);var u=r.className(this.cssClasses.prefix,this.cssClasses.suggestion);this.$menu=i.element(e.menu).on("mouseenter.aa",u,n).on("mouseleave.aa",u,o).on("click.aa",u,t),this.$container=e.appendTo?e.wrapper:this.$menu,e.templates&&e.templates.header&&(this.templates.header=r.templatify(e.templates.header),this.$menu.prepend(this.templates.header())),e.templates&&e.templates.empty&&(this.templates.empty=r.templatify(e.templates.empty),this.$empty=i.element('<div class="'+r.className(this.cssClasses.prefix,this.cssClasses.empty,!0)+'"></div>'),this.$menu.append(this.$empty),this.$empty.hide()),this.datasets=r.map(e.datasets,function(t){return function(e,t,n){return new l.Dataset(r.mixin({$menu:e,cssClasses:n},t))}(a.$menu,t,e.cssClasses)}),r.each(this.datasets,function(e){var t=e.getRoot();t&&0===t.parent().length&&a.$menu.append(t),e.onSync("rendered",a._onRendered,a)}),e.templates&&e.templates.footer&&(this.templates.footer=r.templatify(e.templates.footer),this.$menu.append(this.templates.footer()));var c=this;i.element(window).resize(function(){c._redraw()})}r.mixin(l.prototype,o,{_onSuggestionClick:function(e){this.trigger("suggestionClicked",i.element(e.currentTarget))},_onSuggestionMouseEnter:function(e){var t=i.element(e.currentTarget);if(!t.hasClass(r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0))){this._removeCursor();var n=this;setTimeout(function(){n._setCursor(t,!1)},0)}},_onSuggestionMouseLeave:function(e){e.relatedTarget&&i.element(e.relatedTarget).closest("."+r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).length>0||(this._removeCursor(),this.trigger("cursorRemoved"))},_onRendered:function(e,t){if(this.isEmpty=r.every(this.datasets,function(e){return e.isEmpty()}),this.isEmpty)if(t.length>=this.minLength&&this.trigger("empty"),this.$empty)if(t.length<this.minLength)this._hide();else{var n=this.templates.empty({query:this.datasets[0]&&this.datasets[0].query});this.$empty.html(n),this.$empty.show(),this._show()}else r.any(this.datasets,function(e){return e.templates&&e.templates.empty})?t.length<this.minLength?this._hide():this._show():this._hide();else this.isOpen&&(this.$empty&&(this.$empty.empty(),this.$empty.hide()),t.length>=this.minLength?this._show():this._hide());this.trigger("datasetRendered")},_hide:function(){this.$container.hide()},_show:function(){this.$container.css("display","block"),this._redraw(),this.trigger("shown")},_redraw:function(){this.isOpen&&this.appendTo&&this.trigger("redrawn")},_getSuggestions:function(){return this.$menu.find(r.className(this.cssClasses.prefix,this.cssClasses.suggestion))},_getCursor:function(){return this.$menu.find(r.className(this.cssClasses.prefix,this.cssClasses.cursor)).first()},_setCursor:function(e,t){e.first().addClass(r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).attr("aria-selected","true"),this.trigger("cursorMoved",t)},_removeCursor:function(){this._getCursor().removeClass(r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).removeAttr("aria-selected")},_moveCursor:function(e){var t,n,r,i;this.isOpen&&(n=this._getCursor(),t=this._getSuggestions(),this._removeCursor(),-1!=(r=((r=t.index(n)+e)+1)%(t.length+1)-1)?(r<-1&&(r=t.length-1),this._setCursor(i=t.eq(r),!0),this._ensureVisible(i)):this.trigger("cursorRemoved"))},_ensureVisible:function(e){var t,n,r,i;n=(t=e.position().top)+e.height()+parseInt(e.css("margin-top"),10)+parseInt(e.css("margin-bottom"),10),r=this.$menu.scrollTop(),i=this.$menu.height()+parseInt(this.$menu.css("padding-top"),10)+parseInt(this.$menu.css("padding-bottom"),10),t<0?this.$menu.scrollTop(r+t):i<n&&this.$menu.scrollTop(r+(n-i))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,this.isEmpty||this._show(),this.trigger("opened"))},setLanguageDirection:function(e){this.$menu.css("ltr"===e?this.css.ltr:this.css.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(e){var t=null;return e.length&&(t={raw:a.extractDatum(e),value:a.extractValue(e),datasetName:a.extractDatasetName(e)}),t},getCurrentCursor:function(){return this._getCursor().first()},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},cursorTopSuggestion:function(){this._setCursor(this._getSuggestions().first(),!1)},update:function(e){r.each(this.datasets,function(t){t.update(e)})},empty:function(){r.each(this.datasets,function(e){e.clear()}),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){this.$menu.off(".aa"),this.$menu=null,r.each(this.datasets,function(e){e.destroy()})}}),l.Dataset=a,e.exports=l},7368:function(e,t,n){"use strict";var r=n(5670),i=n(3855);function o(e){e&&e.el||r.error("EventBus initialized without el"),this.$el=i.element(e.el)}r.mixin(o.prototype,{trigger:function(e,t,n,i){var o=r.Event("autocomplete:"+e);return this.$el.trigger(o,[t,n,i]),o}}),e.exports=o},6823:function(e,t,n){"use strict";var r=n(624),i=/\s+/;function o(e,t,n,r){var o;if(!n)return this;for(t=t.split(i),n=r?function(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}(n,r):n,this._callbacks=this._callbacks||{};o=t.shift();)this._callbacks[o]=this._callbacks[o]||{sync:[],async:[]},this._callbacks[o][e].push(n);return this}function a(e,t,n){return function(){for(var r,i=0,o=e.length;!r&&i<o;i+=1)r=!1===e[i].apply(t,n);return!r}}e.exports={onSync:function(e,t,n){return o.call(this,"sync",e,t,n)},onAsync:function(e,t,n){return o.call(this,"async",e,t,n)},off:function(e){var t;if(!this._callbacks)return this;for(e=e.split(i);t=e.shift();)delete this._callbacks[t];return this},trigger:function(e){var t,n,o,s,l;if(!this._callbacks)return this;for(e=e.split(i),o=[].slice.call(arguments,1);(t=e.shift())&&(n=this._callbacks[t]);)s=a(n.sync,this,[t].concat(o)),l=a(n.async,this,[t].concat(o)),s()&&r(l);return this}}},6619:function(e){"use strict";e.exports={wrapper:'<span class="%ROOT%"></span>',dropdown:'<span class="%PREFIX%%DROPDOWN_MENU%"></span>',dataset:'<div class="%PREFIX%%DATASET%-%CLASS%"></div>',suggestions:'<span class="%PREFIX%%SUGGESTIONS%"></span>',suggestion:'<div class="%PREFIX%%SUGGESTION%"></div>'}},1286:function(e,t,n){"use strict";var r;r={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};var i=n(5670),o=n(3855),a=n(6823);function s(e){var t,n,a,s,l,u=this;(e=e||{}).input||i.error("input is missing"),t=i.bind(this._onBlur,this),n=i.bind(this._onFocus,this),a=i.bind(this._onKeydown,this),s=i.bind(this._onInput,this),this.$hint=o.element(e.hint),this.$input=o.element(e.input).on("blur.aa",t).on("focus.aa",n).on("keydown.aa",a),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=i.noop),i.isMsie()?this.$input.on("keydown.aa keypress.aa cut.aa paste.aa",function(e){r[e.which||e.keyCode]||i.defer(i.bind(u._onInput,u,e))}):this.$input.on("input.aa",s),this.query=this.$input.val(),this.$overflowHelper=(l=this.$input,o.element('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:l.css("font-family"),fontSize:l.css("font-size"),fontStyle:l.css("font-style"),fontVariant:l.css("font-variant"),fontWeight:l.css("font-weight"),wordSpacing:l.css("word-spacing"),letterSpacing:l.css("letter-spacing"),textIndent:l.css("text-indent"),textRendering:l.css("text-rendering"),textTransform:l.css("text-transform")}).insertAfter(l))}function l(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}s.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},i.mixin(s.prototype,a,{_onBlur:function(){this.resetInputValue(),this.$input.removeAttr("aria-activedescendant"),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(e){var t=r[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(e,t){var n,r,i;switch(e){case"tab":r=this.getHint(),i=this.getInputValue(),n=r&&r!==i&&!l(t);break;case"up":case"down":n=!l(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){return"tab"!==e||!l(t)},_checkInputValue:function(){var e,t,n,r,i;r=e=this.getInputValue(),i=this.query,n=!(!(t=s.normalizeQuery(r)===s.normalizeQuery(i))||!this.query)&&this.query.length!==e.length,this.query=e,t?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(e){this.query=e},getInputValue:function(){return this.$input.val()},setInputValue:function(e,t){void 0===e&&(e=this.query),this.$input.val(e),t?this.clearHint():this._checkInputValue()},expand:function(){this.$input.attr("aria-expanded","true")},collapse:function(){this.$input.attr("aria-expanded","false")},setActiveDescendant:function(e){this.$input.attr("aria-activedescendant",e)},removeActiveDescendant:function(){this.$input.removeAttr("aria-activedescendant")},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n;n=(e=this.getInputValue())!==(t=this.getHint())&&0===t.indexOf(e),""!==e&&n&&!this.hasOverflow()||this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,t,n;return e=this.$input.val().length,t=this.$input[0].selectionStart,i.isNumber(t)?t===e:!document.selection||((n=document.selection.createRange()).moveStart("character",-e),e===n.text.length)},destroy:function(){this.$hint.off(".aa"),this.$input.off(".aa"),this.$hint=this.$input=this.$overflowHelper=null}}),e.exports=s},4520:function(e,t,n){"use strict";var r="aaAttrs",i=n(5670),o=n(3855),a=n(7368),s=n(1286),l=n(5445),u=n(6619),c=n(7114);function d(e){var t,n;if((e=e||{}).input||i.error("missing input"),this.isActivated=!1,this.debug=!!e.debug,this.autoselect=!!e.autoselect,this.autoselectOnBlur=!!e.autoselectOnBlur,this.openOnFocus=!!e.openOnFocus,this.minLength=i.isNumber(e.minLength)?e.minLength:1,this.autoWidth=void 0===e.autoWidth||!!e.autoWidth,this.clearOnSelected=!!e.clearOnSelected,this.tabAutocomplete=void 0===e.tabAutocomplete||!!e.tabAutocomplete,e.hint=!!e.hint,e.hint&&e.appendTo)throw new Error("[autocomplete.js] hint and appendTo options can't be used at the same time");this.css=e.css=i.mixin({},c,e.appendTo?c.appendTo:{}),this.cssClasses=e.cssClasses=i.mixin({},c.defaultClasses,e.cssClasses||{}),this.cssClasses.prefix=e.cssClasses.formattedPrefix=i.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix),this.listboxId=e.listboxId=[this.cssClasses.root,"listbox",i.getUniqueId()].join("-");var s=function(e){var t,n,a,s;t=o.element(e.input),n=o.element(u.wrapper.replace("%ROOT%",e.cssClasses.root)).css(e.css.wrapper),e.appendTo||"block"!==t.css("display")||"table"!==t.parent().css("display")||n.css("display","table-cell");var l,c=u.dropdown.replace("%PREFIX%",e.cssClasses.prefix).replace("%DROPDOWN_MENU%",e.cssClasses.dropdownMenu);a=o.element(c).css(e.css.dropdown).attr({role:"listbox",id:e.listboxId}),e.templates&&e.templates.dropdownMenu&&a.html(i.templatify(e.templates.dropdownMenu)()),(s=t.clone().css(e.css.hint).css({backgroundAttachment:(l=t).css("background-attachment"),backgroundClip:l.css("background-clip"),backgroundColor:l.css("background-color"),backgroundImage:l.css("background-image"),backgroundOrigin:l.css("background-origin"),backgroundPosition:l.css("background-position"),backgroundRepeat:l.css("background-repeat"),backgroundSize:l.css("background-size")})).val("").addClass(i.className(e.cssClasses.prefix,e.cssClasses.hint,!0)).removeAttr("id name placeholder required").prop("readonly",!0).attr({"aria-hidden":"true",autocomplete:"off",spellcheck:"false",tabindex:-1}),s.removeData&&s.removeData(),t.data(r,{"aria-autocomplete":t.attr("aria-autocomplete"),"aria-expanded":t.attr("aria-expanded"),"aria-owns":t.attr("aria-owns"),autocomplete:t.attr("autocomplete"),dir:t.attr("dir"),role:t.attr("role"),spellcheck:t.attr("spellcheck"),style:t.attr("style"),type:t.attr("type")}),t.addClass(i.className(e.cssClasses.prefix,e.cssClasses.input,!0)).attr({autocomplete:"off",spellcheck:!1,role:"combobox","aria-autocomplete":e.datasets&&e.datasets[0]&&e.datasets[0].displayKey?"both":"list","aria-expanded":"false","aria-label":e.ariaLabel,"aria-owns":e.listboxId}).css(e.hint?e.css.input:e.css.inputWithNoHint);try{t.attr("dir")||t.attr("dir","auto")}catch(e){}return(n=e.appendTo?n.appendTo(o.element(e.appendTo).eq(0)).eq(0):t.wrap(n).parent()).prepend(e.hint?s:null).append(a),{wrapper:n,input:t,hint:s,menu:a}}(e);this.$node=s.wrapper;var l=this.$input=s.input;t=s.menu,n=s.hint,e.dropdownMenuContainer&&o.element(e.dropdownMenuContainer).css("position","relative").append(t.css("top","0")),l.on("blur.aa",function(e){var n=document.activeElement;i.isMsie()&&(t[0]===n||t[0].contains(n))&&(e.preventDefault(),e.stopImmediatePropagation(),i.defer(function(){l.focus()}))}),t.on("mousedown.aa",function(e){e.preventDefault()}),this.eventBus=e.eventBus||new a({el:l}),this.dropdown=new d.Dropdown({appendTo:e.appendTo,wrapper:this.$node,menu:t,datasets:e.datasets,templates:e.templates,cssClasses:e.cssClasses,minLength:this.minLength}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onSync("shown",this._onShown,this).onSync("empty",this._onEmpty,this).onSync("redrawn",this._onRedrawn,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new d.Input({input:l,hint:n}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._bindKeyboardShortcuts(e),this._setLanguageDirection()}i.mixin(d.prototype,{_bindKeyboardShortcuts:function(e){if(e.keyboardShortcuts){var t=this.$input,n=[];i.each(e.keyboardShortcuts,function(e){"string"==typeof e&&(e=e.toUpperCase().charCodeAt(0)),n.push(e)}),o.element(document).keydown(function(e){var r=e.target||e.srcElement,i=r.tagName;if(!r.isContentEditable&&"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i){var o=e.which||e.keyCode;-1!==n.indexOf(o)&&(t.focus(),e.stopPropagation(),e.preventDefault())}})}},_onSuggestionClicked:function(e,t){var n;(n=this.dropdown.getDatumForSuggestion(t))&&this._select(n,{selectionMethod:"click"})},_onCursorMoved:function(e,t){var n=this.dropdown.getDatumForCursor(),r=this.dropdown.getCurrentCursor().attr("id");this.input.setActiveDescendant(r),n&&(t&&this.input.setInputValue(n.value,!0),this.eventBus.trigger("cursorchanged",n.raw,n.datasetName))},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint(),this.eventBus.trigger("cursorremoved")},_onDatasetRendered:function(){this._updateHint(),this.eventBus.trigger("updated")},_onOpened:function(){this._updateHint(),this.input.expand(),this.eventBus.trigger("opened")},_onEmpty:function(){this.eventBus.trigger("empty")},_onRedrawn:function(){this.$node.css("top","0px"),this.$node.css("left","0px");var e=this.$input[0].getBoundingClientRect();this.autoWidth&&this.$node.css("width",e.width+"px");var t=this.$node[0].getBoundingClientRect(),n=e.bottom-t.top;this.$node.css("top",n+"px");var r=e.left-t.left;this.$node.css("left",r+"px"),this.eventBus.trigger("redrawn")},_onShown:function(){this.eventBus.trigger("shown"),this.autoselect&&this.dropdown.cursorTopSuggestion()},_onClosed:function(){this.input.clearHint(),this.input.removeActiveDescendant(),this.input.collapse(),this.eventBus.trigger("closed")},_onFocused:function(){if(this.isActivated=!0,this.openOnFocus){var e=this.input.getQuery();e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty(),this.dropdown.open()}},_onBlurred:function(){var e,t;e=this.dropdown.getDatumForCursor(),t=this.dropdown.getDatumForTopSuggestion();var n={selectionMethod:"blur"};this.debug||(this.autoselectOnBlur&&e?this._select(e,n):this.autoselectOnBlur&&t?this._select(t,n):(this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()))},_onEnterKeyed:function(e,t){var n,r;n=this.dropdown.getDatumForCursor(),r=this.dropdown.getDatumForTopSuggestion();var i={selectionMethod:"enterKey"};n?(this._select(n,i),t.preventDefault()):this.autoselect&&r&&(this._select(r,i),t.preventDefault())},_onTabKeyed:function(e,t){var n;this.tabAutocomplete?(n=this.dropdown.getDatumForCursor())?(this._select(n,{selectionMethod:"tabKey"}),t.preventDefault()):this._autocomplete(!0):this.dropdown.close()},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(e,t){this.input.clearHintIfInvalid(),t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var e=this.input.getLanguageDirection();this.dir!==e&&(this.dir=e,this.$node.css("direction",e),this.dropdown.setLanguageDirection(e))},_updateHint:function(){var e,t,n,r,o;(e=this.dropdown.getDatumForTopSuggestion())&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(t=this.input.getInputValue(),n=s.normalizeQuery(t),r=i.escapeRegExChars(n),(o=new RegExp("^(?:"+r+")(.+$)","i").exec(e.value))?this.input.setHint(t+o[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(e){var t,n,r,i;t=this.input.getHint(),n=this.input.getQuery(),r=e||this.input.isCursorAtEnd(),t&&n!==t&&r&&((i=this.dropdown.getDatumForTopSuggestion())&&this.input.setInputValue(i.value),this.eventBus.trigger("autocompleted",i.raw,i.datasetName))},_select:function(e,t){void 0!==e.value&&this.input.setQuery(e.value),this.clearOnSelected?this.setVal(""):this.input.setInputValue(e.value,!0),this._setLanguageDirection(),!1===this.eventBus.trigger("selected",e.raw,e.datasetName,t).isDefaultPrevented()&&(this.dropdown.close(),i.defer(i.bind(this.dropdown.empty,this.dropdown)))},open:function(){if(!this.isActivated){var e=this.input.getInputValue();e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty()}this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(e){e=i.toStr(e),this.isActivated?this.input.setInputValue(e):(this.input.setQuery(e),this.input.setInputValue(e,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){var e,t,n;this.input.destroy(),this.dropdown.destroy(),e=this.$node,t=this.cssClasses,n=e.find(i.className(t.prefix,t.input)),i.each(n.data(r),function(e,t){void 0===e?n.removeAttr(t):n.attr(t,e)}),n.detach().removeClass(i.className(t.prefix,t.input,!0)).insertAfter(e),n.removeData&&n.removeData(r),e.remove(),this.$node=null},getWrapper:function(){return this.dropdown.$container[0]}}),d.Dropdown=l,d.Input=s,d.sources=n(6331),e.exports=d},3855:function(e){"use strict";e.exports={element:null}},2926:function(e){"use strict";e.exports=function(e){var t=e.match(/Algolia for JavaScript \((\d+\.)(\d+\.)(\d+)\)/)||e.match(/Algolia for vanilla JavaScript (\d+\.)(\d+\.)(\d+)/);if(t)return[t[1],t[2],t[3]]}},5670:function(e,t,n){"use strict";var r,i=n(3855);function o(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}e.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(e){if(void 0===e&&(e=navigator.userAgent),/(msie|trident)/i.test(e)){var t=e.match(/(msie |rv:)(\d+(.\d+)?)/i);if(t)return t[2]}return!1},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(e){return"number"==typeof e},toStr:function(e){return null==e?"":e+""},cloneDeep:function(e){var t=this.mixin({},e),n=this;return this.each(t,function(e,r){e&&(n.isArray(e)?t[r]=[].concat(e):n.isObject(e)&&(t[r]=n.cloneDeep(e)))}),t},error:function(e){throw new Error(e)},every:function(e,t){var n=!0;return e?(this.each(e,function(r,i){n&&(n=t.call(null,r,i,e)&&n)}),!!n):n},any:function(e,t){var n=!1;return e?(this.each(e,function(r,i){if(t.call(null,r,i,e))return n=!0,!1}),n):n},getUniqueId:(r=0,function(){return r++}),templatify:function(e){if(this.isFunction(e))return e;var t=i.element(e);return"SCRIPT"===t.prop("tagName")?function(){return t.text()}:function(){return String(e)}},defer:function(e){setTimeout(e,0)},noop:function(){},formatPrefix:function(e,t){return t?"":e+"-"},className:function(e,t,n){return(n?"":".")+e+t},escapeHighlightedString:function(e,t,n){t=t||"<em>";var r=document.createElement("div");r.appendChild(document.createTextNode(t)),n=n||"</em>";var i=document.createElement("div");i.appendChild(document.createTextNode(n));var a=document.createElement("div");return a.appendChild(document.createTextNode(e)),a.innerHTML.replace(RegExp(o(r.innerHTML),"g"),t).replace(RegExp(o(i.innerHTML),"g"),n)}}},2683:function(e,t,n){"use strict";var r,i,o=n(5670),a=n(3489),s=n(2926),l=(r=[],i=window.Promise.resolve(),function(e,t){return function(n,a){var s,l;(s=e.as,l=r.push({indexName:e.indexName,query:n,params:t})-1,window.Promise.resolve().then(function(){return r.length&&(i=s.search(r),r=[]),i}).then(function(e){if(e)return e.results[l]})).then(function(e){e&&a(e.hits,e)}).catch(function(e){o.error(e.message)})}});e.exports=function(e,t){var n=s(e.as._ua);if(n&&n[0]>=3&&n[1]>20){var r="autocomplete.js "+a;-1===e.as._ua.indexOf(r)&&(e.as._ua+="; "+r)}return l(e,t)}},6331:function(e,t,n){"use strict";e.exports={hits:n(2683),popularIn:n(2226)}},2226:function(e,t,n){"use strict";var r=n(5670),i=n(3489),o=n(2926);e.exports=function(e,t,n,a){var s=o(e.as._ua);if(s&&s[0]>=3&&s[1]>20&&((t=t||{}).additionalUA="autocomplete.js "+i),!n.source)return r.error("Missing 'source' key");var l=r.isFunction(n.source)?n.source:function(e){return e[n.source]};if(!n.index)return r.error("Missing 'index' key");var u=n.index;return a=a||{},function(s,c){e.search(s,t,function(e,s){if(e)r.error(e.message);else{if(s.hits.length>0){var d=s.hits[0],f=r.mixin({hitsPerPage:0},n);delete f.source,delete f.index;var p=o(u.as._ua);return p&&p[0]>=3&&p[1]>20&&(t.additionalUA="autocomplete.js "+i),void u.search(l(d),f,function(e,t){if(e)r.error(e.message);else{var n=[];if(a.includeAll){var i=a.allTitle||"All departments";n.push(r.mixin({facet:{value:i,count:t.nbHits}},r.cloneDeep(d)))}r.each(t.facets,function(e,t){r.each(e,function(e,i){n.push(r.mixin({facet:{facet:t,value:i,count:e}},r.cloneDeep(d)))})});for(var o=1;o<s.hits.length;++o)n.push(s.hits[o]);c(n,s)}})}c([])}})}}},9281:function(e,t,n){"use strict";var r=n(7939);n(3855).element=r;var i=n(5670);i.isArray=r.isArray,i.isFunction=r.isFunction,i.isObject=r.isPlainObject,i.bind=r.proxy,i.each=function(e,t){r.each(e,function(e,n){return t(n,e)})},i.map=r.map,i.mixin=r.extend,i.Event=r.Event;var o="aaAutocomplete",a=n(4520),s=n(7368);function l(e,t,n,l){n=i.isArray(n)?n:[].slice.call(arguments,2);var u=r(e).each(function(e,i){var u=r(i),c=new s({el:u}),d=l||new a({input:u,eventBus:c,dropdownMenuContainer:t.dropdownMenuContainer,hint:void 0===t.hint||!!t.hint,minLength:t.minLength,autoselect:t.autoselect,autoselectOnBlur:t.autoselectOnBlur,tabAutocomplete:t.tabAutocomplete,openOnFocus:t.openOnFocus,templates:t.templates,debug:t.debug,clearOnSelected:t.clearOnSelected,cssClasses:t.cssClasses,datasets:n,keyboardShortcuts:t.keyboardShortcuts,appendTo:t.appendTo,autoWidth:t.autoWidth,ariaLabel:t.ariaLabel||i.getAttribute("aria-label")});u.data(o,d)});return u.autocomplete={},i.each(["open","close","getVal","setVal","destroy","getWrapper"],function(e){u.autocomplete[e]=function(){var t,n=arguments;return u.each(function(i,a){var s=r(a).data(o);t=s[e].apply(s,n)}),t}}),u}l.sources=a.sources,l.escapeHighlightedString=i.escapeHighlightedString;var u="autocomplete"in window,c=window.autocomplete;l.noConflict=function(){return u?window.autocomplete=c:delete window.autocomplete,l},e.exports=l},3489:function(e){e.exports="0.38.1"},7939:function(e){!function(t){e.exports=function(e){var t,n,r=function(){var t,n,r,i,o,a,s=[],l=s.concat,u=s.filter,c=s.slice,d=e.document,f={},p={},h={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},g=/^\s*<(\w+|!)[^>]*>/,m=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,y=/^(?:body|html)$/i,_=/([A-Z])/g,b=["val","css","html","text","data","width","height","offset"],w=d.createElement("table"),x=d.createElement("tr"),k={tr:d.createElement("tbody"),tbody:w,thead:w,tfoot:w,td:x,th:x,"*":d.createElement("div")},C=/complete|loaded|interactive/,D=/^[\w-]*$/,S={},A=S.toString,E={},M=d.createElement("div"),T={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},j=Array.isArray||function(e){return e instanceof Array};function N(e){return null==e?String(e):S[A.call(e)]||"object"}function F(e){return"function"==N(e)}function O(e){return null!=e&&e==e.window}function I(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function z(e){return"object"==N(e)}function $(e){return z(e)&&!O(e)&&Object.getPrototypeOf(e)==Object.prototype}function q(e){var t=!!e&&"length"in e&&e.length,n=r.type(e);return"function"!=n&&!O(e)&&("array"==n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function R(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function P(e){return e in p?p[e]:p[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function L(e,t){return"number"!=typeof t||h[R(e)]?t:t+"px"}function B(e){return"children"in e?c.call(e.children):r.map(e.childNodes,function(e){if(1==e.nodeType)return e})}function U(e,t){var n,r=e?e.length:0;for(n=0;n<r;n++)this[n]=e[n];this.length=r,this.selector=t||""}function V(e,r,i){for(n in r)i&&($(r[n])||j(r[n]))?($(r[n])&&!$(e[n])&&(e[n]={}),j(r[n])&&!j(e[n])&&(e[n]=[]),V(e[n],r[n],i)):r[n]!==t&&(e[n]=r[n])}function H(e,t){return null==t?r(e):r(e).filter(t)}function W(e,t,n,r){return F(t)?t.call(e,n,r):t}function G(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Y(e,n){var r=e.className||"",i=r&&r.baseVal!==t;if(n===t)return i?r.baseVal:r;i?r.baseVal=n:e.className=n}function Q(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?r.parseJSON(e):e):e}catch(t){return e}}function K(e,t){t(e);for(var n=0,r=e.childNodes.length;n<r;n++)K(e.childNodes[n],t)}return E.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(n)return n.call(e,t);var r,i=e.parentNode,o=!i;return o&&(i=M).appendChild(e),r=~E.qsa(i,t).indexOf(e),o&&M.removeChild(e),r},o=function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},a=function(e){return u.call(e,function(t,n){return e.indexOf(t)==n})},E.fragment=function(e,n,i){var o,a,s;return m.test(e)&&(o=r(d.createElement(RegExp.$1))),o||(e.replace&&(e=e.replace(v,"<$1></$2>")),n===t&&(n=g.test(e)&&RegExp.$1),n in k||(n="*"),(s=k[n]).innerHTML=""+e,o=r.each(c.call(s.childNodes),function(){s.removeChild(this)})),$(i)&&(a=r(o),r.each(i,function(e,t){b.indexOf(e)>-1?a[e](t):a.attr(e,t)})),o},E.Z=function(e,t){return new U(e,t)},E.isZ=function(e){return e instanceof E.Z},E.init=function(e,n){var i,o;if(!e)return E.Z();if("string"==typeof e)if("<"==(e=e.trim())[0]&&g.test(e))i=E.fragment(e,RegExp.$1,n),e=null;else{if(n!==t)return r(n).find(e);i=E.qsa(d,e)}else{if(F(e))return r(d).ready(e);if(E.isZ(e))return e;if(j(e))o=e,i=u.call(o,function(e){return null!=e});else if(z(e))i=[e],e=null;else if(g.test(e))i=E.fragment(e.trim(),RegExp.$1,n),e=null;else{if(n!==t)return r(n).find(e);i=E.qsa(d,e)}}return E.Z(i,e)},(r=function(e,t){return E.init(e,t)}).extend=function(e){var t,n=c.call(arguments,1);return"boolean"==typeof e&&(t=e,e=n.shift()),n.forEach(function(n){V(e,n,t)}),e},E.qsa=function(e,t){var n,r="#"==t[0],i=!r&&"."==t[0],o=r||i?t.slice(1):t,a=D.test(o);return e.getElementById&&a&&r?(n=e.getElementById(o))?[n]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:c.call(a&&!r&&e.getElementsByClassName?i?e.getElementsByClassName(o):e.getElementsByTagName(t):e.querySelectorAll(t))},r.contains=d.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},r.type=N,r.isFunction=F,r.isWindow=O,r.isArray=j,r.isPlainObject=$,r.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},r.isNumeric=function(e){var t=Number(e),n=typeof e;return null!=e&&"boolean"!=n&&("string"!=n||e.length)&&!isNaN(t)&&isFinite(t)||!1},r.inArray=function(e,t,n){return s.indexOf.call(t,e,n)},r.camelCase=o,r.trim=function(e){return null==e?"":String.prototype.trim.call(e)},r.uuid=0,r.support={},r.expr={},r.noop=function(){},r.map=function(e,t){var n,i,o,a,s=[];if(q(e))for(i=0;i<e.length;i++)null!=(n=t(e[i],i))&&s.push(n);else for(o in e)null!=(n=t(e[o],o))&&s.push(n);return(a=s).length>0?r.fn.concat.apply([],a):a},r.each=function(e,t){var n,r;if(q(e)){for(n=0;n<e.length;n++)if(!1===t.call(e[n],n,e[n]))return e}else for(r in e)if(!1===t.call(e[r],r,e[r]))return e;return e},r.grep=function(e,t){return u.call(e,t)},e.JSON&&(r.parseJSON=JSON.parse),r.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){S["[object "+t+"]"]=t.toLowerCase()}),r.fn={constructor:E.Z,length:0,forEach:s.forEach,reduce:s.reduce,push:s.push,sort:s.sort,splice:s.splice,indexOf:s.indexOf,concat:function(){var e,t,n=[];for(e=0;e<arguments.length;e++)t=arguments[e],n[e]=E.isZ(t)?t.toArray():t;return l.apply(E.isZ(this)?this.toArray():this,n)},map:function(e){return r(r.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return r(c.apply(this,arguments))},ready:function(e){return C.test(d.readyState)&&d.body?e(r):d.addEventListener("DOMContentLoaded",function(){e(r)},!1),this},get:function(e){return e===t?c.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(e){return s.every.call(this,function(t,n){return!1!==e.call(t,n,t)}),this},filter:function(e){return F(e)?this.not(this.not(e)):r(u.call(this,function(t){return E.matches(t,e)}))},add:function(e,t){return r(a(this.concat(r(e,t))))},is:function(e){return this.length>0&&E.matches(this[0],e)},not:function(e){var n=[];if(F(e)&&e.call!==t)this.each(function(t){e.call(this,t)||n.push(this)});else{var i="string"==typeof e?this.filter(e):q(e)&&F(e.item)?c.call(e):r(e);this.forEach(function(e){i.indexOf(e)<0&&n.push(e)})}return r(n)},has:function(e){return this.filter(function(){return z(e)?r.contains(this,e):r(this).find(e).size()})},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!z(e)?e:r(e)},last:function(){var e=this[this.length-1];return e&&!z(e)?e:r(e)},find:function(e){var t=this;return e?"object"==typeof e?r(e).filter(function(){var e=this;return s.some.call(t,function(t){return r.contains(t,e)})}):1==this.length?r(E.qsa(this[0],e)):this.map(function(){return E.qsa(this,e)}):r()},closest:function(e,t){var n=[],i="object"==typeof e&&r(e);return this.each(function(r,o){for(;o&&!(i?i.indexOf(o)>=0:E.matches(o,e));)o=o!==t&&!I(o)&&o.parentNode;o&&n.indexOf(o)<0&&n.push(o)}),r(n)},parents:function(e){for(var t=[],n=this;n.length>0;)n=r.map(n,function(e){if((e=e.parentNode)&&!I(e)&&t.indexOf(e)<0)return t.push(e),e});return H(t,e)},parent:function(e){return H(a(this.pluck("parentNode")),e)},children:function(e){return H(this.map(function(){return B(this)}),e)},contents:function(){return this.map(function(){return this.contentDocument||c.call(this.childNodes)})},siblings:function(e){return H(this.map(function(e,t){return u.call(B(t.parentNode),function(e){return e!==t})}),e)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return r.map(this,function(t){return t[e]})},show:function(){return this.each(function(){var e,t,n;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(e=this.nodeName,f[e]||(t=d.createElement(e),d.body.appendChild(t),n=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==n&&(n="block"),f[e]=n),f[e]))})},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var t=F(e);if(this[0]&&!t)var n=r(e).get(0),i=n.parentNode||this.length>1;return this.each(function(o){r(this).wrapAll(t?e.call(this,o):i?n.cloneNode(!0):n)})},wrapAll:function(e){if(this[0]){var t;for(r(this[0]).before(e=r(e));(t=e.children()).length;)e=t.first();r(e).append(this)}return this},wrapInner:function(e){var t=F(e);return this.each(function(n){var i=r(this),o=i.contents(),a=t?e.call(this,n):e;o.length?o.wrapAll(a):i.append(a)})},unwrap:function(){return this.parent().each(function(){r(this).replaceWith(r(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var n=r(this);(e===t?"none"==n.css("display"):e)?n.show():n.hide()})},prev:function(e){return r(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return r(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each(function(t){var n=this.innerHTML;r(this).empty().append(W(this,e,t,n))}):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each(function(t){var n=W(this,e,t,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(e,r){var i;return"string"!=typeof e||1 in arguments?this.each(function(t){if(1===this.nodeType)if(z(e))for(n in e)G(this,n,e[n]);else G(this,e,W(this,r,t,this.getAttribute(e)))}):0 in this&&1==this[0].nodeType&&null!=(i=this[0].getAttribute(e))?i:t},removeAttr:function(e){return this.each(function(){1===this.nodeType&&e.split(" ").forEach(function(e){G(this,e)},this)})},prop:function(e,t){return e=T[e]||e,1 in arguments?this.each(function(n){this[e]=W(this,t,n,this[e])}):this[0]&&this[0][e]},removeProp:function(e){return e=T[e]||e,this.each(function(){delete this[e]})},data:function(e,n){var r="data-"+e.replace(_,"-$1").toLowerCase(),i=1 in arguments?this.attr(r,n):this.attr(r);return null!==i?Q(i):t},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each(function(t){this.value=W(this,e,t,this.value)})):this[0]&&(this[0].multiple?r(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=r(this),i=W(this,t,e,n.offset()),o=n.offsetParent().offset(),a={top:i.top-o.top,left:i.left-o.left};"static"==n.css("position")&&(a.position="relative"),n.css(a)});if(!this.length)return null;if(d.documentElement!==this[0]&&!r.contains(d.documentElement,this[0]))return{top:0,left:0};var n=this[0].getBoundingClientRect();return{left:n.left+e.pageXOffset,top:n.top+e.pageYOffset,width:Math.round(n.width),height:Math.round(n.height)}},css:function(e,t){if(arguments.length<2){var i=this[0];if("string"==typeof e){if(!i)return;return i.style[o(e)]||getComputedStyle(i,"").getPropertyValue(e)}if(j(e)){if(!i)return;var a={},s=getComputedStyle(i,"");return r.each(e,function(e,t){a[t]=i.style[o(t)]||s.getPropertyValue(t)}),a}}var l="";if("string"==N(e))t||0===t?l=R(e)+":"+L(e,t):this.each(function(){this.style.removeProperty(R(e))});else for(n in e)e[n]||0===e[n]?l+=R(n)+":"+L(n,e[n])+";":this.each(function(){this.style.removeProperty(R(n))});return this.each(function(){this.style.cssText+=";"+l})},index:function(e){return e?this.indexOf(r(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return!!e&&s.some.call(this,function(e){return this.test(Y(e))},P(e))},addClass:function(e){return e?this.each(function(t){if("className"in this){i=[];var n=Y(this);W(this,e,t,n).split(/\s+/g).forEach(function(e){r(this).hasClass(e)||i.push(e)},this),i.length&&Y(this,n+(n?" ":"")+i.join(" "))}}):this},removeClass:function(e){return this.each(function(n){if("className"in this){if(e===t)return Y(this,"");i=Y(this),W(this,e,n,i).split(/\s+/g).forEach(function(e){i=i.replace(P(e)," ")}),Y(this,i.trim())}})},toggleClass:function(e,n){return e?this.each(function(i){var o=r(this);W(this,e,i,Y(this)).split(/\s+/g).forEach(function(e){(n===t?!o.hasClass(e):n)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n="scrollTop"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n="scrollLeft"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var e=this[0],t=this.offsetParent(),n=this.offset(),i=y.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(r(e).css("margin-top"))||0,n.left-=parseFloat(r(e).css("margin-left"))||0,i.top+=parseFloat(r(t[0]).css("border-top-width"))||0,i.left+=parseFloat(r(t[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||d.body;e&&!y.test(e.nodeName)&&"static"==r(e).css("position");)e=e.offsetParent;return e})}},r.fn.detach=r.fn.remove,["width","height"].forEach(function(e){var n=e.replace(/./,function(e){return e[0].toUpperCase()});r.fn[e]=function(i){var o,a=this[0];return i===t?O(a)?a["inner"+n]:I(a)?a.documentElement["scroll"+n]:(o=this.offset())&&o[e]:this.each(function(t){(a=r(this)).css(e,W(this,i,t,a[e]()))})}}),["after","prepend","before","append"].forEach(function(n,i){var o=i%2;r.fn[n]=function(){var n,a,s=r.map(arguments,function(e){var i=[];return"array"==(n=N(e))?(e.forEach(function(e){return e.nodeType!==t?i.push(e):r.zepto.isZ(e)?i=i.concat(e.get()):void(i=i.concat(E.fragment(e)))}),i):"object"==n||null==e?e:E.fragment(e)}),l=this.length>1;return s.length<1?this:this.each(function(t,n){a=o?n:n.parentNode,n=0==i?n.nextSibling:1==i?n.firstChild:2==i?n:null;var u=r.contains(d.documentElement,a);s.forEach(function(t){if(l)t=t.cloneNode(!0);else if(!a)return r(t).remove();a.insertBefore(t,n),u&&K(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var n=t.ownerDocument?t.ownerDocument.defaultView:e;n.eval.call(n,t.innerHTML)}})})})},r.fn[o?n+"To":"insert"+(i?"Before":"After")]=function(e){return r(e)[n](this),this}}),E.Z.prototype=U.prototype=r.fn,E.uniq=a,E.deserializeValue=Q,r.zepto=E,r}();return function(t){var n,r=1,i=Array.prototype.slice,o=t.isFunction,a=function(e){return"string"==typeof e},s={},l={},u="onfocusin"in e,c={focus:"focusin",blur:"focusout"},d={mouseenter:"mouseover",mouseleave:"mouseout"};function f(e){return e._zid||(e._zid=r++)}function p(e,t,n,r){if((t=h(t)).ns)var i=(o=t.ns,new RegExp("(?:^| )"+o.replace(" "," .* ?")+"(?: |$)"));var o;return(s[f(e)]||[]).filter(function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||i.test(e.ns))&&(!n||f(e.fn)===f(n))&&(!r||e.sel==r)})}function h(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function g(e,t){return e.del&&!u&&e.e in c||!!t}function m(e){return d[e]||u&&c[e]||e}function v(e,r,i,o,a,l,u){var c=f(e),p=s[c]||(s[c]=[]);r.split(/\s/).forEach(function(r){if("ready"==r)return t(document).ready(i);var s=h(r);s.fn=i,s.sel=a,s.e in d&&(i=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return s.fn.apply(this,arguments)}),s.del=l;var c=l||i;s.proxy=function(t){if(!(t=k(t)).isImmediatePropagationStopped()){try{var r=Object.getOwnPropertyDescriptor(t,"data");r&&!r.writable||(t.data=o)}catch(t){}var i=c.apply(e,t._args==n?[t]:[t].concat(t._args));return!1===i&&(t.preventDefault(),t.stopPropagation()),i}},s.i=p.length,p.push(s),"addEventListener"in e&&e.addEventListener(m(s.e),s.proxy,g(s,u))})}function y(e,t,n,r,i){var o=f(e);(t||"").split(/\s/).forEach(function(t){p(e,t,n,r).forEach(function(t){delete s[o][t.i],"removeEventListener"in e&&e.removeEventListener(m(t.e),t.proxy,g(t,i))})})}l.click=l.mousedown=l.mouseup=l.mousemove="MouseEvents",t.event={add:v,remove:y},t.proxy=function(e,n){var r=2 in arguments&&i.call(arguments,2);if(o(e)){var s=function(){return e.apply(n,r?r.concat(i.call(arguments)):arguments)};return s._zid=f(e),s}if(a(n))return r?(r.unshift(e[n],e),t.proxy.apply(null,r)):t.proxy(e[n],e);throw new TypeError("expected function")},t.fn.bind=function(e,t,n){return this.on(e,t,n)},t.fn.unbind=function(e,t){return this.off(e,t)},t.fn.one=function(e,t,n,r){return this.on(e,t,n,r,1)};var _=function(){return!0},b=function(){return!1},w=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,x={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};function k(e,r){if(r||!e.isDefaultPrevented){r||(r=e),t.each(x,function(t,n){var i=r[t];e[t]=function(){return this[n]=_,i&&i.apply(r,arguments)},e[n]=b});try{e.timeStamp||(e.timeStamp=Date.now())}catch(e){}(r.defaultPrevented!==n?r.defaultPrevented:"returnValue"in r?!1===r.returnValue:r.getPreventDefault&&r.getPreventDefault())&&(e.isDefaultPrevented=_)}return e}function C(e){var t,r={originalEvent:e};for(t in e)w.test(t)||e[t]===n||(r[t]=e[t]);return k(r,e)}t.fn.delegate=function(e,t,n){return this.on(t,e,n)},t.fn.undelegate=function(e,t,n){return this.off(t,e,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,r,s,l,u){var c,d,f=this;return e&&!a(e)?(t.each(e,function(e,t){f.on(e,r,s,t,u)}),f):(a(r)||o(l)||!1===l||(l=s,s=r,r=n),l!==n&&!1!==s||(l=s,s=n),!1===l&&(l=b),f.each(function(n,o){u&&(c=function(e){return y(o,e.type,l),l.apply(this,arguments)}),r&&(d=function(e){var n,a=t(e.target).closest(r,o).get(0);if(a&&a!==o)return n=t.extend(C(e),{currentTarget:a,liveFired:o}),(c||l).apply(a,[n].concat(i.call(arguments,1)))}),v(o,e,l,s,r,d||c)}))},t.fn.off=function(e,r,i){var s=this;return e&&!a(e)?(t.each(e,function(e,t){s.off(e,r,t)}),s):(a(r)||o(i)||!1===i||(i=r,r=n),!1===i&&(i=b),s.each(function(){y(this,e,i,r)}))},t.fn.trigger=function(e,n){return(e=a(e)||t.isPlainObject(e)?t.Event(e):k(e))._args=n,this.each(function(){e.type in c&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var r,i;return this.each(function(o,s){(r=C(a(e)?t.Event(e):e))._args=n,r.target=s,t.each(p(s,e.type||e),function(e,t){if(i=t.proxy(r),r.isImmediatePropagationStopped())return!1})}),i},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(e,t){a(e)||(e=(t=e).type);var n=document.createEvent(l[e]||"Events"),r=!0;if(t)for(var i in t)"bubbles"==i?r=!!t[i]:n[i]=t[i];return n.initEvent(e,r,!0),k(n)}}(r),n=[],r.fn.remove=function(){return this.each(function(){this.parentNode&&("IMG"===this.tagName&&(n.push(this),this.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",t&&clearTimeout(t),t=setTimeout(function(){n=[]},6e4)),this.parentNode.removeChild(this))})},function(e){var t={},n=e.fn.data,r=e.camelCase,i=e.expando="Zepto"+ +new Date,o=[];function a(n,a,s){var l=n[i]||(n[i]=++e.uuid),u=t[l]||(t[l]=function(t){var n={};return e.each(t.attributes||o,function(t,i){0==i.name.indexOf("data-")&&(n[r(i.name.replace("data-",""))]=e.zepto.deserializeValue(i.value))}),n}(n));return void 0!==a&&(u[r(a)]=s),u}e.fn.data=function(o,s){return void 0===s?e.isPlainObject(o)?this.each(function(t,n){e.each(o,function(e,t){a(n,e,t)})}):0 in this?function(o,s){var l=o[i],u=l&&t[l];if(void 0===s)return u||a(o);if(u){if(s in u)return u[s];var c=r(s);if(c in u)return u[c]}return n.call(e(o),s)}(this[0],o):void 0:this.each(function(){a(this,o,s)})},e.data=function(t,n,r){return e(t).data(n,r)},e.hasData=function(n){var r=n[i],o=r&&t[r];return!!o&&!e.isEmptyObject(o)},e.fn.removeData=function(n){return"string"==typeof n&&(n=n.split(/\s+/)),this.each(function(){var o=this[i],a=o&&t[o];a&&e.each(n||a,function(e){delete a[n?r(this):e]})})},["remove","empty"].forEach(function(t){var n=e.fn[t];e.fn[t]=function(){var e=this.find("*");return"remove"===t&&(e=e.add(this)),e.removeData(),n.call(this)}})}(r),r}(t)}(window)},6822:function(e,t,n){"use strict";n.r(t),n.d(t,{draw_priority_set_table:function(){return k},get_editor:function(){return S},init:function(){return y},open_editor:function(){return b},priority_set_inject_node_attibutes:function(){return D},priority_set_view:function(){return C}});var r=n(3857),i=n(9050),o=n(4663),a=n(1639),s=n.n(a),l=n(4861),u=n(905),c=n(2033),d=n(4835),f=n(6221),p=n(9983);function h(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v=null;function y(e){if(e._is_CDC_&&e.isPrimaryGraph){var t=d.get_ui_element_selector_by_role("new_priority_set");t&&(window.addEventListener("beforeunload",function(t){return e.priority_groups_pending()>0?(t.preventDefault(),"There are clusters of interest that have not been confirmed. Closing the window now will not finalize their creation."):null}),r.selectAll(t).on("click",function(t){b(e,[]),e.redraw_tables()}));var n=d.get_ui_element_selector_by_role("merge_priority_sets");n&&r.selectAll(n).on("click",function(e){p(d.get_ui_element_selector_by_role("priority_set_merge")).modal()})}}function _(e,t,n){return!(!t.length||t.length>=36||i.default.some(e,function(e){return e.name===t&&e.name!==n}))}function b(e,t,n,a,u,c,m,y,b,x){!v&&e.isPrimaryGraph&&(e._is_CDC_executive_mode?alert(f.network.WarnExecutiveMode):(x=y?y.createdBy:x||f.CDCCOICreatedManually,v=o.jsPanel.create({theme:"bootstrap-primary",headerTitle:"Priority node set editor",headerControls:{size:"lg",maximize:"remove"},position:{my:"center",at:"center",offsetX:0,offsetY:0},contentSize:{width:function(){return.8*window.innerWidth},height:function(){return window.innerHeight/3}},content:"",contentOverflow:"scroll",callback:function(){var o=this;o.network_nodes=[],o.saved=!1,o.prior_name=m&&m.length&&y?y.name:null,o.can_edit_kind=!y||"System"!==y.createdBy,o.can_edit_name=!y||"System"!==y.createdBy,o.can_edit_tracking=!y,o.can_add=function(e){return!i.default.some(o.network_nodes,function(t){return t.id===e})};var S=r.select(o.content);S.selectAll("*").remove();var A=S.append("form").attr("action","javascript:void(0);").classed("form-inline",!0);A.append("div").classed("form-group",!0).append("input").classed("form-control input-sm",!0).attr("placeholder","Add node by ID").attr("data-hivtrace-ui-role","priority-panel-nodeids");var E=A.append("button").classed("btn btn-primary btn-sm",!0).attr("id","priority-panel-add-node").attr("disabled","disabled").on("click",function(e){o.append_node()});E.append("i").classed("fa fa-plus",!0),A.append("p").classed("alert alert-warning",!0).style("display","inline").text("At this time, only nodes that cluster in the network at the 1.5% or 0.5% genetic distance threshold level are available for selection.");var M=S.append("form").classed("form",!0).attr("action","javascript:void(0);").style("display","none"),T=M.append("div");o.prior_name?T.classed("form-group has-success",!0):T.classed("form-group has-error",!0);var j=T.append("input").classed("form-control input-sm",!0).attr("placeholder","Name this cluster of interest").attr("data-hivtrace-ui-role","priority-panel-name").attr("maxlength",100),N=T.append("p").classed("help-block",!0).text("Name this cluster of interest"),F=M.append("div").classed("form-group",!0),O=F.append("select").classed("form-control input-sm",!0).attr("data-hivtrace-ui-role","priority-panel-kind");o.can_edit_kind?O.attr("title",null):(O.property("disabled",!0),O.attr("title","The method of cluster identification cannot be changed for system generated cluster of interest. However, after confirming this cluster of interest, you can clone it and then change this field as needed")),o.can_edit_name?j.attr("title",null):(j.property("disabled",!0),j.attr("title","The name cannot be changed for system generated cluster of interest. However, after confirming this cluster of interest, you can clone it and then change this field as needed")),O.selectAll("option").data(c||f.CDCCOIKind).enter().insert("option").text(function(e){return e}).property("selected",function(e){return e===u}),F.append("p").classed("help-block",!0).text("Cluster identification method");var I=M.append("div").classed("form-group",!0),z=I.append("select").classed("form-control input-sm",!0).attr("data-hivtrace-ui-role","priority-panel-tracking");o.can_edit_tracking?z.attr("title",null):(z.property("disabled",!0),z.attr("title","The method of tracking cannot be changed for existing clusters (system generated or manual). However, you can clone this cluster of interest and then change this field as needed")),b=b||f.CDCCOITrackingOptionsDefault,z.selectAll("option").data(f.CDCCOITrackingOptions).enter().insert("option").text(function(e){return e}).property("selected",function(e){return e===b}),I.append("p").classed("help-block",!0).text("Method of tracking cluster of interest growth");var $=M.append("div").classed("form-group",!0);function q(e){return!e._priority_set_fixed}$.append("textarea").classed("form-control input-sm",!0).attr("placeholder","Cluster of Interest Description").attr("data-hivtrace-ui-role","priority-panel-description").text(a),$.append("p").classed("help-block",!0).text("Describe this cluster of interest"),o.first_save=!0,o.cleanup_attributes=function(){i.default.each(e.nodes,function(e){i.default.each(["_priority_set_fixed","_priority_set_date","_priority_set_kind","_priority_set_autoadded"],function(t){delete e[t]})})};var R=y&&m&&m.length?y.created:l.getCurrentDate(),P="validate"===m&&x===f.CDCCOICreatedBySystem?e.today:l.getCurrentDate();function L(){M.style("display",null);var t,n,a=!0;if(o.network_nodes.length){var s,u,c,v,b=i.default.mapObject(e.unique_entity_object_list(o.table_entities),function(e){return e[0]});i.default.each(o.network_nodes,function(t){var n=b[e.primary_key(t)];n&&i.default.each(["_priority_set_date","_priority_set_kind","_priority_set_autoadded"],function(e){n[e]&&(t[e]=n[e])})});var w=(t=i.default.map(["priority-panel-name","priority-panel-description","priority-panel-kind","priority-panel-tracking"],function(e){return p(r.select(d.get_ui_element_selector_by_role(e)).node()).val()}),n=4,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,n)||g(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());if(s=w[0],u=w[1],c=w[2],v=w[3],!o.first_save&&_(e.defined_priority_groups,s,o.prior_name)){var C={name:s,description:u,nodes:i.default.map(o.network_nodes,function(e){return{name:e.id,added:e._priority_set_date,kind:e._priority_set_kind,autoadded:e._priority_set_autoadded}}),created:l.DateFormats[0](R),modified:l.DateFormats[0](P),kind:c,tracking:v,createdBy:x,expanded:!1,autocreated:!!y&&y.autocreated,autoexpanded:!!y&&y.autoexpanded,pending:!1};if(v!==f.CDCCOITrackingOptionsNone){var D=e.auto_expand_pg_handler(C);if(D.size){var S=i.default.map(h(D),function(t){return e.json.Nodes[t]});if(!confirm('This cluster of interest does not include all the nodes in the current network that are eligible for membership by growth criterion "'+v+'". These '+e.unique_entity_list(S).length+" additional nodes will be automatically added to this cluster of interest when you save it. If you don’t want to add these nodes to the cluster of interest please select 'Cancel' and change the growth criterion."))return!1;i.default.each(S,function(e){C.nodes.push({name:e.id,added:P||R,kind:f.CDCCOINodeKindDefault})})}}var A=null;if(o.prior_name&&(A=y.pending?"insert":"update"),a=function(e,t,n,r,o,a){function s(){if(" "===t.name[0]||" "===t.name[t.name.length-1])return alert("Cluster of interest '"+t.name+"' has spaces either at the beginning or end of the name. Secure HIV-TRACE does not allow names that start or end with spaces."),!0;var n=new Set(i.default.map(t.nodes,function(e){return e.name}));return i.default.some(e.defined_priority_groups,function(e){if(e.nodes.length===n.size){var r=e.nodes.filter(function(e){return n.has(e.name)}).length===e.nodes.length;if(r&&e.tracking===t.tracking)return alert("Cluster of interest '"+e.name+"' has the same set of nodes and the same growth criterion as this new cluster of interest. Secure HIV-TRACE does not allow creating exact duplicates of clusters of interest."),!0;if(r)return!confirm("Warning! Cluster of interest '"+e.name+"' has the same set of nodes as this cluster of interest, but a different growth criterion'. Click 'OK' to create, or 'Cancel' to abort.")}return!1})}if(a=a||"insert",e.priority_groups_validate([t]),o){var l=i.default.findIndex(e.defined_priority_groups,function(e){return e.name===o});if(l>=0)o!==t.name&&(e.priority_groups_update_node_sets(o,"delete"),a="insert"),e.defined_priority_groups[l]=t;else{if(s())return!1;e.defined_priority_groups.push(t)}}else{if(s())return!1;e.defined_priority_groups.push(t)}return e.priority_groups_update_node_sets(t.name,a),k(e),!0}(e,C,0,0,o.prior_name,A),o.saved=!0,o.cleanup_attributes(),o.close(),"validate"===m&&e.priority_set_table_writeable){var E=d.get_ui_element_selector_by_role("priority_set_counts"),T=r.select(E),j=Number(T.text());T.text(j-1),r.select("#banner_coi_counts").text(j-1)}}o.first_save=!1}var N=document.querySelector(d.get_ui_element_selector_by_role("priority-panel-name"));return N&&N.focus(),a}var B=A.append("button").classed("btn btn-primary btn-sm pull-right",!0).text("validate"===m?"Review & Save":"Save").attr("disabled","disabled").attr("id","priority-panel-save").on("click",function(e){L()});A.append("button").classed("btn btn-info btn-sm pull-right",!0).attr("id","priority-panel-preview").text("Preview @1.5%").on("click",function(t){C(e,v,{"priority-edge-length":.015,timestamp:R})}),A.append("button").classed("btn btn-info btn-sm pull-right",!0).attr("id","priority-panel-preview-subcluster").text("Preview @"+100*e.subcluster_threshold+"%").on("click",function(t){C(e,v,{"priority-edge-length":e.subcluster_threshold,timestamp:R})}),p(j.node()).on("input propertychange",function(t){var n=p(this).val();if(_(e.defined_priority_groups,n,o.prior_name))T.classed({"has-success":!0,"has-error":!1,"has-warning":!1}),N.text("Name this cluster of interest"),o.network_nodes.length&&B.attr("disabled",null);else{var r=n.length>=36;T.classed({"has-success":!1,"has-error":!0});var i=r?"MUST be shorter than 36 characters":"MUST be unique";N.text("Name this cluster of interest "+i),B.attr("disabled","disabled")}}),n&&(j.attr("value",n),p(j.node()).trigger("input")),o.selectable_entities=e.has_multiple_sequences?i.default.map(e.primary_key_list,function(e,t){return{id:t}}):e.json.Nodes;var U=s()(d.get_ui_element_selector_by_role("priority-panel-nodeids"),{hint:!1},[{source:function(e,t){for(var n=[],r=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),i=0;n.length<10&&i<o.selectable_entities.length;i++)r.test(o.selectable_entities[i].id)&&o.can_add(o.selectable_entities[i].id)&&n.push(o.selectable_entities[i].id);t(n)},templates:{suggestion:function(e){return e}}}]);o.validate_input=function(e,t){e=e||U.autocomplete.getVal();var n=i.default.filter(o.selectable_entities,function(t){return t.id===e});return 1===n.length&&o.can_add(n[0].id)?(t||E.attr("disabled",null),n[0]):(t||E.attr("disabled","disabled"),null)},o._append_node=function(t){var n;console.log(t,P,R),"_priority_set_date"in t||(t._priority_set_date=P||R),"_priority_set_kind"in t||(t._priority_set_kind=f.CDCCOINodeKindDefault);var r=[];e.has_multiple_sequences&&t.id in e.primary_key_list?r.push.apply(r,h(e.primary_key_list[t.id])):r.push(t),i.default.each(r,function(e){"_priority_set_date"in e||(e._priority_set_date=P||R),"_priority_set_kind"in e||(e._priority_set_kind=f.CDCCOINodeKindDefault)}),(n=o.network_nodes).push.apply(n,r)},o.can_add_nodes=function(){return x===f.CDCCOICreatedManually||(alert("Cannot add nodes to system generated clusters of interest. You may clone this cluster of interest and then add nodes to it manually if necessary."),!1)},o.append_node=function(e,t){if(o.can_add_nodes()){var n=o.validate_input(e,t);n&&(o._append_node(n),o.table_handler(o),o.validate_input())}},o.append_nodes=function(t,n,r){if(o.can_add_nodes()){var a={};i.default.each(o.network_nodes,function(e){a[e.id]=1});var s=!1,l={};i.default.each(e.json.Nodes,function(e){a[e.id]||(l[e.id]=n?i.default.extend(e,n[e.id]):e)}),t=r?i.default.map(t,function(e){return{id:e}}):i.default.flatten(i.default.map(t,function(t){return e.fetch_sequence_objects_for_pid(t)})),i.default.each(t,function(e){!(e.id in a)&&e.id in l?(o._append_node(l[e.id]),a[e.id]=1,s=!0):console.log("***",e)}),s&&o.table_handler(o)}},o.append_node_objects=function(e){if(o.can_add_nodes()){var t={};i.default.each(o.network_nodes,function(e){t[e.id]=1});var n=!1;i.default.each(e,function(e){e.id in t||(o._append_node(e),t[e.id]=1,n=!0)}),n&&o.table_handler(o)}},o.remove_node=function(t){var n=e.entity_id(t);o.network_nodes=i.default.filter(o.network_nodes,function(t){return e.entity_id(t)!==n}),o.table_handler(o)},U.on("autocomplete:selected",function(e,t,n,r){U.autocomplete.setVal(t),o.validate_input()}).on("input propertychange",function(){o.validate_input()}),o.table_handler=function(t){var n=S.selectAll("table").data(["panel"]);n.enter().append("table"),n.classed("table table-striped table-condensed table-hover table-smaller",!0).attr("id","priority-panel-node-table");var i=e.aggregate_indvidual_level_records(t.network_nodes);t.setHeaderTitle("clusterOI editor ("+i.length+" persons)"+(m?" [automatically created review] ":"")),B.attr("disabled",t.network_nodes.length?null:"disabled");var a=function(){return'<form class="form">\n <div class="form-group">\n <div class="input-group"> <textarea class="form-control input-sm" data-hivtrace-ui-role="priority-description-form"\n cols="40" rows="3"></textarea> </div>\n </div> <button data-hivtrace-ui-role="priority-description-dismiss" class="btn btn-sm btn-default">Cancel</button>\n <button data-hivtrace-ui-role="priority-description-save" class="btn btn-sm btn-default">Delete</button>\n</form>'},s=[{prepend:!0,description:{value:"Added",help:"When was this person added to the cluster of interest?"},generator:function(e){return{value:e,callback:function(e,t){var n=r.select(e);t._priority_set_date?(t._priority_set_autoadded&&n.style("color","darkred"),q(t)?n.append("input").attr("type","date").attr("value",l.DateViewFormatSlider(t._priority_set_date)).on("change",function(e,n){try{t._priority_set_date=l.DateViewFormatSlider.parse(p(r.event.target).val())}catch(e){}}):n.text(l.DateViewFormatMMDDYYY(t._priority_set_date))):n.text("N/A")}}}},{prepend:!0,description:{value:"Person identification method",help:"How was this person identified as part of this cluster of interest?"},generator:function(e){return{value:e,html:!0,actions:function(e,t){return q(t)?[{classed:{"btn-default":!0},text:t._priority_set_kind,help:"How was this person identified?",dropdown:f.CDCCOINodeKind,action:function(e,n){t._priority_set_kind=n,e.text(t._priority_set_kind)}}]:[]},callback:function(e,t){var n=r.select(e);return q(t)||n.append("abbr").attr("title",t._priority_set_kind).text(t._priority_set_kind),n}}}},{prepend:!0,description:{value:"",actions:[{icon:"fa-trash",action:function(e,i){var o=new Set(t.network_nodes);n.selectAll("tr").filter(function(e){return"none"!==r.select(this).style("display")}).each(function(e){r.select(this).selectAll("td:first-child > button").each(function(e){var t=r.select(this).datum();q(t)&&o.delete(t)})});var a=o.values();t.network_nodes=[];var s,l=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=g(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(a);try{for(l.s();!(s=l.n()).done;){var u=s.value;t.network_nodes.push(u)}}catch(e){l.e(e)}finally{l.f()}t.table_handler(t)}}]},generator:function(e){return{value:e,callback:function(e,t){var n=r.select(e);!function(e,t){return t===f.CDCCOICreatedManually||!e._priority_set_fixed}(t,x)?n.append("button").classed("btn btn-default btn-xs",!0).style("margin-left","1em").datum(t).property("disabled",!0).append("i").classed("fa fa-ban",!0):n.append("button").classed("btn btn-default btn-xs",!0).style("margin-left","1em").datum(t).on("click",function(){w(r.select(this),a,"Are you sure you wish to permanently delete this node from the cluster of interest?",function(e){o.remove_node(t)},!0),r.event.preventDefault()}).append("i").classed("fa fa-trash",!0)}}}}];e._is_CDC_auto_mode||s.splice(1,1),o.table_entities=e.aggregate_indvidual_level_records(t.network_nodes),e.draw_extended_node_table(o.table_entities,n,s)},o.content.style.padding="5px",o.network_nodes=t,m&&i.default.each(o.network_nodes,function(e){e._priority_set_fixed=!0}),y&&D(e,o.network_nodes,y.nodes),o.table_handler(this)},dragit:{containment:[50,50,100,50]},resizeit:{containment:[50,50,100,50]},onbeforeclose:function(){if(!this.saved){if(confirm("Close cluster of interest editor? Unsaved changes will be lost.")){if(y){var e=new Set(i.default.map(y.nodes,function(e){return e.name}));y.node_objects=i.default.filter(y.node_objects,function(t){return e.has(t.id)})}return this.cleanup_attributes(),!0}return!1}return!0},onclosed:function(){v=null,e.redraw_tables()}})))}function w(e,t,n,i,o){"shown"!==(e=p(e.node())).data("popover_shown")?(e.popover({sanitize:!1,placement:"right",container:"body",html:!0,content:t,trigger:"manual"}).on("shown.bs.popover",function(t){var a=r.select(this),s=r.select("#"+a.attr("aria-describedby")),l=s.selectAll(d.get_ui_element_selector_by_role("priority-description-form")),u=s.selectAll(d.get_ui_element_selector_by_role("priority-description-save"));l.text(n),o&&l.attr("disabled",!0),u.on("click",function(t){i(p(l.node()).val()),r.event.preventDefault(),e.click()}),(u=s.selectAll(d.get_ui_element_selector_by_role("priority-description-dismiss"))).on("click",function(t){r.event.preventDefault(),e.click()})}).popover("show"),e.data("popover_shown","shown"),e.off("hidden.bs.popover").on("hidden.bs.popover",function(){p(this).data("popover_shown","hidden")})):(e.data("popover_shown","hidden"),e.popover("destroy"))}function x(e,t){var n=i.default.flatten([i.default.map([e.subcluster_threshold,.015],function(n){var r=[{label:"View this cluster of interest at link distance of "+f.formats.PercentFormatShort(n),action:function(r,i){C(e,t,{timestamp:t.modified||t.created,priority_set:t,"priority-edge-length":n,title:t.name+" @"+f.formats.PercentFormat(n)})}}];return e.has_multiple_sequences&&r.push({label:"View this cluster of interest at link distance of "+f.formats.PercentFormatShort(n)+" (sequence level)",action:function(r,i){C(e,t,{timestamp:t.modified||t.created,priority_set:t,"priority-edge-length":n,title:t.name+" @"+f.formats.PercentFormat(n)+" (sequence level)",raw_mspp:!0})}}),r})]);return e._is_CDC_executive_mode||(n.push({label:"Clone this cluster of interest in a new editor panel",action:function(n,r){var o=e.priority_groups_find_by_name(t.name),a=i.default.clone(o.node_objects);D(e,a,t.nodes),b(e,a,"","Clone of "+t.name,o.kind),e.redraw_tables()}}),"System"!==t.createdBy&&n.push({label:"Delete this cluster of interest",action:function(n,r){confirm("This action cannot be undone. Proceed?")&&e.priority_groups_remove_set(t.name,!0)}}),n.push({label:"View nodes in this cluster of interest",data:{toggle:"modal",target:d.get_ui_element_selector_by_role("cluster_list"),priority_set:t.name}})),n.push({label:"Modify this cluster of interest",action:function(n,r){var i=e.priority_groups_find_by_name(t.name);i&&(b(e,i.node_objects,i.name,i.description,i.kind,null,"update",i,i.tracking),e.redraw_tables())}}),n}function k(e,t,n){if(t=t||e.priority_set_table){n=n||e.defined_priority_groups,e.priority_groups_compute_node_membership(),e.priority_groups_compute_overlap(n);var o=[[{value:"Type",sort:function(e){return e.value},help:"How was this cluster of interest created",width:50},{value:"Name",sort:"value",filter:!0,width:325,text_wrap:!0,help:"Cluster of interest name"},{value:"Modified/created",width:180,sort:function(e){return e.value[0]},help:"When was the cluster of interest created/last modified"},{value:"Growth",sort:"value",help:"How growth is handled",width:100},{value:"Size",width:100,presort:"desc",sort:function(e){return(e=e.value)?e[1]+(e[2]?1e10:0)+(e[3]?1e5:0):0},help:"Number of nodes in the cluster of interest"},{value:"Priority",width:60,sort:"value",help:"Does the cluster of interest continue to meet priority criteria?"},{value:"DXs in last 12 mo.",width:50,sort:"value",help:"The number of cases in the cluster of interest diagnosed in the past 12 months"},{value:"Overlap",width:140,sort:function(e){return(e=e.value)?e[1]:0},help:"How many other ClusterOI have overlapping nodes with this ClusterOI, and (if overlapping ClusterOI exist) how many nodes in this ClusterOI overlap with ANY other ClusterOI?"}]];e._is_CDC_auto_mode&&o[0].splice(3,0,{value:"clusterOI identification method",width:100,sort:function(e){return e.value},help:"Method of cluster identification"});var a=function(){return'<form class="form"> \n <div class="form-group"> \n <div class="input-group">\n <textarea class="form-control input-sm" data-hivtrace-ui-role = "priority-description-form" cols = "40" rows = "3"></textarea>\n </div>\n </div>\n <button data-hivtrace-ui-role = "priority-description-dismiss" class = "btn btn-sm btn-default">Dismiss</button>\n <button data-hivtrace-ui-role = "priority-description-save" class = "btn btn-sm btn-default">Save</button>\n </form>'},s=[];i.default.each(n,function(t){var n=[{value:t.createdBy,html:!0,width:50,format:function(e){return t.createdBy===f.CDCCOICreatedBySystem?'<i class="fa fa-2x fa-desktop" title="'+f.CDCCOICreatedBySystem+'" data-text-export='+f.CDCCOICreatedBySystem+"></i>":'<i class="fa fa-2x fa-user" title="'+f.CDCCOICreatedManually+'" data-text-export='+f.CDCCOICreatedManually+"></i>"}},{value:t.name,width:325,help:t.description+(t.pending?" (new, pending confirmation)":"")+(t.expanded?" ("+t.expanded+" new nodes; pending confirmation)":""),volatile:!0,format:function(e){return"<div style = 'white-space: nowrap; overflow: hidden; text-overflow : ellipsis;'>"+(t.autocreated||t.autoexpanded?(t.autoexpanded?'<span class="label label-default">Grew</span>':'<span class="label label-danger">New</span>')+"&nbsp;<span style = 'font-weight: 900;' data-text-export = '"+e+"'>"+e+"</span>":'<span data-text-export = "'+e+'">'+e+"</span>")+"</div>"},html:!0,actions:[]},{width:180,value:[t.modified,t.created],format:function(e){var t=i.default.map(e,function(e){return l.DateViewFormat(e)});return t[0]!==t[1]?t[0]+" / "+t[1]:t[0]}},{width:100,value:t.tracking,format:function(e){return f.CDCCOIConciseTrackingOptions[e]}},{value:[e.unique_entity_list(t.node_objects).length,i.default.chain(t.nodes).groupBy(function(t){return e.entity_id_from_string(t.name)}).mapObject(function(t){return i.default.uniq(i.default.map(t,function(t){return e.priority_groups_is_new_node(t)}))}).filter(function(e){return 1==e.length&&e[0]}).size().value(),t.createdBy===f.CDCCOICreatedBySystem&&t.pending,t.meets_priority_def],width:100,format:function(e){return e?e[0]+(e[1]?' <span title="Number of nodes added by the system since the last network update" class="label label-default">'+e[1]+" new</span>":""):"N/A"},html:!0},{width:60,value:t.meets_priority_def?"Yes":"No"},{width:50,value:t.cluster_dx_recent12_mo},{width:140,value:[t.overlap.sets,t.overlap.nodes,t.overlap.duplicate,t.overlap.superset],format:function(e){return e?String(e[0])+(e[1]?' <span title="Number of persons in the overlap" class="label label-default pull-right">'+e[1]+" persons</span>":"")+(e[2].length?' <span title="clusterOIs which are exact duplicates of this clusterOI: '+e[2].join(", ")+'" class="label label-danger pull-right">'+e[2].length+" duplicate clusterOI</span>":"")+(e[3].length?' <span title="clusterOIs which contain this clusterOI: '+e[3].join(", ")+'" class="label label-warning pull-right">Fully contained in '+e[3].length+" clusterOI</span>":""):"N/A"},html:!0,actions:0===t.overlap.sets?[]:[{icon:"fa-eye",dropdown:[{label:"List overlaps",data:{toggle:"modal",target:d.get_ui_element_selector_by_role("overlap_list"),priority_set:t.name}}]}]}];e._is_CDC_auto_mode&&n.splice(3,0,{value:t.kind,width:100,format:function(e){return e||"N/A"},html:!0}),t.pending?n[1].actions=[{icon:"fa-eye",help:"Review and adjust this cluster of interest",action:function(n,r){var i=e.priority_groups_find_by_name(r);i&&(S()?alert("Cannot confirm a cluster of interest while an editor window is open"):(b(e,i.node_objects,i.name,i.description,i.kind,null,"validate",i,t.tracking,t.createdBy),e.redraw_tables()))}}]:(n[1].actions=[i.default.clone(n[1].actions)],n[1].actions[n[1].actions.length-1].splice(-1,0,{icon:"fa-info-circle",classed:{"view-edit-cluster":!0},help:"View/edit this cluster of interest",dropdown:x(e,t)},{icon:"fa-edit",classed:{"btn-info":!0},help:"Edit description",action:function(n,r){w(n,a,t.description,function(n){e.priority_groups_edit_set_description(t.name,n,!0)})}}),n[1].actions[n[1].actions.length-1].splice(-1,0,function(t,n){return S()?{icon:"fa-plus",help:"Add nodes in this cluster of interest to the new cluster of interest",action:function(t,n){var r=e.priority_groups_find_by_name(n);r&&S().append_node_objects(r.node_objects)}}:null})),n[1].actions=i.default.flatten(n[1].actions),t.not_in_network.length&&(n[2].actions=[{text:String(t.not_in_network.length)+" removed",classed:{"btn-danger":!0,disabled:!0},help:"Nodes removed from the network: "+t.not_in_network.join(", ")}]),s.push(n)}),u.add_a_sortable_table(t,o,s,!0,'Showing <span class="badge" data-hivtrace-ui-role="table-count-shown">--</span>/<span class="badge" data-hivtrace-ui-role="table-count-total">--</span> clusters of interest.\n <button class = "btn btn-sm btn-warning pull-right" data-hivtrace-ui-role="priority-subclusters-export">Export to JSON</button>\n <button class = "btn btn-sm btn-primary pull-right" data-hivtrace-ui-role="priority-subclusters-export-csv">Export to CSV</button>',S()),r.select(d.get_ui_element_selector_by_role("priority-subclusters-export")).on("click",function(t){c.export_json_button(e.priority_groups_export(),l.DateViewFormatSlider(e.today))}),r.select(d.get_ui_element_selector_by_role("priority-subclusters-export-csv")).on("click",function(t){c.export_csv_button(e.priority_groups_export_nodes(),"clusters-of-interest")}),r.select("#priority_set_table_download").on("click",function(t){c.export_csv_button(e.priority_groups_export_sets(),"clusters_of_interest_table")})}}function C(e,t,n){n=n||{};var o=t.node_objects||t.network_nodes,a=l.getCurrentDate(),s=n["priority-edge-length"]||e.subcluster_threshold,u=n.timestamp||e.today,c=n.title||"clusterOI "+(t.prior_name||t.name||"unnamed"),p={};t.nodes?i.default.each(t.nodes,function(e){p[e.name]=e.added}):i.default.each(t.network_nodes,function(e){p[e.id]=e._priority_set_date});var h={};n.priority_set&&n.priority_set.nodes&&i.default.each(n.priority_set.nodes,function(e){h[e.name]=e.added}),i.default.each(o,function(e){e.priority_set=1,e._added_date=e.id in h?h[e.id]:e._priority_set_date,e._added_date?e._added_date=l.DateViewFormatSlider(e._added_date):e._added_date=null});var g=i.default.sortBy(i.default.keys(i.default.groupBy(o,function(e){return e._added_date}))),m=i.default.flatten((0,d.hivtrace_cluster_depthwise_traversal)(e.json.Nodes,e.json.Edges,function(e){return e.length<=s},null,o)),v=l.DateViewFormat(u),y=r.scale.ordinal().range(i.default.map(i.default.range(0,18,6),function(e){return"#"+"fee8c8fdbb84e34a33".substr(e,6)})),_=r.scale.ordinal().range(i.default.map(i.default.range(0,24,6),function(e){return"#"+"7b3294c2a5cfa6dba0008837".substr(e,6)})),b=[],w={};i.default.each(g,function(e,t){if(e){if(g.length>4){if(t<g.length-4)return void(w[e]=0);if(t===g.length-4)return w[e]=b.length,void b.push("In cluster of interest (added on or before "+e+")")}w[e]=b.length,b.push("In cluster of interest (added "+e+")")}});var x=b.length;b.push("Diagnosed and in network before "+v),b.push("Diagnosed or in network on or after "+v+" [directly linked to cluster of interest]"),b.push("Diagnosed or in network on or after "+v+" [indirectly linked to cluster of interest]");var k=[].concat(b,[f.missing.label]),C=i.default.map(k,function(e,t){return e!==f.missing.label?t<x?_(e):y(e):"gray"});i.default.each(i.default.groupBy(m,function(t){return e.primary_key(t)}),function(e,t){e.length>1&&i.default.each(["_added_date","priority_set"],function(t){var n=r.min(i.default.map(e,function(e){return e[t]}));i.default.each(e,function(e){e[t]=n})})}),e.view_subcluster(-1,m,c,{"simplified-mspp":!n.raw_mspp,skip_recent_rapid:!0,init_code:function(e){i.default.each(e.json.Edges,function(t){var n=null;1===e.json.Nodes[t.target].priority_set?n=e.json.Nodes[t.source]:1===e.json.Nodes[t.source].priority_set&&(n=e.json.Nodes[t.target]),n&&1!==n.priority_set&&(n.priority_set=2)})},"computed-attributes":{date_added:{depends:[l._networkCDCDateField],label:"Date added to cluster of interest",type:"Date",map:function(e){return e.id in p?p[e.id]:f.missing.label}},priority_set:{depends:[l._networkCDCDateField],label:"Cluster of Interest Status",enum:b,type:"String",map:function(t){return 1===t.priority_set?t._added_date?b[w[t._added_date]]:b[0]:e.filter_by_date(u,l._networkCDCDateField,a,t,!0)?2===t.priority_set?b[x+1]:b[x+2]:b[x]},color_scale:function(){return r.scale.ordinal().domain(k).range(C)}}}},null,null,s).handle_attribute_categorical("priority_set"),i.default.each(o,function(e){delete e.priority_set})}function D(e,t,n){var r={};i.default.each(n,function(t,n){r[t.name]={_priority_set_date:t.added||e.today,_priority_set_kind:t.kind||f.CDCCOINodeKindDefault,_priority_set_autoadded:t.autoadded||!1}}),i.default.each(t,function(e){e.id in r&&i.default.extend(e,r[e.id])})}function S(){return v}},8834:function(e,t,n){"use strict";function r(e,t){return'<div class="col-lg-2 hivtrace-color-picker">\n <input type="color" name="'.concat(e,'" value="').concat(t.category(e),'">\n <label for="').concat(e,'">').concat(e,"</label>\n </div>")}function i(e,t){return'<div class="col-lg-2 hivtrace-color-picker">\n <input type="color" name="'.concat(e.toLowerCase(),'" value="').concat(t,'">\n <label for="').concat(e.toLowerCase(),'">').concat(e,"</label>\n </div>")}function o(e,t){return'<div class="col-lg-2 hivtrace-color-stops">\n <label for="color-stop">'.concat(e,'</label>\n <input type="number" name="color-stop" value="').concat(t,'" min="0" max="20"">\n </div>')}n.r(t),n.d(t,{colorPickerInput:function(){return r},colorPickerInputContinuous:function(){return i},colorStops:function(){return o}})},5795:function(e,t,n){var r=n(9983),i=n(3857),o=n(9050),a=n(6822),s=n(1138),l=n(6221);e.exports={secure_hiv_trace_subcluster_columns:function(e){return[{description:{value:"Cases dx within 36 months",sort:function(t){return t.value.length?i.max(o.map(t.value,function(t){return e.unique_entity_list_from_ids(t).length})):0},help:"Number of cases diagnosed in the past 36 months connected only through cases diagnosed within the past 36 months"},generator:function(t){return{html:!0,value:t.recent_nodes,volatile:!0,format:function(t){return(t=t||[]).length?o.map(t,function(t){return e.unique_entity_list_from_ids(t).length}).join(", "):""},actions:function(e,n){return a.get_editor()&&0!==t.recent_nodes.length?o.map(t.recent_nodes,function(e){var n=new Set(e);return{icon:"fa-plus",action:function(e,r){return a.get_editor()&&a.get_editor().append_node_objects(o.filter(t.children,function(e){return n.has(e.id)&&e.priority_flag>0})),!1},help:"Add to cluster of interest"}}):null}}}},{description:{value:"Cases dx within 12 months",sort:function(t){var n=t.value||[];return n.length>0?i.max(o.map(n,function(t){return e.unique_entity_list_from_ids(t).length})):0},presort:"desc",help:"Number of cases diagnosed in the past 12 months connected only through cases diagnosed within the past 36 months"},generator:function(t){return{html:!0,value:t.priority_score,volatile:!0,format:function(t){if((t=t||[]).length){var n=o.map(t,function(t){return e.unique_entity_list_from_ids(t).length}),r=n.join(", ");return n[0]>=e.CDC_data["autocreate-priority-set-size"]?"<span style='color:red'>"+r+"</span>":r}return""},actions:function(n,u){var c=[];return t.priority_score.length>0&&(c=c.concat(o.map(t.priority_score,function(t){return{icon:"fa-question",help:"Do some of these "+t.length+" nodes belong to a cluster of interest?",action:function(n,a){var u=new Set(t);"shown"!==(n=r(n.node())).data("popover_shown")?(n.popover({sanitize:!1,placement:"right",container:"body",html:!0,content:s.HIVTxNetwork.lookup_form_generator,trigger:"manual"}).on("shown.bs.popover",function(t){var n=i.select(this),r=i.select("#"+n.attr("aria-describedby")).selectAll(e.get_ui_element_selector_by_role("priority-membership-list",!0));r.selectAll("li").remove();var a=o.filter(o.map(e.defined_priority_groups,function(e){return[e.name,o.filter(e.nodes,function(e){return u.has(e.name)}).length,o.filter(e.partitioned_nodes[1].new_direct,function(e){return u.has(e.id)}).length,o.filter(e.partitioned_nodes[1].new_indirect,function(e){return u.has(e.id)}).length]}),function(e){return e[1]+e[2]+e[3]>0});a=0===a.length?[["No nodes belong to any cluster of interest or are linked to any of the clusters of interest."]]:o.map(a,function(t){var n="";return t[1]&&(n+=" "+t[1]+" nodes belong"),t[2]&&(n+=(n.length?", ":" ")+t[2]+" nodes are directly linked @ "+l.formats.PercentFormatShort(e.subcluster_threshold)),t[3]&&(n+=(n.length?", ":" ")+t[3]+" nodes are indirectly linked @ "+l.formats.PercentFormatShort(e.subcluster_threshold)),n+" to cluster of interest <code>"+t[0]+"</code>"}),(r=r.selectAll("li").data(a)).enter().insert("li"),r.html(function(e){return e})}).popover("show"),n.data("popover_shown","shown"),n.off("hidden.bs.popover").on("hidden.bs.popover",function(){r(this).data("popover_shown","hidden")})):(n.data("popover_shown","hidden"),n.popover("destroy"))}}}))),a.get_editor()&&t.priority_score.length>0&&(c=c.concat(o.map(t.priority_score,function(e){var n=new Set(e);return{icon:"fa-plus",action:function(e,r){return a.get_editor()&&a.get_editor().append_node_objects(o.filter(t.children,function(e){return n.has(e.id)&&(2===e.priority_flag||1===e.priority_flag)})),!1},help:"Add to cluster of interest"}}))),c}}}}]}}},6221:function(e,t,n){var r=n(3857),i=n(9050),o=["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],a=[];i.each([0,-.8],function(e){i.each(o,function(t){a.push(r.rgb(t).darker(e).toString())})});var s=a.length,l=["01 state/local molecular cluster analysis","02 national molecular cluster analysis","03 state/local time-space cluster analysis","04 national time-space cluster analysis","05 provider notification","06 partner services notification","07 other"],u=["01. Add cases diagnosed in the past 3 years and linked at 0.5% to a member in this cluster of interest","02. Add cases (regardless of HIV diagnosis date) linked at 0.5% to a member in this cluster of interest","03. Add cases diagnosed in the past 3 years and linked at 1.5% to a member in this cluster of interest","04. Add cases (regardless of HIV diagnosis date) linked at 1.5% to a member in this cluster of interest","05. Do not add cases to this cluster of interest. I do not want to monitor growth in this cluster of interest over time."],c={};c[l[0]]=!0;var d=u[0],f=u[4],p={};p[u[0]]=function(e,t){return e.length<.005},p[u[1]]=function(e,t){return e.length<.005},p[u[2]]=function(e,t){return e.length<.015},p[u[3]]=function(e,t){return e.length<.015};var h={};h[u[0]]=36,h[u[1]]=1e5,h[u[2]]=36,h[u[3]]=1e5;var g={};g[u[0]]="3 years, 0.5% distance",g[u[1]]="0.5% distance",g[u[2]]="3 years, 1.5% distance",g[u[3]]="1.5% distance",g[u[4]]="None";var m=["01 through analysis/notification","02 through investigation"],v=new Set(["alaska","delaware","hawaii","idaho","iowa","kansas","maine","montana","nebraska","new hampshire","newhampshire","new mexico","newmexico","north dakota","northdakota","rhode island","rhodeisland","south dakota","southdakota","utah","vermont","virgin islands","virginislands","west virginia","westvirginia","wyoming"]),y=l[0],_=m[0],b={FloatFormat:r.format(",.2r"),PercentFormat:r.format(",.3p"),PercentFormatShort:r.format(".2p"),DotFormatPadder:r.format("08d")};e.exports={Categorical:a,CategoricalBase:o,CDCCOICanAutoExpand:c,CDCCOIConciseTrackingOptions:g,CDCCOICreatedBySystem:"System",CDCCOICreatedManually:"Manual",CDCCOIKind:l,CDCCOIKindAutomaticCreation:y,CDCCOINodeKind:m,CDCCOINodeKindDefault:_,CDCCOITrackingOptions:u,CDCCOITrackingOptionsDateFilter:h,CDCCOITrackingOptionsDefault:d,CDCCOITrackingOptionsDistanceFilter:p,CDCCOITrackingOptionsNone:f,CDCJurisdictionCodes:{alabama:"al",alaska:"ak",americansamoa:"as",arizona:"az",arkansas:"ar",california:"ca",colorado:"co",connecticut:"ct",delaware:"de",districtofcolumbia:"dc",federatedstatesofmicronesia:"fm",florida:"fl",georgia:"ga",guam:"gu",hawaii:"hi",houston:"hx",idaho:"id",illinois:"il",indiana:"in",iowa:"ia",kansas:"ks",kentucky:"ky",louisiana:"la",maine:"me",marshallislands:"mh",maryland:"md",massachusetts:"ma",michigan:"mi",minnesota:"mn",mississippi:"ms",missouri:"mo",montana:"mt",nebraska:"ne",nevada:"nv",newhampshire:"nh",newjersey:"nj",newmexico:"nm",newyorkstate:"ny",nyc:"nx",northcarolina:"nc",north_dakota:"nd",northernmarianaislands:"mp",ohio:"oh",oklahoma:"ok",oregon:"or",palau:"pw",pennsylvania:"pa",puertorico:"pr",rhodeisland:"ri",southcarolina:"sc",southdakota:"sd",tennessee:"tn",texas:"tx",utah:"ut",vermont:"vt",virginislands:"vi",virginia:"va",washington:"wa",washingtondc:"dc",westvirginia:"wv",wisconsin:"wi",wyoming:"wy",chicago:"cx",philadelphia:"px",losangeles:"lx",sanfrancisco:"sx",republicofpalau:"pw","u.s.virginislands":"vi"},CDCJurisdictionLowMorbidity:v,CDCNPMember:"Ever in national priority clusterOI?",EdgeColorBase:["#000000","#aaaaaa"],formats:b,MaximumValuesInCategories:s,missing:{color:"#999",opacity:"0.1",label:"缺失"},network:{GraphAttrbuteID:"patient_attribute_schema",NodeAttributeID:"patient_attributes",ReducedValue:"Different (other) value",ContinuousColorStops:9,WarnExecutiveMode:"This feature is not available in the executive mode.",AliasedSequencesID:"aliased_sequences"},PresetColorSchemes:{sex_trans:{"MSM-Male":"#1f78b4","MMSC-Male":"#FFBF00","MSM-Unknown sex":"#1f78b4","MMSC-Unknown sex":"#FFBF00","Heterosexual Contact-Male":"#AAFF00","Heterosexual Contact-Female":"#AAFF00","Heterosexual Contact-Unknown sex":"#AAFF00","IDU-Male":"#0096FF","MSM & IDU-Male":"#33a02c","MMSC & IDU-Unknown sex":"#0096FF","MMSC & IDU-Male":"#FFBF00","IDU-Female":"#0096FF","IDU-Unknown sex":"#0096FF","Other/Unknown-Male":"#636363","Other/Unknown-Female":"#636363","Other-Male":"#636363","Other-Female":"#636363",Missing:"#636363","":"#636363","Other/Unknown-Unknown sex":"#636363",Perinatal:"#D2042D","Other/Unknown-Child":"#D2042D","Other-Child":"#D2042D"},race_cat:{Asian:"#1f77b4","Black/African American":"#bcbd22","Hispanic/Latino":"#9467bd","American Indian/Alaska Native":"#2ca02c","Native Hawaiian/Other Pacific Islander":"#17becf","Multiple Races":"#e377c2",Multiracial:"#e377c2","Multiple races":"#e377c2","Unknown race":"#999",Missing:"#999",missing:"#999",White:"#d62728"},sex_birth:{Male:"#FF6700",Female:"#50c878",Unknown:"#999"},birth_sex:{Male:"#FF6700",Female:"#50c878",Unknown:"#999"},gender_identity:{Woman:"#AAFF00","Transgender woman":"#228B22",Man:"#FFBF00","Transgender man":"#FF5F1F","Declined to answer":"#FAFA33","Additional gender identity":"#D2042D",Missing:"#999",Unknown:"#999"}},PresetShapeSchemes:{birth_sex:{Male:"square",Female:"ellipse",Missing:"diamond",missing:"diamond",Unknown:"diamond"},sex_birth:{Male:"square",Female:"ellipse",Missing:"diamond",missing:"diamond",Unknown:"diamond"},gender_identity:{Man:"square",Woman:"ellipse","Transgender man":"hexagon","Transgender woman":"circle","Additional gender identity":"pentagon",Unknown:"diamond","Declined to answer":"diamond"},race_cat:{Asian:"hexagon","Black/African American":"square","Hispanic/Latino":"triangle","American Indian/Alaska Native":"pentagon","Native Hawaiian/Other Pacific Islander":"octagon","Multiple Races":"diamond","Unknown race":"diamond",Missing:"diamond",missing:"diamond",White:"ellipse"},current_gender:{Male:"square",Female:"ellipse","Transgender-Male to Female":"hexagon","Transgender-Female to Male":"pentagon","Additional Gender Identity":"diamond",Unknown:"diamond",Missing:"diamond",missing:"diamond"}},SequentialColor:{2:["#feb24c","#e31a1c"],3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},ShapeOrdering:["circle","square","hexagon","diamond","cross","octagon","ellipse","pentagon"],SubclusterSeparator:".",CoIAddLimit:128}},2033:function(e,t,n){var r=n(3857),i=n(9983),o=n(9050);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var s=n(3729);e.exports.export_csv_button=function(e,t){if(null!==(e=r.csv.format(e))){t=t?t+".csv":"export.csv";var n=document.createElement("a");n.setAttribute("href","data:text/csv;charset=utf-8,"+encodeURIComponent(e)),n.setAttribute("download",t),n.className="btn btn-default btn-sm",n.innerHTML='<span class="glyphicon glyphicon-floppy-save"></span> Download CSV',i("body").append(n),n.click(),n.remove()}},e.exports.export_json_button=function(e,t){if(null!==e){t=t||"export";var n=document.createElement("a");n.setAttribute("href","data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e))),n.setAttribute("download",t+".json"),n.className="btn btn-default btn-sm",n.innerHTML='<span class="glyphicon glyphicon-floppy-save"></span> Download JSON',i("body").append(n),n.click(),n.remove()}},e.exports.save_image=function(e,t){var n="http://www.w3.org/2000/xmlns/",r=i(t).find("svg")[0];r||(r=i(t)[0]);var o=function(e){function t(e){try{if(e.cssRules)for(var r=0;r<e.cssRules.length;r++){var i=e.cssRules[r];3===i.type?t(i.styleSheet):i.selectorText&&-1===i.selectorText.indexOf(">")&&(n+="\n"+i.cssText)}}catch(t){console.log("Could not process stylesheet : "+e)}}var n="",r=e.styleSheets;if(r)for(var i=0;i<r.length;i++)t(r[i]);return n}(window.document);r.setAttribute("version","1.1");var a=document.createElement("defs");r.insertBefore(a,r.firstChild);var l=document.createElement("style");a.appendChild(l),l.setAttribute("type","text/css"),r.removeAttribute("xmlns"),r.removeAttribute("xlink"),r.hasAttributeNS(n,"xmlns")||r.setAttributeNS(n,"xmlns","http://www.w3.org/2000/svg"),r.hasAttributeNS(n,"xmlns:xlink")||r.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink");var u,c,d,f,p=(new XMLSerializer).serializeToString(r).replace("</style>","<![CDATA["+o+"]]></style>"),h="data:image/svg+xml;base66,"+encodeURIComponent(['<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+p]);if(navigator.msSaveBlob)s(h,"image.svg","image/svg+xml");else if("png"===e)u=h,c=function(e){var t=window.URL.createObjectURL(e),n=document.createElement("a");n.setAttribute("download","image.png"),n.setAttribute("href",t),i("body").append(n),n.click(),n.remove()},d=function(e){console.log(error)},(f=new Image).onerror=d,f.onload=function(){var e=document.getElementById("hyphy-chart-canvas");e.width=f.width,e.height=f.height;var t=e.getContext("2d");if(t.fillStyle="#FFFFFF",t.fillRect(0,0,e.width,e.height),t.drawImage(f,0,0,e.width,e.height),e.msToBlob){var n=e.msToBlob(c);c(n),window.navigator.msSaveBlob(n,"image.png")}else e.toBlob(c)},f.src=u;else{var g=document.createElement("a");g.setAttribute("download","image.svg"),g.setAttribute("href",h),i("body").append(g),g.click(),g.remove()}},e.exports.describe_vector=function(e,t){var n;return e.length?(e.sort(r.ascending),n={min:r.min(e),max:r.max(e),median:r.median(e),Q1:r.quantile(e,.25),Q3:r.quantile(e,.75),mean:r.mean(e)}):n={min:null,max:null,median:null,Q1:null,Q3:null,mean:null},t&&(n="<pre>Range :"+n.min+"-"+n.max+"\nIQR :"+n.Q1+"-"+n.Q3+"\nMean :"+n.mean+"\nMedian :"+n.median+"\n</pre>"),n},e.exports.table_to_text=function(e,t){t=t||"\t";var n=[],i=function(e){var t=r.select(e).node().firstChild;if(t&&(t=t.nodeValue),t&&t.length)return t;var n=r.select(e).selectAll("[data-text-export]");return n.empty()?(n=r.select(e).selectAll("p, span, button, abbr, select")).empty()?"":r.select(n.node()).text():r.select(n.node()).attr("data-text-export")};r.selectAll(e+" thead th").each(function(){n.push(i(this))});var o=[];return r.select(e+" tbody").selectAll("tr").each(function(e){if("none"!==r.select(this).style("display")){var t=o.length;o.push([]),r.select(this).selectAll("td").each(function(){o[t].push(i(this))})}}),(","===t?r.csv.format([n]):r.tsv.format([n]))+"\n"+(","===t?r.csv.format(o):r.tsv.format(o))},e.exports.export_handler=function(e,t,n){if(window.navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./)){var r=window.open();r.document.write(e),r.document.close(),r.document.execCommand("SaveAs",!0,t+".csv"),r.close()}else{var i=document.createElement("a");i.setAttribute("href","data:"+(n||"text/plain")+";charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download",t||"download.tsv"),i.click(),i.remove()}},e.exports.getUniqueValues=function(e,t){var n=o.keys(t),r={};o.each(n,function(e){return r[e]=new Set});var i=o.map(e,function(e){return o.omit(e.patient_attributes,"_id")});return o.each(i,function(e){o.each(n,function(t){r[t].add(e[t])})}),o.mapObject(r,function(e){return function(e){if(Array.isArray(e))return a(e)}(t=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var t})},e.exports.exportColorScheme=function(e,t){var n=o.map(e[t.category_id],function(e){return t.category(e)});return o.object(e[t.category_id],n)},e.exports.copyToClipboard=function(e){navigator.clipboard.writeText(e).then(function(){console.log("Copying to clipboard was successful!")},function(e){console.error("Could not copy text: ",e)})},e.exports.collapseLargeCategories=function(e,t){var n=o.keys(t),r={};o.each(n,function(e){return r[e]=[]});var i=o.map(e,function(e){return o.omit(e.patient_attributes,"_id")});o.each(i,function(e){o.each(n,function(t){r[t].push(e[t])})});var a=o.mapObject(r,function(e){return o.countBy(e)});return o.each(n,function(t){var n=Object.entries(a[t]),r=o.sortBy(n,function(e){return-e[1]});if(r.length>12){var i=r[12][1],s=o.map(o.partition(r,function(e){return e[1]<=i})[0],o.first);o.each(e,function(e){o.contains(s,e.patient_attributes[t])&&(e.patient_attributes[t]="其他")})}}),!0}},4358:function(e,t,n){var r=n(3857),i=n(9050);t.K=function(e,t,n){var i=r.format(",.2f");!function(e,t,n,i,o){var a=10,s=30,l=50,u=30,c=300-u-s,d=300-a-l,f=r.scale.linear().domain([0,e.length+1]).range([0,c]),p=r.scale.log().domain([1,r.max(e)]).range([d,0]),h=r.sum(e),g=r.svg.axis().scale(f).orient("bottom"),m=r.select(o).selectAll("svg");m&&m.remove();var v=e.map(function(e,t){return{x:t+1,y:e+1}});v.push({x:e.length+1,y:1}),v.push({x:0,y:1}),v.push({x:0,y:e[0]+1}),m=r.select(o).insert("svg",".histogram-label").attr("width",c+u+s).attr("height",d+a+l).append("g").attr("transform","translate("+u+","+a+")").datum(v);var y=r.svg.line().x(function(e){return f(e.x)}).y(function(e){return p(e.y)}).interpolate("step-before");if(m.selectAll("path").remove(),m.append("path").attr("d",function(e){return y(e)+"Z"}).attr("class","histogram"),t){var _=r.svg.line().interpolate("linear").x(function(e,t){return f(t+1)+(f(t+1)-f(t))/2}).y(function(e){return p(1+e*h)});m.append("path").datum(t).attr("class","line").attr("d",function(e){return _(e)})}m.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")").call(g).selectAll("text").attr("transform","rotate(45)").attr("dx","1em").attr("dy","0.5em")}(e.Degrees.Distribution,e.Degrees.fitted,0,0,t);var o="Network degree distribution is best described by the <strong>"+e.Degrees.Model+"</strong> model, with &rho; of "+i(e.Degrees.rho);void 0!==e.Degrees["rho CI"]&&(o+=" (95% CI "+i(e.Degrees["rho CI"][0])+" - "+i(e.Degrees["rho CI"][1])+")"),r.select(n).html(o)},t.w=function(e,t,n){!function(e,t,n,o){var a={top:10,right:30,bottom:50,left:40},s=300-a.right,l=300-a.top-a.bottom,u=r.select(o).selectAll("svg");if(u&&u.remove(),e.length>0){var c=r.layout.histogram()(e),d=r.scale.linear().domain(r.extent(e)),f=r.scale.linear().domain([0,r.max(i.map(c,function(e){return e.y}))]).range([l,0]);a.left+=12+10*Math.ceil(Math.log10(f.domain()[1])),a.top+=18,s-=a.left,d.range([0,s]);var p=r.svg.axis().scale(d).orient("bottom"),h=r.svg.axis().scale(f).orient("left");c.splice(0,0,{x:d.domain()[0],y:0,dx:0}),c.splice(c.length,0,{x:d.domain()[1],y:0,dx:0}),u=r.select(o).insert("svg",".histogram-label").attr("width",s+a.left+a.right).attr("height",l+a.top+a.bottom).append("g").attr("transform","translate("+a.left+","+a.top+")").datum(c);var g=r.svg.line().x(function(e){return d(e.x+e.dx)}).y(function(e){return f(e.y)}).interpolate("step-before");u.selectAll("path").remove(),u.append("path").attr("d",function(e){return g(e)+"Z"}).attr("class","histogram"),u.append("g").attr("class","x axis").attr("transform","translate(0,"+l+")").call(p).selectAll("text").attr("transform","rotate(45)").attr("dx","1em").attr("dy","0.5em"),u.append("text").attr("transform","rotate(-90)").attr("y",0-a.left+12).attr("x",0-l/2).style("text-anchor","middle").text("边"),u.append("text").attr("transform","translate("+s/2+" ,"+(l+a.top+20)+")").style("text-anchor","middle").text("遗传距离"),u.append("g").attr("class","y axis").call(h)}}(i.map(e.Edges,function(e){return e.length}),0,0,t),r.select(n).html("链接节点间的遗传距离")}},1138:function(e,t,n){var r=n(3857);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function c(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var f=n(9050),p=n(4861),h=n(6221),g=n(4835),m=n(6822),v=function(){function e(t,n,i,o){var l=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"_calc_country_nodes",function(e){e&&"country-centers"in e&&(l.mapProjection=r.geo.mercator().translate([l.margin.left+l.width/2,l.margin.top+l.height/2]).scale(150*l.width/960),f.each(l.countryCentersObject,function(e){e.countryXY=l.mapProjection([e.longt,e.lat])}))}),c(this,"filter_by_size",function(e){return e.children.length>=l.minimum_cluster_size}),c(this,"unique_entity_list",function(e){return f.map(f.groupBy(e,function(e){return l.primary_key(e)}),function(e,t){return t})}),c(this,"unique_entity_list_from_ids",function(e){return l.unique_entity_list(f.map(e,function(e){return{id:e}}))}),c(this,"unique_entity_object_list",function(e){return f.groupBy(e,function(e){return l.primary_key(e)})}),c(this,"filter_singletons",function(e){return e.children.length>1}),c(this,"filter_if_added",function(e){return"existing"!==l.cluster_attributes[e.cluster_id].type}),c(this,"filter_time_period",function(e){return f.some(l.nodes_by_cluster[e.cluster_id],function(e){return l.attribute_node_value_by_id(e,p.getClusterTimeScale())>=l.using_time_filter})}),c(this,"priority_groups_find_by_name",function(e){return this.defined_priority_groups?f.find(this.defined_priority_groups,function(t){return t.name===e}):null}),c(this,"priority_groups_all_events",function(){var e=new Set;return this.defined_priority_groups&&f.each(this.defined_priority_groups,function(t){f.each(t.nodes,function(t){e.add(p.DateViewFormatSlider(t.added))})}),e}),c(this,"priority_groups_compute_overlap",function(e){var t=this;this.priority_node_overlap={};var n={},r={};f.each(e,function(e){n[e.name]=t.aggregate_indvidual_level_records(e.node_objects),r[e.name]=n[e.name].length,f.each(n[e.name],function(n){var r=t.entity_id(n);r in t.priority_node_overlap||(t.priority_node_overlap[r]=new Set),t.priority_node_overlap[r].add(e.name)})}),f.each(e,function(e){var i={sets:new Set,nodes:0,supersets:[],duplicates:[]},o={};f.each(n[e.name],function(n){var r=t.entity_id(n);t.priority_node_overlap[r].size>1&&(i.nodes++,t.priority_node_overlap[r].forEach(function(t){t!==e.name&&(t in o||(o[t]=[]),o[t].push(r)),i.sets.add(t)}))}),f.each(o,function(t,n){t.length==r[e.name]&&(r[n]==r[e.name]?i.duplicates.push(n):i.supersets.push(n))}),e.overlap={nodes:i.nodes,sets:Math.max(0,i.sets.size-1),superset:i.supersets,duplicate:i.duplicates}})}),c(this,"auto_expand_pg_handler",function(e,t,n){var r=this;t||(t={},f.each(this.json.Nodes,function(e,n){t[e.id]=n}));var i=new Set(f.map(e.nodes,function(e){return t[e.name]})),o=new Set,l=h.CDCCOITrackingOptionsDistanceFilter[e.tracking],u=this.get_reference_date();if(l){var c,d=p.n_months_ago(u,h.CDCCOITrackingOptionsDateFilter[e.tracking]);if(n){for(var m=a(i),v=new Set(m),y=0;y<m.length;y++){var _=m[y];_ in this.json.Nodes&&f.each(a(n[_]),function(e){var t=[];v.has(e.source)||t.push(e.source),v.has(e.target)||t.push(e.target),f.each(t,function(e){m.push(e),v.add(e)})})}c=new Set,f.each(f.filter(m,function(e){return e in r.json.Nodes}),function(e){var t,r=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=s(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(n[e]);try{for(r.s();!(t=r.n()).done;){var i=t.value;c.add(i)}}catch(e){r.e(e)}finally{r.f()}}),c=a(c)}else c=this.json.Edges;var b=g.hivtrace_cluster_depthwise_traversal(this.json.Nodes,c,function(e){var t=l(e);return t&&(i.has(e.source)&&i.has(e.target)||(t=t&&r.filter_by_date(d,p._networkCDCDateField,u,r.json.Nodes[e.source])&&r.filter_by_date(d,p._networkCDCDateField,u,r.json.Nodes[e.target]))),t},!1,f.filter(f.map(a(i),function(e){return r.json.Nodes[e]}),function(e){return e}));f.each(b,function(e){f.each(e,function(e){i.has(t[e.id])||o.add(t[e.id])})})}return o}),c(this,"priority_groups_export",function(e,t){return e=e||this.defined_priority_groups,f.map(f.filter(e,function(e){return t||e.validated}),function(e){return{name:e.name,description:e.description,nodes:e.nodes,modified:p.DateFormats[0](e.modified),kind:e.kind,created:p.DateFormats[0](e.created),createdBy:e.createdBy,tracking:e.tracking,autocreated:e.autocreated,autoexpanded:e.autoexpanded,pending:e.pending,history:e.history}})}),c(this,"priority_groups_update_node_sets",function(e,t){var n=this.priority_groups_find_by_name(e);if(n){var i=this.priority_groups_export([n]),o={operation:t,name:e,url:window.location.href,sets:JSON.stringify(i)};this.priority_set_table_write&&this.priority_set_table_writeable&&r.text(this.priority_set_table_write).header("Content-Type","application/json").post(JSON.stringify(o),function(e,t){e&&console.log("received fatal error:",e)})}}),c(this,"priority_groups_edit_set_description",function(e,t,n){var r=this.priority_groups_find_by_name(e);r&&(r.description=t,this.priority_groups_update_node_sets(e,"update"),n&&m.draw_priority_set_table(this))}),c(this,"priority_groups_remove_set",function(e,t){if(this.defined_priority_groups){var n=f.findIndex(this.defined_priority_groups,function(t){return t.name===e});n>=0&&(this.priority_groups_update_node_sets(e,"delete"),this.defined_priority_groups.splice(n,1),t&&m.draw_priority_set_table(this))}}),c(this,"priority_groups_export_nodes",function(e,t){var n=this;return e=e||this.defined_priority_groups,f.flatten(f.map(f.filter(e,function(e){return t||e.validated}),function(e){var t,i=new Set(e.not_in_network),o=n.aggregate_indvidual_level_records(e.node_objects);t=n.unique_entity_list_from_ids(f.map(f.filter(e.nodes,function(t){return t.added<=e.created}),function(e){return e.name})).length;var a=f.groupBy(f.filter(e.nodes,function(e){return!i.has(e.name)}),function(e){return n.entity_id_from_string(e.name)}),s=f.groupBy(f.filter(e.node_objects,function(e){return!i.has(e.id)}),function(e){return n.entity_id_from_string(e.id)});return f.map(f.filter(o,function(e){return new Set(n.list_of_aliased_sequences(e)).difference(i).size>0}),function(i){var l=n.entity_id(i);return{eHARS_uid:l,cluster_uid:e.name,cluster_ident_method:e.kind,person_ident_method:a[l][0].kind,person_ident_dt:p.hivtrace_date_or_na_if_missing(a[l][0].added),sample_dt:r.min(s[l],function(e){return p.hivtrace_date_or_na_if_missing(n.attribute_node_value_by_id(e,"sample_dt"))}),new_linked_case:n.priority_groups_is_new_node(a[l][0])?1:0,cluster_created_dt:p.hivtrace_date_or_na_if_missing(e.created),network_date:p.hivtrace_date_or_na_if_missing(n.today),cluster_detect_size:t,cluster_type:e.createdBy,cluster_modified_dt:p.hivtrace_date_or_na_if_missing(e.modified),cluster_growth:h.CDCCOIConciseTrackingOptions[e.tracking],national_priority:e.meets_priority_def,cluster_current_size:o.length,cluster_dx_recent12_mo:e.cluster_dx_recent12_mo,cluster_overlap:e.overlap.sets,SequenceID:n.list_of_aliased_sequences(i).map(function(e){return e.split("|")[1]}).join(";")}})}))}),c(this,"priority_groups_export_sets",function(){var e=this;return f.flatten(f.map(f.filter(this.defined_priority_groups,function(e){return e.validated}),function(t){return{cluster_type:t.createdBy,cluster_uid:t.name,cluster_modified_dt:p.hivtrace_date_or_na_if_missing(t.modified),cluster_created_dt:p.hivtrace_date_or_na_if_missing(t.created),cluster_ident_method:t.kind,cluster_growth:h.CDCCOIConciseTrackingOptions[t.tracking],cluster_current_size:e.aggregate_indvidual_level_records(t.node_objects).length,national_priority:t.meets_priority_def,cluster_dx_recent12_mo:t.cluster_dx_recent12_mo,cluster_dx_recent36_mo:t.cluster_dx_recent36_mo,cluster_overlap:t.overlap.sets}}))}),c(this,"priority_groups_is_new_node",function(e){return e.autoadded}),c(this,"check_for_time_series",function(e){var t=this,n=function(e,n){n&&(n=r.select(n)),e.network_cluster_dynamics?(n&&n.text("Show time-course plots"),e.network_cluster_dynamics.remove(),e.network_cluster_dynamics=null,e.handle_inline_charts=null):(e.network_cluster_dynamics=e.network_svg.append("g").attr("id",t.dom_prefix+"-dynamics-svg").attr("transform","translate ("+.45*e.width+",0)"),e.handle_inline_charts=function(t){var n=null,r=null;if(e.colorizer.category_id&&!e.colorizer.continuous){var i=e.json[h.network.GraphAttrbuteID][e.colorizer.category_id];(n={})[e.colorizer.category_id]=i.label,(r={})[i.label]=e.colorizer.category}g.cluster_dynamics(e.extract_network_time_series(p.getClusterTimeScale(),n,t),e.network_cluster_dynamics,"Quarter of Diagnosis","Number of Cases",null,null,{base_line:20,top:e.margin.top,right:e.margin.right,bottom:60,left:100,font_size:12,rect_size:14,width:e.width/2,height:e.height/2,colorizer:r,prefix:e.dom_prefix,barchart:!0,drag:{x:.45*e.width,y:0}})},e.handle_inline_charts(),n&&n.text("Hide time-course plots"))};p.getClusterTimeScale()&&(e?e.push(["Show time-course plots",n]):n(this))}),this.json=t,this.button_bar_ui=n,this.warning_string="",this.subcluster_table=null,this.priority_set_table_write=null,this.priority_set_table_writeable=null,this.cluster_attributes=[],this.minimum_cluster_size=0,this.isPrimaryGraph=!o,this.nodeFilterObject=null,this.primary_key=f.isFunction(i)?i:function(e){var t=e.id.indexOf("|");return t>=0?e.id.substr(0,t):e.id},this.tabulate_multiple_sequences(),this.initialize_ui_ux_elements(),this.defined_priority_groups=[],this.using_time_filter=null}return t=e,n=[{key:"group_edges_by_primary_key",value:function(){var e=this,t={};return f.each(this.json.Edges,function(n){try{var r=e.primary_key(e.json.Nodes[n.source]),i=e.primary_key(e.json.Nodes[n.target]);t[r]||(t[r]=[]),t[r].push(n),r!==i&&(t[i]||(t[i]=[]),t[i].push(n))}catch(e){throw console.log(e),e}}),t}},{key:"initialize_ui_ux_elements",value:function(){this.node_label_drag=r.behavior.drag().on("drag",function(e){e.label_x+=r.event.dx,e.label_y+=r.event.dy,r.select(this).attr("transform","translate("+(e.label_x+1.25*e.rendered_size)+","+(e.label_y+.5*e.rendered_size)+")")}).on("dragstart",function(){r.event.sourceEvent.stopPropagation()}).on("dragend",function(){r.event.sourceEvent.stopPropagation()}),this.colorizer={selected:function(e){return"selected"===e?r.rgb(51,122,183):"#FFF"}},this.highlight_unsuppored_edges=!0,this.node_shaper={id:null,shaper:function(){return"circle"}},this.charge_correction=5,this.cluster_filtering_functions={size:this.filter_by_size,singletons:this.filter_singletons}}},{key:"tabulate_multiple_sequences",value:function(){var e=this;this.primary_key_list={},this.has_multiple_sequences=!1,f.each(this.json.Nodes,function(t){var n=e.primary_key(t);n in e.primary_key_list?(e.primary_key_list[n].push(t),e.has_multiple_sequences=!0,e.legend_multiple_sequences=!0):e.primary_key_list[n]=[t],e.legend_multiple_sequences||t[h.network.AliasedSequencesID]&&(e.legend_multiple_sequences=!0)}),this.has_multiple_sequences&&f.each(this.primary_key_list,function(e,t){if(e.length>1){var n={};f.each(e,function(e){f.each(e[h.network.NodeAttributeID],function(e,t){t in n?n[t].push(e):n[t]=[e]})}),n=f.omit(f.mapObject(n,function(e,t){var n=f.countBy(e,function(e){return e});return 1==f.size(n)?f.keys(n)[0]:null}),function(e){return!e}),f.each(e,function(e){f.extend(e[h.network.NodeAttributeID],n)})}})}},{key:"cluster_display_filter",value:function(e){return f.every(this.cluster_filtering_functions,function(t){return t(e)})}},{key:"get_reference_date",value:function(){return!this.isPrimaryGraph&&this.parent_graph_object?this.parent_graph_object.today:this.today}},{key:"lookup_option",value:function(e,t,n){return this.json.Settings&&this.json.Settings[e]?this.json.Settings[e]:n&&n[e]?n[e]:t}},{key:"get_ui_element_selector_by_role",value:function(e,t){if(!t||this.isPrimaryGraph)return(t?"":"#"+this.button_bar_ui)+g.get_ui_element_selector_by_role(e)}},{key:"process_multiple_sequences",value:function(e,t){var n=this;if(this.has_multiple_sequences&&this.isPrimaryGraph){e=e||1e-6,t=t||.015;var r=g.hivtrace_cluster_depthwise_traversal(this.json.Nodes,this.json.Edges),i=g.hivtrace_cluster_depthwise_traversal(this.json.Nodes,this.json.Edges,function(t){return t.length<=e}),o=g.hivtrace_compute_adjacency(this.json.Nodes,this.json.Edges,function(e){return e.length<=t}),s=g.hivtrace_compute_adjacency(this.json.Nodes,this.json.Edges,function(e){return e.length<=.005}),l=new Set;f.each(r,function(e,t){1==n.unique_entity_list(e).length&&f.each(e,function(e){l.add(e.id)})});var u=l.size;if(console.log("Marked ",u," nodes in null clusters"),f.each(i,function(e,t){if(e.length>1){if(f.some(e,function(e){return l.has(e.id)}))return;var r=n.unique_entity_object_list(e);f.each(r,function(e,t){if(e.length>1){for(var n=new Set(f.map(e,function(e){return e.id})),r=new Set(f.map(f.filter(a(o[e[0].id]),function(e){return!n.has(e)}))),i=new Set(f.map(f.filter(a(s[e[0].id]),function(e){return!n.has(e)}))),u=!0,c=1;c<e.length;c+=1){var d=new Set(f.map(f.filter(a(o[e[c].id]),function(e){return!n.has(e)}))),p=new Set(f.map(f.filter(a(s[e[c].id]),function(e){return!n.has(e)})));if(!(d.isSubsetOf(r)&&r.isSubsetOf(d)&&d.isSubsetOf(i)&&r.isSubsetOf(p))){u=!1;break}}u&&(e[0][h.network.AliasedSequencesID]=f.map(e,function(e){return e.id}),f.each(e,function(e,t){t>0&&l.add(e.id)}))}})}}),console.log("Marked ",l.size-u," collapsible nodes"),l.size){var c=[],d=[],p=[],m=0;f.each(this.json.Nodes,function(e,t){l.has(e.id)?p.push(-1):(c.push(e),p.push(m),m++)}),f.each(this.json.Edges,function(e,t){var n=p[e.source],r=p[e.target];n>=0&&r>=0&&(e.source=n,e.target=r,d.push(e))}),this.json.Nodes=c,this.json.Edges=d,this.tabulate_multiple_sequences()}}}},{key:"annotate_multiple_clusters_on_nodes",value:function(){if(this.has_multiple_sequences){var e={};f.each(this.primary_key_list,function(t,n){if(t.length>=2){var r=f.groupBy(t,function(e){return e.cluster});f.size(r)>1?(e[n]=f.keys(r),f.each(t,function(e){e["multiple clusters"]=f.keys(r)})):f.each(t,function(e){delete e["multiple clusters"]}),r=f.filter(f.map(f.groupBy(t,function(e){return e.subcluster_label}),function(e,t){return t}),function(e){return"undefined"!=e}),f.size(r)>1?f.each(t,function(e){e["multiple subclusters"]=r}):f.each(t,function(e){delete e["multiple subclusters"]})}}),this.entities_in_multiple_clusters=e}}},{key:"simplify_multisequence_cluster",value:function(e){var t=this,n=f.pairs(f.mapObject(this.unique_entity_object_list(e.Nodes),function(e){return t.aggregate_indvidual_level_records(e)[0]})),r=f.object(f.map(n,function(e,t){return[e[0],t]})),i={};f.each(n,function(e){var t=e[1][h.network.AliasedSequencesID]||[e[1].id];f.each(t,function(t){i[t]=r[e[0]]})}),g.hivtrace_compute_adjacency(e.Nodes,e.Edges);var o=f.map(r,function(e){return f.map(r,function(e){return 0})}),a=f.map(r,function(e){return f.map(r,function(e){return 0})});f.each(e.Edges,function(t){var n=i[e.Nodes[t.source].id],r=i[e.Nodes[t.target].id];n!=r&&(o[n][r]+=1,o[r][n]+=1,a[n][r]+=t.length,a[r][n]+=t.length)});var s=[];return f.each(o,function(e,t){for(var n=t+1;n<e.length;n++)e[n]>0&&s.push({source:t,target:n,attributes:[],length:a[t][n]/e[n],weight:e[n]})}),e.Edges=s,e.Nodes=f.map(n,function(e){return e[1]}),e}},{key:"generate_cross_hatch_pattern",value:function(e){var t="id"+this.dom_prefix+"_diagonalHatch_"+e.substr(1,10);if(this.network_svg.select("#"+t).empty()){var n=this.network_svg.append("defs").append("pattern").attr("id",t).attr("patternUnits","userSpaceOnUse").attr("width","6").attr("height","6").attr("patternTransform","rotate(45)");n.append("rect").attr("width","3").attr("height","6").attr("fill",e).attr("transform","translate(0,0)"),n.append("rect").attr("width","3").attr("height","6").attr("fill",function(e){var t=r.rgb(e);return.299*t.r+.587*t.g+.114*t.b>128?"#000000":"#ffffff"}(e)).attr("transform","translate(3,0)")}return t}},{key:"priority_groups_pending",value:function(){return f.filter(this.defined_priority_groups,function(e){return e.pending}).length}},{key:"priority_groups_expanded",value:function(){return f.filter(this.defined_priority_groups,function(e){return e.expanded}).length}},{key:"priority_groups_automatic",value:function(){return f.filter(this.defined_priority_groups,function(e){return e.createdBy===h.CDCCOICreatedBySystem}).length}},{key:"generateClusterOfInterestID",value:function(e){for(var t=this.CDC_data.jurisdiction_code+"_"+p.DateViewFormatClusterCreate(this.CDC_data.timestamp)+"_"+e,n="",r=1,i=this.auto_create_priority_sets.find(function(e){return e.name===t+n})||this.defined_priority_groups.find(function(e){return e.name===t+n});void 0!==i;)n="_"+r,r++,i=this.auto_create_priority_sets.find(function(e){return e.name===t+n})||this.defined_priority_groups.find(function(e){return e.name===t+n});return t+n}},{key:"map_ids_to_objects",value:function(){var e=this;this.node_id_to_object||(this.node_id_to_object={},f.each(this.json.Nodes,function(t,n){e.node_id_to_object[t.id]=t}))}},{key:"attribute_node_value_by_id",value:function(e,t,n,r){try{if(h.network.NodeAttributeID in e&&t&&t in e[h.network.NodeAttributeID]){var i;if(i=this.json[h.network.GraphAttrbuteID][t].volatile?this.json[h.network.GraphAttrbuteID][t].map(e,this):e[h.network.NodeAttributeID][t],f.isString(i)){if(0===i.length)return h.missing.label;if(n)return i=Number(i),f.isNaN(i)?h.missing.label:i;if(date)return i.getTime()}return i}}catch(r){console.log("attribute_node_value_by_id",r,e,t,n)}return h.missing.label}},{key:"extract_single_cluster",value:function(t,n,r,i,o,a){var s={},l={};return s.Nodes=f.map(t,function(e,t){if(l[e.id]=t,r)return e;var n=f.clone(e);return n.cluster=1,n}),i=i||this.json,s.Edges=f.filter(a||i.Edges,function(t){return!f.isUndefined(t.source)&&!f.isUndefined(t.target)&&i.Nodes[t.source].id in l&&i.Nodes[t.target].id in l&&(o||!e.is_edge_injected(t))}),n&&(s.Edges=f.filter(s.Edges,n)),s.Edges=f.map(s.Edges,function(e){var t=f.clone(e);return t.source=l[i.Nodes[e.source].id],t.target=l[i.Nodes[e.target].id],t}),s}},{key:"parse_dates",value:function(e){if(e instanceof Date)return e;var t=null;if(f.any(p.DateFormats,function(n){return t=n.parse(e)})){if(this._is_CDC_&&(t.getFullYear()<1970||t.getFullYear()>p.DateUpperBoundYear))throw Error("Invalid date");return t}throw Error("Invalid date")}},{key:"filter_by_date",value:function(t,n,r,i,o){if(o&&e.is_new_node(i))return!0;var a=this.attribute_node_value_by_id(i,n);if(a instanceof Date)return a>=t&&a<=r;try{if((a=this.parse_dates(this.attribute_node_value_by_id(i,n)))instanceof Date)return a>=t&&a<=r}catch(e){return}return!1}},{key:"priority_group_entity_count",value:function(e){return this.unique_entity_list_from_ids(f.map(e.nodes,function(e){return e.name})).length}},{key:"priority_groups_validate",value:function(e,t){var n=this;if(f.some(e,function(e){return!e.validated})){var r=f.chain(this.clusters).map("subclusters").flatten().filter(function(e){return e.priority_score.length}).map("priority_score").flatten(1).map(function(e){return n.unique_entity_list_from_ids(e)}).filter(function(e){return e.length>=n.CDC_data["autocreate-priority-set-size"]}).map(function(e){return new Set(e)}).value();this.map_ids_to_objects();var i={},o={};f.each(this.json.Nodes,function(e,t){i[e.id]=t,o[t]=new Set}),f.each(this.json.Edges,function(e){o[e.source].add(e),o[e.target].add(e)});var s=null;f.each(e,function(e){if(!e.validated){e.node_objects=[],e.not_in_network=[],e.validated=!0,e.created=f.isDate(e.created)?e.created:p.DateFormats[0].parse(e.created),e.modified?e.modified=f.isDate(e.modified)?e.modified:p.DateFormats[0].parse(e.modified):e.modified=e.created,e.tracking||(e.kind===h.CDCCOIKind[0]?e.tracking=h.CDCCOITrackingOptions[0]:e.tracking=h.CDCCOITrackingOptions[4]),e.createdBy||(e.kind===h.CDCCOIKind[0]?e.createdBy=h.CDCCOICreatedBySystem:e.createdBy=h.CDCCOICreatedManually);var l=[],u={},c=new Set,d=new Set,m=new Set,v=new Set;f.each(e.nodes,function(t){var r=t.name;if(r in n.node_id_to_object){var i=n.node_id_to_object[r];c.add(i.subcluster_label),d.add(i.cluster),e.node_objects.push(i),v.add(r)}else{if(n.has_multiple_sequences){var o=n.primary_key_list[r];if(o)return 1==o.length?(t.name=o[0].id,e.node_objects.push(o[0]),c.add(o[0].subcluster_label),d.add(o[0].cluster),void v.add(r)):(u[r]={subclusters:new Set,clusters:new Set},void(u[r]=[o,f.clone(t)]))}e.not_in_network.push(r)}});var y=[];if(f.size(u)){var _=null;e.createdBy==h.CDCCOICreatedBySyste||e.tracking==h.CDCCOITrackingOptions[0]||e.tracking==h.CDCCOITrackingOptions[1]?_=c:e.tracking!=h.CDCCOITrackingOptions[2]&&e.tracking!=h.CDCCOITrackingOptions[3]||(_=d),_&&0!=_.size||((_={}).has=function(e){return!0}),f.each(u,function(t){var n=t[1];m.add(n.name),f.each(t[0],function(t){if(_.has(t.subcluster_label)){e.node_objects.push(t);var r=f.clone(n);r.name=t.id,r.added=n.added,l.push(r),e.nodes.push(r)}else y.push(t)})})}var b=f.groupBy(e.nodes,function(e){return e.name}),w=new Set;if(f.each(b,function(e,t){f.size(e)>1&&w.add(t)}),m.size&&(e.nodes=f.filter(e.nodes,function(e){return!m.has(e.name)})),w.size){var x=new Set,k=[];f.each(e.nodes,function(e){if(w.has(e.name)){if(x.has(e.name))return;x.add(e.name)}k.push(e)}),e.nodes=k;var C=[];x=new Set,f.each(e.node_objects,function(e){if(w.has(e.id)){if(x.has(e.id))return;x.add(e.id)}C.push(e)}),e.node_objects=C}var D=" Migrated to multiple sequences per person cluster";if(w.size||m.size){var S=e.description.split(D);if(S.length>1){var A=f.countBy(S.slice(1,-1));e.description=S[0]+D,f.each(A,function(t,n){e.description+=n})}}(l.length||y.length)&&(e.description+=D,f.each([[l,"used the following sequences "],[y,"ignored the following sequences "]],function(t,r){if(t[0].length){var i={};f.each(t[0],function(t){var o=n.primary_key("id"in t?t:{id:t.name});o in i||(i[o]=[]),i[o].push(t),0==r&&e.nodes.push(t)}),e.description+="; "+t[1]+f.map(i,function(e,t){return t+" ("+f.map(e,function(e){return e.id||e.name}).join(", ")+")"}).join("; ")}}));var E=new Set(f.map(e.node_objects,function(e){return e.id}));s||(s=[g.hivtrace_compute_adjacency_with_edges(n.json.Nodes,n.json.Edges,function(e){return e.length<=.015}),g.hivtrace_compute_adjacency_with_edges(n.json.Nodes,n.json.Edges,function(e){return e.length<=n.subcluster_threshold})]);var M=[],T=f.flatten(g.hivtrace_cluster_depthwise_traversal(n.json.Nodes,n.json.Edges,function(e){return e.length<=.015},M,e.node_objects,null,s[0])),j=[],N=f.flatten(g.hivtrace_cluster_depthwise_traversal(n.json.Nodes,n.json.Edges,function(e){return e.length<=n.subcluster_threshold},j,e.node_objects,null,s[1])),F=new Set,O=n.extract_single_cluster(T,function(e){return e.length<=.015&&(E.has(n.json.Nodes[e.target].id)||E.has(n.json.Nodes[e.source].id))},!0,M);f.each(O.Edges,function(e){f.each([e.source,e.target],function(e){E.has(O.Nodes[e].id)||F.add(O.Nodes[e].id)})});var I=n.get_reference_date(),z=n.extract_single_cluster(N,function(e){return e.length<=n.subcluster_threshold&&(E.has(n.json.Nodes[e.target].id)||E.has(n.json.Nodes[e.source].id))},!0,j),$=new Set,q=new Set;if(f.each(z.Edges,function(t){f.each([t.source,t.target],function(t){E.has(z.Nodes[t].id)||($.add(z.Nodes[t].id),n.filter_by_date(e.modified||e.created,p._networkCDCDateField,I,z.Nodes[t],!0)&&q.add(z.Nodes[t].id))})}),e.partitioned_nodes=f.map([[T,F],[N,$]],function(t){var r={existing_direct:[],new_direct:[],existing_indirect:[],new_indirect:[]};return f.each(t[0],function(i){var o;E.has(i.id)||(o=n.filter_by_date(e.modified||e.created,p._networkCDCDateField,I,i,!0)?"new":"existing",t[1].has(i.id)?o+="_direct":o+="_indirect",r[o].push(i))}),r}),t&&e.tracking!==h.CDCCOITrackingOptionsNone){var R=n.auto_expand_pg_handler(e,i,o);R.size&&(f.each(a(R),function(t){var r=n.json.Nodes[t];e.nodes.push({name:r.id,added:I,kind:h.CDCCOINodeKindDefault,autoadded:!0}),e.node_objects.push(r)}),e.validated=!1,e.autoexpanded=!0,e.pending=!0,e.expanded=R.size,e.modified=n.get_reference_date())}var P=new Set(n.unique_entity_list_from_ids(f.map(e.nodes,function(e){return e.name})));e.meets_priority_def=f.some(r,function(e){return f.filter(a(e),function(e){return P.has(e)}).length===e.size});for(var L=n.get_reference_date(),B=function(){var t=V[U],r=p.n_months_ago(n.get_reference_date(),t.months);e[t.field_name]=n.unique_entity_list(f.filter(e.node_objects,function(e){return n.filter_by_date(r,p._networkCDCDateField,L,e,!1)})).length},U=0,V=[{field_name:"cluster_dx_recent12_mo",months:12},{field_name:"cluster_dx_recent36_mo",months:36}];U<V.length;U++)B();e.history=e.history||[];var H=p.getCurrentDate(),W={date:H,size:n.priority_group_entity_count(e),new_nodes:0,national_priority:e.meets_priority_def,cluster_dx_recent12_mo:e.cluster_dx_recent12_mo,cluster_dx_recent36_mo:e.cluster_dx_recent36_mo};e.history=e.history.filter(function(e){return e.size!==W.size||e.national_priority!==W.national_priority||e.cluster_dx_recent12_mo!==W.cluster_dx_recent12_mo||e.cluster_dx_recent36_mo!==W.cluster_dx_recent36_mo||e.new_nodes!==W.new_nodes||new Date(e.date)<new Date(new Date(H)-864e5)}),e.history.push(W)}})}}},{key:"display_warning",value:function(e,t){if(this.network_warning_tag)if(e.length){var n=r.select(this.network_warning_tag);n.selectAll("div").remove(),t?n.append("div").html(e):n.append("div").text(e),n.style("display","block")}else r.select(this.network_warning_tag).style("display","none")}},{key:"priority_groups_compute_node_membership",value:function(){var e=[],t={};f.each(this.defined_priority_groups,function(n){e.push([n.name,n.createdBy===h.CDCCOICreatedBySystem]),f.each(n.nodes,function(n){n.name in t?t[n.name].push(e.length-1):t[n.name]=[e.length-1]})});for(var n=["Yes (dx≤12 months)","Yes (12<dx≤36 months)","Yes (dx>36 months)","No"],i=this.get_reference_date(),a=this,s={subcluster_or_priority_node:{depends:[p._networkCDCDateField],label:h.CDCNPMember,enum:n,type:"String",volatile:!0,color_scale:function(){return r.scale.ordinal().domain(n.concat([h.missing.label])).range(["red","orange","yellow","steelblue",h.missing.color])},map:function(r){if(r.id in t&&f.some(t[r.id],function(t){return e[t][1]})){var o=[p.n_months_ago(i,12),p.n_months_ago(i,36)];return a.filter_by_date(o[0],p._networkCDCDateField,i,r,!1)?n[0]:a.filter_by_date(o[1],p._networkCDCDateField,i,r,!1)?n[1]:n[2]}return n[3]}},cluster_uid:{depends:[p._networkCDCDateField],label:"Clusters of Interest",type:"String",volatile:!0,map:function(n){var r=t[n.id]||[];return 1===r.length?e[r[0]][0]:r.length>1?"Multiple":"None"}},subcluster_id:{depends:[p._networkCDCDateField],label:"Subcluster ID",type:"String",map:function(e){return e?e.subcluster_label||"None":h.missing.label}}},l=new Set,u=0,c=Object.entries(s);u<c.length;u++){var d=o(c[u],2),g=d[0],m=d[1];l.add(g),this.populate_predefined_attribute(m,g)}this._aux_populate_category_menus(),this._is_CDC_&&this.define_node_search_table()}},{key:"priority_group_node_record",value:function(e,t,n){return{name:e,added:t||this.get_reference_date(),kind:n||h.CDCCOINodeKindDefault,autoadded:!0}}},{key:"load_priority_sets",value:function(e,t){var n=this;r.json(e,function(e,i){if(e)throw Error("Failed loading cluster of interest file "+e.responseURL);var o=new Date;o.setFullYear(1900),n.defined_priority_groups=f.clone(i),f.each(n.defined_priority_groups,function(e){f.each(e.nodes,function(e){try{e.added=p.DateFormats[0].parse(e.added),e.added>o&&(o=e.added)}catch(e){}})}),n.priority_set_table_writeable="writeable"===t,n.priority_groups_validate(n.defined_priority_groups,n._is_CDC_auto_mode),n.auto_create_priority_sets=[];var s,l=p.DateFormats[0](n.get_reference_date());n.map_ids_to_objects(),n._is_CDC_auto_mode&&f.each(n.clusters,function(e,t){f.each(e.subclusters,function(e){f.each(e.priority_score,function(t,r){if(n.unique_entity_list(f.map(t,function(e){return{id:e}})).length>=n.CDC_data["autocreate-priority-set-size"]){var i={};if(f.each(e.recent_nodes[r],function(e){i[e]=1}),f.filter(f.filter(n.defined_priority_groups,function(e){return e.kind in h.CDCCOICanAutoExpand&&e.createdBy===h.CDCCOICreatedBySystem&&e.tracking===h.CDCCOITrackingOptionsDefault}),function(e){return f.countBy(f.map(e.nodes,function(e){return e.name in i}))[!0]>=1}).length>=1)return;var o=n.generateClusterOfInterestID(e.cluster_id);n.auto_create_priority_sets.push({name:o,description:"Automatically created cluster of interest "+o,nodes:f.map(e.recent_nodes[r],function(e){return n.priority_group_node_record(e,n.get_reference_date())}),created:l,kind:h.CDCCOIKindAutomaticCreation,tracking:h.CDCCOITrackingOptions[0],createdBy:h.CDCCOICreatedBySystem,autocreated:!0,autoexpanded:!1,pending:!0})}})})}),n.auto_create_priority_sets.length&&(s=n.defined_priority_groups).push.apply(s,a(n.auto_create_priority_sets));var u=n.defined_priority_groups.filter(function(e){return e.autocreated}).length,c=n.defined_priority_groups.filter(function(e){return e.autoexpanded}).length,d=u+c>0,g=n.defined_priority_groups.filter(function(e){return e.pending}).length;d&&(n.warning_string+="<br/>Automatically created <b>"+u+"</b> and expanded <b>"+c+"</b> clusters of interest."+(g>0?" <b>Please review <span id='banner_coi_counts'></span> clusters in the <code>Clusters of Interest</code> tab.</b><br>":""),n.display_warning(n.warning_string,!0));var v=n.get_ui_element_selector_by_role("priority_set_counts",!0);if(n.priority_set_table_writeable)v&&g>0&&(r.select(v).text(g),r.select("#banner_coi_counts").text(g));else{var y="old"===t?"the network is <b>older</b> than some of the Clusters of Interest":"the network was ran in <b>standalone</b> mode so no data is stored";n.warning_string+='<p class="alert alert-danger"class="alert alert-danger">READ-ONLY mode for Clusters of Interest is enabled because '.concat(y,". None of the changes to clustersOI made during this session will be recorded.</p>"),n.display_warning(n.warning_string,!0),v&&r.select(v).text("Read-only")}n.priority_groups_validate(n.defined_priority_groups);var _=n.auto_create_priority_sets.map(function(e){return e.name});f.each(n.defined_priority_groups,function(e){e.name in _?n.priority_groups_update_node_sets(e.name,"insert"):n.priority_groups_update_node_sets(e.name,"update")}),m.draw_priority_set_table(n),n.showing_diff&&n.has_network_attribute("subcluster_or_priority_node")&&n.handle_attribute_categorical("subcluster_or_priority_node")})}},{key:"inject_attribute_description",value:function(e,t){if(h.network.GraphAttrbuteID in this.json){var n={};n[e]=t,f.extend(this.json[h.network.GraphAttrbuteID],n)}}},{key:"populate_predefined_attribute",value:function(t,n){var r=this;if(f.isFunction(t)&&(t=t(this)),!t.depends||f.every(t.depends,function(e){return f.has(r.json[h.network.GraphAttrbuteID],e)})){if(this.inject_attribute_description(n,t),f.each(this.json.Nodes,function(i){var o=t.map(i,r);e.inject_attribute_node_value_by_id(i,n,o)}),t.enum)this.uniqValues[n]=t.enum;else{var i=new Set;"Date"===t.type?f.each(this.json.Nodes,function(e){try{i.add(r.attribute_node_value_by_id(e,n).getTime())}catch(e){}}):f.each(this.json.Nodes,function(e){return i.add(r.attribute_node_value_by_id(e,n,"Number"===t.type))}),this.uniqValues[n]=a(i),("Number"===t.type||"Date"==t.type)&&((t.color_stops||h.network.ContinuousColorStops)>this.uniqValues[n].length&&(t.color_stops=this.uniqValues[n].length),"Number"===t.type&&(t.is_integer=f.every(this.uniqValues[n],function(e){return Number.isInteger(e)})))}this.uniqs[n]=this.uniqValues[n].length;var o={};o[n]=t,"priority_set"==n&&console.log(),f.extend(this.json[h.network.GraphAttrbuteID],o),t.overwrites&&f.has(this.json[h.network.GraphAttrbuteID],t.overwrites)&&(this.json[h.network.GraphAttrbuteID][t.overwrites]._hidden_=!0)}}},{key:"define_attribute_COI_membership",value:function(e,t){t=t||this.get_reference_date();var n=["No, dx>36 months","No, but dx�12 months","Yes (dx�12 months)","Yes (12<dx� 36 months)","Future node","Not a member of subcluster","Not in a subcluster","No, but 12<dx� 36 months"];return{depends:[p._networkCDCDateField],label:"ClusterOI membership as of "+p.DateViewFormat(t),enum:n,volatile:!0,color_scale:function(){return r.scale.ordinal().domain(n.concat([h.missing.label])).range(f.union(["steelblue","pink","red","#FF8C00","#9A4EAE","yellow","#FFFFFF","#FFD580"],[h.missing.color]))},map:function(e){return e.subcluster_label?e.priority_flag>0?n[e.priority_flag]:n[0]:n[6]}}}},{key:"define_attribute_binned_vl",value:function(e,t){var n=this,i=["<200","200-10000",">10000"];return{depends:[e],label:t,enum:i,type:"String",color_scale:function(){return r.scale.ordinal().domain(i.concat([h.missing.label])).range(f.union(h.SequentialColor[3],[h.missing.color]))},map:function(t){var r=n.attribute_node_value_by_id(t,e,!0);return r!==h.missing.label?r<=200?i[0]:r<=1e4?i[1]:i[2]:h.missing.label}}}},{key:"define_attribute_vl_interpretaion",value:function(){var e=this;return{depends:["vl_recent_value","result_interpretation"],label:"Viral load result interpretation",color_stops:6,scale:r.scale.log(10).domain([10,1e6]).range([0,5]),category_values:["Suppressed","Viremic (above assay limit)"],type:"Number-categories",color_scale:function(e){var t=r.scale.linear().range(["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"]).domain(f.range(h.network.ContinuousColorStops,-1,-1));return function(n){if(f.isNumber(n))return t(e.scale(n));switch(n){case e.category_values[0]:return t(0);case e.category_values[1]:return t(5);default:return h.missing.color}}},label_format:r.format(",.0f"),map:function(t){var n=e.attribute_node_value_by_id(t,"vl_recent_value",!0),r=e.attribute_node_value_by_id(t,"result_interpretation");if(n!==h.missing.label||r!==h.missing.label){if(r===h.missing.label)return n;if("<"===r)return"Suppressed";if(">"===r)return"Viremic (above assay limit)";if(n!==h.missing.label)return n}return h.missing.label}}}},{key:"define_attribute_network_update",value:function(){return{label:"Sequence updates compared to previous network",enum:["Existing","New","Moved clusters"],type:"String",map:function(t){return e.is_new_node(t)?"New":t.attributes.indexOf("moved_clusters")>=0?"Moved clusters":"Existing"},color_scale:function(){return r.scale.ordinal().domain(["Existing","New","Moved clusters",h.missing.label]).range(["#7570b3","#d95f02","#1b9e77","gray"])}}}},{key:"define_attribute_dx_years",value:function(e,t){var n=this;return{depends:[p._networkCDCDateField],label:t,type:"Number",label_format:e?r.format(".2f"):r.format(".0f"),map:function(t){try{var r=n.parse_dates(n.attribute_node_value_by_id(t,p._networkCDCDateField));return r?e?(n.get_reference_date()-r)/31536e6:String(r.getFullYear()):h.missing.label}catch(e){return h.missing.label}},color_scale:function(e){var t=f.without(e.value_range,h.missing.label),n=f.compose(r.interpolateRgb("#ffffcc","#800026"),r.scale.linear().domain([t[0],t[t.length-1]]).range([0,1]));return function(e){return e===h.missing.label?h.missing.color:n(e)}}}}},{key:"fetch_sequence_objects_for_pid",value:function(e){return this.primary_key_list[e]}},{key:"fetch_sequences_for_pid",value:function(e){return this.has_multiple_sequences?f.flatten(f.map(this.primary_key_list[e],function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID]:e.id})):this.primary_key_list[e]}},{key:"define_attribute_sequence_count",value:function(e){var t=this;return{depends:[],label:e,type:"Number",label_format:r.format("d"),map:function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID].length:t.has_multiple_sequences?t.fetch_sequences_for_pid(t.primary_key(e)).length:1},color_scale:function(e){var t=f.without(e.value_range,h.missing.label),n=f.compose(r.interpolateRgb("#ffffcc","#800026"),r.scale.linear().domain([t[0],t[t.length-1]]).range([0,1]));return function(e){return e===h.missing.label?h.missing.color:n(e)}}}}},{key:"define_attribute_age_dx",value:function(){var e=this;return{depends:["age_dx"],overwrites:"age_dx",label:"Age at Diagnosis",enum:["<13","13-19","20-29","30-39","40-49","50-59","�60"],type:"String",color_scale:function(){return r.scale.ordinal().domain(["<13","13-19","20-29","30-39","40-49","50-59","�60",h.missing.label]).range(["#b10026","#e31a1c","#fc4e2a","#fd8d3c","#feb24c","#fed976","#ffffb2","#636363"])},map:function(t){var n=e.attribute_node_value_by_id(t,"age_dx");return">=60"===n||"�60"===n||Number(n)>=60?"�60":n}}}},{key:"annotate_cluster_changes",value:function(){this.cluster_attributes&&f.each(this.cluster_attributes,function(e){"old_size"in e&&"size"in e?(e.delta=e.size-e.old_size,e.deleted=e.old_size+(e.new_nodes?e.new_nodes:0)-e.size):"new"===e.type?(e.delta=e.size,"moved"in e&&(e.delta-=e.moved)):e.delta=0,e.flag=e.moved||e.deleted?2:3})}},{key:"extract_individual_level_records",value:function(){if(this.has_multiple_sequences&&this.primary_key_list){var e=[];return f.each(this.primary_key_list,function(t,n){t.length>1?e.push(f.find(t,function(e){return!e.missing_attributes})||t[0]):e.push(t[0])}),e}return this.json.Nodes}},{key:"aggregate_indvidual_level_records",value:function(e){var t=this;e=e||this.json.Nodes;var n=function(e,t,n,r){var i=f.countBy(e,function(e){return e[t]});delete i[void 0],1==f.size(i)?n[r]=e[0][t]:f.size(i)>0&&(n[r]=f.map(i,function(e,t){return t}).join(";"))};if(this.has_multiple_sequences){var i=f.groupBy(e,function(e){return t.primary_key(e)}),o=[];return f.each(i,function(e,i){if(1==e.length)o.push(f.clone(e[0]));else{var a=f.clone(e[0]);a[h.network.NodeAttributeID]=f.object(f.map(a[h.network.NodeAttributeID],function(n,i){var o=t.json[h.network.GraphAttrbuteID][i],a=f.countBy(e,function(e){return e[h.network.NodeAttributeID][i]});if(1==f.size(a))return[i,e[0][h.network.NodeAttributeID][i]];if("Date"!=o.type)return[i,f.sortBy(f.map(a,function(e,t){return t})).join(";")];try{return[i,new Date(Date.parse(r.min(f.map(a,function(e,t){return t}))))]}catch(e){return[i,null]}})),n(e,"cluster",a,"cluster"),n(e,"subcluster_label",a,"subcluster_label"),a[h.network.AliasedSequencesID]=f.flatten(f.map(e,function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID]:e.id})),a[h.network.NodeAttributeID].sequence_count=a[h.network.AliasedSequencesID].length,o.push(a)}}),o}return e}},{key:"entity_id_from_string",value:function(e){return this.primary_key({id:e})}},{key:"entity_id",value:function(e){return this.primary_key(e)}},{key:"apply_to_entities",value:function(e){this.has_multiple_sequences&&f.each(this.primary_key_list,function(t,n){e(n,t)})}},{key:"list_of_aliased_sequences",value:function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID]:[e.id]}}],i=[{key:"lookup_form_generator",value:function(){return'<div><ul data-hivtrace-ui-role = "priority-membership-list"></ul></div>'}},{key:"is_new_node",value:function(e){return e.attributes.indexOf("new_node")>=0}},{key:"is_edge_injected",value:function(e){return"edge_type"in e}},{key:"inject_attribute_node_value_by_id",value:function(e,t,n){h.network.NodeAttributeID in e&&t&&(e[h.network.NodeAttributeID][t]=n)}}],n&&u(t.prototype,n),i&&u(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();e.exports={HIVTxNetwork:v}},3110:function(e,t,n){"use strict";n.r(t),n.d(t,{clusterNetwork:function(){return j},colorPicker:function(){return z},graphSummary:function(){return $},helpers:function(){return I},histogram:function(){return F.K},histogramDistances:function(){return F.w},misc:function(){return O},scatterPlot:function(){return d.M}});var r=n(3857),i=n(9050),o=n(4417);function a(e){return e}function s(e,t){var n=t.id,r=t.bbox,i=null==t.properties?{}:t.properties,o=function(e,t){var n=function(e){if(null==e)return a;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,a){a||(t=n=0);var l=2,u=e.length,c=new Array(u);for(c[0]=(t+=e[0])*r+o,c[1]=(n+=e[1])*i+s;l<u;)c[l]=e[l],++l;return c}}(e.transform),r=e.arcs;function i(e,t){t.length&&t.pop();for(var i=r[e<0?~e:e],o=0,a=i.length;o<a;++o)t.push(n(i[o],o));e<0&&function(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}(t,a)}function o(e){return n(e)}function s(e){for(var t=[],n=0,r=e.length;n<r;++n)i(e[n],t);return t.length<2&&t.push(t[0]),t}function l(e){for(var t=s(e);t.length<4;)t.push(t[0]);return t}function u(e){return e.map(l)}return function e(t){var n,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(e)};case"Point":n=o(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(o);break;case"LineString":n=s(t.arcs);break;case"MultiLineString":n=t.arcs.map(s);break;case"Polygon":n=u(t.arcs);break;case"MultiPolygon":n=t.arcs.map(u);break;default:return null}return{type:r,coordinates:n}}(t)}(e,t);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}var l=new ArrayBuffer(16);new Float64Array(l),new Uint32Array(l),Math.PI,Math.abs,Math.atan2,Math.cos,Math.sin;var u=n(2033),c=n(8834),d=n(8033),f=n(905),p=n(4861),h=n(7568),g=n(6822),m=n(4835),v=n(6221),y=n(4257),_=n(1138),b=n(5795);function w(e,t,n){i.default.each(t,function(t,r){r!==n&&_.HIVTxNetwork.inject_attribute_node_value_by_id(e,r,t)})}function x(e,t,n,r,i,o,a,s){var l={node_class:"injected",node_annotation:a,attributes:[],degree:0};l[v.network.NodeAttributeID]={},l.id=t,w(l,n,r),i[t]=e.json.Nodes.length,e.json.Nodes.push(l),o.push(l);var u=e.primary_key(l);u in s?s[u].push(l):s[u]=[l]}function k(e,t,n,r,i,o){e.open_exclusive_tab_view(t,n,o,e._social_view_options(r,i),!0)}function C(e,t,n,r,o){function a(t){return _.HIVTxNetwork.is_edge_injected(t)||t.length<=e.subcluster_threshold}var s=[],l=m.hivtrace_cluster_depthwise_traversal(e.json.Nodes,e.json.Edges,n||a,s,t.children),u={},c={};s[0]&&Array.isArray(s[0])&&i.default.each(s[0],function(e){e.edge_type&&(u[e.edge_type]=1,c[e.edge_type]=1)}),(u=i.default.keys(u)).sort(),u.push(""),c[""]=1,r=r||function(e){return"Subcluster "+t.cluster_id+"[+ "+o+"]"},e.view_subcluster(t,l[0],r(t.cluster_id),e._social_view_options(u,c),a,!0)._refresh_subcluster_view(e.today||p.getCurrentDate())}function D(e,t,n,o,a){var s=a||"Social",l=[],u={},c=0,d={},f={},p={};if(i.default.each(e.json.Nodes,function(t,n){d[t.id]=t;var r=e.primary_key(t);r in p?p[r].push(t):p[r]=[t],f[t.id]=n}),t&&t.length){if(!(n in t[0]))throw Error(n+" is not one of the attributes in the imported node records");i.default.each(t[0],function(t,r){if(r!==n){var i={label:r,type:"String",annotation:s};e.inject_attribute_description(r,i)}}),i.default.each(t,function(t){t[n]in d?(w(d[t[n]],t,n),c++):(e.primary_key({id:t[n]})in p&&c++,x(e,t[n],t,n,f,l,s,p))})}if(o&&o.length){var h=!(t&&t.length),g={};i.default.each(o,function(t){try{if(!("Index"in t&&"Partner"in t&&"Contact"in t))throw Error("Missing required attribute (Index, Partner, or Contact)");var r=i.default.map(["Index","Partner"],function(e){return{type:e,node:t[e]}});if(i.default.each(r,function(t){if(t.node in f)g[t.node]=!0;else{if(!h)throw Error("Invalid node: "+t.node);x(e,t.node,[],n,f,l,s,p)}}),u[t.Contact]=(u[t.Contact]||0)+1,e.has_multiple_sequences){var o=e.entity_id_from_string(t.Index),a=e.entity_id_from_string(t.Partner);i.default.each(p[o],function(n){i.default.each(p[a],function(r){var i={source:f[n.id],target:f[r.id],edge_type:t.Contact,length:.005,directed:!0};e.json.Edges.push(i)})})}else{var c={source:f[t.Index],target:f[t.Partner],edge_type:t.Contact,length:.005,directed:!0};e.json.Edges.push(c)}}catch(e){throw Error("Invalid edge specification ( "+e+") "+JSON.stringify(t))}}),h&&(c=i.default.size(g)),e._aux_populate_category_menus(),e.tabulate_multiple_sequences(),e.update_clusters_with_injected_nodes(null,null,s),e.extra_cluster_table_columns||(e.extra_cluster_table_columns=[]),e.extra_subcluster_table_columns||(e.extra_subcluster_table_columns=[]);var v={};i.default.each(e.json.Edges,function(t){try{if(e.json.Nodes[t.source]&&e.json.Nodes[t.target]){var n=i.default.union(i.default.keys(e.json.Nodes[t.source].extended_cluster),i.default.keys(e.json.Nodes[t.target].extended_cluster));i.default.each(n,function(e){e in v||(v[e]={}),t.edge_type&&(v[e][t.edge_type]=1)})}}catch(e){console.log("Error processing edge for cluster types:",e,t)}});var y={};i.default.each(v,function(e,t){var n=i.default.keys(e);n.sort(),y[t]=n});var _=[{description:{value:s+" network",help:"View subclusters with "+s+" data"},generator:function(t){return{value:t,callback:function(t,n){var o=r.select(t);o.append("button").classed("btn btn-primary btn-xs pull-right",!0).style("margin-left","1em").text("Complete "+s).on("click",function(t){return C(e,n,null,null,s)});var a={};i.default.each(n.children,function(e){a[e.id]=1}),o.append("button").classed("btn btn-primary btn-xs pull-right",!0).text("Directly linked "+s).on("click",function(t){return C(e,n,function(t){return e.json.Nodes[t.target].id in a||e.json.Nodes[t.source].id in a},function(e){return"Subcluster "+n.cluster_id+"[+ direct "+s+"]"})})}}}}],b=[{description:{value:s+" network",sort:function(e){return e.value[0]},help:"Nodes added and clusters merged through "+s},generator:function(t){return{value:[t.injected?t.injected[s]:0,t.linked_clusters,t.cluster_id],callback:function(n,o){var a=r.select(n);a.text(Number(o[0])+" "+s+" nodes. ");var l=[];o[1]&&(l=i.default.without(i.default.keys(o[1]),o[2])).length&&(l.sort(),a.append("span").classed("label label-info",!0).text("Bridges to "+l.length+" clusters").attr("title",l.join(", ")));var u=i.default.clone(y[o[2]]||[]);if(o[0]>0||l.length||y[o[2]]&&u.length){u.push("");var c={};i.default.each(u,function(e){c[e]=1}),a.append("button").classed("btn btn-primary btn-xs pull-right",!0).text("Directly linked "+s).style("margin-left","1em").on("click",function(n){var r={},a={};i.default.each(t.children,function(e){a[e.id]=1});var l=m.hivtrace_cluster_depthwise_traversal(e.json.Nodes,e.json.Edges,function(t){return e.json.Nodes[t.target].id in a||e.json.Nodes[t.source].id in a},!1,t.children);i.default.each(l[0],function(e){r[e.id]=!0}),k(e,o[2],function(e){return e.id in r},u,c,function(e){return"Cluster "+e+"[+ direct "+s+"]"})}),a.append("button").classed("btn btn-primary btn-xs pull-right",!0).text("Complete "+s).on("click",function(t){return k(e,o[2],function(e){return e.extended_cluster&&o[2]in e.extended_cluster},u,c,function(e){return"Cluster "+e+"[+ "+s+"]"})})}}}}}];e.extra_cluster_table_columns?e.extra_cluster_table_columns=e.extra_cluster_table_columns.concat(b):e.extra_cluster_table_columns=b,e.subcluster_table&&(e.extra_subcluster_table_columns?e.extra_subcluster_table_columns=e.extra_subcluster_table_columns.concat(_):e.extra_subcluster_table_columns=_)}return e.isPrimaryGraph&&(t||o)&&(e.draw_cluster_table(e.extra_cluster_table_columns,e.cluster_table),e.subcluster_table&&e.draw_cluster_table(e.extra_subcluster_table_columns,e.subcluster_table,{subclusters:!0,"no-clusters":!0}),e._is_CDC_||self.draw_node_table(self.extra_node_table_columns,self.json.Nodes)),{nodes:l,existing_nodes:c,edges:u}}n(5384),n(4728);var S=n(9983);function A(e){return function(e){if(Array.isArray(e))return T(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||M(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||M(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=function(e,t,n,a,l,w,x,k,C,M,T){e.Settings&&e.Settings.compact_json&&y.unpack_compact_json(e),e[v.network.GraphAttrbuteID]||(e[v.network.GraphAttrbuteID]={}),e[v.network.GraphAttrbuteID]=Object.fromEntries(Object.entries(e[v.network.GraphAttrbuteID]).map(function(e){var t=E(e,2),n=t[0],r=t[1];return[n.toLowerCase(),r]})),S("#filter_input").val("").attr("placeholder","在属性中搜索文本"),S("#show_as").html("显示为"),y.normalize_node_attributes(e),y.ensure_node_attributes_exist(e),e.Edges=i.default.filter(e.Edges,function(e){return"source"in e&&"target"in e});var N=y.check_network_option(T,"secondary",!0,!1),F=new _.HIVTxNetwork(e,l,null,!N);F.process_multiple_sequences(),F._is_CDC_=!T||!T.no_cdc,F._is_seguro=y.check_network_option(T,"seguro",!1,!0),F._is_CDC_executive_mode=y.check_network_option(T,"cdc-executive-mode",!1),F.uniqValues=u.getUniqueValues(F.json.Nodes,F.json[v.network.GraphAttrbuteID]),F.uniqs=i.default.mapObject(F.uniqValues,function(e){return e.length}),F.schema=F.json[v.network.GraphAttrbuteID],F.networkColorScheme=v.PresetColorSchemes,F.networkShapeScheme=v.PresetShapeSchemes,F.ww=y.check_network_option(T,"width",r.select(M).property("clientWidth")),F.margin={top:20,right:10,bottom:30,left:10},F.width=F.ww-F.margin.left-F.margin.right,F.height=9*F.width/16,F.container=t,F.nodes=[],F.edges=[],F.clusters=[],F.cluster_sizes=[],F.cluster_mapping={},F.percent_format=v.formats.PercentFormat,F.missing=v.missing.label,F.cluster_attributes=F.json["Cluster description"]||null,F.precomputed_subclusters=F.json.Subclusters||null,F.network_warning_tag=a,F.annotate_cluster_changes(),F.filter_edges=!0,F.hide_hxb2=!1,F.cluster_table=r.select(k),F._is_CDC_?(F.priority_set_table=y.check_network_option(T,"priority-table"),F.priority_set_table_write=y.check_network_option(T,"priority-table-writeback"),F.priority_set_table&&(F.priority_set_table=r.select(F.priority_set_table))):(F.priority_set_table=null,F.priority_set_table_write=null),F.needs_an_update=!1,F.hide_unselected=!1,F.show_percent_in_pairwise_table=!1,F.priority_set_table_writeable=!0,T&&i.default.isFunction(T.init_code)&&T.init_code.call(null,F,T),F.dom_prefix=y.check_network_option(T,"prefix","hiv-trace"),F.extra_cluster_table_columns=y.check_network_option(T,"cluster-table-columns",null),F.parent_graph_object=y.check_network_option(T,"parent_graph",null),F.json.Settings&&F.json.Settings.created?F.today=new Date(e.Settings.created):F.today=y.check_network_option(T,"today",p.getCurrentDate()),F._is_CDC_&&(F._is_CDC_auto_mode=y.check_network_option(T,"cdc-no-auto-priority-set-mode",!0,!1),F.displayed_node_subset=y.check_network_option(T,"node-attributes",[f._networkNodeIDField,"sex_trans","race_cat","hiv_aids_dx_dt","cur_city_name"]),F.subcluster_table=y.check_network_option(T,"subcluster-table",null,r.select(T["subcluster-table"])),F.extra_subcluster_table_columns=null,F.CDC_data={jurisdiction:F.lookup_option("jurisdiction","unknown",T).toLowerCase().replace(/\s/g,""),timestamp:F.today,"autocreate-priority-set-size":5},F.CDC_data.jurisdiction in v.CDCJurisdictionCodes?F.CDC_data.jurisdiction_code=v.CDCJurisdictionCodes[F.CDC_data.jurisdiction].toUpperCase():F.CDC_data.jurisdiction_code="PG",v.CDCJurisdictionLowMorbidity.has(F.CDC_data.jurisdiction)&&(F.CDC_data["autocreate-priority-set-size"]=3),F.subcluster_table?F.extra_subcluster_table_columns=b.secure_hiv_trace_subcluster_columns(F):F.extra_cluster_table_columns?F.extra_cluster_table_columns=F.extra_cluster_table_columns.concat(b.secure_hiv_trace_subcluster_columns(F)):F.extra_cluster_table_columns=b.secure_hiv_trace_subcluster_columns(F)),F._is_CDC_?F.extra_node_table_columns=null:F.extra_node_table_columns=y.check_network_option(T,"node-table-columns"),F.subcluster_threshold=y.check_network_option(T,"subcluster-thershold",.005),F.isPrimaryGraph&&(g.init(F),h.init(r.select(C))),F.countryCentersObject=y.check_network_option(T,"country-centers"),F.countryOutlines=y.check_network_option(T,"country-outlines"),F.countryCentersObject&&F.countryOutlines?(F._calc_country_nodes(T),F.showing_on_map=T.showing_on_map):F.showing_on_map=!1,F._additional_node_pop_fields=[],F.minimum_cluster_size=y.check_network_option(T,"minimum size",5),p.init(T,F._is_CDC_,p._networkCDCDateField),F._is_CDC_&&F._additional_node_pop_fields.push(p._networkCDCDateField),F.core_link_length=y.check_network_option(T,"core-link",-1),F.additional_edge_styler=y.check_network_option(T,"edge-styler"),F.json.Notes&&i.default.each(F.json.Notes,function(e){return F.warning_string+=e+"<br>"}),F.cluster_attributes?(F.warning_string+=" 由于渲染限制,某些簇可能已折叠",F.showing_diff=!0,F.cluster_filtering_functions.new=F.filter_if_added):(F.showing_diff=!1,p.getClusterTimeScale()&&"Cluster sizes"in F.json&&F.json["Cluster sizes"].length>250&&(F.using_time_filter=p.getCurrentDate(),F.warning_string+=" 由于渲染限制,某些簇可能已折叠",F.using_time_filter.setFullYear(F.using_time_filter.getFullYear()-1),F.cluster_filtering_functions.recent=F.filter_time_period)),F.initial_packed=!T||"tiled"!==T.initial_layout,F._networkPredefinedAttributeTransforms={binned_vl_recent_value:F.define_attribute_binned_vl("vl_recent_value","Most Recent Viral Load Category Binned"),binned_vl_recent_value_adj:F.define_attribute_binned_vl("vl_recent_value_adj","Most Recent Viral Load Category Binned"),vl_result_interpretation:F.define_attribute_vl_interpretaion(),age_dx_normalized:F.define_attribute_age_dx(),years_since_dx:F.define_attribute_dx_years(!0,"Years since diagnosis"),hiv_aids_dx_dt_year:F.define_attribute_dx_years(!1,"Diagnosis Year"),sequence_count:F.define_attribute_sequence_count("Number of sequences")},F.cluster_attributes&&(F._networkPredefinedAttributeTransforms._newly_added=F.define_attribute_network_update()),T&&T["computed-attributes"]&&i.default.extend(F._networkPredefinedAttributeTransforms,T["computed-attributes"]),F._get_node_country=function(e){var t=F.attribute_node_value_by_id(e,"country");return t===v.missing.label&&(t=F.attribute_node_value_by_id(e,"Country")),t},F._draw_topomap=function(e){if(T&&"showing_on_map"in T){var t=(a=F.countryOutlines,l=F.countryOutlines.objects.countries,"GeometryCollection"===l.type?{type:"FeatureCollection",features:l.geometries.map(function(e){return s(a,e)})}:s(a,l)).features,n=r.select("#"+F.dom_prefix+"-network-svg"),o=r.geo.path().projection(F.mapProjection);(t=n.selectAll(".country").data(t)).enter().append("path"),t.exit().remove(),F.countries_in_cluster={},i.default.each(F.nodes,function(e){var t=F._get_node_country(e),n=F.countryCentersObject[t].countryCodeNumeric;n in F.countries_in_cluster||(F.countries_in_cluster[n]=!0)}),t.attr("class","country").attr("d",o).attr("stroke","saddlebrown").attr("fill",function(e){return e.id in F.countries_in_cluster?"navajowhite":"bisque"}).attr("stroke-width",function(e){return e.id in F.countries_in_cluster?1.5:.5})}var a,l;return F},F.open_exclusive_tab_close=function(e,t,n){S(n).tab("show"),S("#"+e).remove(),S("#"+t).remove()},F.open_exclusive_tab_view=function(e,t,n,r,o){var a=i.default.find(F.clusters,function(t){return String(t.cluster_id)===String(e)});if(a){(r=r||{}).parent_graph=F;var s=F.extract_single_cluster(t?i.default.filter(F.json.Nodes,t):a.children,null,null,null,o);F.has_multiple_sequences&&(i.default.each(s.Nodes,function(e){e["multiple clusters"]&&(e.multiple_membership=!0)}),r["simplified-mspp"]&&(s=F.simplify_multisequence_cluster(s))),v.network.GraphAttrbuteID in F.json&&(s[v.network.GraphAttrbuteID]={},S.extend(!0,s[v.network.GraphAttrbuteID],F.json[v.network.GraphAttrbuteID]));var l=[];return F._is_CDC_executive_mode||l.push(["导出簇到 CSV",function(t){u.export_csv_button(F._extract_attributes_for_nodes(F._extract_nodes_by_id(e),F._extract_exportable_attributes()))}]),"extra_menu"in r?i.default.each(l,function(e){r.extra_menu.items.push(e)}):i.default.extend(r,{extra_menu:{title:"操作",items:l}}),F.open_exclusive_tab_view_aux(s,n?n(e):"簇 "+e,r)}},F.open_exclusive_tab_view_aux=function(e,t,n){for(var r=m.random_id(),o=r+"_tab",a=r+"_div",s=r+"_ui";S("#"+o).length||S("#"+a).length||S("#"+s).length;)r=m.random_id(),o=r+"_tab",a=r+"_div",s=r+"_ui";var l="#trace-default-tab",u=S("<li></li>").attr("id",o),c=S("<a></a>").attr("href","#"+a).attr("data-toggle","tab").text(t);S('<button type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>').appendTo(c).on("click",function(){F.open_exclusive_tab_close(o,a,l)}),c.appendTo(u),S("#top_level_tab_container").append(u);var d,f,p=S("<div></div>").addClass("tab-pane").attr("id",a).data("cluster",n.cluster_id);if("subcluster"===n.type&&p.addClass("subcluster-view").addClass("subcluster-"+n.cluster_id.replace(".","_")),e&&((d=S('[data-hivtrace="cluster-clone"]').clone().attr("data-hivtrace",null)).find("[data-hivtrace-button-bar='yes']").attr("id",s).addClass("cloned-cluster-tab"),d.appendTo(p)),p.appendTo("#top_level_tab_content"),S(c).on("show.bs.tab",function(e){e.relatedTarget&&(l=e.relatedTarget)}),S(c).tab("show"),!e)return p.attr("id");var h={no_cdc:T&&T.no_cdc,"minimum size":0,secondary:!0,prefix:r,extra_menu:T&&"extra_menu"in T?T.extra_menu:null,"edge-styler":T&&"edge-styler"in T?T["edge-styler"]:null,"no-subclusters":!0,"no-subcluster-compute":!1};return n&&i.default.extend(h,n),n.showing_on_map&&F.countryCentersObject&&F.countryOutlines&&(h.showing_on_map=!0,h["country-centers"]=F.countryCentersObject,h["country-outlines"]=F.countryOutlines,h["extra-graphics"]="extra-graphics"in h?i.default.wrap(function(e,t){return e(t),t._draw_topomap()},h["extra-graphics"]):function(e){return e._draw_topomap()}),h.today=F.today,h.auto_expand_single_cluster=!0,f=j(e,"#"+a,null,null,s,w,null,null,null,M,h),F.colorizer.category_id&&(F.colorizer.continuous?f.handle_attribute_continuous(F.colorizer.category_id):f.handle_attribute_categorical(F.colorizer.category_id)),F.node_shaper.id&&f.handle_shape_categorical(F.node_shaper.id),F.colorizer.opacity_id&&f.handle_attribute_opacity(F.colorizer.opacity_id),f},S('input[type="checkbox"]').prop("checked",!1);var O=function(e){if(!r.event.defaultPrevented){var t=r.select(F.container),n="d3_context_menu_id",i=t.select("#"+n);i.empty()&&(i=t.append("ul").attr("id",n).attr("class","dropdown-menu").attr("role","menu")),i.selectAll("li").remove(),e?(e.fixed=1,i.append("li").append("a").attr("tabindex","-1").text("折叠簇").on("click",function(t){e.fixed=0,function(e){J(F.clusters[F.cluster_mapping[e.cluster]]),F.update(!1,.4)}(e),i.style("display","none")}),i.append("li").append("a").attr("tabindex","-1").text(function(t){return e.show_label?"隐藏文本标签":"显示文本标签"}).on("click",function(t){e.fixed=0,function(e,t){t.show_label=!t.show_label,F.update(!0)}(0,e),i.style("display","none")}),g.get_editor()&&i.append("li").append("a").attr("tabindex","-1").text(function(e){return"将此节点添加到关注簇"}).on("click",function(t){g.get_editor().append_node(F.entity_id(e),!0)}),i.style("position","absolute").style("left",String(r.event.offsetX)+"px").style("top",String(r.event.offsetY)+"px").style("display","block")):i.style("display","none"),t.on("click",function(e){O(null)},!0)}};F._refresh_subcluster_view=function(e){F.annotate_priority_clusters(p._networkCDCDateField,36,12,e);var t=F.define_attribute_COI_membership(F,e);t&&(i.default.each(F.nodes,function(e){var n=t.map(e,F);_.HIVTxNetwork.inject_attribute_node_value_by_id(e,"subcluster_temporal_view",n)}),F.inject_attribute_description("subcluster_temporal_view",t),F._aux_process_category_values(F._aux_populate_category_fields(t,"subcluster_temporal_view")),F.handle_attribute_categorical("subcluster_temporal_view"))},F.view_subcluster=function(e,t,n,o,a,s,l){l=l||F.subcluster_threshold,(o=o||{}).parent_graph=F;var c=e.children;t&&(c=i.default.isArray(t)?t:i.default.filter(F.json.Nodes,t));var d=F.extract_single_cluster(c,a||function(e){return e.length<=l},!1,null,s);F.has_multiple_sequences&&(i.default.each(d.Nodes,function(e){e["multiple subclusters"]&&(e.multiple_membership=!0)}),o["simplified-mspp"]&&(d=F.simplify_multisequence_cluster(d))),i.default.each(d.Nodes,function(e){e.subcluster_label="1.1"}),v.network.GraphAttrbuteID in F.json&&(d[v.network.GraphAttrbuteID]={},S.extend(!0,d[v.network.GraphAttrbuteID],F.json[v.network.GraphAttrbuteID]));var f=[[function(e,t){var n=t.append("div").classed("form-group",!0);n.append("label").text("重新计算国家优先级,起始日期:").classed("control-label",!0),n.append("input").attr("type","date").classed("form-control",!0).attr("value",p.DateViewFormatSlider(F.today)).attr("max",p.DateViewFormatSlider(F.today)).attr("min",p.DateViewFormatSlider(r.min(e.nodes,function(t){return e.attribute_node_value_by_id(t,p._networkCDCDateField)}))).on("change",function(t){var r=p.DateViewFormatSlider.parse(this.value);this.value?(e._refresh_subcluster_view(r),n.classed("has-success",!0).classed("has-error",!1)):n.classed("has-success",!1).classed("has-error",!0)}).on("click",function(e){r.event.stopPropagation()})},null]];F._is_CDC_executive_mode||f.push(["导出簇到 CSV",function(e){u.export_csv_button(e._extract_attributes_for_nodes(e._extract_nodes_by_id("1.1"),e._extract_exportable_attributes()))}]),o.type="subcluster",o.cluster_id=e.cluster_id||"N/A","extra_menu"in o?o.extra_menu.items=o.extra_menu.items.concat(f):o.extra_menu={title:"操作",items:f};var h=F.open_exclusive_tab_view_aux(d,n||"子簇 "+e.cluster_id,o);return o.skip_recent_rapid||h.handle_attribute_categorical("subcluster_or_priority_node"),h};var I=function(e,t){var n=n||p._networkCDCDateField,r=F.attribute_node_value_by_id(e,n),i=F.attribute_node_value_by_id(t,n);return r===i?e.id<t.id?-1:1:r<i?-1:1};function z(e){var t=E(function(e){var t,n=(t=F.nodes,i.default.groupBy(t,"cluster")),o={id:"root",children:[]};F.exclude_cluster_ids&&(n=i.default.omit(n,F.exclude_cluster_ids));var a=i.default.map(n,function(e,t){return{cluster_id:t,children:e}});if(i.default.size(n)>ue){var s=i.default.chain(a).pairs().sortBy(function(e){return-e.children?e.children.length:0}).value();o.children=[];for(var l=0;l<ue;l++)o.children.push({cluster_id:s[l][0],children:s[l][1]})}else o.children=a;return[(e?r.layout.pack().size([F.width,F.height]).children(function(e){return e.children}).value(function(e){return Math.pow(e.parent.children.length,1.5)}).sort(function(e,t){return t.value-e.value}).padding(5):r.layout.treemap().size([F.width,F.height]).children(function(e){return e.children}).value(function(e){return Math.pow(e.parent.children.length,1)}).sort(function(e,t){return e.value-t.value}).ratio(1)).nodes(o),a]}(e),2),n=(t[0],t[1]);0===F.clusters.length&&(F.clusters=n);var o=e?function(e){"x"in e?(e.x+=.5*e.r,e.y+=.5*e.r):(e.x=Math.random()*F.width,e.y=Math.random()*F.height)}:function(e){"x"in e?(e.x+=.5*e.dx,e.y+=.5*e.dy):(e.x=Math.random()*F.width,e.y=Math.random()*F.height)};i.default.each([F.nodes,F.clusters],function(e){i.default.each(e,o)}),F.clusters.forEach(J)}function $(e){F.charge_correction*=e,he.start()}function q(e,t){if(e){var n=(F.width+e/2)/F.width,o=(F.height+e/2)/F.height;F.width+=e,F.height+=e;var a=r.scale.linear().domain(r.extent(he.nodes(),function(e){return e.x}));a.range(i.default.map(a.domain(),function(e){return e*n}));var s=r.scale.linear().domain(r.extent(he.nodes(),function(e){return e.y}));s.range(i.default.map(s.domain(),function(e){return e*o})),i.default.each(he.nodes(),function(e){e.x=a(e.x),e.y=s(e.y)})}F.width=Math.min(Math.max(F.width,200),4e3),F.height=Math.min(Math.max(F.height,200),4e3),he.size([F.width,F.height]),F.network_svg.attr("width",F.width).attr("height",F.height),F._calc_country_nodes(T),F._draw_topomap(!0),t?he.start():e&&F.update(!0)}F.annotate_priority_clusters=function(e,t,n,r){try{r=r||F.get_reference_date();var o,a=p.n_months_ago(r,t),s=p.n_months_ago(r,n);if(r===F.today)o=F.nodes;else{var l=p.getCurrentDate();l.setYear(1900),o=[],i.default.each(F.nodes,function(t){var n=F.filter_by_date(l,e,r,t);i.default.isUndefined(n)?t.priority_flag=6:n?(t.priority_flag=5,o.push(t)):t.priority_flag=4})}var c={},d={};i.default.each(o,function(e){e.nationalCOI=0,e.cluster&&(e.cluster in c||(c[e.cluster]={Nodes:[],Edges:[]}),d[e.id]=c[e.cluster].Nodes.length,c[e.cluster].Nodes.push(e))}),i.default.each(F.edges,function(e){if(e.length<=F.subcluster_threshold){var t=F.nodes[e.source].cluster,n=F.nodes[e.source].id,r=F.nodes[e.target].id;if(n in d&&r in d){var o=i.default.clone(e);o.source=d[n],o.target=d[r],c[t].Edges.push(o)}}});var f=F.precomputed_subclusters&&F.subcluster_threshold in F.precomputed_subclusters?F.precomputed_subclusters:null;i.default.each(c,function(t,n){var o=F.cluster_mapping[n];F.clusters[o].priority_score=0;var l=[],c=function(e){return e.length>1};F.has_multiple_sequences&&(c=function(e){return F.unique_entity_list(e).length>1});var d=i.default.filter((0,m.hivtrace_cluster_depthwise_traversal)(t.Nodes,t.Edges,null,l),c);l=i.default.filter(l,function(e){return e.length>1}),i.default.each(d,function(e,t){e.sort(I)}),d.sort(function(e,t){return I(e[0],t[0])});var p=d.length+1;d=i.default.map(d,function(e,t){var n=t+1;if(f){var r={};i.default.each(e,function(e){if("subcluster"in e){var t=i.default.find(e.subcluster,function(e){return e[0]===F.subcluster_threshold});if(t)return void(r[t[1].split(v.SubclusterSeparator)[1]]=1)}r.null=1}),n=null in r||1!==i.default.keys(r).length?p++:i.default.keys(r)[0]}var a=F.clusters[o].cluster_id+v.SubclusterSeparator+n;return i.default.each(e,function(e){e.subcluster_label=a,e.priority_flag=0}),{children:i.default.clone(e),parent_cluster:F.clusters[o],cluster_id:a,distances:u.describe_vector(i.default.map(l[t],function(e){return e.length}))}}),i.default.each(d,function(e){oe(e)}),F.clusters[o].subclusters=d,i.default.each(d,function(n){var l=F.extract_single_cluster(i.default.filter(n.children,function(t){return F.filter_by_date(a,e,r,t)}),null,!0,t),u=i.default.filter((0,m.hivtrace_cluster_depthwise_traversal)(l.Nodes,i.default.filter(l.Edges,function(e){return e.length<=F.subcluster_threshold})),function(e){return e.length>1});n.rr_count=u.length,u.sort(function(e,t){return t.length-e.length}),n.priority_score=[],n.recent_nodes=[];var c=new Date(r.getTime()+1e13);"2211.1"==n.cluster_id&&console.log(n,u,l),i.default.each(u,function(t){var o=i.default.groupBy(t,function(t){return F.filter_by_date(s,e,r,t)});n.recent_nodes.push(i.default.map(t,function(e){return e.id}));var l=!0 in o&&o[!0].length>=(F.CDC_data?F.CDC_data["autocreate-priority-set-size"]:3);!0 in o&&(n.priority_score.push(i.default.map(o[!0],function(e){return e.id})),i.default.each(o[!0],function(t){t.priority_flag=F.filter_by_date(r,e,c,t)?4:1,l&&(1===t.priority_flag&&(t.priority_flag=2),t.nationalCOI=1)})),!1 in o&&i.default.each(o[!1],function(t){t.priority_flag=3,l?F.filter_by_date(a,e,r,t)?t.nationalCOI=2:t.nationalCOI=3:t.priority_flag=7})}),F.clusters[o].priority_score=n.priority_score})})}catch(e){console.log(e)}},F.compute_adjacency_list=i.default.once(function(){F.nodes.forEach(function(e){e.neighbors=r.set()}),F.edges.forEach(function(e){F.nodes[e.source].neighbors.add(e.target),F.nodes[e.target].neighbors.add(e.source)})}),F.compute_local_clustering_coefficients=i.default.once(function(){F.compute_adjacency_list(),F.nodes.forEach(function(e){i.default.defer(function(e){var t=e.neighbors.size();if(t<2)e.lcc=m.undefined;else if(t>500)e.lcc=m.too_large;else{for(var n=e.neighbors.values(),r=0,i=0;i<t;i+=1)for(var o=i+1;o<t;o+=1)F.nodes[n[i]].neighbors.has(n[o])&&r++;e.lcc=2*r/t/(t-1)}},e)})}),F.get_node_by_id=function(e){return F.nodes.filter(function(t){return t.id===e})[0]},F.compute_local_clustering_coefficients_worker=i.default.once(function(){var e=new Worker("workers/lcc.js");e.onmessage=function(e){e.data.Nodes.forEach(function(e){F.get_node_by_id(e.id).lcc=e.lcc?e.lcc:m.undefined})};var t={};t.Nodes=F.nodes,t.Edges=F.edges,e.postMessage(t)});var R=i.default.memoize(function(e){return F.compute_adjacency_list(),i.default.reduce(i.default.first(i.default.pluck(e.children,"degree").sort(r.descending),3),function(e,t){return e*t},1)},function(e){return e.cluster_id});function P(e,t){var n=r.select(e);n.selectAll("*").remove();var o=t[1],a=t[0];o?(n.append("span").text(a).style("padding-right","0.5em"),F.has_multiple_sequences?i.default.each(["fa-eye","fa-user-circle"],function(e,r){n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.view_subcluster(t[2],null,0==r?"序列级视图 "+t[0]:null,1==r?{"simplified-mspp":1}:null)}).append("i").classed("fa "+e,!0).attr("title",1==r?"查看":"序列级视图")}):n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.view_subcluster(t[2])}).append("i").classed("fa fa-eye",!0).attr("title","查看")):(n.append("span").text(a).style("padding-right","0.5em"),F.has_multiple_sequences?i.default.each(["fa-eye","fa-user-circle"],function(e,t){n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.open_exclusive_tab_view(a,null,0==t?function(e){return"序列级视图 "+e}:null,1==t?{"simplified-mspp":1}:null)}).append("i").classed("fa "+e,!0).attr("title",1==t?"查看":"序列级视图")}):n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.open_exclusive_tab_view(a)}).append("i").classed("fa fa-eye",!0).attr("title","查看")),n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").attr("data-toggle","modal").attr("data-target",F.get_ui_element_selector_by_role("cluster_list",!0)).attr("data-cluster",a).append("i").classed("fa fa-list",!0).attr("title","列表")}function L(e,t){var n=r.select(e),o=function(e){e.delta;var t=e.moved,n=e.deleted,r=e.new_nodes?e.new_nodes:0,i="";return t&&(i=" "+t+" moved "),r&&(i+="+"+r+" new "),n&&(i+="-"+n+" previous "),i},a=[];t[4]&&("new"===t[4].type?t[4].moved?a.push(["renamed "+o(t[4]),2]):a.push(["new",3]):"extended"===t[4].type?a.push([o(t[4]),t[4].flag]):"merged"===t[4].type&&a.push(["Merged "+t[4].old_clusters.join(", ")+" "+o(t[4]),t[4].flag])),a.push([[t[0]?"展开":"折叠",t[0]?"fa-expand":"fa-compress"],0]),t[1]&&a.push([["problematic","fa-exclamation-circle"],1]),t[2]&&a.push([["match","fa-check-square"],1]);var s=n.selectAll("button").data(a);s.enter().append("button"),s.exit().remove(),s.classed("btn btn-xs",!0).classed("btn-default",function(e){return 1!==e[1]&&2!==e[1]}).classed("btn-danger",function(e){return 2===e[1]}).classed("btn-success",function(e){return 3===e[1]}).style("margin-right","0.25em").attr("disabled",function(e){return 1===e[1]?"disabled":null}).on("click",function(e){0===e[1]?(t[0]?ee(F.clusters[t[3]-1],!0):J(F.clusters[t[3]-1]),F.update_volatile_elements(F.cluster_table),F.subcluster_table&&F.update_volatile_elements(F.subcluster_table)):2!==e[1]&&3!==e[1]||F.open_exclusive_tab_view(t[3],null,function(e){return"Cluster "+e+" [changes view]"},F._social_view_options(["Existing","Newly added"],{Existing:1,"Newly added":1},function(e){return i.default.isObject(e.source)&&_.HIVTxNetwork.is_new_node(e.source)||i.default.isObject(e.target)&&_.HIVTxNetwork.is_new_node(e.target)||e.attributes.indexOf("added-to-prior")>=0?"Newly added":"Existing"})).handle_attribute_categorical("_newly_added")}),s.each(function(e,t){var n=r.select(this);if(i.default.isString(e[0]))n.selectAll("i").remove(),n.text(e[0]);else{var o=n.selectAll("i").data([e[0]]);o.enter().append("i"),o.attr("class",function(e){return"fa "+e[1]},!0).attr("title",function(e){return e[0]})}})}function B(e,t){var n,o=r.select(e);n=1===t.length?i.default.isString(t[0])?[[t[0],1,"btn-warning"]]:["无法显示",1]:[[t[0]?"隐藏":"显示",0]],2===t.length&&t[1]>=1&&n.push(["查看簇",function(){F.open_exclusive_tab_view(t[1])}]);var a=o.selectAll("button").data(n);a.enter().append("button"),a.exit().remove(),a.classed("btn btn-xs btn-node-property",!0).classed("btn-primary",!0).text(function(e){return e[0]}).attr("disabled",function(e){return e[1]&&!i.default.isFunction(e[1])?"disabled":null}).on("click",function(e){i.default.isFunction(e[1])?e[1].call(e):0===e[1]&&(t[0]?J(F.clusters[t[3]-1],!0):ee(F.clusters[t[3]-1]),F.update_volatile_elements(h.getNodeTable()))}),a.each(function(e,t){e.length>=3&&r.select(this).classed("btn-primary",!1).classed(e[2],!0)})}function U(e,t){if(n){var o=i.default.filter(F.clusters,function(e){return!e.collapsed}).length,a=i.default.filter(F.clusters,function(e){return!e.is_hidden&&void 0!==e.match_filter&&e.match_filter>0}).length,s=i.default.filter(F.nodes,function(e){return e.match_filter&&!e.is_hidden}).length,l="<span class = 'badge'>"+F.clusters.length+"</span> 簇 <span class = 'label label-primary'>"+o+" 已展开 / "+a+" 匹配 </span> <span class = 'badge'> "+F.nodes.length+"</span> 节点 <span class = 'label label-primary'>"+e+" 已显示 / "+s+" 匹配 </span> <span class = 'badge'> "+F.edges.length+"</span> "+(F._is_CDC_?"链接":"边")+" <span class = 'label label-primary'>"+t+" 已显示</span>";r.select(n).html(l)}}function V(e){if(e in F.networkShapeScheme){var t=i.default.range(0,le[v.network.GraphAttrbuteID][e].value_range.length);return{domain:t,range:i.default.map(t,function(t){return F.networkShapeScheme[e][le[v.network.GraphAttrbuteID][e].value_range[t]]})}}return{domain:i.default.range(0,le[v.network.GraphAttrbuteID][e].dimension),range:v.ShapeOrdering}}function H(e,t){if(t){var n=F.dom_prefix+"-cluster-gradient-"+F.gradient_id++,r=F.network_svg.selectAll("defs").append("radialGradient").attr("id",n),o=i.default.map(e.children,function(e){var n=F.attribute_node_value_by_id(e,t);return n===v.missing.label?1/0:n}).sort(function(e,t){return 0+e-(0+t)}),a=i.default.filter(o,function(e){return e<1/0}),s=o.length-a.length;return s&&(r.append("stop").attr("offset","0%").attr("stop-color",v.missing.color),r.append("stop").attr("offset",String(s/o.length*100)+"%").attr("stop-color",v.missing.color)),i.default.each(a,function(e,t){r.append("stop").attr("offset",String(100*(1+t+s)/o.length)+"%").attr("stop-color",F.colorizer.category(e))}),n}return null}function W(e){if(F.showing_on_map)return 50;var t=5+Math.sqrt(e.degree);return 4*t*t}function G(e){return e.multiple_membership}function Y(e){return F.colorizer.opacity?F.colorizer.opacity(F.attribute_node_value_by_id(e,F.colorizer.opacity_id,!0)):1}function Q(e){r.event.defaultPrevented||ae(this,!0,(F._is_CDC_?"Individual ":"Node ")+F.entity_id(e),function(e){var t;if(F._is_CDC_){t="链接数 <em>"+e.degree+"</em>";try{e[v.network.AliasedSequencesID]&&e[v.network.AliasedSequencesID].length>1&&(t+="<br> 代表序列数 <em>"+e[v.network.AliasedSequencesID].length+"</em> 序列数")}catch(e){}}else t="度 <em>"+e.degree+"</em><br>聚类系数 <em> "+m.format_value(e.lcc,v.formats.FloatFormat)+"</em>";return i.default.each(i.default.union(F._additional_node_pop_fields,[F.colorizer.category_id,F.node_shaper.id,F.colorizer.opacity_id]),function(n){if(n&&n in le[v.network.GraphAttrbuteID]){var r=F.attribute_node_value_by_id(e,n);if("Date"===le[v.network.GraphAttrbuteID][n].type)try{r=p.DateViewFormat(r)}catch(e){}r&&(t+="<br>"+le[v.network.GraphAttrbuteID][n].label+" <em>"+r+"</em>")}}),t}(e),F.container)}function K(e){r.event.defaultPrevented||ae(this,!1)}function Z(e){var t,n;ae(this,!0,e.source.id+" - "+e.target.id,(t=e,n="Length <em>"+v.formats.FloatFormat(t.length)+"</em>","support"in t&&(n+="<br>Worst triangle-based support (p): <em>"+v.formats.FloatFormat(t.support)+"</em>"),n),F.container)}function X(e){ae(this,!1)}function J(e,t){if(F.needs_an_update=!0,e.collapsed=!0,se-=F.cluster_sizes[e.cluster_id-1]-1,!t){var n=de.indexOf(e.cluster_id);n>=0&&de.splice(n,1)}return function(e){for(var t in e){var n=e[t];n.x=0,n.y=0,i.default.has(n,"children")&&(n.children.forEach(function(e){n.x+=e.x,n.y+=e.y}),n.x/=n.children.length,n.y/=n.children.length)}}([e]),e.children.length}function ee(e,t){F.needs_an_update=!0,e.collapsed=!1,se+=F.cluster_sizes[e.cluster_id-1]-1,de.push(e.cluster_id),t?e.children.forEach(function(t){t.x=e.x+(Math.random()-.5)*e.children.length,t.y=e.y+(Math.random()-.5)*e.children.length}):e.children.forEach(function(t){t.x=.25*F.width+(Math.random()-.5)*e.children.length,t.y=.25*F.height+(Math.random()-.5)*e.children.length})}function te(e,t,n){var o=r.select(F.get_ui_element_selector_by_role(e,!0));if(!o.empty()&&(o.selectAll("thead").remove(),o.selectAll("tbody").remove(),r.select(F.get_ui_element_selector_by_role(e+"_enclosed",!0)).style("display",n?null:"none"),n)){var a=F.colorizer.category,s=t(null,"lookup"),l=o.append("thead").append("tr").selectAll("th").data([""].concat(n[0].map(function(e,t){return s[t]})));if(l.enter().append("th"),l.html(function(e){return"<span>&nbsp;"+e+"</span>"}).each(function(e,t){t&&r.select(this).insert("i",":first-child").classed("fa fa-circle",!0).style("color",function(){return a(e)})}),F.show_percent_in_pairwise_table){var u=i.default.map(n,function(e){return i.default.reduce(e,function(e,t){return e+t},0)});n=i.default.map(n,function(e,t){return i.default.map(e,function(e){return 0===u[t]?null:e/u[t]})})}var c=o.append("tbody").selectAll("tr").data(n.map(function(e,t){return[s[t]].concat(e)}));c.enter().append("tr"),c.selectAll("td").data(function(e){return e}).enter().append("td").html(function(e,t){return 0===t?"<span>&nbsp;"+e+"</span>":F.show_percent_in_pairwise_table?null==e||i.default.isNaN(e)?"-":v.formats.PercentFormat(e):e}).each(function(e,t){0===t&&r.select(this).insert("i",":first-child").classed("fa fa-circle",!0).style("color",function(){return a(e)})})}}function ne(e,t,n){var i=r.select(F.get_ui_element_selector_by_role(e,!0));if(!i.empty()&&(i.selectAll("svg").remove(),r.select(F.get_ui_element_selector_by_role(e+"_enclosed",!0)).style("display",n?null:"none"),n)){var o=t(null,"lookup"),a=i.append("svg"),s=r.layout.chord().padding(.05).sortSubgroups(r.descending).matrix(n),l=.41*Math.min(450,430),u=1.1*l,c=F.colorizer.category,d=a.append("g").attr("transform","translate(225,430)").append("text").attr("text-anchor","middle").attr("font-size",12).text(""),f=function(e,t){return function(n,r){d.text(t?o[r]:""),a.selectAll(".chord path").filter(function(e){return e.source.index!==r&&e.target.index!==r}).transition().style("opacity",e)}};(a=a.attr("width",450).attr("height",450).append("g").attr("transform","translate(225,215)")).append("g").selectAll("path").data(s.groups).enter().append("path").style("fill",function(e){return c(o[e.index])}).style("stroke",function(e){return c(o[e.index])}).attr("d",r.svg.arc().innerRadius(l).outerRadius(u)).on("mouseover",f(.1,!0)).on("mouseout",f(1,!1)),a.append("g").attr("class","chord").selectAll("path").data(s.chords).enter().append("path").attr("d",r.svg.chord().radius(l)).style("fill",function(e){return c(e.target.index)}).style("opacity",1)}}function re(e){var t,n,r,i;ae(this,!0,"簇 "+e.cluster_id,(t=e.cluster_id,i=(r=F.clusters[F.cluster_mapping[t]]).binned_attributes,n=F._is_CDC_?"<strong>"+(F.has_multiple_sequences?F.cluster_sizes_in_entities[t]:F.cluster_sizes[t-1])+"</strong> 个体数."+(F.has_multiple_sequences?"<br><strong> "+F.cluster_sizes[t-1]+"</strong> 序列数.":"")+"<br>平均链接数/个体 <em> = "+v.formats.FloatFormat(r.degrees.mean)+"</em><br>最大链接数/个体 <em> = "+r.degrees.max+"</em>":"<strong>"+F.cluster_sizes[t-1]+"</strong> 节点数.<br>平均度 <em>"+v.formats.FloatFormat(r.degrees.mean)+"</em><br>最大度 <em>"+r.degrees.max+"</em><br>聚类系数 <em> "+m.format_value(r.cc,v.formats.FloatFormat)+"</em>",i&&i.forEach(function(e){n+="<br>"+e[0]+" <em>"+e[1]+"</em>"}),n),F.container)}function ie(e){ae(this,!1)}function oe(e){var t=e.children.map(function(e){return e.degree});t.sort(r.ascending),e.degrees=u.describe_vector(t)}function ae(e,t,n,r,o){if(e)if(t&&!e.tooltip){S("[role='tooltip']").each(function(e){S(this).remove()});var a=S(e);e.tooltip=a.tooltip({title:n+"<br>"+r,html:!0,container:o||"body"}),i.default.delay(i.default.bind(e.tooltip.tooltip,e.tooltip),500,"show")}else!t&&e.tooltip&&(e.tooltip.tooltip("destroy"),e.tooltip=void 0)}F.compute_global_clustering_coefficients=i.default.once(function(){F.compute_adjacency_list(),F.clusters.forEach(function(e){i.default.defer(function(e){if(e.children.length<3)e.cc=m.undefined;else if(R(e,!0)>=5e6)e.cc=m.too_large;else{var t=[],n=0,i=0;F.nodes.forEach(function(n,r){n.cluster===e.cluster_id&&t.push(r)}),t.forEach(function(e){for(var t=F.nodes[e].neighbors.values().map(function(e){return Number(e)}).sort(r.ascending),o=0;o<t.length;o+=1)for(var a=o+1;a<t.length;a+=1)n+=1,F.nodes[t[o]].neighbors.has(t[a])&&(i+=1)}),e.cc=i/n}},e)})}),F.mark_nodes_as_processing=function(e){F.nodes.forEach(function(t){t[e]=m.processing})},F.compute_graph_stats=function(){r.select(this).classed("disabled",!0).select("i").classed({"fa-calculator":!1,"fa-cog":!0,"fa-spin":!0}),F.mark_nodes_as_processing("lcc"),F.compute_local_clustering_coefficients_worker(),F.compute_global_clustering_coefficients(),r.select(this).remove()},F.update_volatile_elements=function(e,t){var n=t?null:g.get_editor();e.selectAll("td, th").filter(function(e){return"volatile"in e}).each(function(e,t){f.format_a_cell(e,t,this,n)})},F.redraw_tables=function(){F.update_volatile_elements(F.cluster_table),F.subcluster_table&&F.update_volatile_elements(F.subcluster_table);var e=h.getNodeTable();F.update_volatile_elements(e,e.node_table_N>e.node_table_DN||e.node_table_DN>v.CoIAddLimit),F.priority_set_table&&F.update_volatile_elements(F.priority_set_table)},F.draw_extended_node_table=function(e,t,n,a){if(t=t||h.getNodeTable(),a=a||{},t){var s=(e=e||F.aggregate_indvidual_level_records()).length;e.length>ce&&(e=e.slice(0,ce)),t.node_table_N=s,t.node_table_DN=e.length;var l=F._extract_exportable_attributes(!0);F.displayed_node_subset=i.default.filter(i.default.map(F.displayed_node_subset,function(e,t){return i.default.isString(e)?(e=i.default.find(l,function(t){return t.raw_attribute_key===e}))||l[t]:e}),function(e){return e});var u=F._extract_attributes_for_nodes(e,F.displayed_node_subset);u.splice(0,1);var c=i.default.map(F.displayed_node_subset,function(s,u){return{value:s.raw_attribute_key,sort:"value",filter:!a||!a["no-filter"],volatile:!0,help:"label"in s?s.label:s.raw_attribute_key,callback:function(c,d){var f=r.select(c).append("div").classed("dropdown",!0),p="hivtrace_node_column_"+d+"_"+u,h=f.append("button").classed({btn:!0,"btn-default":!0,"btn-xs":!0,"dropdown-toggle":!0}).attr("type","button").attr("data-toggle","dropdown").attr("aria-haspopup","true").attr("aria-expanded","false").attr("id",p);function g(e){return e in F.json.patient_attribute_schema?F.json.patient_attribute_schema[e].label:function(e){var t=o.default.toHeaderCase(e).split(" ");return i.default.map(t,function(e){return"hivtrace"===e.toLowerCase()?"HIV-TRACE":"id"===e.toLowerCase()?"ID":e}).join(" ")}(e)}h.text(g(d)),h.append("i").classed({fa:!0,"fa-caret-down":!0,"fa-lg":!0});var m=f.append("ul").classed("dropdown-menu",!0).attr("aria-labelledby",p);return(m=m.selectAll("li").data(i.default.filter(l,function(e){return e.raw_attribute_key!==s.raw_attribute_key}))).enter().append("li"),m.each(function(i,o){var s=r.select(this).append("a").attr("href","#").text(function(e){return g(e.raw_attribute_key)});s.on("click",function(r){F.displayed_node_subset[u]=r,F.draw_extended_node_table(e,t,n,a)})}),f}}});n&&i.default.each(n,function(e){e.prepend?c.splice(0,0,e.description):c.push(e.description)});var d=u.map(function(t,o){var a=i.default.map(t,function(e,t){var n=null;return"Date"===F.displayed_node_subset[t].type?n={value:e,format:function(e){return e===v.missing.label?e:p.DateViewFormatSlider(e)}}:"Number"===F.displayed_node_subset[t].type&&(n={value:e,format:r.format(".2f")}),n||(n={value:e}),n});return n&&i.default.each(n,function(t){t.prepend?a.splice(0,0,t.generator(e[o],F)):a.push(t.generator(e[o],F))}),a});F.draw_node_table(null,e,[c],d,t,'Showing <span class="badge" data-hivtrace-ui-role="table-count-shown">--</span>/<span class="badge" data-hivtrace-ui-role="table-count-total">--</span> network entities <span class="label label-warning" data-hivtrace-ui-role="table-count-warning"></span>',s)}},F.generate_coi_temporal_report=function(e,t){if(!e)return{};t=t||.005;var n=(0,m.hivtrace_cluster_depthwise_traversal)(F.json.Nodes,F.json.Edges,function(e){return e.length<=t},null,e.node_objects),r=i.default.map(n,function(e){return F.extract_single_cluster(e,function(e){return e.length<=t})}),o=new Set(i.default.map(e.node_objects,function(e){return e.id})),a=i.default.map(r,function(e){return i.default.filter(e.Nodes,function(e){return o.has(e.id)})});i.default.each(a,function(e){return i.default.each(e,function(e){return e.visited=!1})});var s=p.getCurrentDate();s.setFullYear(1900);var l=i.default.sortBy(A(F.priority_groups_all_events()));l.reverse();var u={};return i.default.each(l,function(e){var n=p.DateViewFormatSlider.parse(e),o=p.DateViewFormatSlider.parse(e);o.setFullYear(n.getFullYear()-3);var l=p.DateViewFormatSlider.parse(e);l.setFullYear(n.getFullYear()-1);var c=function(e){return F.filter_by_date(s,p._networkCDCDateField,n,e)},d=function(e){return F.filter_by_date(o,p._networkCDCDateField,n,e)},f=function(e){return F.filter_by_date(l,p._networkCDCDateField,n,e)},h=i.default.map(r,function(e,n){var r=new Set(i.default.map(i.default.filter(e.Nodes,c),function(e){return e.id})),o=e.Nodes;return(0,m.hivtrace_cluster_depthwise_traversal)(o,e.Edges,function(e){return e.length<=t&&d(o[e.source])&&d(o[e.target])},null,i.default.filter(a[n],c),r)});h=i.default.flatten(h,1),u[e]={connected_componets:i.default.map(h,function(e){return e.length}),priority_nodes:i.default.map(h,function(e){return i.default.map(i.default.filter(e,f),function(e){return e.id})})},u[e].national_priority=i.default.map(u[e].priority_nodes,function(e){return e.length>=F.CDC_data["autocreate-priority-set-size"]})}),{node_info:i.default.map(e.node_objects,function(e){return[e.id,p.DateViewFormatSlider(F.attribute_node_value_by_id(e,p._networkCDCDateField))]}),event_info:u}},F.draw_node_table=function(e,t,n,r,o,a,s){(o=o||h.getNodeTable())&&(t=t||F.nodes,s=s||t.length,n||(n=[[{value:"ID",sort:"value",help:"Node ID"},{value:"操作",sort:"value"},{value:"链接数",sort:"value",help:"Number of links (Node degree)"},{value:"簇",sort:"value",help:"Which cluster does the node belong to"}]],e&&i.default.each(e,function(e){e.prepend?n[0].splice(0,0,e.description):n[0].push(e.description)}),r=t.map(function(t,n){var r=[{value:t.id,help:"Node ID"},{value:function(){if("injected"===t.node_class)return[t.node_annotation];try{return F.exclude_cluster_ids[t.cluster]?[t.cluster]:[!F.clusters[F.cluster_mapping[t.cluster]].collapsed,t.cluster]}catch(e){return[-1]}},callback:B,volatile:!0},{value:"degree"in t?t.degree:"Not defined",help:"Node degree"},{value:"cluster"in t?t.cluster:"Not defined",help:"Which cluster does the node belong to"}];return e&&i.default.each(e,function(e){e.prepend?r.splice(0,0,e.generator(t,F)):r.push(e.generator(t,F))}),r})),f.add_a_sortable_table(o,n,r,!0,a,g.get_editor(),s))},F.draw_cluster_table=function(e,t,n){var o=n&&n["no-clusters"],a=!(n&&n.subclusters);if(t=t||F.cluster_table){var s=[[{value:"簇 ID",sort:function(e){return i.default.map(e.value[0].split(v.SubclusterSeparator),function(e){return v.formats.DotFormatPadder(Number(e))}).join("|")},help:"Unique cluster ID"},{value:"属性",sort:function(e){return(e=e.value())[4]?e[4].delta:e[0]},help:"Visibility in the network tab and other attributes"},{value:"大小",sort:"value",help:"Number of nodes in the cluster"}]];F.cluster_attributes&&(s[0][1].presort="desc"),F._is_seguro&&(s[0].push({value:"过去 2 个月的基因型数量",sort:"value",help:"# of cases in cluster genotyped in the last 2 months"}),s[0].push({value:"缩放后的过去 2 个月基因型数量",sort:"value",help:"# of cases in cluster genotyped in the last 2 months divided by the square-root of the cluster size"})),F._is_CDC_||(s[0].push({value:"每节点的链接数<br>平均值[中位数, IQR]",html:!0}),s[0].push({value:"链接节点间的遗传距离<br>平均值[中位数, IQR]",help:"Genetic distance among nodes in the cluster",html:!0})),e&&i.default.each(e,function(e){s[0].push(e.description)}),n&&n.headers&&n.headers(s);var l=[];i.default.each(F.clusters,function(t){var n=function(t,n){var o=[{value:[t.cluster_id,n,t],callback:P},{value:function(){var e=n?t.parent_cluster:t;return[e.collapsed,e.hxb2_linked,e.match_filter,e.cluster_id,n?null:F.cluster_attributes?F.cluster_attributes[e.cluster_id]:null]},callback:L,volatile:!0},{value:F.unique_entity_list(t.children).length}];return F._is_CDC_&&(o[2].volatile=!0,o[2].actions=function(e,n){return g.get_editor()?[{icon:"fa-plus",action:function(e,n){return g.get_editor()&&g.get_editor().append_node_objects(t.children),!1},help:"Add to cluster of interest"}]:null}),F._is_seguro&&(o.push({value:t,format:function(e){return i.default.filter(e.children,function(e){return r.time.months(e.patient_attributes.sample_dt,p.getCurrentDate()).length<=2}).length}}),o.push({value:t,format:function(e){return(i.default.filter(e.children,function(e){return r.time.months(e.patient_attributes.sample_dt,p.getCurrentDate()).length<=2}).length/Math.sqrt(e.children.length)).toFixed(2)}})),F._is_CDC_||(o.push({value:t.degrees,format:function(e){try{return v.formats.FloatFormat(e.mean)+" ["+v.formats.FloatFormat(e.median)+", "+v.formats.FloatFormat(e.Q1)+" - "+v.formats.FloatFormat(e.Q3)+"]"}catch(e){return""}}}),o.push({value:t.distances,format:function(e){try{return v.formats.FloatFormat(e.mean)+" ["+v.formats.FloatFormat(e.median)+", "+v.formats.FloatFormat(e.Q1)+" - "+v.formats.FloatFormat(e.Q3)+"]"}catch(e){return""}}})),e&&i.default.each(e,function(e){o.push(e.generator(t,F))}),o};o||l.push(n(t,!1)),a||i.default.each(t.subclusters,function(e){l.push(n(e,!0))})}),f.add_a_sortable_table(t,s,l,!0,n&&n.caption?n.caption:null,g.get_editor())}},F.handle_shape_categorical=function(e){var t="None";if(["shapes"].forEach(function(n){r.select(F.get_ui_element_selector_by_role(n)).selectAll("li").selectAll("a").attr("style",function(n,r){return n[1]===e?(t=n[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(n+"_label")).html("形状: "+t+' <span class="caret"></span>')}),e){var n=V(e),i=r.scale.ordinal().domain(n.domain).range(n.range);F.node_shaper.id=e,F.node_shaper.shaper=function(t){return i(le[v.network.GraphAttrbuteID][e].value_map(F.attribute_node_value_by_id(t,e)))},F.node_shaper.category_map=le[v.network.GraphAttrbuteID][e].value_map}else F.node_shaper.id=null,F.node_shaper.shaper=function(){return"circle"},F.node_shaper.category_map=null;F.draw_attribute_labels(),F.update(!0),r.event.preventDefault()},F.renderColorPicker=function(e,t){"categorical"===t?function(e){var t=F.colorizer,n=i.default.map(i.default.filter(F.uniqValues[e]),function(e){return c.colorPickerInput(e,t)});S("#colorPickerRow").html(n.join("")),S(".hivtrace-color-picker").change(function(t){var n=t.target.value,r=t.target.name;i.default.isUndefined(le[v.network.GraphAttrbuteID][e]["user-defined"])&&(le[v.network.GraphAttrbuteID][e]["user-defined"]={}),le[v.network.GraphAttrbuteID][e]["user-defined"][r]=n,F.handle_attribute_categorical(e)})}(e):"continuous"===t?function(e,t){var n=[c.colorStops("Color Stops",t),c.colorPickerInputContinuous("Min",F.uniqValues[e].min),c.colorPickerInputContinuous("Max",F.uniqValues[e].max)];S("#colorPickerRow").html(n.join("")),S(".hivtrace-color-picker").change(function(t){var n=t.target.value,r=t.target.name;i.default.isUndefined(le[v.network.GraphAttrbuteID][e]["user-defined"])&&(le[v.network.GraphAttrbuteID][e]["user-defined"]={}),le[v.network.GraphAttrbuteID][e]["user-defined"][r]=n,F.handle_attribute_continuous(e)}),S(".hivtrace-color-stops").change(function(t){var n=parseInt(t.target.value);le[v.network.GraphAttrbuteID][F.colorizer.category_id].color_stops=n,F._aux_populate_category_menus(),F.handle_attribute_continuous(e),F.update()})}(e,le[v.network.GraphAttrbuteID][F.colorizer.category_id].color_stops):console.log("Error: type not recognized"),null!==e?S("#colorPickerOption").show():S("#colorPickerOption").hide()},F.draw_attribute_labels=function(){var e=function(e){return"label_format"in e?e.label_format:"Date"===e.type?p.DateViewFormatShort:r.format(",.4r")};F.legend_svg.selectAll("g.hiv-trace-legend").remove();var t=10;if(F.legend_caption&&(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text(F.legend_caption).style("font-weight","bold"),t+=18),F.legend_multiple_sequences&&F.rendered_object_counts&&F.rendered_object_counts.nodes>0&&(F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(3,"+(t+5)+")").append("circle").attr("cx","6").attr("cy","-4").attr("r","6").classed("multi_sequence",!0).style("fill","none"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+(t+5)+")").append("text").text("Represents >1 sequence"),t+=24),F.rendered_object_counts&&F.rendered_object_counts.has_hatching&&(F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill","url(#"+F.generate_cross_hatch_pattern("#cab")+")"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text("Contains sequences in >1 cluster/subcluster"),t+=24),F.edge_legend&&(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text(F.edge_legend.caption).style("font-weight","bold"),t+=18,i.default.each(F.edge_legend.types,function(e,n){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n),e.call(F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("line").attr("x1","0").attr("y1","-4").attr("x2","12").attr("y2","-4").classed("legend",!0)),t+=18})),F.colorizer.category_id)if(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text("Color: "+F.json[v.network.GraphAttrbuteID][F.colorizer.category_id].label).style("font-weight","bold"),t+=18,F.colorizer.continuous){var n=e(le[v.network.GraphAttrbuteID][F.colorizer.category_id]),o=le[v.network.GraphAttrbuteID][F.colorizer.category_id].color_stops||v.network.ContinuousColorStops,a=le[v.network.GraphAttrbuteID][F.colorizer.category_id].scale;i.default.each(i.default.range(o),function(e){var r=a.invert(e);F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n(r)),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",F.colorizer.category(r)),t+=18}),"category_values"in le[v.network.GraphAttrbuteID][F.colorizer.category_id]&&i.default.each(le[v.network.GraphAttrbuteID][F.colorizer.category_id].category_values,function(e){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(e),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",F.colorizer.category(e)),t+=18}),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text("missing"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",v.missing.color),t+=18}else i.default.each(F.colorizer.category_map(null,"map"),function(e,n){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",F.colorizer.category(n)),t+=18});if(F.node_shaper.id){F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text("Shape: "+F.json[v.network.GraphAttrbuteID][F.node_shaper.id].label).style("font-weight","bold"),t+=18;var s=V(F.node_shaper.id),l=r.scale.ordinal().domain(s.domain).range(s.range);i.default.each(F.node_shaper.category_map(null,"map"),function(e,n){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("path").attr("transform","translate(5,-5)").attr("d",m.symbol(l(e)).size(128)).classed("legend",!0).style("fill","none"),t+=18})}F.colorizer.opacity_id&&(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text("透明度: "+F.json[v.network.GraphAttrbuteID][F.colorizer.opacity_id].label).style("font-weight","bold"),t+=18,n=e(le[v.network.GraphAttrbuteID][F.colorizer.opacity_id]),a=le[v.network.GraphAttrbuteID][F.colorizer.opacity_id].scale,i.default.each(i.default.range(v.network.ContinuousColorStops),function(e){var r=a.invert(e);F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n(r)),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill","black").style("opacity",F.colorizer.opacity(r)),t+=18}),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text("missing"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill","black").style("opacity",v.missing.opacity),t+=18)},F.handle_attribute_opacity=function(e){var t="None";if(["opacity"].forEach(function(n){r.select(F.get_ui_element_selector_by_role(n)).selectAll("li").selectAll("a").attr("style",function(n,r){return n[1]===e?(t=n[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(n+"_label")).html("透明度: "+t+' <span class="caret"></span>')}),r.select(F.get_ui_element_selector_by_role("opacity_invert")).style("display","None"===t?"none":"inline").classed("btn-active",!1).classed("btn-default",!0),F.colorizer.opacity_id=e,e){var n=le[v.network.GraphAttrbuteID][e].scale;F.colorizer.opacity_scale=r.scale.linear().domain([0,v.network.ContinuousColorStops-1]).range([.25,1]),F.colorizer.opacity=function(e){return e===v.missing.label?v.missing.opacity:F.colorizer.opacity_scale(n(e))}}else F.colorizer.opacity=null,F.colorizer.opacity_scale=null;F.draw_attribute_labels(),F.update(!0),r.event.preventDefault()},F.handle_attribute_continuous=function(e){var t="None";if(ne("aux_svg_holder",null,null),te("attribute_table",null,null),F.network_svg.selectAll("radialGradient").remove(),F.clusters.forEach(function(e){delete e.binned_attributes,delete e.gradient}),[["attributes",!1],["attributes_cat",!0]].forEach(function(n){r.select(F.get_ui_element_selector_by_role(n[0],n[1])).selectAll("li").selectAll("a").attr("style",function(n,r){return n[1]===e?(t=n[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(n[0]+"_label",n[1])).html("Color: "+t+' <span class="caret"></span>')}),r.select(F.get_ui_element_selector_by_role("attributes_invert")).style("display","None"===t?"none":"inline").classed("btn-active",!1).classed("btn-default",!0),e){var n=le[v.network.GraphAttrbuteID][e].color_stops||v.network.ContinuousColorStops;if(le[v.network.GraphAttrbuteID][e].color_scale?(F.colorizer.category=le[v.network.GraphAttrbuteID][e].color_scale(le[v.network.GraphAttrbuteID][e],F),F.uniqValues[e].min=F.colorizer.category(n),F.uniqValues[e].max=F.colorizer.category(n)):F.colorizer.category=i.default.wrap(r.scale.linear().domain(i.default.range(v.network.ContinuousColorStops)).range(["#fff7ec","#7f0000"]).interpolate(r.interpolateRgb),function(t,n){return F.uniqValues[e].min="#fff7ec",F.uniqValues[e].max="#7f0000",t(le[v.network.GraphAttrbuteID][e].scale(n)*(1/v.network.ContinuousColorStops))}),le[v.network.GraphAttrbuteID][e]["user-defined"]){var o=le[v.network.GraphAttrbuteID][e]["user-defined"].min||F.uniqValues[e].min,a=le[v.network.GraphAttrbuteID][e]["user-defined"].max||F.uniqValues[e].max;F.uniqValues[e].min=le[v.network.GraphAttrbuteID][e]["user-defined"].min||F.uniqValues[e].min,F.uniqValues[e].max=le[v.network.GraphAttrbuteID][e]["user-defined"].max||F.uniqValues[e].max,F.colorizer.category=i.default.wrap(r.scale.linear().domain(i.default.range(n)).range([o,a]).interpolate(r.interpolateRgb),function(t,r){return t(le[v.network.GraphAttrbuteID][e].scale(r)*(1/n))})}F.colorizer.category_id=e,F.colorizer.continuous=!0,F.clusters.forEach(function(t){t.gradient=H(t,e)});var s=[],l=null;if(F.attributes_selected_cluster){var u=i.default.find(F.clusters,function(e){return String(e.cluster_id)===String(F.attributes_selected_cluster)});u&&u.children&&(l=new Set(i.default.map(u.children,function(e){return e.id})))}i.default.each(F.edges,function(t){if(l){var n=F.nodes[t.source],r=F.nodes[t.target];if(!n||!r)return;if(!l.has(n.id)||!l.has(r.id))return}var i=F.attribute_node_value_by_id(F.nodes[t.source],e,!0),o=F.attribute_node_value_by_id(F.nodes[t.target],e,!0);i!==v.missing.label&&o!==v.missing.label&&s.push({x:i,y:o,title:F.nodes[t.source].id+" ("+i+") -- "+F.nodes[t.target].id+" ("+o+")"})}),r.select(F.get_ui_element_selector_by_role("aux_svg_holder_enclosed",!0)).style("display",null),d.M(s,400,400,F.get_ui_element_selector_by_role("aux_svg_holder",!0),{x:"Source",y:"Target"},"Date"===le[v.network.GraphAttrbuteID][e].type)}else F.colorizer.category=null,F.colorizer.category_id=null,F.colorizer.continuous=!1,F.colorizer.category_pairwise=null,F.colorizer.category_map=null;F.renderColorPicker(e,"continuous"),F.draw_attribute_labels(),F.update(!0),r.event&&r.event.preventDefault()},F.define_node_search_table=function(){if(F.node_search_div=F.get_ui_element_selector_by_role("node_search_div",!0),F.node_search_div&&F.isPrimaryGraph){var e=function(e,t){return"String"==e?"string":"Number"==e?t.is_integer?"integer":"double":"Date"==e?"date":"string"};if(F.node_search_attributes=F._extract_exportable_attributes(!1),F.qb_filter_def=i.default.sortBy(i.default.map(F.node_search_attributes,function(t){var n={id:t.raw_attribute_key,label:t.label,type:e(t.type,t)};return t.enum&&(n.values=i.default.map(i.default.clone(t.enum),function(e){return{value:e,label:i.default.escape(e)}}),n.input="select"),"date"==n.type?(n.plugin="datepicker",n.plugin_config={format:"yyyy/mm/dd",todayBtn:"linked",todayHighlight:!0,autoclose:!0},n.operators=["equal","not equal","less","less_or_equal","greater","greater_or_equal"]):"string"==n.type?n.operators=["equal","not equal","contains","begins_with","ends_with","is_empty","is_not_empty"]:"integer"!=n.type&&"double"!=n.type||(n.operators=["equal","not equal","less","less_or_equal","greater","greater_or_equal","between"]),n}),function(e){return e.label}),F.nodeFilterObject){try{if(i.default.isEqual(F.nodeFilterObject,F.qb_filter_def))return}catch(e){console.log(e)}S(F.node_search_div).queryBuilder("destroy"),F.nodeFilterObject=null,F.aggregate_entity_data=null}var t=r.select(F.node_search_div).selectAll('[data-hivtrace-ui-role="node-selector-search-buttonbar"]');t.empty()&&(r.select(F.node_search_div).append("div").classed("alert alert-info alert-dismissible",!0).style("font-size","150%").text("Please define some search criteria to find and display information on persons in the network. By default, no persons are displayed.").append("button").classed("close",!0).attr("data-dismiss","alert").append("span").html("&times;"),t=r.select(F.node_search_div).append("div").classed("btn-group btn-group-sm",!0).attr("data-hivtrace-ui-role","node-selector-search-buttonbar"),F.node_query_button_reset=t.append("button").text("Reset").classed("btn btn-warning",!0),F.node_query_button_search=t.append("button").text("Search").classed("btn btn-primary",!0)),F.nodeFilterObject=i.default.clone(F.qb_filter_def),S(F.node_search_div).queryBuilder({plugins:{"filter-description":null,"bt-tooltip-errors":null,"not-group":null},filters:F.qb_filter_def}),r.select(S(F.node_search_div).get(0)).selectAll(".group-conditions").selectAll("label").classed("btn-primary",!1).classed("btn-default",!0),S(F.node_search_div).on("afterInit.queryBuilder afterSetRules.queryBuilder afterAddGroup.queryBuilder",function(e,t){r.select(S(F.node_search_div).get(0)).selectAll(".group-conditions").selectAll("label").classed("btn-primary",!1).classed("btn-default",!0)}),F.process_search_field=function(e,t){switch(t.type){case"string":switch(e||(e=""),e=e.toLowerCase(),t.operator){case"equal":return e==t.value;case"not equal":return e!=t.value;case"contains":return e.indexOf(t.value)>=0;case"begins_with":return 0==e.indexOf(t.value);case"ends_with":return e.indexOf(t.value)==Math.max(0,e.length-t.value.length);case"is_not_empty":return e.length>0;case"is_empty":return 0==e.length}break;case"date":case"integer":case"double":if(!e)return!1;switch(t.operator){case"equal":return e==t.value;case"not equal":return e!=t.value;case"less":return e<t.value;case"less_or_equal":return e<=t.value;case"greater":return e>t.value;case"greater_or_equal":return e>=t.value;case"between":return e>=t.value[0]&&e<=t.value[1]}}return!1},F.process_search=function(e,t){var n;return t.rules?(n=i.default.map(t.rules,function(t){return F.process_search(e,t)}),n="AND"==t.condition?i.default.every(n,function(e){return e}):"OR"==t.condition&&i.default.some(n,function(e){return e}),t.not?!n:n):F.process_search_field(F.attribute_node_value_by_id(e,t.id,"number"==t.type),t)},F.rule_lc=function(e){e.rules?i.default.each(e.rules,function(e){F.rule_lc(e)}):e.value&&("string"==e.type?e.value=e.value.toLowerCase():"date"==e.type&&(e.value=p.DateViewNodeSearch.parse(e.value)))},F.aggregate_entity_data||(F.aggregate_entity_data=F.aggregate_indvidual_level_records()),F.node_query_button_reset.on("click",function(e){S(F.node_search_div).queryBuilder("reset"),F.draw_extended_node_table([],null,null,{"no-filter":!0})}),F.node_query_button_search.on("click",function(e){var t=S(F.node_search_div).queryBuilder("getRules");S.isEmptyObject(t)?F.draw_extended_node_table([],null,null,{"no-filter":!0}):(F.rule_lc(t),F.draw_extended_node_table(i.default.filter(F.aggregate_entity_data,function(e){return F.process_search(e,t)}),null,null,{"no-filter":!0}))})}F.isPrimaryGraph&&F.draw_extended_node_table([],null,null,{"no-filter":!0})},F.handle_attribute_categorical=function(e,t){var n="None";if(r.select(F.get_ui_element_selector_by_role("attributes_invert")).style("display","none"),F.network_svg.selectAll("radialGradient").remove(),[["attributes",!1],["attributes_cat",!0]].forEach(function(t){r.select(F.get_ui_element_selector_by_role(t[0],t[1])).selectAll("li").selectAll("a").attr("style",function(t,r){return t[1]===e?(n=t[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(t[0]+"_label",t[1])).html("Color: "+n+' <span class="caret"></span>')}),F.clusters.forEach(function(t){delete t.gradient,t.binned_attributes=function(e){if(e){var t={},n=[];for(var r in e.forEach(function(e){e in t?t[e]+=1:t[e]=1}),t)n.push([r,t[r]]);return n.sort(function(e,t){return e[0]-t[0]})}return e}(function(e,t){return t&&e?e.children.map(function(e){return F.attribute_node_value_by_id(e,t)}):null}(t,e))}),F.colorizer.continuous=!1,e){if(e in F.networkColorScheme){var o=le[v.network.GraphAttrbuteID][e].enum;o&&(o=new Set(i.default.map(o,function(e){return e.toLowerCase()})));var a=[],s=[];i.default.each(F.networkColorScheme[e],function(e,t){o&&!o.has(t.toLowerCase())||(a.push(t),s.push(e))}),F.colorizer.category=r.scale.ordinal().domain(a).range(s)}else if(le[v.network.GraphAttrbuteID][e].color_scale)F.colorizer.category=le[v.network.GraphAttrbuteID][e].color_scale(le[v.network.GraphAttrbuteID][e],F);else{F.colorizer.category=r.scale.ordinal().range(v.Categorical);var l=i.default.clone(F.colorizer.category.range());l.push(v.missing.color),F.colorizer.category.domain(i.default.range(v.MaximumValuesInCategories+1)),F.colorizer.category.range(l),le[v.network.GraphAttrbuteID][e]["stable-ish order"]&&(F.colorizer.category=i.default.wrap(F.colorizer.category,function(t,n){if(n===v.missing.label)return t(v.MaximumValuesInCategories);var r=le[v.network.GraphAttrbuteID][e];return r.reduced_value_range&&(n in r.reduced_value_range||(n=v.network.ReducedValue)),t(r["stable-ish order"][n])}))}le[v.network.GraphAttrbuteID][e]["user-defined"]&&(F.colorizer.category=i.default.wrap(F.colorizer.category,function(t,n){return n in le[v.network.GraphAttrbuteID][e]["user-defined"]?le[v.network.GraphAttrbuteID][e]["user-defined"][n]:t(n)})),F.colorizer.category_id=e,F.colorizer.category_map=le[v.network.GraphAttrbuteID][e].value_map,F.colorizer.category_pairwise=function(e,t,n){for(var r=F.edges,o=[],a=0;a<t;a+=1){o.push([]);for(var s=0;s<t;s+=1)o[a].push(0)}var l=null;if(F.attributes_selected_cluster){var u=i.default.find(F.clusters,function(e){return String(e.cluster_id)===String(F.attributes_selected_cluster)});u&&u.children&&(l=new Set(i.default.map(u.children,function(e){return e.id})))}if(i.default.each(r,function(t){if(l){var r=F.nodes[t.source],i=F.nodes[t.target];if(!r||!i)return;if(!l.has(r.id)||!l.has(i.id))return}o[n(F.attribute_node_value_by_id(F.nodes[t.source],e))][n(F.attribute_node_value_by_id(F.nodes[t.target],e))]+=1}),!o.some(function(e,n){return n===t-1?e.some(function(e){return e>0}):e[t-1]>0})){o.pop();for(var c=0;c<t-1;c+=1)o[c].pop()}t=o.length;for(var d=0;d<t;d+=1)for(var f=d;f<t;f+=1)o[d][f]+=o[f][d],o[f][d]=o[d][f];return o}(e,F._aux_get_attribute_dimension(e),F.colorizer.category_map),ne("aux_svg_holder",F.colorizer.category_map,F.colorizer.category_pairwise),te("attribute_table",F.colorizer.category_map,F.colorizer.category_pairwise)}else F.colorizer.category=null,F.colorizer.category_id=null,F.colorizer.category_pairwise=null,F.colorizer.category_map=null,ne("aux_svg_holder",null,null),te("attribute_table",null,null);F.handle_inline_charts&&F.handle_inline_charts(),F.draw_attribute_labels(),F.update(!0),r.event&&r.event.preventDefault(),F.renderColorPicker(e,"categorical")},F.filter_visibility=function(){F.clusters.forEach(function(e){e.is_hidden=F.hide_unselected&&!e.match_filter}),F.nodes.forEach(function(e){e.is_hidden=F.hide_unselected&&!e.match_filter})},F.filter=function(e,t){var n=!1;(e=i.default.map(["re","distance","date"],function(t){return i.default.map(i.default.filter(e,function(e){return e.type===t}),function(e){return"distance"===t?e:e.value})}))[1].length?(F.nodes.forEach(function(e){e.length_filter=!1}),i.default.each(F.edges,function(t){var n=i.default.some(e[1],function(e){return e.greater_than?t.length>=e.value:t.length<e.value});n&&(F.nodes[t.source].length_filter=!0,F.nodes[t.target].length_filter=!0),t.length_filter=n})):(F.nodes.forEach(function(e){e.length_filter=!1}),F.edges.forEach(function(e){e.length_filter=!1})),e[2].length?F.nodes.forEach(function(t){var n=F.attribute_node_value_by_id(t,p.getClusterTimeScale());t.date_filter=i.default.some(e[2],function(e){return n>=e[0]&&n<=e[1]})}):F.nodes.forEach(function(e){e.date_filter=!1}),F.clusters.forEach(function(e){e.match_filter=0}),F.edges.forEach(function(e){e.length_filter&&(n=!0)}),F.nodes.forEach(function(t){var r=i.default.some(e[0],function(e){return e.test(t.id)||i.default.some(t[v.network.NodeAttributeID],function(t){return e.test(t)})});(r=r||t.length_filter||t.date_filter)!==t.match_filter&&(t.match_filter=r,n=!0),t.match_filter&&t.parent&&(t.parent.match_filter+=1)}),n&&F.handle_inline_charts&&F.handle_inline_charts(function(e){return e.match_filter}),n&&!t&&(F.hide_unselected&&F.filter_visibility(),F.update(!0))},F.is_empty=function(){return 0===F.cluster_sizes.length},F.link_generator_function=function(e){var t,n=e.pull||0;if(0!==n){var i=e.target.x-e.source.x,o=e.target.y-e.source.y;n*=Math.sqrt(i*i+o*o);var a=Math.PI/6,s=i?Math.atan(-o/i):Math.PI/2;n<0&&(a=-a,n=-n);var l,u,c=Math.cos(a+s)*n,d=Math.cos(a-s)*n,f=Math.sin(a+s)*n,p=Math.sin(a-s)*n;e.target.x>=e.source.x?(l=[c,-f],u=[-d,-p]):(l=[-d,-p],u=[c,-f]),t="M"+e.source.x+" "+e.source.y+" C "+(e.source.x+l[0])+" "+(e.source.y+l[1])+", "+(e.target.x+u[0])+" "+(e.target.y+u[1])+", "+e.target.x+" "+e.target.y}else t="M"+e.source.x+" "+e.source.y+" L "+e.target.x+" "+e.target.y;r.select(this).attr("d",t)},F.update=function(e,t){var n,o,a,s,l,c;if(F.needs_an_update=!1,T&&T["extra-graphics"]&&T["extra-graphics"].call(null,F,T),t&&he.friction(t),F.display_warning(F.warning_string,!0),e)n=F.network_svg.selectAll(".node"),o=F.network_svg.selectAll(".cluster-group"),a=F.network_svg.selectAll(".link"),U(n.size(),a.size());else{var d=(s={all:[],edges:[],nodes:[],clusters:[]},l=[],c=[],F.clusters.forEach(function(e){F.cluster_display_filter(e)&&(e.children.some(function(e){return e.hxb2_linked})&&F.hide_hxb2||(e.collapsed?(s.clusters.push(e),s.all.push(e)):l[e.cluster_id]=!0))}),F.nodes.forEach(function(e,t){l[e.cluster]&&(c[t]=s.nodes.length+s.clusters.length,s.nodes.push(e),s.all.push(e))}),F.edges.forEach(function(e){if(!(e.removed&&F.filter_edges||void 0===c[e.source]||void 0===c[e.target])){var t={};for(var n in e)t[n]=e[n];t.source=c[e.source],t.target=c[e.target],t.ref=e,s.edges.push(t)}}),s);he.nodes(d.all).links(d.edges),U(d.nodes.length,d.edges.length);var f={};i.default.each(d.edges,function(e){var t;e.pull=0,(t=e.source<e.target?String(e.source)+"|"+e.target:String(e.target)+"|"+e.source)in f?f[t].push(e):f[t]=[e]}),i.default.each(f,function(e){if(e.length>1){var t=1/(e.length-1);i.default.each(e,function(e,n){e.pull=n*t-.5})}}),(a=F.network_svg.selectAll(".link").data(d.edges,function(e){return e.id})).enter().append("path").classed("link",!0),a.exit().remove(),a.classed("removed",function(e){return F.highlight_unsuppored_edges&&e.removed}).classed("unsupported",function(e){return F.highlight_unsuppored_edges&&"support"in e&&e.support>.05}).classed("core-link",function(e){return e.length<=F.core_link_length}).classed("mspp-link",function(e){return e.weight>1}),a.on("mouseover",Z).on("mouseout",X).filter(function(e){return e.directed}).attr("marker-end","url(#"+F.dom_prefix+"_arrowhead)"),(n=F.network_svg.selectAll(".node").data(d.nodes,function(e){return e.id})).exit().remove(),n.enter().append("g").append("path"),(o=F.network_svg.selectAll(".cluster-group").data(d.clusters.map(function(e){return e}),function(e){return e.cluster_id})).exit().remove(),o.enter().append("g").attr("class","cluster-group").attr("transform",function(e){return"translate("+e.x+","+e.y+")"}).on("click",function(e){return y.handle_cluster_click(F,e,null)}).on("mouseover",re).on("mouseout",ie).call(he.drag().on("dragstart",ie)),F.draw_cluster_table(F.extra_cluster_table_columns,F.cluster_table),!F._is_CDC_||T&&T["no-subclusters"]&&T["no-subcluster-compute"]||F.annotate_priority_clusters(p._networkCDCDateField,36,12),!F._is_CDC_||T&&T["no-subclusters"]||!T||!T["no-subcluster-compute"]||i.default.each(F.clusters,function(e,t){var n=i.default.groupBy(e.children,function(e){return e.subcluster_id});n=i.default.values(i.default.reject(n,function(e,t){return"undefined"===t})),i.default.each(n,function(e,t){e.sort(I)}),n.sort(function(e,t){return I(e[0],t[0])}),n=i.default.map(n,function(t,n){var r=t[0].parent_cluster_id,o=t[0].subcluster_id,a=t[0].subcluster_label,s=[];s=i.default.filter(s,function(e){return e.length>1});var l=F.json.subcluster_summary_stats[r][o];return{children:i.default.clone(t),parent_cluster:e,cluster_id:a,subcluster_label:o,recent_nodes:l.recent_nodes,priority_score:l.priority_score,distances:u.describe_vector(i.default.map(s[n],function(e){return e.length}))}}),i.default.each(n,function(e){oe(e)}),e.subclusters=n||[];var r=F.json.subcluster_summary_stats[e.cluster_id];e.recent_nodes=i.default.map(i.default.values(r),function(e){return e.recent_nodes[0]||0}),e.priority_score=i.default.map(i.default.values(r),function(e){return e.priority_score[0]||0})}),F.subcluster_table&&F.draw_cluster_table(F.extra_subcluster_table_columns,F.subcluster_table,{"no-clusters":!0,subclusters:!0,headers:function(e){e[0][0].value="Subcluster ID",e[0][0].help="Unique subcluster ID",e[0][2].help="Number of total cases in the subcluster"}}),F._is_CDC_||F.draw_node_table(F.extra_node_table_columns,null,null,{"no-filter":!0})}F.rendered_object_counts={nodes:n.size(),edges:a.size(),clusters:o.size(),has_hatching:!1},n.each(function(e){(function(e,t){var n;t&&(e=r.select(e),n=t.hxb2_linked&&!t.is_lanl?"cross":t.is_lanl?"triangle-down":F.node_shaper.shaper(t),t.rendered_size=Math.sqrt(W(t))/2+2,e.selectAll("path").attr("d",m.symbol(n).size(W(t))).style("fill",function(e){return function(e){var t=function(e,t){return G(e)?"url(#"+F.generate_cross_hatch_pattern(t)+")":t};if(F.colorizer.category_id){var n=F.attribute_node_value_by_id(e,F.colorizer.category_id);return F.colorizer.continuous&&n===v.missing.label?t(e,v.missing.color):t(e,F.colorizer.category(n))}return e.hxb2_linked?t(e,"black"):e.is_lanl?t(e,"red"):t(e,"gray")}(e)}).classed("multi_sequence",function(e){return i.default.isArray(e[v.network.AliasedSequencesID])&&e[v.network.AliasedSequencesID].length>1}),t.show_label?e.selectAll("text").empty()&&(t.label_x=0,t.label_y=0,e.append("text").classed("node-label",!0).text(t.id).attr("transform","translate("+1.25*t.rendered_size+","+.5*t.rendered_size+")").datum(t).call(F.node_label_drag)):e.selectAll("text").remove(),e.attr("class","node").classed("selected_object",function(e){return e.match_filter&&!F.hide_unselected}).classed("injected_object",function(e){return"injected"===e.node_class}).attr("transform",function(e){return"translate("+e.x+","+e.y+")"}).style("opacity",function(e){return Y(e)}).style("display",function(e){return e.is_hidden?"none":null}).call(he.drag().on("dragstart",function(e){r.event.sourceEvent.stopPropagation(),K()})).on("dragend",function(e){r.event.sourceEvent.stopPropagation()}).on("click",O).on("mouseover",Q).on("mouseout",K))})(this,e),F.rendered_object_counts.has_hatching=F.rendered_object_counts.has_hatching||G(e)}),o.each(function(e){!function(e,t){var n=r.select(e),i=t.binned_attributes?t.binned_attributes.map(function(e){return e.concat([0])}):[[null,1,0]];t.match_filter&&(i=i.concat([["selected",t.match_filter,1],["not selected",t.children.length-t.match_filter,1]]));var o=[r.sum(i.filter(function(e){return 0===e[2]}),function(e){return e[1]}),r.sum(i.filter(function(e){return 0!==e[2]}),function(e){return e[1]})],a=[0,0];i=i.map(function(n){var r=n[2],i={container:e,cluster:t,startAngle:a[r]/o[r]*2*Math.PI,endAngle:(a[r]+n[1])/o[r]*2*Math.PI,name:n[0],rim:r>0};return a[r]+=n[1],i});var s,l,u=.5*(s=t,F.cluster_sizes_in_entities&&(l=F.cluster_sizes_in_entities[s.cluster_id]),l=l||s.children.length,8*Math.sqrt(l));t.rendered_size=u+2;var c=n.selectAll("path").data(i);c.enter().append("path"),c.exit().remove(),c.classed("cluster",!0).classed("hiv-trace-problematic",function(e){return t.hxb2_linked&&!e.rim}).classed("hiv-trace-selected",function(e){return e.rim}).attr("d",function(e){return(e.rim?r.svg.arc().innerRadius(u+2).outerRadius(u+5):r.svg.arc().innerRadius(0).outerRadius(u))(e)}).style("fill",function(e,n){return e.rim?F.colorizer.selected(e.name):t.gradient?"url(#"+t.gradient+")":function(e,t){return e.binned_attributes?F.colorizer.category(t):"#bdbdbd"}(t,e.name)}).style("stroke-linejoin",function(e,t){return i.length>1?"round":""}).style("display",function(e){return t.is_hidden?"none":null})}(this,e)}),a.style("opacity",function(e){return Math.max(Y(e.target),Y(e.source))}),F.additional_edge_styler&&a.each(function(e){F.additional_edge_styler(this,e,F)}),a.style("display",function(e){return e.target.is_hidden||e.source.is_hidden||e.is_hidden?"none":null}).classed("selected_object",function(e){return e.ref.length_filter&&!F.hide_unselected}),e?a.each(F.link_generator_function):(se=o[0].length+n[0].length,he.on("tick",function(){var e=he.size();n.attr("transform",function(t){var n=10,r=e[0]-10,i=10,o=e[1]-10;if(F.showing_on_map){var a=F._get_node_country(t);if(a in F.countryCentersObject){var s=F.countryCentersObject[a].countryXY;n=s[0]-15,r=s[0]+15,i=s[1]-15,o=s[1]+15}}return"translate("+(t.x=Math.max(n,Math.min(r,t.x)))+","+(t.y=Math.max(i,Math.min(o,t.y)))+")"}),o.attr("transform",function(t){return"translate("+(t.x=Math.max(t.rendered_size,Math.min(e[0]-t.rendered_size,t.x)))+","+(t.y=Math.max(t.rendered_size,Math.min(e[1]-t.rendered_size,t.y)))+")"}),a.each(F.link_generator_function)}),he.start())},F.attribute_node_value_by_id=function(e,t,n){try{if(v.network.NodeAttributeID in e&&t&&t in e[v.network.NodeAttributeID]){var r;if(r=F.json[v.network.GraphAttrbuteID][t].volatile?F.json[v.network.GraphAttrbuteID][t].map(e,F):e[v.network.NodeAttributeID][t],i.default.isString(r)){if(0===r.length)return v.missing.label;if(n)return r=Number(r),i.default.isNaN(r)?v.missing.label:r}return r}}catch(r){console.log("self.attribute_node_value_by_id",r,e,t,n)}return v.missing.label},F.has_network_attribute=function(e){return v.network.GraphAttrbuteID in F.json&&e in F.json[v.network.GraphAttrbuteID]},F._aux_populate_category_fields=function(e,t){return e.raw_attribute_key=t,"label"in e||(e.label=t),e.discrete=!1,"enum"in e&&(e.discrete=!0,e.value_range=new Set(e.enum),e.value_range.add(v.missing.label),i.default.every(le.Nodes,function(n){return e.value_range.has(F.attribute_node_value_by_id(n,t))}))?(e.value_range=i.default.clone(e.enum),v.missing.label in e.value_range||e.value_range.push(v.missing.label),e.dimension=e.value_range.length,e["no-sort"]=!0,e):("String"===e.type&&(e.discrete=!0,e.value_range=new Set,le.Nodes.forEach(function(n){e.value_range.add(F.attribute_node_value_by_id(n,t))}),e.value_range=A(e.value_range),e.dimension=e.value_range.length),e)},F._aux_get_attribute_dimension=function(e){if(e in le[v.network.GraphAttrbuteID]){var t=le[v.network.GraphAttrbuteID][e];return"reduced_value_range"in t?i.default.size(t.reduced_value_range):t.dimension}return 0},F._aux_process_category_values=function(e){var t,n=null;if(delete e.reduced_value_range,e["no-sort"])t=e.value_range;else if("String"===e.type){if(t=e.value_range.sort(),e.dimension>v.MaximumValuesInCategories){var r=i.default.chain(F.nodes).countBy(function(t){return F.attribute_node_value_by_id(t,e.raw_attribute_key)}).pairs().sortBy(function(e){return-e[1]}).value();n=[];for(var o=0;n.length<v.MaximumValuesInCategories-1&&o<r.length;)r[o][0]!==v.missing.label&&n.push(r[o][0]),o++;(n=n.sort()).push(v.network.ReducedValue)}for(var a=n||t,s=i.default.map(a,function(e){null==e&&(e=""),e=String(e);for(var t=5801,n=0;n<e.length;n++)t=(t<<5+t)+e.charCodeAt(n);return t}),l={},u={},c=0;c<v.MaximumValuesInCategories;c++)l[c]=!0;i.default.each(s,function(e,t){e<0&&(e=-e);var n=e%v.MaximumValuesInCategories;if(n in l)return u[a[t]]=n,void delete l[n];var r=Math.floor(e/v.MaximumValuesInCategories)%v.MaximumValuesInCategories;if(r in l)return u[a[t]]=r,void delete l[r];var o=parseInt(i.default.keys(l).sort()[0]);u[a[t]]=o,delete l[o]}),e["stable-ish order"]=u}var d={};if(n){var f=i.default.object(i.default.map(i.default.pairs(n),function(e){return[e[1],e[0]]}));i.default.each(t,function(e,t){d[e]=e in f?f[e]:f[v.network.ReducedValue]}),e.reduced_value_range=f,e.value_map=function(e,t){return t?"lookup"===t?i.default.invert(f):f:d[e]}}else i.default.each(t,function(e,t){d[e]=t}),e.value_map=function(e,t){return t?"lookup"===t?i.default.invert(d):d:d[e]};return e},F.expand_cluster_handler=function(e,t,n){if(e.collapsed){var r=F.cluster_sizes[e.cluster_id-1]-1;if(r>ue)F.warning_string="This cluster is too large to be displayed";else{var i=r+se-ue;if(i>0){for(var o=0;o<de.length&&i>0;o++){var a=F.clusters[F.cluster_mapping[de[o]]];i-=a.children.length-1,J(a,!0)}(o||de.length)&&de.splice(0,o)}i<=0&&ee(e,!n)}t&&F.update(!1,.6)}return""},F.extract_network_time_series=function(e,t,n){var r=n?i.default.filter(F.nodes,n):F.nodes,o=i.default.map(r,function(n){var r={time:F.attribute_node_value_by_id(n,e)};return t&&i.default.each(t,function(e,t){r[e]=F.attribute_node_value_by_id(n,t)}),r});return o.sort(function(e,t){return e.time<t.time?-1:e.time===t.time?0:1}),o},F.expand_some_clusters=function(e){(e=e||F.clusters).forEach(function(e){e.is_hidden||F.expand_cluster_handler(e,!1)}),F.update()},F.select_some_clusters=function(e){return F.clusters.filter(function(t,n){return i.default.some(t.children,function(t){return e(t)})})},F.collapse_some_clusters=function(e){(e=e||F.clusters).forEach(function(e){e.collapsed||J(e)}),F.update()},F.toggle_hxb2=function(){F.hide_hxb2=!F.hide_hxb2,F.update()},F.toggle_diff=function(){F.showing_diff=!F.showing_diff,F.showing_diff?F.cluster_filtering_functions.new=F.filter_if_added:delete F.cluster_filtering_functions.new,F.update()},F.toggle_highlight_unsupported_edges=function(){F.highlight_unsuppored_edges=!F.highlight_unsuppored_edges,F.update()},F.toggle_time_filter=function(){F.using_time_filter?F.using_time_filter=null:(F.using_time_filter=p.getCurrentDate(),F.using_time_filter.setFullYear(F.using_time_filter.getFullYear()-1)),F.using_time_filter?F.cluster_filtering_functions.recent=F.filter_time_period:delete F.cluster_filtering_functions.recent,F.update()},F._distance_gate_options=function(e){return e=e||.005,{"edge-styler":function(e,t,n){var i=m.edge_typer(t,n.edge_types,n.edge_cluster_threshold);""!==i&&r.select(e).style("stroke",n._edge_colorizer(m.edge_typer(t,n.edge_types,n.edge_cluster_threshold))),t.is_hidden=!n.shown_types[i],r.select(e).style("stroke-width","4px")},init_code:function(t){function n(e){if(this.style("stroke-width","5px"),e.length)this.style("stroke",t._edge_colorizer(e));else{this.classed("link",!0);var n=this.style("stroke");this.classed("link",null),this.style("stroke",n)}}t.update_cluster_threshold_display=function(e){t.edge_cluster_threshold=e,t.edge_types=["≤"+t.edge_cluster_threshold,">"+t.edge_cluster_threshold],t._edge_colorizer=r.scale.ordinal().range(v.EdgeColorBase).domain(t.edge_types),t.shown_types=i.default.object(i.default.map(t.edge_types,function(e){return[e,1]})),t.edge_legend={caption:"Links by distance",types:{}},i.default.each(t.shown_types,function(e,r){r.length&&(t.edge_legend.types[r]=i.default.partial(n,r))})},t.update_cluster_threshold_display(e)},extra_menu:{title:"更多选项",items:[[function(e,t){var n=t.append("div").classed("form-group",!0);n.append("label").text("遗传距离阈值 ").classed("control-label",!0),n.append("input").classed("form-control",!0).attr("value",String(e.edge_cluster_threshold)).on("change",function(t){if(this.value){var r=parseFloat(this.value);if(i.default.isNumber(r)&&r>0&&r<1)return e.update_cluster_threshold_display(r),e.draw_attribute_labels(),e.update(!0),void n.classed("has-success",!0).classed("has-error",!1)}n.classed("has-success",!1).classed("has-error",!0)}).on("click",function(e){r.event.stopPropagation()})},null]]}}},F._social_view_options=function(e,t,n){return n=n||function(e){return i.default.has(e,"edge_type")?e.edge_type:""},{"edge-styler":function(e,t,i){var o=n(t);""!==o?(r.select(e).style("stroke",i._edge_colorizer(n(t))),t.is_hidden=!i.shown_types[o]):t.is_hidden=!i.shown_types[""],r.select(e).style("stroke-width","5px")},init_code:function(e){function n(t){if(this.style("stroke-width","5px"),t.length)this.style("stroke",e._edge_colorizer(t));else{this.classed("link",!0);var n=this.style("stroke");this.classed("link",null),this.style("stroke",n)}}var o=i.default.keys(t);o.sort(),e._edge_colorizer=r.scale.ordinal().range(v.CategoricalBase).domain(o),e.shown_types=i.default.clone(t),e.edge_legend={caption:"Network links",types:{}},i.default.each(e.shown_types,function(t,r){r.length?e.edge_legend.types[r]=i.default.partial(n,r):e.edge_legend.types["Molecular links"]=i.default.partial(n,r)})},extra_menu:{title:"更多选项",items:i.default.map(e,function(e){return[function(t,n){function r(){t.shown_types[e]=!t.shown_types[e],i.attr("checked",t.shown_types[e]?"":null),t.update(!0)}var i=(e.length?n.append("a").text(e+" links").style("color",t._edge_colorizer(e)).on("click",r):n.append("a").text("Molecular links").on("click",r)).append("input").attr("type","checkbox").attr("checked","")}]})}}},F.load_nodes_edges=function(e,t,n,r){return D(F,e,t,n,r)},F.update_clusters_with_injected_nodes=function(e,t,n){var r;try{e=e||function(){return!0},t=t||function(){return!0},r=(0,m.hivtrace_cluster_depthwise_traversal)(i.default.filter(F.json.Nodes,e),F.json.Edges,null,!1),i.default.each(r,function(e){var t={},r=0;i.default.each(e,function(e){t[e.cluster]=1,r+=e.cluster?0:1}),r&&delete t[void 0],i.default.each(e,function(e){"extended_cluster"in e?i.default.extend(e.extended_cluster,t):e.extended_cluster=t}),i.default.each(t,function(e,o){var a=F.clusters[F.cluster_mapping[o]];a.injected||(a.injected={}),a.injected[n]=r,"linked_clusters"in a?i.default.extend(a.linked_clusters,t):a.linked_clusters=t})})}catch(e){throw console.log(e),e}return r};var se,le=F.json,ue=1536,ce=4096,de=[],fe=r.scale.pow().exponent(.5).domain([1,1e5]).range([.1,.15]),pe=r.scale.pow().exponent(1.25).clamp(!0).domain([0,.1]),he=r.layout.force().on("tick",function(){var e=he.size();node.attr("cx",function(t){return t.x=Math.max(10,Math.min(e[0]-10,t.x))}).attr("cy",function(t){return t.y=Math.max(10,Math.min(e[1]-10,t.y))}),link.attr("x1",function(e){return e.source.x}).attr("y1",function(e){return e.source.y}).attr("x2",function(e){return e.target.x}).attr("y2",function(e){return e.target.y})}).charge(function(e){return F.showing_on_map?-60:e.cluster_id?F.charge_correction*(-15-5*Math.pow(e.children.length,.4)):F.charge_correction*(-10-5*Math.sqrt(e.degree))}).linkDistance(function(e){return 5e3*pe(e.length)*.2}).linkStrength(function(e){return F.showing_on_map?.01:void 0!==e.support?.75-.5*e.support:1}).chargeDistance(500).gravity(F.showing_on_map?0:fe(F.json.Nodes.length)).friction(.25);r.select(F.container).selectAll("svg").remove(),F.isPrimaryGraph&&(r.select(F.container).selectAll(".my_progress").style("display","none"),h.getNodeTable().selectAll("*").remove(),F.cluster_table.selectAll("*").remove()),F.network_svg=r.select(F.container).append("svg:svg").attr("id",F.dom_prefix+"-network-svg").attr("width",F.width+F.margin.left+F.margin.right).attr("height",F.height+F.margin.top+F.margin.bottom),F.network_cluster_dynamics=null;var ge=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.stopPropagation()}).on("drag",function(e){r.select(this).attr("transform","translate("+[r.event.x,r.event.y]+")")}),me=F.showing_on_map?100:5;if(F.legend_svg=F.network_svg.append("g").attr("transform","translate(5,"+me+")").call(ge),F.network_svg.append("defs").append("marker").attr("id",F.dom_prefix+"_arrowhead").attr("refX",18).attr("refY",6).attr("markerWidth",20).attr("markerHeight",16).attr("orient","auto").attr("stroke","#666666").attr("markerUnits","userSpaceOnUse").attr("fill","#AAAAAA").append("path").attr("d","M 0,0 L 2,6 L 0,12 L14,6 Z"),q(),function(){var e={},t=0;F.exclude_cluster_ids={},F.has_hxb2_links=!1,F.cluster_sizes=[],F.cluster_sizes_in_entities={};var n=new Set;if(le.Nodes.forEach(function(e){void 0===F.cluster_sizes[e.cluster-1]?F.cluster_sizes[e.cluster-1]=1:F.cluster_sizes[e.cluster-1]++,n.add(e.cluster),"is_lanl"in e&&(e.is_lanl="true"===e.is_lanl),"attributes"in e||(e.attributes=[]),e.attributes.indexOf("problematic")>=0&&(F.has_hxb2_links=!0,e.hxb2_linked=!0)}),F.has_multiple_sequences){var o=0;F.apply_to_entities(function(e,t){F.cluster_sizes_in_entities[t[0].cluster]?F.cluster_sizes_in_entities[t[0].cluster]++:F.cluster_sizes_in_entities[t[0].cluster]=1,o++}),F.json["Network Summary"]&&(F.json["Network Summary"].Nodes=o,F.json["Network Summary"].Clusters=i.default.size(F.cluster_sizes_in_entities),F.json["Cluster sizes"]=[],i.default.each(F.cluster_sizes_in_entities,function(e,t){F.json["Cluster sizes"].push(e)}))}else F.json["Network Summary"]&&(F.json["Network Summary"].Clusters=n.size);if(F._extract_attributes_for_nodes=function(e,t){var n=this,r=[i.default.map(t,function(e){return e.raw_attribute_key})];return i.default.each(e,function(e){r.push(i.default.map(t,function(t){if(t.raw_attribute_key===f._networkNodeIDField){var r=F.primary_key(e);if(F.has_multiple_sequences){if(i.default.every(n.primary_key_list[r],function(e){return _.HIVTxNetwork.is_new_node(e)}))return r+f._networkNewNodeMarker}else if(_.HIVTxNetwork.is_new_node(e))return r+f._networkNewNodeMarker;return r}return i.default.has(e,t.raw_attribute_key)?e[t.raw_attribute_key]:F.attribute_node_value_by_id(e,t.raw_attribute_key)}))}),r},F._extract_exportable_attributes=function(e){var t={String:1,Date:1,Number:1},n=[];return e&&(n=[{raw_attribute_key:f._networkNodeIDField,type:"String",label:"Node ID",format:function(){return"Node ID"}},{raw_attribute_key:"cluster",type:"String",label:"Which cluster the individual belongs to",format:function(){return"簇 ID"}}]),n.push(i.default.filter(F.json[v.network.GraphAttrbuteID],function(e){return e.type in t})),i.default.flatten(n,!0)},F._extract_nodes_by_id=function(e){var t=i.default.filter(F.nodes,function(t){return t.cluster.toString()===e.toString()||t.subcluster_label===e.toString()});return F.has_multiple_sequences&&(t=F.aggregate_indvidual_level_records(t)),t},F._cluster_list_view_render=function(e,t,n,o){var a=this;n.selectAll("*").remove();var s,l=F._extract_exportable_attributes();if(o){if(!(s=F.priority_groups_find_by_name(o)))return;s=F.has_multiple_sequences?F.aggregate_indvidual_level_records(s.node_objects):s.node_objects}else s=F._extract_nodes_by_id(e);r.select(F.get_ui_element_selector_by_role("cluster_list_data_export",!0)).on("click",function(e){F._is_CDC_executive_mode?alert(v.network.WarnExecutiveMode):u.export_csv_button(F._extract_attributes_for_nodes(s,l))}),t?i.default.each(l,function(e){var t=i.default.groupBy(s,function(t){return F.attribute_node_value_by_id(t,e.raw_attribute_key)}),r=i.default.keys(t).sort(),o=n.append("li");o.append("code").text(e.label||e.raw_attribute_key);var l=o.append("dl").classed("dl-horizontal",!0);i.default.each(r,function(e){l.append("dt").text(e),l.append("dd").text(i.default.map(t[e],function(e){return a.entity_id(e)}).join(", "))})}):i.default.each(s,function(e){var t=n.append("li");t.append("code").text(a.entity_id(e));var r=t.append("dl").classed("dl-horizontal",!0);i.default.each(l,function(t){r.append("dt").text(t.label||t.raw_attribute_key),r.append("dd").text(F.attribute_node_value_by_id(e,t.raw_attribute_key))})})},F._setup_cluster_list_view=function(){r.select(F.get_ui_element_selector_by_role("cluster_list_view_toggle",!0)).on("click",function(){var e;r.event.preventDefault();var t=S(this);"id"===t.data("查看")?(t.data("查看","attribute"),t.text("按 ID 分组"),e=!1):(t.data("查看","id"),t.text("按属性分组"),e=!0);var n=t.data("cluster");F._cluster_list_view_render(n?n.toString():"",!e,r.select(F.get_ui_element_selector_by_role("cluster_list_payload",!0)),t.data("priority_list"))}),S(F.get_ui_element_selector_by_role("cluster_list",!0)).on("show.bs.modal",function(e){var t=S(e.relatedTarget),n=t.data("cluster"),i=t.data("priority_set"),o=r.select(F.get_ui_element_selector_by_role("cluster_list",!0));o.selectAll(".modal-title").text("列出节点"+(i?" in cluster of interest "+i:" 簇 "+n));var a=S(F.get_ui_element_selector_by_role("cluster_list_view_toggle",!0));i?(a.data("priority_list",i),a.data("cluster","")):(a.data("cluster",n),a.data("priority_list",null)),F._cluster_list_view_render(n,"id"!==S(F.get_ui_element_selector_by_role("cluster_list_view_toggle",!0)).data("查看"),o.select(F.get_ui_element_selector_by_role("cluster_list_payload",!0)),i)}),S(F.get_ui_element_selector_by_role("overlap_list",!0)).on("show.bs.modal",function(e){var t=S(e.relatedTarget).data("priority_set"),n=r.select(F.get_ui_element_selector_by_role("overlap_list",!0));n.selectAll(".modal-title").text("View how nodes in cluster of interest "+t+" overlap with other clusterOI");var o=F.priority_groups_find_by_name(t);if(o&&F.priority_node_overlap){var a=[],s=[["Overlapping Cluster of Interest","Node","Other clusterOI"]];i.default.each(F.aggregate_indvidual_level_records(o.node_objects),function(e){var n=F.entity_id(e),r=F.priority_node_overlap[n],l="None";r.size>1&&(l=i.default.sortBy(i.default.filter(A(r),function(e){return e!==t})).join("; ")),a.push([{value:n},{value:l}]),s.push([o.name,n,l])}),r.select(F.get_ui_element_selector_by_role("overlap_list_data_export",!0)).on("click",function(e){u.export_csv_button(s,"overlap")}),f.add_a_sortable_table(n.select(F.get_ui_element_selector_by_role("overlap_list_data_table",!0)),[[{value:"Node",help:"EHARS_ID of the node that overlaps with other clusterOI",sort:"value"},{value:"Other Cluster(s) of Interest",help:"Names of other clusterOI where this node is included",sort:"value"}]],a,!0,null,g.get_editor())}})},S(F.get_ui_element_selector_by_role("priority_set_merge",!0)).on("show.bs.modal",function(e){var t=r.select(F.get_ui_element_selector_by_role("priority_set_merge",!0)),n=t.selectAll(".modal-desc"),o=r.select(F.get_ui_element_selector_by_role("priority_set_merge_table_proceed",!0));if(F.defined_priority_groups&&F.defined_priority_groups.length>1){n.text("Select two or more clusters of interest to merge");var a=new Set,s=null,l=null;o.attr("disabled","disabled").on("click",function(){s&&(g.open_editor(F,[],"","Merged from "+A(a).join(" and ")),g.get_editor().append_nodes(A(s),l,!0)),S(t.node()).modal("hide")});var u=[];i.default.each(F.defined_priority_groups,function(e){var t=new Set;i.default.each(e.node_objects,function(n){i.default.each(A(F.priority_node_overlap[F.entity_id(n)]),function(n){n!==e.name&&t.add(n)})}),u.push([{value:e,callback:function(e,t){r.select(e).append("input").attr("type","checkbox").style("margin-left","1em").on("click",function(e){!function(e,t){if(t?a.add(e):a.delete(e),a.size>1){var r=0;s=new Set,l={},i.default.each(F.defined_priority_groups,function(e){a.has(e.name)&&(r+=F.unique_entity_list(e.node_objects).length,i.default.each(e.nodes,function(e){s.add(e.name),l[e.name]={_priority_set_date:e.added,_priority_set_kind:e.kind}}))}),n.html("Merge "+a.size+" clusterOI with "+r+" persons, creating a new clusterOI with "+F.unique_entity_list_from_ids(A(s)).length+" persons. <br><small>Note that the clusters of interest being merged will <b>not</b> be automatically deleted</small>"),o.attr("disabled",null)}else n.text("Select two or more clusters of interest to merge"),o.attr("disabled","disabled")}(t.name,S(this).prop("checked"))})}},{value:e.name},{value:F.unique_entity_list(e.node_objects).length},{value:A(t),format:function(e){return e.join("<br>")},html:!0}])}),f.add_a_sortable_table(t.select(F.get_ui_element_selector_by_role("priority_set_merge_table",!0)),[[{value:"Select"},{value:"Cluster of interest",help:"Cluster of interest Name",sort:"value"},{value:"Persons",help:"How many persons are in this cluster of interest",sort:"value"},{value:"Overlaps",help:"Overlaps with",sort:"value"}]],u,!0,null,g.get_editor())}}),l){F._setup_cluster_list_view();var a=r.select(F.get_ui_element_selector_by_role("cluster_operations_container"));a.selectAll("li").remove();var s=function(e){i.default.each([F.clusters,F.nodes],function(t){i.default.each(t,function(t){t.fixed=e})})},c=function(e){var t=F.network_svg.selectAll(".node");t.empty()||(t.each(function(t){t.show_label=e}),F.update(!0))},d=function(e){var t=[];i.default.each(F.clusters,function(e){e.fixed&&t.push(e),e.fixed=!1}),z(e),he.tick(),F.update(),i.default.each(t,function(e){e.fixed=!0})},h=[["复制配色方案",function(){var e=u.exportColorScheme(F.uniqValues,F.colorizer);u.copyToClipboard(JSON.stringify(e))},!0,"hivtrace-export-color-scheme"],["展开全部",function(){return F.expand_some_clusters()},!0,"hivtrace-expand-all"],["折叠全部",function(){return F.collapse_some_clusters()},!0,"hivtrace-collapse-all"],["展开已过滤",function(){return F.expand_some_clusters(F.select_some_clusters(function(e){return e.match_filter}))},!0,"hivtrace-expand-filtered"],["折叠已过滤",function(){return F.collapse_some_clusters(F.select_some_clusters(function(e){return e.match_filter}))},!0,"hivtrace-collapse-filtered"],["固定所有对象位置",i.default.partial(s,!0),!0,"hivtrace-fix-in-place"],["允许所有对象浮动",i.default.partial(s,!1),!0,"hivtrace-allow-to-float"],["重置布局(紧凑)",i.default.partial(d,!0),!0,"hivtrace-reset-layout"],["重置布局(平铺)",i.default.partial(d,!1),!0,"hivtrace-reset-layout"],["显示所有标签",i.default.partial(c,!0),!0,"hivtrace-node-labels-on"],["隐藏所有标签",i.default.partial(c,!1),!0,"hivtrace-node-labels-off"],["隐藏问题簇",function(e){r.select(e).text(F.hide_hxb2?"隐藏问题簇":"显示问题簇"),F.toggle_hxb2()},F.has_hxb2_links,"hivtrace-hide-problematic-clusters"],["高亮不支持的边",function(e){F.highlight_unsuppored_edges?r.select(e).selectAll(".fa-check-square").remove():r.select(e).insert("i",":first-child").classed("fa fa-check-square",!0),F.toggle_highlight_unsupported_edges()},!0,"hivtrace-highlight-unsuppored_edges",F.highlight_unsuppored_edges]];F.cluster_attributes&&h.push(["Show only changes since last network update",function(e){F.showing_diff?r.select(e).selectAll(".fa-check-square").remove():r.select(e).insert("i",":first-child").classed("fa fa-check-square",!0),F.toggle_diff()},!0,"hivtrace-show-network-diff",F.showing_diff]),p.getClusterTimeScale()&&h.push(["仅显示近期簇",function(e){F.using_time_filter?r.select(e).selectAll(".fa-check-square").remove():r.select(e).insert("i",":first-child").classed("fa fa-check-square",!0),F.toggle_time_filter()},!0,"hivtrace-show-using-time-filter",F.using_time_filter]),F._is_CDC_?h.push(["Add filtered objects to cluster of interest",function(e){g.get_editor()&&g.get_editor().append_node_objects(i.default.filter(F.json.Nodes,function(e){return e.match_filter}))},g.get_editor,"hivtrace-add-filtered-to-panel"]):h.push(["Show removed edges",function(e){F.filter_edges=!F.filter_edges,r.select(e).text(F.filter_edges?"Show removed edges":"Hide removed edges"),F.update(!1)},function(){return i.default.some(F.edges,function(e){return e.removed})},"hivtrace-show-removed-edges"]),h.forEach(function(e,t){var n=e[2];if(i.default.isFunction(n)&&(n=n(e)),n){var r=e[1],o=this.append("li").append("a").text(e[0]).attr("href","#").on("click",function(e){r(this)});e.length>4&&(o.text(""),e[4]&&o.insert("i",":first-child").classed("fa fa-check-square",!0),o.insert("span").text(e[0]))}},a);var m=r.select(F.get_ui_element_selector_by_role("button_group"));if(!m.empty()){m.selectAll("button").remove(),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","扩展间距").on("click",function(e){$(5/4)}).append("i").classed("fa fa-plus",!0),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","压缩间距").on("click",function(e){$(.8)}).append("i").classed("fa fa-minus",!0),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","放大窗口").on("click",function(e){q(100,!0)}).append("i").classed("fa fa-expand",!0),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","缩小窗口").on("click",function(e){q(-100,!0)}).append("i").classed("fa fa-compress",!0),F._is_CDC_?m.append("button").classed("btn btn-default btn-sm",!0).attr("title","切换流行曲线").attr("id","hivtrace-toggle-epi-curve").on("click",function(e){F.check_for_time_series()}).append("i").classed("fa fa-line-chart",!0):m.append("button").classed("btn btn-default btn-sm",!0).attr("title","Compute graph statistics").attr("id","hivtrace-compute-graph-statistics").on("click",function(e){i.default.bind(F.compute_graph_stats,this)()}).append("i").classed("fa fa-calculator",!0);var b=r.select(F.get_ui_element_selector_by_role("export_image"));if(!b.empty()){b.selectAll("div").remove();var x=b.insert("div",":first-child").classed("input-group-btn dropdown-img",!0),k=x.append("ul").classed("dropdown-menu",!0).attr("aria-labelledby","dropdownImg");k.append("li").classed("dropdown-item export-img-item",!0).append("a").attr("href","#").text("SVG").on("click",function(e){u.save_image("svg","#"+F.dom_prefix+"-network-svg")}),k.append("li").classed("dropdown-item export-img-item",!0).append("a").attr("href","#").text("PNG").on("click",function(e){u.save_image("png","#"+F.dom_prefix+"-network-svg")});var C=x.append("button").attr("id","dropdownImg").attr("data-toggle","dropdown").classed("btn btn-default btn-sm dropdown-toggle",!0).attr("title","保存图像").attr("id","hivtrace-export-image");C.append("i").classed("fa fa-image",!0),C.append("span").classed("caret",!0)}}S(F.get_ui_element_selector_by_role("filter")).off("input propertychange").on("input propertychange",i.default.throttle(function(e){var t=S(this).val();F.filter(f.filter_parse(t))},250)),S(F.get_ui_element_selector_by_role("hide_filter")).off("change").on("change",i.default.throttle(function(e){F.hide_unselected=!F.hide_unselected,F.filter_visibility(),F.update(!0)},250)),S(F.get_ui_element_selector_by_role("show_small_clusters")).off("change").on("change",i.default.throttle(function(e){"size"in F.cluster_filtering_functions?delete F.cluster_filtering_functions.size:F.cluster_filtering_functions.size=F.filter_by_size,F.update(!1)},250)),S(F.get_ui_element_selector_by_role("set_min_cluster_size")).val(F.minimum_cluster_size).off("change").on("change",i.default.throttle(function(e){F.minimum_cluster_size=e.target.value,F.update(!1)},250)),S(F.get_ui_element_selector_by_role("pairwise_table_pecentage",!0)).off("change").on("change",i.default.throttle(function(e){F.show_percent_in_pairwise_table=!F.show_percent_in_pairwise_table,te("attribute_table",F.colorizer.category_map,F.colorizer.category_pairwise)},250))}v.network.GraphAttrbuteID in F.json?w=F.json[v.network.GraphAttrbuteID]:w&&"hivtrace"in w&&(w=w.hivtrace),le.Nodes.filter(function(e,t){return null===e.cluster}).length,F.nodes_by_cluster={},F.attributes_selected_cluster=null,F.nodes=le.Nodes.filter(function(n,r){return!(!n.cluster||void 0!==F.exclude_cluster_ids[n.cluster]||(n.cluster in F.nodes_by_cluster?F.nodes_by_cluster[n.cluster].push(n):F.nodes_by_cluster[n.cluster]=[n],e[r]=t++,0))}),F.edges=le.Edges.filter(function(t,n){return t.source in e&&t.target in e}),F.edges=F.edges.map(function(t,n){var r=i.default.clone(t);return r.source=e[t.source],r.target=e[t.target],r.id=n,r}),function(e,t){for(var n in e)e[n].degree=0;for(var r in t)e[t[r].source].degree++,e[t[r].target].degree++}(F.nodes,F.edges),z(F.initial_packed),F.clusters.forEach(function(e,t){F.cluster_mapping[e.cluster_id]=t,e.hxb2_linked=e.children.some(function(e){return e.hxb2_linked}),oe(e),e.distances=[]});try{if(T&&T.extra_menu){var D=r.select(F.get_ui_element_selector_by_role("extra_operations_container"));r.select(F.get_ui_element_selector_by_role("extra_operations_enclosure")).selectAll("button").text(T.extra_menu.title).append("span").classed("caret","true"),D.selectAll("li").remove(),T.extra_menu.items.forEach(function(e,t){var n=e[1];i.default.isFunction(e[0])?e[0](F,this.append("li")):this.append("li").append("a").text(e[0]).attr("href","#").on("click",function(e){n(F,this),r.event.preventDefault()})},D),r.select(F.get_ui_element_selector_by_role("extra_operations_enclosure")).style("display",null)}}catch(e){console.log(e)}if(F._aux_populate_category_menus=function(e){var t=this;if(l){var n=i.default.filter(i.default.map(le[v.network.GraphAttrbuteID],F._aux_populate_category_fields),function(t,n){return t.discrete&&"value_range"in t&&!t._hidden_&&(!e||e.has(t.raw_attribute_key))}),o=i.default.filter(n,function(t){return(!e||e.has(t.raw_attribute_key))&&(t.discrete&&t.dimension<=7||t.raw_attribute_key in F.networkShapeScheme&&!t._hidden_)});i.default.each([n,o],function(e){i.default.each(e,F._aux_process_category_values)});var a=i.default.filter(i.default.map(le[v.network.GraphAttrbuteID],function(e,n){var o=i.default.get(F.json,[v.network.GraphAttrbuteID,n,"color_stops"],v.network.ContinuousColorStops);function a(e,t,n){var a=1/0;e.value_range=r.extent(t),i.default.each(n,function(n,r){var s=i.default.map(i.default.range(o),function(){return 0});n.range([0,o-1]).domain(e.value_range);for(var l=t.length;l--;)s[~~n(t[l])]++;var u=t.length/o,c=i.default.reduce(s,function(e,t){return e+(t-u)*(t-u)});c<a&&(a=c,e.scale=n)})}if(e.raw_attribute_key=n,"Number"===e.type||"Number-categories"===e.type){for(var s=[],l=F.json.Nodes.length;l--;){var u=F.attribute_node_value_by_id(F.json.Nodes[l],n,"Number"===e.type);i.default.isNumber(u)&&s.push(u)}var c=r.extent(s),d=[r.scale.linear()];e.is_integer||(c[0]>0&&d.push(r.scale.log()),c[0]>=0&&(d.push(r.scale.pow().exponent(1/3)),d.push(r.scale.pow().exponent(1/4)),d.push(r.scale.pow().exponent(.5)),d.push(r.scale.pow().exponent(1/8)),d.push(r.scale.pow().exponent(1/16)))),a(e,s,d)}else if("Date"===e.type){if(s=i.default.filter(i.default.map(le.Nodes,function(r){try{var i=F.attribute_node_value_by_id(r,n);e.raw_attribute_key,_.HIVTxNetwork.inject_attribute_node_value_by_id(r,n,t.parse_dates(i))}catch(e){_.HIVTxNetwork.inject_attribute_node_value_by_id(r,n,v.missing.label)}return F.attribute_node_value_by_id(r,n)}),function(e){return e===v.missing.label?null:e}),0===s.length)return{};a(e,s,[r.time.scale()])}return e}),function(e){return("Number"===e.type||"Date"===e.type||"Number-categories"===e.type)&&!e._hidden_}),s=function(e){return(e.annotation?"["+e.annotation+"] ":"")+e.label};[r.select(F.get_ui_element_selector_by_role("attributes")),r.select(F.get_ui_element_selector_by_role("attributes_cat",!0))].forEach(function(e){if(!e.empty())if("div"===e.node().tagName.toLowerCase()){e.selectAll("*").remove();var t=[["None",null,i.default.partial(F.handle_attribute_categorical,null)]].concat(n.map(function(e,t){return[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_categorical,e.raw_attribute_key)]}));a.length&&(t=t.concat(a.map(function(e,t){return[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_continuous,e.raw_attribute_key)]}))),e.selectAll(".hivtrace-pill").data(t).enter().append("span").classed("hivtrace-pill",!0).classed("active",function(e,t){return 0===t}).html(function(e){var t=e[0],n="unknown";return e[1]in F.schema&&(n=F.schema[e[1]].type),e[1]in F.uniqs&&"String"===n&&(t=t+'<span class="badge">'+F.uniqs[e[1]]+"</span>"),t}).on("click",function(t){t[2]&&(e.selectAll(".hivtrace-pill").classed("active",!1),r.select(this).classed("active",!0),t[2].call())})}else{var o=[[["None",null,i.default.partial(F.handle_attribute_categorical,null)]],[["分类","heading",null]]].concat(n.map(function(e,t){return[[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_categorical,e.raw_attribute_key)]]}));a.length&&(o=o.concat([[["连续","heading",null]]]).concat(a.map(function(e,t){return[[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_continuous,e.raw_attribute_key)]]}))),e.selectAll("li").remove();var l=e.selectAll("li").data(o);l.enter().append("li").classed("disabled",function(e){return"heading"===e[0][1]}).style("font-variant",function(e){return e[0][1]<-1?"small-caps":"normal"}),l.selectAll("a").data(function(e){return e}).enter().append("a").html(function(e,t,n){var r=e[0],i="unknown";return e[1]in F.schema&&(i=F.schema[e[1]].type),e[1]in F.uniqs&&"String"===i&&(r=r+'<span title="Number of unique values" class="badge pull-right">'+F.uniqs[e[1]]+"</span>"),r}).attr("style",function(e,t,n){return"heading"===e[1]?"font-style: italic":0===n?" font-weight: bold;":null}).attr("href","#").on("click",function(e){e[2]&&e[2].call()})}}),[r.select(F.get_ui_element_selector_by_role("shapes"))].forEach(function(e){e.selectAll("li").remove();var t=e.selectAll("li").data([[["None",null,i.default.partial(F.handle_shape_categorical,null)]]].concat(o.map(function(e,t){return[[s(e),e.raw_attribute_key,i.default.partial(F.handle_shape_categorical,e.raw_attribute_key)]]})));t.enter().append("li").style("font-variant",function(e){return e[0][1]<-1?"small-caps":"normal"}),t.selectAll("a").data(function(e){return e}).enter().append("a").html(function(e,t,n){var r=e[0],o="unknown";return i.default.contains(i.default.keys(F.schema),e[1])&&(o=F.schema[e[1]].type),i.default.contains(i.default.keys(F.uniqs),e[1])&&"String"===o&&(r=r+'<span title="Number of unique values" class="badge pull-right">'+F.uniqs[e[1]]+"</span>"),r}).attr("style",function(e,t,n){return 0===n?" font-weight: bold;":null}).attr("href","#").on("click",function(e){e[2]&&e[2].call()})}),S(F.get_ui_element_selector_by_role("opacity_invert")).off("click").on("click",function(e){F.colorizer.opacity_scale&&(F.colorizer.opacity_scale.range(F.colorizer.opacity_scale.range().reverse()),F.update(!0),F.draw_attribute_labels()),S(this).toggleClass("btn-active btn-default")}),S(F.get_ui_element_selector_by_role("attributes_invert")).off("click").on("click",function(e){F.colorizer.category_id&&(le[v.network.GraphAttrbuteID][F.colorizer.category_id].scale.range(le[v.network.GraphAttrbuteID][F.colorizer.category_id].scale.range().reverse()),F.clusters.forEach(function(e){e.gradient=H(e,F.colorizer.category_id)}),F.update(!0),F.draw_attribute_labels()),S(this).toggleClass("btn-active btn-default")}),[r.select(F.get_ui_element_selector_by_role("opacity"))].forEach(function(e){e.selectAll("li").remove();var t=e.selectAll("li").data([[["None",null,i.default.partial(F.handle_attribute_opacity,null)]]].concat(a.map(function(e,t){return[[e.label,e.raw_attribute_key,i.default.partial(F.handle_attribute_opacity,e.raw_attribute_key)]]})));t.enter().append("li").style("font-variant",function(e){return e[0][1]<-1?"small-caps":"normal"}),t.selectAll("a").data(function(e){return e}).enter().append("a").text(function(e,t,n){return e[0]}).attr("style",function(e,t,n){return 0===n?" font-weight: bold;":null}).attr("href","#").on("click",function(e){e[2]&&e[2].call()})})}},w){if("attribute_map"in w){var M=w.attribute_map;"map"in M&&M.map.length>0&&(le[v.network.GraphAttrbuteID]=M.map.map(function(e,t){return{label:e,type:null,values:{},index:t,range:0}}),le.Nodes.forEach(function(e){e[v.network.GraphAttrbuteID]=e.id.split(M.delimiter),e[v.network.GraphAttrbuteID].forEach(function(e,t){t<le[v.network.GraphAttrbuteID].length&&(e in le[v.network.GraphAttrbuteID][t].values||(le[v.network.GraphAttrbuteID][t].values[e]=le[v.network.GraphAttrbuteID][t].range,le[v.network.GraphAttrbuteID][t].range+=1))})}),le[v.network.GraphAttrbuteID].forEach(function(e){e.range<le.Nodes.length&&e.range>1&&e.range<=20&&(e.type="category")}))}for(var j=0,N=Object.entries(F._networkPredefinedAttributeTransforms);j<N.length;j++){var O=E(N[j],2),I=O[0],R=O[1];F.populate_predefined_attribute(R,I)}F._aux_populate_category_menus()}if(F.cluster_sizes.length>ue){var P=i.default.filter(i.default.map(F.cluster_sizes,function(e,t){return[e,t+1]}),function(e){return!i.default.isUndefined(e[0])});P=P.sort(function(e,t){return e[0]-t[0]});for(var L=0;L<P.length-ue;L++)F.exclude_cluster_ids[P[L][1]]=1;i.default.size(F.exclude_cluster_ids)&&(F.warning_string+=(F.warning_string.length?"<br>":"")+"Excluded "+(P.length-ue)+" clusters (maximum size "+P[L-1][0]+" nodes) because only "+ue+" objects can be shown at once.")}F.edges.forEach(function(e,t){F.clusters[F.cluster_mapping[F.nodes[e.target].cluster]].distances.push(e.length)}),F.clusters.forEach(function(e,t){e.distances=u.describe_vector(e.distances)}),y.check_network_option(T,"auto_expand_single_cluster",!1,!0)&&1==F.clusters.length&&(F.clusters[0].collapsed=!1),F.update()}(),T){if(i.default.isNumber(T.charge)&&(F.charge_correction=T.charge),"colorizer"in T&&(F.colorizer=T.colorizer),"node_shaper"in T&&(F.node_shaper=T.node_shaper),"callbacks"in T&&T.callbacks(F),i.default.isArray(T.expand)&&F.expand_some_clusters(i.default.filter(F.clusters,function(e){return T.expand.indexOf(e.cluster_id)>=0})),T["priority-sets-url"]){var ve=T["is-writeable"];F.load_priority_sets(T["priority-sets-url"],ve)}F.showing_diff&&F.handle_attribute_categorical("_newly_added")}return F.isPrimaryGraph&&F.annotate_multiple_clusters_on_nodes(),F._is_CDC_&&F.define_node_search_table(),F.draw_attribute_labels(),r.select(F.container).selectAll(".my_progress").style("display","none"),he.start(),F},N=n(8745),F=n(4358),O=n(4835),I=n(2033),z=n(8834),$=N.i},8745:function(e,t,n){var r=n(9050),i=n(3857),o=n(2033),a=i.format(",.2r"),s=i.format(",.3p");e.exports.i=function(e,t,n){var l=i.select(t).select("tbody");l.empty()&&(l=i.select(t).append("tbody"));var u=e.json,c=[];l.empty()||r.each(u["Network Summary"],function(e,t){n&&"Clusters"===t&&(e=r.size(u["Cluster description"])),r.isNumber(e)&&c.push([{cluster_sizes:"簇大小",genetic_distances_among_linked_nodes:"链接节点间的遗传距离",interquartile_range:"四分位距",links_per_node:"每节点的链接数",mean:"平均值",median:"中位数",range:"范围",edges:"边",nodes:"节点",clusters:"簇",sequences:"序列",individuals:"个体",sequences_used_to_make_links:"用于建立链接的序列数",singletons:"单节点",select_cluster:"选择簇",all_network:"总览",cluster_statistics:"簇统计"}[t.replace(/ /g,"_").toLowerCase()],e])});var d=[];r.each(u.Degrees.Distribution,function(e,t){for(var n=0;n<e;n++)d.push(t+1)}),d=o.describe_vector(d),c.push(["每节点的链接数",""]),c.push(["&nbsp;&nbsp;<i>平均值</i>",a(d.mean)]),c.push(["&nbsp;&nbsp;<i>中位数</i>",a(d.median)]),c.push(["&nbsp;&nbsp;<i>范围</i>",d.min+" - "+d.max]),c.push(["&nbsp;&nbsp;<i>四分位距</i>",d.Q1+" - "+d.Q3]),d=o.describe_vector(u["Cluster sizes"]),c.push(["簇大小",""]),c.push(["&nbsp;&nbsp;<i>平均值</i>",a(d.mean)]),c.push(["&nbsp;&nbsp;<i>中位数</i>",a(d.median)]),c.push(["&nbsp;&nbsp;<i>范围</i>",d.min+" - "+d.max]),c.push(["&nbsp;&nbsp;<i>四分位距</i>",d.Q1+" - "+d.Q3]),e.has_multiple_sequences&&(c.push(["Persons with >1 sequence",r.filter(e.primary_key_list,function(e,t){return e.length>1}).length]),c.push(["Persons in multiple clusters",r.size(e.entities_in_multiple_clusters)])),n||(d=o.describe_vector(r.map(u.Edges,function(e){return e.length})),c.push(["链接节点间的遗传距离",""]),c.push(["&nbsp;&nbsp;<i>平均值</i>",s(d.mean)]),c.push(["&nbsp;&nbsp;<i>中位数</i>",s(d.median)]),c.push(["&nbsp;&nbsp;<i>范围</i>",s(d.min)+" - "+s(d.max)]),c.push(["&nbsp;&nbsp;<i>四分位距</i>",s(d.Q1)+" - "+s(d.Q3)]));var f=l.selectAll("tr").data(c);f.enter().append("tr"),f.exit().remove();var p=f.selectAll("td").data(function(e){return e});p.enter().append("td"),p.exit(),p.html(function(e){return e})}},4835:function(e,t,n){var r=n(3857),i=n(9050),o=n(2033),a={};i.each(i.range(3,20),function(e){var t=2*Math.PI/e;a[e]=i.map(i.range(1,e),function(e){return[Math.cos(t*e),Math.sin(t*e)]})});var s=function(){var e=this;return e.ellipse=function(){return"M "+e.radius+" 0 A "+1*e.radius+" "+.75*e.radius+" 0 1 0 "+e.radius+" 0.00001"},e.ellipse.type=function(){return e.ellipse},e.ellipse.size=function(t){return i.isNumber(t)?(e.size=t,e.radius=Math.sqrt(1.25*t/Math.PI),e.ellipse):e.size},e.ellipse.size(64),e.ellipse};function l(){var e=this;return e.polygon=function(){var t=" M"+e.radius+" 0";if(e.sides in a)t+=a[e.sides].map(function(t){return" L"+e.radius*t[0]+" "+e.radius*t[1]}).join(" ");else for(var n=2*Math.PI/e.sides,r=0,i=0;i<e.sides-1;i++)r+=n,t+=" L"+e.radius*Math.cos(r)+" "+e.radius*Math.sin(r);return t+" Z"},e.polygon.sides=function(t){return i.isNumber(t)&&t>2?(e.sides=t,e.polygon):e.sides},e.polygon.type=function(){return e.polygon},e.polygon.size=function(t){return i.isNumber(t)?(e.size=t,e.radius=Math.sqrt(t/Math.PI),e.polygon):e.size},e.polygon.size(64),e.sides=6,e.polygon}e.exports={edge_typer:function(e,t,n){return t[e.length<=n?0:1]},coi_timeseries:function(e,t,n){var o=r.time.format("%Y-%m-%d"),a=i.sortBy(i.map(e.node_info,function(e){return[e[0],o.parse(e[1])]}),function(e){return e[1]}),s=Math.ceil(15*(a.length+.1))+30+10,l=i.map(e.event_info,function(e,t){return[t,o.parse(t)]}),u=r.extent(i.map(a,function(e){return e[1]}).concat(i.map(l,function(e){return e[1]})));n=n||1e3;var c=r.time.scale().domain(u).rangeRound([120,n-60]),d=r.scale.ordinal().domain(r.range(a.length+1)).rangeRoundPoints([30,s-10],.1),f=r.svg.axis().scale(c).orient("top").ticks(n/80).tickFormat(r.time.format("%m/%y"));t.selectAll("svg").remove();var p=t.append("svg").attr("width",n).attr("height",s).attr("viewBox",[0,0,n,s]);p.append("g").attr("transform","translate(0,18)").attr("class","y time_axis").call(f).call(function(e){return e.select(".domain").remove()}),p.append("g").attr("stroke","#ddd").attr("stroke-width",2).attr("opacity",.8).selectAll("line").data(l).enter().append("line").attr("x1",function(e){return c(e[1])}).attr("x2",function(e){return c(e[1])}).attr("y1",function(e,t){return d(0)}).attr("y2",function(e,t){return d(a.length)});var h=p.append("g").selectAll("line").data(a).enter().append("line").attr("stroke","#aaa").attr("stroke-width",2).attr("x1",function(e){return c(u[1])}).attr("x2",function(e){return c(e[1])}).attr("y1",function(e,t){return d(t)}).attr("y2",function(e,t){return d(t)}),g=[null,null],m=new Set,v=a.concat([["Nat'l priority",u[0]]]),y=p.append("g").attr("font-family","sans-serif").attr("font-size",10).attr("font-weight",700).selectAll("text").data(v).enter().append("text").attr("text-anchor","end").attr("x",function(e){return c(e[1])}).attr("y",function(e,t){return d(t)+d.rangeBand()/2}).attr("dy","0.35em").attr("dx","-0.25em").attr("fill","black").text(function(e){return e[0]});p.append("g").selectAll("circle").data(a).enter().append("circle").attr("fill","black").attr("stroke","black").attr("cx",function(e){return c(e[1])}).attr("cy",function(e,t){return d(t)}).attr("r",1),p.append("g").selectAll("circle").data(l).enter().append("circle").attr("fill",function(t,n){return i.some(e.event_info[t[0]].national_priority)?"firebrick":"steelblue"}).attr("stroke","black").attr("cx",function(e){return c(e[1])}).attr("cy",function(e,t){return d(a.length)}).attr("r",function(t){return 2+Math.sqrt(r.sum(e.event_info[t[0]].connected_componets))}).on("mouseover",function(t,n){var r=e.event_info[t[0]];i.each(r.national_priority,function(e,t){e&&i.each(r.priority_nodes[t],function(e){return m.add(e)})});var o=i.map([1,3],function(e){var n=new Date(t[1]);return n.setFullYear(t[1].getFullYear()-e),n<u[0]&&(n=u[0]),n}),s=["firebrick","grey"];g=i.map(o,function(e,n){return p.append("g").selectAll("rect").data([t]).enter().append("rect").attr("fill",s[n]).attr("x",function(t){return c(e)}).attr("y",function(e){return d(0)}).attr("width",c(t[1])-c(e)).attr("height",function(e){return-d(0)+d(a.length-1)}).attr("opacity",.25)}),h.attr("stroke-width",function(e){return m.has(e[0])?5:2}).attr("stroke",function(e){return m.has(e[0])?"black":"#aaa"}),y.attr("fill",function(e){return m.has(e[0])?"firebrick":"black"})}).on("mouseout",function(e,t){h.attr("stroke-width",2).attr("stroke","#aaa"),y.attr("fill","black"),m=new Set,i.each(g,function(e){return e?e.remove():0}),g=[null,null]}).append("title").text(function(t){var n=e.event_info[t[0]],o=t[0]+". ";return i.some(n.national_priority)&&(o+="National priority clusterOI. "),o+=String(r.sum(n.connected_componets))+" nodes in "+n.connected_componets.length+" components. ",o+="A total of "+r.sum(n.priority_nodes,function(e){return e.length})+" nodes dx'ed in the previous 12 months; maximum of "+r.max(n.priority_nodes,function(e){return e.length})+" in a subcluster",o})},compute_node_degrees:function(e){var t=e.Nodes,n=e.Edges;for(var r in t)t[r].degree=0;for(var i in n)t[n[i].source].degree++,t[n[i].target].degree++},export_table_to_text:function(e,t,n,i){var a=r.select(e);return a.selectAll("[data-type='download-button']").remove(),(a=a.append("a").attr("target","_blank").attr("data-type","download-button").on("click",function(e,t){r.event.preventDefault();var a=r.select(this).attr("data-table"),s=o.table_to_text(a,n?",":"\t");i=i||a.substring(1),n?o.export_handler(s,i+".csv","text/comma-separated-values"):o.export_handler(s,i+".tsv","text/tab-separated-values")}).attr("data-table",t)).append("i").classed("fa fa-download fa-2x",!0),a},symbol:function(e){switch(e){case"circle":case"cross":case"diamond":case"square":case"triangle-down":case"triangle-up":return r.svg.symbol().type(e);case"triangle":return(new l).sides(3);case"pentagon":return(new l).sides(5);case"hexagon":return(new l).sides(6);case"septagon":return(new l).sides(7);case"octagon":return(new l).sides(8);case"ellipse":return new s;default:return r.svg.symbol().type("circle")}},cluster_dynamics:function(e,t,n,o,a,s,l){if(l=l||{base_line:20,top:40,right:30,bottom:60,left:100,font_size:18,rect_size:22,width:1024,height:600},0!==(e=i.filter(e,function(e){return i.isDate(e.time)})).length){var u,c=l&&l.barchart,d=l&&l.skip_cumulative||c,f=l.width-l.left-l.right,p=l.height-l.top-l.bottom;s||(s=function(e){var t=e.getFullYear(),n=new Date,r=new Date;n.setDate(1),n.setFullYear(t),r.setFullYear(t);var i=Math.floor(e.getMonth()/3);return n.setMonth(3*i),n.setHours(0,0,0),r.setHours(0,0,0),n.setFullYear(t),r.setMonth(3*i+1),r.setDate(15),["Q"+(i+1)+" "+t,n,r]},u=new Date(2018,3,0)-new Date(2018,0,0));var h=function(e){var t=e.getFullYear(),n=Math.floor(e.getMonth()/3)+1;return String(t)+"-Q"+n};l&&l["x-tick-format"]&&(h=l["x-tick-format"]);var g=r.time.scale().range([0,f]),m=a||r.scale.linear();a?m.range([p,0]):m.rangeRound([p,0]);var v=r.svg.axis().scale(g).orient("bottom").ticks(r.time.month,3).tickFormat(r.time.format("%m/%Y"));h&&v.tickFormat(h);var y=r.svg.axis().scale(m).orient("left").tickFormat(function(e){return(0|e)===e?e:null}),_={},b={},w="total",x=l&&l.prefix?l.prefix:"",k=0;i.each(e,function(e,t){var n=s(e.time);n[0]in _||(_[n[0]]={time:n[1],x:n[2]},_[n[0]][w]=0,i.each(e,function(e,t){"time"!==t&&(_[n[0]][t]={})})),_[n[0]][w]+=1,k=Math.max(k,_[n[0]][w]);var r={};r[w]=t+1,i.each(e,function(e,t){"time"!==t&&(_[n[0]][t][e]=_[n[0]][t][e]?_[n[0]][t][e]+1:1,t in b||(b[t]={}),e in b[t]?b[t][e]++:b[t][e]=1,k=Math.max(k,_[n[0]][t][e]),r[t]=i.clone(b[t]))}),e.y=r,e._bin=n[1]});var C=[];i.each(_,function(e,t){e.id=t,C.push(e)}),C.sort(function(e,t){return t.time-e.time}),c&&(i.isUndefined(u)&&i.each(C,function(e,t){t>0&&(u=Math.min(u,-(e.time-C[t-1].time)))}),u*=.8);var D=r.min(e,function(e){return e.time<e._bin?e.time:e._bin}),S=r.max(e,function(e){return e.time>e._bin?e.time:e._bin});if(c){var A=new Date;A.setTime(S.getTime()+u),S=A,(A=new Date).setTime(D.getTime()-u),D=A}var E=Math.floor((S-D)/3600/24/1e3/30);E>8&&v.ticks(r.time.month,3*Math.ceil(E/8)),g.domain([D,S]).clamp(!0),m.domain([0,Math.round(d?k+1:1.2*e.length)]).clamp(!0),t.selectAll("*").remove();var M=t.append("g").attr("transform","translate("+l.left+","+l.top+")"),T=t.append("g").attr("transform","translate("+(l.left+2.5*l.font_size)+","+(l.top+l.font_size)+")"),j=i.keys(b)[0],N="colorizer"in l&&l.colorizer&&j in l.colorizer?l.colorizer[j]:r.scale.category10();N=i.wrap(N,function(e,t){return t===w?"#555555":e(t)});var F=i.keys(b[j]);if(c?0===F.length&&F.push(w):F.push(w),F.sort(),l&&l.drag){var O=r.behavior.drag();O.on("drag",function(){l.drag.x+=r.event.dx,l.drag.y+=r.event.dy,r.select(this).attr("transform","translate("+l.drag.x+","+l.drag.y+")")}),t.call(O)}if(!c||F.length>1||F[0]!==w){var I=T.selectAll("g").data(F);I.enter().append("g").attr("class","annotation-text"),I.selectAll("text").data(function(e){return[e]}).enter().append("text").attr("transform",function(e,t,n){return"translate("+l.rect_size+","+(l.rect_size*(F.length-1-n)-(l.rect_size-l.font_size))+")"}).attr("dx","0.2em").style("font-size",l.font_size).text(function(e){return e}).on("mouseover",function(e){q(x+e,!0)}).on("mouseout",function(e){q(x+e,!1)}),I.selectAll("rect").data(function(e){return[e]}).enter().append("rect").attr("x",0).attr("y",function(e,t,n){return l.rect_size*(F.length-2-n)}).attr("width",l.rect_size).attr("height",l.rect_size).attr("class","area").style("fill",function(e,t,n){return N(e)}).on("mouseover",function(e){q(x+e,!0)}).on("mouseout",function(e){q(x+e,!1)})}var z=i.clone(e[e.length-1]);z.time=g.domain()[1],e.push(z),i.each(F,function(t,n){var i=N(t),o=function(e){return j&&t in e[j]?e[j][t]:t in e?e[t]:0};if(!d){var a=r.svg.area().x(function(e){return g(e.time)}).y1(function(e){return m(function(e){return t in e.y?e.y[t]:j in e.y&&t in e.y[j]?e.y[j][t]:0}(e))}).y0(function(e){return m(0)}).interpolate("step");M.append("path").datum(e).classed("trend",!0).style("fill",i).style("stroke",i).attr("d",a).attr("data-plotid",x+t)}if(c)C.forEach(function(e){var n=new Date;n.setTime(e.time.getTime()-.5*u);var a=new Date;a.setTime(e.time.getTime()+.5*u);var s=g(n),l=g(a)-g(n),c="last_y"in e?e.last_y:0,d=o(e);M.append("rect").attr("x",s).attr("y",m(c+d)).attr("height",m(0)-m(d)).attr("width",l).attr("data-plotid",x+t).classed("tracer",!0).style("fill",i).style("stroke",r.rgb(i).darker(2)).style("fill-opacity",1).append("title").text(t+" "+d+" cases in "+(h?h(e.time):e.time)),e.last_y=(e.last_y?e.last_y:0)+d});else{C.forEach(function(e){M.append("circle").attr("cx",g(e.time)).attr("cy",m(o(e))).attr("r","5").classed("node",!0).style("fill",i).style("stroke",i).attr("title",t+" : "+o(e))});var s=r.svg.line().x(function(e){return g(e.time)}).y(function(e){return m(o(e))}).interpolate("cardinal");M.append("path").datum(C).classed("tracer",!0).style("stroke",i).attr("d",s).attr("data-curveid",x+t)}});var $=M.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").style("font-size",l.font_size).call(v);$.selectAll("text").attr("transform","rotate(-45)").attr("dy","0.9em").attr("dx","-1.75em"),$.append("text").attr("x",f/2).attr("dy","3.5em").style("text-anchor","middle").style("font-size",1.5*l.font_size).text(n),M.append("g").attr("class","y axis").style("font-size",l.font_size).call(y).append("text").style("font-size",1.5*l.font_size).attr("transform","rotate(-90)").attr("y",6).attr("dy","-2em").style("text-anchor","end").text(o)}function q(e,t){c?r.selectAll('[data-plotid="'+e+'"]').style("stroke-width",t?4:1):r.selectAll('[data-plotid="'+e+'"]').style("fill-opacity",t?.5:.1),r.selectAll('[data-curveid="'+e+'"]').style("stroke-width",t?3:1)}},hivtrace_cluster_depthwise_traversal:function(e,t,n,r,o,a,s){var l=[],u={},c={};if(o=o||e,s){for(var d=e.length;d--;)e[d].visited=!1;u=s}else{for(d=e.length;d--;)e[d].visited=!1,u[e[d].id]=[];n&&(t=i.filter(t,n)),a&&(t=i.filter(t,function(t){return a.has(e[t.source].id)&&a.has(e[t.target].id)})),i.each(t,function(t){try{u[e[t.source].id].push([e[t.target],t]),u[e[t.target].id].push([e[t.source],t])}catch(e){throw Error("Edge does not map to an existing node "+t.source+" to "+t.target)}})}var f=function(e){e.id in c||(l.push([e]),c[e.id]=l.length-1,r&&r.push([])),e.visited=!0;for(var t=u[e.id]?u[e.id].length:0;t--;){var n=u[e.id][t];n[0].visited||(c[n[0].id]=c[e.id],l[c[n[0].id]].push(n[0]),r&&r[c[n[0].id]].push(n[1]),f(n[0]))}};return i.each(o,function(e){e.visited||f(e)}),l},random_id:function(e,t){e=e||["a","b","c","d","e","f","g"],t=t||32;for(var n="",r=0;r<t;r++)n+=i.sample(e);return n},get_ui_element_selector_by_role:function(e){return" [data-hivtrace-ui-role='".concat(e,"']")},hivtrace_cluster_complete_clusters:function(e,t,n){var r=[],o={},a={};i.each(e,function(e){e.visited=!1,o[e.id]=[]}),n&&(t=i.filter(t,n)),i.each(t,function(t){try{o[e[t.source].id].push([e[t.target],t]),o[e[t.target].id].push([e[t.source],t])}catch(e){throw Error("Edge does not map to an existing node "+t.source+" to "+t.target)}});var s=function(e){e.id in a||(r.push([e]),a[e.id]=r.length-1),e.visited=!0,i.each(o[e.id],function(t){t[0].visited||(i.every(r[a[e.id]]),function(e){i.find(o[e.id],function(e){return e[0]==t[0].id})}?(a[t[0].id]=a[e.id],r[a[t[0].id]].push(t[0]),s(t[0])):s(t[0]))})};return i.each(e,function(e){e.visited||s(e)}),r},hivtrace_compute_adjacency:function(e,t,n){var r={};return i.each(t,function(t){if(!n||n(t)){var i=e[t.source],o=e[t.target];i.id in r||(r[i.id]=new Set),r[i.id].add(o.id),o.id in r||(r[o.id]=new Set),r[o.id].add(i.id)}}),r},hivtrace_compute_adjacency_with_edges:function(e,t,n){var r={};return i.each(t,function(t){if(!n||n(t)){var i=e[t.source],o=e[t.target];i.id in r||(r[i.id]=[]),r[i.id].push([o,t]),o.id in r||(r[o.id]=[]),r[o.id].push([i,t])}}),r},format_value:function(e,t){return null==e||isNaN(e)?"N/A":t?t(e):String(e)}}},4257:function(e,t,n){function r(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var o=n(3857),a=n(9050),s=n(6822),l=n(6221);e.exports={check_network_option:function(e,t,n,r){return e&&t in e?void 0===r?e[t]:r:n},ensure_node_attributes_exist:function(e){var t=new Set(["attributes",l.network.NodeAttributeID]);e.Nodes.forEach(function(e){var n,i=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=r(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;e[o]||(e[o]=[])}}catch(e){i.e(e)}finally{i.f()}})},normalize_node_attributes:function(e){var t=a.object(a.map(e[l.network.GraphAttrbuteID],function(e,t){return[e.label,t]}));a.each(e.Nodes,function(n){if(l.network.NodeAttributeID in n){var i={};null!==n[l.network.NodeAttributeID]&&(i=Object.fromEntries(Object.entries(n[l.network.NodeAttributeID]).map(function(e){var t,n,i=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,n)||r(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1];return[o.toLowerCase(),a]})));var o=a.difference(a.keys(i),a.keys(e[l.network.GraphAttrbuteID]));o.length&&a.each(o,function(e){a.contains(a.keys(t),e)&&(i[t[e]]=i[e],delete i[e])}),n[l.network.NodeAttributeID]=i}})},unpack_compact_json:function(e){a.each(["Nodes","Edges"],function(t){var n=a.keys(e[t]),r=[];a.each(n,function(n,i){var o=e[t][n];if(!a.isArray(o)&&"values"in o){var s=[];a.each(o.values,function(e){s.push(o.keys[e])}),o=s}a.each(o,function(e,t){0===i&&r.push({}),r[t][n]=e})}),e[t]=r})},handle_cluster_click:function e(t,n,r){var i=o.select(t.container),l="d3_context_menu_id",u=i.select("#"+l);u.empty()&&(u=i.append("ul").attr("id",l).attr("class","dropdown-menu").attr("role","menu")),u.selectAll("li").remove();var c=n&&n.fixed;n?(u.append("li").append("a").attr("tabindex","-1").text("展开簇").on("click",function(e){n.fixed=0,t.expand_cluster_handler(n,!0),u.style("display","none")}),u.append("li").append("a").attr("tabindex","-1").text("居中显示").on("click",function(e){n.fixed=0,function(e,t){t.x=e.width/2,t.y=e.height/2,e.update(!1,.4)}(t,n),u.style("display","none")}),u.append("li").append("a").attr("tabindex","-1").text(function(e){return n.fixed?"允许簇浮动":"固定簇位置"}).on("click",function(e){n.fixed=!n.fixed,u.style("display","none")}),t.isPrimaryGraph&&u.append("li").append("a").attr("tabindex","-1").text(function(e){return"在单独标签页显示此簇"}).on("click",function(e){t.open_exclusive_tab_view(n.cluster_id,null,null,a.extend(t._distance_gate_options(),{"simplified-mspp":1})),u.style("display","none")}),s.get_editor()&&u.append("li").append("a").attr("tabindex","-1").text(function(e){return"将此簇添加到关注簇"}).on("click",function(e){s.get_editor().append_nodes(a.map(n.children,function(e){return t.entity_id(e)}))}),t.customContextMenuItems&&Array.isArray(t.customContextMenuItems)&&t.customContextMenuItems.length>0&&(u.append("li").attr("class","divider"),t.customContextMenuItems.forEach(function(e){var r=u.append("li");e.disabled&&r.attr("class","disabled");var i=r.append("a").attr("tabindex","-1").style("cursor",e.disabled?"not-allowed":"pointer");e.icon&&i.append("i").attr("class","fa "+e.icon).style("margin-right","6px"),i.append("span").text(e.label),e.disabled||i.on("click",function(){var r={cluster_id:n.cluster_id,node_count:n.children?n.children.length:0,cluster_size:n.cluster_size,nodes:n.children,x:n.x,y:n.y,expanded:n.expanded,fixed:n.fixed};t.onCustomMenuItemClick&&"function"==typeof t.onCustomMenuItemClick&&t.onCustomMenuItemClick(e.id,r),u.style("display","none")})})),u.style("position","absolute").style("left",String(o.event.offsetX)+"px").style("top",String(o.event.offsetY)+"px").style("display","block")):(r&&(r.fixed=0),u.style("display","none")),i.on("click",function(r){e(t,null,c?null:n)},!0)}}},7568:function(e){var t;e.exports={init:function(e){t=e},getNodeTable:function(){return t}}},8033:function(e,t,n){var r=n(3857);e.exports.M=function(e,t,n,i,o,a){var s=r.format(",.2r"),l=r.time.format("%B %Y"),u=t-100-10,c=n-10-100,d=(a?r.time.scale():r.scale.linear()).domain(r.extent(e,function(e){return e.x})).range([0,u]),f=(a?r.time.scale():r.scale.linear()).domain(r.extent(e,function(e){return e.y})).range([c,0]),p=r.svg.axis().scale(d).orient("bottom").tickFormat(a?l:s),h=r.svg.axis().scale(f).orient("left").tickFormat(a?l:s),g=r.select(i).selectAll("svg");g.empty()||g.remove(),(e=(g=r.select(i).append("svg").attr("width",t).attr("height",n).append("g").attr("transform","translate(100,10)")).selectAll("circle").data(e)).enter().append("circle"),e.attr("cx",function(e){return d(e.x)}).attr("cy",function(e){return f(e.y)}).attr("r",3).classed("node scatter",!0),e.each(function(e){"title"in e&&r.select(this).append("title").text(e.title)});var m=g.append("g").attr("class","x axis").attr("transform","translate(0,"+c+")").call(p);m.selectAll("text").attr("transform","rotate(-45)").attr("dx","-.5em").attr("dy",".25em").style("text-anchor","end"),m.append("text").text(o.x).attr("transform","translate("+u+",0)").attr("dy","-1em").attr("text-anchor","end");var v=g.append("g").attr("class","y axis").attr("transform","translate(0,0)").call(h);v.selectAll("text").attr("transform","rotate(-45)").attr("dx","-.5em").attr("dy",".25em").style("text-anchor","end"),v.append("text").text(o.y).attr("transform","rotate(-90)").attr("dy","1em").attr("text-anchor","end")}},905:function(e,t,n){var r=n(9983),i=n(3857),o=n(9050),a=n(4835),s=n(4861),l=n(7568),u=n(6221),c="hivtrace_node_id";function d(e){return o.isFunction(e.value)?e.value():e.value}function f(e,t,n,s){var u=i.select(n),f=d(e),p=u;if(p.selectAll("*").remove(),"callback"in e)p=e.callback(n,f);else{var g="format"in e?e.format(f):f;"html"in e&&e.html?u.html(g):u.text(g)}if("filter"in e){if(e.filter_term="",e.column_id=t,e.value===c&&s){var v=p.append("a").property("href","#");v.append("i").classed("fa fa-plus-square fa-lg",!0).style("margin-left","0.2em").attr("title","Add currently visible nodes to the Cluster of Interest"),v.on("click",function(t){var n=[];l.getNodeTable().selectAll("tr").each(function(t,r){var o=i.select(this);"none"!==o.style("display")&&o.selectAll("td").each(function(t,r){if(r===e.column_id){var i=t.value.indexOf("[+]");i>0?n.push(t.value.substring(0,i)):n.push(t.value)}})}),s.append_nodes(n)})}if(e.filter){var y=p.append("a").property("href","#");y.append("i").classed("fa fa-search",!0).style("margin-left","0.2em"),r(y.node()).popover({html:!0,sanitize:!1,content:function(){return'<form class="form-inline" data-hivtrace-ui-role = "table-filter-form"> \n <div class="form-group"> \n <div class="input-group">\n <input type="text" class="form-control input-sm" data-hivtrace-ui-role = "table-filter-term" placeholder="Filter On" style = "min-width: 100px">\n <div class="input-group-addon"><a data-hivtrace-ui-role = "table-filter-reset"><i class="fa fa-times-circle"></i></a> </div>\n <div class="input-group-addon"><a data-hivtrace-ui-role = "table-filter-apply"><i class="fa fa-filter"></i></a> </div> \n <div class="input-group-addon">\n <i class="fa fa-question" data-toggle="collapse" data-target="#filter-help-column\' +\n index +\n \'" aria-expanded="false" aria-controls="collapseExample"></i>\n </div> \n </div>\n </div>\n </form>\n <div class="collapse" id="filter-help-column\' +\n index +\n \'">\n <div class="well">\n Type in text to select columns which \n <em>contain the term</em>. <br />\n For example, typing in <code>MSM</code> will select rows\n that have "MSM" as a part of the column value.\n <p />\n Type in space separated terms (<code>MSM IDU</code>) to\n search for <b>either</b> term. <p/>\n Type in terms in quotes (<code>"male"</code>) to search\n for this <b>exact</b> term. <p/>\n If columns have date information you can use\n <code>YYYYMMDD:YYYYMMDD</code> to search for date ranges.<p/>\n Use <code>&lt;value</code> or <code>&gt;value</code>\n to search numerical columns<p/>\n </div>\n </div>\n '},placement:"bottom"}).on("shown.bs.popover",function(t){var n=i.select(this),o=function(t){e.filter_term=t,n.selectAll("i").classed("fa-search",!t.length).classed("fa-search-plus",t.length)},s=i.select("#"+i.select(this).attr("aria-describedby")),l=s.selectAll(a.get_ui_element_selector_by_role("table-filter-apply")),u=s.selectAll(a.get_ui_element_selector_by_role("table-filter-reset")),c=s.selectAll(a.get_ui_element_selector_by_role("table-filter-term"));c.property("value",e.filter_term),r(a.get_ui_element_selector_by_role("table-filter-term")).on("keydown",function(e){"Enter"==e.key&&(o(c.property("value")),h(y.node()),e.preventDefault())}),l.on("click",function(e){o(c.property("value")),h(y.node())}),u.on("click",function(e){c.property("value",""),o(""),h(y.node())})})}}if(p&&"sort"in e&&((y=p.append("a").property("href","#").on("click",function(e){m(this,e)}).attr("data-sorted","unsorted").attr("data-column-id",t)).append("i").classed("fa fa-sort",!0).style("margin-left","0.2em"),"presort"in e&&("desc"===e.presort&&y.attr("data-sorted","asc"),m(y.node(),e))),"actions"in e){var _=e.actions;o.isArray(e.actions)&&o.isArray(e.actions[0])||(_=[e.actions]),o.each(_,function(e){var t=p.append("div").classed("btn-group btn-group-xs",!0).attr("style","padding-left:0.5em");o.each(o.isFunction(e)?e(t,f):e,function(e){if(o.isFunction(e)&&(e=e(t,f)),e){var n=null;if(o.isArray(e.dropdown)){var r=t.append("div").classed("btn-group btn-group-xs",!0);n=r.append("button").classed("btn btn-default btn-xs dropdown-toggle",!0).attr("data-toggle","dropdown");var a=r.append("ul").classed("dropdown-menu",!0),s=e.dropdown;function l(e){return o.has(e,"label")?e.label:e}(a=a.selectAll("li").data(s)).enter().append("li"),a.each(function(t,r){var a=i.select(this).append("a").attr("href","#").text(function(e){return l(e)});o.has(t,"data")&&t.data&&o.each(t.data,function(e,t){a.attr("data-"+t,e)}),a.on("click",function(t){o.has(t,"action")&&t.action?t.action(n,t.label):e.action&&e.action(n,l(t))})})}else n=t.append("button").classed("btn btn-default btn-xs",!0),e.action&&n.on("click",function(t){i.event.preventDefault(),e.action(n,f)});e.icon?n.append("i").classed("fa "+e.icon,!0):n.text(e.text).style("font-size","12px"),e.data&&o.each(e.data,function(e,t){n.attr("data-"+t,e)}),e.classed&&o.each(e.classed,function(e,t){n.classed(t,e)}),e.help&&n.attr("title",e.help)}})})}"help"in e&&u.attr("title",e.help)}function p(e,t){return!t.length||o.some(t,function(t){return"re"===t.type?t.value.test(e):"date"===t.type?e>=t.value[0]&&e<=t.value[1]:"distance"===t.type&&(t.greater_than?e>t.value:e<=t.value)})}function h(e){i.event&&i.event.preventDefault();var t=r(e).closest("table");if(t.length){var n=[],s=[];i.select(t[0]).selectAll("thead th").each(function(e,t){e.filter&&(o.isString(e.filter_term)&&e.filter_term.length?(n[e.column_id]=g(e.filter_term),s[e.column_id]=o.isFunction(e.filter)?e.filter:p):(n[e.column_id]=null,s[e.column_id]=null))});var l=0;i.select(t[0]).select("tbody").selectAll("tr").each(function(e,t){var r=i.select(this),o=!1;r.selectAll("td").each(function(e,t){o||n[t]&&(s[t](d(e),n[t])||(o=!0))}),o?r.style("display","none"):(l+=1,r.style("display",null))}),i.select(t[0]).select("caption").select(a.get_ui_element_selector_by_role("table-count-shown")).text(l)}}function g(e){var t=[],n=0,r=[];return o.each(e,function(e){" "===e?0===n?r.length&&(t.push(r.join("")),r=[]):r.push(e):('"'===e&&(n=1-n),r.push(e))}),0===n&&t.push(r.join("")),t.filter(function(e){return e.length>0}).map(function(e){if(e.length>=2){if('"'===e[0]&&'"'===e[e.length-1]&&e.length>2)return{type:"re",value:new RegExp("^"+e.substr(1,e.length-2)+"$","i")};if("<"===e[0]||">"===e[0]){var t=parseFloat(e.substr(1));if(t>0)return{type:"distance",greater_than:">"===e[0],value:t}}if(s.getClusterTimeScale()){var n=s._networkTimeQuery.exec(e);if(n)return{type:"date",value:o.map([n[1],n[2]],function(e){return new Date(e.substring(0,4)+"-"+e.substring(4,6)+"-"+e.substring(6,8))})}}}return{type:"re",value:new RegExp(e,"i")}})}function m(e,t){i.event&&i.event.preventDefault();var n=r(e).closest("table");if(n.length){var a,s=parseInt(r(e).data("column-id")),l=t.sort,u=v(e);a=l?o.isFunction(l)?function(e){return l(e)}:function(e){var t=e[l];return o.isFunction(t)?t():t}:function(e){return e},i.select(n[0]).select("tbody").selectAll("tr").sort(function(e,t){return u(a(e[s]),a(t[s]))}),r(n).find("thead [data-column-id]").filter(function(){return parseInt(r(this).data("column-id"))!==s}).each(function(){v(this,"unsorted")})}}function v(e,t){if(!t){var n=r(e).data("sorted");return v(e,"asc"===n?"desc":"asc"),"asc"===n?i.descending:i.ascending}r(e).data("sorted",t),i.select(e).selectAll("i").classed("fa-sort-amount-desc","desc"===t).classed("fa-sort-amount-asc","asc"===t).classed("fa-sort","unsorted"===t)}e.exports={_networkNodeIDField:c,_networkNewNodeMarker:"[+]",add_a_sortable_table:function(e,t,n,r,o,s,l){if(e&&e.node()){e.style("display","none");var c=e.selectAll("thead"),d=e.selectAll("tbody"),p=function(e,t){(e.width||e.text_wrap)&&(t=i.select(t),e.width&&t.style("width",String(e.width)+"px"),e.text_wrap&&t.style("overflow","hidden").style("white-space","nowrap").style("text-overflow","ellipsis"))};if((d.empty()||r)&&(d.remove(),(d=i.select(document.createElement("tbody"))).selectAll("tr").data(n).enter().append("tr").selectAll("td").data(function(e){return e}).enter().append("td").call(function(e){return e.each(function(e,t){p(e,this),f(e,t,this,s)})}),e.node().appendChild(d.node())),(c.empty()||r)&&(c.remove(),(c=e.insert("thead",":first-child")).selectAll("tr").data(t).enter().append("tr").selectAll("th").data(function(e){return e}).enter().append("th").call(function(e){return e.each(function(e,t){p(e,this),f(e,t,this,l&&l>n.length||n.length>u.CoIAddLimit?null:s)})})),o){var h=e.selectAll("caption").data([o]);h.enter().insert("caption",":first-child"),h.html(function(e){return e}),h.select(a.get_ui_element_selector_by_role("table-count-total")).text(n.length),h.select(a.get_ui_element_selector_by_role("table-count-shown")).text(n.length),l&&l>n.length&&h.select(a.get_ui_element_selector_by_role("table-count-warning")).style("color","black").text("Truncated due to the large number of rows ("+l+")")}e.style("display",null)}},format_a_cell:f,sort_table_by_column:m,sort_table_toggle_icon:v,filter_parse:g}},4861:function(e,t,n){var r,i=n(3857),o="hiv_aids_dx_dt",a=i.time.format.utc("%m/%d/%Y"),s=i.time.format("%m%d%Y"),l=i.time.format("%B %Y"),u=i.time.format("%b %d, %Y"),c=[i.time.format.iso,i.time.format("%Y%m%d")],d=i.time.format("%Y-%m-%d"),f=i.time.format("%Y/%m/%d"),p=(new Date).getFullYear(),h=i.time.format("%Y%m");e.exports={hivtrace_date_or_na_if_missing:function(e,t){if(e){t=t||a;try{return t(e)}catch(t){console.log(e)}}return"N/A"},_networkCDCDateField:o,_networkTimeQuery:/([0-9]{8}):([0-9]{8})/i,getClusterTimeScale:function(){return r},getCurrentDate:function(){return new Date},getAncientDate:function(){return new Date(1900,0,1)},DateFormats:c,DateUpperBoundYear:p,DateViewFormat:u,DateViewFormatExport:a,DateViewFormatClusterCreate:h,DateViewFormatMMDDYYY:s,DateViewFormatShort:l,DateViewFormatSlider:d,DateViewNodeSearch:f,n_months_ago:function(e,t){var n=new Date(e),r=n.getMonth(),i=Math.floor(t/12),o=t-12*i;return o>r?(n.setFullYear(n.getFullYear()-i-1),n.setMonth(12-(o-r))):(n.setFullYear(n.getFullYear()-i),n.setMonth(r-o)),n.setDate(n.getDate()+1),n.setUTCHours(0,0,0),n},init:function(e,t){r=null==e?void 0:e["cluster-time"],t&&!r&&(r=o)}}},4728:function(e,t,n){var r,i,o;i=[n(9983)],r=function(e,t){function n(){return new Date(Date.UTC.apply(Date,arguments))}function r(){var e=new Date;return n(e.getFullYear(),e.getMonth(),e.getDate())}function i(e,t){return e.getUTCFullYear()===t.getUTCFullYear()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCDate()===t.getUTCDate()}function o(n,r){return function(){return r!==t&&e.fn.datepicker.deprecated(r),this[n].apply(this,arguments)}}var a,s=(a={get:function(e){return this.slice(e)[0]},contains:function(e){for(var t=e&&e.valueOf(),n=0,r=this.length;n<r;n++)if(0<=this[n].valueOf()-t&&this[n].valueOf()-t<864e5)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(e){e&&(Array.isArray(e)||(e=[e]),this.clear(),this.push.apply(this,e))},clear:function(){this.length=0},copy:function(){var e=new s;return e.replace(this),e}},function(){var t=[];return t.push.apply(t,arguments),e.extend(t,a),t}),l=function(t,n){e.data(t,"datepicker",this),this._events=[],this._secondaryEvents=[],this._process_options(n),this.dates=new s,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=e(t),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn"),this.component&&0===this.component.length&&(this.component=!1),null===this.o.isInline?this.isInline=!this.component&&!this.isInput:this.isInline=this.o.isInline,this.picker=e(g.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(e,t){return Number(t)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};l.prototype={constructor:l,_resolveViewName:function(t){return e.each(g.viewModes,function(n,r){if(t===n||-1!==e.inArray(t,r.names))return t=n,!1}),t},_resolveDaysOfWeek:function(t){return Array.isArray(t)||(t=t.split(/[,\s]*/)),e.map(t,Number)},_check_template:function(n){try{return n!==t&&""!==n&&((n.match(/[<>]/g)||[]).length<=0||e(n).length>0)}catch(e){return!1}},_process_options:function(t){this._o=e.extend({},this._o,t);var i=this.o=e.extend({},this._o),o=i.language;h[o]||(o=o.split("-")[0],h[o]||(o=f.language)),i.language=o,i.startView=this._resolveViewName(i.startView),i.minViewMode=this._resolveViewName(i.minViewMode),i.maxViewMode=this._resolveViewName(i.maxViewMode),i.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,i.startView)),!0!==i.multidate&&(i.multidate=Number(i.multidate)||!1,!1!==i.multidate&&(i.multidate=Math.max(0,i.multidate))),i.multidateSeparator=String(i.multidateSeparator),i.weekStart%=7,i.weekEnd=(i.weekStart+6)%7;var a=g.parseFormat(i.format);i.startDate!==-1/0&&(i.startDate?i.startDate instanceof Date?i.startDate=this._local_to_utc(this._zero_time(i.startDate)):i.startDate=g.parseDate(i.startDate,a,i.language,i.assumeNearbyYear):i.startDate=-1/0),i.endDate!==1/0&&(i.endDate?i.endDate instanceof Date?i.endDate=this._local_to_utc(this._zero_time(i.endDate)):i.endDate=g.parseDate(i.endDate,a,i.language,i.assumeNearbyYear):i.endDate=1/0),i.daysOfWeekDisabled=this._resolveDaysOfWeek(i.daysOfWeekDisabled||[]),i.daysOfWeekHighlighted=this._resolveDaysOfWeek(i.daysOfWeekHighlighted||[]),i.datesDisabled=i.datesDisabled||[],Array.isArray(i.datesDisabled)||(i.datesDisabled=i.datesDisabled.split(",")),i.datesDisabled=e.map(i.datesDisabled,function(e){return g.parseDate(e,a,i.language,i.assumeNearbyYear)});var s=String(i.orientation).toLowerCase().split(/\s+/g),l=i.orientation.toLowerCase();if(s=e.grep(s,function(e){return/^auto|left|right|top|bottom$/.test(e)}),i.orientation={x:"auto",y:"auto"},l&&"auto"!==l)if(1===s.length)switch(s[0]){case"top":case"bottom":i.orientation.y=s[0];break;case"left":case"right":i.orientation.x=s[0]}else l=e.grep(s,function(e){return/^left|right$/.test(e)}),i.orientation.x=l[0]||"auto",l=e.grep(s,function(e){return/^top|bottom$/.test(e)}),i.orientation.y=l[0]||"auto";if(i.defaultViewDate instanceof Date||"string"==typeof i.defaultViewDate)i.defaultViewDate=g.parseDate(i.defaultViewDate,a,i.language,i.assumeNearbyYear);else if(i.defaultViewDate){var u=i.defaultViewDate.year||(new Date).getFullYear(),c=i.defaultViewDate.month||0,d=i.defaultViewDate.day||1;i.defaultViewDate=n(u,c,d)}else i.defaultViewDate=r()},_applyEvents:function(e){for(var n,r,i,o=0;o<e.length;o++)n=e[o][0],2===e[o].length?(r=t,i=e[o][1]):3===e[o].length&&(r=e[o][1],i=e[o][2]),n.on(i,r)},_unapplyEvents:function(e){for(var n,r,i,o=0;o<e.length;o++)n=e[o][0],2===e[o].length?(i=t,r=e[o][1]):3===e[o].length&&(i=e[o][1],r=e[o][2]),n.off(r,i)},_buildEvents:function(){var t={keyup:e.proxy(function(t){-1===e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:e.proxy(this.keydown,this),paste:e.proxy(this.paste,this)};!0===this.o.showOnFocus&&(t.focus=e.proxy(this.show,this)),this.isInput?this._events=[[this.element,t]]:this.component&&this.inputField.length?this._events=[[this.inputField,t],[this.component,{click:e.proxy(this.show,this)}]]:this._events=[[this.element,{click:e.proxy(this.show,this),keydown:e.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":e.proxy(function(e){this.update(e.date)},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[this.picker,".prev, .next",{click:e.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:e.proxy(this.dayCellClick,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,viewMode:this.viewMode,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){0===arguments.length?(e=this.dates.length-1,t=this.o.format):"string"==typeof e&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return g.formatDate(n,t,this.o.language)},this)})},show:function(){if(!(this.inputField.is(":disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&e(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")||(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide")),this},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(t){var n;if(t.originalEvent.clipboardData&&t.originalEvent.clipboardData.types&&-1!==e.inArray("text/plain",t.originalEvent.clipboardData.types))n=t.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;n=window.clipboardData.getData("Text")}this.setDate(n),this.update(),t.preventDefault()},_utc_to_local:function(e){if(!e)return e;var t=new Date(e.getTime()+6e4*e.getTimezoneOffset());return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(t=new Date(e.getTime()+6e4*t.getTimezoneOffset())),t},_local_to_utc:function(e){return e&&new Date(e.getTime()-6e4*e.getTimezoneOffset())},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&n(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var e=this.dates.get(-1);return e!==t?new Date(e):null},clearDates:function(){this.inputField.val(""),this._trigger("changeDate"),this.update(),this.o.autoclose&&this.hide()},setDates:function(){var e=Array.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,e),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var t=Array.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,e.map(t,this._utc_to_local)),this},setDate:o("setDates"),setUTCDate:o("setUTCDates"),remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var e=this.getFormattedDate();return this.inputField.val(e),this},getFormattedDate:function(n){n===t&&(n=this.o.format);var r=this.o.language;return e.map(this.dates,function(e){return g.formatDate(e,n,r)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(e){return this._process_options({startDate:e}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(e){return this._process_options({endDate:e}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(e){return this._process_options({daysOfWeekDisabled:e}),this.update(),this},setDaysOfWeekHighlighted:function(e){return this._process_options({daysOfWeekHighlighted:e}),this.update(),this},setDatesDisabled:function(e){return this._process_options({datesDisabled:e}),this.update(),this},place:function(){if(this.isInline)return this;var t=this.picker.outerWidth(),n=this.picker.outerHeight(),r=e(this.o.container),i=r.width(),o="body"===this.o.container?e(document).scrollTop():r.scrollTop(),a=r.offset(),s=[0];this.element.parents().each(function(){var t=e(this).css("z-index");"auto"!==t&&0!==Number(t)&&s.push(Number(t))});var l=Math.max.apply(Math,s)+this.o.zIndexOffset,u=this.component?this.component.parent().offset():this.element.offset(),c=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),d=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),f=u.left-a.left,p=u.top-a.top;"body"!==this.o.container&&(p+=o),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(f-=t-d)):u.left<0?(this.picker.addClass("datepicker-orient-left"),f-=u.left-10):f+t>i?(this.picker.addClass("datepicker-orient-right"),f+=d-t):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var h=this.o.orientation.y;if("auto"===h&&(h=-o+p-n<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+h),"top"===h?p-=n+parseInt(this.picker.css("padding-top")):p+=c,this.o.rtl){var g=i-(f+d);this.picker.css({top:p,right:g,zIndex:l})}else this.picker.css({top:p,left:f,zIndex:l});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var t=this.dates.copy(),n=[],r=!1;return arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=(n=this.isInput?this.element.val():this.element.data("date")||this.inputField.val())&&this.o.multidate?n.split(this.o.multidateSeparator):[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return g.parseDate(e,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),n=e.grep(n,e.proxy(function(e){return!this.dateWithinRange(e)||!e},this),!0),this.dates.replace(n),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),r?(this.setValue(),this.element.change()):this.dates.length&&String(t)!==String(this.dates)&&r&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&t.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var t=this.o.weekStart,n="<tr>";for(this.o.calendarWeeks&&(n+='<th class="cw">&#160;</th>');t<this.o.weekStart+7;)n+='<th class="dow',-1!==e.inArray(t,this.o.daysOfWeekDisabled)&&(n+=" disabled"),n+='">'+h[this.o.language].daysMin[t++%7]+"</th>";n+="</tr>",this.picker.find(".datepicker-days thead").append(n)}},fillMonths:function(){for(var e=this._utc_to_local(this.viewDate),t="",n=0;n<12;n++)t+='<span class="month'+(e&&e.getMonth()===n?" focused":"")+'">'+h[this.o.language].monthsShort[n]+"</span>";this.picker.find(".datepicker-months td").html(t)},setRange:function(t){t&&t.length?this.range=e.map(t,function(e){return e.valueOf()}):delete this.range,this.fill()},getClassNames:function(t){var n=[],o=this.viewDate.getUTCFullYear(),a=this.viewDate.getUTCMonth(),s=r();return t.getUTCFullYear()<o||t.getUTCFullYear()===o&&t.getUTCMonth()<a?n.push("old"):(t.getUTCFullYear()>o||t.getUTCFullYear()===o&&t.getUTCMonth()>a)&&n.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("focused"),this.o.todayHighlight&&i(t,s)&&n.push("today"),-1!==this.dates.contains(t)&&n.push("active"),this.dateWithinRange(t)||n.push("disabled"),this.dateIsDisabled(t)&&n.push("disabled","disabled-date"),-1!==e.inArray(t.getUTCDay(),this.o.daysOfWeekHighlighted)&&n.push("highlighted"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("range"),-1!==e.inArray(t.valueOf(),this.range)&&n.push("selected"),t.valueOf()===this.range[0]&&n.push("range-start"),t.valueOf()===this.range[this.range.length-1]&&n.push("range-end")),n},_fill_yearsView:function(n,r,i,o,a,s,l){for(var u,c,d,f="",p=i/10,h=this.picker.find(n),g=Math.floor(o/i)*i,m=g+9*p,v=Math.floor(this.viewDate.getFullYear()/p)*p,y=e.map(this.dates,function(e){return Math.floor(e.getUTCFullYear()/p)*p}),_=g-p;_<=m+p;_+=p)u=[r],c=null,_===g-p?u.push("old"):_===m+p&&u.push("new"),-1!==e.inArray(_,y)&&u.push("active"),(_<a||_>s)&&u.push("disabled"),_===v&&u.push("focused"),l!==e.noop&&((d=l(new Date(_,0,1)))===t?d={}:"boolean"==typeof d?d={enabled:d}:"string"==typeof d&&(d={classes:d}),!1===d.enabled&&u.push("disabled"),d.classes&&(u=u.concat(d.classes.split(/\s+/))),d.tooltip&&(c=d.tooltip)),f+='<span class="'+u.join(" ")+'"'+(c?' title="'+c+'"':"")+">"+_+"</span>";h.find(".datepicker-switch").text(g+"-"+m),h.find("td").html(f)},fill:function(){var i,o,a=new Date(this.viewDate),s=a.getUTCFullYear(),l=a.getUTCMonth(),u=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,c=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,d=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,f=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,p=h[this.o.language].today||h.en.today||"",m=h[this.o.language].clear||h.en.clear||"",v=h[this.o.language].titleFormat||h.en.titleFormat,y=r(),_=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&y>=this.o.startDate&&y<=this.o.endDate&&!this.weekOfDateIsDisabled(y);if(!isNaN(s)&&!isNaN(l)){this.picker.find(".datepicker-days .datepicker-switch").text(g.formatDate(a,v,this.o.language)),this.picker.find("tfoot .today").text(p).css("display",_?"table-cell":"none"),this.picker.find("tfoot .clear").text(m).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var b=n(s,l,0),w=b.getUTCDate();b.setUTCDate(w-(b.getUTCDay()-this.o.weekStart+7)%7);var x=new Date(b);b.getUTCFullYear()<100&&x.setUTCFullYear(b.getUTCFullYear()),x.setUTCDate(x.getUTCDate()+42),x=x.valueOf();for(var k,C,D=[];b.valueOf()<x;){if((k=b.getUTCDay())===this.o.weekStart&&(D.push("<tr>"),this.o.calendarWeeks)){var S=new Date(+b+(this.o.weekStart-k-7)%7*864e5),A=new Date(Number(S)+(11-S.getUTCDay())%7*864e5),E=new Date(Number(E=n(A.getUTCFullYear(),0,1))+(11-E.getUTCDay())%7*864e5),M=(A-E)/864e5/7+1;D.push('<td class="cw">'+M+"</td>")}(C=this.getClassNames(b)).push("day");var T=b.getUTCDate();this.o.beforeShowDay!==e.noop&&((o=this.o.beforeShowDay(this._utc_to_local(b)))===t?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),!1===o.enabled&&C.push("disabled"),o.classes&&(C=C.concat(o.classes.split(/\s+/))),o.tooltip&&(i=o.tooltip),o.content&&(T=o.content)),C="function"==typeof e.uniqueSort?e.uniqueSort(C):e.unique(C),D.push('<td class="'+C.join(" ")+'"'+(i?' title="'+i+'"':"")+' data-date="'+b.getTime().toString()+'">'+T+"</td>"),i=null,k===this.o.weekEnd&&D.push("</tr>"),b.setUTCDate(b.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(D.join(""));var j=h[this.o.language].monthsTitle||h.en.monthsTitle||"Months",N=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?j:s).end().find("tbody span").removeClass("active");if(e.each(this.dates,function(e,t){t.getUTCFullYear()===s&&N.eq(t.getUTCMonth()).addClass("active")}),(s<u||s>d)&&N.addClass("disabled"),s===u&&N.slice(0,c).addClass("disabled"),s===d&&N.slice(f+1).addClass("disabled"),this.o.beforeShowMonth!==e.noop){var F=this;e.each(N,function(n,r){var i=new Date(s,n,1),o=F.o.beforeShowMonth(i);o===t?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),!1!==o.enabled||e(r).hasClass("disabled")||e(r).addClass("disabled"),o.classes&&e(r).addClass(o.classes),o.tooltip&&e(r).prop("title",o.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,s,u,d,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,s,u,d,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,s,u,d,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var e,t,n=new Date(this.viewDate),r=n.getUTCFullYear(),i=n.getUTCMonth(),o=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,a=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,s=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,u=1;switch(this.viewMode){case 4:u*=10;case 3:u*=10;case 2:u*=10;case 1:e=Math.floor(r/u)*u<=o,t=Math.floor(r/u)*u+u>s;break;case 0:e=r<=o&&i<=a,t=r>=s&&i>=l}this.picker.find(".prev").toggleClass("disabled",e),this.picker.find(".next").toggleClass("disabled",t)}},click:function(t){var i,o,a;t.preventDefault(),t.stopPropagation(),(i=e(t.target)).hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),i.hasClass("today")&&!i.hasClass("day")&&(this.setViewMode(0),this._setDate(r(),"linked"===this.o.todayBtn?null:"view")),i.hasClass("clear")&&this.clearDates(),i.hasClass("disabled")||(i.hasClass("month")||i.hasClass("year")||i.hasClass("decade")||i.hasClass("century"))&&(this.viewDate.setUTCDate(1),1===this.viewMode?(a=i.parent().find("span").index(i),o=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(a)):(a=0,o=Number(i.text()),this.viewDate.setUTCFullYear(o)),this._trigger(g.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(n(o,a,1)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(t){var n=e(t.currentTarget).data("date"),r=new Date(n);this.o.updateViewDate&&(r.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),r.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(r)},navArrowsClick:function(t){var n=e(t.currentTarget).hasClass("prev")?-1:1;0!==this.viewMode&&(n*=12*g.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,n),this._trigger(g.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(e){var t=this.dates.contains(e);if(e||this.dates.clear(),-1!==t?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(t):!1===this.o.multidate?(this.dates.clear(),this.dates.push(e)):this.dates.push(e),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(e,t){t&&"date"!==t||this._toggle_multidate(e&&new Date(e)),(!t&&this.o.updateViewDate||"view"===t)&&(this.viewDate=e&&new Date(e)),this.fill(),this.setValue(),t&&"view"===t||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||t&&"date"!==t||this.hide()},moveDay:function(e,t){var n=new Date(e);return n.setUTCDate(e.getUTCDate()+t),n},moveWeek:function(e,t){return this.moveDay(e,7*t)},moveMonth:function(e,t){if(!(n=e)||isNaN(n.getTime()))return this.o.defaultViewDate;var n;if(!t)return e;var r,i,o=new Date(e.valueOf()),a=o.getUTCDate(),s=o.getUTCMonth(),l=Math.abs(t);if(t=t>0?1:-1,1===l)i=-1===t?function(){return o.getUTCMonth()===s}:function(){return o.getUTCMonth()!==r},r=s+t,o.setUTCMonth(r),r=(r+12)%12;else{for(var u=0;u<l;u++)o=this.moveMonth(o,t);r=o.getUTCMonth(),o.setUTCDate(a),i=function(){return r!==o.getUTCMonth()}}for(;i();)o.setUTCDate(--a),o.setUTCMonth(r);return o},moveYear:function(e,t){return this.moveMonth(e,12*t)},moveAvailableDate:function(e,t,n){do{if(e=this[n](e,t),!this.dateWithinRange(e))return!1;n="moveDay"}while(this.dateIsDisabled(e));return e},weekOfDateIsDisabled:function(t){return-1!==e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(t){return this.weekOfDateIsDisabled(t)||e.grep(this.o.datesDisabled,function(e){return i(t,e)}).length>0},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":visible")){var t,n,r=!1,i=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault(),e.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;t=37===e.keyCode||38===e.keyCode?-1:1,0===this.viewMode?e.ctrlKey?(n=this.moveAvailableDate(i,t,"moveYear"))&&this._trigger("changeYear",this.viewDate):e.shiftKey?(n=this.moveAvailableDate(i,t,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===e.keyCode||39===e.keyCode?n=this.moveAvailableDate(i,t,"moveDay"):this.weekOfDateIsDisabled(i)||(n=this.moveAvailableDate(i,t,"moveWeek")):1===this.viewMode?(38!==e.keyCode&&40!==e.keyCode||(t*=4),n=this.moveAvailableDate(i,t,"moveMonth")):2===this.viewMode&&(38!==e.keyCode&&40!==e.keyCode||(t*=4),n=this.moveAvailableDate(i,t,"moveYear")),n&&(this.focusDate=this.viewDate=n,this.setValue(),this.fill(),e.preventDefault());break;case 13:if(!this.o.forceParse)break;i=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(i),r=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),e.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}r&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))}else 40!==e.keyCode&&27!==e.keyCode||(this.show(),e.stopPropagation())},setViewMode:function(e){this.viewMode=e,this.picker.children("div").hide().filter(".datepicker-"+g.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var u=function(t,n){e.data(t,"datepicker",this),this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,this.keepEmptyValues=n.keepEmptyValues,delete n.keepEmptyValues,d.call(e(this.inputs),n).on("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e.data(t,"datepicker")}),this.updateDates()};u.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},clearDates:function(){e.each(this.pickers,function(e,t){t.clearDates()})},dateUpdated:function(n){if(!this.updating){this.updating=!0;var r=e.data(n.target,"datepicker");if(r!==t){var i=r.getUTCDate(),o=this.keepEmptyValues,a=e.inArray(n.target,this.inputs),s=a-1,l=a+1,u=this.inputs.length;if(-1!==a){if(e.each(this.pickers,function(e,t){t.getUTCDate()||t!==r&&o||t.setUTCDate(i)}),i<this.dates[s])for(;s>=0&&i<this.dates[s]&&(this.pickers[s].element.val()||"").length>0;)this.pickers[s--].setUTCDate(i);else if(i>this.dates[l])for(;l<u&&i>this.dates[l]&&(this.pickers[l].element.val()||"").length>0;)this.pickers[l++].setUTCDate(i);this.updateDates(),delete this.updating}}}},destroy:function(){e.map(this.pickers,function(e){e.destroy()}),e(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var c=e.fn.datepicker,d=function(n){var r,i=Array.apply(null,arguments);if(i.shift(),this.each(function(){var t=e(this),o=t.data("datepicker"),a="object"==typeof n&&n;if(!o){var s=function(t,n){var r=e(t).data(),i={},o=new RegExp("^"+n.toLowerCase()+"([A-Z])");function a(e,t){return t.toLowerCase()}for(var s in n=new RegExp("^"+n.toLowerCase()),r)n.test(s)&&(i[s.replace(o,a)]=r[s]);return i}(this,"date"),c=function(t){var n={};if(h[t]||(t=t.split("-")[0],h[t])){var r=h[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}}(e.extend({},f,s,a).language),d=e.extend({},f,c,s,a);t.hasClass("input-daterange")||d.inputs?(e.extend(d,{inputs:d.inputs||t.find("input").toArray()}),o=new u(this,d)):o=new l(this,d),t.data("datepicker",o)}"string"==typeof n&&"function"==typeof o[n]&&(r=o[n].apply(o,i))}),r===t||r instanceof l||r instanceof u)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+n+" function)");return r};e.fn.datepicker=d;var f=e.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:e.noop,beforeShowMonth:e.noop,beforeShowYear:e.noop,beforeShowDecade:e.noop,beforeShowCentury:e.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",isInline:null,keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&#x00AB;",rightArrow:"&#x00BB;"},showWeekDays:!0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=l;var h=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},g={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(e){if("function"==typeof e.toValue&&"function"==typeof e.toDisplay)return e;var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||0===n.length)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(n,i,o,a){if(!n)return t;if(n instanceof Date)return n;if("string"==typeof i&&(i=g.parseFormat(i)),i.toValue)return i.toValue(n,i,o);var s,u,c,d,f,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},m={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(n in m&&(n=m[n]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(n)){for(s=n.match(/([\-+]\d+)([dmwy])/gi),n=new Date,d=0;d<s.length;d++)u=s[d].match(/([\-+]\d+)([dmwy])/i),c=Number(u[1]),f=p[u[2].toLowerCase()],n=l.prototype[f](n,c);return l.prototype._zero_utc_time(n)}s=n&&n.match(this.nonpunctuation)||[];var v,y,_={},b=["yyyy","yy","M","MM","m","mm","d","dd"],w={yyyy:function(e,t){return e.setUTCFullYear(a?(!0===(r=a)&&(r=10),(n=t)<100&&(n+=2e3)>(new Date).getFullYear()+r&&(n-=100),n):t);var n,r},m:function(e,t){if(isNaN(e))return e;for(t-=1;t<0;)t+=12;for(t%=12,e.setUTCMonth(t);e.getUTCMonth()!==t;)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}};w.yy=w.yyyy,w.M=w.MM=w.mm=w.m,w.dd=w.d,n=r();var x=i.parts.slice();function k(){var e=this.slice(0,s[d].length),t=s[d].slice(0,e.length);return e.toLowerCase()===t.toLowerCase()}if(s.length!==x.length&&(x=e(x).filter(function(t,n){return-1!==e.inArray(n,b)}).toArray()),s.length===x.length){var C,D,S;for(d=0,C=x.length;d<C;d++){if(v=parseInt(s[d],10),u=x[d],isNaN(v))switch(u){case"MM":y=e(h[o].months).filter(k),v=e.inArray(y[0],h[o].months)+1;break;case"M":y=e(h[o].monthsShort).filter(k),v=e.inArray(y[0],h[o].monthsShort)+1}_[u]=v}for(d=0;d<b.length;d++)(S=b[d])in _&&!isNaN(_[S])&&(D=new Date(n),w[S](D,_[S]),isNaN(D)||(n=D))}return n},formatDate:function(t,n,r){if(!t)return"";if("string"==typeof n&&(n=g.parseFormat(n)),n.toDisplay)return n.toDisplay(t,n,r);var i={d:t.getUTCDate(),D:h[r].daysShort[t.getUTCDay()],DD:h[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:h[r].monthsShort[t.getUTCMonth()],MM:h[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,t=[];for(var o=e.extend([],n.separators),a=0,s=n.parts.length;a<=s;a++)o.length&&t.push(o.shift()),t.push(i[n.parts[a]]);return t.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+f.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+f.templates.rightArrow+"</th></tr></thead>",contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};g.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+g.headTemplate+"<tbody></tbody>"+g.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+"</table></div></div>",e.fn.datepicker.DPGlobal=g,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e.fn.datepicker.version="1.10.1",e.fn.datepicker.deprecated=function(e){var t=window.console;t&&t.warn&&t.warn("DEPRECATED: "+e)},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);n.data("datepicker")||(t.preventDefault(),d.call(n,"show"))}),e(function(){d.call(e('[data-provide="datepicker-inline"]'))})},void 0===(o=r.apply(t,i))||(e.exports=o)},7915:function(e,t,n){n(8294),n(1309),n(3929),n(4050),n(63),n(9737),n(8852),n(6278),n(6927),n(3497),n(7814),n(5377)},5377:function(e,t,n){!function(e){"use strict";var t=function(n,r){this.options=e.extend({},t.DEFAULTS,r);var i=this.options.target===t.DEFAULTS.target?e(this.options.target):e(document).find(this.options.target);this.$target=i.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 r=e(this),i=r.data("bs.affix"),o="object"==typeof n&&n;i||r.data("bs.affix",i=new t(this,o)),"string"==typeof n&&i[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,r){var i=this.$target.scrollTop(),o=this.$element.offset(),a=this.$target.height();if(null!=n&&"top"==this.affixed)return i<n&&"top";if("bottom"==this.affixed)return null!=n?!(i+this.unpin<=o.top)&&"bottom":!(i+a<=e-r)&&"bottom";var s=null==this.affixed,l=s?i:o.top;return null!=n&&i<=n?"top":null!=r&&l+(s?a:t)>=e-r&&"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(),r=this.options.offset,i=r.top,o=r.bottom,a=Math.max(e(document).height(),e(document.body).height());"object"!=typeof r&&(o=i=r),"function"==typeof i&&(i=r.top(this.$element)),"function"==typeof o&&(o=r.bottom(this.$element));var s=this.getState(a,n,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var l="affix"+(s?"-"+s:""),u=e.Event(l+".bs.affix");if(this.$element.trigger(u),u.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:a-n-o})}};var r=e.fn.affix;e.fn.affix=n,e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=r,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),r=t.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(t,r)})})}(n(9983))},1309:function(e,t,n){!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 r=e(this),i=r.attr("data-target");i||(i=(i=r.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=e(document).find(i);function a(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=r.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",a).emulateTransitionEnd(n.TRANSITION_DURATION):a())};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),"string"==typeof t&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(n(9983))},3929:function(e,t,n){!function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.isLoading=!1};function n(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),o="object"==typeof n&&n;i||r.data("bs.button",i=new t(this,o)),"toggle"==n?i.toggle():n&&i.setState(n)})}t.VERSION="3.4.1",t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(t){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",o=r.data();t+="Text",null==o.resetText&&r.data("resetText",r[i]()),setTimeout(e.proxy(function(){r[i](null==o[t]?this.options[t]:o[t]),"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,r.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 r=e.fn.button;e.fn.button=n,e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=e(t.target).closest(".btn");n.call(r,"toggle"),e(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.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))})}(n(9983))},4050:function(e,t,n){!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 r=e(this),i=r.data("bs.carousel"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n),a="string"==typeof n?n:o.slide;i||r.data("bs.carousel",i=new t(this,o)),"number"==typeof n?i.to(n):a?i[a]():o.interval&&i.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 r=(n+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(r)},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,r){var i=this.$element.find(".item.active"),o=r||this.getItemForDirection(n,i),a=this.interval,s="next"==n?"left":"right",l=this;if(o.hasClass("active"))return this.sliding=!1;var u=o[0],c=e.Event("slide.bs.carousel",{relatedTarget:u,direction:s});if(this.$element.trigger(c),!c.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=e(this.$indicators.children()[this.getItemIndex(o)]);d&&d.addClass("active")}var f=e.Event("slid.bs.carousel",{relatedTarget:u,direction:s});return e.support.transition&&this.$element.hasClass("slide")?(o.addClass(n),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([n,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(f)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(f)),a&&this.cycle(),this}};var r=e.fn.carousel;e.fn.carousel=n,e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=r,this};var i=function(t){var r=e(this),i=r.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=r.attr("data-target")||i,a=e(document).find(o);if(a.hasClass("carousel")){var s=e.extend({},a.data(),r.data()),l=r.attr("data-slide-to");l&&(s.interval=!1),n.call(a,s),l&&a.data("bs.carousel").to(l),t.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",i).on("click.bs.carousel.data-api","[data-slide-to]",i),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var t=e(this);n.call(t,t.data())})})}(n(9983))},63:function(e,t,n){!function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),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,r=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(document).find(r)}function r(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n);!i&&o.toggle&&/show|hide/.test(n)&&(o.toggle=!1),i||r.data("bs.collapse",i=new t(this,o)),"string"==typeof n&&i[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,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(n=i.data("bs.collapse"))&&n.transitioning)){var o=e.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){i&&i.length&&(r.call(i,"hide"),n||i.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var l=e.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",e.proxy(s,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[a](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 r=this.dimension();this.$element[r](this.$element[r]())[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 i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return i.call(this);this.$element[r](0).one("bsTransitionEnd",e.proxy(i,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,r){var i=e(r);this.addAriaAndCollapsedClass(n(i),i)},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 i=e.fn.collapse;e.fn.collapse=r,e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=i,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var i=e(this);i.attr("data-target")||t.preventDefault();var o=n(i),a=o.data("bs.collapse")?"toggle":i.data();r.call(o,a)})}(n(9983))},9737:function(e,t,n){!function(e){"use strict";var t='[data-toggle="dropdown"]',n=function(t){e(t).on("click.bs.dropdown",this.toggle)};function r(t){var n=t.attr("data-target");n||(n=(n=t.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?e(document).find(n):null;return r&&r.length?r:t.parent()}function i(n){n&&3===n.which||(e(".dropdown-backdrop").remove(),e(t).each(function(){var t=e(this),i=r(t),o={relatedTarget:this};i.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(i[0],n.target)||(i.trigger(n=e.Event("hide.bs.dropdown",o)),n.isDefaultPrevented()||(t.attr("aria-expanded","false"),i.removeClass("open").trigger(e.Event("hidden.bs.dropdown",o)))))}))}n.VERSION="3.4.1",n.prototype.toggle=function(t){var n=e(this);if(!n.is(".disabled, :disabled")){var o=r(n),a=o.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",i);var s={relatedTarget:this};if(o.trigger(t=e.Event("show.bs.dropdown",s)),t.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(e.Event("shown.bs.dropdown",s))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var i=e(this);if(n.preventDefault(),n.stopPropagation(),!i.is(".disabled, :disabled")){var o=r(i),a=o.hasClass("open");if(!a&&27!=n.which||a&&27==n.which)return 27==n.which&&o.find(t).trigger("focus"),i.trigger("click");var s=o.find(".dropdown-menu li:not(.disabled):visible a");if(s.length){var l=s.index(n.target);38==n.which&&l>0&&l--,40==n.which&&l<s.length-1&&l++,~l||(l=0),s.eq(l).trigger("focus")}}}};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("bs.dropdown");i||r.data("bs.dropdown",i=new n(this)),"string"==typeof t&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",t,n.prototype.toggle).on("keydown.bs.dropdown.data-api",t,n.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",n.prototype.keydown)}(n(9983))},8852:function(e,t,n){!function(e){"use strict";var t=function(t,n){this.options=n,this.$body=e(document.body),this.$element=e(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function n(n,r){return this.each(function(){var i=e(this),o=i.data("bs.modal"),a=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n);o||i.data("bs.modal",o=new t(this,a)),"string"==typeof n?o[n](r):a.show&&o.show(r)})}t.VERSION="3.4.1",t.TRANSITION_DURATION=300,t.BACKDROP_TRANSITION_DURATION=150,t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},t.prototype.show=function(n){var r=this,i=e.Event("show.bs.modal",{relatedTarget:n});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var i=e.support.transition&&r.$element.hasClass("fade");r.$element.parent().length||r.$element.appendTo(r.$body),r.$element.show().scrollTop(0),r.adjustDialog(),i&&r.$element[0].offsetWidth,r.$element.addClass("in"),r.enforceFocus();var o=e.Event("shown.bs.modal",{relatedTarget:n});i?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(o)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(o)}))},t.prototype.hide=function(n){n&&n.preventDefault(),n=e.Event("hide.bs.modal"),this.$element.trigger(n),this.isShown&&!n.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){document===e.target||this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},t.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(n){var r=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=e.support.transition&&i;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!n)return;o?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):n()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){r.removeBackdrop(),n&&n()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):a()}else n&&n()},t.prototype.handleUpdate=function(){this.adjustDialog()},t.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},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<e,this.scrollbarWidth=this.measureScrollbar()},t.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),e(this.fixedContent).each(function(t,r){var i=r.style.paddingRight,o=e(r).css("padding-right");e(r).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),e(this.fixedContent).each(function(t,n){var r=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=r||""})},t.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var r=e.fn.modal;e.fn.modal=n,e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=r,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=e(this),i=r.attr("href"),o=r.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),a=e(document).find(o),s=a.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},a.data(),r.data());r.is("a")&&t.preventDefault(),a.one("show.bs.modal",function(e){e.isDefaultPrevented()||a.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})}),n.call(a,s,this)})}(n(9983))},6927:function(e,t,n){!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:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),(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 r=typeof n;this.options.sanitize&&(t=this.sanitizeHtml(t),"string"===r&&(n=this.sanitizeHtml(n))),e.find(".popover-title").html(t),e.find(".popover-content").children().detach().end()["string"===r?"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 r=e(this),i=r.data("bs.popover"),o="object"==typeof n&&n;!i&&/destroy|hide/.test(n)||(i||r.data("bs.popover",i=new t(this,o)),"string"==typeof n&&i[n]())})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(n(9983))},3497:function(e,t,n){!function(e){"use strict";function t(n,r){this.$body=e(document.body),this.$scrollElement=e(n).is(document.body)?e(window):e(n),this.options=e.extend({},t.DEFAULTS,r),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 r=e(this),i=r.data("bs.scrollspy"),o="object"==typeof n&&n;i||r.data("bs.scrollspy",i=new t(this,o)),"string"==typeof n&&i[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",r=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",r=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=e(this),i=t.data("target")||t.attr("href"),o=/^#./.test(i)&&e(i);return o&&o.length&&o.is(":visible")&&[[o[n]().top+r,i]]||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(),r=this.options.offset+n-this.$scrollElement.height(),i=this.offsets,o=this.targets,a=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=r)return a!=(e=o[o.length-1])&&this.activate(e);if(a&&t<i[0])return this.activeTarget=null,this.clear();for(e=i.length;e--;)a!=o[e]&&t>=i[e]&&(void 0===i[e+1]||t<i[e+1])&&this.activate(o[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',r=e(n).parents("li").addClass("active");r.parent(".dropdown-menu").length&&(r=r.closest("li.dropdown").addClass("active")),r.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=e.fn.scrollspy;e.fn.scrollspy=n,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=r,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);n.call(t,t.data())})})}(n(9983))},7814:function(e,t,n){!function(e){"use strict";var t=function(t){this.element=e(t)};function n(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),"string"==typeof n&&i[n]()})}t.VERSION="3.4.1",t.TRANSITION_DURATION=150,t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.data("target");if(r||(r=(r=t.attr("href"))&&r.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var i=n.find(".active:last a"),o=e.Event("hide.bs.tab",{relatedTarget:t[0]}),a=e.Event("show.bs.tab",{relatedTarget:i[0]});if(i.trigger(o),t.trigger(a),!a.isDefaultPrevented()&&!o.isDefaultPrevented()){var s=e(document).find(r);this.activate(t.closest("li"),n),this.activate(s,s.parent(),function(){i.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:i[0]})})}}},t.prototype.activate=function(n,r,i){var o=r.find("> .active"),a=i&&e.support.transition&&(o.length&&o.hasClass("fade")||!!r.find("> .fade").length);function s(){o.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),a?(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),i&&i()}o.length&&a?o.one("bsTransitionEnd",s).emulateTransitionEnd(t.TRANSITION_DURATION):s(),o.removeClass("in")};var r=e.fn.tab;e.fn.tab=n,e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(t){t.preventDefault(),n.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(n(9983))},6278:function(e,t,n){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,i=/^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 o(t,o){var a=t.nodeName.toLowerCase();if(-1!==e.inArray(a,o))return-1===e.inArray(a,n)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(i));for(var s=e(o).filter(function(e,t){return t instanceof RegExp}),l=0,u=s.length;l<u;l++)if(a.match(s[l]))return!0;return!1}function a(t,n,r){if(0===t.length)return t;if(r&&"function"==typeof r)return r(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var i=document.implementation.createHTMLDocument("sanitization");i.body.innerHTML=t;for(var a=e.map(n,function(e,t){return t}),s=e(i.body).find("*"),l=0,u=s.length;l<u;l++){var c=s[l],d=c.nodeName.toLowerCase();if(-1!==e.inArray(d,a))for(var f=e.map(c.attributes,function(e){return e}),p=[].concat(n["*"]||[],n[d]||[]),h=0,g=f.length;h<g;h++)o(f[h],p)||c.removeAttribute(f[h].nodeName);else c.parentNode.removeChild(c)}return i.body.innerHTML}var s=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};s.VERSION="3.4.1",s.TRANSITION_DURATION=150,s.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^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.prototype.init=function(t,n,r){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r),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 i=this.options.trigger.split(" "),o=i.length;o--;){var a=i[o];if("click"==a)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=a){var s="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(s+"."+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()},s.prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.getOptions=function(n){var r=this.$element.data();for(var i in r)r.hasOwnProperty(i)&&-1!==e.inArray(i,t)&&delete r[i];return(n=e.extend({},this.getDefaults(),r,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},s.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},s.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)}},s.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},s.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)}},s.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 r=this,i=this.tip(),o=this.getUID(this.type);this.setContent(),i.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&i.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,u=l.test(a);u&&(a=a.replace(l,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?i.appendTo(e(document).find(this.options.container)):i.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var c=this.getPosition(),d=i[0].offsetWidth,f=i[0].offsetHeight;if(u){var p=a,h=this.getPosition(this.$viewport);a="bottom"==a&&c.bottom+f>h.bottom?"top":"top"==a&&c.top-f<h.top?"bottom":"right"==a&&c.right+d>h.width?"left":"left"==a&&c.left-d<h.left?"right":a,i.removeClass(p).addClass(a)}var g=this.getCalculatedOffset(a,c,d,f);this.applyPlacement(g,a);var m=function(){var e=r.hoverState;r.$element.trigger("shown.bs."+r.type),r.hoverState=null,"out"==e&&r.leave(r)};e.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",m).emulateTransitionEnd(s.TRANSITION_DURATION):m()}},s.prototype.applyPlacement=function(t,n){var r=this.tip(),i=r[0].offsetWidth,o=r[0].offsetHeight,a=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(s)&&(s=0),t.top+=a,t.left+=s,e.offset.setOffset(r[0],e.extend({using:function(e){r.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),r.addClass("in");var l=r[0].offsetWidth,u=r[0].offsetHeight;"top"==n&&u!=o&&(t.top=t.top+o-u);var c=this.getViewportAdjustedDelta(n,t,l,u);c.left?t.left+=c.left:t.top+=c.top;var d=/top|bottom/.test(n),f=d?2*c.left-i+l:2*c.top-o+u,p=d?"offsetWidth":"offsetHeight";r.offset(t),this.replaceArrow(f,r[0][p],d)},s.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},s.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();this.options.html?(this.options.sanitize&&(t=a(t,this.options.whiteList,this.options.sanitizeFn)),e.find(".tooltip-inner").html(t)):e.find(".tooltip-inner").text(t),e.removeClass("fade in top bottom left right")},s.prototype.hide=function(t){var n=this,r=e(this.$tip),i=e.Event("hide.bs."+this.type);function o(){"in"!=n.hoverState&&r.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),t&&t()}if(this.$element.trigger(i),!i.isDefaultPrevented())return r.removeClass("in"),e.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",o).emulateTransitionEnd(s.TRANSITION_DURATION):o(),this.hoverState=null,this},s.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},s.prototype.hasContent=function(){return this.getTitle()},s.prototype.getPosition=function(t){var n=(t=t||this.$element)[0],r="BODY"==n.tagName,i=n.getBoundingClientRect();null==i.width&&(i=e.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var o=window.SVGElement&&n instanceof window.SVGElement,a=r?{top:0,left:0}:o?null:t.offset(),s={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},l=r?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},i,s,l,a)},s.prototype.getCalculatedOffset=function(e,t,n,r){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-r,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},s.prototype.getViewportAdjustedDelta=function(e,t,n,r){var i={top:0,left:0};if(!this.$viewport)return i;var o=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(e)){var s=t.top-o-a.scroll,l=t.top+o-a.scroll+r;s<a.top?i.top=a.top-s:l>a.top+a.height&&(i.top=a.top+a.height-l)}else{var u=t.left-o,c=t.left+o+n;u<a.left?i.left=a.left-u:c>a.right&&(i.left=a.left+a.width-c)}return i},s.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)},s.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},s.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},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},s.prototype.enable=function(){this.enabled=!0},s.prototype.disable=function(){this.enabled=!1},s.prototype.toggleEnabled=function(){this.enabled=!this.enabled},s.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)},s.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})},s.prototype.sanitizeHtml=function(e){return a(e,this.options.whiteList,this.options.sanitizeFn)};var l=e.fn.tooltip;e.fn.tooltip=function(t){return this.each(function(){var n=e(this),r=n.data("bs.tooltip"),i="object"==typeof t&&t;!r&&/destroy|hide/.test(t)||(r||n.data("bs.tooltip",r=new s(this,i)),"string"==typeof t&&r[t]())})},e.fn.tooltip.Constructor=s,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=l,this}}(n(9983))},8294:function(e,t,n){!function(e){"use strict";e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;return e(this).one("bsTransitionEnd",function(){n=!0}),setTimeout(function(){n||e(r).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)}})})}(n(9983))},5078:function(e,t,n){var r,i;!function(){var o={version:"3.5.17"},a=[].slice,s=function(e){return a.call(e)},l=this.document;function u(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(e){s=function(e){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var d=this.Element.prototype,f=d.setAttribute,p=d.setAttributeNS,h=this.CSSStyleDeclaration.prototype,g=h.setProperty;d.setAttribute=function(e,t){f.call(this,e,t+"")},d.setAttributeNS=function(e,t,n){p.call(this,e,t,n+"")},h.setProperty=function(e,t,n){g.call(this,e,t+"",n)}}function m(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function v(e){return null===e?NaN:+e}function y(e){return!isNaN(e)}function _(e){return{left:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}o.ascending=m,o.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},o.min=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&n>r&&(n=r)}return n},o.max=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&r>n&&(n=r)}return n},o.extent=function(e,t){var n,r,i,o=-1,a=e.length;if(1===arguments.length){for(;++o<a;)if(null!=(r=e[o])&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=e[o])&&(n>r&&(n=r),i<r&&(i=r))}else{for(;++o<a;)if(null!=(r=t.call(e,e[o],o))&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=t.call(e,e[o],o))&&(n>r&&(n=r),i<r&&(i=r))}return[n,i]},o.sum=function(e,t){var n,r=0,i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)y(n=+e[o])&&(r+=n);else for(;++o<i;)y(n=+t.call(e,e[o],o))&&(r+=n);return r},o.mean=function(e,t){var n,r=0,i=e.length,o=-1,a=i;if(1===arguments.length)for(;++o<i;)y(n=v(e[o]))?r+=n:--a;else for(;++o<i;)y(n=v(t.call(e,e[o],o)))?r+=n:--a;if(a)return r/a},o.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],o=n-r;return o?i+o*(e[r]-i):i},o.median=function(e,t){var n,r=[],i=e.length,a=-1;if(1===arguments.length)for(;++a<i;)y(n=v(e[a]))&&r.push(n);else for(;++a<i;)y(n=v(t.call(e,e[a],a)))&&r.push(n);if(r.length)return o.quantile(r.sort(m),.5)},o.variance=function(e,t){var n,r,i=e.length,o=0,a=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)y(n=v(e[s]))&&(a+=(r=n-o)*(n-(o+=r/++l)));else for(;++s<i;)y(n=v(t.call(e,e[s],s)))&&(a+=(r=n-o)*(n-(o+=r/++l)));if(l>1)return a/(l-1)},o.deviation=function(){var e=o.variance.apply(this,arguments);return e?Math.sqrt(e):e};var b=_(m);function w(e){return e.length}o.bisectLeft=b.left,o.bisect=o.bisectRight=b.right,o.bisector=function(e){return _(1===e.length?function(t,n){return m(e(t),n)}:e)},o.shuffle=function(e,t,n){(o=arguments.length)<3&&(n=e.length,o<2&&(t=0));for(var r,i,o=n-t;o;)i=Math.random()*o--|0,r=e[o+t],e[o+t]=e[i+t],e[i+t]=r;return e},o.permute=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},o.pairs=function(e){for(var t=0,n=e.length-1,r=e[0],i=new Array(n<0?0:n);t<n;)i[t]=[r,r=e[++t]];return i},o.transpose=function(e){if(!(i=e.length))return[];for(var t=-1,n=o.min(e,w),r=new Array(n);++t<n;)for(var i,a=-1,s=r[t]=new Array(i);++a<i;)s[a]=e[a][t];return r},o.zip=function(){return o.transpose(arguments)},o.keys=function(e){var t=[];for(var n in e)t.push(n);return t},o.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},o.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},o.merge=function(e){for(var t,n,r,i=e.length,o=-1,a=0;++o<i;)a+=e[o].length;for(n=new Array(a);--i>=0;)for(t=(r=e[i]).length;--t>=0;)n[--a]=r[t];return n};var x=Math.abs;function k(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function C(){this._=Object.create(null)}function D(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function S(e){return"\0"===(e+="")[0]?e.slice(1):e}function A(e){return D(e)in this._}function E(e){return(e=D(e))in this._&&delete this._[e]}function M(){var e=[];for(var t in this._)e.push(S(t));return e}function T(){var e=0;for(var t in this._)++e;return e}function j(){for(var e in this._)return!1;return!0}function N(){this._=Object.create(null)}function F(e){return e}function O(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function I(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=z.length;n<r;++n){var i=z[n]+t;if(i in e)return i}}o.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n===1/0)throw new Error("infinite range");var r,i=[],o=function(e){for(var t=1;e*t%1;)t*=10;return t}(x(n)),a=-1;if(e*=o,t*=o,(n*=o)<0)for(;(r=e+n*++a)>t;)i.push(r/o);else for(;(r=e+n*++a)<t;)i.push(r/o);return i},o.map=function(e,t){var n=new C;if(e instanceof C)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(1===arguments.length)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t.call(e,r=e[i],i),r)}else for(var a in e)n.set(a,e[a]);return n},k(C,{has:A,get:function(e){return this._[D(e)]},set:function(e,t){return this._[D(e)]=t},remove:E,keys:M,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:S(t),value:this._[t]});return e},size:T,empty:j,forEach:function(e){for(var t in this._)e.call(this,S(t),this._[t])}}),o.nest=function(){var e,t,n={},r=[],i=[];function a(i,o,s){if(s>=r.length)return t?t.call(n,o):e?o.sort(e):o;for(var l,u,c,d,f=-1,p=o.length,h=r[s++],g=new C;++f<p;)(d=g.get(l=h(u=o[f])))?d.push(u):g.set(l,[u]);return i?(u=i(),c=function(e,t){u.set(e,a(i,t,s))}):(u={},c=function(e,t){u[e]=a(i,t,s)}),g.forEach(c),u}function s(e,t){if(t>=r.length)return e;var n=[],o=i[t++];return e.forEach(function(e,r){n.push({key:e,values:s(r,t)})}),o?n.sort(function(e,t){return o(e.key,t.key)}):n}return n.map=function(e,t){return a(t,e,0)},n.entries=function(e){return s(a(o.map,e,0),0)},n.key=function(e){return r.push(e),n},n.sortKeys=function(e){return i[r.length-1]=e,n},n.sortValues=function(t){return e=t,n},n.rollup=function(e){return t=e,n},n},o.set=function(e){var t=new N;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},k(N,{has:A,add:function(e){return this._[D(e+="")]=!0,e},remove:E,values:M,size:T,empty:j,forEach:function(e){for(var t in this._)e.call(this,S(t))}}),o.behavior={},o.rebind=function(e,t){for(var n,r=1,i=arguments.length;++r<i;)e[n=arguments[r]]=O(e,t,t[n]);return e};var z=["webkit","ms","moz","Moz","o","O"];function $(){}function q(){}function R(e){var t=[],n=new C;function r(){for(var n,r=t,i=-1,o=r.length;++i<o;)(n=r[i].on)&&n.apply(this,arguments);return e}return r.on=function(r,i){var o,a=n.get(r);return arguments.length<2?a&&a.on:(a&&(a.on=null,t=t.slice(0,o=t.indexOf(a)).concat(t.slice(o+1)),n.remove(r)),i&&t.push(n.set(r,{on:i})),e)},r}function P(){o.event.preventDefault()}function L(){for(var e,t=o.event;e=t.sourceEvent;)t=e;return t}function B(e){for(var t=new q,n=0,r=arguments.length;++n<r;)t[arguments[n]]=R(t);return t.of=function(n,r){return function(i){try{var a=i.sourceEvent=o.event;i.target=e,o.event=i,t[i.type].apply(n,r)}finally{o.event=a}}},t}o.dispatch=function(){for(var e=new q,t=-1,n=arguments.length;++t<n;)e[arguments[t]]=R(e);return e},q.prototype.on=function(e,t){var n=e.indexOf("."),r="";if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},o.event=null,o.requote=function(e){return e.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]};function H(e){return V(e,Q),e}var W=function(e,t){return t.querySelector(e)},G=function(e,t){return t.querySelectorAll(e)},Y=function(e,t){var n=e.matches||e[I(e,"matchesSelector")];return Y=function(e,t){return n.call(e,t)},Y(e,t)};"function"==typeof Sizzle&&(W=function(e,t){return Sizzle(e,t)[0]||null},G=Sizzle,Y=Sizzle.matchesSelector),o.selection=function(){return o.select(l.documentElement)};var Q=o.selection.prototype=[];function K(e){return"function"==typeof e?e:function(){return W(e,this)}}function Z(e){return"function"==typeof e?e:function(){return G(e,this)}}Q.select=function(e){var t,n,r,i,o=[];e=K(e);for(var a=-1,s=this.length;++a<s;){o.push(t=[]),t.parentNode=(r=this[a]).parentNode;for(var l=-1,u=r.length;++l<u;)(i=r[l])?(t.push(n=e.call(i,i.__data__,l,a)),n&&"__data__"in i&&(n.__data__=i.__data__)):t.push(null)}return H(o)},Q.selectAll=function(e){var t,n,r=[];e=Z(e);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],l=-1,u=a.length;++l<u;)(n=a[l])&&(r.push(t=s(e.call(n,n.__data__,l,i))),t.parentNode=n);return H(r)};var X="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:X,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(e,t){return e=o.ns.qualify(e),null==t?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof t?e.local?function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}:function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}:e.local?function(){this.setAttributeNS(e.space,e.local,t)}:function(){this.setAttribute(e,t)}}function te(e){return e.trim().replace(/\s+/g," ")}function ne(e){return new RegExp("(?:^|\\s+)"+o.requote(e)+"(?:\\s+|$)","g")}function re(e){return(e+"").trim().split(/^|\s+/)}function ie(e,t){var n=(e=re(e).map(oe)).length;return"function"==typeof t?function(){for(var r=-1,i=t.apply(this,arguments);++r<n;)e[r](this,i)}:function(){for(var r=-1;++r<n;)e[r](this,t)}}function oe(e){var t=ne(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||n.setAttribute("class",te(i+" "+e))):n.setAttribute("class",te(i.replace(t," ")))}}function ae(e,t,n){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}:function(){this.style.setProperty(e,t,n)}}function se(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}:function(){this[e]=t}}function le(e){return"function"==typeof e?e:(e=o.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,n=this.namespaceURI;return n===X&&t.documentElement.namespaceURI===X?t.createElement(e):t.createElementNS(n,e)}}function ue(){var e=this.parentNode;e&&e.removeChild(this)}function ce(e){return{__data__:e}}function de(e){return function(){return Y(this,e)}}function fe(e){return arguments.length||(e=m),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function pe(e,t){for(var n=0,r=e.length;n<r;n++)for(var i,o=e[n],a=0,s=o.length;a<s;a++)(i=o[a])&&t(i,a,n);return e}function he(e){return V(e,ge),e}o.ns={prefix:J,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),J.hasOwnProperty(n)?{space:J[n],local:e}:e}},Q.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=o.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(ee(t,e[t]));return this}return this.each(ee(e,t))},Q.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node(),r=(e=re(e)).length,i=-1;if(t=n.classList){for(;++i<r;)if(!t.contains(e[i]))return!1}else for(t=n.getAttribute("class");++i<r;)if(!ne(e[i]).test(t))return!1;return!0}for(t in e)this.each(ie(t,e[t]));return this}return this.each(ie(e,t))},Q.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.each(ae(n,e[n],t));return this}if(r<2){var i=this.node();return c(i).getComputedStyle(i,null).getPropertyValue(e)}n=""}return this.each(ae(e,t,n))},Q.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(se(t,e[t]));return this}return this.each(se(e,t))},Q.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},Q.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},Q.append=function(e){return e=le(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},Q.insert=function(e,t){return e=le(e),t=K(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},Q.remove=function(){return this.each(ue)},Q.data=function(e,t){var n,r,i=-1,o=this.length;if(!arguments.length){for(e=new Array(o=(n=this[0]).length);++i<o;)(r=n[i])&&(e[i]=r.__data__);return e}function a(e,n){var r,i,o,a=e.length,c=n.length,d=Math.min(a,c),f=new Array(c),p=new Array(c),h=new Array(a);if(t){var g,m=new C,v=new Array(a);for(r=-1;++r<a;)(i=e[r])&&(m.has(g=t.call(i,i.__data__,r))?h[r]=i:m.set(g,i),v[r]=g);for(r=-1;++r<c;)(i=m.get(g=t.call(n,o=n[r],r)))?!0!==i&&(f[r]=i,i.__data__=o):p[r]=ce(o),m.set(g,!0);for(r=-1;++r<a;)r in v&&!0!==m.get(v[r])&&(h[r]=e[r])}else{for(r=-1;++r<d;)i=e[r],o=n[r],i?(i.__data__=o,f[r]=i):p[r]=ce(o);for(;r<c;++r)p[r]=ce(n[r]);for(;r<a;++r)h[r]=e[r]}p.update=f,p.parentNode=f.parentNode=h.parentNode=e.parentNode,s.push(p),l.push(f),u.push(h)}var s=he([]),l=H([]),u=H([]);if("function"==typeof e)for(;++i<o;)a(n=this[i],e.call(n,n.parentNode.__data__,i));else for(;++i<o;)a(n=this[i],e);return l.enter=function(){return s},l.exit=function(){return u},l},Q.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},Q.filter=function(e){var t,n,r,i=[];"function"!=typeof e&&(e=de(e));for(var o=0,a=this.length;o<a;o++){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;s<l;s++)(r=n[s])&&e.call(r,r.__data__,s,o)&&t.push(r)}return H(i)},Q.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n,r=this[e],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},Q.sort=function(e){e=fe.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},Q.each=function(e){return pe(this,function(t,n,r){e.call(t,t.__data__,n,r)})},Q.call=function(e){var t=s(arguments);return e.apply(t[0]=this,t),this},Q.empty=function(){return!this.node()},Q.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var o=n[r];if(o)return o}return null},Q.size=function(){var e=0;return pe(this,function(){++e}),e};var ge=[];function me(e,t,n){var r="__on"+e,i=e.indexOf("."),a=ye;i>0&&(e=e.slice(0,i));var l=ve.get(e);function u(){var t=this[r];t&&(this.removeEventListener(e,t,t.$),delete this[r])}return l&&(e=l,a=_e),i?t?function(){var i=a(t,s(arguments));u.call(this),this.addEventListener(e,this[r]=i,i.$=n),i._=t}:u:t?$:function(){var t,n=new RegExp("^__on([^.]+)"+o.requote(e)+"$");for(var r in this)if(t=r.match(n)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}}o.selection.enter=he,o.selection.enter.prototype=ge,ge.append=Q.append,ge.empty=Q.empty,ge.node=Q.node,ge.call=Q.call,ge.size=Q.size,ge.select=function(e){for(var t,n,r,i,o,a=[],s=-1,l=this.length;++s<l;){r=(i=this[s]).update,a.push(t=[]),t.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(o=i[u])?(t.push(r[u]=n=e.call(i.parentNode,o.__data__,u,s)),n.__data__=o.__data__):t.push(null)}return H(a)},ge.insert=function(e,t){var n,r,i;return arguments.length<2&&(n=this,t=function(e,t,o){var a,s=n[o].update,l=s.length;for(o!=i&&(i=o,r=0),t>=r&&(r=t+1);!(a=s[r])&&++r<l;);return a}),Q.insert.call(this,e,t)},o.select=function(e){var t;return"string"==typeof e?(t=[W(e,l)]).parentNode=l.documentElement:(t=[e]).parentNode=u(e),H([t])},o.selectAll=function(e){var t;return"string"==typeof e?(t=s(G(e,l))).parentNode=l.documentElement:(t=s(e)).parentNode=null,H([t])},Q.on=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=!1),e)this.each(me(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(me(e,t,n))};var ve=o.map({mouseenter:"mouseover",mouseleave:"mouseout"});function ye(e,t){return function(n){var r=o.event;o.event=n,t[0]=this.__data__;try{e.apply(this,t)}finally{o.event=r}}}function _e(e,t){var n=ye(e,t);return function(e){var t=this,r=e.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||n.call(t,e)}}l&&ve.forEach(function(e){"on"+e in l&&ve.remove(e)});var be,we=0;function xe(e){var t=".dragsuppress-"+ ++we,n="click"+t,r=o.select(c(e)).on("touchmove"+t,P).on("dragstart"+t,P).on("selectstart"+t,P);if(null==be&&(be=!("onselectstart"in e)&&I(e.style,"userSelect")),be){var i=u(e).style,a=i[be];i[be]="none"}return function(e){if(r.on(t,null),be&&(i[be]=a),e){var o=function(){r.on(n,null)};r.on(n,function(){P(),o()},!0),setTimeout(o,0)}}}o.mouse=function(e){return Ce(e,L())};var ke=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ce(e,t){t.changedTouches&&(t=t.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(ke<0){var i=c(e);if(i.scrollX||i.scrollY){var a=(n=o.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();ke=!(a.f||a.e),n.remove()}}return ke?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}function De(){return o.event.changedTouches[0].identifier}o.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=L().changedTouches),t)for(var r,i=0,o=t.length;i<o;++i)if((r=t[i]).identifier===n)return Ce(e,r)},o.behavior.drag=function(){var e=B(i,"drag","dragstart","dragend"),t=null,n=a($,o.mouse,c,"mousemove","mouseup"),r=a(De,o.touch,F,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",r)}function a(n,r,i,a,s){return function(){var l,u=this,c=o.event.target.correspondingElement||o.event.target,d=u.parentNode,f=e.of(u,arguments),p=0,h=n(),g=".drag"+(null==h?"":"-"+h),m=o.select(i(c)).on(a+g,function(){var e,t,n=r(d,h);n&&(e=n[0]-y[0],t=n[1]-y[1],p|=e|t,y=n,f({type:"drag",x:n[0]+l[0],y:n[1]+l[1],dx:e,dy:t}))}).on(s+g,function(){r(d,h)&&(m.on(a+g,null).on(s+g,null),v(p),f({type:"dragend"}))}),v=xe(c),y=r(d,h);l=t?[(l=t.apply(u,arguments)).x-y[0],l.y-y[1]]:[0,0],f({type:"dragstart"})}}return i.origin=function(e){return arguments.length?(t=e,i):t},o.rebind(i,e,"on")},o.touches=function(e,t){return arguments.length<2&&(t=L().touches),t?s(t).map(function(t){var n=Ce(e,t);return n.identifier=t.identifier,n}):[]};var Se=1e-6,Ae=Se*Se,Ee=Math.PI,Me=2*Ee,Te=Me-Se,je=Ee/2,Ne=Ee/180,Fe=180/Ee;function Oe(e){return e>0?1:e<0?-1:0}function Ie(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function ze(e){return e>1?0:e<-1?Ee:Math.acos(e)}function $e(e){return e>1?je:e<-1?-je:Math.asin(e)}function qe(e){return((e=Math.exp(e))+1/e)/2}function Re(e){return(e=Math.sin(e/2))*e}var Pe=Math.SQRT2;o.interpolateZoom=function(e,t){var n,r,i=e[0],o=e[1],a=e[2],s=t[0],l=t[1],u=t[2],c=s-i,d=l-o,f=c*c+d*d;if(f<Ae)r=Math.log(u/a)/Pe,n=function(e){return[i+e*c,o+e*d,a*Math.exp(Pe*e*r)]};else{var p=Math.sqrt(f),h=(u*u-a*a+4*f)/(2*a*2*p),g=(u*u-a*a-4*f)/(2*u*2*p),m=Math.log(Math.sqrt(h*h+1)-h),v=Math.log(Math.sqrt(g*g+1)-g);r=(v-m)/Pe,n=function(e){var t,n=e*r,s=qe(m),l=a/(2*p)*(s*(t=Pe*n+m,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(m));return[i+l*c,o+l*d,a*s/qe(Pe*n+m)]}}return n.duration=1e3*r,n},o.behavior.zoom=function(){var e,t,n,r,i,a,s,u,d,f={x:0,y:0,k:1},p=[960,500],h=Ue,g=250,m=0,v="mousedown.zoom",y="mousemove.zoom",_="mouseup.zoom",b="touchstart.zoom",w=B(x,"zoomstart","zoom","zoomend");function x(e){e.on(v,j).on(Be+".zoom",F).on("dblclick.zoom",O).on(b,N)}function k(e){return[(e[0]-f.x)/f.k,(e[1]-f.y)/f.k]}function C(e){f.k=Math.max(h[0],Math.min(h[1],e))}function D(e,t){t=function(e){return[e[0]*f.k+f.x,e[1]*f.k+f.y]}(t),f.x+=e[0]-t[0],f.y+=e[1]-t[1]}function S(e,n,r,i){e.__chart__={x:f.x,y:f.y,k:f.k},C(Math.pow(2,i)),D(t=n,r),e=o.select(e),g>0&&(e=e.transition().duration(g)),e.call(x.event)}function A(){s&&s.domain(a.range().map(function(e){return(e-f.x)/f.k}).map(a.invert)),d&&d.domain(u.range().map(function(e){return(e-f.y)/f.k}).map(u.invert))}function E(e){m++||e({type:"zoomstart"})}function M(e){A(),e({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function T(e){--m||(e({type:"zoomend"}),t=null)}function j(){var e=this,t=w.of(e,arguments),n=0,r=o.select(c(e)).on(y,function(){n=1,D(o.mouse(e),i),M(t)}).on(_,function(){r.on(y,null).on(_,null),a(n),T(t)}),i=k(o.mouse(e)),a=xe(e);Ts.call(e),E(t)}function N(){var e,t=this,n=w.of(t,arguments),r={},a=0,s=".zoom-"+o.event.changedTouches[0].identifier,l="touchmove"+s,u="touchend"+s,c=[],d=o.select(t),p=xe(t);function h(){var n=o.touches(t);return e=f.k,n.forEach(function(e){e.identifier in r&&(r[e.identifier]=k(e))}),n}function g(){var e=o.event.target;o.select(e).on(l,m).on(u,y),c.push(e);for(var n=o.event.changedTouches,s=0,d=n.length;s<d;++s)r[n[s].identifier]=null;var p=h(),g=Date.now();if(1===p.length){if(g-i<500){var v=p[0];S(t,v,r[v.identifier],Math.floor(Math.log(f.k)/Math.LN2)+1),P()}i=g}else if(p.length>1){v=p[0];var _=p[1],b=v[0]-_[0],w=v[1]-_[1];a=b*b+w*w}}function m(){var s,l,u,c,d=o.touches(t);Ts.call(t);for(var f=0,p=d.length;f<p;++f,c=null)if(u=d[f],c=r[u.identifier]){if(l)break;s=u,l=c}if(c){var h=(h=u[0]-s[0])*h+(h=u[1]-s[1])*h,g=a&&Math.sqrt(h/a);s=[(s[0]+u[0])/2,(s[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],C(g*e)}i=null,D(s,l),M(n)}function y(){if(o.event.touches.length){for(var e=o.event.changedTouches,t=0,i=e.length;t<i;++t)delete r[e[t].identifier];for(var a in r)return void h()}o.selectAll(c).on(s,null),d.on(v,j).on(b,N),p(),T(n)}g(),E(n),d.on(v,null).on(b,g)}function F(){var i=w.of(this,arguments);r?clearTimeout(r):(Ts.call(this),e=k(t=n||o.mouse(this)),E(i)),r=setTimeout(function(){r=null,T(i)},50),P(),C(Math.pow(2,.002*Le())*f.k),D(t,e),M(i)}function O(){var e=o.mouse(this),t=Math.log(f.k)/Math.LN2;S(this,e,k(e),o.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}return Be||(Be="onwheel"in l?(Le=function(){return-o.event.deltaY*(o.event.deltaMode?120:1)},"wheel"):"onmousewheel"in l?(Le=function(){return o.event.wheelDelta},"mousewheel"):(Le=function(){return-o.event.detail},"MozMousePixelScroll")),x.event=function(e){e.each(function(){var e=w.of(this,arguments),n=f;Fs?o.select(this).transition().each("start.zoom",function(){f=this.__chart__||{x:0,y:0,k:1},E(e)}).tween("zoom:zoom",function(){var r=p[0],i=p[1],a=t?t[0]:r/2,s=t?t[1]:i/2,l=o.interpolateZoom([(a-f.x)/f.k,(s-f.y)/f.k,r/f.k],[(a-n.x)/n.k,(s-n.y)/n.k,r/n.k]);return function(t){var n=l(t),i=r/n[2];this.__chart__=f={x:a-n[0]*i,y:s-n[1]*i,k:i},M(e)}}).each("interrupt.zoom",function(){T(e)}).each("end.zoom",function(){T(e)}):(this.__chart__=f,E(e),M(e),T(e))})},x.translate=function(e){return arguments.length?(f={x:+e[0],y:+e[1],k:f.k},A(),x):[f.x,f.y]},x.scale=function(e){return arguments.length?(f={x:f.x,y:f.y,k:null},C(+e),A(),x):f.k},x.scaleExtent=function(e){return arguments.length?(h=null==e?Ue:[+e[0],+e[1]],x):h},x.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],x):n},x.size=function(e){return arguments.length?(p=e&&[+e[0],+e[1]],x):p},x.duration=function(e){return arguments.length?(g=+e,x):g},x.x=function(e){return arguments.length?(s=e,a=e.copy(),f={x:0,y:0,k:1},x):s},x.y=function(e){return arguments.length?(d=e,u=e.copy(),f={x:0,y:0,k:1},x):d},o.rebind(x,w,"on")};var Le,Be,Ue=[0,1/0];function Ve(){}function He(e,t,n){return this instanceof He?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof He?new He(e.h,e.s,e.l):ft(""+e,pt,He):new He(e,t,n)}o.color=Ve,Ve.prototype.toString=function(){return this.rgb()+""},o.hsl=He;var We=He.prototype=new Ve;function Ge(e,t,n){var r,i;function o(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,r=2*(n=n<0?0:n>1?1:n)-(i=n<=.5?n*(1+t):n+t-n*t),new st(o(e+120),o(e),o(e-120))}function Ye(e,t,n){return this instanceof Ye?(this.h=+e,this.c=+t,void(this.l=+n)):arguments.length<2?e instanceof Ye?new Ye(e.h,e.c,e.l):function(e,t,n){return e>0?new Ye(Math.atan2(n,t)*Fe,Math.sqrt(t*t+n*n),e):new Ye(NaN,NaN,e)}(e instanceof Ze?e.l:(e=ht((e=o.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ye(e,t,n)}We.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new He(this.h,this.s,this.l/e)},We.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new He(this.h,this.s,e*this.l)},We.rgb=function(){return Ge(this.h,this.s,this.l)},o.hcl=Ye;var Qe=Ye.prototype=new Ve;function Ke(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ze(n,Math.cos(e*=Ne)*t,Math.sin(e)*t)}function Ze(e,t,n){return this instanceof Ze?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof Ze?new Ze(e.l,e.a,e.b):e instanceof Ye?Ke(e.h,e.c,e.l):ht((e=st(e)).r,e.g,e.b):new Ze(e,t,n)}Qe.brighter=function(e){return new Ye(this.h,this.c,Math.min(100,this.l+Xe*(arguments.length?e:1)))},Qe.darker=function(e){return new Ye(this.h,this.c,Math.max(0,this.l-Xe*(arguments.length?e:1)))},Qe.rgb=function(){return Ke(this.h,this.c,this.l).rgb()},o.lab=Ze;var Xe=18,Je=.95047,et=1,tt=1.08883,nt=Ze.prototype=new Ve;function rt(e,t,n){var r=(e+16)/116,i=r+t/500,o=r-n/200;return new st(at(3.2404542*(i=it(i)*Je)-1.5371385*(r=it(r)*et)-.4985314*(o=it(o)*tt)),at(-.969266*i+1.8760108*r+.041556*o),at(.0556434*i-.2040259*r+1.0572252*o))}function it(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ot(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function st(e,t,n){return this instanceof st?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof st?new st(e.r,e.g,e.b):ft(""+e,st,Ge):new st(e,t,n)}function lt(e){return new st(e>>16,e>>8&255,255&e)}function ut(e){return lt(e)+""}nt.brighter=function(e){return new Ze(Math.min(100,this.l+Xe*(arguments.length?e:1)),this.a,this.b)},nt.darker=function(e){return new Ze(Math.max(0,this.l-Xe*(arguments.length?e:1)),this.a,this.b)},nt.rgb=function(){return rt(this.l,this.a,this.b)},o.rgb=st;var ct=st.prototype=new Ve;function dt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ft(e,t,n){var r,i,o,a=0,s=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(mt(i[0]),mt(i[1]),mt(i[2]))}return(o=vt.get(e))?t(o.r,o.g,o.b):(null==e||"#"!==e.charAt(0)||isNaN(o=parseInt(e.slice(1),16))||(4===e.length?(a=(3840&o)>>4,a|=a>>4,s=240&o,s|=s>>4,l=15&o,l|=l<<4):7===e.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,l=255&o)),t(a,s,l))}function pt(e,t,n){var r,i,o=Math.min(e/=255,t/=255,n/=255),a=Math.max(e,t,n),s=a-o,l=(a+o)/2;return s?(i=l<.5?s/(a+o):s/(2-a-o),r=e==a?(t-n)/s+(t<n?6:0):t==a?(n-e)/s+2:(e-t)/s+4,r*=60):(r=NaN,i=l>0&&l<1?0:r),new He(r,i,l)}function ht(e,t,n){var r=ot((.4124564*(e=gt(e))+.3575761*(t=gt(t))+.1804375*(n=gt(n)))/Je),i=ot((.2126729*e+.7151522*t+.072175*n)/et);return Ze(116*i-16,500*(r-i),200*(i-ot((.0193339*e+.119192*t+.9503041*n)/tt)))}function gt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ct.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return t||n||r?(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new st(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e))):new st(i,i,i)},ct.darker=function(e){return new st((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},ct.hsl=function(){return pt(this.r,this.g,this.b)},ct.toString=function(){return"#"+dt(this.r)+dt(this.g)+dt(this.b)};var vt=o.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function yt(e){return"function"==typeof e?e:function(){return e}}function _t(e){return function(t,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),bt(t,n,e,r)}}function bt(e,t,n,r){var i={},a=o.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function d(){var e,t=u.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(u)||t>=200&&t<300||304===t){try{e=n.call(i,u)}catch(e){return void a.error.call(i,e)}a.load.call(i,e)}else a.error.call(i,u)}return this.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=d:u.onreadystatechange=function(){u.readyState>3&&d()},u.onprogress=function(e){var t=o.event;o.event=e;try{a.progress.call(i,u)}finally{o.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return n=e,i},["get","post"].forEach(function(e){i[e]=function(){return i.send.apply(i,[e].concat(s(arguments)))}}),i.send=function(n,r,o){if(2===arguments.length&&"function"==typeof r&&(o=r,r=null),u.open(n,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),u.setRequestHeader)for(var s in l)u.setRequestHeader(s,l[s]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=c&&(u.responseType=c),null!=o&&i.on("error",o).on("load",function(e){o(null,e)}),a.beforesend.call(i,u),u.send(null==r?null:r),i},i.abort=function(){return u.abort(),i},o.rebind(i,a,"on"),null==r?i:i.get(function(e){return 1===e.length?function(t,n){e(null==t?n:null)}:e}(r))}vt.forEach(function(e,t){vt.set(e,lt(t))}),o.functor=yt,o.xhr=_t(F),o.dsv=function(e,t){var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=bt(e,t,null==n?o:a(n),r);return i.row=function(e){return arguments.length?i.response(null==(n=e)?o:a(e)):n},i}function o(e){return i.parse(e.responseText)}function a(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var n;return i.parseRows(e,function(e,r){if(n)return n(e,r-1);var i=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");n=t?function(e,n){return t(i(e),n)}:i})},i.parseRows=function(e,t){var n,i,o={},a={},s=[],l=e.length,u=0,c=0;function d(){if(u>=l)return a;if(i)return i=!1,o;var t=u;if(34===e.charCodeAt(t)){for(var n=t;n++<l;)if(34===e.charCodeAt(n)){if(34!==e.charCodeAt(n+1))break;++n}return u=n+2,13===(s=e.charCodeAt(n+1))?(i=!0,10===e.charCodeAt(n+2)&&++u):10===s&&(i=!0),e.slice(t+1,n).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=e.charCodeAt(u++)))i=!0;else if(13===s)i=!0,10===e.charCodeAt(u)&&(++u,++c);else if(s!==r)continue;return e.slice(t,u-c)}return e.slice(t)}for(;(n=d())!==a;){for(var f=[];n!==o&&n!==a;)f.push(n),n=d();t&&null==(f=t(f,c++))||s.push(f)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var n=new N,r=[];return t.forEach(function(e){for(var t in e)n.has(t)||r.push(n.add(t))}),[r.map(l).join(e)].concat(t.map(function(t){return r.map(function(e){return l(t[e])}).join(e)})).join("\n")},i.formatRows=function(e){return e.map(s).join("\n")},i},o.csv=o.dsv(",","text/csv"),o.tsv=o.dsv("\t","text/tab-separated-values");var wt,xt,kt,Ct,Dt=this[I(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function St(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i={c:e,t:n+t,n:null};return xt?xt.n=i:wt=i,xt=i,kt||(Ct=clearTimeout(Ct),kt=1,Dt(At)),i}function At(){var e=Et(),t=Mt()-e;t>24?(isFinite(t)&&(clearTimeout(Ct),Ct=setTimeout(At,t)),kt=0):(kt=1,Dt(At))}function Et(){for(var e=Date.now(),t=wt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Mt(){for(var e,t=wt,n=1/0;t;)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:wt=t.n;return xt=e,n}function Tt(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}o.timer=function(){St.apply(this,arguments)},o.timer.flush=function(){Et(),Mt()},o.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var jt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(e,t){var n=Math.pow(10,3*x(8-t));return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}});function Nt(e){var t=e.decimal,n=e.thousands,r=e.grouping,i=e.currency,a=r&&n?function(e,t){for(var i=e.length,o=[],a=0,s=r[0],l=0;i>0&&s>0&&(l+s+1>t&&(s=Math.max(1,t-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>t));)s=r[a=(a+1)%r.length];return o.reverse().join(n)}:F;return function(e){var n=Ft.exec(e),r=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],d=+n[6],f=n[7],p=n[8],h=n[9],g=1,m="",v="",y=!1,_=!0;switch(p&&(p=+p.substring(1)),(c||"0"===r&&"="===s)&&(c=r="0",s="="),h){case"n":f=!0,h="g";break;case"%":g=100,v="%",h="f";break;case"p":g=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===u&&(m="0"+h.toLowerCase());case"c":_=!1;case"d":y=!0,p=0;break;case"s":g=-1,h="r"}"$"===u&&(m=i[0],v=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=Ot.get(h)||It;var b=c&&f;return function(e){var n=v;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var u=o.formatPrefix(e,p);e=u.scale(e),n=u.symbol+v}else e*=g;var w,x,k=(e=h(e,p)).lastIndexOf(".");if(k<0){var C=_?e.lastIndexOf("e"):-1;C<0?(w=e,x=""):(w=e.substring(0,C),x=e.substring(C))}else w=e.substring(0,k),x=t+e.substring(k+1);!c&&f&&(w=a(w,1/0));var D=m.length+w.length+x.length+(b?0:i.length),S=D<d?new Array(D=d-D+1).join(r):"";return b&&(w=a(S+w,S.length?d-x.length:1/0)),i+=m,e=w+x,("<"===s?i+e+S:">"===s?S+i+e:"^"===s?S.substring(0,D>>=1)+i+e+S.substring(D):i+(b?e:S+e))+n}}}o.formatPrefix=function(e,t){var n=0;return(e=+e)&&(e<0&&(e*=-1),t&&(e=o.round(e,Tt(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),jt[8+n/3]};var Ft=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ot=o.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=o.round(e,Tt(e,t))).toFixed(Math.max(0,Math.min(20,Tt(e*(1+1e-15),t))))}});function It(e){return e+""}var zt=o.time={},$t=Date;function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}qt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Rt.setUTCDate.apply(this._,arguments)},setDay:function(){Rt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Rt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Rt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Rt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Rt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Rt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Rt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Rt.setTime.apply(this._,arguments)}};var Rt=Date.prototype;function Pt(e,t,n){function r(t){var n=e(t),r=o(n,1);return t-n<r-t?n:r}function i(n){return t(n=e(new $t(n-1)),1),n}function o(e,n){return t(e=new $t(+e),n),e}function a(e,r,o){var a=i(e),s=[];if(o>1)for(;a<r;)n(a)%o||s.push(new Date(+a)),t(a,1);else for(;a<r;)s.push(new Date(+a)),t(a,1);return s}e.floor=e,e.round=r,e.ceil=i,e.offset=o,e.range=a;var s=e.utc=Lt(e);return s.floor=s,s.round=Lt(r),s.ceil=Lt(i),s.offset=Lt(o),s.range=function(e,t,n){try{$t=qt;var r=new qt;return r._=e,a(r,t,n)}finally{$t=Date}},e}function Lt(e){return function(t,n){try{$t=qt;var r=new qt;return r._=t,e(r,n)._}finally{$t=Date}}}function Bt(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(e){var t=e.length;function n(n){for(var r,i,o,a=[],s=-1,l=0;++s<t;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Ut[r=e.charAt(++s)])&&(r=e.charAt(++s)),(o=w[r])&&(r=o(n,null==i?"e"===r?" ":"0":i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}return n.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(d(n,e,t,0)!=t.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var r=null!=n.Z&&$t!==qt,i=new(r?qt:$t);return"j"in n?i.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),i.setFullYear(n.y,0,1),i.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(i.getDay()+5)%7:n.w+7*n.U-(i.getDay()+6)%7)):i.setFullYear(n.y,n.m,n.d),i.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),r?i._:i},n.toString=function(){return e},n}function d(e,t,n,r){for(var i,o,a,s=0,l=t.length,u=n.length;s<l;){if(r>=u)return-1;if(37===(i=t.charCodeAt(s++))){if(a=t.charAt(s++),!(o=x[a in Ut?t.charAt(s++):a])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}c.utc=function(e){var t=c(e);function n(e){try{var n=new($t=qt);return n._=e,t(n)}finally{$t=Date}}return n.parse=function(e){try{$t=qt;var n=t.parse(e);return n&&n._}finally{$t=Date}},n.toString=t.toString,n},c.multi=c.utc.multi=dn;var f=o.map(),p=Gt(a),h=Yt(a),g=Gt(s),m=Yt(s),v=Gt(l),y=Yt(l),_=Gt(u),b=Yt(u);i.forEach(function(e,t){f.set(e.toLowerCase(),t)});var w={a:function(e){return s[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:c(t),d:function(e,t){return Wt(e.getDate(),t,2)},e:function(e,t){return Wt(e.getDate(),t,2)},H:function(e,t){return Wt(e.getHours(),t,2)},I:function(e,t){return Wt(e.getHours()%12||12,t,2)},j:function(e,t){return Wt(1+zt.dayOfYear(e),t,3)},L:function(e,t){return Wt(e.getMilliseconds(),t,3)},m:function(e,t){return Wt(e.getMonth()+1,t,2)},M:function(e,t){return Wt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return Wt(e.getSeconds(),t,2)},U:function(e,t){return Wt(zt.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Wt(zt.mondayOfYear(e),t,2)},x:c(n),X:c(r),y:function(e,t){return Wt(e.getFullYear()%100,t,2)},Y:function(e,t){return Wt(e.getFullYear()%1e4,t,4)},Z:un,"%":function(){return"%"}},x={a:function(e,t,n){g.lastIndex=0;var r=g.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){p.lastIndex=0;var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){_.lastIndex=0;var r=_.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){v.lastIndex=0;var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,t,n){return d(e,w.c.toString(),t,n)},d:nn,e:nn,H:on,I:on,j:rn,L:ln,m:tn,M:an,p:function(e,t,n){var r=f.get(t.slice(n,n+=2).toLowerCase());return null==r?-1:(e.p=r,n)},S:sn,U:Kt,w:Qt,W:Zt,x:function(e,t,n){return d(e,w.x.toString(),t,n)},X:function(e,t,n){return d(e,w.X.toString(),t,n)},y:Jt,Y:Xt,Z:en,"%":cn};return c}zt.year=Pt(function(e){return(e=zt.day(e)).setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),zt.years=zt.year.range,zt.years.utc=zt.year.utc.range,zt.day=Pt(function(e){var t=new $t(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),zt.days=zt.day.range,zt.days.utc=zt.day.utc.range,zt.dayOfYear=function(e){var t=zt.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=zt[e]=Pt(function(e){return(e=zt.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var n=zt.year(e).getDay();return Math.floor((zt.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});zt[e+"s"]=n.range,zt[e+"s"].utc=n.utc.range,zt[e+"OfYear"]=function(e){var n=zt.year(e).getDay();return Math.floor((zt.dayOfYear(e)+(n+t)%7)/7)}}),zt.week=zt.sunday,zt.weeks=zt.sunday.range,zt.weeks.utc=zt.sunday.utc.range,zt.weekOfYear=zt.sundayOfYear;var Ut={"-":"",_:" ",0:"0"},Vt=/^\s*\d+/,Ht=/^%/;function Wt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Gt(e){return new RegExp("^(?:"+e.map(o.requote).join("|")+")","i")}function Yt(e){for(var t=new C,n=-1,r=e.length;++n<r;)t.set(e[n].toLowerCase(),n);return t}function Qt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Kt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function Zt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function Xt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Jt(e,t,n){Vt.lastIndex=0;var r,i=Vt.exec(t.slice(n,n+2));return i?(e.y=(r=+i[0])+(r>68?1900:2e3),n+i[0].length):-1}function en(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function tn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function nn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function rn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function on(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function an(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function sn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ln(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function un(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=x(t)/60|0,i=x(t)%60;return n+Wt(r,"0",2)+Wt(i,"0",2)}function cn(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dn(e){for(var t=e.length,n=-1;++n<t;)e[n][0]=this(e[n][0]);return function(t){for(var n=0,r=e[n];!r[1](t);)r=e[++n];return r[0](t)}}o.locale=function(e){return{numberFormat:Nt(e),timeFormat:Bt(e)}};var fn=o.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function pn(){}o.format=fn.numberFormat,o.geo={},pn.prototype={s:0,t:0,add:function(e){gn(e,this.t,hn),gn(hn.s,this.s,this),this.s?this.t+=hn.t:this.s=hn.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var hn=new pn;function gn(e,t,n){var r=n.s=e+t,i=r-e,o=r-i;n.t=e-o+(t-i)}function mn(e,t){e&&yn.hasOwnProperty(e.type)&&yn[e.type](e,t)}o.geo.stream=function(e,t){e&&vn.hasOwnProperty(e.type)?vn[e.type](e,t):mn(e,t)};var vn={Feature:function(e,t){mn(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)mn(n[r].geometry,t)}},yn={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){_n(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)_n(n[r],t,0)},Polygon:function(e,t){bn(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)bn(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)mn(n[r],t)}};function _n(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function bn(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)_n(e[n],t,1);t.polygonEnd()}o.geo.area=function(e){return wn=0,o.geo.stream(e,On),wn};var wn,xn,kn,Cn,Dn,Sn,An,En,Mn,Tn,jn,Nn,Fn=new pn,On={sphere:function(){wn+=4*Ee},point:$,lineStart:$,lineEnd:$,polygonStart:function(){Fn.reset(),On.lineStart=In},polygonEnd:function(){var e=2*Fn;wn+=e<0?4*Ee+e:e,On.lineStart=On.lineEnd=On.point=$}};function In(){var e,t,n,r,i;function o(e,t){t=t*Ne/2+Ee/4;var o=(e*=Ne)-n,a=o>=0?1:-1,s=a*o,l=Math.cos(t),u=Math.sin(t),c=i*u,d=r*l+c*Math.cos(s),f=c*a*Math.sin(s);Fn.add(Math.atan2(f,d)),n=e,r=l,i=u}On.point=function(a,s){On.point=o,n=(e=a)*Ne,r=Math.cos(s=(t=s)*Ne/2+Ee/4),i=Math.sin(s)},On.lineEnd=function(){o(e,t)}}function zn(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function $n(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function qn(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Rn(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Pn(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Ln(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Bn(e){return[Math.atan2(e[1],e[0]),$e(e[2])]}function Un(e,t){return x(e[0]-t[0])<Se&&x(e[1]-t[1])<Se}o.geo.bounds=function(){var e,t,n,r,i,a,s,l,u,c,d,f={point:p,lineStart:g,lineEnd:m,polygonStart:function(){f.point=v,f.lineStart=y,f.lineEnd=_,u=0,On.polygonStart()},polygonEnd:function(){On.polygonEnd(),f.point=p,f.lineStart=g,f.lineEnd=m,Fn<0?(e=-(n=180),t=-(r=90)):u>Se?r=90:u<-Se&&(t=-90),d[0]=e,d[1]=n}};function p(i,o){c.push(d=[e=i,n=i]),o<t&&(t=o),o>r&&(r=o)}function h(o,a){var s=zn([o*Ne,a*Ne]);if(l){var u=qn(l,s),c=qn([u[1],-u[0],0],u);Ln(c),c=Bn(c);var d=o-i,f=d>0?1:-1,h=c[0]*Fe*f,g=x(d)>180;if(g^(f*i<h&&h<f*o))(m=c[1]*Fe)>r&&(r=m);else if(g^(f*i<(h=(h+360)%360-180)&&h<f*o)){var m;(m=-c[1]*Fe)<t&&(t=m)}else a<t&&(t=a),a>r&&(r=a);g?o<i?b(e,o)>b(e,n)&&(n=o):b(o,n)>b(e,n)&&(e=o):n>=e?(o<e&&(e=o),o>n&&(n=o)):o>i?b(e,o)>b(e,n)&&(n=o):b(o,n)>b(e,n)&&(e=o)}else p(o,a);l=s,i=o}function g(){f.point=h}function m(){d[0]=e,d[1]=n,f.point=p,l=null}function v(e,t){if(l){var n=e-i;u+=x(n)>180?n+(n>0?360:-360):n}else a=e,s=t;On.point(e,t),h(e,t)}function y(){On.lineStart()}function _(){v(a,s),On.lineEnd(),x(u)>Se&&(e=-(n=180)),d[0]=e,d[1]=n,l=null}function b(e,t){return(t-=e)<0?t+360:t}function w(e,t){return e[0]-t[0]}function k(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}return function(i){if(r=n=-(e=t=1/0),c=[],o.geo.stream(i,f),u=c.length){c.sort(w);for(var a=1,s=[g=c[0]];a<u;++a)k((p=c[a])[0],g)||k(p[1],g)?(b(g[0],p[1])>b(g[0],g[1])&&(g[1]=p[1]),b(p[0],g[1])>b(g[0],g[1])&&(g[0]=p[0])):s.push(g=p);for(var l,u,p,h=-1/0,g=(a=0,s[u=s.length-1]);a<=u;g=p,++a)p=s[a],(l=b(g[1],p[0]))>h&&(h=l,e=p[0],n=g[1])}return c=d=null,e===1/0||t===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,t],[n,r]]}}(),o.geo.centroid=function(e){xn=kn=Cn=Dn=Sn=An=En=Mn=Tn=jn=Nn=0,o.geo.stream(e,Vn);var t=Tn,n=jn,r=Nn,i=t*t+n*n+r*r;return i<Ae&&(t=An,n=En,r=Mn,kn<Se&&(t=Cn,n=Dn,r=Sn),(i=t*t+n*n+r*r)<Ae)?[NaN,NaN]:[Math.atan2(n,t)*Fe,$e(r/Math.sqrt(i))*Fe]};var Vn={sphere:$,point:Hn,lineStart:Gn,lineEnd:Yn,polygonStart:function(){Vn.lineStart=Qn},polygonEnd:function(){Vn.lineStart=Gn}};function Hn(e,t){e*=Ne;var n=Math.cos(t*=Ne);Wn(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function Wn(e,t,n){++xn,Cn+=(e-Cn)/xn,Dn+=(t-Dn)/xn,Sn+=(n-Sn)/xn}function Gn(){var e,t,n;function r(r,i){r*=Ne;var o=Math.cos(i*=Ne),a=o*Math.cos(r),s=o*Math.sin(r),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=t*l-n*s)*u+(u=n*a-e*l)*u+(u=e*s-t*a)*u),e*a+t*s+n*l);kn+=u,An+=u*(e+(e=a)),En+=u*(t+(t=s)),Mn+=u*(n+(n=l)),Wn(e,t,n)}Vn.point=function(i,o){i*=Ne;var a=Math.cos(o*=Ne);e=a*Math.cos(i),t=a*Math.sin(i),n=Math.sin(o),Vn.point=r,Wn(e,t,n)}}function Yn(){Vn.point=Hn}function Qn(){var e,t,n,r,i;function o(e,t){e*=Ne;var o=Math.cos(t*=Ne),a=o*Math.cos(e),s=o*Math.sin(e),l=Math.sin(t),u=r*l-i*s,c=i*a-n*l,d=n*s-r*a,f=Math.sqrt(u*u+c*c+d*d),p=n*a+r*s+i*l,h=f&&-ze(p)/f,g=Math.atan2(f,p);Tn+=h*u,jn+=h*c,Nn+=h*d,kn+=g,An+=g*(n+(n=a)),En+=g*(r+(r=s)),Mn+=g*(i+(i=l)),Wn(n,r,i)}Vn.point=function(a,s){e=a,t=s,Vn.point=o,a*=Ne;var l=Math.cos(s*=Ne);n=l*Math.cos(a),r=l*Math.sin(a),i=Math.sin(s),Wn(n,r,i)},Vn.lineEnd=function(){o(e,t),Vn.lineEnd=Yn,Vn.point=Hn}}function Kn(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function Zn(){return!0}function Xn(e,t,n,r,i){var o=[],a=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t];if(Un(n,r)){i.lineStart();for(var s=0;s<t;++s)i.point((n=e[s])[0],n[1]);i.lineEnd()}else{var l=new er(n,e,null,!0),u=new er(n,null,l,!1);l.o=u,o.push(l),a.push(u),l=new er(r,e,null,!1),u=new er(r,null,l,!0),l.o=u,o.push(l),a.push(u)}}}),a.sort(t),Jn(o),Jn(a),o.length){for(var s=0,l=n,u=a.length;s<u;++s)a[s].e=l=!l;for(var c,d,f=o[0];;){for(var p=f,h=!0;p.v;)if((p=p.n)===f)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(s=0,u=c.length;s<u;++s)i.point((d=c[s])[0],d[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(h)for(s=(c=p.p.z).length-1;s>=0;--s)i.point((d=c[s])[0],d[1]);else r(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,h=!h}while(!p.v);i.lineEnd()}}}function Jn(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function er(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function tr(e,t,n,r){return function(i,a){var s,l=t(a),u=i.invert(r[0],r[1]),c={point:d,lineStart:p,lineEnd:h,polygonStart:function(){c.point=b,c.lineStart=w,c.lineEnd=x,s=[],g=[]},polygonEnd:function(){c.point=d,c.lineStart=p,c.lineEnd=h,s=o.merge(s);var e=function(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;Fn.reset();for(var s=0,l=t.length;s<l;++s){var u=t[s],c=u.length;if(c)for(var d=u[0],f=d[0],p=d[1]/2+Ee/4,h=Math.sin(p),g=Math.cos(p),m=1;;){m===c&&(m=0);var v=(e=u[m])[0],y=e[1]/2+Ee/4,_=Math.sin(y),b=Math.cos(y),w=v-f,x=w>=0?1:-1,k=x*w,C=k>Ee,D=h*_;if(Fn.add(Math.atan2(D*x*Math.sin(k),g*b+D*Math.cos(k))),o+=C?w+x*Me:w,C^f>=n^v>=n){var S=qn(zn(d),zn(e));Ln(S);var A=qn(i,S);Ln(A);var E=(C^w>=0?-1:1)*$e(A[2]);(r>E||r===E&&(S[0]||S[1]))&&(a+=C^w>=0?1:-1)}if(!m++)break;f=v,h=_,g=b,d=e}}return(o<-Se||o<Se&&Fn<-Se)^1&a}(u,g);s.length?(_||(a.polygonStart(),_=!0),Xn(s,ir,e,n,a)):e&&(_||(a.polygonStart(),_=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),s=g=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function d(t,n){var r=i(t,n);e(t=r[0],n=r[1])&&a.point(t,n)}function f(e,t){var n=i(e,t);l.point(n[0],n[1])}function p(){c.point=f,l.lineStart()}function h(){c.point=d,l.lineEnd()}var g,m,v=rr(),y=t(v),_=!1;function b(e,t){m.push([e,t]);var n=i(e,t);y.point(n[0],n[1])}function w(){y.lineStart(),m=[]}function x(){b(m[0][0],m[0][1]),y.lineEnd();var e,t=y.clean(),n=v.buffer(),r=n.length;if(m.pop(),g.push(m),m=null,r)if(1&t){var i,o=-1;if((r=(e=n[0]).length-1)>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<r;)a.point((i=e[o])[0],i[1]);a.lineEnd()}}else r>1&&2&t&&n.push(n.pop().concat(n.shift())),s.push(n.filter(nr))}return c}}function nr(e){return e.length>1}function rr(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:$,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function ir(e,t){return((e=e.x)[0]<0?e[1]-je-Se:je-e[1])-((t=t.x)[0]<0?t[1]-je-Se:je-t[1])}var or=tr(Zn,function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Ee:-Ee,l=x(o-n);x(l-Ee)<Se?(e.point(n,r=(r+a)/2>0?je:-je),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&l>=Ee&&(x(n-i)<Se&&(n-=i*Se),x(o-s)<Se&&(o-=s*Se),r=function(e,t,n,r){var i,o,a=Math.sin(e-n);return x(a)>Se?Math.atan((Math.sin(t)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}},function(e,t,n,r){var i;if(null==e)i=n*je,r.point(-Ee,i),r.point(0,i),r.point(Ee,i),r.point(Ee,0),r.point(Ee,-i),r.point(0,-i),r.point(-Ee,-i),r.point(-Ee,0),r.point(-Ee,i);else if(x(e[0]-t[0])>Se){var o=e[0]<t[0]?Ee:-Ee;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-Ee,-Ee/2]);function ar(e,t,n,r){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=0,d=1,f=s.x-l,p=s.y-u;if(o=e-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<d&&(d=o)}else if(f>0){if(o>d)return;o>c&&(c=o)}if(o=n-l,f||!(o<0)){if(o/=f,f<0){if(o>d)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<d&&(d=o)}if(o=t-u,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<d&&(d=o)}else if(p>0){if(o>d)return;o>c&&(c=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>d)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<d&&(d=o)}return c>0&&(i.a={x:l+c*f,y:u+c*p}),d<1&&(i.b={x:l+d*f,y:u+d*p}),i}}}}}}var sr=1e9;function lr(e,t,n,r){return function(l){var u,c,d,f,p,h,g,m,v,y,_,b=l,w=rr(),x=ar(e,t,n,r),k={point:S,lineStart:function(){k.point=A,c&&c.push(d=[]),y=!0,v=!1,g=m=NaN},lineEnd:function(){u&&(A(f,p),h&&v&&w.rejoin(),u.push(w.buffer())),k.point=S,v&&l.lineEnd()},polygonStart:function(){l=w,u=[],c=[],_=!0},polygonEnd:function(){l=b,u=o.merge(u);var t=function(e){for(var t=0,n=c.length,r=e[1],i=0;i<n;++i)for(var o,a=1,s=c[i],l=s.length,u=s[0];a<l;++a)o=s[a],u[1]<=r?o[1]>r&&Ie(u,o,e)>0&&++t:o[1]<=r&&Ie(u,o,e)<0&&--t,u=o;return 0!==t}([e,r]),n=_&&t,i=u.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),C(null,null,1,l),l.lineEnd()),i&&Xn(u,a,t,C,l),l.polygonEnd()),u=c=d=null}};function C(o,a,l,u){var c=0,d=0;if(null==o||(c=i(o,l))!==(d=i(a,l))||s(o,a)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+l+4)%4)!==d);else u.point(a[0],a[1])}function D(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function S(e,t){D(e,t)&&l.point(e,t)}function A(e,t){var n=D(e=Math.max(-1e9,Math.min(sr,e)),t=Math.max(-1e9,Math.min(sr,t)));if(c&&d.push([e,t]),y)f=e,p=t,h=n,y=!1,n&&(l.lineStart(),l.point(e,t));else if(n&&v)l.point(e,t);else{var r={a:{x:g,y:m},b:{x:e,y:t}};x(r)?(v||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),n||l.lineEnd(),_=!1):n&&(l.lineStart(),l.point(e,t),_=!1)}g=e,m=t,v=n}return k};function i(r,i){return x(r[0]-e)<Se?i>0?0:3:x(r[0]-n)<Se?i>0?2:1:x(r[1]-t)<Se?i>0?1:0:i>0?3:2}function a(e,t){return s(e.x,t.x)}function s(e,t){var n=i(e,1),r=i(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}}function ur(e){var t=0,n=Ee/3,r=Fr(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*Ee/180,n=e[1]*Ee/180):[t/Ee*180,n/Ee*180]},i}function cr(e,t){var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),o=Math.sqrt(i)/r;function a(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),o-n*Math.cos(e)]}return a.invert=function(e,t){var n=o-t;return[Math.atan2(e,n)/r,$e((i-(e*e+n*n)*r*r)/(2*r))]},a}o.geo.clipExtent=function(){var e,t,n,r,i,o,a={stream:function(e){return i&&(i.valid=!1),(i=o(e)).valid=!0,i},extent:function(s){return arguments.length?(o=lr(e=+s[0][0],t=+s[0][1],n=+s[1][0],r=+s[1][1]),i&&(i.valid=!1,i=null),a):[[e,t],[n,r]]}};return a.extent([[0,0],[960,500]])},(o.geo.conicEqualArea=function(){return ur(cr)}).raw=cr,o.geo.albers=function(){return o.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},o.geo.albersUsa=function(){var e,t,n,r,i=o.geo.albers(),a=o.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=o.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};function u(i){var o=i[0],a=i[1];return e=null,t(o,a),e||(n(o,a),e)||r(o,a),e}return u.invert=function(e){var t=i.scale(),n=i.translate(),r=(e[0]-n[0])/t,o=(e[1]-n[1])/t;return(o>=.12&&o<.234&&r>=-.425&&r<-.214?a:o>=.166&&o<.234&&r>=-.214&&r<-.115?s:i).invert(e)},u.stream=function(e){var t=i.stream(e),n=a.stream(e),r=s.stream(e);return{point:function(e,i){t.point(e,i),n.point(e,i),r.point(e,i)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},u.precision=function(e){return arguments.length?(i.precision(e),a.precision(e),s.precision(e),u):i.precision()},u.scale=function(e){return arguments.length?(i.scale(e),a.scale(.35*e),s.scale(e),u.translate(i.translate())):i.scale()},u.translate=function(e){if(!arguments.length)return i.translate();var o=i.scale(),c=+e[0],d=+e[1];return t=i.translate(e).clipExtent([[c-.455*o,d-.238*o],[c+.455*o,d+.238*o]]).stream(l).point,n=a.translate([c-.307*o,d+.201*o]).clipExtent([[c-.425*o+Se,d+.12*o+Se],[c-.214*o-Se,d+.234*o-Se]]).stream(l).point,r=s.translate([c-.205*o,d+.212*o]).clipExtent([[c-.214*o+Se,d+.166*o+Se],[c-.115*o-Se,d+.234*o-Se]]).stream(l).point,u},u.scale(1070)};var dr,fr,pr,hr,gr,mr,vr={point:$,lineStart:$,lineEnd:$,polygonStart:function(){fr=0,vr.lineStart=yr},polygonEnd:function(){vr.lineStart=vr.lineEnd=vr.point=$,dr+=x(fr/2)}};function yr(){var e,t,n,r;function i(e,t){fr+=r*e-n*t,n=e,r=t}vr.point=function(o,a){vr.point=i,e=n=o,t=r=a},vr.lineEnd=function(){i(e,t)}}var _r={point:function(e,t){e<pr&&(pr=e),e>gr&&(gr=e),t<hr&&(hr=t),t>mr&&(mr=t)},lineStart:$,lineEnd:$,polygonStart:$,polygonEnd:$};function br(){var e=wr(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(t){return e=wr(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=o}function o(e,n){t.push("L",e,",",n)}function a(){n.point=r}function s(){t.push("Z")}return n}function wr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var xr,kr={point:Cr,lineStart:Dr,lineEnd:Sr,polygonStart:function(){kr.lineStart=Ar},polygonEnd:function(){kr.point=Cr,kr.lineStart=Dr,kr.lineEnd=Sr}};function Cr(e,t){Cn+=e,Dn+=t,++Sn}function Dr(){var e,t;function n(n,r){var i=n-e,o=r-t,a=Math.sqrt(i*i+o*o);An+=a*(e+n)/2,En+=a*(t+r)/2,Mn+=a,Cr(e=n,t=r)}kr.point=function(r,i){kr.point=n,Cr(e=r,t=i)}}function Sr(){kr.point=Cr}function Ar(){var e,t,n,r;function i(e,t){var i=e-n,o=t-r,a=Math.sqrt(i*i+o*o);An+=a*(n+e)/2,En+=a*(r+t)/2,Mn+=a,Tn+=(a=r*e-n*t)*(n+e),jn+=a*(r+t),Nn+=3*a,Cr(n=e,r=t)}kr.point=function(o,a){kr.point=i,Cr(e=n=o,t=r=a)},kr.lineEnd=function(){i(e,t)}}function Er(e){var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(e){return t=e,n},result:$};function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,Me)}function i(t,r){e.moveTo(t,r),n.point=o}function o(t,n){e.lineTo(t,n)}function a(){n.point=r}function s(){e.closePath()}return n}function Mr(e){var t=.5,n=Math.cos(30*Ne),r=16;function i(e){return(r?a:o)(e)}function o(t){return jr(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function a(t){var n,i,o,a,l,u,c,d,f,p,h,g,m={point:v,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),m.lineStart=w},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function v(n,r){n=e(n,r),t.point(n[0],n[1])}function y(){d=NaN,m.point=_,t.lineStart()}function _(n,i){var o=zn([n,i]),a=e(n,i);s(d,f,c,p,h,g,d=a[0],f=a[1],c=n,p=o[0],h=o[1],g=o[2],r,t),t.point(d,f)}function b(){m.point=v,t.lineEnd()}function w(){y(),m.point=x,m.lineEnd=k}function x(e,t){_(n=e,t),i=d,o=f,a=p,l=h,u=g,m.point=_}function k(){s(d,f,c,p,h,g,i,o,n,a,l,u,r,t),m.lineEnd=b,b()}return m}function s(r,i,o,a,l,u,c,d,f,p,h,g,m,v){var y=c-r,_=d-i,b=y*y+_*_;if(b>4*t&&m--){var w=a+p,k=l+h,C=u+g,D=Math.sqrt(w*w+k*k+C*C),S=Math.asin(C/=D),A=x(x(C)-1)<Se||x(o-f)<Se?(o+f)/2:Math.atan2(k,w),E=e(A,S),M=E[0],T=E[1],j=M-r,N=T-i,F=_*j-y*N;(F*F/b>t||x((y*j+_*N)/b-.5)>.3||a*p+l*h+u*g<n)&&(s(r,i,o,a,l,u,M,T,A,w/=D,k/=D,C,m,v),v.point(M,T),s(M,T,A,w,k,C,c,d,f,p,h,g,m,v))}}return i.precision=function(e){return arguments.length?(r=(t=e*e)>0&&16,i):Math.sqrt(t)},i}function Tr(e){this.stream=e}function jr(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Nr(e){return Fr(function(){return e})()}function Fr(e){var t,n,r,i,a,s,l=Mr(function(e,n){return[(e=t(e,n))[0]*u+i,a-e[1]*u]}),u=150,c=480,d=250,f=0,p=0,h=0,g=0,m=0,v=or,y=F,_=null,b=null;function w(e){return[(e=r(e[0]*Ne,e[1]*Ne))[0]*u+i,a-e[1]*u]}function k(e){return(e=r.invert((e[0]-i)/u,(a-e[1])/u))&&[e[0]*Fe,e[1]*Fe]}function C(){r=Kn(n=$r(h,g,m),t);var e=t(f,p);return i=c-e[0]*u,a=d+e[1]*u,D()}function D(){return s&&(s.valid=!1,s=null),w}return w.stream=function(e){return s&&(s.valid=!1),(s=Or(v(n,l(y(e))))).valid=!0,s},w.clipAngle=function(e){return arguments.length?(v=null==e?(_=e,or):function(e){var t=Math.cos(e),n=t>0,r=x(t)>Se;return tr(i,function(e){var t,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(d,f){var p,h=[d,f],g=i(d,f),m=n?g?0:a(d,f):g?a(d+(d<0?Ee:-Ee),f):0;if(!t&&(u=l=g)&&e.lineStart(),g!==l&&(p=o(t,h),(Un(t,p)||Un(h,p))&&(h[0]+=Se,h[1]+=Se,g=i(h[0],h[1]))),g!==l)c=0,g?(e.lineStart(),p=o(h,t),e.point(p[0],p[1])):(p=o(t,h),e.point(p[0],p[1]),e.lineEnd()),t=p;else if(r&&t&&n^g){var v;m&s||!(v=o(h,t,!0))||(c=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1])))}!g||t&&Un(t,h)||e.point(h[0],h[1]),t=h,l=g,s=m},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}},Lr(e,6*Ne),n?[0,-e]:[-Ee,e-Ee]);function i(e,n){return Math.cos(e)*Math.cos(n)>t}function o(e,n,r){var i=[1,0,0],o=qn(zn(e),zn(n)),a=$n(o,o),s=o[0],l=a-s*s;if(!l)return!r&&e;var u=t*a/l,c=-t*s/l,d=qn(i,o),f=Pn(i,u);Rn(f,Pn(o,c));var p=d,h=$n(f,p),g=$n(p,p),m=h*h-g*($n(f,f)-1);if(!(m<0)){var v=Math.sqrt(m),y=Pn(p,(-h-v)/g);if(Rn(y,f),y=Bn(y),!r)return y;var _,b=e[0],w=n[0],k=e[1],C=n[1];w<b&&(_=b,b=w,w=_);var D=w-b,S=x(D-Ee)<Se;if(!S&&C<k&&(_=k,k=C,C=_),S||D<Se?S?k+C>0^y[1]<(x(y[0]-b)<Se?k:C):k<=y[1]&&y[1]<=C:D>Ee^(b<=y[0]&&y[0]<=w)){var A=Pn(p,(-h+v)/g);return Rn(A,f),[y,Bn(A)]}}}function a(t,r){var i=n?e:Ee-e,o=0;return t<-i?o|=1:t>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}}((_=+e)*Ne),D()):_},w.clipExtent=function(e){return arguments.length?(b=e,y=e?lr(e[0][0],e[0][1],e[1][0],e[1][1]):F,D()):b},w.scale=function(e){return arguments.length?(u=+e,C()):u},w.translate=function(e){return arguments.length?(c=+e[0],d=+e[1],C()):[c,d]},w.center=function(e){return arguments.length?(f=e[0]%360*Ne,p=e[1]%360*Ne,C()):[f*Fe,p*Fe]},w.rotate=function(e){return arguments.length?(h=e[0]%360*Ne,g=e[1]%360*Ne,m=e.length>2?e[2]%360*Ne:0,C()):[h*Fe,g*Fe,m*Fe]},o.rebind(w,l,"precision"),function(){return t=e.apply(this,arguments),w.invert=t.invert&&k,C()}}function Or(e){return jr(e,function(t,n){e.point(t*Ne,n*Ne)})}function Ir(e,t){return[e,t]}function zr(e,t){return[e>Ee?e-Me:e<-Ee?e+Me:e,t]}function $r(e,t,n){return e?t||n?Kn(Rr(e),Pr(t,n)):Rr(e):t||n?Pr(t,n):zr}function qr(e){return function(t,n){return[(t+=e)>Ee?t-Me:t<-Ee?t+Me:t,n]}}function Rr(e){var t=qr(e);return t.invert=qr(-e),t}function Pr(e,t){var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),o=Math.sin(t);function a(e,t){var a=Math.cos(t),s=Math.cos(e)*a,l=Math.sin(e)*a,u=Math.sin(t),c=u*n+s*r;return[Math.atan2(l*i-c*o,s*n-u*r),$e(c*i+l*o)]}return a.invert=function(e,t){var a=Math.cos(t),s=Math.cos(e)*a,l=Math.sin(e)*a,u=Math.sin(t),c=u*i-l*o;return[Math.atan2(l*i+u*o,s*n+c*r),$e(c*n-s*r)]},a}function Lr(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,o,a,s){var l=a*t;null!=i?(i=Br(n,i),o=Br(n,o),(a>0?i<o:i>o)&&(i+=a*Me)):(i=e+a*Me,o=e-.5*l);for(var u,c=i;a>0?c>o:c<o;c-=l)s.point((u=Bn([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function Br(e,t){var n=zn(t);n[0]-=e,Ln(n);var r=ze(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Se)%(2*Math.PI)}function Ur(e,t,n){var r=o.range(e,t-Se,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function Vr(e,t,n){var r=o.range(e,t-Se,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function Hr(e){return e.source}function Wr(e){return e.target}o.geo.path=function(){var e,t,n,r,i,a=4.5;function s(e){return e&&("function"==typeof a&&r.pointRadius(+a.apply(this,arguments)),i&&i.valid||(i=n(r)),o.geo.stream(e,i)),r.result()}function l(){return i=null,s}return s.area=function(e){return dr=0,o.geo.stream(e,n(vr)),dr},s.centroid=function(e){return Cn=Dn=Sn=An=En=Mn=Tn=jn=Nn=0,o.geo.stream(e,n(kr)),Nn?[Tn/Nn,jn/Nn]:Mn?[An/Mn,En/Mn]:Sn?[Cn/Sn,Dn/Sn]:[NaN,NaN]},s.bounds=function(e){return gr=mr=-(pr=hr=1/0),o.geo.stream(e,n(_r)),[[pr,hr],[gr,mr]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,i=Mr(function(e,t){return r([e*Fe,t*Fe])}),function(e){return Or(i(e))}):F,l()):e;var r,i},s.context=function(e){return arguments.length?(r=null==(t=e)?new br:new Er(e),"function"!=typeof a&&r.pointRadius(a),l()):t},s.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(r.pointRadius(+e),+e),s):a},s.projection(o.geo.albersUsa()).context(null)},o.geo.transform=function(e){return{stream:function(t){var n=new Tr(t);for(var r in e)n[r]=e[r];return n}}},Tr.prototype={point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},o.geo.projection=Nr,o.geo.projectionMutator=Fr,(o.geo.equirectangular=function(){return Nr(Ir)}).raw=Ir.invert=Ir,o.geo.rotation=function(e){function t(t){return(t=e(t[0]*Ne,t[1]*Ne))[0]*=Fe,t[1]*=Fe,t}return e=$r(e[0]%360*Ne,e[1]*Ne,e.length>2?e[2]*Ne:0),t.invert=function(t){return(t=e.invert(t[0]*Ne,t[1]*Ne))[0]*=Fe,t[1]*=Fe,t},t},zr.invert=Ir,o.geo.circle=function(){var e,t,n=[0,0],r=6;function i(){var e="function"==typeof n?n.apply(this,arguments):n,r=$r(-e[0]*Ne,-e[1]*Ne,0).invert,i=[];return t(null,null,1,{point:function(e,t){i.push(e=r(e,t)),e[0]*=Fe,e[1]*=Fe}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(e){return arguments.length?(n=e,i):n},i.angle=function(n){return arguments.length?(t=Lr((e=+n)*Ne,r*Ne),i):e},i.precision=function(n){return arguments.length?(t=Lr(e*Ne,(r=+n)*Ne),i):r},i.angle(90)},o.geo.distance=function(e,t){var n,r=(t[0]-e[0])*Ne,i=e[1]*Ne,o=t[1]*Ne,a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),d=Math.cos(o);return Math.atan2(Math.sqrt((n=d*a)*n+(n=u*c-l*d*s)*n),l*c+u*d*s)},o.geo.graticule=function(){var e,t,n,r,i,a,s,l,u,c,d,f,p=10,h=p,g=90,m=360,v=2.5;function y(){return{type:"MultiLineString",coordinates:_()}}function _(){return o.range(Math.ceil(r/g)*g,n,g).map(d).concat(o.range(Math.ceil(l/m)*m,s,m).map(f)).concat(o.range(Math.ceil(t/p)*p,e,p).filter(function(e){return x(e%g)>Se}).map(u)).concat(o.range(Math.ceil(a/h)*h,i,h).filter(function(e){return x(e%m)>Se}).map(c))}return y.lines=function(){return _().map(function(e){return{type:"LineString",coordinates:e}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(f(s).slice(1),d(n).reverse().slice(1),f(l).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.majorExtent(e).minorExtent(e):y.minorExtent()},y.majorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],l=+e[0][1],s=+e[1][1],r>n&&(e=r,r=n,n=e),l>s&&(e=l,l=s,s=e),y.precision(v)):[[r,l],[n,s]]},y.minorExtent=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],a=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),a>i&&(n=a,a=i,i=n),y.precision(v)):[[t,a],[e,i]]},y.step=function(e){return arguments.length?y.majorStep(e).minorStep(e):y.minorStep()},y.majorStep=function(e){return arguments.length?(g=+e[0],m=+e[1],y):[g,m]},y.minorStep=function(e){return arguments.length?(p=+e[0],h=+e[1],y):[p,h]},y.precision=function(o){return arguments.length?(v=+o,u=Ur(a,i,90),c=Vr(t,e,v),d=Ur(l,s,90),f=Vr(r,n,v),y):v},y.majorExtent([[-180,-90+Se],[180,90-Se]]).minorExtent([[-180,-80-Se],[180,80+Se]])},o.geo.greatArc=function(){var e,t,n=Hr,r=Wr;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),t||r.apply(this,arguments)]}}return i.distance=function(){return o.geo.distance(e||n.apply(this,arguments),t||r.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,i):r},i.precision=function(){return arguments.length?i:0},i},o.geo.interpolate=function(e,t){return n=e[0]*Ne,r=e[1]*Ne,i=t[0]*Ne,o=t[1]*Ne,a=Math.cos(r),s=Math.sin(r),l=Math.cos(o),u=Math.sin(o),c=a*Math.cos(n),d=a*Math.sin(n),f=l*Math.cos(i),p=l*Math.sin(i),h=2*Math.asin(Math.sqrt(Re(o-r)+a*l*Re(i-n))),g=1/Math.sin(h),(m=h?function(e){var t=Math.sin(e*=h)*g,n=Math.sin(h-e)*g,r=n*c+t*f,i=n*d+t*p,o=n*s+t*u;return[Math.atan2(i,r)*Fe,Math.atan2(o,Math.sqrt(r*r+i*i))*Fe]}:function(){return[n*Fe,r*Fe]}).distance=h,m;var n,r,i,o,a,s,l,u,c,d,f,p,h,g,m},o.geo.length=function(e){return xr=0,o.geo.stream(e,Gr),xr};var Gr={sphere:$,point:$,lineStart:function(){var e,t,n;function r(r,i){var o=Math.sin(i*=Ne),a=Math.cos(i),s=x((r*=Ne)-e),l=Math.cos(s);xr+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=n*o-t*a*l)*s),t*o+n*a*l),e=r,t=o,n=a}Gr.point=function(i,o){e=i*Ne,t=Math.sin(o*=Ne),n=Math.cos(o),Gr.point=r},Gr.lineEnd=function(){Gr.point=Gr.lineEnd=$}},lineEnd:$,polygonStart:$,polygonEnd:$};function Yr(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),o=e(r*i);return[o*i*Math.sin(t),o*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(e*o,r*a),Math.asin(r&&n*o/r)]},n}var Qr=Yr(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(o.geo.azimuthalEqualArea=function(){return Nr(Qr)}).raw=Qr;var Kr=Yr(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},F);function Zr(e,t){var n=Math.cos(e),r=function(e){return Math.tan(Ee/4+e/2)},i=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),o=n*Math.pow(r(e),i)/i;if(!i)return ei;function a(e,t){o>0?t<-je+Se&&(t=-je+Se):t>je-Se&&(t=je-Se);var n=o/Math.pow(r(t),i);return[n*Math.sin(i*e),o-n*Math.cos(i*e)]}return a.invert=function(e,t){var n=o-t,r=Oe(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(o/r,1/i))-je]},a}function Xr(e,t){var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),i=n/r+e;if(x(r)<Se)return Ir;function o(e,t){var n=i-t;return[n*Math.sin(r*e),i-n*Math.cos(r*e)]}return o.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,i-Oe(r)*Math.sqrt(e*e+n*n)]},o}(o.geo.azimuthalEquidistant=function(){return Nr(Kr)}).raw=Kr,(o.geo.conicConformal=function(){return ur(Zr)}).raw=Zr,(o.geo.conicEquidistant=function(){return ur(Xr)}).raw=Xr;var Jr=Yr(function(e){return 1/e},Math.atan);function ei(e,t){return[e,Math.log(Math.tan(Ee/4+t/2))]}function ti(e){var t,n=Nr(e),r=n.scale,i=n.translate,o=n.clipExtent;return n.scale=function(){var e=r.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.translate=function(){var e=i.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.clipExtent=function(e){var a=o.apply(n,arguments);if(a===n){if(t=null==e){var s=Ee*r(),l=i();o([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else t&&(a=null);return a},n.clipExtent(null)}(o.geo.gnomonic=function(){return Nr(Jr)}).raw=Jr,ei.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-je]},(o.geo.mercator=function(){return ti(ei)}).raw=ei;var ni=Yr(function(){return 1},Math.asin);(o.geo.orthographic=function(){return Nr(ni)}).raw=ni;var ri=Yr(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});function ii(e,t){return[Math.log(Math.tan(Ee/4+t/2)),-e]}function oi(e){return e[0]}function ai(e){return e[1]}function si(e){for(var t=e.length,n=[0,1],r=2,i=2;i<t;i++){for(;r>1&&Ie(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function li(e,t){return e[0]-t[0]||e[1]-t[1]}(o.geo.stereographic=function(){return Nr(ri)}).raw=ri,ii.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-je]},(o.geo.transverseMercator=function(){var e=ti(ii),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90])}).raw=ii,o.geom={},o.geom.hull=function(e){var t=oi,n=ai;if(arguments.length)return r(e);function r(e){if(e.length<3)return[];var r,i=yt(t),o=yt(n),a=e.length,s=[],l=[];for(r=0;r<a;r++)s.push([+i.call(this,e[r],r),+o.call(this,e[r],r),r]);for(s.sort(li),r=0;r<a;r++)l.push([s[r][0],-s[r][1]]);var u=si(s),c=si(l),d=c[0]===u[0],f=c[c.length-1]===u[u.length-1],p=[];for(r=u.length-1;r>=0;--r)p.push(e[s[u[r]][2]]);for(r=+d;r<c.length-f;++r)p.push(e[s[c[r]][2]]);return p}return r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r},o.geom.polygon=function(e){return V(e,ui),e};var ui=o.geom.polygon.prototype=[];function ci(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function di(e,t,n,r){var i=e[0],o=n[0],a=t[0]-i,s=r[0]-o,l=e[1],u=n[1],c=t[1]-l,d=r[1]-u,f=(s*(l-u)-d*(i-o))/(d*a-s*c);return[i+f*a,l+f*c]}function fi(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}ui.area=function(){for(var e,t=-1,n=this.length,r=this[n-1],i=0;++t<n;)e=r,r=this[t],i+=e[1]*r[0]-e[0]*r[1];return.5*i},ui.centroid=function(e){var t,n,r=-1,i=this.length,o=0,a=0,s=this[i-1];for(arguments.length||(e=-1/(6*this.area()));++r<i;)t=s,s=this[r],n=t[0]*s[1]-s[0]*t[1],o+=(t[0]+s[0])*n,a+=(t[1]+s[1])*n;return[o*e,a*e]},ui.clip=function(e){for(var t,n,r,i,o,a,s=fi(e),l=-1,u=this.length-fi(this),c=this[u-1];++l<u;){for(t=e.slice(),e.length=0,i=this[l],o=t[(r=t.length-s)-1],n=-1;++n<r;)ci(a=t[n],c,i)?(ci(o,c,i)||e.push(di(o,a,c,i)),e.push(a)):ci(o,c,i)&&e.push(di(o,a,c,i)),o=a;s&&e.push(e[0]),c=i}return e};var pi,hi,gi,mi,vi,yi=[],_i=[];function bi(){Ri(this),this.edge=this.site=this.circle=null}function wi(e){var t=yi.pop()||new bi;return t.site=e,t}function xi(e){ji(e),gi.remove(e),yi.push(e),Ri(e)}function ki(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},o=e.P,a=e.N,s=[e];xi(e);for(var l=o;l.circle&&x(n-l.circle.x)<Se&&x(r-l.circle.cy)<Se;)o=l.P,s.unshift(l),xi(l),l=o;s.unshift(l),ji(l);for(var u=a;u.circle&&x(n-u.circle.x)<Se&&x(r-u.circle.cy)<Se;)a=u.N,s.push(u),xi(u),u=a;s.push(u),ji(u);var c,d=s.length;for(c=1;c<d;++c)u=s[c],l=s[c-1],zi(u.edge,l.site,u.site,i);l=s[0],(u=s[d-1]).edge=Oi(l.site,u.site,null,i),Ti(l),Ti(u)}function Ci(e){for(var t,n,r,i,o=e.x,a=e.y,s=gi._;s;)if((r=Di(s,a)-o)>Se)s=s.L;else{if(!((i=o-Si(s,a))>Se)){r>-Se?(t=s.P,n=s):i>-Se?(t=s,n=s.N):t=n=s;break}if(!s.R){t=s;break}s=s.R}var l=wi(e);if(gi.insert(t,l),t||n){if(t===n)return ji(t),n=wi(t.site),gi.insert(l,n),l.edge=n.edge=Oi(t.site,l.site),Ti(t),void Ti(n);if(n){ji(t),ji(n);var u=t.site,c=u.x,d=u.y,f=e.x-c,p=e.y-d,h=n.site,g=h.x-c,m=h.y-d,v=2*(f*m-p*g),y=f*f+p*p,_=g*g+m*m,b={x:(m*y-p*_)/v+c,y:(f*_-g*y)/v+d};zi(n.edge,u,h,b),l.edge=Oi(u,e,null,b),n.edge=Oi(e,h,null,b),Ti(t),Ti(n)}else l.edge=Oi(t.site,l.site)}}function Di(e,t){var n=e.site,r=n.x,i=n.y,o=i-t;if(!o)return r;var a=e.P;if(!a)return-1/0;var s=(n=a.site).x,l=n.y,u=l-t;if(!u)return s;var c=s-r,d=1/o-1/u,f=c/u;return d?(-f+Math.sqrt(f*f-2*d*(c*c/(-2*u)-l+u/2+i-o/2)))/d+r:(r+s)/2}function Si(e,t){var n=e.N;if(n)return Di(n,t);var r=e.site;return r.y===t?r.x:1/0}function Ai(e){this.site=e,this.edges=[]}function Ei(e,t){return t.angle-e.angle}function Mi(){Ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ti(e){var t=e.P,n=e.N;if(t&&n){var r=t.site,i=e.site,o=n.site;if(r!==o){var a=i.x,s=i.y,l=r.x-a,u=r.y-s,c=o.x-a,d=2*(l*(m=o.y-s)-u*c);if(!(d>=-Ae)){var f=l*l+u*u,p=c*c+m*m,h=(m*f-u*p)/d,g=(l*p-c*f)/d,m=g+s,v=_i.pop()||new Mi;v.arc=e,v.site=i,v.x=h+a,v.y=m+Math.sqrt(h*h+g*g),v.cy=m,e.circle=v;for(var y=null,_=vi._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){y=_.P;break}_=_.L}else{if(!_.R){y=_;break}_=_.R}vi.insert(y,v),y||(mi=v)}}}}function ji(e){var t=e.circle;t&&(t.P||(mi=t.N),vi.remove(t),_i.push(t),Ri(t),e.circle=null)}function Ni(e,t){var n=e.b;if(n)return!0;var r,i,o=e.a,a=t[0][0],s=t[1][0],l=t[0][1],u=t[1][1],c=e.l,d=e.r,f=c.x,p=c.y,h=d.x,g=d.y,m=(f+h)/2,v=(p+g)/2;if(g===p){if(m<a||m>=s)return;if(f>h){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.y<l)return}else o={x:m,y:u};n={x:m,y:l}}}else if(i=v-(r=(f-h)/(g-p))*m,r<-1||r>1)if(f>h){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/r,y:u};n={x:(l-i)/r,y:l}}else if(p<g){if(o){if(o.x>=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.x<a)return}else o={x:s,y:r*s+i};n={x:a,y:r*a+i}}return e.a=o,e.b=n,!0}function Fi(e,t){this.l=e,this.r=t,this.a=this.b=null}function Oi(e,t,n,r){var i=new Fi(e,t);return pi.push(i),n&&zi(i,e,t,n),r&&zi(i,t,e,r),hi[e.i].edges.push(new $i(i,e,t)),hi[t.i].edges.push(new $i(i,t,e)),i}function Ii(e,t,n){var r=new Fi(e,null);return r.a=t,r.b=n,pi.push(r),r}function zi(e,t,n,r){e.a||e.b?e.l===n?e.b=r:e.a=r:(e.a=r,e.l=t,e.r=n)}function $i(e,t,n){var r=e.a,i=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function qi(){this._=null}function Ri(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Pi(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Li(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Bi(e){for(;e.L;)e=e.L;return e}function Ui(e,t){var n,r,i,o=e.sort(Vi).pop();for(pi=[],hi=new Array(e.length),gi=new qi,vi=new qi;;)if(i=mi,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===n&&o.y===r||(hi[o.i]=new Ai(o),Ci(o),n=o.x,r=o.y),o=e.pop();else{if(!i)break;ki(i.arc)}t&&(function(e){for(var t,n=pi,r=ar(e[0][0],e[0][1],e[1][0],e[1][1]),i=n.length;i--;)(!Ni(t=n[i],e)||!r(t)||x(t.a.x-t.b.x)<Se&&x(t.a.y-t.b.y)<Se)&&(t.a=t.b=null,n.splice(i,1))}(t),function(e){for(var t,n,r,i,o,a,s,l,u,c,d=e[0][0],f=e[1][0],p=e[0][1],h=e[1][1],g=hi,m=g.length;m--;)if((o=g[m])&&o.prepare())for(l=(s=o.edges).length,a=0;a<l;)r=(c=s[a].end()).x,i=c.y,t=(u=s[++a%l].start()).x,n=u.y,(x(r-t)>Se||x(i-n)>Se)&&(s.splice(a,0,new $i(Ii(o.site,c,x(r-d)<Se&&h-i>Se?{x:d,y:x(t-d)<Se?n:h}:x(i-h)<Se&&f-r>Se?{x:x(n-h)<Se?t:f,y:h}:x(r-f)<Se&&i-p>Se?{x:f,y:x(t-f)<Se?n:p}:x(i-p)<Se&&r-d>Se?{x:x(n-p)<Se?t:d,y:p}:null),o.site,null)),++l)}(t));var a={cells:hi,edges:pi};return gi=vi=pi=hi=null,a}function Vi(e,t){return t.y-e.y||t.x-e.x}Ai.prototype.prepare=function(){for(var e,t=this.edges,n=t.length;n--;)(e=t[n].edge).b&&e.a||t.splice(n,1);return t.sort(Ei),t.length},$i.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},qi.prototype={insert:function(e,t){var n,r,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=Bi(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(Pi(this,n),n=(e=n).U),n.C=!1,r.C=!0,Li(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(Li(this,n),n=(e=n).U),n.C=!1,r.C=!0,Pi(this,r)),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,n,r,i=e.U,o=e.L,a=e.R;if(n=o?a?Bi(a):o:a,i?i.L===e?i.L=n:i.R=n:this._=n,o&&a?(r=n.C,n.C=e.C,n.L=o,o.U=n,n!==a?(i=n.U,n.U=e.U,e=n.R,i.L=e,n.R=a,a.U=n):(n.U=i,i=n,e=n.R)):(r=e.C,e=n),e&&(e.U=i),!r)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,Pi(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Li(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,Pi(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,Li(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Pi(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,Li(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},o.geom.voronoi=function(e){var t=oi,n=ai,r=t,i=n,o=Hi;if(e)return a(e);function a(e){var t=new Array(e.length),n=o[0][0],r=o[0][1],i=o[1][0],a=o[1][1];return Ui(s(e),o).cells.forEach(function(o,s){var l=o.edges,u=o.site;(t[s]=l.length?l.map(function(e){var t=e.start();return[t.x,t.y]}):u.x>=n&&u.x<=i&&u.y>=r&&u.y<=a?[[n,a],[i,a],[i,r],[n,r]]:[]).point=e[s]}),t}function s(e){return e.map(function(e,t){return{x:Math.round(r(e,t)/Se)*Se,y:Math.round(i(e,t)/Se)*Se,i:t}})}return a.links=function(e){return Ui(s(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},a.triangles=function(e){var t=[];return Ui(s(e)).cells.forEach(function(n,r){for(var i,o=n.site,a=n.edges.sort(Ei),s=-1,l=a.length,u=a[l-1].edge,c=u.l===o?u.r:u.l;++s<l;)i=c,c=(u=a[s].edge).l===o?u.r:u.l,r<i.i&&r<c.i&&Wi(o,i,c)<0&&t.push([e[r],e[i.i],e[c.i]])}),t},a.x=function(e){return arguments.length?(r=yt(t=e),a):t},a.y=function(e){return arguments.length?(i=yt(n=e),a):n},a.clipExtent=function(e){return arguments.length?(o=null==e?Hi:e,a):o===Hi?null:o},a.size=function(e){return arguments.length?a.clipExtent(e&&[[0,0],e]):o===Hi?null:o&&o[1]},a};var Hi=[[-1e6,-1e6],[1e6,1e6]];function Wi(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}function Gi(e){return e.x}function Yi(e){return e.y}function Qi(e,t,n,r,i,o){if(!e(t,n,r,i,o)){var a=.5*(n+i),s=.5*(r+o),l=t.nodes;l[0]&&Qi(e,l[0],n,r,a,s),l[1]&&Qi(e,l[1],a,r,i,s),l[2]&&Qi(e,l[2],n,s,a,o),l[3]&&Qi(e,l[3],a,s,i,o)}}function Ki(e,t){e=o.rgb(e),t=o.rgb(t);var n=e.r,r=e.g,i=e.b,a=t.r-n,s=t.g-r,l=t.b-i;return function(e){return"#"+dt(Math.round(n+a*e))+dt(Math.round(r+s*e))+dt(Math.round(i+l*e))}}function Zi(e,t){var n,r={},i={};for(n in e)n in t?r[n]=no(e[n],t[n]):i[n]=e[n];for(n in t)n in e||(i[n]=t[n]);return function(e){for(n in r)i[n]=r[n](e);return i}}function Xi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ji(e,t){var n,r,i,o=eo.lastIndex=to.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=eo.exec(e))&&(r=to.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Xi(n,r)})),o=to.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?(t=l[0].x,function(e){return t(e)+""}):function(){return t}:(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}o.geom.delaunay=function(e){return o.geom.voronoi().triangles(e)},o.geom.quadtree=function(e,t,n,r,i){var o,a=oi,s=ai;if(o=arguments.length)return a=Gi,s=Yi,3===o&&(i=n,r=t,n=t=0),l(e);function l(e){var l,u,c,d,f,p,h,g,m,v=yt(a),y=yt(s);if(null!=t)p=t,h=n,g=r,m=i;else if(g=m=-(p=h=1/0),u=[],c=[],f=e.length,o)for(d=0;d<f;++d)(l=e[d]).x<p&&(p=l.x),l.y<h&&(h=l.y),l.x>g&&(g=l.x),l.y>m&&(m=l.y),u.push(l.x),c.push(l.y);else for(d=0;d<f;++d){var _=+v(l=e[d],d),b=+y(l,d);_<p&&(p=_),b<h&&(h=b),_>g&&(g=_),b>m&&(m=b),u.push(_),c.push(b)}var w=g-p,k=m-h;function C(e,t,n,r,i,o,a,s){if(!isNaN(n)&&!isNaN(r))if(e.leaf){var l=e.x,u=e.y;if(null!=l)if(x(l-n)+x(u-r)<.01)D(e,t,n,r,i,o,a,s);else{var c=e.point;e.x=e.y=e.point=null,D(e,c,l,u,i,o,a,s),D(e,t,n,r,i,o,a,s)}else e.x=n,e.y=r,e.point=t}else D(e,t,n,r,i,o,a,s)}function D(e,t,n,r,i,o,a,s){var l=.5*(i+a),u=.5*(o+s),c=n>=l,d=r>=u,f=d<<1|c;e.leaf=!1,c?i=l:a=l,d?o=u:s=u,C(e=e.nodes[f]||(e.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,n,r,i,o,a,s)}w>k?m=h+w:g=p+k;var S={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){C(S,e,+v(e,++d),+y(e,d),p,h,g,m)}};if(S.visit=function(e){Qi(e,S,p,h,g,m)},S.find=function(e){return function(e,t,n,r,i,o,a){var s,l=1/0;return function e(u,c,d,f,p){if(!(c>o||d>a||f<r||p<i)){if(h=u.point){var h,g=t-u.x,m=n-u.y,v=g*g+m*m;if(v<l){var y=Math.sqrt(l=v);r=t-y,i=n-y,o=t+y,a=n+y,s=h}}for(var _=u.nodes,b=.5*(c+f),w=.5*(d+p),x=(n>=w)<<1|t>=b,k=x+4;x<k;++x)if(u=_[3&x])switch(3&x){case 0:e(u,c,d,b,w);break;case 1:e(u,b,d,f,w);break;case 2:e(u,c,w,b,p);break;case 3:e(u,b,w,f,p)}}}(e,r,i,o,a),s}(S,e[0],e[1],p,h,g,m)},d=-1,null==t){for(;++d<f;)C(S,e[d],u[d],c[d],p,h,g,m);--d}else e.forEach(S.add);return u=c=e=l=null,S}return l.x=function(e){return arguments.length?(a=e,l):a},l.y=function(e){return arguments.length?(s=e,l):s},l.extent=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),l):null==t?null:[[t,n],[r,i]]},l.size=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),l):null==t?null:[r-t,i-n]},l},o.interpolateRgb=Ki,o.interpolateObject=Zi,o.interpolateNumber=Xi,o.interpolateString=Ji;var eo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,to=new RegExp(eo.source,"g");function no(e,t){for(var n,r=o.interpolators.length;--r>=0&&!(n=o.interpolators[r](e,t)););return n}function ro(e,t){var n,r=[],i=[],o=e.length,a=t.length,s=Math.min(e.length,t.length);for(n=0;n<s;++n)r.push(no(e[n],t[n]));for(;n<o;++n)i[n]=e[n];for(;n<a;++n)i[n]=t[n];return function(e){for(n=0;n<s;++n)i[n]=r[n](e);return i}}o.interpolate=no,o.interpolators=[function(e,t){var n=typeof t;return("string"===n?vt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?Ki:Ji:t instanceof Ve?Ki:Array.isArray(t)?ro:"object"===n&&isNaN(t)?Zi:Xi)(e,t)}],o.interpolateArray=ro;var io=function(){return F},oo=o.map({linear:io,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return uo},cubic:function(){return co},sin:function(){return po},exp:function(){return ho},circle:function(){return go},elastic:function(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Me*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Me/t)}},back:function(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}},bounce:function(){return mo}}),ao=o.map({in:F,out:so,"in-out":lo,"out-in":function(e){return lo(so(e))}});function so(e){return function(t){return 1-e(1-t)}}function lo(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function uo(e){return e*e}function co(e){return e*e*e}function fo(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function po(e){return 1-Math.cos(e*je)}function ho(e){return Math.pow(2,10*(e-1))}function go(e){return 1-Math.sqrt(1-e*e)}function mo(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function vo(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function yo(e){var t,n,r,i=[e.a,e.b],o=[e.c,e.d],a=bo(i),s=_o(i,o),l=bo(((t=o)[0]+=(r=-s)*(n=i)[0],t[1]+=r*n[1],t))||0;i[0]*o[1]<o[0]*i[1]&&(i[0]*=-1,i[1]*=-1,a*=-1,s*=-1),this.rotate=(a?Math.atan2(i[1],i[0]):Math.atan2(-o[0],o[1]))*Fe,this.translate=[e.e,e.f],this.scale=[a,l],this.skew=l?Math.atan2(s,l)*Fe:0}function _o(e,t){return e[0]*t[0]+e[1]*t[1]}function bo(e){var t=Math.sqrt(_o(e,e));return t&&(e[0]/=t,e[1]/=t),t}o.ease=function(e){var t,n=e.indexOf("-"),r=n>=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):"in";return r=oo.get(r)||io,i=ao.get(i)||F,t=i(r.apply(null,a.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},o.interpolateHcl=function(e,t){e=o.hcl(e),t=o.hcl(t);var n=e.h,r=e.c,i=e.l,a=t.h-n,s=t.c-r,l=t.l-i;return isNaN(s)&&(s=0,r=isNaN(r)?t.c:r),isNaN(a)?(a=0,n=isNaN(n)?t.h:n):a>180?a-=360:a<-180&&(a+=360),function(e){return Ke(n+a*e,r+s*e,i+l*e)+""}},o.interpolateHsl=function(e,t){e=o.hsl(e),t=o.hsl(t);var n=e.h,r=e.s,i=e.l,a=t.h-n,s=t.s-r,l=t.l-i;return isNaN(s)&&(s=0,r=isNaN(r)?t.s:r),isNaN(a)?(a=0,n=isNaN(n)?t.h:n):a>180?a-=360:a<-180&&(a+=360),function(e){return Ge(n+a*e,r+s*e,i+l*e)+""}},o.interpolateLab=function(e,t){e=o.lab(e),t=o.lab(t);var n=e.l,r=e.a,i=e.b,a=t.l-n,s=t.a-r,l=t.b-i;return function(e){return rt(n+a*e,r+s*e,i+l*e)+""}},o.interpolateRound=vo,o.transform=function(e){var t=l.createElementNS(o.ns.prefix.svg,"g");return(o.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new yo(n?n.matrix:wo)})(e)},yo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var wo={a:1,b:0,c:0,d:1,e:0,f:0};function xo(e){return e.length?e.pop()+",":""}function ko(e,t){var n=[],r=[];return e=o.transform(e),t=o.transform(t),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:Xi(e[0],t[0])},{i:i-2,x:Xi(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}(e.translate,t.translate,n,r),function(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(xo(n)+"rotate(",null,")")-2,x:Xi(e,t)})):t&&n.push(xo(n)+"rotate("+t+")")}(e.rotate,t.rotate,n,r),function(e,t,n,r){e!==t?r.push({i:n.push(xo(n)+"skewX(",null,")")-2,x:Xi(e,t)}):t&&n.push(xo(n)+"skewX("+t+")")}(e.skew,t.skew,n,r),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(xo(n)+"scale(",null,",",null,")");r.push({i:i-4,x:Xi(e[0],t[0])},{i:i-2,x:Xi(e[1],t[1])})}else 1===t[0]&&1===t[1]||n.push(xo(n)+"scale("+t+")")}(e.scale,t.scale,n,r),e=t=null,function(e){for(var t,i=-1,o=r.length;++i<o;)n[(t=r[i]).i]=t.x(e);return n.join("")}}function Co(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function Do(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function So(e){for(var t=e.source,n=e.target,r=function(e,t){if(e===t)return e;for(var n=Ao(e),r=Ao(t),i=n.pop(),o=r.pop(),a=null;i===o;)a=i,i=n.pop(),o=r.pop();return a}(t,n),i=[t];t!==r;)t=t.parent,i.push(t);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function Ao(e){for(var t=[],n=e.parent;null!=n;)t.push(e),e=n,n=n.parent;return t.push(e),t}function Eo(e){e.fixed|=2}function Mo(e){e.fixed&=-7}function To(e){e.fixed|=4,e.px=e.x,e.py=e.y}function jo(e){e.fixed&=-5}function No(e,t,n){var r=0,i=0;if(e.charge=0,!e.leaf)for(var o,a=e.nodes,s=a.length,l=-1;++l<s;)null!=(o=a[l])&&(No(o,t,n),e.charge+=o.charge,r+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=t*n[e.point.index];e.charge+=e.pointCharge=u,r+=u*e.point.x,i+=u*e.point.y}e.cx=r/e.charge,e.cy=i/e.charge}o.interpolateTransform=ko,o.layout={},o.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++n<r;)t.push(So(e[n]));return t}},o.layout.chord=function(){var e,t,n,r,i,a,s,l={},u=0;function c(){var l,c,f,p,h,g={},m=[],v=o.range(r),y=[];for(e=[],t=[],l=0,p=-1;++p<r;){for(c=0,h=-1;++h<r;)c+=n[p][h];m.push(c),y.push(o.range(r)),l+=c}for(i&&v.sort(function(e,t){return i(m[e],m[t])}),a&&y.forEach(function(e,t){e.sort(function(e,r){return a(n[t][e],n[t][r])})}),l=(Me-u*r)/l,c=0,p=-1;++p<r;){for(f=c,h=-1;++h<r;){var _=v[p],b=y[_][h],w=n[_][b],x=c,k=c+=w*l;g[_+"-"+b]={index:_,subindex:b,startAngle:x,endAngle:k,value:w}}t[_]={index:_,startAngle:f,endAngle:c,value:m[_]},c+=u}for(p=-1;++p<r;)for(h=p-1;++h<r;){var C=g[p+"-"+h],D=g[h+"-"+p];(C.value||D.value)&&e.push(C.value<D.value?{source:D,target:C}:{source:C,target:D})}s&&d()}function d(){e.sort(function(e,t){return s((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}return l.matrix=function(i){return arguments.length?(r=(n=i)&&n.length,e=t=null,l):n},l.padding=function(n){return arguments.length?(u=n,e=t=null,l):u},l.sortGroups=function(n){return arguments.length?(i=n,e=t=null,l):i},l.sortSubgroups=function(t){return arguments.length?(a=t,e=null,l):a},l.sortChords=function(t){return arguments.length?(s=t,e&&d(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return t||c(),t},l},o.layout.force=function(){var e,t,n,r,i,a,s={},l=o.dispatch("start","tick","end"),u=[1,1],c=.9,d=Fo,f=Oo,p=-30,h=Io,g=.1,m=.64,v=[],y=[];function _(e){return function(t,n,r,i){if(t.point!==e){var o=t.cx-e.x,a=t.cy-e.y,s=i-n,l=o*o+a*a;if(s*s/m<l){if(l<h){var u=t.charge/l;e.px-=o*u,e.py-=a*u}return!0}t.point&&l&&l<h&&(u=t.pointCharge/l,e.px-=o*u,e.py-=a*u)}return!t.charge}}function b(e){e.px=o.event.x,e.py=o.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var t,s,d,f,h,m,b,w,x,k=v.length,C=y.length;for(s=0;s<C;++s)f=(d=y[s]).source,(m=(w=(h=d.target).x-f.x)*w+(x=h.y-f.y)*x)&&(w*=m=n*i[s]*((m=Math.sqrt(m))-r[s])/m,x*=m,h.x-=w*(b=f.weight+h.weight?f.weight/(f.weight+h.weight):.5),h.y-=x*b,f.x+=w*(b=1-b),f.y+=x*b);if((b=n*g)&&(w=u[0]/2,x=u[1]/2,s=-1,b))for(;++s<k;)(d=v[s]).x+=(w-d.x)*b,d.y+=(x-d.y)*b;if(p)for(No(t=o.geom.quadtree(v),n,a),s=-1;++s<k;)(d=v[s]).fixed||t.visit(_(d));for(s=-1;++s<k;)(d=v[s]).fixed?(d.x=d.px,d.y=d.py):(d.x-=(d.px-(d.px=d.x))*c,d.y-=(d.py-(d.py=d.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(e){return arguments.length?(v=e,s):v},s.links=function(e){return arguments.length?(y=e,s):y},s.size=function(e){return arguments.length?(u=e,s):u},s.linkDistance=function(e){return arguments.length?(d="function"==typeof e?e:+e,s):d},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(f="function"==typeof e?e:+e,s):f},s.friction=function(e){return arguments.length?(c=+e,s):c},s.charge=function(e){return arguments.length?(p="function"==typeof e?e:+e,s):p},s.chargeDistance=function(e){return arguments.length?(h=e*e,s):Math.sqrt(h)},s.gravity=function(e){return arguments.length?(g=+e,s):g},s.theta=function(e){return arguments.length?(m=e*e,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=St(s.tick)),s):n},s.start=function(){var e,t,n,o=v.length,l=y.length,c=u[0],h=u[1];for(e=0;e<o;++e)(n=v[e]).index=e,n.weight=0;for(e=0;e<l;++e)"number"==typeof(n=y[e]).source&&(n.source=v[n.source]),"number"==typeof n.target&&(n.target=v[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<o;++e)n=v[e],isNaN(n.x)&&(n.x=g("x",c)),isNaN(n.y)&&(n.y=g("y",h)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(r=[],"function"==typeof d)for(e=0;e<l;++e)r[e]=+d.call(this,y[e],e);else for(e=0;e<l;++e)r[e]=d;if(i=[],"function"==typeof f)for(e=0;e<l;++e)i[e]=+f.call(this,y[e],e);else for(e=0;e<l;++e)i[e]=f;if(a=[],"function"==typeof p)for(e=0;e<o;++e)a[e]=+p.call(this,v[e],e);else for(e=0;e<o;++e)a[e]=p;function g(n,r){if(!t){for(t=new Array(o),u=0;u<o;++u)t[u]=[];for(u=0;u<l;++u){var i=y[u];t[i.source.index].push(i.target),t[i.target.index].push(i.source)}}for(var a,s=t[e],u=-1,c=s.length;++u<c;)if(!isNaN(a=s[u][n]))return a;return Math.random()*r}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(t||(t=o.behavior.drag().origin(F).on("dragstart.force",Eo).on("drag.force",b).on("dragend.force",Mo)),!arguments.length)return t;this.on("mouseover.force",To).on("mouseout.force",jo).call(t)},o.rebind(s,l,"on")};var Fo=20,Oo=1,Io=1/0;function zo(e,t){return o.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=Bo,e}function $o(e,t){for(var n=[e];null!=(e=n.pop());)if(t(e),(i=e.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function qo(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(o=e.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a]);for(;null!=(e=r.pop());)t(e)}function Ro(e){return e.children}function Po(e){return e.value}function Lo(e,t){return t.value-e.value}function Bo(e){return o.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}o.layout.hierarchy=function(){var e=Lo,t=Ro,n=Po;function r(i){var o,a=[i],s=[];for(i.depth=0;null!=(o=a.pop());)if(s.push(o),(u=t.call(r,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)a.push(c=u[l]),c.parent=o,c.depth=o.depth+1;n&&(o.value=0),o.children=u}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return qo(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&($o(e,function(e){e.children&&(e.value=0)}),qo(e,function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)})),e},r},o.layout.partition=function(){var e=o.layout.hierarchy(),t=[1,1];function n(e,t,r,i){var o=e.children;if(e.x=t,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,s,l,u=-1;for(r=e.value?r/e.value:0;++u<a;)n(s=o[u],t,l=s.value*r,i),t+=l}}function r(e){var t=e.children,n=0;if(t&&(i=t.length))for(var i,o=-1;++o<i;)n=Math.max(n,r(t[o]));return 1+n}function i(i,o){var a=e.call(this,i,o);return n(a[0],0,t[0],t[1]/r(a[0])),a}return i.size=function(e){return arguments.length?(t=e,i):t},zo(i,e)},o.layout.pie=function(){var e=Number,t=Uo,n=0,r=Me,i=0;function a(s){var l,u=s.length,c=s.map(function(t,n){return+e.call(a,t,n)}),d=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof r?r.apply(this,arguments):r)-d,p=Math.min(Math.abs(f)/u,+("function"==typeof i?i.apply(this,arguments):i)),h=p*(f<0?-1:1),g=o.sum(c),m=g?(f-u*h)/g:0,v=o.range(u),y=[];return null!=t&&v.sort(t===Uo?function(e,t){return c[t]-c[e]}:function(e,n){return t(s[e],s[n])}),v.forEach(function(e){y[e]={data:s[e],value:l=c[e],startAngle:d,endAngle:d+=l*m+h,padAngle:p}}),y}return a.value=function(t){return arguments.length?(e=t,a):e},a.sort=function(e){return arguments.length?(t=e,a):t},a.startAngle=function(e){return arguments.length?(n=e,a):n},a.endAngle=function(e){return arguments.length?(r=e,a):r},a.padAngle=function(e){return arguments.length?(i=e,a):i},a};var Uo={};function Vo(e){return e.x}function Ho(e){return e.y}function Wo(e,t,n){e.y0=t,e.y=n}o.layout.stack=function(){var e=F,t=Qo,n=Ko,r=Wo,i=Vo,a=Ho;function s(l,u){if(!(p=l.length))return l;var c=l.map(function(t,n){return e.call(s,t,n)}),d=c.map(function(e){return e.map(function(e,t){return[i.call(s,e,t),a.call(s,e,t)]})}),f=t.call(s,d,u);c=o.permute(c,f),d=o.permute(d,f);var p,h,g,m,v=n.call(s,d,u),y=c[0].length;for(g=0;g<y;++g)for(r.call(s,c[0][g],m=v[g],d[0][g][1]),h=1;h<p;++h)r.call(s,c[h][g],m+=d[h-1][g][1],d[h][g][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(e){return arguments.length?(t="function"==typeof e?e:Go.get(e)||Qo,s):t},s.offset=function(e){return arguments.length?(n="function"==typeof e?e:Yo.get(e)||Ko,s):n},s.x=function(e){return arguments.length?(i=e,s):i},s.y=function(e){return arguments.length?(a=e,s):a},s.out=function(e){return arguments.length?(r=e,s):r},s};var Go=o.map({"inside-out":function(e){var t,n,r=e.length,i=e.map(Zo),a=e.map(Xo),s=o.range(r).sort(function(e,t){return i[e]-i[t]}),l=0,u=0,c=[],d=[];for(t=0;t<r;++t)n=s[t],l<u?(l+=a[n],c.push(n)):(u+=a[n],d.push(n));return d.reverse().concat(c)},reverse:function(e){return o.range(e.length).reverse()},default:Qo}),Yo=o.map({silhouette:function(e){var t,n,r,i=e.length,o=e[0].length,a=[],s=0,l=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];r>s&&(s=r),a.push(r)}for(n=0;n<o;++n)l[n]=(s-a[n])/2;return l},wiggle:function(e){var t,n,r,i,o,a,s,l,u,c=e.length,d=e[0],f=d.length,p=[];for(p[0]=l=u=0,n=1;n<f;++n){for(t=0,i=0;t<c;++t)i+=e[t][n][1];for(t=0,o=0,s=d[n][0]-d[n-1][0];t<c;++t){for(r=0,a=(e[t][n][1]-e[t][n-1][1])/(2*s);r<t;++r)a+=(e[r][n][1]-e[r][n-1][1])/s;o+=a*e[t][n][1]}p[n]=l-=i?o/i*s:0,l<u&&(u=l)}for(n=0;n<f;++n)p[n]-=u;return p},expand:function(e){var t,n,r,i=e.length,o=e[0].length,a=1/i,s=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];if(r)for(t=0;t<i;t++)e[t][n][1]/=r;else for(t=0;t<i;t++)e[t][n][1]=a}for(n=0;n<o;++n)s[n]=0;return s},zero:Ko});function Qo(e){return o.range(e.length)}function Ko(e){for(var t=-1,n=e[0].length,r=[];++t<n;)r[t]=0;return r}function Zo(e){for(var t,n=1,r=0,i=e[0][1],o=e.length;n<o;++n)(t=e[n][1])>i&&(r=n,i=t);return r}function Xo(e){return e.reduce(Jo,0)}function Jo(e,t){return e+t[1]}function ea(e,t){return ta(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ta(e,t){for(var n=-1,r=+e[0],i=(e[1]-r)/t,o=[];++n<=t;)o[n]=i*n+r;return o}function na(e){return[o.min(e),o.max(e)]}function ra(e,t){return e.value-t.value}function ia(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function oa(e,t){e._pack_next=t,t._pack_prev=e}function aa(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return.999*i*i>n*n+r*r}function sa(e){if((t=e.children)&&(l=t.length)){var t,n,r,i,o,a,s,l,u=1/0,c=-1/0,d=1/0,f=-1/0;if(t.forEach(la),(n=t[0]).x=-n.r,n.y=0,_(n),l>1&&((r=t[1]).x=r.r,r.y=0,_(r),l>2))for(da(n,r,i=t[2]),_(i),ia(n,i),n._pack_prev=i,ia(i,r),r=n._pack_next,o=3;o<l;o++){da(n,r,i=t[o]);var p=0,h=1,g=1;for(a=r._pack_next;a!==r;a=a._pack_next,h++)if(aa(a,i)){p=1;break}if(1==p)for(s=n._pack_prev;s!==a._pack_prev&&!aa(s,i);s=s._pack_prev,g++);p?(h<g||h==g&&r.r<n.r?oa(n,r=a):oa(n=s,r),o--):(ia(n,i),r=i,_(i))}var m=(u+c)/2,v=(d+f)/2,y=0;for(o=0;o<l;o++)(i=t[o]).x-=m,i.y-=v,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=y,t.forEach(ua)}function _(e){u=Math.min(e.x-e.r,u),c=Math.max(e.x+e.r,c),d=Math.min(e.y-e.r,d),f=Math.max(e.y+e.r,f)}}function la(e){e._pack_next=e._pack_prev=e}function ua(e){delete e._pack_next,delete e._pack_prev}function ca(e,t,n,r){var i=e.children;if(e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r,i)for(var o=-1,a=i.length;++o<a;)ca(i[o],t,n,r)}function da(e,t,n){var r=e.r+n.r,i=t.x-e.x,o=t.y-e.y;if(r&&(i||o)){var a=t.r+n.r,s=i*i+o*o,l=.5+((r*=r)-(a*=a))/(2*s),u=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=e.x+l*i+u*o,n.y=e.y+l*o-u*i}else n.x=e.x+r,n.y=e.y}function fa(e,t){return e.parent==t.parent?1:2}function pa(e){var t=e.children;return t.length?t[0]:e.t}function ha(e){var t,n=e.children;return(t=n.length)?n[t-1]:e.t}function ga(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function ma(e,t,n){return e.a.parent===t.parent?e.a:n}function va(e){var t=e.children;return t&&t.length?va(t[0]):e}function ya(e){var t,n=e.children;return n&&(t=n.length)?ya(n[t-1]):e}function _a(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function ba(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],o=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function wa(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function xa(e){return e.rangeExtent?e.rangeExtent():wa(e.range())}function ka(e,t,n,r){var i=n(e[0],e[1]),o=r(t[0],t[1]);return function(e){return o(i(e))}}function Ca(e,t){var n,r=0,i=e.length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}function Da(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:Sa}o.layout.histogram=function(){var e=!0,t=Number,n=na,r=ea;function i(i,a){for(var s,l,u=[],c=i.map(t,this),d=n.call(this,c,a),f=r.call(this,d,c,a),p=(a=-1,c.length),h=f.length-1,g=e?1:1/p;++a<h;)(s=u[a]=[]).dx=f[a+1]-(s.x=f[a]),s.y=0;if(h>0)for(a=-1;++a<p;)(l=c[a])>=d[0]&&l<=d[1]&&((s=u[o.bisect(f,l,1,h)-1]).y+=g,s.push(i[a]));return u}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(n=yt(e),i):n},i.bins=function(e){return arguments.length?(r="number"==typeof e?function(t){return ta(t,e)}:yt(e),i):r},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},o.layout.pack=function(){var e,t=o.layout.hierarchy().sort(ra),n=0,r=[1,1];function i(i,o){var a=t.call(this,i,o),s=a[0],l=r[0],u=r[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,qo(s,function(e){e.r=+c(e.value)}),qo(s,sa),n){var d=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;qo(s,function(e){e.r+=d}),qo(s,sa),qo(s,function(e){e.r-=d})}return ca(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),a}return i.size=function(e){return arguments.length?(r=e,i):r},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(n=+e,i):n},zo(i,t)},o.layout.tree=function(){var e=o.layout.hierarchy().sort(null).value(null),t=fa,n=[1,1],r=null;function i(i,o){var u=e.call(this,i,o),c=u[0],d=function(e){for(var t,n={A:null,children:[e]},r=[n];null!=(t=r.pop());)for(var i,o=t.children,a=0,s=o.length;a<s;++a)r.push((o[a]=i={_:o[a],parent:t,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}(c);if(qo(d,a),d.parent.m=-d.z,$o(d,s),r)$o(c,l);else{var f=c,p=c,h=c;$o(c,function(e){e.x<f.x&&(f=e),e.x>p.x&&(p=e),e.depth>h.depth&&(h=e)});var g=t(f,p)/2-f.x,m=n[0]/(p.x+t(p,f)/2+g),v=n[1]/(h.depth||1);$o(c,function(e){e.x=(e.x+g)*m,e.y=e.depth*v})}return u}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n.length){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,l=o.parent.children[0],u=o.m,c=a.m,d=s.m,f=l.m;s=ha(s),o=pa(o),s&&o;)l=pa(l),(a=ha(a)).a=e,(i=s.z+d-o.z-u+t(s._,o._))>0&&(ga(ma(s,e,r),e,i),u+=i,c+=i),d+=s.m,u+=o.m,f+=l.m,c+=a.m;s&&!ha(a)&&(a.t=s,a.m+=d-c),o&&!pa(l)&&(l.t=o,l.m+=u-f,r=e)}return r}(e,i,e.parent.A||r[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e)?l:null,i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null==(n=e)?null:l,i):r?n:null},zo(i,e)},o.layout.cluster=function(){var e=o.layout.hierarchy().sort(null).value(null),t=fa,n=[1,1],r=!1;function i(i,a){var s,l=e.call(this,i,a),u=l[0],c=0;qo(u,function(e){var n=e.children;n&&n.length?(e.x=function(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}(n),e.y=function(e){return 1+o.max(e,function(e){return e.y})}(n)):(e.x=s?c+=t(e,s):0,e.y=0,s=e)});var d=va(u),f=ya(u),p=d.x-t(d,f)/2,h=f.x+t(f,d)/2;return qo(u,r?function(e){e.x=(e.x-u.x)*n[0],e.y=(u.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(h-p)*n[0],e.y=(1-(u.y?e.y/u.y:1))*n[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e),i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null!=(n=e),i):r?n:null},zo(i,e)},o.layout.treemap=function(){var e,t=o.layout.hierarchy(),n=Math.round,r=[1,1],i=null,a=_a,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(e,t){for(var n,r,i=-1,o=e.length;++i<o;)r=(n=e[i]).value*(t<0?0:t),n.area=isNaN(r)||r<=0?0:r}function d(e){var t=e.children;if(t&&t.length){var n,r,i,o=a(e),s=[],u=t.slice(),f=1/0,g="slice"===l?o.dx:"dice"===l?o.dy:"slice-dice"===l?1&e.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(c(u,o.dx*o.dy/e.value),s.area=0;(i=u.length)>0;)s.push(n=u[i-1]),s.area+=n.area,"squarify"!==l||(r=p(s,g))<=f?(u.pop(),f=r):(s.area-=s.pop().area,h(s,g,o,!1),g=Math.min(o.dx,o.dy),s.length=s.area=0,f=1/0);s.length&&(h(s,g,o,!0),s.length=s.area=0),t.forEach(d)}}function f(e){var t=e.children;if(t&&t.length){var n,r=a(e),i=t.slice(),o=[];for(c(i,r.dx*r.dy/e.value),o.area=0;n=i.pop();)o.push(n),o.area+=n.area,null!=n.z&&(h(o,n.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);t.forEach(f)}}function p(e,t){for(var n,r=e.area,i=0,o=1/0,a=-1,s=e.length;++a<s;)(n=e[a].area)&&(n<o&&(o=n),n>i&&(i=n));return t*=t,(r*=r)?Math.max(t*i*u/r,r/(t*o*u)):1/0}function h(e,t,r,i){var o,a=-1,s=e.length,l=r.x,u=r.y,c=t?n(e.area/t):0;if(t==r.dx){for((i||c>r.dy)&&(c=r.dy);++a<s;)(o=e[a]).x=l,o.y=u,o.dy=c,l+=o.dx=Math.min(r.x+r.dx-l,c?n(o.area/c):0);o.z=!0,o.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++a<s;)(o=e[a]).x=l,o.y=u,o.dx=c,u+=o.dy=Math.min(r.y+r.dy-u,c?n(o.area/c):0);o.z=!1,o.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function g(n){var i=e||t(n),o=i[0];return o.x=o.y=0,o.value?(o.dx=r[0],o.dy=r[1]):o.dx=o.dy=0,e&&t.revalue(o),c([o],o.dx*o.dy/o.value),(e?f:d)(o),s&&(e=i),i}return g.size=function(e){return arguments.length?(r=e,g):r},g.padding=function(e){if(!arguments.length)return i;function t(t){return ba(t,e)}var n;return a=null==(i=e)?_a:"function"==(n=typeof e)?function(t){var n=e.call(g,t,t.depth);return null==n?_a(t):ba(t,"number"==typeof n?[n,n,n,n]:n)}:"number"===n?(e=[e,e,e,e],t):t,g},g.round=function(e){return arguments.length?(n=e?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(s=t,e=null,g):s},g.ratio=function(e){return arguments.length?(u=e,g):u},g.mode=function(e){return arguments.length?(l=e+"",g):l},zo(g,t)},o.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do{i=(n=2*Math.random()-1)*n+(r=2*Math.random()-1)*r}while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=o.random.normal.apply(o,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=o.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},o.scale={};var Sa={floor:F,ceil:F};function Aa(e,t,n,r){var i=[],a=[],s=0,l=Math.min(e.length,t.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<=l;)i.push(n(e[s-1],e[s])),a.push(r(t[s-1],t[s]));return function(t){var n=o.bisect(e,t,1,l)-1;return a[n](i[n](t))}}function Ea(e,t,n,r){var i,o;function a(){var a=Math.min(e.length,t.length)>2?Aa:ka,l=r?Do:Co;return i=a(e,t,l,n),o=a(t,e,l,no),s}function s(e){return i(e)}return s.invert=function(e){return o(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),a()):e},s.range=function(e){return arguments.length?(t=e,a()):t},s.rangeRound=function(e){return s.range(e).interpolate(vo)},s.clamp=function(e){return arguments.length?(r=e,a()):r},s.interpolate=function(e){return arguments.length?(n=e,a()):n},s.ticks=function(t){return Na(e,t)},s.tickFormat=function(t,n){return Fa(e,t,n)},s.nice=function(t){return Ta(e,t),a()},s.copy=function(){return Ea(e,t,n,r)},a()}function Ma(e,t){return o.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Ta(e,t){return Ca(e,Da(ja(e,t)[2])),Ca(e,Da(ja(e,t)[2])),e}function ja(e,t){null==t&&(t=10);var n=wa(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),o=t/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Na(e,t){return o.range.apply(o,ja(e,t))}function Fa(e,t,n){var r=ja(e,t);if(n){var i=Ft.exec(n);if(i.shift(),"s"===i[8]){var a=o.formatPrefix(Math.max(x(r[0]),x(r[1])));return i[7]||(i[7]="."+Ia(a.scale(r[2]))),i[8]="f",n=o.format(i.join("")),function(e){return n(a.scale(e))+a.symbol}}i[7]||(i[7]="."+function(e,t){var n=Ia(t[2]);return e in Oa?Math.abs(n-Ia(Math.max(x(t[0]),x(t[1]))))+ +("e"!==e):n-2*("%"===e)}(i[8],r)),n=i.join("")}else n=",."+Ia(r[2])+"f";return o.format(n)}o.scale.linear=function(){return Ea([0,1],[0,1],no,!1)};var Oa={s:1,g:1,p:1,r:1,e:1};function Ia(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function za(e,t,n,r){function i(e){return(n?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return n?Math.pow(t,e):-Math.pow(t,-e)}function s(t){return e(i(t))}return s.invert=function(t){return a(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((r=t.map(Number)).map(i)),s):r},s.base=function(n){return arguments.length?(t=+n,e.domain(r.map(i)),s):t},s.nice=function(){var t=Ca(r.map(i),n?Math:qa);return e.domain(t),r=t.map(a),s},s.ticks=function(){var e=wa(r),o=[],s=e[0],l=e[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),d=t%1?2:t;if(isFinite(c-u)){if(n){for(;u<c;u++)for(var f=1;f<d;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(f=d-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},s.tickFormat=function(e,n){if(!arguments.length)return $a;arguments.length<2?n=$a:"function"!=typeof n&&(n=o.format(n));var r=Math.max(1,t*e/s.ticks().length);return function(e){var o=e/a(Math.round(i(e)));return o*t<t-.5&&(o*=t),o<=r?n(e):""}},s.copy=function(){return za(e.copy(),t,n,r)},Ma(s,e)}o.scale.log=function(){return za(o.scale.linear().domain([0,1]),10,!0,[1,10])};var $a=o.format(".0e"),qa={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Ra(e,t,n){var r=Pa(t),i=Pa(1/t);function o(t){return e(r(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(r)),o):n},o.ticks=function(e){return Na(n,e)},o.tickFormat=function(e,t){return Fa(n,e,t)},o.nice=function(e){return o.domain(Ta(n,e))},o.exponent=function(a){return arguments.length?(r=Pa(t=a),i=Pa(1/t),e.domain(n.map(r)),o):t},o.copy=function(){return Ra(e.copy(),t,n)},Ma(o,e)}function Pa(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function La(e,t){var n,r,i;function a(i){return r[((n.get(i)||("range"===t.t?n.set(i,e.push(i)):NaN))-1)%r.length]}function s(t,n){return o.range(e.length).map(function(e){return t+n*e})}return a.domain=function(r){if(!arguments.length)return e;e=[],n=new C;for(var i,o=-1,s=r.length;++o<s;)n.has(i=r[o])||n.set(i,e.push(i));return a[t.t].apply(a,t.a)},a.range=function(e){return arguments.length?(r=e,i=0,t={t:"range",a:arguments},a):r},a.rangePoints=function(n,o){arguments.length<2&&(o=0);var l=n[0],u=n[1],c=e.length<2?(l=(l+u)/2,0):(u-l)/(e.length-1+o);return r=s(l+c*o/2,c),i=0,t={t:"rangePoints",a:arguments},a},a.rangeRoundPoints=function(n,o){arguments.length<2&&(o=0);var l=n[0],u=n[1],c=e.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(e.length-1+o)|0;return r=s(l+Math.round(c*o/2+(u-l-(e.length-1+o)*c)/2),c),i=0,t={t:"rangeRoundPoints",a:arguments},a},a.rangeBands=function(n,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var u=n[1]<n[0],c=n[u-0],d=(n[1-u]-c)/(e.length-o+2*l);return r=s(c+d*l,d),u&&r.reverse(),i=d*(1-o),t={t:"rangeBands",a:arguments},a},a.rangeRoundBands=function(n,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var u=n[1]<n[0],c=n[u-0],d=n[1-u],f=Math.floor((d-c)/(e.length-o+2*l));return r=s(c+Math.round((d-c-(e.length-o)*f)/2),f),u&&r.reverse(),i=Math.round(f*(1-o)),t={t:"rangeRoundBands",a:arguments},a},a.rangeBand=function(){return i},a.rangeExtent=function(){return wa(t.a[0])},a.copy=function(){return La(e,t)},a.domain(e)}o.scale.pow=function(){return Ra(o.scale.linear(),1,[0,1])},o.scale.sqrt=function(){return o.scale.pow().exponent(.5)},o.scale.ordinal=function(){return La([],{t:"range",a:[[]]})},o.scale.category10=function(){return o.scale.ordinal().range(Ba)},o.scale.category20=function(){return o.scale.ordinal().range(Ua)},o.scale.category20b=function(){return o.scale.ordinal().range(Va)},o.scale.category20c=function(){return o.scale.ordinal().range(Ha)};var Ba=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ut),Ua=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ut),Va=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ut),Ha=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ut);function Wa(e,t){var n;function r(){var r=0,a=t.length;for(n=[];++r<a;)n[r-1]=o.quantile(e,r/a);return i}function i(e){if(!isNaN(e=+e))return t[o.bisect(n,e)]}return i.domain=function(t){return arguments.length?(e=t.map(v).filter(y).sort(m),r()):e},i.range=function(e){return arguments.length?(t=e,r()):t},i.quantiles=function(){return n},i.invertExtent=function(r){return(r=t.indexOf(r))<0?[NaN,NaN]:[r>0?n[r-1]:e[0],r<n.length?n[r]:e[e.length-1]]},i.copy=function(){return Wa(e,t)},r()}function Ga(e,t,n){var r,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(r*(t-e))))]}function a(){return r=n.length/(t-e),i=n.length-1,o}return o.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],a()):[e,t]},o.range=function(e){return arguments.length?(n=e,a()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/r+e,t+1/r]},o.copy=function(){return Ga(e,t,n)},a()}function Ya(e,t){function n(n){if(n<=n)return t[o.bisect(e,n)]}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(e){return arguments.length?(t=e,n):t},n.invertExtent=function(n){return n=t.indexOf(n),[e[n-1],e[n]]},n.copy=function(){return Ya(e,t)},n}function Qa(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return Na(e,t)},t.tickFormat=function(t,n){return Fa(e,t,n)},t.copy=function(){return Qa(e)},t}function Ka(){return 0}o.scale.quantile=function(){return Wa([],[])},o.scale.quantize=function(){return Ga(0,1,[0,1])},o.scale.threshold=function(){return Ya([.5],[0,1])},o.scale.identity=function(){return Qa([0,1])},o.svg={},o.svg.arc=function(){var e=Xa,t=Ja,n=Ka,r=Za,i=es,o=ts,a=ns;function s(){var s=Math.max(0,+e.apply(this,arguments)),u=Math.max(0,+t.apply(this,arguments)),c=i.apply(this,arguments)-je,d=o.apply(this,arguments)-je,f=Math.abs(d-c),p=c>d?0:1;if(u<s&&(h=u,u=s,s=h),f>=Te)return l(u,p)+(s?l(s,1-p):"")+"Z";var h,g,m,v,y,_,b,w,x,k,C,D,S=0,A=0,E=[];if((v=(+a.apply(this,arguments)||0)/2)&&(m=r===Za?Math.sqrt(s*s+u*u):+r.apply(this,arguments),p||(A*=-1),u&&(A=$e(m/u*Math.sin(v))),s&&(S=$e(m/s*Math.sin(v)))),u){y=u*Math.cos(c+A),_=u*Math.sin(c+A),b=u*Math.cos(d-A),w=u*Math.sin(d-A);var M=Math.abs(d-c-2*A)<=Ee?0:1;if(A&&rs(y,_,b,w)===p^M){var T=(c+d)/2;y=u*Math.cos(T),_=u*Math.sin(T),b=w=null}}else y=_=0;if(s){x=s*Math.cos(d-S),k=s*Math.sin(d-S),C=s*Math.cos(c+S),D=s*Math.sin(c+S);var j=Math.abs(c-d+2*S)<=Ee?0:1;if(S&&rs(x,k,C,D)===1-p^j){var N=(c+d)/2;x=s*Math.cos(N),k=s*Math.sin(N),C=D=null}}else x=k=0;if(f>Se&&(h=Math.min(Math.abs(u-s)/2,+n.apply(this,arguments)))>.001){g=s<u^p?0:1;var F=h,O=h;if(f<Ee){var I=null==C?[x,k]:null==b?[y,_]:di([y,_],[C,D],[b,w],[x,k]),z=y-I[0],$=_-I[1],q=b-I[0],R=w-I[1],P=1/Math.sin(Math.acos((z*q+$*R)/(Math.sqrt(z*z+$*$)*Math.sqrt(q*q+R*R)))/2),L=Math.sqrt(I[0]*I[0]+I[1]*I[1]);O=Math.min(h,(s-L)/(P-1)),F=Math.min(h,(u-L)/(P+1))}if(null!=b){var B=is(null==C?[x,k]:[C,D],[y,_],u,F,p),U=is([b,w],[x,k],u,F,p);h===F?E.push("M",B[0],"A",F,",",F," 0 0,",g," ",B[1],"A",u,",",u," 0 ",1-p^rs(B[1][0],B[1][1],U[1][0],U[1][1]),",",p," ",U[1],"A",F,",",F," 0 0,",g," ",U[0]):E.push("M",B[0],"A",F,",",F," 0 1,",g," ",U[0])}else E.push("M",y,",",_);if(null!=C){var V=is([y,_],[C,D],s,-O,p),H=is([x,k],null==b?[y,_]:[b,w],s,-O,p);h===O?E.push("L",H[0],"A",O,",",O," 0 0,",g," ",H[1],"A",s,",",s," 0 ",p^rs(H[1][0],H[1][1],V[1][0],V[1][1]),",",1-p," ",V[1],"A",O,",",O," 0 0,",g," ",V[0]):E.push("L",H[0],"A",O,",",O," 0 0,",g," ",V[0])}else E.push("L",x,",",k)}else E.push("M",y,",",_),null!=b&&E.push("A",u,",",u," 0 ",M,",",p," ",b,",",w),E.push("L",x,",",k),null!=C&&E.push("A",s,",",s," 0 ",j,",",1-p," ",C,",",D);return E.push("Z"),E.join("")}function l(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return s.innerRadius=function(t){return arguments.length?(e=yt(t),s):e},s.outerRadius=function(e){return arguments.length?(t=yt(e),s):t},s.cornerRadius=function(e){return arguments.length?(n=yt(e),s):n},s.padRadius=function(e){return arguments.length?(r=e==Za?Za:yt(e),s):r},s.startAngle=function(e){return arguments.length?(i=yt(e),s):i},s.endAngle=function(e){return arguments.length?(o=yt(e),s):o},s.padAngle=function(e){return arguments.length?(a=yt(e),s):a},s.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-je;return[Math.cos(r)*n,Math.sin(r)*n]},s};var Za="auto";function Xa(e){return e.innerRadius}function Ja(e){return e.outerRadius}function es(e){return e.startAngle}function ts(e){return e.endAngle}function ns(e){return e&&e.padAngle}function rs(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function is(e,t,n,r,i){var o=e[0]-t[0],a=e[1]-t[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=e[0]+l,d=e[1]+u,f=t[0]+l,p=t[1]+u,h=(c+f)/2,g=(d+p)/2,m=f-c,v=p-d,y=m*m+v*v,_=n-r,b=c*p-f*d,w=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*y-b*b)),x=(b*v-m*w)/y,k=(-b*m-v*w)/y,C=(b*v+m*w)/y,D=(-b*m+v*w)/y,S=x-h,A=k-g,E=C-h,M=D-g;return S*S+A*A>E*E+M*M&&(x=C,k=D),[[x-l,k-u],[x*n/_,k*n/_]]}function os(e){var t=oi,n=ai,r=Zn,i=ss,o=i.key,a=.7;function s(o){var s,l=[],u=[],c=-1,d=o.length,f=yt(t),p=yt(n);function h(){l.push("M",i(e(u),a))}for(;++c<d;)r.call(this,s=o[c],c)?u.push([+f.call(this,s,c),+p.call(this,s,c)]):u.length&&(h(),u=[]);return u.length&&h(),l.length?l.join(""):null}return s.x=function(e){return arguments.length?(t=e,s):t},s.y=function(e){return arguments.length?(n=e,s):n},s.defined=function(e){return arguments.length?(r=e,s):r},s.interpolate=function(e){return arguments.length?(o="function"==typeof e?i=e:(i=as.get(e)||ss).key,s):o},s.tension=function(e){return arguments.length?(a=e,s):a},s}o.svg.line=function(){return os(F)};var as=o.map({linear:ss,"linear-closed":ls,step:function(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);return n>1&&i.push("H",r[0]),i.join("")},"step-before":us,"step-after":cs,basis:ps,"basis-open":function(e){if(e.length<4)return ss(e);for(var t,n=[],r=-1,i=e.length,o=[0],a=[0];++r<3;)t=e[r],o.push(t[0]),a.push(t[1]);for(n.push(hs(vs,o)+","+hs(vs,a)),--r;++r<i;)t=e[r],o.shift(),o.push(t[0]),a.shift(),a.push(t[1]),ys(n,o,a);return n.join("")},"basis-closed":function(e){for(var t,n,r=-1,i=e.length,o=i+4,a=[],s=[];++r<4;)n=e[r%i],a.push(n[0]),s.push(n[1]);for(t=[hs(vs,a),",",hs(vs,s)],--r;++r<o;)n=e[r%i],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),ys(t,a,s);return t.join("")},bundle:function(e,t){var n=e.length-1;if(n)for(var r,i,o=e[0][0],a=e[0][1],s=e[n][0]-o,l=e[n][1]-a,u=-1;++u<=n;)i=u/n,(r=e[u])[0]=t*r[0]+(1-t)*(o+i*s),r[1]=t*r[1]+(1-t)*(a+i*l);return ps(e)},cardinal:function(e,t){return e.length<3?ss(e):e[0]+ds(e,fs(e,t))},"cardinal-open":function(e,t){return e.length<4?ss(e):e[1]+ds(e.slice(1,-1),fs(e,t))},"cardinal-closed":function(e,t){return e.length<3?ls(e):e[0]+ds((e.push(e[0]),e),fs([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?ss(e):e[0]+ds(e,function(e){for(var t,n,r,i,o=[],a=function(e){for(var t=0,n=e.length-1,r=[],i=e[0],o=e[1],a=r[0]=_s(i,o);++t<n;)r[t]=(a+(a=_s(i=o,o=e[t+1])))/2;return r[t]=a,r}(e),s=-1,l=e.length-1;++s<l;)t=_s(e[s],e[s+1]),x(t)<Se?a[s]=a[s+1]=0:(i=(n=a[s]/t)*n+(r=a[s+1]/t)*r)>9&&(i=3*t/Math.sqrt(i),a[s]=i*n,a[s+1]=i*r);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}(e))}});function ss(e){return e.length>1?e.join("L"):e+"Z"}function ls(e){return e.join("L")+"Z"}function us(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("V",(r=e[t])[1],"H",r[0]);return i.join("")}function cs(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("H",(r=e[t])[0],"V",r[1]);return i.join("")}function ds(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return ss(e);var n=e.length!=t.length,r="",i=e[0],o=e[1],a=t[0],s=a,l=1;if(n&&(r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=e[1],l=2),t.length>1){s=t[1],o=e[l],l++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<t.length;u++,l++)o=e[l],s=t[u],r+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}if(n){var c=e[l];r+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+c[0]+","+c[1]}return r}function fs(e,t){for(var n,r=[],i=(1-t)/2,o=e[0],a=e[1],s=1,l=e.length;++s<l;)n=o,o=a,a=e[s],r.push([i*(a[0]-n[0]),i*(a[1]-n[1])]);return r}function ps(e){if(e.length<3)return ss(e);var t=1,n=e.length,r=e[0],i=r[0],o=r[1],a=[i,i,i,(r=e[1])[0]],s=[o,o,o,r[1]],l=[i,",",o,"L",hs(vs,a),",",hs(vs,s)];for(e.push(e[n-1]);++t<=n;)r=e[t],a.shift(),a.push(r[0]),s.shift(),s.push(r[1]),ys(l,a,s);return e.pop(),l.push("L",r),l.join("")}function hs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}as.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var gs=[0,2/3,1/3,0],ms=[0,1/3,2/3,0],vs=[0,1/6,2/3,1/6];function ys(e,t,n){e.push("C",hs(gs,t),",",hs(gs,n),",",hs(ms,t),",",hs(ms,n),",",hs(vs,t),",",hs(vs,n))}function _s(e,t){return(t[1]-e[1])/(t[0]-e[0])}function bs(e){for(var t,n,r,i=-1,o=e.length;++i<o;)n=(t=e[i])[0],r=t[1]-je,t[0]=n*Math.cos(r),t[1]=n*Math.sin(r);return e}function ws(e){var t=oi,n=oi,r=0,i=ai,o=Zn,a=ss,s=a.key,l=a,u="L",c=.7;function d(s){var d,f,p,h=[],g=[],m=[],v=-1,y=s.length,_=yt(t),b=yt(r),w=t===n?function(){return f}:yt(n),x=r===i?function(){return p}:yt(i);function k(){h.push("M",a(e(m),c),u,l(e(g.reverse()),c),"Z")}for(;++v<y;)o.call(this,d=s[v],v)?(g.push([f=+_.call(this,d,v),p=+b.call(this,d,v)]),m.push([+w.call(this,d,v),+x.call(this,d,v)])):g.length&&(k(),g=[],m=[]);return g.length&&k(),h.length?h.join(""):null}return d.x=function(e){return arguments.length?(t=n=e,d):n},d.x0=function(e){return arguments.length?(t=e,d):t},d.x1=function(e){return arguments.length?(n=e,d):n},d.y=function(e){return arguments.length?(r=i=e,d):i},d.y0=function(e){return arguments.length?(r=e,d):r},d.y1=function(e){return arguments.length?(i=e,d):i},d.defined=function(e){return arguments.length?(o=e,d):o},d.interpolate=function(e){return arguments.length?(s="function"==typeof e?a=e:(a=as.get(e)||ss).key,l=a.reverse||a,u=a.closed?"M":"L",d):s},d.tension=function(e){return arguments.length?(c=e,d):c},d}function xs(e){return e.radius}function ks(e){return[e.x,e.y]}function Cs(){return 64}function Ds(){return"circle"}function Ss(e){var t=Math.sqrt(e/Ee);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}o.svg.line.radial=function(){var e=os(bs);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},us.reverse=cs,cs.reverse=us,o.svg.area=function(){return ws(F)},o.svg.area.radial=function(){var e=ws(bs);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},o.svg.chord=function(){var e=Hr,t=Wr,n=xs,r=es,i=ts;function o(n,r){var i,o,u=a(this,e,n,r),c=a(this,t,n,r);return"M"+u.p0+s(u.r,u.p1,u.a1-u.a0)+(o=c,((i=u).a0==o.a0&&i.a1==o.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+s(c.r,c.p1,c.a1-c.a0)+l(c.r,c.p1,u.r,u.p0))+"Z")}function a(e,t,o,a){var s=t.call(e,o,a),l=n.call(e,s,a),u=r.call(e,s,a)-je,c=i.call(e,s,a)-je;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(e,t,n){return"A"+e+","+e+" 0 "+ +(n>Ee)+",1 "+t}function l(e,t,n,r){return"Q 0,0 "+r}return o.radius=function(e){return arguments.length?(n=yt(e),o):n},o.source=function(t){return arguments.length?(e=yt(t),o):e},o.target=function(e){return arguments.length?(t=yt(e),o):t},o.startAngle=function(e){return arguments.length?(r=yt(e),o):r},o.endAngle=function(e){return arguments.length?(i=yt(e),o):i},o},o.svg.diagonal=function(){var e=Hr,t=Wr,n=ks;function r(r,i){var o=e.call(this,r,i),a=t.call(this,r,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(e=yt(t),r):e},r.target=function(e){return arguments.length?(t=yt(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},o.svg.diagonal.radial=function(){var e=o.svg.diagonal(),t=ks,n=e.projection;return e.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-je;return[n*Math.cos(r),n*Math.sin(r)]}}(t=e)):t},e},o.svg.symbol=function(){var e=Ds,t=Cs;function n(n,r){return(As.get(e.call(this,n,r))||Ss)(t.call(this,n,r))}return n.type=function(t){return arguments.length?(e=yt(t),n):e},n.size=function(e){return arguments.length?(t=yt(e),n):t},n};var As=o.map({circle:Ss,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Ms)),n=t*Ms;return"M0,"+-t+"L"+n+",0 0,"+t+" "+-n+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Es),n=t*Es/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Es),n=t*Es/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}});o.svg.symbolTypes=As.keys();var Es=Math.sqrt(3),Ms=Math.tan(30*Ne);Q.transition=function(e){for(var t,n,r=Fs||++zs,i=Rs(e),o=[],a=Os||{time:Date.now(),ease:fo,delay:0,duration:250},s=-1,l=this.length;++s<l;){o.push(t=[]);for(var u=this[s],c=-1,d=u.length;++c<d;)(n=u[c])&&Ps(n,c,i,r,a),t.push(n)}return Ns(o,i,r)},Q.interrupt=function(e){return this.each(null==e?Ts:js(Rs(e)))};var Ts=js(Rs());function js(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Ns(e,t,n){return V(e,Is),e.namespace=t,e.id=n,e}var Fs,Os,Is=[],zs=0;function $s(e,t,n,r){var i=e.id,o=e.namespace;return pe(e,"function"==typeof n?function(e,a,s){e[o][i].tween.set(t,r(n.call(e,e.__data__,a,s)))}:(n=r(n),function(e){e[o][i].tween.set(t,n)}))}function qs(e){return null==e&&(e=""),function(){this.textContent=e}}function Rs(e){return null==e?"__transition__":"__transition_"+e+"__"}function Ps(e,t,n,r,i){var o,a,s,l,u,c=e[n]||(e[n]={active:0,count:0}),d=c[r];function f(n){var i=c.active,f=c[i];for(var h in f&&(f.timer.c=null,f.timer.t=NaN,--c.count,delete c[i],f.event&&f.event.interrupt.call(e,e.__data__,f.index)),c)if(+h<r){var g=c[h];g.timer.c=null,g.timer.t=NaN,--c.count,delete c[h]}a.c=p,St(function(){return a.c&&p(n||1)&&(a.c=null,a.t=NaN),1},0,o),c.active=r,d.event&&d.event.start.call(e,e.__data__,t),u=[],d.tween.forEach(function(n,r){(r=r.call(e,e.__data__,t))&&u.push(r)}),l=d.ease,s=d.duration}function p(i){for(var o=i/s,a=l(o),f=u.length;f>0;)u[--f].call(e,a);if(o>=1)return d.event&&d.event.end.call(e,e.__data__,t),--c.count?delete c[r]:delete e[n],1}d||(o=i.time,a=St(function(e){var t=d.delay;if(a.t=t+o,t<=e)return f(e-t);a.c=f},0,o),d=c[r]={tween:new C,time:o,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}Is.call=Q.call,Is.empty=Q.empty,Is.node=Q.node,Is.size=Q.size,o.transition=function(e,t){return e&&e.transition?Fs?e.transition(t):e:o.selection().transition(e)},o.transition.prototype=Is,Is.select=function(e){var t,n,r,i=this.id,o=this.namespace,a=[];e=K(e);for(var s=-1,l=this.length;++s<l;){a.push(t=[]);for(var u=this[s],c=-1,d=u.length;++c<d;)(r=u[c])&&(n=e.call(r,r.__data__,c,s))?("__data__"in r&&(n.__data__=r.__data__),Ps(n,c,o,i,r[o][i]),t.push(n)):t.push(null)}return Ns(a,o,i)},Is.selectAll=function(e){var t,n,r,i,o,a=this.id,s=this.namespace,l=[];e=Z(e);for(var u=-1,c=this.length;++u<c;)for(var d=this[u],f=-1,p=d.length;++f<p;)if(r=d[f]){o=r[s][a],n=e.call(r,r.__data__,f,u),l.push(t=[]);for(var h=-1,g=n.length;++h<g;)(i=n[h])&&Ps(i,h,s,a,o),t.push(i)}return Ns(l,s,a)},Is.filter=function(e){var t,n,r=[];"function"!=typeof e&&(e=de(e));for(var i=0,o=this.length;i<o;i++){r.push(t=[]);for(var a,s=0,l=(a=this[i]).length;s<l;s++)(n=a[s])&&e.call(n,n.__data__,s,i)&&t.push(n)}return Ns(r,this.namespace,this.id)},Is.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):pe(this,null==t?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Is.attr=function(e,t){if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var n="transform"==e?ko:no,r=o.ns.qualify(e);function i(){this.removeAttribute(r)}function a(){this.removeAttributeNS(r.space,r.local)}return $s(this,"attr."+e,t,r.local?function(e){return null==e?a:(e+="",function(){var t,i=this.getAttributeNS(r.space,r.local);return i!==e&&(t=n(i,e),function(e){this.setAttributeNS(r.space,r.local,t(e))})})}:function(e){return null==e?i:(e+="",function(){var t,i=this.getAttribute(r);return i!==e&&(t=n(i,e),function(e){this.setAttribute(r,t(e))})})})},Is.attrTween=function(e,t){var n=o.ns.qualify(e);return this.tween("attr."+e,n.local?function(e,r){var i=t.call(this,e,r,this.getAttributeNS(n.space,n.local));return i&&function(e){this.setAttributeNS(n.space,n.local,i(e))}}:function(e,r){var i=t.call(this,e,r,this.getAttribute(n));return i&&function(e){this.setAttribute(n,i(e))}})},Is.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.style(n,e[n],t);return this}n=""}function i(){this.style.removeProperty(e)}return $s(this,"style."+e,t,function(t){return null==t?i:(t+="",function(){var r,i=c(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(r=no(i,t),function(t){this.style.setProperty(e,r(t),n)})})})},Is.styleTween=function(e,t,n){return arguments.length<3&&(n=""),this.tween("style."+e,function(r,i){var o=t.call(this,r,i,c(this).getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),n)}})},Is.text=function(e){return $s(this,"text",e,qs)},Is.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Is.ease=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].ease:("function"!=typeof e&&(e=o.ease.apply(o,arguments)),pe(this,function(r){r[n][t].ease=e}))},Is.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:pe(this,"function"==typeof e?function(r,i,o){r[n][t].delay=+e.call(r,r.__data__,i,o)}:(e=+e,function(r){r[n][t].delay=e}))},Is.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:pe(this,"function"==typeof e?function(r,i,o){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,o))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Is.each=function(e,t){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Os,a=Fs;try{Fs=n,pe(this,function(t,i,o){Os=t[r][n],e.call(t,t.__data__,i,o)})}finally{Os=i,Fs=a}}else pe(this,function(i){var a=i[r][n];(a.event||(a.event=o.dispatch("start","end","interrupt"))).on(e,t)});return this},Is.transition=function(){for(var e,t,n,r=this.id,i=++zs,o=this.namespace,a=[],s=0,l=this.length;s<l;s++){a.push(e=[]);for(var u,c=0,d=(u=this[s]).length;c<d;c++)(t=u[c])&&Ps(t,c,o,i,{time:(n=t[o][r]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),e.push(t)}return Ns(a,o,i)},o.svg.axis=function(){var e,t=o.scale.linear(),n=Ls,r=6,i=6,a=3,l=[10],u=null;function c(s){s.each(function(){var s,c=o.select(this),d=this.__chart__||t,f=this.__chart__=t.copy(),p=null==u?f.ticks?f.ticks.apply(f,l):f.domain():u,h=null==e?f.tickFormat?f.tickFormat.apply(f,l):F:e,g=c.selectAll(".tick").data(p,f),m=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Se),v=o.transition(g.exit()).style("opacity",Se).remove(),y=o.transition(g.order()).style("opacity",1),_=Math.max(r,0)+a,b=xa(f),w=c.selectAll(".domain").data([0]),x=(w.enter().append("path").attr("class","domain"),o.transition(w));m.append("line"),m.append("text");var k,C,D,S,A=m.select("line"),E=y.select("line"),M=g.select("text").text(h),T=m.select("text"),j=y.select("text"),N="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(s=Us,k="x",D="y",C="x2",S="y2",M.attr("dy",N<0?"0em":".71em").style("text-anchor","middle"),x.attr("d","M"+b[0]+","+N*i+"V0H"+b[1]+"V"+N*i)):(s=Vs,k="y",D="x",C="y2",S="x2",M.attr("dy",".32em").style("text-anchor",N<0?"end":"start"),x.attr("d","M"+N*i+","+b[0]+"H0V"+b[1]+"H"+N*i)),A.attr(S,N*r),T.attr(D,N*_),E.attr(C,0).attr(S,N*r),j.attr(k,0).attr(D,N*_),f.rangeBand){var O=f,I=O.rangeBand()/2;d=f=function(e){return O(e)+I}}else d.rangeBand?d=f:v.call(s,f,d);m.call(s,d,f),y.call(s,f,f)})}return c.scale=function(e){return arguments.length?(t=e,c):t},c.orient=function(e){return arguments.length?(n=e in Bs?e+"":Ls,c):n},c.ticks=function(){return arguments.length?(l=s(arguments),c):l},c.tickValues=function(e){return arguments.length?(u=e,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(e){var t=arguments.length;return t?(r=+e,i=+arguments[t-1],c):r},c.innerTickSize=function(e){return arguments.length?(r=+e,c):r},c.outerTickSize=function(e){return arguments.length?(i=+e,c):i},c.tickPadding=function(e){return arguments.length?(a=+e,c):a},c.tickSubdivide=function(){return arguments.length&&c},c};var Ls="bottom",Bs={top:1,right:1,bottom:1,left:1};function Us(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"})}function Vs(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"})}o.svg.brush=function(){var e,t,n=B(f,"brushstart","brush","brushend"),r=null,i=null,a=[0,0],s=[0,0],l=!0,u=!0,d=Ws[0];function f(e){e.each(function(){var e=o.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),t=e.selectAll(".background").data([0]);t.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(d,F);n.exit().remove(),n.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return Hs[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",f.empty()?"none":null);var a,s=o.transition(e),l=o.transition(t);r&&(a=xa(r),l.attr("x",a[0]).attr("width",a[1]-a[0]),h(s)),i&&(a=xa(i),l.attr("y",a[0]).attr("height",a[1]-a[0]),g(s)),p(s)})}function p(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+a[+/e$/.test(e)]+","+s[+/^s/.test(e)]+")"})}function h(e){e.select(".extent").attr("x",a[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",a[1]-a[0])}function g(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function m(){var d,m,v=this,y=o.select(o.event.target),_=n.of(v,arguments),b=o.select(v),w=y.datum(),x=!/^(n|s)$/.test(w)&&r,k=!/^(e|w)$/.test(w)&&i,C=y.classed("extent"),D=xe(v),S=o.mouse(v),A=o.select(c(v)).on("keydown.brush",function(){32==o.event.keyCode&&(C||(d=null,S[0]-=a[1],S[1]-=s[1],C=2),P())}).on("keyup.brush",function(){32==o.event.keyCode&&2==C&&(S[0]+=a[1],S[1]+=s[1],C=0,P())});if(o.event.changedTouches?A.on("touchmove.brush",T).on("touchend.brush",N):A.on("mousemove.brush",T).on("mouseup.brush",N),b.interrupt().selectAll("*").interrupt(),C)S[0]=a[0]-S[0],S[1]=s[0]-S[1];else if(w){var E=+/w$/.test(w),M=+/^n/.test(w);m=[a[1-E]-S[0],s[1-M]-S[1]],S[0]=a[E],S[1]=s[M]}else o.event.altKey&&(d=S.slice());function T(){var e=o.mouse(v),t=!1;m&&(e[0]+=m[0],e[1]+=m[1]),C||(o.event.altKey?(d||(d=[(a[0]+a[1])/2,(s[0]+s[1])/2]),S[0]=a[+(e[0]<d[0])],S[1]=s[+(e[1]<d[1])]):d=null),x&&j(e,r,0)&&(h(b),t=!0),k&&j(e,i,1)&&(g(b),t=!0),t&&(p(b),_({type:"brush",mode:C?"move":"resize"}))}function j(n,r,i){var o,c,f=xa(r),p=f[0],h=f[1],g=S[i],m=i?s:a,v=m[1]-m[0];if(C&&(p-=g,h-=v+g),o=(i?u:l)?Math.max(p,Math.min(h,n[i])):n[i],C?c=(o+=g)+v:(d&&(g=Math.max(p,Math.min(h,2*d[i]-o))),g<o?(c=o,o=g):c=g),m[0]!=o||m[1]!=c)return i?t=null:e=null,m[0]=o,m[1]=c,!0}function N(){T(),b.style("pointer-events","all").selectAll(".resize").style("display",f.empty()?"none":null),o.select("body").style("cursor",null),A.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),_({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),o.select("body").style("cursor",y.style("cursor")),_({type:"brushstart"}),T()}return f.event=function(r){r.each(function(){var r=n.of(this,arguments),i={x:a,y:s,i:e,j:t},l=this.__chart__||i;this.__chart__=i,Fs?o.select(this).transition().each("start.brush",function(){e=l.i,t=l.j,a=l.x,s=l.y,r({type:"brushstart"})}).tween("brush:brush",function(){var n=ro(a,i.x),o=ro(s,i.y);return e=t=null,function(e){a=i.x=n(e),s=i.y=o(e),r({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=i.i,t=i.j,r({type:"brush",mode:"resize"}),r({type:"brushend"})}):(r({type:"brushstart"}),r({type:"brush",mode:"resize"}),r({type:"brushend"}))})},f.x=function(e){return arguments.length?(d=Ws[!(r=e)<<1|!i],f):r},f.y=function(e){return arguments.length?(d=Ws[!r<<1|!(i=e)],f):i},f.clamp=function(e){return arguments.length?(r&&i?(l=!!e[0],u=!!e[1]):r?l=!!e:i&&(u=!!e),f):r&&i?[l,u]:r?l:i?u:null},f.extent=function(n){var o,l,u,c,d;return arguments.length?(r&&(o=n[0],l=n[1],i&&(o=o[0],l=l[0]),e=[o,l],r.invert&&(o=r(o),l=r(l)),l<o&&(d=o,o=l,l=d),o==a[0]&&l==a[1]||(a=[o,l])),i&&(u=n[0],c=n[1],r&&(u=u[1],c=c[1]),t=[u,c],i.invert&&(u=i(u),c=i(c)),c<u&&(d=u,u=c,c=d),u==s[0]&&c==s[1]||(s=[u,c])),f):(r&&(e?(o=e[0],l=e[1]):(o=a[0],l=a[1],r.invert&&(o=r.invert(o),l=r.invert(l)),l<o&&(d=o,o=l,l=d))),i&&(t?(u=t[0],c=t[1]):(u=s[0],c=s[1],i.invert&&(u=i.invert(u),c=i.invert(c)),c<u&&(d=u,u=c,c=d))),r&&i?[[o,u],[l,c]]:r?[o,l]:i&&[u,c])},f.clear=function(){return f.empty()||(a=[0,0],s=[0,0],e=t=null),f},f.empty=function(){return!!r&&a[0]==a[1]||!!i&&s[0]==s[1]},o.rebind(f,n,"on")};var Hs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ws=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Gs=zt.format=fn.timeFormat,Ys=Gs.utc,Qs=Ys("%Y-%m-%dT%H:%M:%S.%LZ");function Ks(e){return e.toISOString()}function Zs(e,t,n){function r(t){return e(t)}function i(e,n){var r=(e[1]-e[0])/n,i=o.bisect(Js,r);return i==Js.length?[t.year,ja(e.map(function(e){return e/31536e6}),n)[2]]:i?t[r/Js[i-1]<Js[i]/r?i-1:i]:[nl,ja(e,n)[2]]}return r.invert=function(t){return Xs(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain().map(Xs)},r.nice=function(e,t){var n=r.domain(),o=wa(n),a=null==e?i(o,10):"number"==typeof e&&i(o,e);function s(n){return!isNaN(n)&&!e.range(n,Xs(+n+1),t).length}return a&&(e=a[0],t=a[1]),r.domain(Ca(n,t>1?{floor:function(t){for(;s(t=e.floor(t));)t=Xs(t-1);return t},ceil:function(t){for(;s(t=e.ceil(t));)t=Xs(+t+1);return t}}:e))},r.ticks=function(e,t){var n=wa(r.domain()),o=null==e?i(n,10):"number"==typeof e?i(n,e):!e.range&&[{range:e},t];return o&&(e=o[0],t=o[1]),e.range(n[0],Xs(+n[1]+1),t<1?1:t)},r.tickFormat=function(){return n},r.copy=function(){return Zs(e.copy(),t,n)},Ma(r,e)}function Xs(e){return new Date(e)}Gs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ks:Qs,Ks.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Ks.toString=Qs.toString,zt.second=Pt(function(e){return new $t(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),zt.seconds=zt.second.range,zt.seconds.utc=zt.second.utc.range,zt.minute=Pt(function(e){return new $t(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),zt.minutes=zt.minute.range,zt.minutes.utc=zt.minute.utc.range,zt.hour=Pt(function(e){var t=e.getTimezoneOffset()/60;return new $t(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),zt.hours=zt.hour.range,zt.hours.utc=zt.hour.utc.range,zt.month=Pt(function(e){return(e=zt.day(e)).setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),zt.months=zt.month.range,zt.months.utc=zt.month.utc.range;var Js=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],el=[[zt.second,1],[zt.second,5],[zt.second,15],[zt.second,30],[zt.minute,1],[zt.minute,5],[zt.minute,15],[zt.minute,30],[zt.hour,1],[zt.hour,3],[zt.hour,6],[zt.hour,12],[zt.day,1],[zt.day,2],[zt.week,1],[zt.month,1],[zt.month,3],[zt.year,1]],tl=Gs.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Zn]]),nl={range:function(e,t,n){return o.range(Math.ceil(e/n)*n,+t,n).map(Xs)},floor:F,ceil:F};el.year=zt.year,zt.scale=function(){return Zs(o.scale.linear(),el,tl)};var rl=el.map(function(e){return[e[0].utc,e[1]]}),il=Ys.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Zn]]);function ol(e){return JSON.parse(e.responseText)}function al(e){var t=l.createRange();return t.selectNode(l.body),t.createContextualFragment(e.responseText)}rl.year=zt.year.utc,zt.scale.utc=function(){return Zs(o.scale.linear(),rl,il)},o.text=_t(function(e){return e.responseText}),o.json=function(e,t){return bt(e,"application/json",ol,t)},o.html=function(e,t){return bt(e,"text/html",al,t)},o.xml=_t(function(e){return e.responseXML}),this.d3=o,void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i)}()},3729:function(e,t){var n,r;void 0===(r="function"==typeof(n=function(){return function e(t,n,r){var i,o,a=window,s="application/octet-stream",l=r||s,u=t,c=!n&&!r&&u,d=document.createElement("a"),f=function(e){return String(e)},p=a.Blob||a.MozBlob||a.WebKitBlob||f,h=n||"download";if(p=p.call?p.bind(a):Blob,"true"===String(this)&&(l=(u=[u,l])[0],u=u[1]),c&&c.length<2048&&(h=c.split("/").pop().split("?")[0],d.href=c,-1!==d.href.indexOf(c))){var g=new XMLHttpRequest;return g.open("GET",c,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,h,s)},setTimeout(function(){g.send()},0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&p!==f))return navigator.msSaveBlob?navigator.msSaveBlob(_(u),h):b(u);l=(u=_(u)).type||s}else if(/([\x80-\xff])/.test(u)){for(var m=0,v=new Uint8Array(u.length),y=v.length;m<y;++m)v[m]=u.charCodeAt(m);u=new p([v],{type:l})}function _(e){for(var t=e.split(/[:;,]/),n=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),i=r.length,o=0,a=new Uint8Array(i);o<i;++o)a[o]=r.charCodeAt(o);return new p([a],{type:n})}function b(e,t){if("download"in d)return d.href=e,d.setAttribute("download",h),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout(function(){d.click(),document.body.removeChild(d),!0===t&&setTimeout(function(){a.URL.revokeObjectURL(d.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout(function(){document.body.removeChild(n)},333)}if(i=u instanceof p?u:new p([u],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(i,h);if(a.URL)b(a.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===f)try{return b("data:"+l+";base64,"+a.btoa(i))}catch(e){return b("data:"+l+","+encodeURIComponent(i))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(i)}return!0}})?n.apply(t,[]):n)||(e.exports=r)},9983:function(e,t,n){var r=n(9755),i=n(7672);void 0===i.jQuery&&(i.jQuery={}),void 0===i.jQuery.$&&(i.jQuery.$=r),e.exports=r},3857:function(e,t,n){var r=n(5078);n(7672).d3=r,e.exports=r},4663:function(e,t,n){var r=n(6107);n(7672).jsPanel=r,e.exports=r},7672:function(e,t,n){"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},624:function(e,t,n){"use strict";var r,i,o,a=[n(5525),n(4785),n(8291),n(2709),n(2506),n(9176)],s=-1,l=[],u=!1;function c(){r&&i&&(r=!1,i.length?l=i.concat(l):s=-1,l.length&&d())}function d(){if(!r){u=!1,r=!0;for(var e=l.length,t=setTimeout(c);e;){for(i=l,l=[];i&&++s<e;)i[s].run();s=-1,e=l.length}i=null,s=-1,r=!1,clearTimeout(t)}}for(var f=-1,p=a.length;++f<p;)if(a[f]&&a[f].test&&a[f].test()){o=a[f].install(d);break}function h(e,t){this.fun=e,this.array=t}h.prototype.run=function(){var e=this.fun,t=this.array;switch(t.length){case 0:return e();case 1:return e(t[0]);case 2:return e(t[0],t[1]);case 3:return e(t[0],t[1],t[2]);default:return e.apply(null,t)}},e.exports=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),u||r||(u=!0,o())}},2709:function(e,t,n){"use strict";t.test=function(){return!n.g.setImmediate&&void 0!==n.g.MessageChannel},t.install=function(e){var t=new n.g.MessageChannel;return t.port1.onmessage=e,function(){t.port2.postMessage(0)}}},8291:function(e,t,n){"use strict";var r=n.g.MutationObserver||n.g.WebKitMutationObserver;t.test=function(){return r},t.install=function(e){var t=0,i=new r(e),o=n.g.document.createTextNode("");return i.observe(o,{characterData:!0}),function(){o.data=t=++t%2}}},4785:function(e,t,n){"use strict";t.test=function(){return"function"==typeof n.g.queueMicrotask},t.install=function(e){return function(){n.g.queueMicrotask(e)}}},2506:function(e,t,n){"use strict";t.test=function(){return"document"in n.g&&"onreadystatechange"in n.g.document.createElement("script")},t.install=function(e){return function(){var t=n.g.document.createElement("script");return t.onreadystatechange=function(){e(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},n.g.document.documentElement.appendChild(t),e}}},9176:function(e,t){"use strict";t.test=function(){return!0},t.install=function(e){return function(){setTimeout(e,0)}}},5384:function(e,t,n){var r,i,o;i=[n(9983),n(1491)],r=function(e){"use strict";var t=function(i,o){i[0].queryBuilder=this,this.$el=i,this.settings=e.extendext(!0,"replace",{},t.DEFAULTS,o),this.model=new r,this.status={id:null,generated_id:!1,group_id:0,rule_id:0,has_optgroup:!1,has_operator_optgroup:!1},this.filters=this.settings.filters,this.icons=this.settings.icons,this.operators=this.settings.operators,this.templates=this.settings.templates,this.plugins=this.settings.plugins,this.lang=null,void 0===t.regional.en&&n.error("Config",'"i18n/en.js" not loaded.'),this.lang=e.extendext(!0,"replace",{},t.regional.en,t.regional[this.settings.lang_code],this.settings.lang),!1===this.settings.allow_groups?this.settings.allow_groups=0:!0===this.settings.allow_groups&&(this.settings.allow_groups=-1),Object.keys(this.templates).forEach(function(e){if(this.templates[e]||(this.templates[e]=t.templates[e]),"function"!=typeof this.templates[e])throw new Error(`Template ${e} must be a function`)},this),this.$el.attr("id")||(this.$el.attr("id","qb_"+Math.floor(99999*Math.random())),this.status.generated_id=!0),this.status.id=this.$el.attr("id"),this.$el.addClass("query-builder form-inline"),this.filters=this.checkFilters(this.filters),this.operators=this.checkOperators(this.operators),this.bindEvents(),this.initPlugins()};e.extend(t.prototype,{trigger:function(t){var n=new e.Event(this._tojQueryEvent(t),{builder:this});return this.$el.triggerHandler(n,Array.prototype.slice.call(arguments,1)),n},change:function(t,n){var r=new e.Event(this._tojQueryEvent(t,!0),{builder:this,value:n});return this.$el.triggerHandler(r,Array.prototype.slice.call(arguments,2)),r.value},on:function(e,t){return this.$el.on(this._tojQueryEvent(e),t),this},off:function(e,t){return this.$el.off(this._tojQueryEvent(e),t),this},once:function(e,t){return this.$el.one(this._tojQueryEvent(e),t),this},_tojQueryEvent:function(e,t){return e.split(" ").map(function(e){return e+".queryBuilder"+(t?".filter":"")}).join(" ")}}),t.types={string:"string",integer:"number",double:"number",date:"datetime",time:"datetime",datetime:"datetime",boolean:"boolean"},t.inputs=["text","number","textarea","radio","checkbox","select"],t.modifiable_options=["display_errors","allow_groups","allow_empty","default_condition","default_filter"],t.selectors={group_container:".rules-group-container",rule_container:".rule-container",filter_container:".rule-filter-container",operator_container:".rule-operator-container",value_container:".rule-value-container",error_container:".error-container",condition_container:".rules-group-header .group-conditions",rule_header:".rule-header",group_header:".rules-group-header",group_actions:".group-actions",rule_actions:".rule-actions",rules_list:".rules-group-body>.rules-list",group_condition:".rules-group-header [name$=_cond]",rule_filter:".rule-filter-container [name$=_filter]",rule_operator:".rule-operator-container [name$=_operator]",rule_value:".rule-value-container [name*=_value_]",add_rule:"[data-add=rule]",delete_rule:"[data-delete=rule]",add_group:"[data-add=group]",delete_group:"[data-delete=group]"},t.templates={},t.regional={},t.OPERATORS={equal:{type:"equal",nb_inputs:1,multiple:!1,apply_to:["string","number","datetime","boolean"]},not_equal:{type:"not_equal",nb_inputs:1,multiple:!1,apply_to:["string","number","datetime","boolean"]},in:{type:"in",nb_inputs:1,multiple:!0,apply_to:["string","number","datetime"]},not_in:{type:"not_in",nb_inputs:1,multiple:!0,apply_to:["string","number","datetime"]},less:{type:"less",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},less_or_equal:{type:"less_or_equal",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},greater:{type:"greater",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},greater_or_equal:{type:"greater_or_equal",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},between:{type:"between",nb_inputs:2,multiple:!1,apply_to:["number","datetime"]},not_between:{type:"not_between",nb_inputs:2,multiple:!1,apply_to:["number","datetime"]},begins_with:{type:"begins_with",nb_inputs:1,multiple:!1,apply_to:["string"]},not_begins_with:{type:"not_begins_with",nb_inputs:1,multiple:!1,apply_to:["string"]},contains:{type:"contains",nb_inputs:1,multiple:!1,apply_to:["string"]},not_contains:{type:"not_contains",nb_inputs:1,multiple:!1,apply_to:["string"]},ends_with:{type:"ends_with",nb_inputs:1,multiple:!1,apply_to:["string"]},not_ends_with:{type:"not_ends_with",nb_inputs:1,multiple:!1,apply_to:["string"]},is_empty:{type:"is_empty",nb_inputs:0,multiple:!1,apply_to:["string"]},is_not_empty:{type:"is_not_empty",nb_inputs:0,multiple:!1,apply_to:["string"]},is_null:{type:"is_null",nb_inputs:0,multiple:!1,apply_to:["string","number","datetime","boolean"]},is_not_null:{type:"is_not_null",nb_inputs:0,multiple:!1,apply_to:["string","number","datetime","boolean"]}},t.DEFAULTS={filters:[],plugins:[],sort_filters:!1,display_errors:!0,allow_groups:-1,allow_empty:!1,conditions:["AND","OR"],default_condition:"AND",inputs_separator:" , ",select_placeholder:"------",display_empty_filter:!0,default_filter:null,optgroups:{},default_rule_flags:{filter_readonly:!1,operator_readonly:!1,value_readonly:!1,no_delete:!1},default_group_flags:{condition_readonly:!1,no_add_rule:!1,no_add_group:!1,no_delete:!1},templates:{group:null,rule:null,filterSelect:null,operatorSelect:null,ruleValueSelect:null},lang_code:"en",lang:{},operators:["equal","not_equal","in","not_in","less","less_or_equal","greater","greater_or_equal","between","not_between","begins_with","not_begins_with","contains","not_contains","ends_with","not_ends_with","is_empty","is_not_empty","is_null","is_not_null"],icons:{add_group:"glyphicon glyphicon-plus-sign",add_rule:"glyphicon glyphicon-plus",remove_group:"glyphicon glyphicon-remove",remove_rule:"glyphicon glyphicon-remove",error:"glyphicon glyphicon-warning-sign"}},t.plugins={},t.defaults=function(n){if("object"!=typeof n)return"string"==typeof n?"object"==typeof t.DEFAULTS[n]?e.extend(!0,{},t.DEFAULTS[n]):t.DEFAULTS[n]:e.extend(!0,{},t.DEFAULTS);e.extendext(!0,"replace",t.DEFAULTS,n)},t.define=function(e,n,r){t.plugins[e]={fct:n,def:r||{}}},t.extend=function(n){e.extend(t.prototype,n)},t.prototype.initPlugins=function(){if(this.plugins){if(e.isArray(this.plugins)){var r={};this.plugins.forEach(function(e){r[e]=null}),this.plugins=r}Object.keys(this.plugins).forEach(function(r){r in t.plugins?(this.plugins[r]=e.extend(!0,{},t.plugins[r].def,this.plugins[r]||{}),t.plugins[r].fct.call(this,this.plugins[r])):n.error("Config",'Unable to find plugin "{0}"',r)},this)}},t.prototype.getPluginOptions=function(e,r){var i;if(this.plugins&&this.plugins[e]?i=this.plugins[e]:t.plugins[e]&&(i=t.plugins[e].def),i)return r?i[r]:i;n.error("Config",'Unable to find plugin "{0}"',e)},t.prototype.init=function(e){this.trigger("afterInit"),e?(this.setRules(e),delete this.settings.rules):this.setRoot(!0)},t.prototype.checkFilters=function(e){var r=[];if(e&&0!==e.length||n.error("Config","Missing filters list"),e.forEach(function(e,i){switch(e.id||n.error("Config","Missing filter {0} id",i),-1!=r.indexOf(e.id)&&n.error("Config",'Filter "{0}" already defined',e.id),r.push(e.id),e.type?t.types[e.type]||n.error("Config",'Invalid type "{0}"',e.type):e.type="string",e.input?"function"!=typeof e.input&&-1==t.inputs.indexOf(e.input)&&n.error("Config",'Invalid input "{0}"',e.input):e.input="number"===t.types[e.type]?"number":"text",e.operators&&e.operators.forEach(function(e){"string"!=typeof e&&n.error("Config","Filter operators must be global operators types (string)")}),e.field||(e.field=e.id),e.label||(e.label=e.field),e.optgroup?(this.status.has_optgroup=!0,this.settings.optgroups[e.optgroup]||(this.settings.optgroups[e.optgroup]=e.optgroup)):e.optgroup=null,e.input){case"radio":case"checkbox":(!e.values||e.values.length<1)&&n.error("Config",'Missing filter "{0}" values',e.id);break;case"select":var o=[];e.has_optgroup=!1,n.iterateOptions(e.values,function(t,n,r){o.push({value:t,label:n,optgroup:r||null}),r&&(e.has_optgroup=!0,this.settings.optgroups[r]||(this.settings.optgroups[r]=r))}.bind(this)),e.has_optgroup?e.values=n.groupSort(o,"optgroup"):e.values=o,e.placeholder&&(void 0===e.placeholder_value&&(e.placeholder_value=-1),e.values.forEach(function(t){t.value==e.placeholder_value&&n.error("Config",'Placeholder of filter "{0}" overlaps with one of its values',e.id)}))}},this),this.settings.sort_filters)if("function"==typeof this.settings.sort_filters)e.sort(this.settings.sort_filters);else{var i=this;e.sort(function(e,t){return i.translate(e.label).localeCompare(i.translate(t.label))})}return this.status.has_optgroup&&(e=n.groupSort(e,"optgroup")),e},t.prototype.checkOperators=function(r){var i=[];return r.forEach(function(o,a){"string"==typeof o?(t.OPERATORS[o]||n.error("Config",'Unknown operator "{0}"',o),r[a]=o=e.extendext(!0,"replace",{},t.OPERATORS[o])):(o.type||n.error("Config",'Missing "type" for operator {0}',a),t.OPERATORS[o.type]&&(r[a]=o=e.extendext(!0,"replace",{},t.OPERATORS[o.type],o)),void 0!==o.nb_inputs&&void 0!==o.apply_to||n.error("Config",'Missing "nb_inputs" and/or "apply_to" for operator "{0}"',o.type)),-1!=i.indexOf(o.type)&&n.error("Config",'Operator "{0}" already defined',o.type),i.push(o.type),o.optgroup?(this.status.has_operator_optgroup=!0,this.settings.optgroups[o.optgroup]||(this.settings.optgroups[o.optgroup]=o.optgroup)):o.optgroup=null},this),this.status.has_operator_optgroup&&(r=n.groupSort(r,"optgroup")),r},t.prototype.bindEvents=function(){var n=this,r=t.selectors;this.$el.on("change.queryBuilder",r.group_condition,function(){if(e(this).is(":checked")){var t=e(this).closest(r.group_container);n.getModel(t).condition=e(this).val()}}),this.$el.on("change.queryBuilder",r.rule_filter,function(){var t=e(this).closest(r.rule_container);n.getModel(t).filter=n.getFilterById(e(this).val())}),this.$el.on("change.queryBuilder",r.rule_operator,function(){var t=e(this).closest(r.rule_container);n.getModel(t).operator=n.getOperatorByType(e(this).val())}),this.$el.on("click.queryBuilder",r.add_rule,function(){var t=e(this).closest(r.group_container);n.addRule(n.getModel(t))}),this.$el.on("click.queryBuilder",r.delete_rule,function(){var t=e(this).closest(r.rule_container);n.deleteRule(n.getModel(t))}),0!==this.settings.allow_groups&&(this.$el.on("click.queryBuilder",r.add_group,function(){var t=e(this).closest(r.group_container);n.addGroup(n.getModel(t))}),this.$el.on("click.queryBuilder",r.delete_group,function(){var t=e(this).closest(r.group_container);n.deleteGroup(n.getModel(t))})),this.model.on({drop:function(e,t){t.$el.remove(),n.refreshGroupsConditions()},add:function(e,r,i,o){0===o?i.$el.prependTo(r.$el.find(">"+t.selectors.rules_list)):i.$el.insertAfter(r.rules[o-1].$el),n.refreshGroupsConditions()},move:function(e,r,i,o){r.$el.detach(),0===o?r.$el.prependTo(i.$el.find(">"+t.selectors.rules_list)):r.$el.insertAfter(i.rules[o-1].$el),n.refreshGroupsConditions()},update:function(e,t,r,i,o){if(t instanceof a)switch(r){case"error":n.updateError(t);break;case"flags":n.applyRuleFlags(t);break;case"filter":n.updateRuleFilter(t,o);break;case"operator":n.updateRuleOperator(t,o);break;case"value":n.updateRuleValue(t,o)}else switch(r){case"error":n.updateError(t);break;case"flags":n.applyGroupFlags(t);break;case"condition":n.updateGroupCondition(t,o)}}})},t.prototype.setRoot=function(t,n,r){t=void 0===t||!0===t;var i=this.nextGroupId(),a=e(e.parseHTML(this.getGroupTemplate(i,1)));return this.$el.append(a),this.model.root=new o(null,a),this.model.root.model=this.model,this.model.root.data=n,this.model.root.flags=e.extend({},this.settings.default_group_flags,r),this.model.root.condition=this.settings.default_condition,this.trigger("afterAddGroup",this.model.root),t&&this.addRule(this.model.root),this.model.root},t.prototype.addGroup=function(t,n,r,i){n=void 0===n||!0===n;var o=t.level+1;if(this.trigger("beforeAddGroup",t,n,o).isDefaultPrevented())return null;var a=this.nextGroupId(),s=e(this.getGroupTemplate(a,o)),l=t.addGroup(s);return l.data=r,l.flags=e.extend({},this.settings.default_group_flags,i),l.condition=this.settings.default_condition,this.trigger("afterAddGroup",l),this.trigger("rulesChanged"),n&&this.addRule(l),l},t.prototype.deleteGroup=function(e){if(e.isRoot())return!1;if(this.trigger("beforeDeleteGroup",e).isDefaultPrevented())return!1;var t=!0;return e.each("reverse",function(e){t&=this.deleteRule(e)},function(e){t&=this.deleteGroup(e)},this),t&&(e.drop(),this.trigger("afterDeleteGroup"),this.trigger("rulesChanged")),t},t.prototype.updateGroupCondition=function(n,r){n.$el.find(">"+t.selectors.group_condition).each(function(){var t=e(this);t.prop("checked",t.val()===n.condition),t.parent().toggleClass("active",t.val()===n.condition)}),this.trigger("afterUpdateGroupCondition",n,r),this.trigger("rulesChanged")},t.prototype.refreshGroupsConditions=function(){!function e(n){(!n.flags||n.flags&&!n.flags.condition_readonly)&&n.$el.find(">"+t.selectors.group_condition).prop("disabled",n.rules.length<=1).parent().toggleClass("disabled",n.rules.length<=1),n.each(null,function(t){e(t)},this)}(this.model.root)},t.prototype.addRule=function(t,n,r){if(this.trigger("beforeAddRule",t).isDefaultPrevented())return null;var i=this.nextRuleId(),o=e(e.parseHTML(this.getRuleTemplate(i))),a=t.addRule(o);return a.data=n,a.flags=e.extend({},this.settings.default_rule_flags,r),this.trigger("afterAddRule",a),this.trigger("rulesChanged"),this.createRuleFilters(a),!this.settings.default_filter&&this.settings.display_empty_filter||(a.filter=this.change("getDefaultFilter",this.getFilterById(this.settings.default_filter||this.filters[0].id),a)),a},t.prototype.deleteRule=function(e){return!e.flags.no_delete&&!this.trigger("beforeDeleteRule",e).isDefaultPrevented()&&(e.drop(),this.trigger("afterDeleteRule"),this.trigger("rulesChanged"),!0)},t.prototype.createRuleFilters=function(n){var r=this.change("getRuleFilters",this.filters,n),i=e(e.parseHTML(this.getRuleFilterSelect(n,r)));n.$el.find(t.selectors.filter_container).html(i),this.trigger("afterCreateRuleFilters",n),this.applyRuleFlags(n)},t.prototype.createRuleOperators=function(n){var r=n.$el.find(t.selectors.operator_container).empty();if(n.filter){var i=this.getOperators(n.filter),o=e(e.parseHTML(this.getRuleOperatorSelect(n,i)));r.html(o),n.filter.default_operator?n.__.operator=this.getOperatorByType(n.filter.default_operator):n.__.operator=i[0],n.$el.find(t.selectors.rule_operator).val(n.operator.type),this.trigger("afterCreateRuleOperators",n,i),this.applyRuleFlags(n)}},t.prototype.createRuleInput=function(n){var r=n.$el.find(t.selectors.value_container).empty();if(n.__.value=void 0,n.filter&&n.operator&&0!==n.operator.nb_inputs){for(var i=this,o=e(),a=n.filter,s=0;s<n.operator.nb_inputs;s++){var l=e(e.parseHTML(e.trim(this.getRuleInput(n,s))));s>0&&r.append(this.settings.inputs_separator),r.append(l),o=o.add(l)}r.css("display",""),o.on("change "+(a.input_event||""),function(){n._updating_input||(n._updating_value=!0,n.value=i.getRuleInputValue(n),n._updating_value=!1)}),a.plugin&&o[a.plugin](a.plugin_config||{}),this.trigger("afterCreateRuleInput",n),void 0!==a.default_value?n.value=a.default_value:(n._updating_value=!0,n.value=i.getRuleInputValue(n),n._updating_value=!1),this.applyRuleFlags(n)}},t.prototype.updateRuleFilter=function(e,n){this.createRuleOperators(e),this.createRuleInput(e),e.$el.find(t.selectors.rule_filter).val(e.filter?e.filter.id:"-1"),n&&e.filter&&n.id!==e.filter.id&&(e.data=void 0),this.trigger("afterUpdateRuleFilter",e,n),this.trigger("rulesChanged")},t.prototype.updateRuleOperator=function(e,n){var r=e.$el.find(t.selectors.value_container);e.operator&&0!==e.operator.nb_inputs?(r.css("display",""),!r.is(":empty")&&n&&e.operator.nb_inputs===n.nb_inputs&&e.operator.optgroup===n.optgroup||this.createRuleInput(e)):(r.hide(),e.__.value=void 0),e.operator&&(e.$el.find(t.selectors.rule_operator).val(e.operator.type),e.__.value=this.getRuleInputValue(e)),this.trigger("afterUpdateRuleOperator",e,n),this.trigger("rulesChanged")},t.prototype.updateRuleValue=function(e,t){e._updating_value||this.setRuleInputValue(e,e.value),this.trigger("afterUpdateRuleValue",e,t),this.trigger("rulesChanged")},t.prototype.applyRuleFlags=function(e){var n=e.flags,r=t.selectors;e.$el.find(r.rule_filter).prop("disabled",n.filter_readonly),e.$el.find(r.rule_operator).prop("disabled",n.operator_readonly),e.$el.find(r.rule_value).prop("disabled",n.value_readonly),n.no_delete&&e.$el.find(r.delete_rule).remove(),this.trigger("afterApplyRuleFlags",e)},t.prototype.applyGroupFlags=function(e){var n=e.flags,r=t.selectors;e.$el.find(">"+r.group_condition).prop("disabled",n.condition_readonly).parent().toggleClass("readonly",n.condition_readonly),n.no_add_rule&&e.$el.find(r.add_rule).remove(),n.no_add_group&&e.$el.find(r.add_group).remove(),n.no_delete&&e.$el.find(r.delete_group).remove(),this.trigger("afterApplyGroupFlags",e)},t.prototype.clearErrors=function(e){(e=e||this.model.root)&&(e.error=null,e instanceof o&&e.each(function(e){e.error=null},function(e){this.clearErrors(e)},this))},t.prototype.updateError=function(e){if(this.settings.display_errors)if(null===e.error)e.$el.removeClass("has-error");else{var r=this.translate("errors",e.error[0]);r=n.fmt(r,e.error.slice(1)),r=this.change("displayError",r,e.error,e),e.$el.addClass("has-error").find(t.selectors.error_container).eq(0).attr("title",r)}},t.prototype.triggerValidationError=function(t,n,r){e.isArray(n)||(n=[n]),this.trigger("validationError",t,n,r).isDefaultPrevented()||(t.error=n)},t.prototype.destroy=function(){this.trigger("beforeDestroy"),this.status.generated_id&&this.$el.removeAttr("id"),this.clear(),this.model=null,this.$el.off(".queryBuilder").removeClass("query-builder").removeData("queryBuilder"),delete this.$el[0].queryBuilder},t.prototype.reset=function(){this.trigger("beforeReset").isDefaultPrevented()||(this.status.group_id=1,this.status.rule_id=0,this.model.root.empty(),this.model.root.data=void 0,this.model.root.flags=e.extend({},this.settings.default_group_flags),this.model.root.condition=this.settings.default_condition,this.addRule(this.model.root),this.trigger("afterReset"),this.trigger("rulesChanged"))},t.prototype.clear=function(){this.trigger("beforeClear").isDefaultPrevented()||(this.status.group_id=0,this.status.rule_id=0,this.model.root&&(this.model.root.drop(),this.model.root=null),this.trigger("afterClear"),this.trigger("rulesChanged"))},t.prototype.setOptions=function(n){e.each(n,function(e,n){-1!==t.modifiable_options.indexOf(e)&&(this.settings[e]=n)}.bind(this))},t.prototype.getModel=function(t){return t?t instanceof i?t:e(t).data("queryBuilderModel"):this.model.root},t.prototype.validate=function(t){t=e.extend({skip_empty:!1},t),this.clearErrors();var n=this,r=function e(r){var i=0,o=0;return r.each(function(e){if(e.filter||!t.skip_empty){if(!e.filter)return n.triggerValidationError(e,"no_filter",null),void o++;if(!e.operator)return n.triggerValidationError(e,"no_operator",null),void o++;if(0!==e.operator.nb_inputs){var r=n.validateValue(e,e.value);if(!0!==r)return n.triggerValidationError(e,r,e.value),void o++}i++}},function(t){var n=e(t);!0===n?i++:!1===n&&o++}),!(o>0)&&(0===i&&!r.isRoot()&&t.skip_empty?null:!!(0!==i||n.settings.allow_empty&&r.isRoot())||(n.triggerValidationError(r,"empty_group",null),!1))}(this.model.root);return this.change("validate",r)},t.prototype.getRules=function(t){t=e.extend({get_flags:!1,allow_invalid:!1,skip_empty:!1},t);var n=this.validate(t);if(!n&&!t.allow_invalid)return null;var r=this,i=function n(i){var o={condition:i.condition,rules:[]};if(i.data&&(o.data=e.extendext(!0,"replace",{},i.data)),t.get_flags){var a=r.getGroupFlags(i.flags,"all"===t.get_flags);e.isEmptyObject(a)||(o.flags=a)}return i.each(function(n){if(n.filter||!t.skip_empty){var i=null;n.operator&&0===n.operator.nb_inputs||(i=n.value);var a={id:n.filter?n.filter.id:null,field:n.filter?n.filter.field:null,type:n.filter?n.filter.type:null,input:n.filter?n.filter.input:null,operator:n.operator?n.operator.type:null,value:i};if((n.filter&&n.filter.data||n.data)&&(a.data=e.extendext(!0,"replace",{},n.filter?n.filter.data:{},n.data)),t.get_flags){var s=r.getRuleFlags(n.flags,"all"===t.get_flags);e.isEmptyObject(s)||(a.flags=s)}o.rules.push(r.change("ruleToJson",a,n))}},function(e){var r=n(e);0===r.rules.length&&t.skip_empty||o.rules.push(r)},this),r.change("groupToJson",o,i)}(this.model.root);return i.valid=n,this.change("getRules",i)},t.prototype.setRules=function(t,r){r=e.extend({allow_invalid:!1},r),e.isArray(t)&&(t={condition:this.settings.default_condition,rules:t}),t&&t.rules&&(0!==t.rules.length||this.settings.allow_empty)||n.error("RulesParse","Incorrect data object passed"),this.clear(),this.setRoot(!1,t.data,this.parseGroupFlags(t)),t=this.change("setRules",t,r);var i=this;!function e(t,o){null!==o&&(void 0===t.condition?t.condition=i.settings.default_condition:-1==i.settings.conditions.indexOf(t.condition)&&(n.error(!r.allow_invalid,"UndefinedCondition",'Invalid condition "{0}"',t.condition),t.condition=i.settings.default_condition),o.condition=t.condition,t.rules.forEach(function(t){var a;if(void 0!==t.rules)if(-1!==i.settings.allow_groups&&i.settings.allow_groups<o.level)n.error(!r.allow_invalid,"RulesParse","No more than {0} groups are allowed",i.settings.allow_groups),i.reset();else{if(null===(a=i.addGroup(o,!1,t.data,i.parseGroupFlags(t))))return;e(t,a)}else{if(t.empty||(void 0===t.id&&(n.error(!r.allow_invalid,"RulesParse","Missing rule field id"),t.empty=!0),void 0===t.operator&&(t.operator="equal")),null===(a=i.addRule(o,t.data,i.parseRuleFlags(t))))return;t.empty||(a.filter=i.getFilterById(t.id,!r.allow_invalid)),a.filter&&(a.operator=i.getOperatorByType(t.operator,!r.allow_invalid),a.operator||(a.operator=i.getOperators(a.filter)[0])),a.operator&&0!==a.operator.nb_inputs&&(void 0!==t.value?a.value=t.value:void 0!==a.filter.default_value&&(a.value=a.filter.default_value)),i.change("jsonToRule",a,t)!=a&&n.error("RulesParse","Plugin tried to change rule reference")}}),i.change("jsonToGroup",o,t)!=o&&n.error("RulesParse","Plugin tried to change group reference"))}(t,this.model.root),this.trigger("afterSetRules")},t.prototype.validateValue=function(e,t){var n,r=e.filter.validation||{};return n=r.callback?r.callback.call(this,t,e):this._validateValue(e,t),this.change("validateValue",n,t,e)},t.prototype._validateValue=function(r,i){var o,a,s=r.filter,l=r.operator,u=s.validation||{},c=!0;1===r.operator.nb_inputs&&(i=[i]);for(var d=0;d<l.nb_inputs;d++){if(!l.multiple&&e.isArray(i[d])&&i[d].length>1){c=["operator_not_multiple",l.type,this.translate("operators",l.type)];break}switch(s.input){case"radio":if(void 0===i[d]||0===i[d].length){u.allow_empty_value||(c=["radio_empty"]);break}break;case"checkbox":if(void 0===i[d]||0===i[d].length){u.allow_empty_value||(c=["checkbox_empty"]);break}break;case"select":if(void 0===i[d]||0===i[d].length||s.placeholder&&i[d]==s.placeholder_value){u.allow_empty_value||(c=["select_empty"]);break}break;default:a=e.isArray(i[d])?i[d]:[i[d]];for(var f=0;f<a.length;f++){switch(t.types[s.type]){case"string":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["string_empty"]);break}if(void 0!==u.min&&a[f].length<parseInt(u.min)){c=[this.getValidationMessage(u,"min","string_exceed_min_length"),u.min];break}if(void 0!==u.max&&a[f].length>parseInt(u.max)){c=[this.getValidationMessage(u,"max","string_exceed_max_length"),u.max];break}if(u.format&&("string"==typeof u.format&&(u.format=new RegExp(u.format)),!u.format.test(a[f]))){c=[this.getValidationMessage(u,"format","string_invalid_format"),u.format];break}break;case"number":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["number_nan"]);break}if(isNaN(a[f])){c=["number_nan"];break}if("integer"==s.type){if(parseInt(a[f])!=a[f]){c=["number_not_integer"];break}}else if(parseFloat(a[f])!=a[f]){c=["number_not_double"];break}if(void 0!==u.min&&a[f]<parseFloat(u.min)){c=[this.getValidationMessage(u,"min","number_exceed_min"),u.min];break}if(void 0!==u.max&&a[f]>parseFloat(u.max)){c=[this.getValidationMessage(u,"max","number_exceed_max"),u.max];break}if(void 0!==u.step&&"any"!==u.step){var p=(a[f]/u.step).toPrecision(14);if(parseInt(p)!=p){c=[this.getValidationMessage(u,"step","number_wrong_step"),u.step];break}}break;case"datetime":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["datetime_empty"]);break}if(u.format){"moment"in window||n.error("MissingLibrary","MomentJS is required for Date/Time validation. Get it here http://momentjs.com");var h=moment(a[f],u.format);if(!h.isValid()){c=[this.getValidationMessage(u,"format","datetime_invalid"),u.format];break}if(u.min&&h<moment(u.min,u.format)){c=[this.getValidationMessage(u,"min","datetime_exceed_min"),u.min];break}if(u.max&&h>moment(u.max,u.format)){c=[this.getValidationMessage(u,"max","datetime_exceed_max"),u.max];break}}break;case"boolean":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["boolean_not_valid"]);break}if("true"!==(o=(""+a[f]).trim().toLowerCase())&&"false"!==o&&"1"!==o&&"0"!==o&&1!==a[f]&&0!==a[f]){c=["boolean_not_valid"];break}}if(!0!==c)break}}if(!0!==c)break}if(("between"===r.operator.type||"not_between"===r.operator.type)&&2===i.length)switch(t.types[s.type]){case"number":i[0]>i[1]&&(c=["number_between_invalid",i[0],i[1]]);break;case"datetime":u.format&&("moment"in window||n.error("MissingLibrary","MomentJS is required for Date/Time validation. Get it here http://momentjs.com"),moment(i[0],u.format).isAfter(moment(i[1],u.format))&&(c=["datetime_between_invalid",i[0],i[1]]))}return c},t.prototype.nextGroupId=function(){return this.status.id+"_group_"+this.status.group_id++},t.prototype.nextRuleId=function(){return this.status.id+"_rule_"+this.status.rule_id++},t.prototype.getOperators=function(e){"string"==typeof e&&(e=this.getFilterById(e));for(var n=[],r=0,i=this.operators.length;r<i;r++){if(e.operators){if(-1==e.operators.indexOf(this.operators[r].type))continue}else if(-1==this.operators[r].apply_to.indexOf(t.types[e.type]))continue;n.push(this.operators[r])}return e.operators&&n.sort(function(t,n){return e.operators.indexOf(t.type)-e.operators.indexOf(n.type)}),this.change("getOperators",n,e)},t.prototype.getFilterById=function(e,t){if("-1"==e)return null;for(var r=0,i=this.filters.length;r<i;r++)if(this.filters[r].id==e)return this.filters[r];return n.error(!1!==t,"UndefinedFilter",'Undefined filter "{0}"',e),null},t.prototype.getOperatorByType=function(e,t){if("-1"==e)return null;for(var r=0,i=this.operators.length;r<i;r++)if(this.operators[r].type==e)return this.operators[r];return n.error(!1!==t,"UndefinedOperator",'Undefined operator "{0}"',e),null},t.prototype.getRuleInputValue=function(r){var i=r.filter,o=r.operator,a=[];if(i.valueGetter)a=i.valueGetter.call(this,r);else{for(var s=r.$el.find(t.selectors.value_container),l=0;l<o.nb_inputs;l++){var u,c=n.escapeElementId(r.id+"_value_"+l);switch(i.input){case"radio":a.push(s.find("[name="+c+"]:checked").val());break;case"checkbox":u=[],s.find("[name="+c+"]:checked").each(function(){u.push(e(this).val())}),a.push(u);break;case"select":i.multiple?(u=[],s.find("[name="+c+"] option:selected").each(function(){u.push(e(this).val())}),a.push(u)):a.push(s.find("[name="+c+"] option:selected").val());break;default:a.push(s.find("[name="+c+"]").val())}}a=a.map(function(t){return o.multiple&&i.value_separator&&"string"==typeof t&&(t=t.split(i.value_separator)),e.isArray(t)?t.map(function(e){return n.changeType(e,i.type)}):n.changeType(t,i.type)}),1===o.nb_inputs&&(a=a[0]),i.valueParser&&(a=i.valueParser.call(this,r,a))}return this.change("getRuleValue",a,r)},t.prototype.setRuleInputValue=function(r,i){var o=r.filter,a=r.operator;if(o&&a){if(r._updating_input=!0,o.valueSetter)o.valueSetter.call(this,r,i);else{var s=r.$el.find(t.selectors.value_container);1==a.nb_inputs&&(i=[i]);for(var l=0;l<a.nb_inputs;l++){var u=n.escapeElementId(r.id+"_value_"+l);switch(o.input){case"radio":s.find("[name="+u+'][value="'+i[l]+'"]').prop("checked",!0).trigger("change");break;case"checkbox":e.isArray(i[l])||(i[l]=[i[l]]),i[l].forEach(function(e){s.find("[name="+u+'][value="'+e+'"]').prop("checked",!0).trigger("change")});break;default:a.multiple&&o.value_separator&&e.isArray(i[l])&&(i[l]=i[l].join(o.value_separator)),s.find("[name="+u+"]").val(i[l]).trigger("change")}}}r._updating_input=!1}},t.prototype.parseRuleFlags=function(t){var n=e.extend({},this.settings.default_rule_flags);return t.readonly&&e.extend(n,{filter_readonly:!0,operator_readonly:!0,value_readonly:!0,no_delete:!0}),t.flags&&e.extend(n,t.flags),this.change("parseRuleFlags",n,t)},t.prototype.getRuleFlags=function(t,n){if(n)return e.extend({},t);var r={};return e.each(this.settings.default_rule_flags,function(e,n){t[e]!==n&&(r[e]=t[e])}),r},t.prototype.parseGroupFlags=function(t){var n=e.extend({},this.settings.default_group_flags);return t.readonly&&e.extend(n,{condition_readonly:!0,no_add_rule:!0,no_add_group:!0,no_delete:!0}),t.flags&&e.extend(n,t.flags),this.change("parseGroupFlags",n,t)},t.prototype.getGroupFlags=function(t,n){if(n)return e.extend({},t);var r={};return e.each(this.settings.default_group_flags,function(e,n){t[e]!==n&&(r[e]=t[e])}),r},t.prototype.translate=function(e,t){var n;return t||(t=e,e=void 0),n="object"==typeof t?t[this.settings.lang_code]||t.en:(e?this.lang[e]:this.lang)[t]||t,this.change("translate",n,t,e)},t.prototype.getValidationMessage=function(e,t,n){return e.messages&&e.messages[t]||n},t.templates.group=({group_id:e,level:t,conditions:n,icons:r,settings:i,translate:o,builder:a})=>`\n<div id="${e}" class="rules-group-container">\n <div class="rules-group-header">\n <div class="btn-group pull-right group-actions">\n <button type="button" class="btn btn-xs btn-success" data-add="rule">\n <i class="${r}"></i> ${o("add_rule")}\n </button>\n ${-1===i.allow_groups||i.allow_groups>=t?`\n <button type="button" class="btn btn-xs btn-success" data-add="group">\n <i class="${r.add_group}"></i> ${o("add_group")}\n </button>\n `:""}\n ${t>1?`\n <button type="button" class="btn btn-xs btn-danger" data-delete="group">\n <i class="${r.remove_group}"></i> ${o("delete_group")}\n </button>\n `:""}\n </div>\n <div class="btn-group group-conditions">\n ${n.map(t=>`\n <label class="btn btn-xs btn-primary">\n <input type="radio" name="${e}_cond" value="${t}"> ${o("conditions",t)}\n </label>\n `).join("\n")}\n </div>\n ${i.display_errors?`\n <div class="error-container"><i class="${r.error}"></i></div>\n `:""}\n </div>\n <div class=rules-group-body>\n <div class=rules-list></div>\n </div>\n</div>`,t.templates.rule=({rule_id:e,icons:t,settings:n,translate:r,builder:i})=>`\n<div id="${e}" class="rule-container">\n <div class="rule-header">\n <div class="btn-group pull-right rule-actions">\n <button type="button" class="btn btn-xs btn-danger" data-delete="rule">\n <i class="${t.remove_rule}"></i> ${r("delete_rule")}\n </button>\n </div>\n </div>\n ${n.display_errors?`\n <div class="error-container"><i class="${t.error}"></i></div>\n `:""}\n <div class="rule-filter-container"></div>\n <div class="rule-operator-container"></div>\n <div class="rule-value-container"></div>\n</div>`,t.templates.filterSelect=({rule:e,filters:t,icons:n,settings:r,translate:i,builder:o})=>{let a=null;return`\n<select class="form-control" name="${e.id}_filter">\n ${r.display_empty_filter?`\n <option value="-1">${r.select_placeholder}</option>\n `:""}\n ${t.map(e=>`\n ${a!==e.optgroup?`\n ${null!==a?"</optgroup>":""}\n ${null!==(a=e.optgroup)?`\n <optgroup label="${i(r.optgroups[a])}">\n `:""}\n `:""}\n <option value="${e.id}" ${e.icon?`data-icon="${e.icon}"`:""}>${i(e.label)}</option>\n `).join("")}\n ${null!==a?"</optgroup>":""}\n</select>`},t.templates.operatorSelect=({rule:e,operators:t,icons:n,settings:r,translate:i,builder:o})=>{let a=null;return`\n${1===t.length?`\n<span>\n${i("operators",t[0].type)}\n</span>\n`:""}\n<select class="form-control ${1===t.length?"hide":""}" name="${e.id}_operator">\n ${t.map(e=>`\n ${a!==e.optgroup?`\n ${null!==a?"</optgroup>":""}\n ${null!==(a=e.optgroup)?`\n <optgroup label="${i(r.optgroups[a])}">\n `:""}\n `:""}\n <option value="${e.type}" ${e.icon?`data-icon="${e.icon}"`:""}>${i("operators",e.type)}</option>\n `).join("")}\n ${null!==a?"</optgroup>":""}\n</select>`},t.templates.ruleValueSelect=({name:e,rule:t,icons:n,settings:r,translate:i,builder:o})=>{let a=null;return`\n<select class="form-control" name="${e}" ${t.filter.multiple?"multiple":""}>\n ${t.filter.placeholder?`\n <option value="${t.filter.placeholder_value}" disabled selected>${t.filter.placeholder}</option>\n `:""}\n ${t.filter.values.map(e=>`\n ${a!==e.optgroup?`\n ${null!==a?"</optgroup>":""}\n ${null!==(a=e.optgroup)?`\n <optgroup label="${i(r.optgroups[a])}">\n `:""}\n `:""}\n <option value="${e.value}">${e.label}</option>\n `).join("")}\n ${null!==a?"</optgroup>":""}\n</select>`},t.prototype.getGroupTemplate=function(e,t){var n=this.templates.group({builder:this,group_id:e,level:t,conditions:this.settings.conditions,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getGroupTemplate",n,t)},t.prototype.getRuleTemplate=function(e){var t=this.templates.rule({builder:this,rule_id:e,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleTemplate",t)},t.prototype.getRuleFilterSelect=function(e,t){var n=this.templates.filterSelect({builder:this,rule:e,filters:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleFilterSelect",n,e,t)},t.prototype.getRuleOperatorSelect=function(e,t){var n=this.templates.operatorSelect({builder:this,rule:e,operators:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleOperatorSelect",n,e,t)},t.prototype.getRuleValueSelect=function(e,t){var n=this.templates.ruleValueSelect({builder:this,name:e,rule:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleValueSelect",n,e,t)},t.prototype.getRuleInput=function(e,t){var r=e.filter,i=e.filter.validation||{},o=e.id+"_value_"+t,a=r.vertical?" class=block":"",s="",l=Array.isArray(r.placeholder)?r.placeholder[t]:r.placeholder;if("function"==typeof r.input)s=r.input.call(this,e,o);else switch(r.input){case"radio":case"checkbox":n.iterateOptions(r.values,function(e,t){s+="<label"+a+'><input type="'+r.input+'" name="'+o+'" value="'+e+'"> '+t+"</label> "});break;case"select":s=this.getRuleValueSelect(o,e);break;case"textarea":s+='<textarea class="form-control" name="'+o+'"',r.size&&(s+=' cols="'+r.size+'"'),r.rows&&(s+=' rows="'+r.rows+'"'),void 0!==i.min&&(s+=' minlength="'+i.min+'"'),void 0!==i.max&&(s+=' maxlength="'+i.max+'"'),l&&(s+=' placeholder="'+l+'"'),s+="></textarea>";break;case"number":s+='<input class="form-control" type="number" name="'+o+'"',void 0!==i.step&&(s+=' step="'+i.step+'"'),void 0!==i.min&&(s+=' min="'+i.min+'"'),void 0!==i.max&&(s+=' max="'+i.max+'"'),l&&(s+=' placeholder="'+l+'"'),r.size&&(s+=' size="'+r.size+'"'),s+=">";break;default:s+='<input class="form-control" type="text" name="'+o+'"',l&&(s+=' placeholder="'+l+'"'),"string"===r.type&&void 0!==i.min&&(s+=' minlength="'+i.min+'"'),"string"===r.type&&void 0!==i.max&&(s+=' maxlength="'+i.max+'"'),r.size&&(s+=' size="'+r.size+'"'),s+=">"}return this.change("getRuleInput",s,e,o)};var n={};function r(){this.root=null,this.$=e(this)}t.utils=n,n.iterateOptions=function(t,n){t&&(e.isArray(t)?t.forEach(function(t){e.isPlainObject(t)?"value"in t?n(t.value,t.label||t.value,t.optgroup):e.each(t,function(e,t){return n(e,t),!1}):n(t,t)}):e.each(t,function(e,t){n(e,t)}))},n.fmt=function(e,t){return Array.isArray(t)||(t=Array.prototype.slice.call(arguments,1)),e.replace(/{([0-9]+)}/g,function(e,n){return t[parseInt(n)]})},n.error=function(){var e=0,t="boolean"!=typeof arguments[e]||arguments[e++],r=arguments[e++],i=arguments[e++],o=Array.isArray(arguments[e])?arguments[e]:Array.prototype.slice.call(arguments,e);if(t){var a=new Error(n.fmt(i,o));throw a.name=r+"Error",a.args=o,a}console.error(r+"Error: "+n.fmt(i,o))},n.changeType=function(e,t){if(""!==e&&void 0!==e)switch(t){case"integer":return"string"!=typeof e||/^-?\d+$/.test(e)?parseInt(e):e;case"double":return"string"!=typeof e||/^-?\d+\.?\d*$/.test(e)?parseFloat(e):e;case"boolean":return"string"!=typeof e||/^(0|1|true|false){1}$/i.test(e)?!0===e||1===e||"true"===e.toLowerCase()||"1"===e:e;default:return e}},n.escapeString=function(e,t){if("string"!=typeof e)return e;var n=e.replace(/[\0\n\r\b\\\'\"]/g,function(e){switch(e){case"\0":return"\\0";case"\n":return"\\n";case"\r":return"\\r";case"\b":return"\\b";case"'":return"''";default:return"\\"+e}}).replace(/\t/g,"\\t").replace(/\x1a/g,"\\Z");return t&&(n=n.replace(new RegExp("["+t+"]","g"),function(e){return"\\"+e})),n},n.escapeRegExp=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},n.escapeElementId=function(e){return e?e.replace(/(\\)?([:.\[\],])/g,function(e,t,n){return t?e:"\\"+n}):e},n.groupSort=function(e,t){var n=[],r=[];return e.forEach(function(e){var i;e[t]?-1==(i=n.lastIndexOf(e[t]))?i=n.length:i++:i=n.length,n.splice(i,0,e[t]),r.splice(i,0,e)}),r},n.defineModelProperties=function(t,n){n.forEach(function(n){Object.defineProperty(t.prototype,n,{enumerable:!0,get:function(){return this.__[n]},set:function(t){var r=null!==this.__[n]&&"object"==typeof this.__[n]?e.extend({},this.__[n]):this.__[n];this.__[n]=t,null!==this.model&&this.model.trigger("update",this,n,t,r)}})})},e.extend(r.prototype,{trigger:function(t){var n=new e.Event(t);return this.$.triggerHandler(n,Array.prototype.slice.call(arguments,1)),n},on:function(){return this.$.on.apply(this.$,Array.prototype.slice.call(arguments)),this},off:function(){return this.$.off.apply(this.$,Array.prototype.slice.call(arguments)),this},once:function(){return this.$.one.apply(this.$,Array.prototype.slice.call(arguments)),this}});var i=function(e,t){if(!(this instanceof i))return new i(e,t);Object.defineProperty(this,"__",{value:{}}),t.data("queryBuilderModel",this),this.__.level=1,this.__.error=null,this.__.flags={},this.__.data=void 0,this.$el=t,this.id=t[0].id,this.model=null,this.parent=e};n.defineModelProperties(i,["level","error","data","flags"]),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){return this.__.parent},set:function(e){this.__.parent=e,this.level=null===e?1:e.level+1,this.model=null===e?null:e.model}}),i.prototype.isRoot=function(){return 1===this.level},i.prototype.getPos=function(){return this.isRoot()?-1:this.parent.getNodePos(this)},i.prototype.drop=function(){var e=this.model;this.parent&&this.parent.removeNode(this),this.$el.removeData("queryBuilderModel"),null!==e&&e.trigger("drop",this)},i.prototype.moveAfter=function(e){this.isRoot()||this.move(e.parent,e.getPos()+1)},i.prototype.moveAtBegin=function(e){this.isRoot()||(void 0===e&&(e=this.parent),this.move(e,0))},i.prototype.moveAtEnd=function(e){this.isRoot()||(void 0===e&&(e=this.parent),this.move(e,0===e.length()?0:e.length()-1))},i.prototype.move=function(e,t){this.isRoot()||("number"==typeof e&&(t=e,e=this.parent),this.parent.removeNode(this),e.insertNode(this,t,!1),null!==this.model&&this.model.trigger("move",this,e,t))};var o=function(e,t){if(!(this instanceof o))return new o(e,t);i.call(this,e,t),this.rules=[],this.__.condition=null};o.prototype=Object.create(i.prototype),o.prototype.constructor=o,n.defineModelProperties(o,["condition"]),o.prototype.empty=function(){this.each("reverse",function(e){e.drop()},function(e){e.drop()})},o.prototype.drop=function(){this.empty(),i.prototype.drop.call(this)},o.prototype.length=function(){return this.rules.length},o.prototype.insertNode=function(e,t,n){return void 0===t&&(t=this.length()),this.rules.splice(t,0,e),e.parent=this,n&&null!==this.model&&this.model.trigger("add",this,e,t),e},o.prototype.addGroup=function(e,t){return this.insertNode(new o(this,e),t,!0)},o.prototype.addRule=function(e,t){return this.insertNode(new a(this,e),t,!0)},o.prototype.removeNode=function(e){var t=this.getNodePos(e);-1!==t&&(e.parent=null,this.rules.splice(t,1))},o.prototype.getNodePos=function(e){return this.rules.indexOf(e)},o.prototype.each=function(e,t,n,r){"boolean"!=typeof e&&"string"!=typeof e&&(r=n,n=t,t=e,e=!1),r=void 0===r?null:r;for(var i=e?this.rules.length-1:0,a=e?0:this.rules.length-1,s=e?-1:1,l=function(){return e?i>=a:i<=a},u=!1;l()&&(this.rules[i]instanceof o?n&&(u=!1===n.call(r,this.rules[i])):t&&(u=!1===t.call(r,this.rules[i])),!u);i+=s);return!u},o.prototype.contains=function(e,t){return-1!==this.getNodePos(e)||!!t&&!this.each(function(){return!0},function(t){return!t.contains(e,!0)})};var a=function(e,t){if(!(this instanceof a))return new a(e,t);i.call(this,e,t),this._updating_value=!1,this._updating_input=!1,this.__.filter=null,this.__.operator=null,this.__.value=void 0};function s(e,n,r){var i,o,s=t.selectors;(i=n.closest(s.rule_container)).length&&(o="moveAfter"),o||(i=n.closest(s.group_header)).length&&(i=n.closest(s.group_container),o="moveAtBegin"),o||(i=n.closest(s.group_container)).length&&(o="moveAtEnd"),o&&(e[o](r.getModel(i)),r&&e instanceof a&&r.setRuleInputValue(e,e.value))}function l(e){var t=e.match(/(question_mark|numbered|named)(?:\((.)\))?/);return t||(t=[null,"question_mark",void 0]),t}return a.prototype=Object.create(i.prototype),a.prototype.constructor=a,n.defineModelProperties(a,["filter","operator","value"]),a.prototype.isRoot=function(){return!1},t.Group=o,t.Rule=a,e.fn.queryBuilder=function(e){0===this.length&&n.error("Config","No target defined"),this.length>1&&n.error("Config","Unable to initialize on multiple target");var r=this.data("queryBuilder"),i="object"==typeof e&&e||{};if(!r&&"destroy"==e)return this;if(!r){var o=new t(this,i);this.data("queryBuilder",o),o.init(i.rules)}return"string"==typeof e?r[e].apply(r,Array.prototype.slice.call(arguments,1)):this},e.fn.queryBuilder.constructor=t,e.fn.queryBuilder.defaults=t.defaults,e.fn.queryBuilder.extend=t.extend,e.fn.queryBuilder.define=t.define,e.fn.queryBuilder.regional=t.regional,t.define("bt-checkbox",function(e){"glyphicons"==e.font&&this.$el.addClass("bt-checkbox-glyphicons"),this.on("getRuleInput.filter",function(t,r,i){var o=r.filter;if(("radio"===o.input||"checkbox"===o.input)&&!o.plugin){t.value="",o.colors||(o.colors={}),o.color&&(o.colors._def_=o.color);var a=o.vertical?' style="display:block"':"",s=0;n.iterateOptions(o.values,function(n,r){var l=o.colors[n]||o.colors._def_||e.color,u=i+"_"+s++;t.value+="<div"+a+' class="'+o.input+" "+o.input+"-"+l+'"> <input type="'+o.input+'" name="'+i+'" id="'+u+'" value="'+n+'"> <label for="'+u+'">'+r+"</label> </div>"})}})},{font:"glyphicons",color:"default"}),t.define("bt-selectpicker",function(r){e.fn.selectpicker&&e.fn.selectpicker.Constructor||n.error("MissingLibrary",'Bootstrap Select is required to use "bt-selectpicker" plugin. Get it here: http://silviomoreto.github.io/bootstrap-select');var i=t.selectors;this.on("afterCreateRuleFilters",function(e,t){t.$el.find(i.rule_filter).removeClass("form-control").selectpicker(r)}),this.on("afterCreateRuleOperators",function(e,t){t.$el.find(i.rule_operator).removeClass("form-control").selectpicker(r)}),this.on("afterUpdateRuleFilter",function(e,t){t.$el.find(i.rule_filter).selectpicker("render")}),this.on("afterUpdateRuleOperator",function(e,t){t.$el.find(i.rule_operator).selectpicker("render")}),this.on("beforeDeleteRule",function(e,t){t.$el.find(i.rule_filter).selectpicker("destroy"),t.$el.find(i.rule_operator).selectpicker("destroy")})},{container:"body",style:"btn-inverse btn-xs",width:"auto",showIcon:!1}),t.define("bt-tooltip-errors",function(r){e.fn.tooltip&&e.fn.tooltip.Constructor&&e.fn.tooltip.Constructor.prototype.fixTitle||n.error("MissingLibrary",'Bootstrap Tooltip is required to use "bt-tooltip-errors" plugin. Get it here: http://getbootstrap.com');var i=this;this.on("getRuleTemplate.filter getGroupTemplate.filter",function(n){var r=e(e.parseHTML(n.value));r.find(t.selectors.error_container).attr("data-toggle","tooltip"),n.value=r.prop("outerHTML")}),this.model.on("update",function(e,n,o){"error"==o&&i.settings.display_errors&&n.$el.find(t.selectors.error_container).eq(0).tooltip(r).tooltip("hide").tooltip("fixTitle")})},{placement:"right"}),t.extend({setFilters:function(e,r){var i=this;void 0===r&&(r=e,e=!1),r=this.checkFilters(r);var o=(r=this.change("setFilters",r)).map(function(e){return e.id});if(e||function e(t){t.each(function(e){e.filter&&-1===o.indexOf(e.filter.id)&&n.error("ChangeFilter",'A rule is using filter "{0}"',e.filter.id)},e)}(this.model.root),this.filters=r,function e(n){n.each(!0,function(e){e.filter&&-1===o.indexOf(e.filter.id)?(e.drop(),i.trigger("rulesChanged")):(i.createRuleFilters(e),e.$el.find(t.selectors.rule_filter).val(e.filter?e.filter.id:"-1"),i.trigger("afterUpdateRuleFilter",e))},e)}(this.model.root),this.settings.plugins&&(this.settings.plugins["unique-filter"]&&this.updateDisabledFilters(),this.settings.plugins["bt-selectpicker"]&&this.$el.find(t.selectors.rule_filter).selectpicker("render")),this.settings.default_filter)try{this.getFilterById(this.settings.default_filter)}catch(e){this.settings.default_filter=null}this.trigger("afterSetFilters",r)},addFilter:function(t,n){void 0===n||"#end"==n?n=this.filters.length:"#start"==n&&(n=0),e.isArray(t)||(t=[t]);var r=e.extend(!0,[],this.filters);parseInt(n)==n||this.filters.some(function(e,t){if(e.id==n)return n=t+1,!0})?Array.prototype.splice.apply(r,[n,0].concat(t)):Array.prototype.push.apply(r,t),this.setFilters(r)},removeFilter:function(t,n){var r=e.extend(!0,[],this.filters);"string"==typeof t&&(t=[t]),r=r.filter(function(e){return-1===t.indexOf(e.id)}),this.setFilters(n,r)}}),t.define("chosen-selectpicker",function(r){e.fn.chosen||n.error("MissingLibrary",'chosen is required to use "chosen-selectpicker" plugin. Get it here: https://github.com/harvesthq/chosen'),this.settings.plugins["bt-selectpicker"]&&n.error("Conflict","bt-selectpicker is already selected as the dropdown plugin. Please remove chosen-selectpicker from the plugin list");var i=t.selectors;this.on("afterCreateRuleFilters",function(e,t){t.$el.find(i.rule_filter).removeClass("form-control").chosen(r)}),this.on("afterCreateRuleOperators",function(e,t){e.builder.getOperators(t.filter).length>1&&t.$el.find(i.rule_operator).removeClass("form-control").chosen(r)}),this.on("afterUpdateRuleFilter",function(e,t){t.$el.find(i.rule_filter).trigger("chosen:updated")}),this.on("afterUpdateRuleOperator",function(e,t){t.$el.find(i.rule_operator).trigger("chosen:updated")}),this.on("beforeDeleteRule",function(e,t){t.$el.find(i.rule_filter).chosen("destroy"),t.$el.find(i.rule_operator).chosen("destroy")})}),t.define("filter-description",function(r){"inline"===r.mode?this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(t,n){var i=n.$el.find("p.filter-description"),o=t.builder.getFilterDescription(n.filter,n);o?(0===i.length?(i=e(e.parseHTML('<p class="filter-description"></p>'))).appendTo(n.$el):i.css("display",""),i.html('<i class="'+r.icon+'"></i> '+o)):i.hide()}):"popover"===r.mode?(e.fn.popover&&e.fn.popover.Constructor&&e.fn.popover.Constructor.prototype.fixTitle||n.error("MissingLibrary",'Bootstrap Popover is required to use "filter-description" plugin. Get it here: http://getbootstrap.com'),this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(n,i){var o=i.$el.find("button.filter-description"),a=n.builder.getFilterDescription(i.filter,i);a?(0===o.length?((o=e(e.parseHTML('<button type="button" class="btn btn-xs btn-info filter-description" data-toggle="popover"><i class="'+r.icon+'"></i></button>'))).prependTo(i.$el.find(t.selectors.rule_actions)),o.popover({placement:"left",container:"body",html:!0}),o.on("mouseout",function(){o.popover("hide")})):o.css("display",""),o.data("bs.popover").options.content=a,o.attr("aria-describedby")&&o.popover("show")):(o.hide(),o.data("bs.popover")&&o.popover("hide"))})):"bootbox"===r.mode&&("bootbox"in window||n.error("MissingLibrary",'Bootbox is required to use "filter-description" plugin. Get it here: http://bootboxjs.com'),this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(n,i){var o=i.$el.find("button.filter-description"),a=n.builder.getFilterDescription(i.filter,i);a?(0===o.length?((o=e(e.parseHTML('<button type="button" class="btn btn-xs btn-info filter-description" data-toggle="bootbox"><i class="'+r.icon+'"></i></button>'))).prependTo(i.$el.find(t.selectors.rule_actions)),o.on("click",function(){bootbox.alert(o.data("description"))})):o.css("display",""),o.data("description",a)):o.hide()}))},{icon:"glyphicon glyphicon-info-sign",mode:"popover"}),t.extend({getFilterDescription:function(e,t){return e?"function"==typeof e.description?e.description.call(this,t):e.description:void 0}}),t.define("invert",function(n){var r=this,i=t.selectors;this.on("afterInit",function(){r.$el.on("click.queryBuilder","[data-invert=group]",function(){var t=e(this).closest(i.group_container);r.invert(r.getModel(t),n)}),n.display_rules_button&&n.invert_rules&&r.$el.on("click.queryBuilder","[data-invert=rule]",function(){var t=e(this).closest(i.rule_container);r.invert(r.getModel(t),n)})}),n.disable_template||(this.on("getGroupTemplate.filter",function(t){var o=e(e.parseHTML(t.value));o.find(i.condition_container).after('<button type="button" class="btn btn-xs btn-default" data-invert="group"><i class="'+n.icon+'"></i> '+r.translate("invert")+"</button>"),t.value=o.prop("outerHTML")}),n.display_rules_button&&n.invert_rules&&this.on("getRuleTemplate.filter",function(t){var o=e(e.parseHTML(t.value));o.find(i.rule_actions).prepend('<button type="button" class="btn btn-xs btn-default" data-invert="rule"><i class="'+n.icon+'"></i> '+r.translate("invert")+"</button>"),t.value=o.prop("outerHTML")}))},{icon:"glyphicon glyphicon-random",recursive:!0,invert_rules:!0,display_rules_button:!1,silent_fail:!1,disable_template:!1}),t.defaults({operatorOpposites:{equal:"not_equal",not_equal:"equal",in:"not_in",not_in:"in",less:"greater_or_equal",less_or_equal:"greater",greater:"less_or_equal",greater_or_equal:"less",between:"not_between",not_between:"between",begins_with:"not_begins_with",not_begins_with:"begins_with",contains:"not_contains",not_contains:"contains",ends_with:"not_ends_with",not_ends_with:"ends_with",is_empty:"is_not_empty",is_not_empty:"is_empty",is_null:"is_not_null",is_not_null:"is_null"},conditionOpposites:{AND:"OR",OR:"AND"}}),t.extend({invert:function(t,r){if(!(t instanceof i)){if(!this.model.root)return;r=t,t=this.model.root}if("object"!=typeof r&&(r={}),void 0===r.recursive&&(r.recursive=!0),void 0===r.invert_rules&&(r.invert_rules=!0),void 0===r.silent_fail&&(r.silent_fail=!1),void 0===r.trigger&&(r.trigger=!0),t instanceof o){if(this.settings.conditionOpposites[t.condition]?t.condition=this.settings.conditionOpposites[t.condition]:r.silent_fail||n.error("InvertCondition",'Unknown inverse of condition "{0}"',t.condition),r.recursive){var s=e.extend({},r,{trigger:!1});t.each(function(e){r.invert_rules&&this.invert(e,s)},function(e){this.invert(e,s)},this)}}else if(t instanceof a&&t.operator&&!t.filter.no_invert)if(this.settings.operatorOpposites[t.operator.type]){var l=this.settings.operatorOpposites[t.operator.type];t.filter.operators&&-1==t.filter.operators.indexOf(l)||(t.operator=this.getOperatorByType(l))}else r.silent_fail||n.error("InvertOperator",'Unknown inverse of operator "{0}"',t.operator.type);r.trigger&&(this.trigger("afterInvert",t,r),this.trigger("rulesChanged"))}}),t.defaults({mongoOperators:{equal:function(e){return e[0]},not_equal:function(e){return{$ne:e[0]}},in:function(e){return{$in:e}},not_in:function(e){return{$nin:e}},less:function(e){return{$lt:e[0]}},less_or_equal:function(e){return{$lte:e[0]}},greater:function(e){return{$gt:e[0]}},greater_or_equal:function(e){return{$gte:e[0]}},between:function(e){return{$gte:e[0],$lte:e[1]}},not_between:function(e){return{$lt:e[0],$gt:e[1]}},begins_with:function(e){return{$regex:"^"+n.escapeRegExp(e[0])}},not_begins_with:function(e){return{$regex:"^(?!"+n.escapeRegExp(e[0])+")"}},contains:function(e){return{$regex:n.escapeRegExp(e[0])}},not_contains:function(e){return{$regex:"^((?!"+n.escapeRegExp(e[0])+").)*$",$options:"s"}},ends_with:function(e){return{$regex:n.escapeRegExp(e[0])+"$"}},not_ends_with:function(e){return{$regex:"(?<!"+n.escapeRegExp(e[0])+")$"}},is_empty:function(e){return""},is_not_empty:function(e){return{$ne:""}},is_null:function(e){return null},is_not_null:function(e){return{$ne:null}}},mongoRuleOperators:{$eq:function(e){return{val:e,op:null===e?"is_null":""===e?"is_empty":"equal"}},$ne:function(e){return{val:e=e.$ne,op:null===e?"is_not_null":""===e?"is_not_empty":"not_equal"}},$regex:function(e){return"^(?!"==(e=e.$regex).slice(0,4)&&")"==e.slice(-1)?{val:e.slice(4,-1),op:"not_begins_with"}:"^((?!"==e.slice(0,5)&&").)*$"==e.slice(-5)?{val:e.slice(5,-5),op:"not_contains"}:"(?<!"==e.slice(0,4)&&")$"==e.slice(-2)?{val:e.slice(4,-2),op:"not_ends_with"}:"$"==e.slice(-1)?{val:e.slice(0,-1),op:"ends_with"}:"^"==e.slice(0,1)?{val:e.slice(1),op:"begins_with"}:{val:e,op:"contains"}},between:function(e){return{val:[e.$gte,e.$lte],op:"between"}},not_between:function(e){return{val:[e.$lt,e.$gt],op:"not_between"}},$in:function(e){return{val:e.$in,op:"in"}},$nin:function(e){return{val:e.$nin,op:"not_in"}},$lt:function(e){return{val:e.$lt,op:"less"}},$lte:function(e){return{val:e.$lte,op:"less_or_equal"}},$gt:function(e){return{val:e.$gt,op:"greater"}},$gte:function(e){return{val:e.$gte,op:"greater_or_equal"}}}}),t.extend({getMongo:function(e){if(!(e=void 0===e?this.getRules():e))return null;var t=this;return function e(r){if(r.condition||(r.condition=t.settings.default_condition),-1===["AND","OR"].indexOf(r.condition.toUpperCase())&&n.error("UndefinedMongoCondition",'Unable to build MongoDB query with condition "{0}"',r.condition),!r.rules)return{};var i=[];r.rules.forEach(function(r){if(r.rules&&r.rules.length>0)i.push(e(r));else{var o=t.settings.mongoOperators[r.operator],a=t.getOperatorByType(r.operator);void 0===o&&n.error("UndefinedMongoOperator",'Unknown MongoDB operation for operator "{0}"',r.operator),0!==a.nb_inputs&&(r.value instanceof Array||(r.value=[r.value]));var s={};s[t.change("getMongoDBField",r.field,r)]=o.call(t,r.value),i.push(t.change("ruleToMongo",s,r,r.value,o))}});var o={};return o["$"+r.condition.toLowerCase()]=i,t.change("groupToMongo",o,r)}(e)},getRulesFromMongo:function(e){if(null==e)return null;var t=this;if("rules"in(e=t.change("parseMongoNode",e))&&"condition"in e)return e;if("id"in e&&"operator"in e&&"value"in e)return{condition:this.settings.default_condition,rules:[e]};var r=t.getMongoCondition(e);return r||n.error("MongoParse","Invalid MongoDB query format"),function e(r,i){var o=r[i],a=[];return o.forEach(function(r){if("rules"in(r=t.change("parseMongoNode",r))&&"condition"in r)a.push(r);else if("id"in r&&"operator"in r&&"value"in r)a.push(r);else{var i=t.getMongoCondition(r);if(i)a.push(e(r,i));else{var o=Object.keys(r)[0],s=r[o],l=t.getMongoOperator(s);void 0===l&&n.error("MongoParse","Invalid MongoDB query format");var u=t.settings.mongoRuleOperators[l];void 0===u&&n.error("UndefinedMongoOperator",'JSON Rule operation unknown for operator "{0}"',l);var c=u.call(t,s),d=t.getMongoDBFieldID(o,s),f=t.change("mongoToRule",{id:d,field:o,operator:c.op,value:c.val},r);a.push(f)}}}),t.change("mongoToGroup",{condition:i.replace("$","").toUpperCase(),rules:a},r)}(e,r)},setRulesFromMongo:function(e){this.setRules(this.getRulesFromMongo(e))},getMongoDBFieldID:function(e,t){var n=this.filters.filter(function(t){return t.field===e});return 1===n.length?n[0].id:this.change("getMongoDBFieldID",e,t)},getMongoOperator:function(e){if(null===e||"object"!=typeof e)return"$eq";if(void 0!==e.$gte&&void 0!==e.$lte)return"between";if(void 0!==e.$lt&&void 0!==e.$gt)return"not_between";var t=Object.keys(e).filter(function(e){return!!this.settings.mongoRuleOperators[e]}.bind(this));return 1===t.length?t[0]:void 0},getMongoCondition:function(e){for(var t=Object.keys(e),n=0,r=t.length;n<r;n++)if("$or"===t[n].toLowerCase()||"$and"===t[n].toLowerCase())return t[n]}}),t.define("not-group",function(n){var r=this;this.on("afterInit",function(){r.$el.on("click.queryBuilder","[data-not=group]",function(){var n=e(this).closest(t.selectors.group_container),i=r.getModel(n);i.not=!i.not}),r.model.on("update",function(e,t,n){t instanceof o&&"not"===n&&r.updateGroupNot(t)})}),this.on("afterAddGroup",function(e,t){t.__.not=!1}),n.disable_template||this.on("getGroupTemplate.filter",function(i){var o=e(e.parseHTML(i.value));o.find(t.selectors.condition_container).prepend('<button type="button" class="btn btn-xs btn-default" data-not="group"><i class="'+n.icon_unchecked+'"></i> '+r.translate("NOT")+"</button>"),i.value=o.prop("outerHTML")}),this.on("groupToJson.filter",function(e,t){e.value.not=t.not}),this.on("jsonToGroup.filter",function(e,t){e.value.not=!!t.not}),this.on("groupToSQL.filter",function(e,t){t.not&&(e.value="NOT ( "+e.value+" )")}),this.on("parseSQLNode.filter",function(e){e.value.name&&"NOT"==e.value.name.toUpperCase()&&(e.value=e.value.arguments.value[0],-1===["AND","OR"].indexOf(e.value.operation.toUpperCase())&&(e.value=new SQLParser.nodes.Op(r.settings.default_condition,e.value,null)),e.value.not=!0)}),this.on("sqlGroupsDistinct.filter",function(e,t,n,r){n.not&&r>0&&(e.value=!0)}),this.on("sqlToGroup.filter",function(e,t){e.value.not=!!t.not}),this.on("groupToMongo.filter",function(e,t){var n="$"+t.condition.toLowerCase();t.not&&e.value[n]&&(e.value={$nor:[e.value]})}),this.on("parseMongoNode.filter",function(e){var t=Object.keys(e.value);"$nor"==t[0]&&(e.value=e.value[t[0]][0],e.value.not=!0)}),this.on("mongoToGroup.filter",function(e,t){e.value.not=!!t.not})},{icon_unchecked:"glyphicon glyphicon-unchecked",icon_checked:"glyphicon glyphicon-check",disable_template:!1}),n.defineModelProperties(o,["not"]),t.selectors.group_not=t.selectors.group_header+" [data-not=group]",t.extend({updateGroupNot:function(e){var n=this.plugins["not-group"];e.$el.find(">"+t.selectors.group_not).toggleClass("active",e.not).find("i").attr("class",e.not?n.icon_checked:n.icon_unchecked),this.trigger("afterUpdateGroupNot",e),this.trigger("rulesChanged")}}),t.define("sortable",function(r){var i,a,l,u;"interact"in window||n.error("MissingLibrary",'interact.js is required to use "sortable" plugin. Get it here: http://interactjs.io'),void 0!==r.default_no_sortable&&(n.error(!1,"Config",'Sortable plugin : "default_no_sortable" options is deprecated, use standard "default_rule_flags" and "default_group_flags" instead'),this.settings.default_rule_flags.no_sortable=this.settings.default_group_flags.no_sortable=r.default_no_sortable),interact.dynamicDrop(!0),interact.pointerMoveTolerance(10),this.on("afterAddRule afterAddGroup",function(n,c){if(c!=i){var d=n.builder;r.inherit_no_sortable&&c.parent&&c.parent.flags.no_sortable&&(c.flags.no_sortable=!0),r.inherit_no_drop&&c.parent&&c.parent.flags.no_drop&&(c.flags.no_drop=!0),c.flags.no_sortable||interact(c.$el[0]).draggable({allowFrom:t.selectors.drag_handle,onstart:function(t){u=!1,l=d.getModel(t.target),a=l.$el.clone().appendTo(l.$el.parent()).width(l.$el.outerWidth()).addClass("dragging");var n=e(e.parseHTML('<div class="rule-placeholder">&nbsp;</div>')).height(l.$el.outerHeight());i=l.parent.addRule(n,l.getPos()),l.$el.hide()},onmove:function(e){a[0].style.top=e.clientY-15+"px",a[0].style.left=e.clientX-15+"px"},onend:function(t){t.dropzone&&(s(l,e(t.relatedTarget),d),u=!0),a.remove(),a=void 0,i.drop(),i=void 0,l.$el.css("display",""),d.trigger("afterMove",l),d.trigger("rulesChanged")}}),c.flags.no_drop||(interact(c.$el[0]).dropzone({accept:t.selectors.rule_and_group_containers,ondragenter:function(t){s(i,e(t.target),d)},ondrop:function(t){u||s(l,e(t.target),d)}}),c instanceof o&&interact(c.$el.find(t.selectors.group_header)[0]).dropzone({accept:t.selectors.rule_and_group_containers,ondragenter:function(t){s(i,e(t.target),d)},ondrop:function(t){u||s(l,e(t.target),d)}}))}}),this.on("beforeDeleteRule beforeDeleteGroup",function(e,n){e.isDefaultPrevented()||(interact(n.$el[0]).unset(),n instanceof o&&interact(n.$el.find(t.selectors.group_header)[0]).unset())}),this.on("afterApplyRuleFlags afterApplyGroupFlags",function(e,t){t.flags.no_sortable&&t.$el.find(".drag-handle").remove()}),r.disable_template||(this.on("getGroupTemplate.filter",function(n,i){if(i>1){var o=e(e.parseHTML(n.value));o.find(t.selectors.condition_container).after('<div class="drag-handle"><i class="'+r.icon+'"></i></div>'),n.value=o.prop("outerHTML")}}),this.on("getRuleTemplate.filter",function(n){var i=e(e.parseHTML(n.value));i.find(t.selectors.rule_header).after('<div class="drag-handle"><i class="'+r.icon+'"></i></div>'),n.value=i.prop("outerHTML")}))},{inherit_no_sortable:!0,inherit_no_drop:!0,icon:"glyphicon glyphicon-sort",disable_template:!1}),t.selectors.rule_and_group_containers=t.selectors.rule_container+", "+t.selectors.group_container,t.selectors.drag_handle=".drag-handle",t.defaults({default_rule_flags:{no_sortable:!1,no_drop:!1},default_group_flags:{no_sortable:!1,no_drop:!1}}),t.define("sql-support",function(e){},{boolean_as_integer:!0}),t.defaults({sqlOperators:{equal:{op:"= ?"},not_equal:{op:"!= ?"},in:{op:"IN(?)",sep:", "},not_in:{op:"NOT IN(?)",sep:", "},less:{op:"< ?"},less_or_equal:{op:"<= ?"},greater:{op:"> ?"},greater_or_equal:{op:">= ?"},between:{op:"BETWEEN ?",sep:" AND "},not_between:{op:"NOT BETWEEN ?",sep:" AND "},begins_with:{op:"LIKE ?",mod:"{0}%",escape:"%_"},not_begins_with:{op:"NOT LIKE ?",mod:"{0}%",escape:"%_"},contains:{op:"LIKE ?",mod:"%{0}%",escape:"%_"},not_contains:{op:"NOT LIKE ?",mod:"%{0}%",escape:"%_"},ends_with:{op:"LIKE ?",mod:"%{0}",escape:"%_"},not_ends_with:{op:"NOT LIKE ?",mod:"%{0}",escape:"%_"},is_empty:{op:"= ''"},is_not_empty:{op:"!= ''"},is_null:{op:"IS NULL"},is_not_null:{op:"IS NOT NULL"}},sqlRuleOperator:{"=":function(e){return{val:e,op:""===e?"is_empty":"equal"}},"!=":function(e){return{val:e,op:""===e?"is_not_empty":"not_equal"}},LIKE:function(e){return"%"==e.slice(0,1)&&"%"==e.slice(-1)?{val:e.slice(1,-1),op:"contains"}:"%"==e.slice(0,1)?{val:e.slice(1),op:"ends_with"}:"%"==e.slice(-1)?{val:e.slice(0,-1),op:"begins_with"}:void n.error("SQLParse",'Invalid value for LIKE operator "{0}"',e)},"NOT LIKE":function(e){return"%"==e.slice(0,1)&&"%"==e.slice(-1)?{val:e.slice(1,-1),op:"not_contains"}:"%"==e.slice(0,1)?{val:e.slice(1),op:"not_ends_with"}:"%"==e.slice(-1)?{val:e.slice(0,-1),op:"not_begins_with"}:void n.error("SQLParse",'Invalid value for NOT LIKE operator "{0}"',e)},IN:function(e){return{val:e,op:"in"}},"NOT IN":function(e){return{val:e,op:"not_in"}},"<":function(e){return{val:e,op:"less"}},"<=":function(e){return{val:e,op:"less_or_equal"}},">":function(e){return{val:e,op:"greater"}},">=":function(e){return{val:e,op:"greater_or_equal"}},BETWEEN:function(e){return{val:e,op:"between"}},"NOT BETWEEN":function(e){return{val:e,op:"not_between"}},IS:function(e){return null!==e&&n.error("SQLParse","Invalid value for IS operator"),{val:null,op:"is_null"}},"IS NOT":function(e){return null!==e&&n.error("SQLParse","Invalid value for IS operator"),{val:null,op:"is_not_null"}}},sqlStatements:{question_mark:function(){var e=[];return{add:function(t,n){return e.push(n),"?"},run:function(){return e}}},numbered:function(e){(!e||e.length>1)&&(e="$");var t=0,n=[];return{add:function(r,i){return n.push(i),t++,e+t},run:function(){return n}}},named:function(e){(!e||e.length>1)&&(e=":");var t={},n={};return{add:function(r,i){t[r.field]||(t[r.field]=1);var o=r.field+"_"+t[r.field]++;return n[o]=i,e+o},run:function(){return n}}}},sqlRuleStatement:{question_mark:function(e){var t=0;return{parse:function(n){return"?"==n?e[t++]:n},esc:function(e){return e.replace(/\?/g,"'?'")}}},numbered:function(e,t){(!t||t.length>1)&&(t="$");var n=new RegExp("^\\"+t+"[0-9]+$"),r=new RegExp("\\"+t+"([0-9]+)","g");return{parse:function(t){return n.test(t)?e[t.slice(1)-1]:t},esc:function(e){return e.replace(r,"'"+("$"==t?"$$":t)+"$1'")}}},named:function(e,t){(!t||t.length>1)&&(t=":");var n=new RegExp("^\\"+t),r=new RegExp("\\"+t+"("+Object.keys(e).join("|")+")\\b","g");return{parse:function(t){return n.test(t)?e[t.slice(1)]:t},esc:function(e){return e.replace(r,"'"+("$"==t?"$$":t)+"$1'")}}}}}),t.extend({getSQL:function(e,t,r){if(!(r=void 0===r?this.getRules():r))return null;t=t?"\n":" ";var i=this.getPluginOptions("sql-support","boolean_as_integer");if(!0===e&&(e="question_mark"),"string"==typeof e){var o=l(e);e=this.settings.sqlStatements[o[1]](o[2])}var a=this,s=function r(o){if(o.condition||(o.condition=a.settings.default_condition),-1===["AND","OR"].indexOf(o.condition.toUpperCase())&&n.error("UndefinedSQLCondition",'Unable to build SQL query with condition "{0}"',o.condition),!o.rules)return"";var s=[];o.rules.forEach(function(o){if(o.rules&&o.rules.length>0)s.push("("+t+r(o)+t+")"+t);else{var l=a.settings.sqlOperators[o.operator],u=a.getOperatorByType(o.operator),c="";void 0===l&&n.error("UndefinedSQLOperator",'Unknown SQL operation for operator "{0}"',o.operator),0!==u.nb_inputs&&(o.value instanceof Array||(o.value=[o.value]),o.value.forEach(function(t,r){r>0&&(c+=l.sep),"boolean"==o.type&&i?t=t?1:0:e||"integer"===o.type||"double"===o.type||"boolean"===o.type||(t=n.escapeString(t,l.escape)),l.mod&&(t=n.fmt(l.mod,t)),e?c+=e.add(o,t):("string"==typeof t&&(t="'"+t+"'"),c+=t)}));var d=function(e){return l.op.replace("?",function(){return e})},f=a.change("getSQLField",o.field,o)+" "+d(c);s.push(a.change("ruleToSQL",f,o,c,d))}});var l=s.join(" "+o.condition+t);return a.change("groupToSQL",l,o)}(r);return e?{sql:s,params:e.run()}:{sql:s}},getRulesFromSQL:function(t,r){"SQLParser"in window||n.error("MissingLibrary","SQLParser is required to parse SQL queries. Get it here https://github.com/mistic100/sql-parser");var i=this;if("string"==typeof t&&(t={sql:t}),!0===r&&(r="question_mark"),"string"==typeof r){var o=l(r);r=this.settings.sqlRuleStatement[o[1]](t.params,o[2])}r&&(t.sql=r.esc(t.sql)),0!==t.sql.toUpperCase().indexOf("SELECT")&&(t.sql="SELECT * FROM table WHERE "+t.sql);var a=SQLParser.parse(t.sql);a.where||n.error("SQLParse","No WHERE clause found");var s=i.change("parseSQLNode",a.where.conditions);if("rules"in s&&"condition"in s)return s;if("id"in s&&"operator"in s&&"value"in s)return{condition:this.settings.default_condition,rules:[s]};var u=i.change("sqlToGroup",{condition:this.settings.default_condition,rules:[]},s),c=u;return function t(o,a){if(null!==o)if("rules"in(o=i.change("parseSQLNode",o))&&"condition"in o)c.rules.push(o);else if("id"in o&&"operator"in o&&"value"in o)c.rules.push(o);else if("left"in o&&"right"in o&&"operation"in o||n.error("SQLParse","Unable to parse WHERE clause"),-1!==["AND","OR"].indexOf(o.operation.toUpperCase())){if(i.change("sqlGroupsDistinct",a>0&&c.condition!=o.operation.toUpperCase(),c,o,a)){var s=i.change("sqlToGroup",{condition:i.settings.default_condition,rules:[]},o);c.rules.push(s),c=s}c.condition=o.operation.toUpperCase(),a++;var l=c;t(o.left,a),c=l,t(o.right,a)}else{var u;e.isPlainObject(o.right.value)&&n.error("SQLParse","Value format not supported for {0}.",o.left.value),u=e.isArray(o.right.value)?o.right.value.map(function(e){return e.value}):o.right.value,r&&(u=e.isArray(u)?u.map(r.parse):r.parse(u));var d=o.operation.toUpperCase();"<>"==d&&(d="!=");var f=i.settings.sqlRuleOperator[d];void 0===f&&n.error("UndefinedSQLOperator",'Invalid SQL operation "{0}".',o.operation);var p,h=f.call(this,u,o.operation);"values"in o.left?p=o.left.values.join("."):"value"in o.left?p=o.left.value:n.error("SQLParse","Cannot find field name in {0}",JSON.stringify(o.left));var g=h.val,m=i.settings.sqlOperators[h.op];if(!r&&m&&m.escape){var v=m.escape.split("").map(function(e){return"\\\\"+e}).join("|");g=g.replace(new RegExp("("+v+")","g"),function(e){return e[1]})}var y=i.getSQLFieldID(p,u),_=i.change("sqlToRule",{id:y,field:p,operator:h.op,value:g},o);c.rules.push(_)}}(s,0),u},setRulesFromSQL:function(e,t){this.setRules(this.getRulesFromSQL(e,t))},getSQLFieldID:function(e,t){var n=this.filters.filter(function(t){return t.field.toLowerCase()===e.toLowerCase()});return 1===n.length?n[0].id:this.change("getSQLFieldID",e,t)}}),t.define("unique-filter",function(){this.status.used_filters={},this.on("afterUpdateRuleFilter",this.updateDisabledFilters),this.on("afterDeleteRule",this.updateDisabledFilters),this.on("afterCreateRuleFilters",this.applyDisabledFilters),this.on("afterReset",this.clearDisabledFilters),this.on("afterClear",this.clearDisabledFilters),this.on("getDefaultFilter.filter",function(e,t){var r=e.builder;r.updateDisabledFilters(),e.value.id in r.status.used_filters&&(r.filters.some(function(n){if(!(n.id in r.status.used_filters)||r.status.used_filters[n.id].length>0&&-1===r.status.used_filters[n.id].indexOf(t.parent))return e.value=n,!0})||(n.error(!1,"UniqueFilter","No more non-unique filters available"),e.value=void 0))})}),t.extend({updateDisabledFilters:function(e){var t=e?e.builder:this;t.status.used_filters={},t.model&&(function e(n){n.each(function(e){e.filter&&e.filter.unique&&(t.status.used_filters[e.filter.id]||(t.status.used_filters[e.filter.id]=[]),"group"==e.filter.unique&&t.status.used_filters[e.filter.id].push(e.parent))},function(t){e(t)})}(t.model.root),t.applyDisabledFilters(e))},clearDisabledFilters:function(e){var t=e?e.builder:this;t.status.used_filters={},t.applyDisabledFilters(e)},applyDisabledFilters:function(n){var r=n?n.builder:this;r.$el.find(t.selectors.filter_container+" option").prop("disabled",!1),e.each(r.status.used_filters,function(e,n){0===n.length?r.$el.find(t.selectors.filter_container+' option[value="'+e+'"]:not(:selected)').prop("disabled",!0):n.forEach(function(n){n.each(function(n){n.$el.find(t.selectors.filter_container+' option[value="'+e+'"]:not(:selected)').prop("disabled",!0)})})}),r.settings.plugins&&r.settings.plugins["bt-selectpicker"]&&r.$el.find(t.selectors.rule_filter).selectpicker("render")}}),t.regional.en={__locale:"English (en)",__author:'Damien "Mistic" Sorel, http://www.strangeplanet.fr',add_rule:"Add rule",add_group:"Add group",delete_rule:"Delete",delete_group:"Delete",conditions:{AND:"AND",OR:"OR"},operators:{equal:"equal",not_equal:"not equal",in:"in",not_in:"not in",less:"less",less_or_equal:"less or equal",greater:"greater",greater_or_equal:"greater or equal",between:"between",not_between:"not between",begins_with:"begins with",not_begins_with:"doesn't begin with",contains:"contains",not_contains:"doesn't contain",ends_with:"ends with",not_ends_with:"doesn't end with",is_empty:"is empty",is_not_empty:"is not empty",is_null:"is null",is_not_null:"is not null"},errors:{no_filter:"No filter selected",empty_group:"The group is empty",radio_empty:"No value selected",checkbox_empty:"No value selected",select_empty:"No value selected",string_empty:"Empty value",string_exceed_min_length:"Must contain at least {0} characters",string_exceed_max_length:"Must not contain more than {0} characters",string_invalid_format:"Invalid format ({0})",number_nan:"Not a number",number_not_integer:"Not an integer",number_not_double:"Not a real number",number_exceed_min:"Must be greater than {0}",number_exceed_max:"Must be lower than {0}",number_wrong_step:"Must be a multiple of {0}",number_between_invalid:"Invalid values, {0} is greater than {1}",datetime_empty:"Empty value",datetime_invalid:"Invalid date format ({0})",datetime_exceed_min:"Must be after {0}",datetime_exceed_max:"Must be before {0}",datetime_between_invalid:"Invalid values, {0} is greater than {1}",boolean_not_valid:"Not a boolean",operator_not_multiple:'Operator "{1}" cannot accept multiple values'},invert:"Invert",NOT:"NOT"},t.defaults({lang_code:"en"}),t},void 0===(o=r.apply(t,i))||(e.exports=o)},1491:function(e,t,n){var r,i,o;i=[n(9983)],r=function(e){"use strict";e.extendext=function(){var t,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1,d="default";for("boolean"==typeof s&&(c=s,s=arguments[l++]||{}),"string"==typeof s&&("concat"!==(d=s.toLowerCase())&&"replace"!==d&&"extend"!==d&&(d="default"),s=arguments[l++]||{}),"object"==typeof s||e.isFunction(s)||(s={}),l===u&&(s=this,l--);l<u;l++)if(null!==(t=arguments[l]))if(e.isArray(t)&&"default"!==d)switch(a=s&&e.isArray(s)?s:[],d){case"concat":s=a.concat(e.extend(c,[],t));break;case"replace":s=e.extend(c,[],t);break;case"extend":t.forEach(function(t,n){if("object"==typeof t){var r=e.isArray(t)?[]:{};a[n]=e.extendext(c,d,a[n]||r,t)}else-1===a.indexOf(t)&&a.push(t)}),s=a}else for(n in t)i=t[n],"__proto__"!==n&&s!==i&&(c&&i&&(e.isPlainObject(i)||(o=e.isArray(i)))?(r=s[n],a=o&&!Array.isArray(r)?[]:o||e.isPlainObject(r)?r:{},o=!1,s[n]=e.extendext(c,d,a,i)):void 0!==i&&(s[n]=i));return s}},void 0===(o=r.apply(t,i))||(e.exports=o)},9755:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(r,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},u=o.push,c=o.indexOf,d={},f=d.toString,p=d.hasOwnProperty,h=p.toString,g=h.call(Object),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},_=r.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var r,i,o=(n=n||_).createElement("script");if(o.text=e,t)for(r in b)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[f.call(e)]||"object":typeof e}var k="3.7.1",C=/HTML$/i,D=function(e,t){return new D.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}D.fn=D.prototype={jquery:k,constructor:D,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=D.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return D.each(this,e)},map:function(e){return this.pushStack(D.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(D.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(D.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},D.extend=D.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(D.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||D.isPlainObject(n)?n:{},i=!1,a[t]=D.extend(u,o,r)):void 0!==r&&(a[t]=r));return a},D.extend({expando:"jQuery"+(k+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==f.call(e)||(t=a(e))&&("function"!=typeof(n=p.call(t,"constructor")&&t.constructor)||h.call(n)!==g))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){w(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(S(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=D.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?D.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!C.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(S(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return l(a)},guid:1,support:m}),"function"==typeof Symbol&&(D.fn[Symbol.iterator]=o[Symbol.iterator]),D.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){d["[object "+t+"]"]=t.toLowerCase()});var E=o.pop,M=o.sort,T=o.splice,j="[\\x20\\t\\r\\n\\f]",N=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g");D.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var F=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function O(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}D.escapeSelector=function(e){return(e+"").replace(F,O)};var I=_,z=u;!function(){var e,t,n,i,a,l,u,d,f,h,g=z,v=D.expando,y=0,_=0,b=ee(),w=ee(),x=ee(),k=ee(),C=function(e,t){return e===t&&(a=!0),0},S="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="(?:\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",O="\\["+j+"*("+F+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+j+"*\\]",$=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",q=new RegExp(j+"+","g"),R=new RegExp("^"+j+"*,"+j+"*"),P=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),L=new RegExp(j+"|>"),B=new RegExp($),U=new RegExp("^"+F+"$"),V={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+S+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/[+~]/,Q=new RegExp("\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\([^\\r\\n\\f])","g"),K=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},Z=function(){le()},X=fe(function(e){return!0===e.disabled&&A(e,"fieldset")},{dir:"parentNode",next:"legend"});try{g.apply(o=s.call(I.childNodes),I.childNodes),o[I.childNodes.length].nodeType}catch(e){g={apply:function(e,t){z.apply(e,s.call(t))},call:function(e){z.apply(e,s.call(arguments,1))}}}function J(e,t,n,r){var i,o,a,s,u,c,p,h=t&&t.ownerDocument,y=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return n;if(!r&&(le(t),t=t||l,d)){if(11!==y&&(u=G.exec(e)))if(i=u[1]){if(9===y){if(!(a=t.getElementById(i)))return n;if(a.id===i)return g.call(n,a),n}else if(h&&(a=h.getElementById(i))&&J.contains(t,a)&&a.id===i)return g.call(n,a),n}else{if(u[2])return g.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(i)),n}if(!(k[e+" "]||f&&f.test(e))){if(p=e,h=t,1===y&&(L.test(e)||P.test(e))){for((h=Y.test(e)&&se(t.parentNode)||t)==t&&m.scope||((s=t.getAttribute("id"))?s=D.escapeSelector(s):t.setAttribute("id",s=v)),o=(c=ce(e)).length;o--;)c[o]=(s?"#"+s:":scope")+" "+de(c[o]);p=c.join(",")}try{return g.apply(n,h.querySelectorAll(p)),n}catch(t){k(e,!0)}finally{s===v&&t.removeAttribute("id")}}}return ye(e.replace(N,"$1"),t,n,r)}function ee(){var e=[];return function n(r,i){return e.push(r+" ")>t.cacheLength&&delete n[e.shift()],n[r+" "]=i}}function te(e){return e[v]=!0,e}function ne(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return A(t,"input")&&t.type===e}}function ie(e){return function(t){return(A(t,"input")||A(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&X(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ae(e){return te(function(t){return t=+t,te(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function se(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var n,r=e?e.ownerDocument||e:I;return r!=l&&9===r.nodeType&&r.documentElement?(u=(l=r).documentElement,d=!D.isXMLDoc(l),h=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&I!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",Z),m.getById=ne(function(e){return u.appendChild(e).id=D.expando,!l.getElementsByName||!l.getElementsByName(D.expando).length}),m.disconnectedMatch=ne(function(e){return h.call(e,"*")}),m.scope=ne(function(){return l.querySelectorAll(":scope")}),m.cssHas=ne(function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),m.getById?(t.filter.ID=function(e){var t=e.replace(Q,K);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(Q,K);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},f=[],ne(function(e){var t;u.appendChild(e).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||f.push("\\["+j+"*(?:value|"+S+")"),e.querySelectorAll("[id~="+v+"-]").length||f.push("~="),e.querySelectorAll("a#"+v+"+*").length||f.push(".#.+[+~]"),e.querySelectorAll(":checked").length||f.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),u.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||f.push("\\["+j+"*name"+j+"*="+j+"*(?:''|\"\")")}),m.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),C=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===n?e===l||e.ownerDocument==I&&J.contains(I,e)?-1:t===l||t.ownerDocument==I&&J.contains(I,t)?1:i?c.call(i,e)-c.call(i,t):0:4&n?-1:1)},l):l}for(e in J.matches=function(e,t){return J(e,null,null,t)},J.matchesSelector=function(e,t){if(le(e),d&&!k[t+" "]&&(!f||!f.test(t)))try{var n=h.call(e,t);if(n||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){k(t,!0)}return J(t,l,null,[e]).length>0},J.contains=function(e,t){return(e.ownerDocument||e)!=l&&le(e),D.contains(e,t)},J.attr=function(e,n){(e.ownerDocument||e)!=l&&le(e);var r=t.attrHandle[n.toLowerCase()],i=r&&p.call(t.attrHandle,n.toLowerCase())?r(e,n,!d):void 0;return void 0!==i?i:e.getAttribute(n)},J.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},D.uniqueSort=function(e){var t,n=[],r=0,o=0;if(a=!m.sortStable,i=!m.sortStable&&s.call(e,0),M.call(e,C),a){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)T.call(e,n[r],1)}return i=null,e},D.fn.uniqueSort=function(){return this.pushStack(D.uniqueSort(s.apply(this)))},t=D.expr={cacheLength:50,createPseudo:te,match:V,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(Q,K),e[3]=(e[3]||e[4]||e[5]||"").replace(Q,K),"~="===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]||J.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]&&J.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=ce(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(Q,K).toLowerCase();return"*"===e?function(){return!0}:function(e){return A(e,t)}},CLASS:function(e){var t=b[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&b(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(r){var i=J.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,f,p,h=o!==a?"nextSibling":"previousSibling",g=t.parentNode,m=s&&t.nodeName.toLowerCase(),_=!l&&!s,b=!1;if(g){if(o){for(;h;){for(d=t;d=d[h];)if(s?A(d,m):1===d.nodeType)return!1;p=h="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&_){for(b=(f=(u=(c=g[v]||(g[v]={}))[e]||[])[0]===y&&u[1])&&u[2],d=f&&g.childNodes[f];d=++f&&d&&d[h]||(b=f=0)||p.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[y,f,b];break}}else if(_&&(b=f=(u=(c=t[v]||(t[v]={}))[e]||[])[0]===y&&u[1]),!1===b)for(;(d=++f&&d&&d[h]||(b=f=0)||p.pop())&&(!(s?A(d,m):1===d.nodeType)||!++b||(_&&((c=d[v]||(d[v]={}))[e]=[y,b]),d!==t)););return(b-=i)===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,n){var r,i=t.pseudos[e]||t.setFilters[e.toLowerCase()]||J.error("unsupported pseudo: "+e);return i[v]?i(n):i.length>1?(r=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te(function(e,t){for(var r,o=i(e,n),a=o.length;a--;)e[r=c.call(e,o[a])]=!(t[r]=o[a])}):function(e){return i(e,0,r)}):i}},pseudos:{not:te(function(e){var t=[],n=[],r=ve(e.replace(N,"$1"));return r[v]?te(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:te(function(e){return function(t){return J(e,t).length>0}}),contains:te(function(e){return e=e.replace(Q,K),function(t){return(t.textContent||D.text(t)).indexOf(e)>-1}}),lang:te(function(e){return U.test(e||"")||J.error("unsupported lang: "+e),e=e.replace(Q,K).toLowerCase(),function(t){var n;do{if(n=d?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(e){var t=r.location&&r.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return A(e,"input")&&!!e.checked||A(e,"option")&&!!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!t.pseudos.empty(e)},header:function(e){return W.test(e.nodeName)},input:function(e){return H.test(e.nodeName)},button:function(e){return A(e,"input")&&"button"===e.type||A(e,"button")},text:function(e){var t;return A(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ae(function(){return[0]}),last:ae(function(e,t){return[t-1]}),eq:ae(function(e,t,n){return[n<0?n+t:n]}),even:ae(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ae(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ae(function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:ae(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},t.pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=re(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=ie(e);function ue(){}function ce(e,n){var r,i,o,a,s,l,u,c=w[e+" "];if(c)return n?0:c.slice(0);for(s=e,l=[],u=t.preFilter;s;){for(a in r&&!(i=R.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=P.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(N," ")}),s=s.slice(r.length)),t.filter)!(i=V[a].exec(s))||u[a]&&!(i=u[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?J.error(e):w(e,l).slice(0)}function de(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function fe(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=_++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,l){var u,c,d=[y,s];if(l){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=t[v]||(t[v]={}),i&&A(t,i))t=t[r]||t;else{if((u=c[o])&&u[0]===y&&u[1]===s)return d[2]=u[2];if(c[o]=d,d[2]=e(t,n,l))return!0}return!1}}function pe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function he(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),u&&t.push(s)));return a}function ge(e,t,n,r,i,o){return r&&!r[v]&&(r=ge(r)),i&&!i[v]&&(i=ge(i,o)),te(function(o,a,s,l){var u,d,f,p,h=[],m=[],v=a.length,y=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)J(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),_=!e||!o&&t?y:he(y,h,e,s,l);if(n?n(_,p=i||(o?e:v||r)?[]:a,s,l):p=_,r)for(u=he(p,m),r(u,[],s,l),d=u.length;d--;)(f=u[d])&&(p[m[d]]=!(_[m[d]]=f));if(o){if(i||e){if(i){for(u=[],d=p.length;d--;)(f=p[d])&&u.push(_[d]=f);i(null,p=[],u,l)}for(d=p.length;d--;)(f=p[d])&&(u=i?c.call(o,f):h[d])>-1&&(o[u]=!(a[u]=f))}}else p=he(p===a?p.splice(v,p.length):p),i?i(null,a,p,l):g.apply(a,p)})}function me(e){for(var r,i,o,a=e.length,s=t.relative[e[0].type],l=s||t.relative[" "],u=s?1:0,d=fe(function(e){return e===r},l,!0),f=fe(function(e){return c.call(r,e)>-1},l,!0),p=[function(e,t,i){var o=!s&&(i||t!=n)||((r=t).nodeType?d(e,t,i):f(e,t,i));return r=null,o}];u<a;u++)if(i=t.relative[e[u].type])p=[fe(pe(p),i)];else{if((i=t.filter[e[u].type].apply(null,e[u].matches))[v]){for(o=++u;o<a&&!t.relative[e[o].type];o++);return ge(u>1&&pe(p),u>1&&de(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(N,"$1"),i,u<o&&me(e.slice(u,o)),o<a&&me(e=e.slice(o)),o<a&&de(e))}p.push(i)}return pe(p)}function ve(e,r){var i,o=[],a=[],s=x[e+" "];if(!s){for(r||(r=ce(e)),i=r.length;i--;)(s=me(r[i]))[v]?o.push(s):a.push(s);s=x(e,function(e,r){var i=r.length>0,o=e.length>0,a=function(a,s,u,c,f){var p,h,m,v=0,_="0",b=a&&[],w=[],x=n,k=a||o&&t.find.TAG("*",f),C=y+=null==x?1:Math.random()||.1,S=k.length;for(f&&(n=s==l||s||f);_!==S&&null!=(p=k[_]);_++){if(o&&p){for(h=0,s||p.ownerDocument==l||(le(p),u=!d);m=e[h++];)if(m(p,s||l,u)){g.call(c,p);break}f&&(y=C)}i&&((p=!m&&p)&&v--,a&&b.push(p))}if(v+=_,i&&_!==v){for(h=0;m=r[h++];)m(b,w,s,u);if(a){if(v>0)for(;_--;)b[_]||w[_]||(w[_]=E.call(c));w=he(w)}g.apply(c,w),f&&!a&&w.length>0&&v+r.length>1&&D.uniqueSort(c)}return f&&(y=C,n=x),b};return i?te(a):a}(a,o)),s.selector=e}return s}function ye(e,n,r,i){var o,a,s,l,u,c="function"==typeof e&&e,f=!i&&ce(e=c.selector||e);if(r=r||[],1===f.length){if((a=f[0]=f[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===n.nodeType&&d&&t.relative[a[1].type]){if(!(n=(t.find.ID(s.matches[0].replace(Q,K),n)||[])[0]))return r;c&&(n=n.parentNode),e=e.slice(a.shift().value.length)}for(o=V.needsContext.test(e)?0:a.length;o--&&(s=a[o],!t.relative[l=s.type]);)if((u=t.find[l])&&(i=u(s.matches[0].replace(Q,K),Y.test(a[0].type)&&se(n.parentNode)||n))){if(a.splice(o,1),!(e=i.length&&de(a)))return g.apply(r,i),r;break}}return(c||ve(e,f))(i,n,!d,r,!n||Y.test(e)&&se(n.parentNode)||n),r}ue.prototype=t.filters=t.pseudos,t.setFilters=new ue,m.sortStable=v.split("").sort(C).join("")===v,le(),m.sortDetached=ne(function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))}),D.find=J,D.expr[":"]=D.expr.pseudos,D.unique=D.uniqueSort,J.compile=ve,J.select=ye,J.setDocument=le,J.tokenize=ce,J.escape=D.escapeSelector,J.getText=D.text,J.isXML=D.isXMLDoc,J.selectors=D.expr,J.support=D.support,J.uniqueSort=D.uniqueSort}();var $=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&D(e).is(n))break;r.push(e)}return r},q=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},R=D.expr.match.needsContext,P=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,t,n){return v(t)?D.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?D.grep(e,function(e){return e===t!==n}):"string"!=typeof t?D.grep(e,function(e){return c.call(t,e)>-1!==n}):D.filter(t,e,n)}D.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?D.find.matchesSelector(r,e)?[r]:[]:D.find.matches(e,D.grep(t,function(e){return 1===e.nodeType}))},D.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(D(e).filter(function(){for(t=0;t<r;t++)if(D.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)D.find(e,i[t],n);return r>1?D.uniqueSort(n):n},filter:function(e){return this.pushStack(L(this,e||[],!1))},not:function(e){return this.pushStack(L(this,e||[],!0))},is:function(e){return!!L(this,"string"==typeof e&&R.test(e)?D(e):e||[],!1).length}});var B,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(D.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||B,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:U.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof D?t[0]:t,D.merge(this,D.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:_,!0)),P.test(r[1])&&D.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=_.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(D):D.makeArray(e,this)}).prototype=D.fn,B=D(_);var V=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function W(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}D.fn.extend({has:function(e){var t=D(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(D.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&D(e);if(!R.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&D.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?D.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(D(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(D.uniqueSort(D.merge(this.get(),D(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),D.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return $(e,"parentNode")},parentsUntil:function(e,t,n){return $(e,"parentNode",n)},next:function(e){return W(e,"nextSibling")},prev:function(e){return W(e,"previousSibling")},nextAll:function(e){return $(e,"nextSibling")},prevAll:function(e){return $(e,"previousSibling")},nextUntil:function(e,t,n){return $(e,"nextSibling",n)},prevUntil:function(e,t,n){return $(e,"previousSibling",n)},siblings:function(e){return q((e.parentNode||{}).firstChild,e)},children:function(e){return q(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),D.merge([],e.childNodes))}},function(e,t){D.fn[e]=function(n,r){var i=D.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=D.filter(r,i)),this.length>1&&(H[e]||D.uniqueSort(i),V.test(e)&&i.reverse()),this.pushStack(i)}});var G=/[^\x20\t\r\n\f]+/g;function Y(e){return e}function Q(e){throw e}function K(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}D.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return D.each(e.match(G)||[],function(e,n){t[n]=!0}),t}(e):D.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){D.each(n,function(n,r){v(r)?e.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&l()),this},remove:function(){return D.each(arguments,function(e,t){for(var n;(n=D.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?D.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},D.extend({Deferred:function(e){var t=[["notify","progress",D.Callbacks("memory"),D.Callbacks("memory"),2],["resolve","done",D.Callbacks("once memory"),D.Callbacks("once memory"),0,"resolved"],["reject","fail",D.Callbacks("once memory"),D.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return D.Deferred(function(n){D.each(t,function(t,r){var i=v(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var s=this,l=arguments,u=function(){var r,u;if(!(e<o)){if((r=n.apply(s,l))===t.promise())throw new TypeError("Thenable self-resolution");u=r&&("object"==typeof r||"function"==typeof r)&&r.then,v(u)?i?u.call(r,a(o,t,Y,i),a(o,t,Q,i)):(o++,u.call(r,a(o,t,Y,i),a(o,t,Q,i),a(o,t,Y,t.notifyWith))):(n!==Y&&(s=void 0,l=[r]),(i||t.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(r){D.Deferred.exceptionHook&&D.Deferred.exceptionHook(r,c.error),e+1>=o&&(n!==Q&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?c():(D.Deferred.getErrorHook?c.error=D.Deferred.getErrorHook():D.Deferred.getStackHook&&(c.error=D.Deferred.getStackHook()),r.setTimeout(c))}}return D.Deferred(function(r){t[0][3].add(a(0,r,v(i)?i:Y,r.notifyWith)),t[1][3].add(a(0,r,v(e)?e:Y)),t[2][3].add(a(0,r,v(n)?n:Q))}).promise()},promise:function(e){return null!=e?D.extend(e,i):i}},o={};return D.each(t,function(e,r){var a=r[2],s=r[5];i[r[1]]=a.add,s&&a.add(function(){n=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=D.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(K(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)K(i[n],a(n),o.reject);return o.promise()}});var Z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;D.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&Z.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},D.readyException=function(e){r.setTimeout(function(){throw e})};var X=D.Deferred();function J(){_.removeEventListener("DOMContentLoaded",J),r.removeEventListener("load",J),D.ready()}D.fn.ready=function(e){return X.then(e).catch(function(e){D.readyException(e)}),this},D.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--D.readyWait:D.isReady)||(D.isReady=!0,!0!==e&&--D.readyWait>0||X.resolveWith(_,[D]))}}),D.ready.then=X.then,"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?r.setTimeout(D.ready):(_.addEventListener("DOMContentLoaded",J),r.addEventListener("load",J));var ee=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===x(n))for(s in i=!0,n)ee(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(D(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},te=/^-ms-/,ne=/-([a-z])/g;function re(e,t){return t.toUpperCase()}function ie(e){return e.replace(te,"ms-").replace(ne,re)}var oe=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function ae(){this.expando=D.expando+ae.uid++}ae.uid=1,ae.prototype={cache:function(e){var t=e[this.expando];return t||(t={},oe(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[ie(t)]=n;else for(r in t)i[ie(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ie(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ie):(t=ie(t))in r?[t]:t.match(G)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||D.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!D.isEmptyObject(t)}};var se=new ae,le=new ae,ue=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ce=/[A-Z]/g;function de(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ce,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ue.test(e)?JSON.parse(e):e)}(n)}catch(e){}le.set(e,t,n)}else n=void 0;return n}D.extend({hasData:function(e){return le.hasData(e)||se.hasData(e)},data:function(e,t,n){return le.access(e,t,n)},removeData:function(e,t){le.remove(e,t)},_data:function(e,t,n){return se.access(e,t,n)},_removeData:function(e,t){se.remove(e,t)}}),D.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=le.get(o),1===o.nodeType&&!se.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=ie(r.slice(5)),de(o,r,i[r]));se.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){le.set(this,e)}):ee(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=le.get(o,e))||void 0!==(n=de(o,e))?n:void 0;this.each(function(){le.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){le.remove(this,e)})}}),D.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=se.get(e,t),n&&(!r||Array.isArray(n)?r=se.access(e,t,D.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=D.queue(e,t),r=n.length,i=n.shift(),o=D._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){D.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return se.get(e,n)||se.access(e,n,{empty:D.Callbacks("once memory").add(function(){se.remove(e,[t+"queue",n])})})}}),D.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?D.queue(this[0],e):void 0===t?this:this.each(function(){var n=D.queue(this,e,t);D._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&D.dequeue(this,e)})},dequeue:function(e){return this.each(function(){D.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=D.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=se.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var fe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,pe=new RegExp("^(?:([+-])=|)("+fe+")([a-z%]*)$","i"),he=["Top","Right","Bottom","Left"],ge=_.documentElement,me=function(e){return D.contains(e.ownerDocument,e)},ve={composed:!0};ge.getRootNode&&(me=function(e){return D.contains(e.ownerDocument,e)||e.getRootNode(ve)===e.ownerDocument});var ye=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&me(e)&&"none"===D.css(e,"display")};function _e(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return D.css(e,t,"")},l=s(),u=n&&n[3]||(D.cssNumber[t]?"":"px"),c=e.nodeType&&(D.cssNumber[t]||"px"!==u&&+l)&&pe.exec(D.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)D.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,D.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var be={};function we(e){var t,n=e.ownerDocument,r=e.nodeName,i=be[r];return i||(t=n.body.appendChild(n.createElement(r)),i=D.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),be[r]=i,i)}function xe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=se.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ye(r)&&(i[o]=we(r))):"none"!==n&&(i[o]="none",se.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}D.fn.extend({show:function(){return xe(this,!0)},hide:function(){return xe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ye(this)?D(this).show():D(this).hide()})}});var ke,Ce,De=/^(?:checkbox|radio)$/i,Se=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ae=/^$|^module$|\/(?:java|ecma)script/i;ke=_.createDocumentFragment().appendChild(_.createElement("div")),(Ce=_.createElement("input")).setAttribute("type","radio"),Ce.setAttribute("checked","checked"),Ce.setAttribute("name","t"),ke.appendChild(Ce),m.checkClone=ke.cloneNode(!0).cloneNode(!0).lastChild.checked,ke.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!ke.cloneNode(!0).lastChild.defaultValue,ke.innerHTML="<option></option>",m.option=!!ke.lastChild;var Ee={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Me(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?D.merge([e],n):n}function Te(e,t){for(var n=0,r=e.length;n<r;n++)se.set(e[n],"globalEval",!t||se.get(t[n],"globalEval"))}Ee.tbody=Ee.tfoot=Ee.colgroup=Ee.caption=Ee.thead,Ee.th=Ee.td,m.option||(Ee.optgroup=Ee.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ne(e,t,n,r,i){for(var o,a,s,l,u,c,d=t.createDocumentFragment(),f=[],p=0,h=e.length;p<h;p++)if((o=e[p])||0===o)if("object"===x(o))D.merge(f,o.nodeType?[o]:o);else if(je.test(o)){for(a=a||d.appendChild(t.createElement("div")),s=(Se.exec(o)||["",""])[1].toLowerCase(),l=Ee[s]||Ee._default,a.innerHTML=l[1]+D.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;D.merge(f,a.childNodes),(a=d.firstChild).textContent=""}else f.push(t.createTextNode(o));for(d.textContent="",p=0;o=f[p++];)if(r&&D.inArray(o,r)>-1)i&&i.push(o);else if(u=me(o),a=Me(d.appendChild(o),"script"),u&&Te(a),n)for(c=0;o=a[c++];)Ae.test(o.type||"")&&n.push(o);return d}var Fe=/^([^.]*)(?:\.(.+)|)/;function Oe(){return!0}function Ie(){return!1}function ze(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ze(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ie;else if(!i)return e;return 1===o&&(a=i,i=function(e){return D().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=D.guid++)),e.each(function(){D.event.add(this,t,i,r,n)})}function $e(e,t,n){n?(se.set(e,t,!1),D.event.add(e,t,{namespace:!1,handler:function(e){var n,r=se.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(D.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),se.set(this,t,r),this[t](),n=se.get(this,t),se.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(se.set(this,t,D.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Oe)}})):void 0===se.get(e,t)&&D.event.add(e,t,Oe)}D.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,f,p,h,g,m=se.get(e);if(oe(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&D.find.matchesSelector(ge,i),n.guid||(n.guid=D.guid++),(l=m.events)||(l=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(t){return void 0!==D&&D.event.triggered!==t.type?D.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(G)||[""]).length;u--;)p=g=(s=Fe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(d=D.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=D.event.special[p]||{},c=D.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&D.expr.match.needsContext.test(i),namespace:h.join(".")},o),(f=l[p])||((f=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),D.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,f,p,h,g,m=se.hasData(e)&&se.get(e);if(m&&(l=m.events)){for(u=(t=(t||"").match(G)||[""]).length;u--;)if(p=g=(s=Fe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=D.event.special[p]||{},f=l[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||D.removeEvent(e,p,m.handle),delete l[p])}else for(p in l)D.event.remove(e,p+t[u],n,r,!0);D.isEmptyObject(l)&&se.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=D.event.fix(e),u=(se.get(this,"events")||Object.create(null))[l.type]||[],c=D.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(a=D.event.handlers.call(this,l,u),t=0;(i=a[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((D.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?D(i,this).index(u)>-1:D.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(D.Event.prototype,e,{enumerable:!0,configurable:!0,get:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[D.expando]?e:new D.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return De.test(t.type)&&t.click&&A(t,"input")&&$e(t,"click",!0),!1},trigger:function(e){var t=this||e;return De.test(t.type)&&t.click&&A(t,"input")&&$e(t,"click"),!0},_default:function(e){var t=e.target;return De.test(t.type)&&t.click&&A(t,"input")&&se.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},D.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},D.Event=function(e,t){if(!(this instanceof D.Event))return new D.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Oe:Ie,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&D.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[D.expando]=!0},D.Event.prototype={constructor:D.Event,isDefaultPrevented:Ie,isPropagationStopped:Ie,isImmediatePropagationStopped:Ie,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Oe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Oe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Oe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},D.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},D.event.addProp),D.each({focus:"focusin",blur:"focusout"},function(e,t){function n(e){if(_.documentMode){var n=se.get(this,"handle"),r=D.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else D.event.simulate(t,e.target,D.event.fix(e))}D.event.special[e]={setup:function(){var r;if($e(this,e,!0),!_.documentMode)return!1;(r=se.get(this,t))||this.addEventListener(t,n),se.set(this,t,(r||0)+1)},trigger:function(){return $e(this,e),!0},teardown:function(){var e;if(!_.documentMode)return!1;(e=se.get(this,t)-1)?se.set(this,t,e):(this.removeEventListener(t,n),se.remove(this,t))},_default:function(t){return se.get(t.target,e)},delegateType:t},D.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,o=se.get(i,t);o||(_.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),se.set(i,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,o=se.get(i,t)-1;o?se.set(i,t,o):(_.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),se.remove(i,t))}}}),D.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){D.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||D.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),D.fn.extend({on:function(e,t,n,r){return ze(this,e,t,n,r)},one:function(e,t,n,r){return ze(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,D(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ie),this.each(function(){D.event.remove(this,e,n,t)})}});var qe=/<script|<style|<link/i,Re=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Le(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&D(e).children("tbody")[0]||e}function Be(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ue(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ve(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(se.hasData(e)&&(s=se.get(e).events))for(i in se.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)D.event.add(t,i,s[i][n]);le.hasData(e)&&(o=le.access(e),a=D.extend({},o),le.set(t,a))}}function He(e,t){var n=t.nodeName.toLowerCase();"input"===n&&De.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function We(e,t,n,r){t=l(t);var i,o,a,s,u,c,d=0,f=e.length,p=f-1,h=t[0],g=v(h);if(g||f>1&&"string"==typeof h&&!m.checkClone&&Re.test(h))return e.each(function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),We(o,t,n,r)});if(f&&(o=(i=Ne(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=D.map(Me(i,"script"),Be)).length;d<f;d++)u=i,d!==p&&(u=D.clone(u,!0,!0),s&&D.merge(a,Me(u,"script"))),n.call(e[d],u,d);if(s)for(c=a[a.length-1].ownerDocument,D.map(a,Ue),d=0;d<s;d++)u=a[d],Ae.test(u.type||"")&&!se.access(u,"globalEval")&&D.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?D._evalUrl&&!u.noModule&&D._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):w(u.textContent.replace(Pe,""),u,c))}return e}function Ge(e,t,n){for(var r,i=t?D.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||D.cleanData(Me(r)),r.parentNode&&(n&&me(r)&&Te(Me(r,"script")),r.parentNode.removeChild(r));return e}D.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=me(e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||D.isXMLDoc(e)))for(a=Me(s),r=0,i=(o=Me(e)).length;r<i;r++)He(o[r],a[r]);if(t)if(n)for(o=o||Me(e),a=a||Me(s),r=0,i=o.length;r<i;r++)Ve(o[r],a[r]);else Ve(e,s);return(a=Me(s,"script")).length>0&&Te(a,!l&&Me(e,"script")),s},cleanData:function(e){for(var t,n,r,i=D.event.special,o=0;void 0!==(n=e[o]);o++)if(oe(n)){if(t=n[se.expando]){if(t.events)for(r in t.events)i[r]?D.event.remove(n,r):D.removeEvent(n,r,t.handle);n[se.expando]=void 0}n[le.expando]&&(n[le.expando]=void 0)}}}),D.fn.extend({detach:function(e){return Ge(this,e,!0)},remove:function(e){return Ge(this,e)},text:function(e){return ee(this,function(e){return void 0===e?D.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return We(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return We(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return We(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return We(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(D.cleanData(Me(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return D.clone(this,e,t)})},html:function(e){return ee(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!Ee[(Se.exec(e)||["",""])[1].toLowerCase()]){e=D.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(D.cleanData(Me(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return We(this,arguments,function(t){var n=this.parentNode;D.inArray(this,e)<0&&(D.cleanData(Me(this)),n&&n.replaceChild(t,this))},e)}}),D.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){D.fn[e]=function(e){for(var n,r=[],i=D(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),D(i[a])[t](n),u.apply(r,n.get());return this.pushStack(r)}});var Ye=new RegExp("^("+fe+")(?!px)[a-z%]+$","i"),Qe=/^--/,Ke=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=r),t.getComputedStyle(e)},Ze=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Xe=new RegExp(he.join("|"),"i");function Je(e,t,n){var r,i,o,a,s=Qe.test(t),l=e.style;return(n=n||Ke(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(N,"$1")||void 0),""!==a||me(e)||(a=D.style(e,t)),!m.pixelBoxStyles()&&Ye.test(a)&&Xe.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function et(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ge.appendChild(u).appendChild(c);var e=r.getComputedStyle(c);n="1%"!==e.top,l=12===t(e.marginLeft),c.style.right="60%",a=36===t(e.right),i=36===t(e.width),c.style.position="absolute",o=12===t(c.offsetWidth/3),ge.removeChild(u),c=null}}function t(e){return Math.round(parseFloat(e))}var n,i,o,a,s,l,u=_.createElement("div"),c=_.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,D.extend(m,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,t,n,i;return null==s&&(e=_.createElement("table"),t=_.createElement("tr"),n=_.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",ge.appendChild(e).appendChild(t).appendChild(n),i=r.getComputedStyle(t),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===t.offsetHeight,ge.removeChild(e)),s}}))}();var tt=["Webkit","Moz","ms"],nt=_.createElement("div").style,rt={};function it(e){return D.cssProps[e]||rt[e]||(e in nt?e:rt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=tt.length;n--;)if((e=tt[n]+t)in nt)return e}(e)||e)}var ot=/^(none|table(?!-c[ea]).+)/,at={position:"absolute",visibility:"hidden",display:"block"},st={letterSpacing:"0",fontWeight:"400"};function lt(e,t,n){var r=pe.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function ut(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=D.css(e,n+he[a],!0,i)),r?("content"===n&&(l-=D.css(e,"padding"+he[a],!0,i)),"margin"!==n&&(l-=D.css(e,"border"+he[a]+"Width",!0,i))):(l+=D.css(e,"padding"+he[a],!0,i),"padding"!==n?l+=D.css(e,"border"+he[a]+"Width",!0,i):s+=D.css(e,"border"+he[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l+u}function ct(e,t,n){var r=Ke(e),i=(!m.boxSizingReliable()||n)&&"border-box"===D.css(e,"boxSizing",!1,r),o=i,a=Je(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ye.test(a)){if(!n)return a;a="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===D.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===D.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+ut(e,t,n||(i?"border":"content"),o,r,a)+"px"}function dt(e,t,n,r,i){return new dt.prototype.init(e,t,n,r,i)}D.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=ie(t),l=Qe.test(t),u=e.style;if(l||(t=it(s)),a=D.cssHooks[t]||D.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];"string"==(o=typeof n)&&(i=pe.exec(n))&&i[1]&&(n=_e(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(D.cssNumber[s]?"":"px")),m.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=ie(t);return Qe.test(t)||(t=it(s)),(a=D.cssHooks[t]||D.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Je(e,t,r)),"normal"===i&&t in st&&(i=st[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),D.each(["height","width"],function(e,t){D.cssHooks[t]={get:function(e,n,r){if(n)return!ot.test(D.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ct(e,t,r):Ze(e,at,function(){return ct(e,t,r)})},set:function(e,n,r){var i,o=Ke(e),a=!m.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===D.css(e,"boxSizing",!1,o),l=r?ut(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-ut(e,t,"border",!1,o)-.5)),l&&(i=pe.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=D.css(e,t)),lt(0,n,l)}}}),D.cssHooks.marginLeft=et(m.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-Ze(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),D.each({margin:"",padding:"",border:"Width"},function(e,t){D.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+he[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(D.cssHooks[e+t].set=lt)}),D.fn.extend({css:function(e,t){return ee(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ke(e),i=t.length;a<i;a++)o[t[a]]=D.css(e,t[a],!1,r);return o}return void 0!==n?D.style(e,t,n):D.css(e,t)},e,t,arguments.length>1)}}),D.Tween=dt,dt.prototype={constructor:dt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||D.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(D.cssNumber[n]?"":"px")},cur:function(){var e=dt.propHooks[this.prop];return e&&e.get?e.get(this):dt.propHooks._default.get(this)},run:function(e){var t,n=dt.propHooks[this.prop];return this.options.duration?this.pos=t=D.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):dt.propHooks._default.set(this),this}},dt.prototype.init.prototype=dt.prototype,dt.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=D.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){D.fx.step[e.prop]?D.fx.step[e.prop](e):1!==e.elem.nodeType||!D.cssHooks[e.prop]&&null==e.elem.style[it(e.prop)]?e.elem[e.prop]=e.now:D.style(e.elem,e.prop,e.now+e.unit)}}},dt.propHooks.scrollTop=dt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},D.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},D.fx=dt.prototype.init,D.fx.step={};var ft,pt,ht=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;function mt(){pt&&(!1===_.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(mt):r.setTimeout(mt,D.fx.interval),D.fx.tick())}function vt(){return r.setTimeout(function(){ft=void 0}),ft=Date.now()}function yt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=he[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function _t(e,t,n){for(var r,i=(bt.tweeners[t]||[]).concat(bt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function bt(e,t,n){var r,i,o=0,a=bt.prefilters.length,s=D.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=ft||vt(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),r<1&&a?n:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:D.extend({},t),opts:D.extend(!0,{specialEasing:{},easing:D.easing._default},n),originalProperties:t,originalOptions:n,startTime:ft||vt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=D.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=ie(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=D.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);o<a;o++)if(r=bt.prefilters[o].call(u,e,c,u.opts))return v(r.stop)&&(D._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return D.map(c,_t,u),v(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),D.fx.timer(D.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}D.Animation=D.extend(bt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return _e(n.elem,e,pe.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(G);for(var n,r=0,i=e.length;r<i;r++)n=e[r],bt.tweeners[n]=bt.tweeners[n]||[],bt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,l,u,c,d="width"in t||"height"in t,f=this,p={},h=e.style,g=e.nodeType&&ye(e),m=se.get(e,"fxshow");for(r in n.queue||(null==(a=D._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,f.always(function(){f.always(function(){a.unqueued--,D.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ht.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}p[r]=m&&m[r]||D.style(e,r)}if((l=!D.isEmptyObject(t))||!D.isEmptyObject(p))for(r in d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(u=m&&m.display)&&(u=se.get(e,"display")),"none"===(c=D.css(e,"display"))&&(u?c=u:(xe([e],!0),u=e.style.display||u,c=D.css(e,"display"),xe([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===D.css(e,"float")&&(l||(f.done(function(){h.display=u}),null==u&&(c=h.display,u="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",f.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),l=!1,p)l||(m?"hidden"in m&&(g=m.hidden):m=se.access(e,"fxshow",{display:u}),o&&(m.hidden=!g),g&&xe([e],!0),f.done(function(){for(r in g||xe([e]),se.remove(e,"fxshow"),p)D.style(e,r,p[r])})),l=_t(g?m[r]:0,r,f),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?bt.prefilters.unshift(e):bt.prefilters.push(e)}}),D.speed=function(e,t,n){var r=e&&"object"==typeof e?D.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return D.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in D.fx.speeds?r.duration=D.fx.speeds[r.duration]:r.duration=D.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&D.dequeue(this,r.queue)},r},D.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ye).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=D.isEmptyObject(e),o=D.speed(t,n,r),a=function(){var t=bt(this,D.extend({},e),o);(i||se.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=D.timers,a=se.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&gt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||D.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=se.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=D.timers,a=r?r.length:0;for(n.finish=!0,D.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),D.each(["toggle","show","hide"],function(e,t){var n=D.fn[t];D.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(yt(t,!0),e,r,i)}}),D.each({slideDown:yt("show"),slideUp:yt("hide"),slideToggle:yt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){D.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),D.timers=[],D.fx.tick=function(){var e,t=0,n=D.timers;for(ft=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||D.fx.stop(),ft=void 0},D.fx.timer=function(e){D.timers.push(e),D.fx.start()},D.fx.interval=13,D.fx.start=function(){pt||(pt=!0,mt())},D.fx.stop=function(){pt=null},D.fx.speeds={slow:600,fast:200,_default:400},D.fn.delay=function(e,t){return e=D.fx&&D.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,n){var i=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(i)}})},function(){var e=_.createElement("input"),t=_.createElement("select").appendChild(_.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=_.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var wt,xt=D.expr.attrHandle;D.fn.extend({attr:function(e,t){return ee(this,D.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){D.removeAttr(this,e)})}}),D.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?D.prop(e,t,n):(1===o&&D.isXMLDoc(e)||(i=D.attrHooks[t.toLowerCase()]||(D.expr.match.bool.test(t)?wt:void 0)),void 0!==n?null===n?void D.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=D.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(G);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),wt={set:function(e,t,n){return!1===t?D.removeAttr(e,n):e.setAttribute(n,n),n}},D.each(D.expr.match.bool.source.match(/\w+/g),function(e,t){var n=xt[t]||D.find.attr;xt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=xt[a],xt[a]=i,i=null!=n(e,t,r)?a:null,xt[a]=o),i}});var kt=/^(?:input|select|textarea|button)$/i,Ct=/^(?:a|area)$/i;function Dt(e){return(e.match(G)||[]).join(" ")}function St(e){return e.getAttribute&&e.getAttribute("class")||""}function At(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(G)||[]}D.fn.extend({prop:function(e,t){return ee(this,D.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[D.propFix[e]||e]})}}),D.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&D.isXMLDoc(e)||(t=D.propFix[t]||t,i=D.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=D.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||Ct.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(D.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),D.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){D.propFix[this.toLowerCase()]=this}),D.fn.extend({addClass:function(e){var t,n,r,i,o,a;return v(e)?this.each(function(t){D(this).addClass(e.call(this,t,St(this)))}):(t=At(e)).length?this.each(function(){if(r=St(this),n=1===this.nodeType&&" "+Dt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Dt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(e){var t,n,r,i,o,a;return v(e)?this.each(function(t){D(this).removeClass(e.call(this,t,St(this)))}):arguments.length?(t=At(e)).length?this.each(function(){if(r=St(this),n=1===this.nodeType&&" "+Dt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");a=Dt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=typeof e,s="string"===a||Array.isArray(e);return v(e)?this.each(function(n){D(this).toggleClass(e.call(this,n,St(this),t),t)}):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=At(e),this.each(function(){if(s)for(o=D(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==a||((r=St(this))&&se.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":se.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Dt(St(n))+" ").indexOf(t)>-1)return!0;return!1}});var Et=/\r/g;D.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,D(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=D.map(i,function(e){return null==e?"":e+""})),(t=D.valHooks[this.type]||D.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=D.valHooks[i.type]||D.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Et,""):null==n?"":n:void 0}}),D.extend({valHooks:{option:{get:function(e){var t=D.find.attr(e,"value");return null!=t?t:Dt(D.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=D(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=D.makeArray(t),a=i.length;a--;)((r=i[a]).selected=D.inArray(D.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),D.each(["radio","checkbox"],function(){D.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=D.inArray(D(e).val(),t)>-1}},m.checkOn||(D.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Mt=r.location,Tt={guid:Date.now()},jt=/\?/;D.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||D.error("Invalid XML: "+(n?D.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Nt=/^(?:focusinfocus|focusoutblur)$/,Ft=function(e){e.stopPropagation()};D.extend(D.event,{trigger:function(e,t,n,i){var o,a,s,l,u,c,d,f,h=[n||_],g=p.call(e,"type")?e.type:e,m=p.call(e,"namespace")?e.namespace.split("."):[];if(a=f=s=n=n||_,3!==n.nodeType&&8!==n.nodeType&&!Nt.test(g+D.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(e=e[D.expando]?e:new D.Event(g,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:D.makeArray(t,[e]),d=D.event.special[g]||{},i||!d.trigger||!1!==d.trigger.apply(n,t))){if(!i&&!d.noBubble&&!y(n)){for(l=d.delegateType||g,Nt.test(l+g)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(n.ownerDocument||_)&&h.push(s.defaultView||s.parentWindow||r)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)f=a,e.type=o>1?l:d.bindType||g,(c=(se.get(a,"events")||Object.create(null))[e.type]&&se.get(a,"handle"))&&c.apply(a,t),(c=u&&a[u])&&c.apply&&oe(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(h.pop(),t)||!oe(n)||u&&v(n[g])&&!y(n)&&((s=n[u])&&(n[u]=null),D.event.triggered=g,e.isPropagationStopped()&&f.addEventListener(g,Ft),n[g](),e.isPropagationStopped()&&f.removeEventListener(g,Ft),D.event.triggered=void 0,s&&(n[u]=s)),e.result}},simulate:function(e,t,n){var r=D.extend(new D.Event,n,{type:e,isSimulated:!0});D.event.trigger(r,null,t)}}),D.fn.extend({trigger:function(e,t){return this.each(function(){D.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return D.event.trigger(e,t,n,!0)}});var Ot=/\[\]$/,It=/\r?\n/g,zt=/^(?:submit|button|image|reset|file)$/i,$t=/^(?:input|select|textarea|keygen)/i;function qt(e,t,n,r){var i;if(Array.isArray(t))D.each(t,function(t,i){n||Ot.test(e)?r(e,i):qt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)qt(e+"["+i+"]",t[i],n,r)}D.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!D.isPlainObject(e))D.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},D.fn.extend({serialize:function(){return D.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=D.prop(this,"elements");return e?D.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!D(this).is(":disabled")&&$t.test(this.nodeName)&&!zt.test(e)&&(this.checked||!De.test(e))}).map(function(e,t){var n=D(this).val();return null==n?null:Array.isArray(n)?D.map(n,function(e){return{name:t.name,value:e.replace(It,"\r\n")}}):{name:t.name,value:n.replace(It,"\r\n")}}).get()}});var Rt=/%20/g,Pt=/#.*$/,Lt=/([?&])_=[^&]*/,Bt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ut=/^(?:GET|HEAD)$/,Vt=/^\/\//,Ht={},Wt={},Gt="*/".concat("*"),Yt=_.createElement("a");function Qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(G)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Kt(e,t,n,r){var i={},o=e===Wt;function a(s){var l;return i[s]=!0,D.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Zt(e,t){var n,r,i=D.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&D.extend(!0,e,r),e}Yt.href=Mt.href,D.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Gt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":D.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Zt(Zt(e,D.ajaxSettings),t):Zt(D.ajaxSettings,e)},ajaxPrefilter:Qt(Ht),ajaxTransport:Qt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,a,s,l,u,c,d,f,p=D.ajaxSetup({},t),h=p.context||p,g=p.context&&(h.nodeType||h.jquery)?D(h):D.event,m=D.Deferred(),v=D.Callbacks("once memory"),y=p.statusCode||{},b={},w={},x="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Bt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||x;return n&&n.abort(t),C(0,t),this}};if(m.promise(k),p.url=((e||p.url||Mt.href)+"").replace(Vt,Mt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(G)||[""],null==p.crossDomain){l=_.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Yt.protocol+"//"+Yt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=D.param(p.data,p.traditional)),Kt(Ht,p,t,k),u)return k;for(d in(c=D.event&&p.global)&&0===D.active++&&D.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ut.test(p.type),i=p.url.replace(Pt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Rt,"+")):(f=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(jt.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Lt,"$1"),f=(jt.test(i)?"&":"?")+"_="+Tt.guid+++f),p.url=i+f),p.ifModified&&(D.lastModified[i]&&k.setRequestHeader("If-Modified-Since",D.lastModified[i]),D.etag[i]&&k.setRequestHeader("If-None-Match",D.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Gt+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(h,k,p)||u))return k.abort();if(x="abort",v.add(p.complete),k.done(p.success),k.fail(p.error),n=Kt(Wt,p,t,k)){if(k.readyState=1,c&&g.trigger("ajaxSend",[k,p]),u)return k;p.async&&p.timeout>0&&(s=r.setTimeout(function(){k.abort("timeout")},p.timeout));try{u=!1,n.send(b,C)}catch(e){if(u)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,a,l){var d,f,_,b,w,x=t;u||(u=!0,s&&r.clearTimeout(s),n=void 0,o=l||"",k.readyState=e>0?4:0,d=e>=200&&e<300||304===e,a&&(b=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,k,a)),!d&&D.inArray("script",p.dataTypes)>-1&&D.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(p,b,k,d),d?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(D.lastModified[i]=w),(w=k.getResponseHeader("etag"))&&(D.etag[i]=w)),204===e||"HEAD"===p.type?x="nocontent":304===e?x="notmodified":(x=b.state,f=b.data,d=!(_=b.error))):(_=x,!e&&x||(x="error",e<0&&(e=0))),k.status=e,k.statusText=(t||x)+"",d?m.resolveWith(h,[f,x,k]):m.rejectWith(h,[k,x,_]),k.statusCode(y),y=void 0,c&&g.trigger(d?"ajaxSuccess":"ajaxError",[k,p,d?f:_]),v.fireWith(h,[k,x]),c&&(g.trigger("ajaxComplete",[k,p]),--D.active||D.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return D.get(e,t,n,"json")},getScript:function(e,t){return D.get(e,void 0,t,"script")}}),D.each(["get","post"],function(e,t){D[t]=function(e,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),D.ajax(D.extend({url:e,type:t,dataType:i,data:n,success:r},D.isPlainObject(e)&&e))}}),D.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),D._evalUrl=function(e,t,n){return D.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){D.globalEval(e,t,n)}})},D.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=D(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return v(e)?this.each(function(t){D(this).wrapInner(e.call(this,t))}):this.each(function(){var t=D(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v(e);return this.each(function(n){D(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){D(this).replaceWith(this.childNodes)}),this}}),D.expr.pseudos.hidden=function(e){return!D.expr.pseudos.visible(e)},D.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},D.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Xt={0:200,1223:204},Jt=D.ajaxSettings.xhr();m.cors=!!Jt&&"withCredentials"in Jt,m.ajax=Jt=!!Jt,D.ajaxTransport(function(e){var t,n;if(m.cors||Jt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Xt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout(function(){t&&n()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),D.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),D.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 D.globalEval(e),e}}}),D.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),D.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=D("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),_.head.appendChild(t[0])},abort:function(){n&&n()}}});var en,tn=[],nn=/(=)\?(?=&|$)|\?\?/;D.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tn.pop()||D.expando+"_"+Tt.guid++;return this[e]=!0,e}}),D.ajaxPrefilter("json jsonp",function(e,t,n){var i,o,a,s=!1!==e.jsonp&&(nn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(nn,"$1"+i):!1!==e.jsonp&&(e.url+=(jt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||D.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=r[i],r[i]=function(){a=arguments},n.always(function(){void 0===o?D(r).removeProp(i):r[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,tn.push(i)),a&&v(o)&&o(a[0]),a=o=void 0}),"script"}),m.createHTMLDocument=((en=_.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===en.childNodes.length),D.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?((r=(t=_.implementation.createHTMLDocument("")).createElement("base")).href=_.location.href,t.head.appendChild(r)):t=_),o=!n&&[],(i=P.exec(e))?[t.createElement(i[1])]:(i=Ne([e],t,o),o&&o.length&&D(o).remove(),D.merge([],i.childNodes)));var r,i,o},D.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=Dt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&D.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?D("<div>").append(D.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},D.expr.pseudos.animated=function(e){return D.grep(D.timers,function(t){return e===t.elem}).length},D.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=D.css(e,"position"),c=D(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=D.css(e,"top"),l=D.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),v(t)&&(t=t.call(e,n,D.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},D.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){D.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===D.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===D.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=D(e).offset()).top+=D.css(e,"borderTopWidth",!0),i.left+=D.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-D.css(r,"marginTop",!0),left:t.left-i.left-D.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===D.css(e,"position");)e=e.offsetParent;return e||ge})}}),D.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;D.fn[e]=function(r){return ee(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),D.each(["top","left"],function(e,t){D.cssHooks[t]=et(m.pixelPosition,function(e,n){if(n)return n=Je(e,t),Ye.test(n)?D(e).position()[t]+"px":n})}),D.each({Height:"height",Width:"width"},function(e,t){D.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){D.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return ee(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]: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?D.css(t,n,s):D.style(t,n,i,s)},t,a?i:void 0,a)}})}),D.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){D.fn[t]=function(e){return this.on(t,e)}}),D.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,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),D.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){D.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;D.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=s.call(arguments,2),i=function(){return e.apply(t||this,r.concat(s.call(arguments)))},i.guid=e.guid=e.guid||D.guid++,i},D.holdReady=function(e){e?D.readyWait++:D.ready(!0)},D.isArray=Array.isArray,D.parseJSON=JSON.parse,D.nodeName=A,D.isFunction=v,D.isWindow=y,D.camelCase=ie,D.type=x,D.now=Date.now,D.isNumeric=function(e){var t=D.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},D.trim=function(e){return null==e?"":(e+"").replace(rn,"$1")},void 0===(n=function(){return D}.apply(t,[]))||(e.exports=n);var on=r.jQuery,an=r.$;return D.noConflict=function(e){return r.$===D&&(r.$=an),e&&r.jQuery===D&&(r.jQuery=on),D},void 0===i&&(r.jQuery=r.$=D),D})},4417:function(e,t,n){e.exports=n(2217)},2217:function(e,t,n){"use strict";var r=n(8319);r.default;var i=n(2888);i.default;var o=n(707);o.default;var a=n(9017);a.default;var s=n(6293);s.default;var l=n(68);l.default;var u=n(6433);u.default;var c=n(5202);c.default;var d=n(5896);d.default;var f=n(9102);f.default;var p=n(5745);p.default;var h=n(7658);h.default;var g=n(6509);g.default;var m=n(9278);m.default;var v=n(4703);v.default;var y={toCamelCase:r.default,toSnakeCase:i.default,toPascalCase:o.default,toDotCase:a.default,toPathCase:s.default,toTextCase:l.default,toSentenceCase:u.default,toHeaderCase:c.default,toKebabCase:d.default,toUpperCase:function(e){return String(e||"").toUpperCase()},toLowerCase:function(e){return String(e||"").toLowerCase()},lowerKeys:f.default,upperKeys:p.default,camelKeys:h.default,snakeKeys:g.default,pascalKeys:m.default,kebabKeys:v.default};t.default=y},7658:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(8319);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},4703:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(5896);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},9102:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var o={};return Object.keys(t).forEach(function(a){var s=t[a],l=a.toLowerCase();n.recursive&&(i.isValidObject(s)?i.belongToTypes(s,n.keepTypesOnRecursion)||(s=e(s,n)):n.recursiveInArray&&i.isArrayObject(s)&&(s=r(s).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),o[l]=s}),o}},9278:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(707);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},6509:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(2888);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},5745:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var o={};return Object.keys(t).forEach(function(a){var s=t[a],l=a.toUpperCase();n.recursive&&(i.isValidObject(s)?i.belongToTypes(s,n.keepTypesOnRecursion)||(s=e(s,n)):n.recursiveInArray&&i.isArrayObject(s)&&(s=r(s).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),o[l]=s}),o}},5920:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.belongToTypes=t.isValidObject=t.isArrayObject=t.validateOptions=t.DefaultOption=void 0,t.DefaultOption={recursive:!1,recursiveInArray:!1,keepTypesOnRecursion:[]},t.validateOptions=function(e){return void 0===e&&(e=t.DefaultOption),null==e.recursive?e=t.DefaultOption:null==e.recursiveInArray&&(e.recursiveInArray=!1),e},t.isArrayObject=function(e){return null!=e&&Array.isArray(e)},t.isValidObject=function(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)},t.belongToTypes=function(e,t){return(t||[]).some(function(t){return e instanceof t})}},8319:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"$"+n}).toLowerCase().replace(/(\$)(\w)/g,function(e,t,n){return n.toUpperCase()}):""}},9017:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,".").toLowerCase():""}},5202:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase().replace(/( ?)(\w+)( ?)/g,function(e,t,n,r){return t+n.charAt(0).toUpperCase()+n.slice(1)+r}):""}},5896:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"-").toLowerCase():""}},707:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"$").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"$"+n}).toLowerCase().replace(/(\$)(\w?)/g,function(e,t,n){return n.toUpperCase()}):""}},6293:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"/").toLowerCase():""}},6433:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(void 0===e&&(e=""),!e)return"";var t=String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}},2888:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"_").toLowerCase():""}},68:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase():""}},6107:function(e,t,n){"use strict";n.r(t),n.d(t,{jsPanel:function(){return r}});let r={version:"4.16.1",date:"2022-11-03 09:18",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||r.getPanels(e=>e.classList.contains("jsPanel")).some(e=>!!e.options.closeOnEscape&&("function"==typeof e.options.closeOnEscape?e.options.closeOnEscape.call(e,e):(e.close(null,!0),!0)))},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M13.7,11l6.1-6.1c0.4-0.4,0.4-0.9,0-1.3l-1.4-1.4c-0.4-0.4-0.9-0.4-1.3,0L11,8.3L4.9,2.3C4.6,1.9,4,1.9,3.7,2.3L2.3,3.7 C1.9,4,1.9,4.6,2.3,4.9L8.3,11l-6.1,6.1c-0.4,0.4-0.4,0.9,0,1.3l1.4,1.4c0.4,0.4,0.9,0.4,1.3,0l6.1-6.1l6.1,6.1 c0.4,0.4,0.9,0.4,1.3,0l1.4-1.4c0.4-0.4,0.4-0.9,0-1.3L13.7,11z"/></svg>',maximize:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M18.3,2H3.7C2.8,2,2,2.9,2,3.9v14.1C2,19.1,2.8,20,3.7,20h14.6c0.9,0,1.7-0.9,1.7-1.9V3.9C20,2.9,19.2,2,18.3,2z M18.3,17.8 c0,0.1-0.1,0.2-0.2,0.2H3.9c-0.1,0-0.2-0.1-0.2-0.2V8.4h14.6V17.8z"/></svg>',normalize:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M18.3,2H7.1C6.1,2,5.4,2.8,5.4,3.7v1.7H3.7C2.8,5.4,2,6.1,2,7.1v11.3C2,19.2,2.8,20,3.7,20h11.3c0.9,0,1.7-0.8,1.7-1.7v-1.7 h1.7c0.9,0,1.7-0.8,1.7-1.7V3.7C20,2.8,19.2,2,18.3,2z M14.9,18.3H3.7V11h11.3V18.3z M18.3,14.9h-1.7V7.1c0-0.9-0.8-1.7-1.7-1.7H7.1 V3.7h11.3V14.9z"/></svg>',minimize:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M18.9,19.8H3.1c-0.6,0-1.1-0.5-1.1-1.1s0.5-1.1,1.1-1.1h15.8c0.6,0,1.1,0.5,1.1,1.1S19.5,19.8,18.9,19.8z"/></svg>',smallify:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M2.1,15.2L2.9,16c0.2,0.2,0.5,0.2,0.7,0L11,8.7l7.4,7.3c0.2,0.2,0.5,0.2,0.7,0l0.8-0.8c0.2-0.2,0.2-0.5,0-0.7L11.3,6 c-0.2-0.2-0.5-0.2-0.7,0l-8.5,8.5C2,14.7,2,15,2.1,15.2z"/></svg>'},idCounter:0,isIE:document.documentMode||!1,pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e<arguments.length;e++){let n=arguments[e];if(null==n)continue;n=Object(n);let r=Object.keys(Object(n));for(let e=0,i=r.length;e<i;e++){let i=r[e],o=Object.getOwnPropertyDescriptor(n,i);void 0!==o&&o.enumerable&&(t[i]=n[i])}}return t}}),Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(let n=0;n<this.length;n++)e.call(t,this[n],n,this)}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.append=e.append||function(){let e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach(function(e){let n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))}),this.appendChild(t)}}),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){let t,n=(this.document||this.ownerDocument).querySelectorAll(e),r=this;do{for(t=n.length;--t>=0&&n.item(t)!==r;);}while(t<0&&(r=r.parentElement));return r}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return(void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var n=t>0?0|t:0;return this.substring(n,n+e.length)===e}}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)}),String.prototype.repeat||(String.prototype.repeat=function(e){if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return"";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");var n=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,n-t.length)}),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');let n=Object(this),r=n.length>>>0;if(0===r)return!1;let i=0|t,o=Math.max(i>=0?i:r-Math.abs(i),0);for(;o<r;){if((a=n[o])===(s=e)||"number"==typeof a&&"number"==typeof s&&isNaN(a)&&isNaN(s))return!0;o++}var a,s;return!1}}))),ziBase:100,colorFilledLight:.81,colorFilledDark:.08,colorFilled:0,colorBrightnessThreshold:.55,colorNames:{default:"b0bec5",secondary:"b0bec5",primary:"01579b",info:"039be5",success:"2e7d32",warning:"f57f17",danger:"dd2c00",light:"e0e0e0",dark:"263238",aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",grey50:"fafafa",grey100:"f5f5f5",grey200:"eeeeee",grey300:"e0e0e0",grey400:"bdbdbd",grey500:"9e9e9e",grey600:"757575",grey700:"616161",grey800:"424242",grey900:"212121",gray50:"fafafa",gray100:"f5f5f5",gray200:"eeeeee",gray300:"e0e0e0",gray400:"bdbdbd",gray500:"9e9e9e",gray600:"757575",gray700:"616161",gray800:"424242",gray900:"212121",bluegrey50:"eceff1",bluegrey100:"CFD8DC",bluegrey200:"B0BEC5",bluegrey300:"90A4AE",bluegrey400:"78909C",bluegrey500:"607D8B",bluegrey600:"546E7A",bluegrey700:"455A64",bluegrey800:"37474F",bluegrey900:"263238",bluegray50:"eceff1",bluegray100:"CFD8DC",bluegray200:"B0BEC5",bluegray300:"90A4AE",bluegray400:"78909C",bluegray500:"607D8B",bluegray600:"546E7A",bluegray700:"455A64",bluegray800:"37474F",bluegray900:"263238",red50:"FFEBEE",red100:"FFCDD2",red200:"EF9A9A",red300:"E57373",red400:"EF5350",red500:"F44336",red600:"E53935",red700:"D32F2F",red800:"C62828",red900:"B71C1C",reda100:"FF8A80",reda200:"FF5252",reda400:"FF1744",reda700:"D50000",pink50:"FCE4EC",pink100:"F8BBD0",pink200:"F48FB1",pink300:"F06292",pink400:"EC407A",pink500:"E91E63",pink600:"D81B60",pink700:"C2185B",pink800:"AD1457",pink900:"880E4F",pinka100:"FF80AB",pinka200:"FF4081",pinka400:"F50057",pinka700:"C51162",purple50:"F3E5F5",purple100:"E1BEE7",purple200:"CE93D8",purple300:"BA68C8",purple400:"AB47BC",purple500:"9C27B0",purple600:"8E24AA",purple700:"7B1FA2",purple800:"6A1B9A",purple900:"4A148C",purplea100:"EA80FC",purplea200:"E040FB",purplea400:"D500F9",purplea700:"AA00FF",deeppurple50:"EDE7F6",deeppurple100:"D1C4E9",deeppurple200:"B39DDB",deeppurple300:"9575CD",deeppurple400:"7E57C2",deeppurple500:"673AB7",deeppurple600:"5E35B1",deeppurple700:"512DA8",deeppurple800:"4527A0",deeppurple900:"311B92",deeppurplea100:"B388FF",deeppurplea200:"7C4DFF",deeppurplea400:"651FFF",deeppurplea700:"6200EA",indigo50:"E8EAF6",indigo100:"C5CAE9",indigo200:"9FA8DA",indigo300:"7986CB",indigo400:"5C6BC0",indigo500:"3F51B5",indigo600:"3949AB",indigo700:"303F9F",indigo800:"283593",indigo900:"1A237E",indigoa100:"8C9EFF",indigoa200:"536DFE",indigoa400:"3D5AFE",indigoa700:"304FFE",blue50:"E3F2FD",blue100:"BBDEFB",blue200:"90CAF9",blue300:"64B5F6",blue400:"42A5F5",blue500:"2196F3",blue600:"1E88E5",blue700:"1976D2",blue800:"1565C0",blue900:"0D47A1",bluea100:"82B1FF",bluea200:"448AFF",bluea400:"2979FF",bluea700:"2962FF",lightblue50:"E1F5FE",lightblue100:"B3E5FC",lightblue200:"81D4FA",lightblue300:"4FC3F7",lightblue400:"29B6F6",lightblue500:"03A9F4",lightblue600:"039BE5",lightblue700:"0288D1",lightblue800:"0277BD",lightblue900:"01579B",lightbluea100:"80D8FF",lightbluea200:"40C4FF",lightbluea400:"00B0FF",lightbluea700:"0091EA",cyan50:"E0F7FA",cyan100:"B2EBF2",cyan200:"80DEEA",cyan300:"4DD0E1",cyan400:"26C6DA",cyan500:"00BCD4",cyan600:"00ACC1",cyan700:"0097A7",cyan800:"00838F",cyan900:"006064",cyana100:"84FFFF",cyana200:"18FFFF",cyana400:"00E5FF",cyana700:"00B8D4",teal50:"E0F2F1",teal100:"B2DFDB",teal200:"80CBC4",teal300:"4DB6AC",teal400:"26A69A",teal500:"009688",teal600:"00897B",teal700:"00796B",teal800:"00695C",teal900:"004D40",teala100:"A7FFEB",teala200:"64FFDA",teala400:"1DE9B6",teala700:"00BFA5",green50:"E8F5E9",green100:"C8E6C9",green200:"A5D6A7",green300:"81C784",green400:"66BB6A",green500:"4CAF50",green600:"43A047",green700:"388E3C",green800:"2E7D32",green900:"1B5E20",greena100:"B9F6CA",greena200:"69F0AE",greena400:"00E676",greena700:"00C853",lightgreen50:"F1F8E9",lightgreen100:"DCEDC8",lightgreen200:"C5E1A5",lightgreen300:"AED581",lightgreen400:"9CCC65",lightgreen500:"8BC34A",lightgreen600:"7CB342",lightgreen700:"689F38",lightgreen800:"558B2F",lightgreen900:"33691E",lightgreena100:"CCFF90",lightgreena200:"B2FF59",lightgreena400:"76FF03",lightgreena700:"64DD17",lime50:"F9FBE7",lime100:"F0F4C3",lime200:"E6EE9C",lime300:"DCE775",lime400:"D4E157",lime500:"CDDC39",lime600:"C0CA33",lime700:"AFB42B",lime800:"9E9D24",lime900:"827717",limea100:"F4FF81",limea200:"EEFF41",limea400:"C6FF00",limea700:"AEEA00",yellow50:"FFFDE7",yellow100:"FFF9C4",yellow200:"FFF59D",yellow300:"FFF176",yellow400:"FFEE58",yellow500:"FFEB3B",yellow600:"FDD835",yellow700:"FBC02D",yellow800:"F9A825",yellow900:"F57F17",yellowa100:"FFFF8D",yellowa200:"FFFF00",yellowa400:"FFEA00",yellowa700:"FFD600",amber50:"FFF8E1",amber100:"FFECB3",amber200:"FFE082",amber300:"FFD54F",amber400:"FFCA28",amber500:"FFC107",amber600:"FFB300",amber700:"FFA000",amber800:"FF8F00",amber900:"FF6F00",ambera100:"FFE57F",ambera200:"FFD740",ambera400:"FFC400",ambera700:"FFAB00",orange50:"FFF3E0",orange100:"FFE0B2",orange200:"FFCC80",orange300:"FFB74D",orange400:"FFA726",orange500:"FF9800",orange600:"FB8C00",orange700:"F57C00",orange800:"EF6C00",orange900:"E65100",orangea100:"FFD180",orangea200:"FFAB40",orangea400:"FF9100",orangea700:"FF6D00",deeporange50:"FBE9E7",deeporange100:"FFCCBC",deeporange200:"FFAB91",deeporange300:"FF8A65",deeporange400:"FF7043",deeporange500:"FF5722",deeporange600:"F4511E",deeporange700:"E64A19",deeporange800:"D84315",deeporange900:"BF360C",deeporangea100:"FF9E80",deeporangea200:"FF6E40",deeporangea400:"FF3D00",deeporangea700:"DD2C00",brown50:"EFEBE9",brown100:"D7CCC8",brown200:"BCAAA4",brown300:"A1887F",brown400:"8D6E63",brown500:"795548",brown600:"6D4C41",brown700:"5D4037",brown800:"4E342E",brown900:"3E2723","mdb-default":"2BBBAD","mdb-default-dark":"00695c","mdb-primary":"4285F4","mdb-primary-dark":"0d47a1","mdb-secondary":"aa66cc","mdb-secondary-dark":"9933CC","mdb-danger":"ff4444","mdb-danger-dark":"CC0000","mdb-warning":"ffbb33","mdb-warning-dark":"FF8800","mdb-success":"00C851","mdb-success-dark":"007E33","mdb-info":"33b5e5","mdb-info-dark":"0099CC","mdb-elegant":"2E2E2E","mdb-elegant-dark":"212121","mdb-stylish":"4B515D","mdb-stylish-dark":"3E4551","mdb-unique":"3F729B","mdb-unique-dark":"1C2331","mdb-special":"37474F","mdb-special-dark":"263238"},errorReporting:1,modifier:!1,helper:(document.addEventListener("keydown",e=>r.modifier=e),void document.addEventListener("keyup",()=>r.modifier=!1)),usePointerEvents(e=!0){e?(this.pointerdown="onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"]):(this.pointerdown="ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="ontouchend"in window?["touchend","mouseup"]:["mouseup"])},pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return!!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return[t,t,t,t];if(Array.isArray(t)){if(1===t.length)return[t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1])}return t},pOsize(e,t){let n=t||this.defaults.contentSize;const r=e.parentElement;if("string"==typeof n){const e=n.trim().split(" ");(n={}).width=e[0],2===e.length?n.height=e[1]:n.height=e[0]}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[\d.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(r===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else{const e=window.getComputedStyle(r),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);n.width=(parseFloat(e.width)-t)*(parseFloat(n.width)/100)+"px"}else"function"==typeof n.width&&(n.width=n.width.call(e,e),("number"==typeof n.width||"string"==typeof n.width&&n.width.match(/^[\d.]+$/gi))&&(n.width+="px"));if(String(n.height).match(/^[\d.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(r===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else{const e=window.getComputedStyle(r),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);n.height=(parseFloat(e.height)-t)*(parseFloat(n.height)/100)+"px"}else"function"==typeof n.height&&(n.height=n.height.call(e,e),("number"==typeof n.height||"string"==typeof n.height&&n.height.match(/^[\d.]+$/gi))&&(n.height+="px"));return n},pOborder(e){let t=[],n=e.trim().replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," ").split(" ");return n.forEach((e,t)=>{(e.startsWith("--")||e.startsWith("var"))&&(n[t]=r.getCssVariableValue(e))}),n.forEach(e=>{r.colorNames[e]?t[2]="#"+r.colorNames[e]:e.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)/)?t[1]=e:e.match(/(thin|medium|thick)|(\d*\.?\d*(cap|ch|em|ex|ic|lh|rem|rlh|vh|vw|vmax|vmin|vb|vi|px|cm|mm|Q|in|pc|pt))/)?t[0]=e:t[2]=e}),t[0]||(t[0]="medium"),t[1]||(t[1]="solid"),t[2]||(t[2]=""),t},pOheaderControls(e){if("string"==typeof e){let t={},n=e.toLowerCase(),r=n.match(/xl|lg|md|sm|xs/),i=n.match(/closeonly|none/);return r&&(t.size=r[0]),i&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===i[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},pOtheme(e){let t,n="";if((e=e.trim()).match(/^(rgb|hsl|var)/)){let i=e.indexOf(")");(t=e.slice(0,i+1).replace(/\s+/g,"")).startsWith("var")&&(t=r.getCssVariableValue(t)),n=e.slice(i+1,e.length).trim()}else if(e.match(/^(#|\w|--)/)){let i=e.indexOf(" ");i>0?(t=e.slice(0,i+1).replace(/\s+/g,""),n=e.slice(i+1,e.length).trim()):t=e,t.startsWith("--")&&(t=r.getCssVariableValue(t))}if(t.match(/^([\da-f]{3}|[\da-f]{6})$/gi)&&(t="#"+t),n.startsWith("fillcolor")){let e=n.indexOf(" ");n=(n=n.slice(e+1,n.length).trim().replace(/\s+/g,"")).match(/^([\da-f]{3}|[\da-f]{6})$/gi)?"#"+n:r.colorNames[n]?"#"+r.colorNames[n]:n.match(/^(--|var)/)?r.getCssVariableValue(n):"#fff"}return{color:t,colors:!1,filling:n}},color(e){let t,n,r,i,o,a,s,l,u,c=e.toLowerCase(),d={};const f=/^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3}),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,p=/^hsla?\((\d{1,3}),(\d{1,3}%),(\d{1,3}%),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,h=this.colorNames;return h[c]&&(c=h[c]),null!==c.match(/^#?([\da-f]{3}|[\da-f]{6})$/gi)?((c=c.replace("#","")).length%2==1?(t=c.slice(0,1).repeat(2),n=c.slice(1,2).repeat(2),r=c.slice(2,3).repeat(2),d.rgb={r:parseInt(t,16),g:parseInt(n,16),b:parseInt(r,16)},d.hex=`#${t}${n}${r}`):(d.rgb={r:parseInt(c.slice(0,2),16),g:parseInt(c.slice(2,4),16),b:parseInt(c.slice(4,6),16)},d.hex=`#${c}`),u=this.rgbToHsl(d.rgb.r,d.rgb.g,d.rgb.b),d.hsl=u,d.rgb.css=`rgb(${d.rgb.r},${d.rgb.g},${d.rgb.b})`):c.match(f)?(s=f.exec(c),d.rgb={css:c,r:s[1],g:s[2],b:s[3]},d.hex=this.rgbToHex(s[1],s[2],s[3]),u=this.rgbToHsl(s[1],s[2],s[3]),d.hsl=u):c.match(p)?(i=(s=p.exec(c))[1]/360,o=s[2].slice(0,s[2].length-1)/100,a=s[3].slice(0,s[3].length-1)/100,l=this.hslToRgb(i,o,a),d.rgb={css:`rgb(${l[0]},${l[1]},${l[2]})`,r:l[0],g:l[1],b:l[2]},d.hex=this.rgbToHex(d.rgb.r,d.rgb.g,d.rgb.b),d.hsl={css:`hsl(${s[1]},${s[2]},${s[3]})`,h:s[1],s:s[2],l:s[3]}):(d.hex="#f5f5f5",d.rgb={css:"rgb(245,245,245)",r:245,g:245,b:245},d.hsl={css:"hsl(0,0%,96%)",h:0,s:"0%",l:"96%"}),d},calcColors(e){const t=this.colorBrightnessThreshold,n=this.color(e),r=this.lighten(e,this.colorFilledLight),i=this.darken(e,this.colorFilled),o=this.perceivedBrightness(e)<=t?"#ffffff":"#000000",a=this.perceivedBrightness(r)<=t?"#ffffff":"#000000",s=this.perceivedBrightness(i)<=t?"#ffffff":"#000000",l=this.lighten(e,this.colorFilledDark),u=this.perceivedBrightness(l)<=t?"#ffffff":"#000000";return[n.hsl.css,r,i,o,a,s,l,u]},darken(e,t){const n=this.color(e).hsl,r=parseFloat(n.l),i=Math.round(r-r*t)+"%";return`hsl(${n.h},${n.s},${i})`},lighten(e,t){const n=this.color(e).hsl,r=parseFloat(n.l),i=Math.round(r+(100-r)*t)+"%";return`hsl(${n.h},${n.s},${i})`},hslToRgb(e,t,n){let r,i,o;if(0===t)r=i=o=n;else{let a=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),i=a(l,s,e),o=a(l,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*o)]},rgbToHsl(e,t,n){e/=255,t/=255,n/=255;let r,i,o=Math.max(e,t,n),a=Math.min(e,t,n),s=(o+a)/2;if(o===a)r=i=0;else{let l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{css:"hsl("+(r=Math.round(360*r))+","+(i=Math.round(100*i)+"%")+","+(s=Math.round(100*s)+"%")+")",h:r,s:i,l:s}},rgbToHex(e,t,n){let r=Number(e).toString(16),i=Number(t).toString(16),o=Number(n).toString(16);return 1===r.length&&(r=`0${r}`),1===i.length&&(i=`0${i}`),1===o.length&&(o=`0${o}`),`#${r}${i}${o}`},perceivedBrightness(e){const t=this.color(e).rgb;return t.r/255*.2126+t.g/255*.7152+t.b/255*.0722},pOposition(e){let t={},n=e.trim().split(/\s+/),r=n.filter(e=>e.match(/^(down|right|up|left)$/i));r.length&&(t.autoposition=r[0],n.splice(n.indexOf(r[0]),1));let i=n.filter(e=>e.match(/^(left-|right-)(top|center|bottom)$|(^center-)(top|bottom)$|(^center$)/i));i.length?(t.my=i[0],t.at=i[1]||i[0],n.splice(n.indexOf(i[0]),1),i[1]&&n.splice(n.indexOf(i[1]),1)):(t.my="center",t.at="center");let o=n.filter(e=>e.match(/^[+-]?\d*\.?\d+[a-z%]*$/i));return o.length&&(t.offsetX=o[0].match(/^[+-]?\d*\.?\d+$/i)?`${o[0]}px`:o[0],o[1]?t.offsetY=o[1].match(/^[+-]?\d*\.?\d+$/i)?`${o[1]}px`:o[1]:t.offsetY=t.offsetX,n.splice(n.indexOf(o[0]),1),o[1]&&n.splice(n.indexOf(o[1]),1)),n.length&&(t.of=n.join(" ")),t},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(n=>{"function"==typeof t[n]&&(t[n]=t[n].call(e,e))}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const n="window"===e.options.container?"window":e.parentElement,r=e.getBoundingClientRect(),i=e.parentElement.getBoundingClientRect(),o="window"===n?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:i.width,height:i.height,left:i.left,top:i.top},a="window"===n?{x:1,y:1}:{x:o.width/n.offsetWidth,y:o.height/n.offsetHeight},s="window"===n?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(n);let l;o.width-=(parseFloat(s.borderLeftWidth)+parseFloat(s.borderRightWidth))*a.x,o.height-=(parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth))*a.y,l=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():o;let u=this.getScrollbarWidth(document.body),c=this.getScrollbarWidth(e.parentElement),d="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+l.width/2+"px":o.width/2+"px":t.at.startsWith("right-")&&(d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+l.width+"px":o.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-r.width/2+"px":-r.width/2+"px":t.at.startsWith("center")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-(r.width-l.width)/2+"px":o.width/2-r.width/2+"px":t.at.startsWith("right-")&&(d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+(l.width-r.width/2)+"px":o.width-r.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-r.width+"px":-r.width+"px":t.at.startsWith("center")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-r.width+l.width/2+"px":o.width/2-r.width+"px":t.at.startsWith("right-")&&(d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+l.width-r.width+"px":o.width-r.width+"px","window"!==n&&(d=parseFloat(d)-c.y+"px")));let f="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)+"px":"0px":t.at.endsWith("center")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)+l.height/2+"px":o.height/2+"px":t.at.endsWith("-bottom")&&(f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)+l.height+"px":o.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height/2+"px":-r.height/2+"px":t.at.endsWith("center")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height/2+l.height/2+"px":o.height/2-r.height/2+"px":t.at.endsWith("-bottom")&&(f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height/2+l.height+"px":o.height-r.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height+"px":-r.height+"px":t.at.endsWith("center")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height+l.height/2+"px":o.height/2-r.height+"px":t.at.endsWith("-bottom")&&(f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height+l.height+"px":o.height-r.height+"px",f="window"!==n?parseFloat(f)-c.x+"px":parseFloat(f)-u.x+"px")),e.style.left=1===a.x?d:parseFloat(d)/a.x+"px",e.style.top=1===a.y?f:parseFloat(f)/a.y+"px";let p=getComputedStyle(e),h={left:p.left,top:p.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(h=this.applyPositionAutopos(e,h,t)),(t.offsetX||t.offsetY)&&(h=this.applyPositionOffset(e,h,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(h=this.applyPositionMinMax(e,h,t)),t.modify&&(h=this.applyPositionModify(e,h,t)),"number"==typeof e.options.opacity?e.style.opacity=e.options.opacity:e.style.opacity=1,e},applyPositionAutopos(e,t,n){const i=`${n.my}-${n.autoposition.toLowerCase()}`;e.classList.add(i);const o=Array.prototype.slice.call(document.querySelectorAll(`.${i}`)),a=o.indexOf(e);if(o.length>1){switch(n.autoposition){case"down":o.forEach((e,n)=>{n>0&&n<=a&&(t.top=parseFloat(t.top)+o[--n].getBoundingClientRect().height+r.autopositionSpacing+"px")});break;case"up":o.forEach((e,n)=>{n>0&&n<=a&&(t.top=parseFloat(t.top)-o[--n].getBoundingClientRect().height-r.autopositionSpacing+"px")});break;case"right":o.forEach((e,n)=>{n>0&&n<=a&&(t.left=parseFloat(t.left)+o[--n].getBoundingClientRect().width+r.autopositionSpacing+"px")});break;case"left":o.forEach((e,n)=>{n>0&&n<=a&&(t.left=parseFloat(t.left)-o[--n].getBoundingClientRect().width-r.autopositionSpacing+"px")})}e.style.left=t.left,e.style.top=t.top}return{left:t.left,top:t.top}},applyPositionOffset(e,t,n){["offsetX","offsetY"].forEach(e=>{n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]=`${n[e]}px`)):n[e]="0px"}),e.style.left=`calc(${e.style.left} + ${n.offsetX})`,e.style.top=`calc(${e.style.top} + ${n.offsetY})`;const r=getComputedStyle(e);return{left:r.left,top:r.top}},applyPositionMinMax(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]=`${n[e]}px`))}),n.minLeft){e.style.left=n.minLeft;let r=getComputedStyle(e).left;parseFloat(r)<parseFloat(t.left)?e.style.left=t.left:t.left=r}if(n.minTop){e.style.top=n.minTop;let r=getComputedStyle(e).top;parseFloat(r)<parseFloat(t.top)?e.style.top=t.top:t.top=r}if(n.maxLeft){e.style.left=n.maxLeft;let r=getComputedStyle(e).left;parseFloat(r)>parseFloat(t.left)?e.style.left=t.left:t.left=r}if(n.maxTop){e.style.top=n.maxTop;let r=getComputedStyle(e).top;parseFloat(r)>parseFloat(t.top)?e.style.top=t.top:t.top=r}const r=getComputedStyle(e);return{left:r.left,top:r.top}},applyPositionModify(e,t,n){if(n.modify&&"function"==typeof n.modify){const r=n.modify.call(t,t,n);e.style.left=Number.isInteger(r.left)||r.left.match(/^\d+$/)?`${r.left}px`:r.left,e.style.top=Number.isInteger(r.top)||r.top.match(/^\d+$/)?`${r.top}px`:r.top}const r=getComputedStyle(e);return{left:r.left,top:r.top}},autopositionRemaining(e){let t,n=e.options.container;["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(n=>{e.classList.contains(n)&&(t=n)}),t&&("window"===n?document.body:"string"==typeof n?document.querySelector(n):n).querySelectorAll(`.${t}`).forEach(e=>e.reposition())},getThemeDetails(e){const t=this.pOtheme(e);if(t.color.startsWith("bootstrap-")){let e=t.color.indexOf("-"),n=document.createElement("button");n.className="btn btn"+t.color.slice(e),document.body.appendChild(n),t.color=getComputedStyle(n).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(n),n=void 0}return t.colors=this.calcColors(t.color),t},clearTheme(e,t){return e.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),e.header.classList.remove("jsPanel-hdr-light"),e.header.classList.remove("jsPanel-hdr-dark"),e.style.backgroundColor="",this.setStyles(e.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),this.setStyles(e.content,{background:"",borderTopColor:"transparent"}),e.header.style.background="",Array.prototype.slice.call(e.controlbar.querySelectorAll(".jsPanel-icon")).concat([e.headerlogo,e.headertitle,e.headertoolbar,e.content]).forEach(e=>e.style.color=""),t&&t.call(e,e),e},applyColorTheme(e,t){if(e.style.backgroundColor=t.colors[0],e.header.style.backgroundColor=t.colors[0],e.header.style.color=t.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(n=>e.querySelector(n).style.color=t.colors[3]),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=t.colors[3]),"string"==typeof e.options.theme&&"filled"===t.filling&&(e.content.style.borderTop="#000000"===t.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===t.colors[3]?e.header.classList.add("jsPanel-hdr-light"):e.header.classList.add("jsPanel-hdr-dark"),t.filling)switch(t.filling){case"filled":this.setStyles(e.content,{backgroundColor:t.colors[2],color:t.colors[3]});break;case"filledlight":e.content.style.backgroundColor=t.colors[1];break;case"filleddark":this.setStyles(e.content,{backgroundColor:t.colors[6],color:t.colors[7]});break;default:e.content.style.backgroundColor=t.filling,e.content.style.color=this.perceivedBrightness(t.filling)<=this.colorBrightnessThreshold?"#fff":"#000"}return e},applyCustomTheme(e,t){let n={bgPanel:"#ffffff",bgContent:"#ffffff",bgFooter:"#f5f5f5",colorHeader:"#000000",colorContent:"#000000",colorFooter:"#000000",border:void 0,borderRadius:void 0},r="object"==typeof t?Object.assign(n,t):n,i=r.bgPanel,o=r.bgContent,a=r.colorHeader,s=r.colorContent,l=r.bgFooter,u=r.colorFooter;return this.colorNames[i]?e.style.background="#"+this.colorNames[i]:e.style.background=this.getCssVariableValue(i),this.colorNames[a]&&(a="#"+this.colorNames[a]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>e.querySelector(t).style.color=this.getCssVariableValue(a)),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=this.getCssVariableValue(a)),this.colorNames[o]?e.content.style.background="#"+this.colorNames[o]:e.content.style.background=this.getCssVariableValue(o),this.colorNames[s]?e.content.style.color="#"+this.colorNames[s]:e.content.style.color=this.getCssVariableValue(s),this.perceivedBrightness(a)>this.colorBrightnessThreshold?e.header.classList.add("jsPanel-hdr-dark"):e.header.classList.add("jsPanel-hdr-light"),this.perceivedBrightness(s)>this.colorBrightnessThreshold?e.content.style.borderTop="1px solid rgba(255,255,255,0.15)":e.content.style.borderTop="1px solid rgba(0,0,0,0.15)",this.colorNames[l]?e.footer.style.background="#"+this.colorNames[l]:e.footer.style.background=this.getCssVariableValue(l),this.colorNames[u]?e.footer.style.color="#"+this.colorNames[u]:e.footer.style.color=this.getCssVariableValue(u),r.border&&e.setBorder(r.border),r.borderRadius&&(e.options.borderRadius=void 0,e.setBorderRadius(r.borderRadius)),e},getCssVariableValue(e){if(e.startsWith("--"))return getComputedStyle(document.documentElement).getPropertyValue(e).replace(/\s+/g,"");if(e.startsWith("var")){let t=e.slice(e.indexOf("(")+1,e.indexOf(")"));return getComputedStyle(document.documentElement).getPropertyValue(t).replace(/\s+/g,"")}return e},getScrollbarWidth(e=document.body){if(e===document.body)return{y:window.innerWidth-document.documentElement.clientWidth,x:window.innerHeight-document.documentElement.clientHeight};{let t=getComputedStyle(e);return{y:e.offsetWidth-e.clientWidth-parseFloat(t.borderRightWidth)-parseFloat(t.borderLeftWidth),x:e.offsetHeight-e.clientHeight-parseFloat(t.borderBottomWidth)-parseFloat(t.borderTopWidth)}}},remClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.remove(t)),e),setClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(const[n,i]of Object.entries(t))e.style[n]="string"==typeof i?r.getCssVariableValue(i):i;return e},setStyle(e,t){return this.setStyles.call(e,e,t)},strToHtml:e=>document.createRange().createContextualFragment(e),toggleClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)),e),emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},addScript(e,t="application/javascript",n){if(!document.querySelector(`script[src="${e}"]`)){const r=document.createElement("script");r.src=e,r.type=t,document.head.appendChild(r),n&&(r.onload=n)}},ajax(e,t){let n,i,o=new XMLHttpRequest;const a={method:"GET",async:!0,user:"",pwd:"",done:function(){if(t){let e=r.strToHtml(this.responseText);n.urlSelector&&(e=e.querySelector(n.urlSelector)),t.contentRemove(),t.content.append(e)}},autoresize:!0,autoreposition:!0};if(t&&"string"==typeof e)n=Object.assign({},a,{url:e});else{if("object"!=typeof e||!e.url){if(this.errorReporting){let e="XMLHttpRequest seems to miss the <mark>url</mark> parameter!";r.errorpanel(e)}return}(n=Object.assign({},a,e)).url=e.url,!1===n.async&&(n.timeout=0,n.withCredentials&&(n.withCredentials=void 0),n.responseType&&(n.responseType=void 0))}i=n.url.trim().split(/\s+/),n.url=encodeURI(i[0]),i.length>1&&(i.shift(),n.urlSelector=i.join(" ")),o.onreadystatechange=()=>{4===o.readyState&&(200===o.status?t?n.done.call(o,o,t):n.done.call(o,o):n.fail&&(t?n.fail.call(o,o,t):n.fail.call(o,o)),n.always&&(t?n.always.call(o,o,t):n.always.call(o,o)),t&&(n.autoresize||n.autoreposition)&&r.ajaxAutoresizeAutoreposition(t,n),r.ajaxAlwaysCallbacks.length&&r.ajaxAlwaysCallbacks.forEach(e=>{t?e.call(o,o,t):e.call(o,o)}))},o.open(n.method,n.url,n.async,n.user,n.pwd),o.timeout=n.timeout||0,n.withCredentials&&(o.withCredentials=n.withCredentials),n.responseType&&(o.responseType=n.responseType),n.beforeSend&&(t?n.beforeSend.call(o,o,t):n.beforeSend.call(o,o)),n.data?o.send(n.data):o.send(null)},fetch(e,t){let n;const i={bodyMethod:"text",autoresize:!0,autoreposition:!0,done:function(e,t){if(t){let n=r.strToHtml(e);t.contentRemove(),t.content.append(n)}}};if(t&&"string"==typeof e)n=Object.assign({},i,{resource:encodeURI(e)});else{if("object"!=typeof e||!e.resource){if(this.errorReporting){let e="Fetch Request seems to miss the <mark>resource</mark> parameter!";r.errorpanel(e)}return}(n=Object.assign({},i,e)).resource=encodeURI(e.resource)}const o=n.fetchInit||{};n.beforeSend&&(t?n.beforeSend.call(e,e,t):n.beforeSend.call(e,e)),fetch(n.resource,o).then(e=>{if(e.ok)return e[n.bodyMethod]()}).then(e=>{t?n.done.call(e,e,t):n.done.call(e,e),t&&(n.autoresize||n.autoreposition)&&r.ajaxAutoresizeAutoreposition(t,n)})},ajaxAutoresizeAutoreposition(e,t){const n=e.options.contentSize;if("string"==typeof n&&n.match(/auto/i)){const r=n.split(" "),i=Object.assign({},{width:r[0],height:r[1]});t.autoresize&&e.resize(i),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition()}else if("object"==typeof n&&("auto"===n.width||"auto"===n.height)){const r=Object.assign({},n);t.autoresize&&e.resize(r),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition()}},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled")}),t.innerHTML=`<div class="jsPanel-hdr">\n <div class="jsPanel-headerbar">\n <div class="jsPanel-headerlogo"></div>\n <div class="jsPanel-titlebar">\n <div class="jsPanel-title"></div>\n </div>\n <div class="jsPanel-controlbar">\n <button type="button" class="jsPanel-btn jsPanel-btn-smallify" aria-label="Smallify">${this.icons.smallify}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-minimize" aria-label="Minimize">${this.icons.minimize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-normalize" aria-label="Normalize">${this.icons.normalize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-maximize" aria-label="Maximize">${this.icons.maximize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-close" aria-label="Close">${this.icons.close}</button>\n </div>\n </div>\n <div class="jsPanel-hdr-toolbar"></div>\n </div>\n <div class="jsPanel-progressbar">\n <div class="jsPanel-progressbar-slider"></div>\n </div>\n <div class="jsPanel-content"></div>\n <div class="jsPanel-minimized-box"></div>\n <div class="jsPanel-ftr"></div>`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`<div class="jsPanel-hdr">\n <div class="jsPanel-headerbar">\n <div class="jsPanel-headerlogo"></div>\n <div class="jsPanel-titlebar">\n <div class="jsPanel-title"></div>\n </div>\n <div class="jsPanel-controlbar">\n <button type="button" class="jsPanel-btn jsPanel-btn-sm jsPanel-btn-normalize" aria-label="Normalize">${this.icons.normalize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-sm jsPanel-btn-maximize" aria-label="Maximize">${this.icons.maximize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-sm jsPanel-btn-close" aria-label="Close">${this.icons.close}</button>\n </div>\n </div>\n </div>`,e},createSnapArea(e,t,n){const r=document.createElement("div"),i=e.parentElement;r.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(r.style.width=n+"px",r.style.height=n+"px"):"ct"===t||"cb"===t?r.style.height=n+"px":"lc"!==t&&"rc"!==t||(r.style.width=n+"px"),i!==document.body&&(r.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(r)},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>e.parentElement.removeChild(e))},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.extensions[t]=e[t])},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),processCallbacks(e,t,n="some",r,i){if("function"==typeof t&&(t=[t]),n)return t[n](t=>t.call(e,e,r,i));t.forEach(t=>t.call(e,e,r,i))},resetZi(){this.zi=((e=r.ziBase)=>{let t=e;return{next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>e.style.zIndex=r.zi.next())},errorpanel(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"&#9888; jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`<div class="jsPanel-error-content-separator"></div><p>${e}</p>`})},create(e={},t){r.zi||(r.zi=((e=r.ziBase)=>{let t=e;return{next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${r.idCounter+=1}`;const n=document.getElementById(e.id);if(null!==n){if(n.classList.contains("jsPanel")&&n.front(),this.errorReporting){let t=`&#9664; COULD NOT CREATE NEW JSPANEL &#9658;<br>An element with the ID <mark>${e.id}</mark> already exists in the document.`;r.errorpanel(t)}return!1}let i=this.pOcontainer(e.container);if("object"==typeof i&&i.length&&i.length>0&&(i=i[0]),!i){if(this.errorReporting){let e="&#9664; COULD NOT CREATE NEW JSPANEL &#9658;<br>The container to append the panel to does not exist";r.errorpanel(e)}return!1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[]});const o=e.template||this.createPanelTemplate();o.options=e,o.closetimer=void 0,o.status="initialized",o.currentData={},o.header=o.querySelector(".jsPanel-hdr"),o.headerbar=o.header.querySelector(".jsPanel-headerbar"),o.titlebar=o.header.querySelector(".jsPanel-titlebar"),o.headerlogo=o.headerbar.querySelector(".jsPanel-headerlogo"),o.headertitle=o.headerbar.querySelector(".jsPanel-title"),o.controlbar=o.headerbar.querySelector(".jsPanel-controlbar"),o.headertoolbar=o.header.querySelector(".jsPanel-hdr-toolbar"),o.content=o.querySelector(".jsPanel-content"),o.footer=o.querySelector(".jsPanel-ftr"),o.snappableTo=!1,o.snapped=!1,o.droppableTo=!1,o.progressbar=o.autocloseProgressbar=o.querySelector(".jsPanel-progressbar");const a=new CustomEvent("jspanelloaded",{detail:e.id,cancelable:!0}),s=new CustomEvent("jspanelstatuschange",{detail:e.id,cancelable:!0}),l=new CustomEvent("jspanelbeforenormalize",{detail:e.id,cancelable:!0}),u=new CustomEvent("jspanelnormalized",{detail:e.id,cancelable:!0}),c=new CustomEvent("jspanelbeforemaximize",{detail:e.id,cancelable:!0}),d=new CustomEvent("jspanelmaximized",{detail:e.id,cancelable:!0}),f=new CustomEvent("jspanelbeforeminimize",{detail:e.id,cancelable:!0}),p=new CustomEvent("jspanelminimized",{detail:e.id,cancelable:!0}),h=new CustomEvent("jspanelbeforesmallify",{detail:e.id,cancelable:!0}),g=new CustomEvent("jspanelsmallified",{detail:e.id,cancelable:!0}),m=new CustomEvent("jspanelsmallifiedmax",{detail:e.id,cancelable:!0}),v=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id,cancelable:!0}),y=new CustomEvent("jspanelfronted",{detail:e.id,cancelable:!0}),_=new CustomEvent("jspanelbeforeclose",{detail:e.id,cancelable:!0}),b=new CustomEvent("jspanelclosed",{detail:e.id,cancelable:!0}),w=new CustomEvent("jspanelcloseduser",{detail:e.id,cancelable:!0});[a,s,l,u,c,d,f,p,h,g,m,v,y,_].forEach(e=>e.panel=o);const x=o.querySelector(".jsPanel-btn-close"),k=o.querySelector(".jsPanel-btn-maximize"),C=o.querySelector(".jsPanel-btn-normalize"),D=o.querySelector(".jsPanel-btn-smallify"),S=o.querySelector(".jsPanel-btn-minimize");x&&r.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.close(null,!0)})}),k&&r.pointerup.forEach(e=>{k.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.maximize()})}),C&&r.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.normalize()})}),D&&r.pointerup.forEach(e=>{D.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;"normalized"===o.status||"maximized"===o.status?o.smallify():"smallified"!==o.status&&"smallifiedmax"!==o.status||o.unsmallify()})}),S&&r.pointerup.forEach(e=>{S.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.minimize()})});let A=r.extensions;for(let e in A)Object.prototype.hasOwnProperty.call(A,e)&&(o[e]=A[e]);if(o.setBorder=e=>{let t=r.pOborder(e);return t[2].length||(t[2]=o.style.backgroundColor),t=t.join(" "),o.style.border=t,o.options.border=t,o},o.setBorderRadius=e=>{"string"==typeof e&&(e.startsWith("--")||e.startsWith("var"))&&(e=e.replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," "),e=r.getCssVariableValue(e)),"number"==typeof e&&(e+="px"),o.style.borderRadius=e;const t=getComputedStyle(o);return o.options.header?(o.header.style.borderTopLeftRadius=t.borderTopLeftRadius,o.header.style.borderTopRightRadius=t.borderTopRightRadius):(o.content.style.borderTopLeftRadius=t.borderTopLeftRadius,o.content.style.borderTopRightRadius=t.borderTopRightRadius),o.options.footerToolbar?(o.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,o.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(o.content.style.borderBottomRightRadius=t.borderBottomRightRadius,o.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),o},o.setTheme=(t=e.theme,n)=>{let i;if("minimized"===o.status&&(i=!0,o.normalize()),r.clearTheme(o),"object"==typeof t)e.border=void 0,r.applyCustomTheme(o,t);else if("string"==typeof t){"none"===t&&(t="white");let e=r.getThemeDetails(t);r.applyColorTheme(o,e)}return i&&o.minimize(),n&&n.call(o,o),o},o.remove=(e,t,n)=>{o.parentElement.removeChild(o),document.getElementById(e)?n&&n.call(o,e,o):(o.removeMinimizedReplacement(),o.status="closed",t&&document.dispatchEvent(w),document.dispatchEvent(b),o.options.onclosed&&r.processCallbacks(o,o.options.onclosed,"every",t),r.autopositionRemaining(o),n&&n.call(e,e)),window.removeEventListener("resize",o.windowResizeHandler),document.removeEventListener("jspanelresize",o.parentResizeHandler)},o.close=(e,t)=>{if(o.parentElement){if(o.closetimer&&window.clearInterval(o.closetimer),document.dispatchEvent(_),o.statusBefore=o.status,o.options.onbeforeclose&&o.options.onbeforeclose.length>0&&!r.processCallbacks(o,o.options.onbeforeclose,"some",o.status,t))return o;o.options.animateOut?(o.options.animateIn&&r.remClass(o,o.options.animateIn),r.setClass(o,o.options.animateOut),o.addEventListener("animationend",n=>{n.stopPropagation(),o.remove(o.id,t,e)})):o.remove(o.id,t,e)}},o.maximize=(t,n)=>{if(o.statusBefore=o.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!r.processCallbacks(o,e.onbeforemaximize,"some",o.statusBefore))return o;document.dispatchEvent(c);const i=o.parentElement,a=r.pOcontainment(e.maximizedMargin);return i===document.body?(o.style.width=document.documentElement.clientWidth-a[1]-a[3]+"px",o.style.height=document.documentElement.clientHeight-a[0]-a[2]+"px",o.style.left=a[3]+"px",o.style.top=a[0]+"px"):(o.style.width=i.clientWidth-a[1]-a[3]+"px",o.style.height=i.clientHeight-a[0]-a[2]+"px",o.style.left=a[3]+"px",o.style.top=a[0]+"px"),D.style.transform="unset",o.removeMinimizedReplacement(),o.status="maximized",o.setControls([".jsPanel-btn-maximize"]),n||o.front(),document.dispatchEvent(d),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore),t&&t.call(o,o,o.statusBefore),e.onmaximized&&r.processCallbacks(o,e.onmaximized,"every",o.statusBefore),o},o.minimize=t=>{if("minimized"===o.status)return o;if(o.statusBefore=o.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!r.processCallbacks(o,e.onbeforeminimize,"some",o.statusBefore))return o;if(document.dispatchEvent(f),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e)}if(o.style.left="-9999px",o.status="minimized",document.dispatchEvent(p),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore),e.minimizeTo){let t,n,r,i=o.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(i);break;case"parentpanel":(t=(r=(n=o.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[r.length-1]).append(i);break;case"parent":(t=(n=o.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",n.append(t)),t.append(i);break;default:document.querySelector(e.minimizeTo).append(i)}}return t&&t.call(o,o,o.statusBefore),e.onminimized&&r.processCallbacks(o,e.onminimized,"every",o.statusBefore),o},o.normalize=t=>("normalized"===o.status||(o.statusBefore=o.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!r.processCallbacks(o,e.onbeforenormalize,"some",o.statusBefore)||(document.dispatchEvent(l),o.style.width=o.currentData.width,o.style.height=o.currentData.height,o.snapped?o.snap(o.snapped,!0):(o.style.left=o.currentData.left,o.style.top=o.currentData.top),D.style.transform="unset",o.removeMinimizedReplacement(),o.status="normalized",o.setControls([".jsPanel-btn-normalize"]),o.front(),document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore),t&&t.call(o,o,o.statusBefore),e.onnormalized&&r.processCallbacks(o,e.onnormalized,"every",o.statusBefore))),o),o.smallify=t=>{if("smallified"===o.status||"smallifiedmax"===o.status)return o;if(o.statusBefore=o.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!r.processCallbacks(o,e.onbeforesmallify,"some",o.statusBefore))return o;document.dispatchEvent(h),o.style.overflow="hidden";const n=window.getComputedStyle(o),i=parseFloat(window.getComputedStyle(o.headerbar).height);o.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+i+"px",D.style.transform="rotate(180deg)","normalized"===o.status?(o.setControls([".jsPanel-btn-normalize"]),o.status="smallified",document.dispatchEvent(g),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore)):"maximized"===o.status&&(o.setControls([".jsPanel-btn-maximize"]),o.status="smallifiedmax",document.dispatchEvent(m),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore));const a=o.querySelectorAll(".jsPanel-minimized-box");return a[a.length-1].style.display="none",t&&t.call(o,o,o.statusBefore),e.onsmallified&&r.processCallbacks(o,e.onsmallified,"every",o.statusBefore),o},o.unsmallify=t=>{if(o.statusBefore=o.status,"smallified"===o.status||"smallifiedmax"===o.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!r.processCallbacks(o,e.onbeforeunsmallify,"some",o.statusBefore))return o;document.dispatchEvent(v),o.style.overflow="visible",o.front(),"smallified"===o.status?(o.style.height=o.currentData.height,o.setControls([".jsPanel-btn-normalize"]),o.status="normalized",document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore)):"smallifiedmax"===o.status?o.maximize():"minimized"===o.status&&o.normalize(),D.style.transform="rotate(0deg)";const n=o.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",t&&t.call(o,o,o.statusBefore),e.onunsmallified&&r.processCallbacks(o,e.onunsmallified,"every",o.statusBefore)}return o},o.front=(t,n=!0)=>{if("minimized"===o.status)"maximized"===o.statusBefore?o.maximize():o.normalize();else{const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>o.style.zIndex&&(o.style.zIndex=r.zi.next()),r.resetZi()}return document.dispatchEvent(y),t&&t.call(o,o),e.onfronted&&n&&r.processCallbacks(o,e.onfronted,"every",o.status),o},o.snap=(e,t=!1)=>{if(t||(o.currentData.beforeSnap={width:o.currentData.width,height:o.currentData.height}),e&&"function"==typeof e&&!t)e.call(o,o,o.snappableTo);else if(!1!==e){let e=[0,0];if(o.options.dragit.snap.containment&&o.options.dragit.containment){const t=r.pOcontainment(o.options.dragit.containment),n=o.snappableTo;n.startsWith("left")?e[0]=t[3]:n.startsWith("right")&&(e[0]=-t[1]),n.endsWith("top")?e[1]=t[0]:n.endsWith("bottom")&&(e[1]=-t[2])}o.reposition(`${o.snappableTo} ${e[0]} ${e[1]}`)}t||(o.snapped=o.snappableTo)},o.move=(e,t)=>{let n=o.overlaps(e,"paddingbox"),r=o.parentElement;return e.appendChild(o),o.options.container=e,o.style.left=n.left+"px",o.style.top=n.top+"px",o.saveCurrentDimensions(),o.saveCurrentPosition(),o.calcSizeFactors(),t&&t.call(o,o,e,r),o},o.closeChildpanels=e=>(o.getChildpanels().forEach(e=>e.close()),e&&e.call(o,o),o),o.getChildpanels=e=>{const t=o.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,n,r)=>{e.call(t,t,n,r)}),t},o.isChildpanel=e=>{const t=o.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(o,o,n),!!t&&n},o.contentRemove=e=>(r.emptyNode(o.content),e&&e.call(o,o),o),o.createMinimizedReplacement=()=>{const t=r.createMinimizedTemplate(),n=window.getComputedStyle(o.headertitle).color,i=window.getComputedStyle(o),a=e.iconfont,s=t.querySelector(".jsPanel-controlbar");return"auto-show-hide"!==o.options.header?r.setStyles(t,{backgroundColor:i.backgroundColor,backgroundPositionX:i.backgroundPositionX,backgroundPositionY:i.backgroundPositionY,backgroundRepeat:i.backgroundRepeat,backgroundAttachment:i.backgroundAttachment,backgroundImage:i.backgroundImage,backgroundSize:i.backgroundSize,backgroundOrigin:i.backgroundOrigin,backgroundClip:i.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(o.header).backgroundColor,t.id=o.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(o.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(o.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",o.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=n,s.style.color=n,s.querySelectorAll("button").forEach(e=>e.style.color=n),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{o.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e)}),o.setIconfont(a,t),"enabled"===o.dataset.btnnormalize?r.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.normalize()})}):s.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===o.dataset.btnmaximize?r.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.maximize()})}):s.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===o.dataset.btnclose?r.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.close(null,!0)})}):s.querySelector(".jsPanel-btn-close").style.display="none",t},o.removeMinimizedReplacement=()=>{const e=document.getElementById(`${o.id}-min`);e&&e.parentElement.removeChild(e)},o.drag=(e={})=>{let t,n,i;const a=new CustomEvent("jspaneldragstart",{detail:o.id}),s=new CustomEvent("jspaneldrag",{detail:o.id}),l=new CustomEvent("jspaneldragstop",{detail:o.id});[a,s,l].forEach(e=>e.panel=o);const u=e=>{let t=e.split("-");return t.forEach((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1)}),"snap"+t.join("")};function c(e){null===e.relatedTarget&&r.pointermove.forEach(e=>{document.removeEventListener(e,n,!1),o.style.opacity=1})}let d=e.handles||r.defaults.dragit.handles,f=e.cursor||r.defaults.dragit.cursor;function p(e){if(r.pointermove.forEach(e=>document.removeEventListener(e,n)),r.removeSnapAreas(),t){if(o.style.opacity=1,t=void 0,i.snap){switch(o.snappableTo){case"left-top":o.snap(i.snap.snapLeftTop);break;case"center-top":o.snap(i.snap.snapCenterTop);break;case"right-top":o.snap(i.snap.snapRightTop);break;case"right-center":o.snap(i.snap.snapRightCenter);break;case"right-bottom":o.snap(i.snap.snapRightBottom);break;case"center-bottom":o.snap(i.snap.snapCenterBottom);break;case"left-bottom":o.snap(i.snap.snapLeftBottom);break;case"left-center":o.snap(i.snap.snapLeftCenter)}i.snap.callback&&o.snappableTo&&"function"==typeof i.snap.callback&&(i.snap.callback.call(o,o),i.snap.repositionOnSnap&&!1!==i.snap[u(o.snappableTo)]&&o.repositionOnSnap(o.snappableTo)),o.snappableTo&&i.snap.repositionOnSnap&&i.snap[u(o.snappableTo)]&&o.repositionOnSnap(o.snappableTo)}if(o.droppableTo&&o.droppableTo){let e=o.parentElement;o.move(o.droppableTo),i.drop.callback&&i.drop.callback.call(o,o,o.droppableTo,e)}if(document.dispatchEvent(l),i.stop.length){let t=window.getComputedStyle(o),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};r.processCallbacks(o,i.stop,!1,n,e)}o.saveCurrentPosition(),o.calcSizeFactors()}o.controlbar.style.pointerEvents="inherit",o.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),document.removeEventListener(e,p)}return o.querySelectorAll(d).forEach(l=>{l.style.touchAction="none",l.style.cursor=f,r.pointerdown.forEach(u=>{l.addEventListener(u,l=>{if(l.button&&l.button>0)return!1;if((i=Object.assign({},r.defaults.dragit,e)).disableOnMaximized&&"maximized"===o.status)return!1;if((i.containment||0===i.containment)&&(i.containment=r.pOcontainment(i.containment)),i.grid&&Array.isArray(i.grid)&&1===i.grid.length&&(i.grid[1]=i.grid[0]),i.snap&&("object"==typeof i.snap?i.snap=Object.assign({},r.defaultSnapConfig,i.snap):i.snap=r.defaultSnapConfig),l.target.closest(".jsPanel-ftr-btn"))return;o.controlbar.style.pointerEvents="none",o.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");let u=window.getComputedStyle(o),d=parseFloat(u.left),f=parseFloat(u.top),p=parseFloat(u.width),h=parseFloat(u.height),g=l.touches?l.touches[0].clientX:l.clientX,m=l.touches?l.touches[0].clientY:l.clientY,v=o.parentElement,y=v.getBoundingClientRect(),_=window.getComputedStyle(v),b=o.getScaleFactor(),w=0,x=r.getScrollbarWidth(v);n=e=>{if(e.preventDefault(),!t){if(document.dispatchEvent(a),o.style.opacity=i.opacity,o.snapped&&i.snap.resizeToPreSnap&&o.currentData.beforeSnap){o.resize(o.currentData.beforeSnap.width+" "+o.currentData.beforeSnap.height),o.setControls([".jsPanel-btn-normalize"]);let e=o.getBoundingClientRect(),t=g-(e.left+e.width),n=e.width/2;t>-n&&(w=t+n)}if(o.front(),o.snapped=!1,"maximized"===o.status&&(o.setControls([".jsPanel-btn-normalize"]),o.status="normalized"),i.drop&&i.drop.dropZones){let e=i.drop.dropZones.map(e=>r.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e)}):t.push(e)}),t=t.filter(function(e,t,n){return n.indexOf(e)===t}),i.drop.dropZones=t}i.start.length&&r.processCallbacks(o,i.start,!1,{left:d,top:f,width:p,height:h},e)}let n,l,u,c,k,C,D,S,A,E;t=1;let M,T=e.touches?e.touches[0].clientX:e.clientX,j=e.touches?e.touches[0].clientY:e.clientY,N=window.getComputedStyle(o);if(v===document.body){let e=o.getBoundingClientRect();A=window.innerWidth-parseInt(_.borderLeftWidth,10)-parseInt(_.borderRightWidth,10)-(e.left+e.width),E=window.innerHeight-parseInt(_.borderTopWidth,10)-parseInt(_.borderBottomWidth,10)-(e.top+e.height)}else A=parseInt(_.width,10)-parseInt(_.borderLeftWidth,10)-parseInt(_.borderRightWidth,10)-(parseInt(N.left,10)+parseInt(N.width,10)),E=parseInt(_.height,10)-parseInt(_.borderTopWidth,10)-parseInt(_.borderBottomWidth,10)-(parseInt(N.top,10)+parseInt(N.height,10));n=parseFloat(N.left),u=parseFloat(N.top),k=A,D=E,i.snap&&("panel"===i.snap.trigger?(l=n**2,c=u**2,C=k**2,S=D**2):"pointer"===i.snap.trigger&&("window"===o.options.container?(n=T,l=T**2,c=(u=j)**2,C=(k=window.innerWidth-T)**2,S=(D=window.innerHeight-j)**2):(n=(M=o.overlaps(v,"paddingbox",e)).pointer.left,u=M.pointer.top,k=M.pointer.right,D=M.pointer.bottom,l=M.pointer.left**2,c=M.pointer.top**2,C=M.pointer.right**2,S=M.pointer.bottom**2)));let F=Math.sqrt(l+c),O=Math.sqrt(l+S),I=Math.sqrt(C+c),z=Math.sqrt(C+S),$=Math.abs(n-k)/2,q=Math.abs(u-D)/2,R=Math.sqrt(l+q**2),P=Math.sqrt(c+$**2),L=Math.sqrt(C+q**2),B=Math.sqrt(S+$**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(s),i.axis&&"x"!==i.axis||(o.style.left=d+(T-g)/b.x+w+"px"),i.axis&&"y"!==i.axis||(o.style.top=f+(j-m)/b.y+"px"),i.grid){let e=i.grid,t=i.axis,n=e[0]*Math.round((d+(T-g))/e[0]),r=e[1]*Math.round((f+(j-m))/e[1]);t&&"x"!==t||(o.style.left=`${n}px`),t&&"y"!==t||(o.style.top=`${r}px`)}if(i.containment||0===i.containment){let e,t,n=i.containment;if("window"===o.options.container)e=window.innerWidth-parseFloat(N.width)-n[1]-x.y,t=window.innerHeight-parseFloat(N.height)-n[2]-x.x;else{let r=parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth),i=parseFloat(_.borderTopWidth)+parseFloat(_.borderBottomWidth);e=y.width/b.x-parseFloat(N.width)-n[1]-r-x.y,t=y.height/b.y-parseFloat(N.height)-n[2]-i-x.x}parseFloat(o.style.left)<=n[3]&&(o.style.left=n[3]+"px"),parseFloat(o.style.top)<=n[0]&&(o.style.top=n[0]+"px"),parseFloat(o.style.left)>=e&&(o.style.left=e+"px"),parseFloat(o.style.top)>=t&&(o.style.top=t+"px")}if(i.drag.length){let t={left:n,top:u,right:k,bottom:D,width:parseFloat(N.width),height:parseFloat(N.height)};r.processCallbacks(o,i.drag,!1,t,e)}if(i.snap){let e=i.snap.sensitivity,t=v===document.body?window.innerWidth/8:y.width/8,a=v===document.body?window.innerHeight/8:y.height/8;o.snappableTo=!1,r.removeSnapAreas(),F<e?!1!==i.snap.snapLeftTop&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.left>0&&M.pointer.top>0?(o.snappableTo="left-top",r.createSnapArea(o,"lt",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="left-top",r.createSnapArea(o,"lt",e))):O<e?!1!==i.snap.snapLeftBottom&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.left>0&&M.pointer.bottom>0?(o.snappableTo="left-bottom",r.createSnapArea(o,"lb",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="left-bottom",r.createSnapArea(o,"lb",e))):I<e?!1!==i.snap.snapRightTop&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.right>0&&M.pointer.top>0?(o.snappableTo="right-top",r.createSnapArea(o,"rt",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="right-top",r.createSnapArea(o,"rt",e))):z<e?!1!==i.snap.snapRightBottom&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.right>0&&M.pointer.bottom>0?(o.snappableTo="right-bottom",r.createSnapArea(o,"rb",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="right-bottom",r.createSnapArea(o,"rb",e))):u<e&&P<t?!1!==i.snap.snapCenterTop&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.top>0?(o.snappableTo="center-top",r.createSnapArea(o,"ct",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="center-top",r.createSnapArea(o,"ct",e))):n<e&&R<a?!1!==i.snap.snapLeftCenter&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.left>0?(o.snappableTo="left-center",r.createSnapArea(o,"lc",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="left-center",r.createSnapArea(o,"lc",e))):k<e&&L<a?!1!==i.snap.snapRightCenter&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.right>0?(o.snappableTo="right-center",r.createSnapArea(o,"rc",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="right-center",r.createSnapArea(o,"rc",e))):D<e&&B<t&&!1!==i.snap.snapCenterBottom&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.bottom>0?(o.snappableTo="center-bottom",r.createSnapArea(o,"cb",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="center-bottom",r.createSnapArea(o,"cb",e)))}if(i.drop&&i.drop.dropZones){let t=r.isIE?"msElementsFromPoint":"elementsFromPoint",n=document[t](e.clientX,e.clientY);Array.isArray(n)||(n=Array.prototype.slice.call(n)),i.drop.dropZones.forEach(e=>{n.includes(e)&&(o.droppableTo=e)}),n.includes(o.droppableTo)||(o.droppableTo=!1)}},r.pointermove.forEach(e=>document.addEventListener(e,n)),window.addEventListener("mouseout",c,!1)})}),r.pointerup.forEach(e=>{document.addEventListener(e,p),window.removeEventListener("mouseout",c)}),e.disable&&(l.style.pointerEvents="none")}),o},o.dragit=t=>{const n=Object.assign({},r.defaults.dragit,e.dragit),i=o.querySelectorAll(n.handles);return"disable"===t?i.forEach(e=>e.style.pointerEvents="none"):i.forEach(e=>e.style.pointerEvents="auto"),o},o.sizeit=(e={})=>{const t=new CustomEvent("jspanelresizestart",{detail:o.id}),n=new CustomEvent("jspanelresize",{detail:o.id}),i=new CustomEvent("jspanelresizestop",{detail:o.id});[t,n,i].forEach(e=>e.panel=o);let a,s,l,u,c,d,f={};f.handles=e.handles||r.defaults.resizeit.handles,f.handles.split(",").forEach(e=>{const t=document.createElement("DIV");t.className=`jsPanel-resizeit-handle jsPanel-resizeit-${e.trim()}`,o.append(t)});let p=!!e.aspectRatio&&e.aspectRatio;function h(e){null===e.relatedTarget&&r.pointermove.forEach(e=>document.removeEventListener(e,a,!1))}function g(e){if(r.pointermove.forEach(e=>document.removeEventListener(e,a,!1)),e.target.classList&&e.target.classList.contains("jsPanel-resizeit-handle")){let t,n,r=e.target.className;if(r.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(t=!0),r.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(n=!0),f.grid&&Array.isArray(f.grid)){1===f.grid.length&&(f.grid[1]=f.grid[0]);const e=parseFloat(o.style.width),r=parseFloat(o.style.height),i=e%f.grid[0],a=r%f.grid[1],s=parseFloat(o.style.left),l=parseFloat(o.style.top),u=s%f.grid[0],c=l%f.grid[1];i<f.grid[0]/2?o.style.width=e-i+"px":o.style.width=e+(f.grid[0]-i)+"px",a<f.grid[1]/2?o.style.height=r-a+"px":o.style.height=r+(f.grid[1]-a)+"px",t&&(u<f.grid[0]/2?o.style.left=s-u+"px":o.style.left=s+(f.grid[0]-u)+"px"),n&&(c<f.grid[1]/2?o.style.top=l-c+"px":o.style.top=l+(f.grid[1]-c)+"px")}}if(s){o.content.style.pointerEvents="inherit",s=void 0,o.saveCurrentDimensions(),o.saveCurrentPosition(),o.calcSizeFactors();let t=o.controlbar.querySelector(".jsPanel-btn-smallify"),n=o.getBoundingClientRect();if(t&&n.height>d+5&&(t.style.transform="rotate(0deg)"),document.dispatchEvent(i),f.stop.length){let t=window.getComputedStyle(o),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};r.processCallbacks(o,f.stop,!1,n,e)}}o.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),f.aspectRatio=p,document.removeEventListener(e,g)}return o.querySelectorAll(".jsPanel-resizeit-handle").forEach(i=>{i.style.touchAction="none",r.pointerdown.forEach(p=>{i.addEventListener(p,i=>{if(i.preventDefault(),i.stopPropagation(),i.button&&i.button>0)return!1;let p=1;if(((f=Object.assign({},r.defaults.resizeit,e)).containment||0===f.containment)&&(f.containment=r.pOcontainment(f.containment)),f.aspectRatio&&!0===f.aspectRatio&&(f.aspectRatio="panel"),r.modifier){let e=r.modifier;e.altKey?f.aspectRatio="content":e.ctrlKey?f.aspectRatio="panel":e.shiftKey&&(f.aspectRatio=!1,p=2)}let g="function"==typeof f.maxWidth?f.maxWidth():f.maxWidth||1e4,m="function"==typeof f.maxHeight?f.maxHeight():f.maxHeight||1e4,v="function"==typeof f.minWidth?f.minWidth():f.minWidth,y="function"==typeof f.minHeight?f.minHeight():f.minHeight;o.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");const _=o.parentElement,b=_.tagName.toLowerCase(),w=o.getBoundingClientRect(),x=_.getBoundingClientRect(),k=window.getComputedStyle(_,null),C=parseInt(k.borderLeftWidth,10),D=parseInt(k.borderTopWidth,10),S=k.getPropertyValue("position"),A=i.clientX||0===i.clientX||i.touches[0].clientX,E=i.clientY||0===i.clientY||i.touches[0].clientY,M=A/E,T=i.target.classList,j=o.getScaleFactor(),N=w.width/w.height,F=o.content.getBoundingClientRect(),O=F.width/F.height,I=o.header.getBoundingClientRect().height,z=o.footer.getBoundingClientRect().height||0;let $=w.left,q=w.top,R=1e4,P=1e4,L=1e4,B=1e4;c=w.width,d=w.height,"body"!==b&&($=w.left-x.left+_.scrollLeft,q=w.top-x.top+_.scrollTop),"body"===b&&f.containment?(R=document.documentElement.clientWidth-w.left,L=document.documentElement.clientHeight-w.top,P=w.width+w.left,B=w.height+w.top):f.containment&&("static"===S?(R=x.width-w.left+C,L=x.height+x.top-w.top+D,P=w.width+(w.left-x.left)-C,B=w.height+(w.top-x.top)-D):(R=_.clientWidth-(w.left-x.left)/j.x+C,L=_.clientHeight-(w.top-x.top)/j.y+D,P=(w.width+w.left-x.left)/j.x-C,B=o.clientHeight+(w.top-x.top)/j.y-D)),f.containment&&(P-=f.containment[3],B-=f.containment[0],R-=f.containment[1],L-=f.containment[2]);const U=window.getComputedStyle(o),V=parseFloat(U.width)-w.width,H=parseFloat(U.height)-w.height;let W=parseFloat(U.left)-w.left,G=parseFloat(U.top)-w.top;_!==document.body&&(W+=x.left,G+=x.top);let Y=parseInt(U.borderTopWidth,10),Q=parseInt(U.borderRightWidth,10),K=parseInt(U.borderBottomWidth,10),Z=parseInt(U.borderLeftWidth,10);a=e=>{e.preventDefault(),s||(document.dispatchEvent(t),f.start.length&&r.processCallbacks(o,f.start,!1,{width:c,height:d,left:$,top:q},e),o.front(),"maximized"===o.status&&(o.status="normalized",o.controlbar.querySelector(".jsPanel-btn-maximize")&&o.setControlStatus("maximize","show"),o.controlbar.querySelector(".jsPanel-btn-normalize")&&o.setControlStatus("normalize","hide")),w.height>d+5&&(o.status="normalized",o.setControls([".jsPanel-btn-normalize"]))),s=1,document.dispatchEvent(n);let i,a=e.touches?e.touches[0].clientX:e.clientX,h=e.touches?e.touches[0].clientY:e.clientY;T.contains("jsPanel-resizeit-e")?((l=c+(a-A)*p/j.x+V)>=R&&(l=R),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",2===p&&(o.style.left=$-(a-A)+"px"),"content"===f.aspectRatio?(o.style.height=(l-Q-Z)/O+I+z+Y+K+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*O+"px")):"panel"===f.aspectRatio&&(o.style.height=l/N+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*N+"px"))):T.contains("jsPanel-resizeit-s")?((u=d+(h-E)*p/j.y+H)>=L&&(u=L),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px",2===p&&(o.style.top=q-(h-E)+"px"),"content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-w")?((l=c+(A-a)*p/j.x+V)<=g&&l>=v&&l<=P&&(o.style.left=$+(a-A)/j.x+W+"px"),l>=P&&(l=P),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px","content"===f.aspectRatio?(o.style.height=(l-Q-Z)/O+I+z+Y+K+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*O+"px")):"panel"===f.aspectRatio&&(o.style.height=l/N+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*N+"px"))):T.contains("jsPanel-resizeit-n")?((u=d+(E-h)*p/j.y+H)<=m&&u>=y&&u<=B&&(o.style.top=q+(h-E)/j.y+G+"px"),u>=B&&(u=B),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px","content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-se")?((l=c+(a-A)*p/j.x+V)>=R&&(l=R),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",2===p&&(o.style.left=$-(a-A)+"px"),f.aspectRatio&&(o.style.height=l/N+"px"),(u=d+(h-E)*p/j.y+H)>=L&&(u=L),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px",2===p&&(o.style.top=q-(h-E)+"px"),"content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-sw")?((u=d+(h-E)*p/j.y+H)>=L&&(u=L),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px",2===p&&(o.style.top=q-(h-E)+"px"),f.aspectRatio&&(o.style.width=u*N+"px"),(l=c+(A-a)*p/j.x+V)<=g&&l>=v&&l<=P&&(o.style.left=$+(a-A)/j.x+W+"px"),l>=P&&(l=P),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px","content"===f.aspectRatio?(o.style.height=(l-Q-Z)/O+I+z+Y+K+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*O+"px")):"panel"===f.aspectRatio&&(o.style.height=l/N+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*N+"px"))):T.contains("jsPanel-resizeit-ne")?((l=c+(a-A)*p/j.x+V)>=R&&(l=R),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",2===p&&(o.style.left=$-(a-A)+"px"),f.aspectRatio&&(o.style.height=l/N+"px"),(u=d+(E-h)*p/j.y+H)<=m&&u>=y&&u<=B&&(o.style.top=q+(h-E)/j.y+G+"px"),u>=B&&(u=B),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px","content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-nw")&&(f.aspectRatio&&T.contains("jsPanel-resizeit-nw")&&(h=(a=h*M)/M),(l=c+(A-a)*p/j.x+V)<=g&&l>=v&&l<=P&&(o.style.left=$+(a-A)/j.x+W+"px"),l>=P&&(l=P),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",f.aspectRatio&&(o.style.height=l/N+"px"),(u=d+(E-h)*p/j.y+H)<=m&&u>=y&&u<=B&&(o.style.top=q+(h-E)/j.y+G+"px"),u>=B&&(u=B),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px","content"===f.aspectRatio?o.style.width=(u-I-z-Y-K)*O+Y+K+"px":"panel"===f.aspectRatio&&(o.style.width=u*N+"px")),window.getSelection().removeAllRanges();const b=window.getComputedStyle(o),x={left:parseFloat(b.left),top:parseFloat(b.top),right:parseFloat(b.right),bottom:parseFloat(b.bottom),width:parseFloat(b.width),height:parseFloat(b.height)};f.resize.length&&r.processCallbacks(o,f.resize,!1,x,e)},r.pointermove.forEach(e=>document.addEventListener(e,a,!1)),window.addEventListener("mouseout",h,!1)})}),r.pointerup.forEach(function(e){document.addEventListener(e,g),window.removeEventListener("mouseout",h)}),e.disable&&(i.style.pointerEvents="none")}),o},o.resizeit=e=>{const t=o.querySelectorAll(".jsPanel-resizeit-handle");return"disable"===e?t.forEach(e=>e.style.pointerEvents="none"):t.forEach(e=>e.style.pointerEvents="auto"),o},o.getScaleFactor=()=>{const e=o.getBoundingClientRect();return{x:e.width/o.offsetWidth,y:e.height/o.offsetHeight}},o.calcSizeFactors=()=>{const t=window.getComputedStyle(o);if("window"===e.container)o.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),o.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(o.parentElement){let e=o.parentElement.getBoundingClientRect();o.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),o.vf=parseFloat(t.top)/(e.height-parseFloat(t.height))}},o.saveCurrentDimensions=()=>{const e=window.getComputedStyle(o);o.currentData.width=e.width,o.currentData.height=e.height},o.saveCurrentPosition=()=>{const e=window.getComputedStyle(o);o.currentData.left=e.left,o.currentData.top=e.top},o.reposition=(...t)=>{let n,i=e.position,a=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?i=e:"boolean"==typeof e?a=e:"function"==typeof e&&(n=e)}),r.position(o,i),o.slaves&&o.slaves.size>0&&o.slaves.forEach(e=>e.reposition()),a&&o.saveCurrentPosition(),n&&n.call(o,o),o},o.repositionOnSnap=t=>{let n="0",i="0",a=r.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":n=a[3],i=a[0];break;case"right-top":n=-a[1],i=a[0];break;case"right-bottom":n=-a[1],i=-a[2];break;case"left-bottom":n=a[3],i=-a[2];break;case"center-top":n=a[3]/2-a[1]/2,i=a[0];break;case"center-bottom":n=a[3]/2-a[1]/2,i=-a[2];break;case"left-center":n=a[3],i=a[0]/2-a[2]/2;break;case"right-center":n=-a[1],i=a[0]/2-a[2]/2}r.position(o,t),r.setStyles(o,{left:`calc(${o.style.left} + ${n}px)`,top:`calc(${o.style.top} + ${i}px)`})},o.overlaps=(e,t,n)=>{let r,i=o.getBoundingClientRect(),a=getComputedStyle(o.parentElement),s=o.getScaleFactor(),l={top:0,right:0,bottom:0,left:0},u=0,c=0,d=0,f=0;"window"!==o.options.container&&"paddingbox"===t&&(l.top=parseInt(a.borderTopWidth,10)*s.y,l.right=parseInt(a.borderRightWidth,10)*s.x,l.bottom=parseInt(a.borderBottomWidth,10)*s.y,l.left=parseInt(a.borderLeftWidth,10)*s.x),r="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?o.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),n&&(u=n.touches?n.touches[0].clientX:n.clientX,c=n.touches?n.touches[0].clientY:n.clientY,d=u-r.left,f=c-r.top);let p=i.left<r.right&&i.right>r.left,h=i.top<r.bottom&&i.bottom>r.top;return{overlaps:p&&h,top:i.top-r.top-l.top,right:r.right-i.right-l.right,bottom:r.bottom-i.bottom-l.bottom,left:i.left-r.left-l.left,parentBorderWidth:l,panelRect:i,referenceRect:r,pointer:{clientX:u,clientY:c,left:d-l.left,top:f-l.top,right:r.width-d-l.right,bottom:r.height-f-l.bottom}}},o.setSize=()=>{if(e.panelSize){const t=r.pOsize(o,e.panelSize);o.style.width=t.width,o.style.height=t.height}else if(e.contentSize){const t=r.pOsize(o,e.contentSize);o.content.style.width=t.width,o.content.style.height=t.height,o.style.width=t.width,o.content.style.width="100%"}return o},o.resize=(...e)=>{let t,n=window.getComputedStyle(o),i={width:n.width,height:n.height},a=!0;e.forEach(e=>{"string"==typeof e?i=e:"object"==typeof e?i=Object.assign(i,e):"boolean"==typeof e?a=e:"function"==typeof e&&(t=e)});let s=r.pOsize(o,i);o.style.width=s.width,o.style.height=s.height,o.slaves&&o.slaves.size>0&&o.slaves.forEach(e=>e.reposition()),a&&o.saveCurrentDimensions(),o.status="normalized";let l=o.controlbar.querySelector(".jsPanel-btn-smallify");return l&&(l.style.transform="rotate(0deg)"),t&&t.call(o,o),o.calcSizeFactors(),o},o.windowResizeHandler=t=>{if(t.target===window){let n,r,i=o.status,a=e.onwindowresize;if("maximized"===i&&a)o.maximize(!1,!0);else if(o.snapped&&"minimized"!==i)o.snap(o.snapped,!0);else if("normalized"===i||"smallified"===i||"maximized"===i){let e=typeof a;"boolean"===e?(n=(window.innerWidth-o.offsetWidth)*o.hf,o.style.left=n<=0?0:n+"px",r=(window.innerHeight-o.offsetHeight)*o.vf,o.style.top=r<=0?0:r+"px"):"function"===e?a.call(o,t,o):"object"===e&&(!0===a.preset?(n=(window.innerWidth-o.offsetWidth)*o.hf,o.style.left=n<=0?0:n+"px",r=(window.innerHeight-o.offsetHeight)*o.vf,o.style.top=r<=0?0:r+"px",a.callback.call(o,t,o)):a.callback.call(o,t,o))}else"smallifiedmax"===i&&a&&o.maximize(!1,!0).smallify();o.slaves&&o.slaves.size>0&&o.slaves.forEach(e=>e.reposition())}},o.setControls=(e,t)=>(o.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),n=t[t.length-1];"hidden"!==o.getAttribute(`data-btn${n}`)&&(e.style.display="block")}),e.forEach(e=>{const t=o.controlbar.querySelector(e);t&&(t.style.display="none")}),t&&t.call(o,o),o),o.setControlStatus=(e,t="enable",n)=>{const r=o.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==o.getAttribute(`data-btn${e}`)&&(o.setAttribute(`data-btn${e}`,"disabled"),r.style.pointerEvents="none",r.style.opacity=.4,r.style.cursor="default");break;case"hide":"removed"!==o.getAttribute(`data-btn${e}`)&&(o.setAttribute(`data-btn${e}`,"hidden"),r.style.display="none");break;case"show":"removed"!==o.getAttribute(`data-btn${e}`)&&(o.setAttribute(`data-btn${e}`,"enabled"),r.style.display="block",r.style.pointerEvents="auto",r.style.opacity=1,r.style.cursor="pointer");break;case"enable":"removed"!==o.getAttribute(`data-btn${e}`)&&("hidden"===o.getAttribute(`data-btn${e}`)&&(r.style.display="block"),o.setAttribute(`data-btn${e}`,"enabled"),r.style.pointerEvents="auto",r.style.opacity=1,r.style.cursor="pointer");break;case"remove":o.controlbar.removeChild(r),o.setAttribute(`data-btn${e}`,"removed")}return n&&n.call(o,o),o},o.setControlSize=e=>{const t=e.toLowerCase();o.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>e.classList.remove(t)),e.classList.add(`jsPanel-btn-${t}`)}),"xl"===t?o.titlebar.style.fontSize="1.5rem":"lg"===t?o.titlebar.style.fontSize="1.25rem":"md"===t?o.titlebar.style.fontSize="1.05rem":"sm"===t?o.titlebar.style.fontSize=".9rem":"xs"===t&&(o.titlebar.style.fontSize=".8rem")},o.setHeaderControls=t=>{if(o.options.headerControls.add){let e=o.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>o.addControl(e))}let n=[];o.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z\d]{3,}/i)[0].substring(12);n.push(t)});const i=r.pOheaderControls(e.headerControls);return e.headerControls=i,n.forEach(e=>{i[e]&&o.setControlStatus(e,i[e])}),o.setControlSize(i.size),t&&t.call(o,o),o},o.setHeaderLogo=(e,t)=>{let n=[o.headerlogo],i=document.querySelector("#"+o.id+"-min");return i&&n.push(i.querySelector(".jsPanel-headerlogo")),"string"==typeof e?e.startsWith("<")?n.forEach(t=>t.innerHTML=e):n.forEach(t=>{r.emptyNode(t);let n=document.createElement("img");n.src=e,t.append(n)}):n.forEach(t=>{r.emptyNode(t),t.append(e)}),o.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false")}),t&&t.call(o,o),o},o.setHeaderRemove=e=>(o.removeChild(o.header),o.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>o.setAttribute(`data-btn${e}`,"removed")),e&&e.call(o,o),o),o.setHeaderTitle=(e,t)=>{let n=[o.headertitle],i=document.querySelector("#"+o.id+"-min");return i&&n.push(i.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(t=>t.innerHTML=e):"function"==typeof e?n.forEach(t=>{r.emptyNode(t),t.innerHTML=e()}):n.forEach(t=>{r.emptyNode(t),t.append(e)}),t&&t.call(o,o),o},o.setIconfont=(e,t=o,n)=>{if(e){let n,i;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)n=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)n=[e,e,e,e,e,e],i=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))n=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else{if("bootstrap"!==e&&"glyphicon"!==e)return t;n=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"]}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>r.emptyNode(e).innerHTML="<span></span>"),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,r)=>{t.className=n[r],"material-icons"===e&&(t.textContent=i[r])})}return n&&n.call(t,t),t},o.addToolbar=(e,t,n)=>{if("header"===e?e=o.headertoolbar:"footer"===e&&(e=o.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t)});else if("function"==typeof t){let n=t.call(o,o);"string"==typeof n?e.innerHTML=n:e.append(n)}else e.append(t);return e.classList.add("active"),n&&n.call(o,o),o},o.addCloseControl=()=>{let e=document.createElement("button"),t=o.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=r.icons.close,e.style.color=t,o.options.rtl&&e.classList.add("rtl"),o.appendChild(e),r.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.close(null,!0)})}),r.pointerdown.forEach(t=>{e.addEventListener(t,e=>e.preventDefault())}),o},o.addControl=t=>{if(!t.html)return o;t.position||(t.position=1);const n=o.controlbar.querySelectorAll(".jsPanel-btn").length;let i=document.createElement("button");i.innerHTML=t.html,i.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,i.style.color=o.header.style.color,t.position>n?o.controlbar.append(i):o.controlbar.insertBefore(i,o.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const a=t.ariaLabel||t.name;return a&&i.setAttribute("aria-label",a),r.pointerup.forEach(e=>{i.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;t.handler.call(o,o,i)})}),t.afterInsert&&t.afterInsert.call(i,i),o},o.setRtl=()=>{[o.header,o.content,o.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang)})},o.id=e.id,o.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(o.style.zIndex=this.zi.next()),i.append(o),o.front(!1,!1),o.setTheme(e.theme),e.boxShadow&&o.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&o.setHeaderLogo(e.headerLogo),o.setIconfont(e.iconfont),o.setHeaderTitle(e.headerTitle),o.setHeaderControls(),r.isIE){let e=[o.headerbar,o.controlbar];switch(o.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px"});break;case"xs":e.forEach(e=>{e.style.height="26px"});break;case"sm":e.forEach(e=>{e.style.height="30px"});break;case"lg":e.forEach(e=>{e.style.height="38px"});break;case"xl":e.forEach(e=>{e.style.height="42px"})}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;o.header.style.opacity=0,o.style.backgroundColor="transparent",this.remClass(o,t),this.setClass(o.content,t),o.header.addEventListener("mouseenter",()=>{o.header.style.opacity=1,r.setClass(o,t),r.remClass(o.content,t)}),o.header.addEventListener("mouseleave",()=>{o.header.style.opacity=0,r.remClass(o,t),r.setClass(o.content,t)})}}else o.setHeaderRemove(),e.addCloseControl&&o.addCloseControl();if(e.headerToolbar&&o.addToolbar(o.headertoolbar,e.headerToolbar),e.footerToolbar&&o.addToolbar(o.footer,e.footerToolbar),e.border&&o.setBorder(e.border),e.borderRadius&&o.setBorderRadius(e.borderRadius),e.css)for(const[t,n]of Object.entries(e.css))if("panel"===t)o.className+=` ${n}`;else{let e=o.querySelector(`.jsPanel-${t}`);e&&(e.className+=` ${n}`)}if(e.content&&("function"==typeof e.content?e.content.call(o,o):"string"==typeof e.content?o.content.innerHTML=e.content:o.content.append(e.content)),e.contentAjax&&this.ajax(e.contentAjax,o),e.contentFetch&&this.fetch(e.contentFetch,o),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?o.content.style.overflow=t[0]:2===t.length&&(o.content.style.overflowX=t[0],o.content.style.overflowY=t[1])}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},r.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let n=o.progressbar.querySelector("div");n.addEventListener("animationend",e=>{e.stopPropagation(),o.progressbar.classList.remove("active"),o.close()}),t.progressbar&&(o.progressbar.classList.add("active"),t.background?r.colorNames[t.background]?o.progressbar.style.background="#"+r.colorNames[t.background]:o.progressbar.style.background=t.background:o.progressbar.classList.add("success-bg")),n.style.animation=`${t.time} progressbar`}if(e.rtl&&o.setRtl(),o.setSize(),o.status="normalized",e.position?this.position(o,e.position):o.style.opacity=1,document.dispatchEvent(u),o.calcSizeFactors(),e.animateIn&&(o.addEventListener("animationend",()=>{this.remClass(o,e.animateIn)}),this.setClass(o,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=r.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t)}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[]}),o.drag(e.dragit),o.addEventListener("jspaneldragstop",e=>{e.panel===o&&o.calcSizeFactors()},!1)):o.titlebar.style.cursor="default",e.resizeit){let t;["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[]}),o.sizeit(e.resizeit),o.addEventListener("jspanelresizestart",e=>{e.panel===o&&(t=o.status)},!1),o.addEventListener("jspanelresizestop",n=>{n.panel===o&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(o.style.height)>parseFloat(window.getComputedStyle(o.header).height)&&(o.setControls([".jsPanel-btn-normalize"]),o.status="normalized",document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every"),o.calcSizeFactors())},!1)}if(o.saveCurrentDimensions(),o.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?o.maximize().smallify():"smallified"===e.setStatus?o.smallify():o[e.setStatus.slice(0,-1)]()),this.pointerdown.forEach(t=>{o.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||o.front()},!1)}),e.onwindowresize&&"window"===o.options.container&&window.addEventListener("resize",o.windowResizeHandler,!1),e.onparentresize){let t=e.onparentresize,n=typeof t,r=o.isChildpanel();if(r){const e=r.content;let i=[];o.parentResizeHandler=a=>{if(a.panel===r){i[0]=e.offsetWidth,i[1]=e.offsetHeight;let r,a,s=o.status;"maximized"===s&&t?o.maximize():o.snapped&&"minimized"!==s?o.snap(o.snapped,!0):"normalized"===s||"smallified"===s||"maximized"===s?"function"===n?t.call(o,o,{width:i[0],height:i[1]}):"object"===n&&!0===t.preset?(r=(i[0]-o.offsetWidth)*o.hf,o.style.left=r<=0?0:r+"px",a=(i[1]-o.offsetHeight)*o.vf,o.style.top=a<=0?0:a+"px",t.callback.call(o,o,{width:i[0],height:i[1]})):"boolean"===n&&(r=(i[0]-o.offsetWidth)*o.hf,o.style.left=r<=0?0:r+"px",a=(i[1]-o.offsetHeight)*o.vf,o.style.top=a<=0?0:a+"px"):"smallifiedmax"===s&&t&&o.maximize().smallify()}},document.addEventListener("jspanelresize",o.parentResizeHandler,!1)}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>e.call(o,o)):this.globalCallbacks.call(o,o)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>e.call(o,o)):e.callback.call(o,o)),t&&(Array.isArray(t)?t.forEach(e=>e.call(o,o)):t.call(o,o)),document.dispatchEvent(a),o}}},7694:function(e,t,n){"use strict";n.r(t)},3513:function(e,t,n){"use strict";n.r(t)},281:function(e,t,n){"use strict";n.r(t)},2526:function(e,t,n){"use strict";n.r(t)},367:function(e,t,n){"use strict";n.r(t)},9648:function(e,t,n){"use strict";n.r(t)},800:function(e,t,n){"use strict";n.r(t)},4672:function(e,t,n){"use strict";n.r(t)},2019:function(e,t,n){"use strict";n.r(t)},5525:function(){},9050:function(e,t,n){"use strict";n.r(t),n.d(t,{VERSION:function(){return i},after:function(){return Ot},all:function(){return en},allKeys:function(){return me},any:function(){return tn},assign:function(){return Oe},before:function(){return It},bind:function(){return xt},bindAll:function(){return Dt},chain:function(){return yt},chunk:function(){return qn},clone:function(){return qe},collect:function(){return Yt},compact:function(){return An},compose:function(){return Ft},constant:function(){return X},contains:function(){return nn},countBy:function(){return vn},create:function(){return $e},debounce:function(){return Tt},default:function(){return Un},defaults:function(){return Ie},defer:function(){return Et},delay:function(){return At},detect:function(){return Ht},difference:function(){return Mn},drop:function(){return Dn},each:function(){return Gt},escape:function(){return at},every:function(){return en},extend:function(){return Fe},extendOwn:function(){return Oe},filter:function(){return Xt},find:function(){return Ht},findIndex:function(){return Rt},findKey:function(){return $t},findLastIndex:function(){return Pt},findWhere:function(){return Wt},first:function(){return Cn},flatten:function(){return En},foldl:function(){return Kt},foldr:function(){return Zt},forEach:function(){return Gt},functions:function(){return je},get:function(){return Ue},groupBy:function(){return gn},has:function(){return Ve},head:function(){return Cn},identity:function(){return He},include:function(){return nn},includes:function(){return nn},indexBy:function(){return mn},indexOf:function(){return Ut},initial:function(){return kn},inject:function(){return Kt},intersection:function(){return Fn},invert:function(){return Te},invoke:function(){return rn},isArguments:function(){return Q},isArray:function(){return W},isArrayBuffer:function(){return $},isBoolean:function(){return E},isDataView:function(){return H},isDate:function(){return F},isElement:function(){return M},isEmpty:function(){return le},isEqual:function(){return ge},isError:function(){return I},isFinite:function(){return K},isFunction:function(){return P},isMap:function(){return Ce},isMatch:function(){return ue},isNaN:function(){return Z},isNull:function(){return S},isNumber:function(){return N},isObject:function(){return D},isRegExp:function(){return O},isSet:function(){return Se},isString:function(){return j},isSymbol:function(){return z},isTypedArray:function(){return ie},isUndefined:function(){return A},isWeakMap:function(){return De},isWeakSet:function(){return Ae},iteratee:function(){return Ke},keys:function(){return se},last:function(){return Sn},lastIndexOf:function(){return Vt},map:function(){return Yt},mapObject:function(){return Xe},matcher:function(){return We},matches:function(){return We},max:function(){return sn},memoize:function(){return St},methods:function(){return je},min:function(){return ln},mixin:function(){return Pn},negate:function(){return Nt},noop:function(){return Je},now:function(){return rt},object:function(){return zn},omit:function(){return xn},once:function(){return zt},pairs:function(){return Me},partial:function(){return wt},partition:function(){return yn},pick:function(){return wn},pluck:function(){return on},property:function(){return Ge},propertyOf:function(){return et},random:function(){return nt},range:function(){return $n},reduce:function(){return Kt},reduceRight:function(){return Zt},reject:function(){return Jt},rest:function(){return Dn},restArguments:function(){return C},result:function(){return gt},sample:function(){return dn},select:function(){return Xt},shuffle:function(){return fn},size:function(){return _n},some:function(){return tn},sortBy:function(){return pn},sortedIndex:function(){return Lt},tail:function(){return Dn},take:function(){return Cn},tap:function(){return Re},template:function(){return ht},templateSettings:function(){return lt},throttle:function(){return Mt},times:function(){return tt},toArray:function(){return cn},toPath:function(){return Pe},transpose:function(){return On},unescape:function(){return st},union:function(){return Nn},uniq:function(){return jn},unique:function(){return jn},uniqueId:function(){return vt},unzip:function(){return On},values:function(){return Ee},where:function(){return an},without:function(){return Tn},wrap:function(){return jt},zip:function(){return In}});var r={};n.r(r),n.d(r,{VERSION:function(){return i},after:function(){return Ot},all:function(){return en},allKeys:function(){return me},any:function(){return tn},assign:function(){return Oe},before:function(){return It},bind:function(){return xt},bindAll:function(){return Dt},chain:function(){return yt},chunk:function(){return qn},clone:function(){return qe},collect:function(){return Yt},compact:function(){return An},compose:function(){return Ft},constant:function(){return X},contains:function(){return nn},countBy:function(){return vn},create:function(){return $e},debounce:function(){return Tt},default:function(){return Ln},defaults:function(){return Ie},defer:function(){return Et},delay:function(){return At},detect:function(){return Ht},difference:function(){return Mn},drop:function(){return Dn},each:function(){return Gt},escape:function(){return at},every:function(){return en},extend:function(){return Fe},extendOwn:function(){return Oe},filter:function(){return Xt},find:function(){return Ht},findIndex:function(){return Rt},findKey:function(){return $t},findLastIndex:function(){return Pt},findWhere:function(){return Wt},first:function(){return Cn},flatten:function(){return En},foldl:function(){return Kt},foldr:function(){return Zt},forEach:function(){return Gt},functions:function(){return je},get:function(){return Ue},groupBy:function(){return gn},has:function(){return Ve},head:function(){return Cn},identity:function(){return He},include:function(){return nn},includes:function(){return nn},indexBy:function(){return mn},indexOf:function(){return Ut},initial:function(){return kn},inject:function(){return Kt},intersection:function(){return Fn},invert:function(){return Te},invoke:function(){return rn},isArguments:function(){return Q},isArray:function(){return W},isArrayBuffer:function(){return $},isBoolean:function(){return E},isDataView:function(){return H},isDate:function(){return F},isElement:function(){return M},isEmpty:function(){return le},isEqual:function(){return ge},isError:function(){return I},isFinite:function(){return K},isFunction:function(){return P},isMap:function(){return Ce},isMatch:function(){return ue},isNaN:function(){return Z},isNull:function(){return S},isNumber:function(){return N},isObject:function(){return D},isRegExp:function(){return O},isSet:function(){return Se},isString:function(){return j},isSymbol:function(){return z},isTypedArray:function(){return ie},isUndefined:function(){return A},isWeakMap:function(){return De},isWeakSet:function(){return Ae},iteratee:function(){return Ke},keys:function(){return se},last:function(){return Sn},lastIndexOf:function(){return Vt},map:function(){return Yt},mapObject:function(){return Xe},matcher:function(){return We},matches:function(){return We},max:function(){return sn},memoize:function(){return St},methods:function(){return je},min:function(){return ln},mixin:function(){return Pn},negate:function(){return Nt},noop:function(){return Je},now:function(){return rt},object:function(){return zn},omit:function(){return xn},once:function(){return zt},pairs:function(){return Me},partial:function(){return wt},partition:function(){return yn},pick:function(){return wn},pluck:function(){return on},property:function(){return Ge},propertyOf:function(){return et},random:function(){return nt},range:function(){return $n},reduce:function(){return Kt},reduceRight:function(){return Zt},reject:function(){return Jt},rest:function(){return Dn},restArguments:function(){return C},result:function(){return gt},sample:function(){return dn},select:function(){return Xt},shuffle:function(){return fn},size:function(){return _n},some:function(){return tn},sortBy:function(){return pn},sortedIndex:function(){return Lt},tail:function(){return Dn},take:function(){return Cn},tap:function(){return Re},template:function(){return ht},templateSettings:function(){return lt},throttle:function(){return Mt},times:function(){return tt},toArray:function(){return cn},toPath:function(){return Pe},transpose:function(){return On},unescape:function(){return st},union:function(){return Nn},uniq:function(){return jn},unique:function(){return jn},uniqueId:function(){return vt},unzip:function(){return On},values:function(){return Ee},where:function(){return an},without:function(){return Tn},wrap:function(){return jt},zip:function(){return In}});var i="1.13.7",o="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},a=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,u=a.push,c=a.slice,d=s.toString,f=s.hasOwnProperty,p="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof DataView,g=Array.isArray,m=Object.keys,v=Object.create,y=p&&ArrayBuffer.isView,_=isNaN,b=isFinite,w=!{toString:null}.propertyIsEnumerable("toString"),x=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],k=Math.pow(2,53)-1;function C(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=r,e.apply(this,o)}}function D(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function S(e){return null===e}function A(e){return void 0===e}function E(e){return!0===e||!1===e||"[object Boolean]"===d.call(e)}function M(e){return!(!e||1!==e.nodeType)}function T(e){var t="[object "+e+"]";return function(e){return d.call(e)===t}}var j=T("String"),N=T("Number"),F=T("Date"),O=T("RegExp"),I=T("Error"),z=T("Symbol"),$=T("ArrayBuffer"),q=T("Function"),R=o.document&&o.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof R&&(q=function(e){return"function"==typeof e||!1});var P=q,L=T("Object"),B=h&&(!/\[native code\]/.test(String(DataView))||L(new DataView(new ArrayBuffer(8)))),U="undefined"!=typeof Map&&L(new Map),V=T("DataView"),H=B?function(e){return null!=e&&P(e.getInt8)&&$(e.buffer)}:V,W=g||T("Array");function G(e,t){return null!=e&&f.call(e,t)}var Y=T("Arguments");!function(){Y(arguments)||(Y=function(e){return G(e,"callee")})}();var Q=Y;function K(e){return!z(e)&&b(e)&&!isNaN(parseFloat(e))}function Z(e){return N(e)&&_(e)}function X(e){return function(){return e}}function J(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=k}}function ee(e){return function(t){return null==t?void 0:t[e]}}var te=ee("byteLength"),ne=J(te),re=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,ie=p?function(e){return y?y(e)&&!H(e):ne(e)&&re.test(d.call(e))}:X(!1),oe=ee("length");function ae(e,t){t=function(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return!0===t[e]},push:function(n){return t[n]=!0,e.push(n)}}}(t);var n=x.length,r=e.constructor,i=P(r)&&r.prototype||s,o="constructor";for(G(e,o)&&!t.contains(o)&&t.push(o);n--;)(o=x[n])in e&&e[o]!==i[o]&&!t.contains(o)&&t.push(o)}function se(e){if(!D(e))return[];if(m)return m(e);var t=[];for(var n in e)G(e,n)&&t.push(n);return w&&ae(e,t),t}function le(e){if(null==e)return!0;var t=oe(e);return"number"==typeof t&&(W(e)||j(e)||Q(e))?0===t:0===oe(se(e))}function ue(e,t){var n=se(t),r=n.length;if(null==e)return!r;for(var i=Object(e),o=0;o<r;o++){var a=n[o];if(t[a]!==i[a]||!(a in i))return!1}return!0}function ce(e){return e instanceof ce?e:this instanceof ce?void(this._wrapped=e):new ce(e)}function de(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,te(e))}ce.VERSION=i,ce.prototype.value=function(){return this._wrapped},ce.prototype.valueOf=ce.prototype.toJSON=ce.prototype.value,ce.prototype.toString=function(){return String(this._wrapped)};var fe="[object DataView]";function pe(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&he(e,t,n,r)}function he(e,t,n,r){e instanceof ce&&(e=e._wrapped),t instanceof ce&&(t=t._wrapped);var i=d.call(e);if(i!==d.call(t))return!1;if(B&&"[object Object]"==i&&H(e)){if(!H(t))return!1;i=fe}switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0===+e?1/+e==1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t;case"[object Symbol]":return l.valueOf.call(e)===l.valueOf.call(t);case"[object ArrayBuffer]":case fe:return he(de(e),de(t),n,r)}var o="[object Array]"===i;if(!o&&ie(e)){if(te(e)!==te(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(P(a)&&a instanceof a&&P(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),o){if((u=e.length)!==t.length)return!1;for(;u--;)if(!pe(e[u],t[u],n,r))return!1}else{var c,f=se(e);if(u=f.length,se(t).length!==u)return!1;for(;u--;)if(!G(t,c=f[u])||!pe(e[c],t[c],n,r))return!1}return n.pop(),r.pop(),!0}function ge(e,t){return pe(e,t)}function me(e){if(!D(e))return[];var t=[];for(var n in e)t.push(n);return w&&ae(e,t),t}function ve(e){var t=oe(e);return function(n){if(null==n)return!1;var r=me(n);if(oe(r))return!1;for(var i=0;i<t;i++)if(!P(n[e[i]]))return!1;return e!==xe||!P(n[ye])}}var ye="forEach",_e=["clear","delete"],be=["get","has","set"],we=_e.concat(ye,be),xe=_e.concat(be),ke=["add"].concat(_e,ye,"has"),Ce=U?ve(we):T("Map"),De=U?ve(xe):T("WeakMap"),Se=U?ve(ke):T("Set"),Ae=T("WeakSet");function Ee(e){for(var t=se(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r}function Me(e){for(var t=se(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r}function Te(e){for(var t={},n=se(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t}function je(e){var t=[];for(var n in e)P(e[n])&&t.push(n);return t.sort()}function Ne(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=e(o),s=a.length,l=0;l<s;l++){var u=a[l];t&&void 0!==n[u]||(n[u]=o[u])}return n}}var Fe=Ne(me),Oe=Ne(se),Ie=Ne(me,!0);function ze(e){if(!D(e))return{};if(v)return v(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function $e(e,t){var n=ze(e);return t&&Oe(n,t),n}function qe(e){return D(e)?W(e)?e.slice():Fe({},e):e}function Re(e,t){return t(e),e}function Pe(e){return W(e)?e:[e]}function Le(e){return ce.toPath(e)}function Be(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0}function Ue(e,t,n){var r=Be(e,Le(t));return A(r)?n:r}function Ve(e,t){for(var n=(t=Le(t)).length,r=0;r<n;r++){var i=t[r];if(!G(e,i))return!1;e=e[i]}return!!n}function He(e){return e}function We(e){return e=Oe({},e),function(t){return ue(t,e)}}function Ge(e){return e=Le(e),function(t){return Be(t,e)}}function Ye(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}}function Qe(e,t,n){return null==e?He:P(e)?Ye(e,t,n):D(e)&&!W(e)?We(e):Ge(e)}function Ke(e,t){return Qe(e,t,1/0)}function Ze(e,t,n){return ce.iteratee!==Ke?ce.iteratee(e,t):Qe(e,t,n)}function Xe(e,t,n){t=Ze(t,n);for(var r=se(e),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=t(e[s],s,e)}return o}function Je(){}function et(e){return null==e?Je:function(t){return Ue(e,t)}}function tt(e,t,n){var r=Array(Math.max(0,e));t=Ye(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r}function nt(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ce.toPath=Pe,ce.iteratee=Ke;var rt=Date.now||function(){return(new Date).getTime()};function it(e){var t=function(t){return e[t]},n="(?:"+se(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}}var ot={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},at=it(ot),st=it(Te(ot)),lt=ce.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},ut=/(.)^/,ct={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},dt=/\\|'|\r|\n|\u2028|\u2029/g;function ft(e){return"\\"+ct[e]}var pt=/^\s*(\w|\$)+\s*$/;function ht(e,t,n){!t&&n&&(t=n),t=Ie({},t,ce.templateSettings);var r=RegExp([(t.escape||ut).source,(t.interpolate||ut).source,(t.evaluate||ut).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(r,function(t,n,r,a,s){return o+=e.slice(i,s).replace(dt,ft),i=s+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n";var a,s=t.variable;if(s){if(!pt.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(e){throw e.source=o,e}var l=function(e){return a.call(this,e,ce)};return l.source="function("+s+"){\n"+o+"}",l}function gt(e,t,n){var r=(t=Le(t)).length;if(!r)return P(n)?n.call(e):n;for(var i=0;i<r;i++){var o=null==e?void 0:e[t[i]];void 0===o&&(o=n,i=r),e=P(o)?o.call(e):o}return e}var mt=0;function vt(e){var t=++mt+"";return e?e+t:t}function yt(e){var t=ce(e);return t._chain=!0,t}function _t(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=ze(e.prototype),a=e.apply(o,i);return D(a)?a:o}var bt=C(function(e,t){var n=bt.placeholder,r=function(){for(var i=0,o=t.length,a=Array(o),s=0;s<o;s++)a[s]=t[s]===n?arguments[i++]:t[s];for(;i<arguments.length;)a.push(arguments[i++]);return _t(e,r,this,this,a)};return r});bt.placeholder=ce;var wt=bt,xt=C(function(e,t,n){if(!P(e))throw new TypeError("Bind must be called on a function");var r=C(function(i){return _t(e,r,t,this,n.concat(i))});return r}),kt=J(oe);function Ct(e,t,n,r){if(r=r||[],t||0===t){if(t<=0)return r.concat(e)}else t=1/0;for(var i=r.length,o=0,a=oe(e);o<a;o++){var s=e[o];if(kt(s)&&(W(s)||Q(s)))if(t>1)Ct(s,t-1,n,r),i=r.length;else for(var l=0,u=s.length;l<u;)r[i++]=s[l++];else n||(r[i++]=s)}return r}var Dt=C(function(e,t){var n=(t=Ct(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=xt(e[r],e)}return e});function St(e,t){var n=function(r){var i=n.cache,o=""+(t?t.apply(this,arguments):r);return G(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n}var At=C(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),Et=wt(At,ce,1);function Mt(e,t,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:rt(),r=null,a=e.apply(i,o),r||(i=o=null)},u=function(){var u=rt();s||!1!==n.leading||(s=u);var c=t-(u-s);return i=this,o=arguments,c<=0||c>t?(r&&(clearTimeout(r),r=null),s=u,a=e.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,c)),a};return u.cancel=function(){clearTimeout(r),s=0,r=i=o=null},u}function Tt(e,t,n){var r,i,o,a,s,l=function(){var u=rt()-i;t>u?r=setTimeout(l,t-u):(r=null,n||(a=e.apply(s,o)),r||(o=s=null))},u=C(function(u){return s=this,o=u,i=rt(),r||(r=setTimeout(l,t),n&&(a=e.apply(s,o))),a});return u.cancel=function(){clearTimeout(r),r=o=s=null},u}function jt(e,t){return wt(t,e)}function Nt(e){return function(){return!e.apply(this,arguments)}}function Ft(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}function Ot(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function It(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var zt=wt(It,2);function $t(e,t,n){t=Ze(t,n);for(var r,i=se(e),o=0,a=i.length;o<a;o++)if(t(e[r=i[o]],r,e))return r}function qt(e){return function(t,n,r){n=Ze(n,r);for(var i=oe(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(n(t[o],o,t))return o;return-1}}var Rt=qt(1),Pt=qt(-1);function Lt(e,t,n,r){for(var i=(n=Ze(n,r,1))(t),o=0,a=oe(e);o<a;){var s=Math.floor((o+a)/2);n(e[s])<i?o=s+1:a=s}return o}function Bt(e,t,n){return function(r,i,o){var a=0,s=oe(r);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=t(c.call(r,a,s),Z))>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&o<s;o+=e)if(r[o]===i)return o;return-1}}var Ut=Bt(1,Rt,Lt),Vt=Bt(-1,Pt);function Ht(e,t,n){var r=(kt(e)?Rt:$t)(e,t,n);if(void 0!==r&&-1!==r)return e[r]}function Wt(e,t){return Ht(e,We(t))}function Gt(e,t,n){var r,i;if(t=Ye(t,n),kt(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var o=se(e);for(r=0,i=o.length;r<i;r++)t(e[o[r]],o[r],e)}return e}function Yt(e,t,n){t=Ze(t,n);for(var r=!kt(e)&&se(e),i=(r||e).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=t(e[s],s,e)}return o}function Qt(e){return function(t,n,r,i){var o=arguments.length>=3;return function(t,n,r,i){var o=!kt(t)&&se(t),a=(o||t).length,s=e>0?0:a-1;for(i||(r=t[o?o[s]:s],s+=e);s>=0&&s<a;s+=e){var l=o?o[s]:s;r=n(r,t[l],l,t)}return r}(t,Ye(n,i,4),r,o)}}var Kt=Qt(1),Zt=Qt(-1);function Xt(e,t,n){var r=[];return t=Ze(t,n),Gt(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function Jt(e,t,n){return Xt(e,Nt(Ze(t)),n)}function en(e,t,n){t=Ze(t,n);for(var r=!kt(e)&&se(e),i=(r||e).length,o=0;o<i;o++){var a=r?r[o]:o;if(!t(e[a],a,e))return!1}return!0}function tn(e,t,n){t=Ze(t,n);for(var r=!kt(e)&&se(e),i=(r||e).length,o=0;o<i;o++){var a=r?r[o]:o;if(t(e[a],a,e))return!0}return!1}function nn(e,t,n,r){return kt(e)||(e=Ee(e)),("number"!=typeof n||r)&&(n=0),Ut(e,t,n)>=0}var rn=C(function(e,t,n){var r,i;return P(t)?i=t:(t=Le(t),r=t.slice(0,-1),t=t[t.length-1]),Yt(e,function(e){var o=i;if(!o){if(r&&r.length&&(e=Be(e,r)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)})});function on(e,t){return Yt(e,Ge(t))}function an(e,t){return Xt(e,We(t))}function sn(e,t,n){var r,i,o=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=kt(e)?e:Ee(e)).length;s<l;s++)null!=(r=e[s])&&r>o&&(o=r);else t=Ze(t,n),Gt(e,function(e,n,r){((i=t(e,n,r))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o}function ln(e,t,n){var r,i,o=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=kt(e)?e:Ee(e)).length;s<l;s++)null!=(r=e[s])&&r<o&&(o=r);else t=Ze(t,n),Gt(e,function(e,n,r){((i=t(e,n,r))<a||i===1/0&&o===1/0)&&(o=e,a=i)});return o}var un=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function cn(e){return e?W(e)?c.call(e):j(e)?e.match(un):kt(e)?Yt(e,He):Ee(e):[]}function dn(e,t,n){if(null==t||n)return kt(e)||(e=Ee(e)),e[nt(e.length-1)];var r=cn(e),i=oe(r);t=Math.max(Math.min(t,i),0);for(var o=i-1,a=0;a<t;a++){var s=nt(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,t)}function fn(e){return dn(e,1/0)}function pn(e,t,n){var r=0;return t=Ze(t,n),on(Yt(e,function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index}),"value")}function hn(e,t){return function(n,r,i){var o=t?[[],[]]:{};return r=Ze(r,i),Gt(n,function(t,i){var a=r(t,i,n);e(o,t,a)}),o}}var gn=hn(function(e,t,n){G(e,n)?e[n].push(t):e[n]=[t]}),mn=hn(function(e,t,n){e[n]=t}),vn=hn(function(e,t,n){G(e,n)?e[n]++:e[n]=1}),yn=hn(function(e,t,n){e[n?0:1].push(t)},!0);function _n(e){return null==e?0:kt(e)?e.length:se(e).length}function bn(e,t,n){return t in n}var wn=C(function(e,t){var n={},r=t[0];if(null==e)return n;P(r)?(t.length>1&&(r=Ye(r,t[1])),t=me(e)):(r=bn,t=Ct(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i<o;i++){var a=t[i],s=e[a];r(s,a,e)&&(n[a]=s)}return n}),xn=C(function(e,t){var n,r=t[0];return P(r)?(r=Nt(r),t.length>1&&(n=t[1])):(t=Yt(Ct(t,!1,!1),String),r=function(e,n){return!nn(t,n)}),wn(e,r,n)});function kn(e,t,n){return c.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function Cn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:kn(e,e.length-t)}function Dn(e,t,n){return c.call(e,null==t||n?1:t)}function Sn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:Dn(e,Math.max(0,e.length-t))}function An(e){return Xt(e,Boolean)}function En(e,t){return Ct(e,t,!1)}var Mn=C(function(e,t){return t=Ct(t,!0,!0),Xt(e,function(e){return!nn(t,e)})}),Tn=C(function(e,t){return Mn(e,t)});function jn(e,t,n,r){E(t)||(r=n,n=t,t=!1),null!=n&&(n=Ze(n,r));for(var i=[],o=[],a=0,s=oe(e);a<s;a++){var l=e[a],u=n?n(l,a,e):l;t&&!n?(a&&o===u||i.push(l),o=u):n?nn(o,u)||(o.push(u),i.push(l)):nn(i,l)||i.push(l)}return i}var Nn=C(function(e){return jn(Ct(e,!0,!0))});function Fn(e){for(var t=[],n=arguments.length,r=0,i=oe(e);r<i;r++){var o=e[r];if(!nn(t,o)){var a;for(a=1;a<n&&nn(arguments[a],o);a++);a===n&&t.push(o)}}return t}function On(e){for(var t=e&&sn(e,oe).length||0,n=Array(t),r=0;r<t;r++)n[r]=on(e,r);return n}var In=C(On);function zn(e,t){for(var n={},r=0,i=oe(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n}function $n(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;o<r;o++,e+=n)i[o]=e;return i}function qn(e,t){if(null==t||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(c.call(e,r,r+=t));return n}function Rn(e,t){return e._chain?ce(t).chain():t}function Pn(e){return Gt(je(e),function(t){var n=ce[t]=e[t];ce.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),Rn(this,n.apply(ce,e))}}),ce}Gt(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];ce.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),Rn(this,n)}}),Gt(["concat","join","slice"],function(e){var t=a[e];ce.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Rn(this,e)}});var Ln=ce,Bn=Pn(r);Bn._=Bn;var Un=Bn}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e=n(9983);window.jQuery=e,window.$=e,n(7694),n(2526),n(281),n(3513),n(800),n(367),n(9648),n(7915),n(4672),n(2019);var t=n(3110);Math.log10=Math.log10||function(e){return Math.log(e)/Math.LN10},window.hivtrace=t}()}();
2
+ !function(){var e={1639:function(e,t,n){"use strict";e.exports=n(9281)},7114:function(e,t,n){"use strict";var r=n(5670),i={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:"0"},defaultClasses:{root:"algolia-autocomplete",prefix:"aa",noPrefix:!1,dropdownMenu:"dropdown-menu",input:"input",hint:"hint",suggestions:"suggestions",suggestion:"suggestion",cursor:"cursor",dataset:"dataset",empty:"empty"},appendTo:{wrapper:{position:"absolute",zIndex:"100",display:"none"},input:{},inputWithNoHint:{},dropdown:{display:"block"}}};r.isMsie()&&r.mixin(i.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),r.isMsie()&&r.isMsie()<=7&&r.mixin(i.input,{marginTop:"-1px"}),e.exports=i},3312:function(e,t,n){"use strict";var r="aaDataset",i="aaValue",o="aaDatum",a=n(5670),s=n(3855),l=n(6619),u=n(7114),c=n(6823);function d(e){var t,n,r,i;(e=e||{}).templates=e.templates||{},e.source||a.error("missing source"),e.name&&(t=e.name,!/^[_a-zA-Z0-9-]+$/.test(t))&&a.error("invalid dataset name: "+e.name),this.query=null,this._isEmpty=!0,this.highlight=!!e.highlight,this.name=void 0===e.name||null===e.name?a.getUniqueId():e.name,this.source=e.source,this.displayFn=(i=(i=e.display||e.displayKey)||"value",a.isFunction(i)?i:function(e){return e[i]}),this.debounce=e.debounce,this.cache=!1!==e.cache,this.templates=(n=e.templates,r=this.displayFn,{empty:n.empty&&a.templatify(n.empty),header:n.header&&a.templatify(n.header),footer:n.footer&&a.templatify(n.footer),suggestion:n.suggestion||function(e){return"<p>"+r(e)+"</p>"}}),this.css=a.mixin({},u,e.appendTo?u.appendTo:{}),this.cssClasses=e.cssClasses=a.mixin({},u.defaultClasses,e.cssClasses||{}),this.cssClasses.prefix=e.cssClasses.formattedPrefix||a.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix);var o=a.className(this.cssClasses.prefix,this.cssClasses.dataset);this.$el=e.$menu&&e.$menu.find(o+"-"+this.name).length>0?s.element(e.$menu.find(o+"-"+this.name)[0]):s.element(l.dataset.replace("%CLASS%",this.name).replace("%PREFIX%",this.cssClasses.prefix).replace("%DATASET%",this.cssClasses.dataset)),this.$menu=e.$menu,this.clearCachedSuggestions()}d.extractDatasetName=function(e){return s.element(e).data(r)},d.extractValue=function(e){return s.element(e).data(i)},d.extractDatum=function(e){var t=s.element(e).data(o);return"string"==typeof t&&(t=JSON.parse(t)),t},a.mixin(d.prototype,c,{_render:function(e,t){if(this.$el){var n,u=this,c=[].slice.call(arguments,2);if(this.$el.empty(),n=t&&t.length,this._isEmpty=!n,!n&&this.templates.empty)this.$el.html(function(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!0}].concat(t),u.templates.empty.apply(this,t)}.apply(this,c)).prepend(u.templates.header?d.apply(this,c):null).append(u.templates.footer?f.apply(this,c):null);else if(n)this.$el.html(function(){var e,n,c=[].slice.call(arguments,0),d=this,f=l.suggestions.replace("%PREFIX%",this.cssClasses.prefix).replace("%SUGGESTIONS%",this.cssClasses.suggestions);return e=s.element(f).css(this.css.suggestions),n=a.map(t,function(e){var t,n=l.suggestion.replace("%PREFIX%",d.cssClasses.prefix).replace("%SUGGESTION%",d.cssClasses.suggestion);return(t=s.element(n).attr({role:"option",id:["option",Math.floor(1e8*Math.random())].join("-")}).append(u.templates.suggestion.apply(this,[e].concat(c)))).data(r,u.name),t.data(i,u.displayFn(e)||void 0),t.data(o,JSON.stringify(e)),t.children().each(function(){s.element(this).css(d.css.suggestionChild)}),t}),e.append.apply(e,n),e}.apply(this,c)).prepend(u.templates.header?d.apply(this,c):null).append(u.templates.footer?f.apply(this,c):null);else if(t&&!Array.isArray(t))throw new TypeError("suggestions must be an array");this.$menu&&this.$menu.addClass(this.cssClasses.prefix+(n?"with":"without")+"-"+this.name).removeClass(this.cssClasses.prefix+(n?"without":"with")+"-"+this.name),this.trigger("rendered",e)}function d(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!n}].concat(t),u.templates.header.apply(this,t)}function f(){var t=[].slice.call(arguments,0);return t=[{query:e,isEmpty:!n}].concat(t),u.templates.footer.apply(this,t)}},getRoot:function(){return this.$el},update:function(e){function t(t){if(!this.canceled&&e===this.query){var n=[].slice.call(arguments,1);this.cacheSuggestions(e,t,n),this._render.apply(this,[e,t].concat(n))}}if(this.query=e,this.canceled=!1,this.shouldFetchFromCache(e))t.apply(this,[this.cachedSuggestions].concat(this.cachedRenderExtraArgs));else{var n=this,r=function(){n.canceled||n.source(e,t.bind(n))};this.debounce?(clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(function(){n.debounceTimeout=null,r()},this.debounce)):r()}},cacheSuggestions:function(e,t,n){this.cachedQuery=e,this.cachedSuggestions=t,this.cachedRenderExtraArgs=n},shouldFetchFromCache:function(e){return this.cache&&this.cachedQuery===e&&this.cachedSuggestions&&this.cachedSuggestions.length},clearCachedSuggestions:function(){delete this.cachedQuery,delete this.cachedSuggestions,delete this.cachedRenderExtraArgs},cancel:function(){this.canceled=!0},clear:function(){this.$el&&(this.cancel(),this.$el.empty(),this.trigger("rendered",""))},isEmpty:function(){return this._isEmpty},destroy:function(){this.clearCachedSuggestions(),this.$el=null}}),e.exports=d},5445:function(e,t,n){"use strict";var r=n(5670),i=n(3855),o=n(6823),a=n(3312),s=n(7114);function l(e){var t,n,o,a=this;(e=e||{}).menu||r.error("menu is required"),r.isArray(e.datasets)||r.isObject(e.datasets)||r.error("1 or more datasets required"),e.datasets||r.error("datasets is required"),this.isOpen=!1,this.isEmpty=!0,this.minLength=e.minLength||0,this.templates={},this.appendTo=e.appendTo||!1,this.css=r.mixin({},s,e.appendTo?s.appendTo:{}),this.cssClasses=e.cssClasses=r.mixin({},s.defaultClasses,e.cssClasses||{}),this.cssClasses.prefix=e.cssClasses.formattedPrefix||r.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix),t=r.bind(this._onSuggestionClick,this),n=r.bind(this._onSuggestionMouseEnter,this),o=r.bind(this._onSuggestionMouseLeave,this);var u=r.className(this.cssClasses.prefix,this.cssClasses.suggestion);this.$menu=i.element(e.menu).on("mouseenter.aa",u,n).on("mouseleave.aa",u,o).on("click.aa",u,t),this.$container=e.appendTo?e.wrapper:this.$menu,e.templates&&e.templates.header&&(this.templates.header=r.templatify(e.templates.header),this.$menu.prepend(this.templates.header())),e.templates&&e.templates.empty&&(this.templates.empty=r.templatify(e.templates.empty),this.$empty=i.element('<div class="'+r.className(this.cssClasses.prefix,this.cssClasses.empty,!0)+'"></div>'),this.$menu.append(this.$empty),this.$empty.hide()),this.datasets=r.map(e.datasets,function(t){return function(e,t,n){return new l.Dataset(r.mixin({$menu:e,cssClasses:n},t))}(a.$menu,t,e.cssClasses)}),r.each(this.datasets,function(e){var t=e.getRoot();t&&0===t.parent().length&&a.$menu.append(t),e.onSync("rendered",a._onRendered,a)}),e.templates&&e.templates.footer&&(this.templates.footer=r.templatify(e.templates.footer),this.$menu.append(this.templates.footer()));var c=this;i.element(window).resize(function(){c._redraw()})}r.mixin(l.prototype,o,{_onSuggestionClick:function(e){this.trigger("suggestionClicked",i.element(e.currentTarget))},_onSuggestionMouseEnter:function(e){var t=i.element(e.currentTarget);if(!t.hasClass(r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0))){this._removeCursor();var n=this;setTimeout(function(){n._setCursor(t,!1)},0)}},_onSuggestionMouseLeave:function(e){e.relatedTarget&&i.element(e.relatedTarget).closest("."+r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).length>0||(this._removeCursor(),this.trigger("cursorRemoved"))},_onRendered:function(e,t){if(this.isEmpty=r.every(this.datasets,function(e){return e.isEmpty()}),this.isEmpty)if(t.length>=this.minLength&&this.trigger("empty"),this.$empty)if(t.length<this.minLength)this._hide();else{var n=this.templates.empty({query:this.datasets[0]&&this.datasets[0].query});this.$empty.html(n),this.$empty.show(),this._show()}else r.any(this.datasets,function(e){return e.templates&&e.templates.empty})?t.length<this.minLength?this._hide():this._show():this._hide();else this.isOpen&&(this.$empty&&(this.$empty.empty(),this.$empty.hide()),t.length>=this.minLength?this._show():this._hide());this.trigger("datasetRendered")},_hide:function(){this.$container.hide()},_show:function(){this.$container.css("display","block"),this._redraw(),this.trigger("shown")},_redraw:function(){this.isOpen&&this.appendTo&&this.trigger("redrawn")},_getSuggestions:function(){return this.$menu.find(r.className(this.cssClasses.prefix,this.cssClasses.suggestion))},_getCursor:function(){return this.$menu.find(r.className(this.cssClasses.prefix,this.cssClasses.cursor)).first()},_setCursor:function(e,t){e.first().addClass(r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).attr("aria-selected","true"),this.trigger("cursorMoved",t)},_removeCursor:function(){this._getCursor().removeClass(r.className(this.cssClasses.prefix,this.cssClasses.cursor,!0)).removeAttr("aria-selected")},_moveCursor:function(e){var t,n,r,i;this.isOpen&&(n=this._getCursor(),t=this._getSuggestions(),this._removeCursor(),-1!=(r=((r=t.index(n)+e)+1)%(t.length+1)-1)?(r<-1&&(r=t.length-1),this._setCursor(i=t.eq(r),!0),this._ensureVisible(i)):this.trigger("cursorRemoved"))},_ensureVisible:function(e){var t,n,r,i;n=(t=e.position().top)+e.height()+parseInt(e.css("margin-top"),10)+parseInt(e.css("margin-bottom"),10),r=this.$menu.scrollTop(),i=this.$menu.height()+parseInt(this.$menu.css("padding-top"),10)+parseInt(this.$menu.css("padding-bottom"),10),t<0?this.$menu.scrollTop(r+t):i<n&&this.$menu.scrollTop(r+(n-i))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,this.isEmpty||this._show(),this.trigger("opened"))},setLanguageDirection:function(e){this.$menu.css("ltr"===e?this.css.ltr:this.css.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(e){var t=null;return e.length&&(t={raw:a.extractDatum(e),value:a.extractValue(e),datasetName:a.extractDatasetName(e)}),t},getCurrentCursor:function(){return this._getCursor().first()},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},cursorTopSuggestion:function(){this._setCursor(this._getSuggestions().first(),!1)},update:function(e){r.each(this.datasets,function(t){t.update(e)})},empty:function(){r.each(this.datasets,function(e){e.clear()}),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){this.$menu.off(".aa"),this.$menu=null,r.each(this.datasets,function(e){e.destroy()})}}),l.Dataset=a,e.exports=l},7368:function(e,t,n){"use strict";var r=n(5670),i=n(3855);function o(e){e&&e.el||r.error("EventBus initialized without el"),this.$el=i.element(e.el)}r.mixin(o.prototype,{trigger:function(e,t,n,i){var o=r.Event("autocomplete:"+e);return this.$el.trigger(o,[t,n,i]),o}}),e.exports=o},6823:function(e,t,n){"use strict";var r=n(624),i=/\s+/;function o(e,t,n,r){var o;if(!n)return this;for(t=t.split(i),n=r?function(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}(n,r):n,this._callbacks=this._callbacks||{};o=t.shift();)this._callbacks[o]=this._callbacks[o]||{sync:[],async:[]},this._callbacks[o][e].push(n);return this}function a(e,t,n){return function(){for(var r,i=0,o=e.length;!r&&i<o;i+=1)r=!1===e[i].apply(t,n);return!r}}e.exports={onSync:function(e,t,n){return o.call(this,"sync",e,t,n)},onAsync:function(e,t,n){return o.call(this,"async",e,t,n)},off:function(e){var t;if(!this._callbacks)return this;for(e=e.split(i);t=e.shift();)delete this._callbacks[t];return this},trigger:function(e){var t,n,o,s,l;if(!this._callbacks)return this;for(e=e.split(i),o=[].slice.call(arguments,1);(t=e.shift())&&(n=this._callbacks[t]);)s=a(n.sync,this,[t].concat(o)),l=a(n.async,this,[t].concat(o)),s()&&r(l);return this}}},6619:function(e){"use strict";e.exports={wrapper:'<span class="%ROOT%"></span>',dropdown:'<span class="%PREFIX%%DROPDOWN_MENU%"></span>',dataset:'<div class="%PREFIX%%DATASET%-%CLASS%"></div>',suggestions:'<span class="%PREFIX%%SUGGESTIONS%"></span>',suggestion:'<div class="%PREFIX%%SUGGESTION%"></div>'}},1286:function(e,t,n){"use strict";var r;r={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};var i=n(5670),o=n(3855),a=n(6823);function s(e){var t,n,a,s,l,u=this;(e=e||{}).input||i.error("input is missing"),t=i.bind(this._onBlur,this),n=i.bind(this._onFocus,this),a=i.bind(this._onKeydown,this),s=i.bind(this._onInput,this),this.$hint=o.element(e.hint),this.$input=o.element(e.input).on("blur.aa",t).on("focus.aa",n).on("keydown.aa",a),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=i.noop),i.isMsie()?this.$input.on("keydown.aa keypress.aa cut.aa paste.aa",function(e){r[e.which||e.keyCode]||i.defer(i.bind(u._onInput,u,e))}):this.$input.on("input.aa",s),this.query=this.$input.val(),this.$overflowHelper=(l=this.$input,o.element('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:l.css("font-family"),fontSize:l.css("font-size"),fontStyle:l.css("font-style"),fontVariant:l.css("font-variant"),fontWeight:l.css("font-weight"),wordSpacing:l.css("word-spacing"),letterSpacing:l.css("letter-spacing"),textIndent:l.css("text-indent"),textRendering:l.css("text-rendering"),textTransform:l.css("text-transform")}).insertAfter(l))}function l(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}s.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},i.mixin(s.prototype,a,{_onBlur:function(){this.resetInputValue(),this.$input.removeAttr("aria-activedescendant"),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(e){var t=r[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(e,t){var n,r,i;switch(e){case"tab":r=this.getHint(),i=this.getInputValue(),n=r&&r!==i&&!l(t);break;case"up":case"down":n=!l(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){return"tab"!==e||!l(t)},_checkInputValue:function(){var e,t,n,r,i;r=e=this.getInputValue(),i=this.query,n=!(!(t=s.normalizeQuery(r)===s.normalizeQuery(i))||!this.query)&&this.query.length!==e.length,this.query=e,t?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(e){this.query=e},getInputValue:function(){return this.$input.val()},setInputValue:function(e,t){void 0===e&&(e=this.query),this.$input.val(e),t?this.clearHint():this._checkInputValue()},expand:function(){this.$input.attr("aria-expanded","true")},collapse:function(){this.$input.attr("aria-expanded","false")},setActiveDescendant:function(e){this.$input.attr("aria-activedescendant",e)},removeActiveDescendant:function(){this.$input.removeAttr("aria-activedescendant")},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n;n=(e=this.getInputValue())!==(t=this.getHint())&&0===t.indexOf(e),""!==e&&n&&!this.hasOverflow()||this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,t,n;return e=this.$input.val().length,t=this.$input[0].selectionStart,i.isNumber(t)?t===e:!document.selection||((n=document.selection.createRange()).moveStart("character",-e),e===n.text.length)},destroy:function(){this.$hint.off(".aa"),this.$input.off(".aa"),this.$hint=this.$input=this.$overflowHelper=null}}),e.exports=s},4520:function(e,t,n){"use strict";var r="aaAttrs",i=n(5670),o=n(3855),a=n(7368),s=n(1286),l=n(5445),u=n(6619),c=n(7114);function d(e){var t,n;if((e=e||{}).input||i.error("missing input"),this.isActivated=!1,this.debug=!!e.debug,this.autoselect=!!e.autoselect,this.autoselectOnBlur=!!e.autoselectOnBlur,this.openOnFocus=!!e.openOnFocus,this.minLength=i.isNumber(e.minLength)?e.minLength:1,this.autoWidth=void 0===e.autoWidth||!!e.autoWidth,this.clearOnSelected=!!e.clearOnSelected,this.tabAutocomplete=void 0===e.tabAutocomplete||!!e.tabAutocomplete,e.hint=!!e.hint,e.hint&&e.appendTo)throw new Error("[autocomplete.js] hint and appendTo options can't be used at the same time");this.css=e.css=i.mixin({},c,e.appendTo?c.appendTo:{}),this.cssClasses=e.cssClasses=i.mixin({},c.defaultClasses,e.cssClasses||{}),this.cssClasses.prefix=e.cssClasses.formattedPrefix=i.formatPrefix(this.cssClasses.prefix,this.cssClasses.noPrefix),this.listboxId=e.listboxId=[this.cssClasses.root,"listbox",i.getUniqueId()].join("-");var s=function(e){var t,n,a,s;t=o.element(e.input),n=o.element(u.wrapper.replace("%ROOT%",e.cssClasses.root)).css(e.css.wrapper),e.appendTo||"block"!==t.css("display")||"table"!==t.parent().css("display")||n.css("display","table-cell");var l,c=u.dropdown.replace("%PREFIX%",e.cssClasses.prefix).replace("%DROPDOWN_MENU%",e.cssClasses.dropdownMenu);a=o.element(c).css(e.css.dropdown).attr({role:"listbox",id:e.listboxId}),e.templates&&e.templates.dropdownMenu&&a.html(i.templatify(e.templates.dropdownMenu)()),(s=t.clone().css(e.css.hint).css({backgroundAttachment:(l=t).css("background-attachment"),backgroundClip:l.css("background-clip"),backgroundColor:l.css("background-color"),backgroundImage:l.css("background-image"),backgroundOrigin:l.css("background-origin"),backgroundPosition:l.css("background-position"),backgroundRepeat:l.css("background-repeat"),backgroundSize:l.css("background-size")})).val("").addClass(i.className(e.cssClasses.prefix,e.cssClasses.hint,!0)).removeAttr("id name placeholder required").prop("readonly",!0).attr({"aria-hidden":"true",autocomplete:"off",spellcheck:"false",tabindex:-1}),s.removeData&&s.removeData(),t.data(r,{"aria-autocomplete":t.attr("aria-autocomplete"),"aria-expanded":t.attr("aria-expanded"),"aria-owns":t.attr("aria-owns"),autocomplete:t.attr("autocomplete"),dir:t.attr("dir"),role:t.attr("role"),spellcheck:t.attr("spellcheck"),style:t.attr("style"),type:t.attr("type")}),t.addClass(i.className(e.cssClasses.prefix,e.cssClasses.input,!0)).attr({autocomplete:"off",spellcheck:!1,role:"combobox","aria-autocomplete":e.datasets&&e.datasets[0]&&e.datasets[0].displayKey?"both":"list","aria-expanded":"false","aria-label":e.ariaLabel,"aria-owns":e.listboxId}).css(e.hint?e.css.input:e.css.inputWithNoHint);try{t.attr("dir")||t.attr("dir","auto")}catch(e){}return(n=e.appendTo?n.appendTo(o.element(e.appendTo).eq(0)).eq(0):t.wrap(n).parent()).prepend(e.hint?s:null).append(a),{wrapper:n,input:t,hint:s,menu:a}}(e);this.$node=s.wrapper;var l=this.$input=s.input;t=s.menu,n=s.hint,e.dropdownMenuContainer&&o.element(e.dropdownMenuContainer).css("position","relative").append(t.css("top","0")),l.on("blur.aa",function(e){var n=document.activeElement;i.isMsie()&&(t[0]===n||t[0].contains(n))&&(e.preventDefault(),e.stopImmediatePropagation(),i.defer(function(){l.focus()}))}),t.on("mousedown.aa",function(e){e.preventDefault()}),this.eventBus=e.eventBus||new a({el:l}),this.dropdown=new d.Dropdown({appendTo:e.appendTo,wrapper:this.$node,menu:t,datasets:e.datasets,templates:e.templates,cssClasses:e.cssClasses,minLength:this.minLength}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onSync("shown",this._onShown,this).onSync("empty",this._onEmpty,this).onSync("redrawn",this._onRedrawn,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=new d.Input({input:l,hint:n}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._bindKeyboardShortcuts(e),this._setLanguageDirection()}i.mixin(d.prototype,{_bindKeyboardShortcuts:function(e){if(e.keyboardShortcuts){var t=this.$input,n=[];i.each(e.keyboardShortcuts,function(e){"string"==typeof e&&(e=e.toUpperCase().charCodeAt(0)),n.push(e)}),o.element(document).keydown(function(e){var r=e.target||e.srcElement,i=r.tagName;if(!r.isContentEditable&&"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i){var o=e.which||e.keyCode;-1!==n.indexOf(o)&&(t.focus(),e.stopPropagation(),e.preventDefault())}})}},_onSuggestionClicked:function(e,t){var n;(n=this.dropdown.getDatumForSuggestion(t))&&this._select(n,{selectionMethod:"click"})},_onCursorMoved:function(e,t){var n=this.dropdown.getDatumForCursor(),r=this.dropdown.getCurrentCursor().attr("id");this.input.setActiveDescendant(r),n&&(t&&this.input.setInputValue(n.value,!0),this.eventBus.trigger("cursorchanged",n.raw,n.datasetName))},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint(),this.eventBus.trigger("cursorremoved")},_onDatasetRendered:function(){this._updateHint(),this.eventBus.trigger("updated")},_onOpened:function(){this._updateHint(),this.input.expand(),this.eventBus.trigger("opened")},_onEmpty:function(){this.eventBus.trigger("empty")},_onRedrawn:function(){this.$node.css("top","0px"),this.$node.css("left","0px");var e=this.$input[0].getBoundingClientRect();this.autoWidth&&this.$node.css("width",e.width+"px");var t=this.$node[0].getBoundingClientRect(),n=e.bottom-t.top;this.$node.css("top",n+"px");var r=e.left-t.left;this.$node.css("left",r+"px"),this.eventBus.trigger("redrawn")},_onShown:function(){this.eventBus.trigger("shown"),this.autoselect&&this.dropdown.cursorTopSuggestion()},_onClosed:function(){this.input.clearHint(),this.input.removeActiveDescendant(),this.input.collapse(),this.eventBus.trigger("closed")},_onFocused:function(){if(this.isActivated=!0,this.openOnFocus){var e=this.input.getQuery();e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty(),this.dropdown.open()}},_onBlurred:function(){var e,t;e=this.dropdown.getDatumForCursor(),t=this.dropdown.getDatumForTopSuggestion();var n={selectionMethod:"blur"};this.debug||(this.autoselectOnBlur&&e?this._select(e,n):this.autoselectOnBlur&&t?this._select(t,n):(this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()))},_onEnterKeyed:function(e,t){var n,r;n=this.dropdown.getDatumForCursor(),r=this.dropdown.getDatumForTopSuggestion();var i={selectionMethod:"enterKey"};n?(this._select(n,i),t.preventDefault()):this.autoselect&&r&&(this._select(r,i),t.preventDefault())},_onTabKeyed:function(e,t){var n;this.tabAutocomplete?(n=this.dropdown.getDatumForCursor())?(this._select(n,{selectionMethod:"tabKey"}),t.preventDefault()):this._autocomplete(!0):this.dropdown.close()},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(e,t){this.input.clearHintIfInvalid(),t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var e=this.input.getLanguageDirection();this.dir!==e&&(this.dir=e,this.$node.css("direction",e),this.dropdown.setLanguageDirection(e))},_updateHint:function(){var e,t,n,r,o;(e=this.dropdown.getDatumForTopSuggestion())&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(t=this.input.getInputValue(),n=s.normalizeQuery(t),r=i.escapeRegExChars(n),(o=new RegExp("^(?:"+r+")(.+$)","i").exec(e.value))?this.input.setHint(t+o[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(e){var t,n,r,i;t=this.input.getHint(),n=this.input.getQuery(),r=e||this.input.isCursorAtEnd(),t&&n!==t&&r&&((i=this.dropdown.getDatumForTopSuggestion())&&this.input.setInputValue(i.value),this.eventBus.trigger("autocompleted",i.raw,i.datasetName))},_select:function(e,t){void 0!==e.value&&this.input.setQuery(e.value),this.clearOnSelected?this.setVal(""):this.input.setInputValue(e.value,!0),this._setLanguageDirection(),!1===this.eventBus.trigger("selected",e.raw,e.datasetName,t).isDefaultPrevented()&&(this.dropdown.close(),i.defer(i.bind(this.dropdown.empty,this.dropdown)))},open:function(){if(!this.isActivated){var e=this.input.getInputValue();e.length>=this.minLength?this.dropdown.update(e):this.dropdown.empty()}this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(e){e=i.toStr(e),this.isActivated?this.input.setInputValue(e):(this.input.setQuery(e),this.input.setInputValue(e,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){var e,t,n;this.input.destroy(),this.dropdown.destroy(),e=this.$node,t=this.cssClasses,n=e.find(i.className(t.prefix,t.input)),i.each(n.data(r),function(e,t){void 0===e?n.removeAttr(t):n.attr(t,e)}),n.detach().removeClass(i.className(t.prefix,t.input,!0)).insertAfter(e),n.removeData&&n.removeData(r),e.remove(),this.$node=null},getWrapper:function(){return this.dropdown.$container[0]}}),d.Dropdown=l,d.Input=s,d.sources=n(6331),e.exports=d},3855:function(e){"use strict";e.exports={element:null}},2926:function(e){"use strict";e.exports=function(e){var t=e.match(/Algolia for JavaScript \((\d+\.)(\d+\.)(\d+)\)/)||e.match(/Algolia for vanilla JavaScript (\d+\.)(\d+\.)(\d+)/);if(t)return[t[1],t[2],t[3]]}},5670:function(e,t,n){"use strict";var r,i=n(3855);function o(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}e.exports={isArray:null,isFunction:null,isObject:null,bind:null,each:null,map:null,mixin:null,isMsie:function(e){if(void 0===e&&(e=navigator.userAgent),/(msie|trident)/i.test(e)){var t=e.match(/(msie |rv:)(\d+(.\d+)?)/i);if(t)return t[2]}return!1},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isNumber:function(e){return"number"==typeof e},toStr:function(e){return null==e?"":e+""},cloneDeep:function(e){var t=this.mixin({},e),n=this;return this.each(t,function(e,r){e&&(n.isArray(e)?t[r]=[].concat(e):n.isObject(e)&&(t[r]=n.cloneDeep(e)))}),t},error:function(e){throw new Error(e)},every:function(e,t){var n=!0;return e?(this.each(e,function(r,i){n&&(n=t.call(null,r,i,e)&&n)}),!!n):n},any:function(e,t){var n=!1;return e?(this.each(e,function(r,i){if(t.call(null,r,i,e))return n=!0,!1}),n):n},getUniqueId:(r=0,function(){return r++}),templatify:function(e){if(this.isFunction(e))return e;var t=i.element(e);return"SCRIPT"===t.prop("tagName")?function(){return t.text()}:function(){return String(e)}},defer:function(e){setTimeout(e,0)},noop:function(){},formatPrefix:function(e,t){return t?"":e+"-"},className:function(e,t,n){return(n?"":".")+e+t},escapeHighlightedString:function(e,t,n){t=t||"<em>";var r=document.createElement("div");r.appendChild(document.createTextNode(t)),n=n||"</em>";var i=document.createElement("div");i.appendChild(document.createTextNode(n));var a=document.createElement("div");return a.appendChild(document.createTextNode(e)),a.innerHTML.replace(RegExp(o(r.innerHTML),"g"),t).replace(RegExp(o(i.innerHTML),"g"),n)}}},2683:function(e,t,n){"use strict";var r,i,o=n(5670),a=n(3489),s=n(2926),l=(r=[],i=window.Promise.resolve(),function(e,t){return function(n,a){var s,l;(s=e.as,l=r.push({indexName:e.indexName,query:n,params:t})-1,window.Promise.resolve().then(function(){return r.length&&(i=s.search(r),r=[]),i}).then(function(e){if(e)return e.results[l]})).then(function(e){e&&a(e.hits,e)}).catch(function(e){o.error(e.message)})}});e.exports=function(e,t){var n=s(e.as._ua);if(n&&n[0]>=3&&n[1]>20){var r="autocomplete.js "+a;-1===e.as._ua.indexOf(r)&&(e.as._ua+="; "+r)}return l(e,t)}},6331:function(e,t,n){"use strict";e.exports={hits:n(2683),popularIn:n(2226)}},2226:function(e,t,n){"use strict";var r=n(5670),i=n(3489),o=n(2926);e.exports=function(e,t,n,a){var s=o(e.as._ua);if(s&&s[0]>=3&&s[1]>20&&((t=t||{}).additionalUA="autocomplete.js "+i),!n.source)return r.error("Missing 'source' key");var l=r.isFunction(n.source)?n.source:function(e){return e[n.source]};if(!n.index)return r.error("Missing 'index' key");var u=n.index;return a=a||{},function(s,c){e.search(s,t,function(e,s){if(e)r.error(e.message);else{if(s.hits.length>0){var d=s.hits[0],f=r.mixin({hitsPerPage:0},n);delete f.source,delete f.index;var p=o(u.as._ua);return p&&p[0]>=3&&p[1]>20&&(t.additionalUA="autocomplete.js "+i),void u.search(l(d),f,function(e,t){if(e)r.error(e.message);else{var n=[];if(a.includeAll){var i=a.allTitle||"All departments";n.push(r.mixin({facet:{value:i,count:t.nbHits}},r.cloneDeep(d)))}r.each(t.facets,function(e,t){r.each(e,function(e,i){n.push(r.mixin({facet:{facet:t,value:i,count:e}},r.cloneDeep(d)))})});for(var o=1;o<s.hits.length;++o)n.push(s.hits[o]);c(n,s)}})}c([])}})}}},9281:function(e,t,n){"use strict";var r=n(7939);n(3855).element=r;var i=n(5670);i.isArray=r.isArray,i.isFunction=r.isFunction,i.isObject=r.isPlainObject,i.bind=r.proxy,i.each=function(e,t){r.each(e,function(e,n){return t(n,e)})},i.map=r.map,i.mixin=r.extend,i.Event=r.Event;var o="aaAutocomplete",a=n(4520),s=n(7368);function l(e,t,n,l){n=i.isArray(n)?n:[].slice.call(arguments,2);var u=r(e).each(function(e,i){var u=r(i),c=new s({el:u}),d=l||new a({input:u,eventBus:c,dropdownMenuContainer:t.dropdownMenuContainer,hint:void 0===t.hint||!!t.hint,minLength:t.minLength,autoselect:t.autoselect,autoselectOnBlur:t.autoselectOnBlur,tabAutocomplete:t.tabAutocomplete,openOnFocus:t.openOnFocus,templates:t.templates,debug:t.debug,clearOnSelected:t.clearOnSelected,cssClasses:t.cssClasses,datasets:n,keyboardShortcuts:t.keyboardShortcuts,appendTo:t.appendTo,autoWidth:t.autoWidth,ariaLabel:t.ariaLabel||i.getAttribute("aria-label")});u.data(o,d)});return u.autocomplete={},i.each(["open","close","getVal","setVal","destroy","getWrapper"],function(e){u.autocomplete[e]=function(){var t,n=arguments;return u.each(function(i,a){var s=r(a).data(o);t=s[e].apply(s,n)}),t}}),u}l.sources=a.sources,l.escapeHighlightedString=i.escapeHighlightedString;var u="autocomplete"in window,c=window.autocomplete;l.noConflict=function(){return u?window.autocomplete=c:delete window.autocomplete,l},e.exports=l},3489:function(e){e.exports="0.38.1"},7939:function(e){!function(t){e.exports=function(e){var t,n,r=function(){var t,n,r,i,o,a,s=[],l=s.concat,u=s.filter,c=s.slice,d=e.document,f={},p={},h={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},g=/^\s*<(\w+|!)[^>]*>/,m=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,y=/^(?:body|html)$/i,_=/([A-Z])/g,b=["val","css","html","text","data","width","height","offset"],w=d.createElement("table"),x=d.createElement("tr"),k={tr:d.createElement("tbody"),tbody:w,thead:w,tfoot:w,td:x,th:x,"*":d.createElement("div")},C=/complete|loaded|interactive/,D=/^[\w-]*$/,S={},A=S.toString,E={},M=d.createElement("div"),T={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},j=Array.isArray||function(e){return e instanceof Array};function N(e){return null==e?String(e):S[A.call(e)]||"object"}function F(e){return"function"==N(e)}function O(e){return null!=e&&e==e.window}function I(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function z(e){return"object"==N(e)}function $(e){return z(e)&&!O(e)&&Object.getPrototypeOf(e)==Object.prototype}function q(e){var t=!!e&&"length"in e&&e.length,n=r.type(e);return"function"!=n&&!O(e)&&("array"==n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function R(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function P(e){return e in p?p[e]:p[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function L(e,t){return"number"!=typeof t||h[R(e)]?t:t+"px"}function B(e){return"children"in e?c.call(e.children):r.map(e.childNodes,function(e){if(1==e.nodeType)return e})}function U(e,t){var n,r=e?e.length:0;for(n=0;n<r;n++)this[n]=e[n];this.length=r,this.selector=t||""}function V(e,r,i){for(n in r)i&&($(r[n])||j(r[n]))?($(r[n])&&!$(e[n])&&(e[n]={}),j(r[n])&&!j(e[n])&&(e[n]=[]),V(e[n],r[n],i)):r[n]!==t&&(e[n]=r[n])}function H(e,t){return null==t?r(e):r(e).filter(t)}function W(e,t,n,r){return F(t)?t.call(e,n,r):t}function G(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Y(e,n){var r=e.className||"",i=r&&r.baseVal!==t;if(n===t)return i?r.baseVal:r;i?r.baseVal=n:e.className=n}function Q(e){try{return e?"true"==e||"false"!=e&&("null"==e?null:+e+""==e?+e:/^[\[\{]/.test(e)?r.parseJSON(e):e):e}catch(t){return e}}function K(e,t){t(e);for(var n=0,r=e.childNodes.length;n<r;n++)K(e.childNodes[n],t)}return E.matches=function(e,t){if(!t||!e||1!==e.nodeType)return!1;var n=e.matches||e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(n)return n.call(e,t);var r,i=e.parentNode,o=!i;return o&&(i=M).appendChild(e),r=~E.qsa(i,t).indexOf(e),o&&M.removeChild(e),r},o=function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},a=function(e){return u.call(e,function(t,n){return e.indexOf(t)==n})},E.fragment=function(e,n,i){var o,a,s;return m.test(e)&&(o=r(d.createElement(RegExp.$1))),o||(e.replace&&(e=e.replace(v,"<$1></$2>")),n===t&&(n=g.test(e)&&RegExp.$1),n in k||(n="*"),(s=k[n]).innerHTML=""+e,o=r.each(c.call(s.childNodes),function(){s.removeChild(this)})),$(i)&&(a=r(o),r.each(i,function(e,t){b.indexOf(e)>-1?a[e](t):a.attr(e,t)})),o},E.Z=function(e,t){return new U(e,t)},E.isZ=function(e){return e instanceof E.Z},E.init=function(e,n){var i,o;if(!e)return E.Z();if("string"==typeof e)if("<"==(e=e.trim())[0]&&g.test(e))i=E.fragment(e,RegExp.$1,n),e=null;else{if(n!==t)return r(n).find(e);i=E.qsa(d,e)}else{if(F(e))return r(d).ready(e);if(E.isZ(e))return e;if(j(e))o=e,i=u.call(o,function(e){return null!=e});else if(z(e))i=[e],e=null;else if(g.test(e))i=E.fragment(e.trim(),RegExp.$1,n),e=null;else{if(n!==t)return r(n).find(e);i=E.qsa(d,e)}}return E.Z(i,e)},(r=function(e,t){return E.init(e,t)}).extend=function(e){var t,n=c.call(arguments,1);return"boolean"==typeof e&&(t=e,e=n.shift()),n.forEach(function(n){V(e,n,t)}),e},E.qsa=function(e,t){var n,r="#"==t[0],i=!r&&"."==t[0],o=r||i?t.slice(1):t,a=D.test(o);return e.getElementById&&a&&r?(n=e.getElementById(o))?[n]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:c.call(a&&!r&&e.getElementsByClassName?i?e.getElementsByClassName(o):e.getElementsByTagName(t):e.querySelectorAll(t))},r.contains=d.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},r.type=N,r.isFunction=F,r.isWindow=O,r.isArray=j,r.isPlainObject=$,r.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},r.isNumeric=function(e){var t=Number(e),n=typeof e;return null!=e&&"boolean"!=n&&("string"!=n||e.length)&&!isNaN(t)&&isFinite(t)||!1},r.inArray=function(e,t,n){return s.indexOf.call(t,e,n)},r.camelCase=o,r.trim=function(e){return null==e?"":String.prototype.trim.call(e)},r.uuid=0,r.support={},r.expr={},r.noop=function(){},r.map=function(e,t){var n,i,o,a,s=[];if(q(e))for(i=0;i<e.length;i++)null!=(n=t(e[i],i))&&s.push(n);else for(o in e)null!=(n=t(e[o],o))&&s.push(n);return(a=s).length>0?r.fn.concat.apply([],a):a},r.each=function(e,t){var n,r;if(q(e)){for(n=0;n<e.length;n++)if(!1===t.call(e[n],n,e[n]))return e}else for(r in e)if(!1===t.call(e[r],r,e[r]))return e;return e},r.grep=function(e,t){return u.call(e,t)},e.JSON&&(r.parseJSON=JSON.parse),r.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){S["[object "+t+"]"]=t.toLowerCase()}),r.fn={constructor:E.Z,length:0,forEach:s.forEach,reduce:s.reduce,push:s.push,sort:s.sort,splice:s.splice,indexOf:s.indexOf,concat:function(){var e,t,n=[];for(e=0;e<arguments.length;e++)t=arguments[e],n[e]=E.isZ(t)?t.toArray():t;return l.apply(E.isZ(this)?this.toArray():this,n)},map:function(e){return r(r.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return r(c.apply(this,arguments))},ready:function(e){return C.test(d.readyState)&&d.body?e(r):d.addEventListener("DOMContentLoaded",function(){e(r)},!1),this},get:function(e){return e===t?c.call(this):this[e>=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(e){return s.every.call(this,function(t,n){return!1!==e.call(t,n,t)}),this},filter:function(e){return F(e)?this.not(this.not(e)):r(u.call(this,function(t){return E.matches(t,e)}))},add:function(e,t){return r(a(this.concat(r(e,t))))},is:function(e){return this.length>0&&E.matches(this[0],e)},not:function(e){var n=[];if(F(e)&&e.call!==t)this.each(function(t){e.call(this,t)||n.push(this)});else{var i="string"==typeof e?this.filter(e):q(e)&&F(e.item)?c.call(e):r(e);this.forEach(function(e){i.indexOf(e)<0&&n.push(e)})}return r(n)},has:function(e){return this.filter(function(){return z(e)?r.contains(this,e):r(this).find(e).size()})},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!z(e)?e:r(e)},last:function(){var e=this[this.length-1];return e&&!z(e)?e:r(e)},find:function(e){var t=this;return e?"object"==typeof e?r(e).filter(function(){var e=this;return s.some.call(t,function(t){return r.contains(t,e)})}):1==this.length?r(E.qsa(this[0],e)):this.map(function(){return E.qsa(this,e)}):r()},closest:function(e,t){var n=[],i="object"==typeof e&&r(e);return this.each(function(r,o){for(;o&&!(i?i.indexOf(o)>=0:E.matches(o,e));)o=o!==t&&!I(o)&&o.parentNode;o&&n.indexOf(o)<0&&n.push(o)}),r(n)},parents:function(e){for(var t=[],n=this;n.length>0;)n=r.map(n,function(e){if((e=e.parentNode)&&!I(e)&&t.indexOf(e)<0)return t.push(e),e});return H(t,e)},parent:function(e){return H(a(this.pluck("parentNode")),e)},children:function(e){return H(this.map(function(){return B(this)}),e)},contents:function(){return this.map(function(){return this.contentDocument||c.call(this.childNodes)})},siblings:function(e){return H(this.map(function(e,t){return u.call(B(t.parentNode),function(e){return e!==t})}),e)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return r.map(this,function(t){return t[e]})},show:function(){return this.each(function(){var e,t,n;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(e=this.nodeName,f[e]||(t=d.createElement(e),d.body.appendChild(t),n=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==n&&(n="block"),f[e]=n),f[e]))})},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var t=F(e);if(this[0]&&!t)var n=r(e).get(0),i=n.parentNode||this.length>1;return this.each(function(o){r(this).wrapAll(t?e.call(this,o):i?n.cloneNode(!0):n)})},wrapAll:function(e){if(this[0]){var t;for(r(this[0]).before(e=r(e));(t=e.children()).length;)e=t.first();r(e).append(this)}return this},wrapInner:function(e){var t=F(e);return this.each(function(n){var i=r(this),o=i.contents(),a=t?e.call(this,n):e;o.length?o.wrapAll(a):i.append(a)})},unwrap:function(){return this.parent().each(function(){r(this).replaceWith(r(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(e){return this.each(function(){var n=r(this);(e===t?"none"==n.css("display"):e)?n.show():n.hide()})},prev:function(e){return r(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return r(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each(function(t){var n=this.innerHTML;r(this).empty().append(W(this,e,t,n))}):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each(function(t){var n=W(this,e,t,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this.pluck("textContent").join(""):null},attr:function(e,r){var i;return"string"!=typeof e||1 in arguments?this.each(function(t){if(1===this.nodeType)if(z(e))for(n in e)G(this,n,e[n]);else G(this,e,W(this,r,t,this.getAttribute(e)))}):0 in this&&1==this[0].nodeType&&null!=(i=this[0].getAttribute(e))?i:t},removeAttr:function(e){return this.each(function(){1===this.nodeType&&e.split(" ").forEach(function(e){G(this,e)},this)})},prop:function(e,t){return e=T[e]||e,1 in arguments?this.each(function(n){this[e]=W(this,t,n,this[e])}):this[0]&&this[0][e]},removeProp:function(e){return e=T[e]||e,this.each(function(){delete this[e]})},data:function(e,n){var r="data-"+e.replace(_,"-$1").toLowerCase(),i=1 in arguments?this.attr(r,n):this.attr(r);return null!==i?Q(i):t},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each(function(t){this.value=W(this,e,t,this.value)})):this[0]&&(this[0].multiple?r(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=r(this),i=W(this,t,e,n.offset()),o=n.offsetParent().offset(),a={top:i.top-o.top,left:i.left-o.left};"static"==n.css("position")&&(a.position="relative"),n.css(a)});if(!this.length)return null;if(d.documentElement!==this[0]&&!r.contains(d.documentElement,this[0]))return{top:0,left:0};var n=this[0].getBoundingClientRect();return{left:n.left+e.pageXOffset,top:n.top+e.pageYOffset,width:Math.round(n.width),height:Math.round(n.height)}},css:function(e,t){if(arguments.length<2){var i=this[0];if("string"==typeof e){if(!i)return;return i.style[o(e)]||getComputedStyle(i,"").getPropertyValue(e)}if(j(e)){if(!i)return;var a={},s=getComputedStyle(i,"");return r.each(e,function(e,t){a[t]=i.style[o(t)]||s.getPropertyValue(t)}),a}}var l="";if("string"==N(e))t||0===t?l=R(e)+":"+L(e,t):this.each(function(){this.style.removeProperty(R(e))});else for(n in e)e[n]||0===e[n]?l+=R(n)+":"+L(n,e[n])+";":this.each(function(){this.style.removeProperty(R(n))});return this.each(function(){this.style.cssText+=";"+l})},index:function(e){return e?this.indexOf(r(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return!!e&&s.some.call(this,function(e){return this.test(Y(e))},P(e))},addClass:function(e){return e?this.each(function(t){if("className"in this){i=[];var n=Y(this);W(this,e,t,n).split(/\s+/g).forEach(function(e){r(this).hasClass(e)||i.push(e)},this),i.length&&Y(this,n+(n?" ":"")+i.join(" "))}}):this},removeClass:function(e){return this.each(function(n){if("className"in this){if(e===t)return Y(this,"");i=Y(this),W(this,e,n,i).split(/\s+/g).forEach(function(e){i=i.replace(P(e)," ")}),Y(this,i.trim())}})},toggleClass:function(e,n){return e?this.each(function(i){var o=r(this);W(this,e,i,Y(this)).split(/\s+/g).forEach(function(e){(n===t?!o.hasClass(e):n)?o.addClass(e):o.removeClass(e)})}):this},scrollTop:function(e){if(this.length){var n="scrollTop"in this[0];return e===t?n?this[0].scrollTop:this[0].pageYOffset:this.each(n?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var n="scrollLeft"in this[0];return e===t?n?this[0].scrollLeft:this[0].pageXOffset:this.each(n?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var e=this[0],t=this.offsetParent(),n=this.offset(),i=y.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(r(e).css("margin-top"))||0,n.left-=parseFloat(r(e).css("margin-left"))||0,i.top+=parseFloat(r(t[0]).css("border-top-width"))||0,i.left+=parseFloat(r(t[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||d.body;e&&!y.test(e.nodeName)&&"static"==r(e).css("position");)e=e.offsetParent;return e})}},r.fn.detach=r.fn.remove,["width","height"].forEach(function(e){var n=e.replace(/./,function(e){return e[0].toUpperCase()});r.fn[e]=function(i){var o,a=this[0];return i===t?O(a)?a["inner"+n]:I(a)?a.documentElement["scroll"+n]:(o=this.offset())&&o[e]:this.each(function(t){(a=r(this)).css(e,W(this,i,t,a[e]()))})}}),["after","prepend","before","append"].forEach(function(n,i){var o=i%2;r.fn[n]=function(){var n,a,s=r.map(arguments,function(e){var i=[];return"array"==(n=N(e))?(e.forEach(function(e){return e.nodeType!==t?i.push(e):r.zepto.isZ(e)?i=i.concat(e.get()):void(i=i.concat(E.fragment(e)))}),i):"object"==n||null==e?e:E.fragment(e)}),l=this.length>1;return s.length<1?this:this.each(function(t,n){a=o?n:n.parentNode,n=0==i?n.nextSibling:1==i?n.firstChild:2==i?n:null;var u=r.contains(d.documentElement,a);s.forEach(function(t){if(l)t=t.cloneNode(!0);else if(!a)return r(t).remove();a.insertBefore(t,n),u&&K(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var n=t.ownerDocument?t.ownerDocument.defaultView:e;n.eval.call(n,t.innerHTML)}})})})},r.fn[o?n+"To":"insert"+(i?"Before":"After")]=function(e){return r(e)[n](this),this}}),E.Z.prototype=U.prototype=r.fn,E.uniq=a,E.deserializeValue=Q,r.zepto=E,r}();return function(t){var n,r=1,i=Array.prototype.slice,o=t.isFunction,a=function(e){return"string"==typeof e},s={},l={},u="onfocusin"in e,c={focus:"focusin",blur:"focusout"},d={mouseenter:"mouseover",mouseleave:"mouseout"};function f(e){return e._zid||(e._zid=r++)}function p(e,t,n,r){if((t=h(t)).ns)var i=(o=t.ns,new RegExp("(?:^| )"+o.replace(" "," .* ?")+"(?: |$)"));var o;return(s[f(e)]||[]).filter(function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||i.test(e.ns))&&(!n||f(e.fn)===f(n))&&(!r||e.sel==r)})}function h(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function g(e,t){return e.del&&!u&&e.e in c||!!t}function m(e){return d[e]||u&&c[e]||e}function v(e,r,i,o,a,l,u){var c=f(e),p=s[c]||(s[c]=[]);r.split(/\s/).forEach(function(r){if("ready"==r)return t(document).ready(i);var s=h(r);s.fn=i,s.sel=a,s.e in d&&(i=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return s.fn.apply(this,arguments)}),s.del=l;var c=l||i;s.proxy=function(t){if(!(t=k(t)).isImmediatePropagationStopped()){try{var r=Object.getOwnPropertyDescriptor(t,"data");r&&!r.writable||(t.data=o)}catch(t){}var i=c.apply(e,t._args==n?[t]:[t].concat(t._args));return!1===i&&(t.preventDefault(),t.stopPropagation()),i}},s.i=p.length,p.push(s),"addEventListener"in e&&e.addEventListener(m(s.e),s.proxy,g(s,u))})}function y(e,t,n,r,i){var o=f(e);(t||"").split(/\s/).forEach(function(t){p(e,t,n,r).forEach(function(t){delete s[o][t.i],"removeEventListener"in e&&e.removeEventListener(m(t.e),t.proxy,g(t,i))})})}l.click=l.mousedown=l.mouseup=l.mousemove="MouseEvents",t.event={add:v,remove:y},t.proxy=function(e,n){var r=2 in arguments&&i.call(arguments,2);if(o(e)){var s=function(){return e.apply(n,r?r.concat(i.call(arguments)):arguments)};return s._zid=f(e),s}if(a(n))return r?(r.unshift(e[n],e),t.proxy.apply(null,r)):t.proxy(e[n],e);throw new TypeError("expected function")},t.fn.bind=function(e,t,n){return this.on(e,t,n)},t.fn.unbind=function(e,t){return this.off(e,t)},t.fn.one=function(e,t,n,r){return this.on(e,t,n,r,1)};var _=function(){return!0},b=function(){return!1},w=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,x={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};function k(e,r){if(r||!e.isDefaultPrevented){r||(r=e),t.each(x,function(t,n){var i=r[t];e[t]=function(){return this[n]=_,i&&i.apply(r,arguments)},e[n]=b});try{e.timeStamp||(e.timeStamp=Date.now())}catch(e){}(r.defaultPrevented!==n?r.defaultPrevented:"returnValue"in r?!1===r.returnValue:r.getPreventDefault&&r.getPreventDefault())&&(e.isDefaultPrevented=_)}return e}function C(e){var t,r={originalEvent:e};for(t in e)w.test(t)||e[t]===n||(r[t]=e[t]);return k(r,e)}t.fn.delegate=function(e,t,n){return this.on(t,e,n)},t.fn.undelegate=function(e,t,n){return this.off(t,e,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,r,s,l,u){var c,d,f=this;return e&&!a(e)?(t.each(e,function(e,t){f.on(e,r,s,t,u)}),f):(a(r)||o(l)||!1===l||(l=s,s=r,r=n),l!==n&&!1!==s||(l=s,s=n),!1===l&&(l=b),f.each(function(n,o){u&&(c=function(e){return y(o,e.type,l),l.apply(this,arguments)}),r&&(d=function(e){var n,a=t(e.target).closest(r,o).get(0);if(a&&a!==o)return n=t.extend(C(e),{currentTarget:a,liveFired:o}),(c||l).apply(a,[n].concat(i.call(arguments,1)))}),v(o,e,l,s,r,d||c)}))},t.fn.off=function(e,r,i){var s=this;return e&&!a(e)?(t.each(e,function(e,t){s.off(e,r,t)}),s):(a(r)||o(i)||!1===i||(i=r,r=n),!1===i&&(i=b),s.each(function(){y(this,e,i,r)}))},t.fn.trigger=function(e,n){return(e=a(e)||t.isPlainObject(e)?t.Event(e):k(e))._args=n,this.each(function(){e.type in c&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,n){var r,i;return this.each(function(o,s){(r=C(a(e)?t.Event(e):e))._args=n,r.target=s,t.each(p(s,e.type||e),function(e,t){if(i=t.proxy(r),r.isImmediatePropagationStopped())return!1})}),i},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(e,t){a(e)||(e=(t=e).type);var n=document.createEvent(l[e]||"Events"),r=!0;if(t)for(var i in t)"bubbles"==i?r=!!t[i]:n[i]=t[i];return n.initEvent(e,r,!0),k(n)}}(r),n=[],r.fn.remove=function(){return this.each(function(){this.parentNode&&("IMG"===this.tagName&&(n.push(this),this.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",t&&clearTimeout(t),t=setTimeout(function(){n=[]},6e4)),this.parentNode.removeChild(this))})},function(e){var t={},n=e.fn.data,r=e.camelCase,i=e.expando="Zepto"+ +new Date,o=[];function a(n,a,s){var l=n[i]||(n[i]=++e.uuid),u=t[l]||(t[l]=function(t){var n={};return e.each(t.attributes||o,function(t,i){0==i.name.indexOf("data-")&&(n[r(i.name.replace("data-",""))]=e.zepto.deserializeValue(i.value))}),n}(n));return void 0!==a&&(u[r(a)]=s),u}e.fn.data=function(o,s){return void 0===s?e.isPlainObject(o)?this.each(function(t,n){e.each(o,function(e,t){a(n,e,t)})}):0 in this?function(o,s){var l=o[i],u=l&&t[l];if(void 0===s)return u||a(o);if(u){if(s in u)return u[s];var c=r(s);if(c in u)return u[c]}return n.call(e(o),s)}(this[0],o):void 0:this.each(function(){a(this,o,s)})},e.data=function(t,n,r){return e(t).data(n,r)},e.hasData=function(n){var r=n[i],o=r&&t[r];return!!o&&!e.isEmptyObject(o)},e.fn.removeData=function(n){return"string"==typeof n&&(n=n.split(/\s+/)),this.each(function(){var o=this[i],a=o&&t[o];a&&e.each(n||a,function(e){delete a[n?r(this):e]})})},["remove","empty"].forEach(function(t){var n=e.fn[t];e.fn[t]=function(){var e=this.find("*");return"remove"===t&&(e=e.add(this)),e.removeData(),n.call(this)}})}(r),r}(t)}(window)},6822:function(e,t,n){"use strict";n.r(t),n.d(t,{draw_priority_set_table:function(){return k},get_editor:function(){return S},init:function(){return y},open_editor:function(){return b},priority_set_inject_node_attibutes:function(){return D},priority_set_view:function(){return C}});var r=n(3857),i=n(9050),o=n(4663),a=n(1639),s=n.n(a),l=n(4861),u=n(905),c=n(2033),d=n(4835),f=n(6221),p=n(9983);function h(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var v=null;function y(e){if(e._is_CDC_&&e.isPrimaryGraph){var t=d.get_ui_element_selector_by_role("new_priority_set");t&&(window.addEventListener("beforeunload",function(t){return e.priority_groups_pending()>0?(t.preventDefault(),"There are clusters of interest that have not been confirmed. Closing the window now will not finalize their creation."):null}),r.selectAll(t).on("click",function(t){b(e,[]),e.redraw_tables()}));var n=d.get_ui_element_selector_by_role("merge_priority_sets");n&&r.selectAll(n).on("click",function(e){p(d.get_ui_element_selector_by_role("priority_set_merge")).modal()})}}function _(e,t,n){return!(!t.length||t.length>=36||i.default.some(e,function(e){return e.name===t&&e.name!==n}))}function b(e,t,n,a,u,c,m,y,b,x){!v&&e.isPrimaryGraph&&(e._is_CDC_executive_mode?alert(f.network.WarnExecutiveMode):(x=y?y.createdBy:x||f.CDCCOICreatedManually,v=o.jsPanel.create({theme:"bootstrap-primary",headerTitle:"Priority node set editor",headerControls:{size:"lg",maximize:"remove"},position:{my:"center",at:"center",offsetX:0,offsetY:0},contentSize:{width:function(){return.8*window.innerWidth},height:function(){return window.innerHeight/3}},content:"",contentOverflow:"scroll",callback:function(){var o=this;o.network_nodes=[],o.saved=!1,o.prior_name=m&&m.length&&y?y.name:null,o.can_edit_kind=!y||"System"!==y.createdBy,o.can_edit_name=!y||"System"!==y.createdBy,o.can_edit_tracking=!y,o.can_add=function(e){return!i.default.some(o.network_nodes,function(t){return t.id===e})};var S=r.select(o.content);S.selectAll("*").remove();var A=S.append("form").attr("action","javascript:void(0);").classed("form-inline",!0);A.append("div").classed("form-group",!0).append("input").classed("form-control input-sm",!0).attr("placeholder","Add node by ID").attr("data-hivtrace-ui-role","priority-panel-nodeids");var E=A.append("button").classed("btn btn-primary btn-sm",!0).attr("id","priority-panel-add-node").attr("disabled","disabled").on("click",function(e){o.append_node()});E.append("i").classed("fa fa-plus",!0),A.append("p").classed("alert alert-warning",!0).style("display","inline").text("At this time, only nodes that cluster in the network at the 1.5% or 0.5% genetic distance threshold level are available for selection.");var M=S.append("form").classed("form",!0).attr("action","javascript:void(0);").style("display","none"),T=M.append("div");o.prior_name?T.classed("form-group has-success",!0):T.classed("form-group has-error",!0);var j=T.append("input").classed("form-control input-sm",!0).attr("placeholder","Name this cluster of interest").attr("data-hivtrace-ui-role","priority-panel-name").attr("maxlength",100),N=T.append("p").classed("help-block",!0).text("Name this cluster of interest"),F=M.append("div").classed("form-group",!0),O=F.append("select").classed("form-control input-sm",!0).attr("data-hivtrace-ui-role","priority-panel-kind");o.can_edit_kind?O.attr("title",null):(O.property("disabled",!0),O.attr("title","The method of cluster identification cannot be changed for system generated cluster of interest. However, after confirming this cluster of interest, you can clone it and then change this field as needed")),o.can_edit_name?j.attr("title",null):(j.property("disabled",!0),j.attr("title","The name cannot be changed for system generated cluster of interest. However, after confirming this cluster of interest, you can clone it and then change this field as needed")),O.selectAll("option").data(c||f.CDCCOIKind).enter().insert("option").text(function(e){return e}).property("selected",function(e){return e===u}),F.append("p").classed("help-block",!0).text("Cluster identification method");var I=M.append("div").classed("form-group",!0),z=I.append("select").classed("form-control input-sm",!0).attr("data-hivtrace-ui-role","priority-panel-tracking");o.can_edit_tracking?z.attr("title",null):(z.property("disabled",!0),z.attr("title","The method of tracking cannot be changed for existing clusters (system generated or manual). However, you can clone this cluster of interest and then change this field as needed")),b=b||f.CDCCOITrackingOptionsDefault,z.selectAll("option").data(f.CDCCOITrackingOptions).enter().insert("option").text(function(e){return e}).property("selected",function(e){return e===b}),I.append("p").classed("help-block",!0).text("Method of tracking cluster of interest growth");var $=M.append("div").classed("form-group",!0);function q(e){return!e._priority_set_fixed}$.append("textarea").classed("form-control input-sm",!0).attr("placeholder","Cluster of Interest Description").attr("data-hivtrace-ui-role","priority-panel-description").text(a),$.append("p").classed("help-block",!0).text("Describe this cluster of interest"),o.first_save=!0,o.cleanup_attributes=function(){i.default.each(e.nodes,function(e){i.default.each(["_priority_set_fixed","_priority_set_date","_priority_set_kind","_priority_set_autoadded"],function(t){delete e[t]})})};var R=y&&m&&m.length?y.created:l.getCurrentDate(),P="validate"===m&&x===f.CDCCOICreatedBySystem?e.today:l.getCurrentDate();function L(){M.style("display",null);var t,n,a=!0;if(o.network_nodes.length){var s,u,c,v,b=i.default.mapObject(e.unique_entity_object_list(o.table_entities),function(e){return e[0]});i.default.each(o.network_nodes,function(t){var n=b[e.primary_key(t)];n&&i.default.each(["_priority_set_date","_priority_set_kind","_priority_set_autoadded"],function(e){n[e]&&(t[e]=n[e])})});var w=(t=i.default.map(["priority-panel-name","priority-panel-description","priority-panel-kind","priority-panel-tracking"],function(e){return p(r.select(d.get_ui_element_selector_by_role(e)).node()).val()}),n=4,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,n)||g(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());if(s=w[0],u=w[1],c=w[2],v=w[3],!o.first_save&&_(e.defined_priority_groups,s,o.prior_name)){var C={name:s,description:u,nodes:i.default.map(o.network_nodes,function(e){return{name:e.id,added:e._priority_set_date,kind:e._priority_set_kind,autoadded:e._priority_set_autoadded}}),created:l.DateFormats[0](R),modified:l.DateFormats[0](P),kind:c,tracking:v,createdBy:x,expanded:!1,autocreated:!!y&&y.autocreated,autoexpanded:!!y&&y.autoexpanded,pending:!1};if(v!==f.CDCCOITrackingOptionsNone){var D=e.auto_expand_pg_handler(C);if(D.size){var S=i.default.map(h(D),function(t){return e.json.Nodes[t]});if(!confirm('This cluster of interest does not include all the nodes in the current network that are eligible for membership by growth criterion "'+v+'". These '+e.unique_entity_list(S).length+" additional nodes will be automatically added to this cluster of interest when you save it. If you don’t want to add these nodes to the cluster of interest please select 'Cancel' and change the growth criterion."))return!1;i.default.each(S,function(e){C.nodes.push({name:e.id,added:P||R,kind:f.CDCCOINodeKindDefault})})}}var A=null;if(o.prior_name&&(A=y.pending?"insert":"update"),a=function(e,t,n,r,o,a){function s(){if(" "===t.name[0]||" "===t.name[t.name.length-1])return alert("Cluster of interest '"+t.name+"' has spaces either at the beginning or end of the name. Secure HIV-TRACE does not allow names that start or end with spaces."),!0;var n=new Set(i.default.map(t.nodes,function(e){return e.name}));return i.default.some(e.defined_priority_groups,function(e){if(e.nodes.length===n.size){var r=e.nodes.filter(function(e){return n.has(e.name)}).length===e.nodes.length;if(r&&e.tracking===t.tracking)return alert("Cluster of interest '"+e.name+"' has the same set of nodes and the same growth criterion as this new cluster of interest. Secure HIV-TRACE does not allow creating exact duplicates of clusters of interest."),!0;if(r)return!confirm("Warning! Cluster of interest '"+e.name+"' has the same set of nodes as this cluster of interest, but a different growth criterion'. Click 'OK' to create, or 'Cancel' to abort.")}return!1})}if(a=a||"insert",e.priority_groups_validate([t]),o){var l=i.default.findIndex(e.defined_priority_groups,function(e){return e.name===o});if(l>=0)o!==t.name&&(e.priority_groups_update_node_sets(o,"delete"),a="insert"),e.defined_priority_groups[l]=t;else{if(s())return!1;e.defined_priority_groups.push(t)}}else{if(s())return!1;e.defined_priority_groups.push(t)}return e.priority_groups_update_node_sets(t.name,a),k(e),!0}(e,C,0,0,o.prior_name,A),o.saved=!0,o.cleanup_attributes(),o.close(),"validate"===m&&e.priority_set_table_writeable){var E=d.get_ui_element_selector_by_role("priority_set_counts"),T=r.select(E),j=Number(T.text());T.text(j-1),r.select("#banner_coi_counts").text(j-1)}}o.first_save=!1}var N=document.querySelector(d.get_ui_element_selector_by_role("priority-panel-name"));return N&&N.focus(),a}var B=A.append("button").classed("btn btn-primary btn-sm pull-right",!0).text("validate"===m?"Review & Save":"Save").attr("disabled","disabled").attr("id","priority-panel-save").on("click",function(e){L()});A.append("button").classed("btn btn-info btn-sm pull-right",!0).attr("id","priority-panel-preview").text("Preview @1.5%").on("click",function(t){C(e,v,{"priority-edge-length":.015,timestamp:R})}),A.append("button").classed("btn btn-info btn-sm pull-right",!0).attr("id","priority-panel-preview-subcluster").text("Preview @"+100*e.subcluster_threshold+"%").on("click",function(t){C(e,v,{"priority-edge-length":e.subcluster_threshold,timestamp:R})}),p(j.node()).on("input propertychange",function(t){var n=p(this).val();if(_(e.defined_priority_groups,n,o.prior_name))T.classed({"has-success":!0,"has-error":!1,"has-warning":!1}),N.text("Name this cluster of interest"),o.network_nodes.length&&B.attr("disabled",null);else{var r=n.length>=36;T.classed({"has-success":!1,"has-error":!0});var i=r?"MUST be shorter than 36 characters":"MUST be unique";N.text("Name this cluster of interest "+i),B.attr("disabled","disabled")}}),n&&(j.attr("value",n),p(j.node()).trigger("input")),o.selectable_entities=e.has_multiple_sequences?i.default.map(e.primary_key_list,function(e,t){return{id:t}}):e.json.Nodes;var U=s()(d.get_ui_element_selector_by_role("priority-panel-nodeids"),{hint:!1},[{source:function(e,t){for(var n=[],r=new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"i"),i=0;n.length<10&&i<o.selectable_entities.length;i++)r.test(o.selectable_entities[i].id)&&o.can_add(o.selectable_entities[i].id)&&n.push(o.selectable_entities[i].id);t(n)},templates:{suggestion:function(e){return e}}}]);o.validate_input=function(e,t){e=e||U.autocomplete.getVal();var n=i.default.filter(o.selectable_entities,function(t){return t.id===e});return 1===n.length&&o.can_add(n[0].id)?(t||E.attr("disabled",null),n[0]):(t||E.attr("disabled","disabled"),null)},o._append_node=function(t){var n;console.log(t,P,R),"_priority_set_date"in t||(t._priority_set_date=P||R),"_priority_set_kind"in t||(t._priority_set_kind=f.CDCCOINodeKindDefault);var r=[];e.has_multiple_sequences&&t.id in e.primary_key_list?r.push.apply(r,h(e.primary_key_list[t.id])):r.push(t),i.default.each(r,function(e){"_priority_set_date"in e||(e._priority_set_date=P||R),"_priority_set_kind"in e||(e._priority_set_kind=f.CDCCOINodeKindDefault)}),(n=o.network_nodes).push.apply(n,r)},o.can_add_nodes=function(){return x===f.CDCCOICreatedManually||(alert("Cannot add nodes to system generated clusters of interest. You may clone this cluster of interest and then add nodes to it manually if necessary."),!1)},o.append_node=function(e,t){if(o.can_add_nodes()){var n=o.validate_input(e,t);n&&(o._append_node(n),o.table_handler(o),o.validate_input())}},o.append_nodes=function(t,n,r){if(o.can_add_nodes()){var a={};i.default.each(o.network_nodes,function(e){a[e.id]=1});var s=!1,l={};i.default.each(e.json.Nodes,function(e){a[e.id]||(l[e.id]=n?i.default.extend(e,n[e.id]):e)}),t=r?i.default.map(t,function(e){return{id:e}}):i.default.flatten(i.default.map(t,function(t){return e.fetch_sequence_objects_for_pid(t)})),i.default.each(t,function(e){!(e.id in a)&&e.id in l?(o._append_node(l[e.id]),a[e.id]=1,s=!0):console.log("***",e)}),s&&o.table_handler(o)}},o.append_node_objects=function(e){if(o.can_add_nodes()){var t={};i.default.each(o.network_nodes,function(e){t[e.id]=1});var n=!1;i.default.each(e,function(e){e.id in t||(o._append_node(e),t[e.id]=1,n=!0)}),n&&o.table_handler(o)}},o.remove_node=function(t){var n=e.entity_id(t);o.network_nodes=i.default.filter(o.network_nodes,function(t){return e.entity_id(t)!==n}),o.table_handler(o)},U.on("autocomplete:selected",function(e,t,n,r){U.autocomplete.setVal(t),o.validate_input()}).on("input propertychange",function(){o.validate_input()}),o.table_handler=function(t){var n=S.selectAll("table").data(["panel"]);n.enter().append("table"),n.classed("table table-striped table-condensed table-hover table-smaller",!0).attr("id","priority-panel-node-table");var i=e.aggregate_indvidual_level_records(t.network_nodes);t.setHeaderTitle("clusterOI editor ("+i.length+" persons)"+(m?" [automatically created review] ":"")),B.attr("disabled",t.network_nodes.length?null:"disabled");var a=function(){return'<form class="form">\n <div class="form-group">\n <div class="input-group"> <textarea class="form-control input-sm" data-hivtrace-ui-role="priority-description-form"\n cols="40" rows="3"></textarea> </div>\n </div> <button data-hivtrace-ui-role="priority-description-dismiss" class="btn btn-sm btn-default">Cancel</button>\n <button data-hivtrace-ui-role="priority-description-save" class="btn btn-sm btn-default">Delete</button>\n</form>'},s=[{prepend:!0,description:{value:"Added",help:"When was this person added to the cluster of interest?"},generator:function(e){return{value:e,callback:function(e,t){var n=r.select(e);t._priority_set_date?(t._priority_set_autoadded&&n.style("color","darkred"),q(t)?n.append("input").attr("type","date").attr("value",l.DateViewFormatSlider(t._priority_set_date)).on("change",function(e,n){try{t._priority_set_date=l.DateViewFormatSlider.parse(p(r.event.target).val())}catch(e){}}):n.text(l.DateViewFormatMMDDYYY(t._priority_set_date))):n.text("N/A")}}}},{prepend:!0,description:{value:"Person identification method",help:"How was this person identified as part of this cluster of interest?"},generator:function(e){return{value:e,html:!0,actions:function(e,t){return q(t)?[{classed:{"btn-default":!0},text:t._priority_set_kind,help:"How was this person identified?",dropdown:f.CDCCOINodeKind,action:function(e,n){t._priority_set_kind=n,e.text(t._priority_set_kind)}}]:[]},callback:function(e,t){var n=r.select(e);return q(t)||n.append("abbr").attr("title",t._priority_set_kind).text(t._priority_set_kind),n}}}},{prepend:!0,description:{value:"",actions:[{icon:"fa-trash",action:function(e,i){var o=new Set(t.network_nodes);n.selectAll("tr").filter(function(e){return"none"!==r.select(this).style("display")}).each(function(e){r.select(this).selectAll("td:first-child > button").each(function(e){var t=r.select(this).datum();q(t)&&o.delete(t)})});var a=o.values();t.network_nodes=[];var s,l=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=g(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(a);try{for(l.s();!(s=l.n()).done;){var u=s.value;t.network_nodes.push(u)}}catch(e){l.e(e)}finally{l.f()}t.table_handler(t)}}]},generator:function(e){return{value:e,callback:function(e,t){var n=r.select(e);!function(e,t){return t===f.CDCCOICreatedManually||!e._priority_set_fixed}(t,x)?n.append("button").classed("btn btn-default btn-xs",!0).style("margin-left","1em").datum(t).property("disabled",!0).append("i").classed("fa fa-ban",!0):n.append("button").classed("btn btn-default btn-xs",!0).style("margin-left","1em").datum(t).on("click",function(){w(r.select(this),a,"Are you sure you wish to permanently delete this node from the cluster of interest?",function(e){o.remove_node(t)},!0),r.event.preventDefault()}).append("i").classed("fa fa-trash",!0)}}}}];e._is_CDC_auto_mode||s.splice(1,1),o.table_entities=e.aggregate_indvidual_level_records(t.network_nodes),e.draw_extended_node_table(o.table_entities,n,s)},o.content.style.padding="5px",o.network_nodes=t,m&&i.default.each(o.network_nodes,function(e){e._priority_set_fixed=!0}),y&&D(e,o.network_nodes,y.nodes),o.table_handler(this)},dragit:{containment:[50,50,100,50]},resizeit:{containment:[50,50,100,50]},onbeforeclose:function(){if(!this.saved){if(confirm("Close cluster of interest editor? Unsaved changes will be lost.")){if(y){var e=new Set(i.default.map(y.nodes,function(e){return e.name}));y.node_objects=i.default.filter(y.node_objects,function(t){return e.has(t.id)})}return this.cleanup_attributes(),!0}return!1}return!0},onclosed:function(){v=null,e.redraw_tables()}})))}function w(e,t,n,i,o){"shown"!==(e=p(e.node())).data("popover_shown")?(e.popover({sanitize:!1,placement:"right",container:"body",html:!0,content:t,trigger:"manual"}).on("shown.bs.popover",function(t){var a=r.select(this),s=r.select("#"+a.attr("aria-describedby")),l=s.selectAll(d.get_ui_element_selector_by_role("priority-description-form")),u=s.selectAll(d.get_ui_element_selector_by_role("priority-description-save"));l.text(n),o&&l.attr("disabled",!0),u.on("click",function(t){i(p(l.node()).val()),r.event.preventDefault(),e.click()}),(u=s.selectAll(d.get_ui_element_selector_by_role("priority-description-dismiss"))).on("click",function(t){r.event.preventDefault(),e.click()})}).popover("show"),e.data("popover_shown","shown"),e.off("hidden.bs.popover").on("hidden.bs.popover",function(){p(this).data("popover_shown","hidden")})):(e.data("popover_shown","hidden"),e.popover("destroy"))}function x(e,t){var n=i.default.flatten([i.default.map([e.subcluster_threshold,.015],function(n){var r=[{label:"View this cluster of interest at link distance of "+f.formats.PercentFormatShort(n),action:function(r,i){C(e,t,{timestamp:t.modified||t.created,priority_set:t,"priority-edge-length":n,title:t.name+" @"+f.formats.PercentFormat(n)})}}];return e.has_multiple_sequences&&r.push({label:"View this cluster of interest at link distance of "+f.formats.PercentFormatShort(n)+" (sequence level)",action:function(r,i){C(e,t,{timestamp:t.modified||t.created,priority_set:t,"priority-edge-length":n,title:t.name+" @"+f.formats.PercentFormat(n)+" (sequence level)",raw_mspp:!0})}}),r})]);return e._is_CDC_executive_mode||(n.push({label:"Clone this cluster of interest in a new editor panel",action:function(n,r){var o=e.priority_groups_find_by_name(t.name),a=i.default.clone(o.node_objects);D(e,a,t.nodes),b(e,a,"","Clone of "+t.name,o.kind),e.redraw_tables()}}),"System"!==t.createdBy&&n.push({label:"Delete this cluster of interest",action:function(n,r){confirm("This action cannot be undone. Proceed?")&&e.priority_groups_remove_set(t.name,!0)}}),n.push({label:"View nodes in this cluster of interest",data:{toggle:"modal",target:d.get_ui_element_selector_by_role("cluster_list"),priority_set:t.name}})),n.push({label:"Modify this cluster of interest",action:function(n,r){var i=e.priority_groups_find_by_name(t.name);i&&(b(e,i.node_objects,i.name,i.description,i.kind,null,"update",i,i.tracking),e.redraw_tables())}}),n}function k(e,t,n){if(t=t||e.priority_set_table){n=n||e.defined_priority_groups,e.priority_groups_compute_node_membership(),e.priority_groups_compute_overlap(n);var o=[[{value:"Type",sort:function(e){return e.value},help:"How was this cluster of interest created",width:50},{value:"Name",sort:"value",filter:!0,width:325,text_wrap:!0,help:"Cluster of interest name"},{value:"Modified/created",width:180,sort:function(e){return e.value[0]},help:"When was the cluster of interest created/last modified"},{value:"Growth",sort:"value",help:"How growth is handled",width:100},{value:"Size",width:100,presort:"desc",sort:function(e){return(e=e.value)?e[1]+(e[2]?1e10:0)+(e[3]?1e5:0):0},help:"Number of nodes in the cluster of interest"},{value:"Priority",width:60,sort:"value",help:"Does the cluster of interest continue to meet priority criteria?"},{value:"DXs in last 12 mo.",width:50,sort:"value",help:"The number of cases in the cluster of interest diagnosed in the past 12 months"},{value:"Overlap",width:140,sort:function(e){return(e=e.value)?e[1]:0},help:"How many other ClusterOI have overlapping nodes with this ClusterOI, and (if overlapping ClusterOI exist) how many nodes in this ClusterOI overlap with ANY other ClusterOI?"}]];e._is_CDC_auto_mode&&o[0].splice(3,0,{value:"clusterOI identification method",width:100,sort:function(e){return e.value},help:"Method of cluster identification"});var a=function(){return'<form class="form"> \n <div class="form-group"> \n <div class="input-group">\n <textarea class="form-control input-sm" data-hivtrace-ui-role = "priority-description-form" cols = "40" rows = "3"></textarea>\n </div>\n </div>\n <button data-hivtrace-ui-role = "priority-description-dismiss" class = "btn btn-sm btn-default">Dismiss</button>\n <button data-hivtrace-ui-role = "priority-description-save" class = "btn btn-sm btn-default">Save</button>\n </form>'},s=[];i.default.each(n,function(t){var n=[{value:t.createdBy,html:!0,width:50,format:function(e){return t.createdBy===f.CDCCOICreatedBySystem?'<i class="fa fa-2x fa-desktop" title="'+f.CDCCOICreatedBySystem+'" data-text-export='+f.CDCCOICreatedBySystem+"></i>":'<i class="fa fa-2x fa-user" title="'+f.CDCCOICreatedManually+'" data-text-export='+f.CDCCOICreatedManually+"></i>"}},{value:t.name,width:325,help:t.description+(t.pending?" (new, pending confirmation)":"")+(t.expanded?" ("+t.expanded+" new nodes; pending confirmation)":""),volatile:!0,format:function(e){return"<div style = 'white-space: nowrap; overflow: hidden; text-overflow : ellipsis;'>"+(t.autocreated||t.autoexpanded?(t.autoexpanded?'<span class="label label-default">Grew</span>':'<span class="label label-danger">New</span>')+"&nbsp;<span style = 'font-weight: 900;' data-text-export = '"+e+"'>"+e+"</span>":'<span data-text-export = "'+e+'">'+e+"</span>")+"</div>"},html:!0,actions:[]},{width:180,value:[t.modified,t.created],format:function(e){var t=i.default.map(e,function(e){return l.DateViewFormat(e)});return t[0]!==t[1]?t[0]+" / "+t[1]:t[0]}},{width:100,value:t.tracking,format:function(e){return f.CDCCOIConciseTrackingOptions[e]}},{value:[e.unique_entity_list(t.node_objects).length,i.default.chain(t.nodes).groupBy(function(t){return e.entity_id_from_string(t.name)}).mapObject(function(t){return i.default.uniq(i.default.map(t,function(t){return e.priority_groups_is_new_node(t)}))}).filter(function(e){return 1==e.length&&e[0]}).size().value(),t.createdBy===f.CDCCOICreatedBySystem&&t.pending,t.meets_priority_def],width:100,format:function(e){return e?e[0]+(e[1]?' <span title="Number of nodes added by the system since the last network update" class="label label-default">'+e[1]+" new</span>":""):"N/A"},html:!0},{width:60,value:t.meets_priority_def?"Yes":"No"},{width:50,value:t.cluster_dx_recent12_mo},{width:140,value:[t.overlap.sets,t.overlap.nodes,t.overlap.duplicate,t.overlap.superset],format:function(e){return e?String(e[0])+(e[1]?' <span title="Number of persons in the overlap" class="label label-default pull-right">'+e[1]+" persons</span>":"")+(e[2].length?' <span title="clusterOIs which are exact duplicates of this clusterOI: '+e[2].join(", ")+'" class="label label-danger pull-right">'+e[2].length+" duplicate clusterOI</span>":"")+(e[3].length?' <span title="clusterOIs which contain this clusterOI: '+e[3].join(", ")+'" class="label label-warning pull-right">Fully contained in '+e[3].length+" clusterOI</span>":""):"N/A"},html:!0,actions:0===t.overlap.sets?[]:[{icon:"fa-eye",dropdown:[{label:"List overlaps",data:{toggle:"modal",target:d.get_ui_element_selector_by_role("overlap_list"),priority_set:t.name}}]}]}];e._is_CDC_auto_mode&&n.splice(3,0,{value:t.kind,width:100,format:function(e){return e||"N/A"},html:!0}),t.pending?n[1].actions=[{icon:"fa-eye",help:"Review and adjust this cluster of interest",action:function(n,r){var i=e.priority_groups_find_by_name(r);i&&(S()?alert("Cannot confirm a cluster of interest while an editor window is open"):(b(e,i.node_objects,i.name,i.description,i.kind,null,"validate",i,t.tracking,t.createdBy),e.redraw_tables()))}}]:(n[1].actions=[i.default.clone(n[1].actions)],n[1].actions[n[1].actions.length-1].splice(-1,0,{icon:"fa-info-circle",classed:{"view-edit-cluster":!0},help:"View/edit this cluster of interest",dropdown:x(e,t)},{icon:"fa-edit",classed:{"btn-info":!0},help:"Edit description",action:function(n,r){w(n,a,t.description,function(n){e.priority_groups_edit_set_description(t.name,n,!0)})}}),n[1].actions[n[1].actions.length-1].splice(-1,0,function(t,n){return S()?{icon:"fa-plus",help:"Add nodes in this cluster of interest to the new cluster of interest",action:function(t,n){var r=e.priority_groups_find_by_name(n);r&&S().append_node_objects(r.node_objects)}}:null})),n[1].actions=i.default.flatten(n[1].actions),t.not_in_network.length&&(n[2].actions=[{text:String(t.not_in_network.length)+" removed",classed:{"btn-danger":!0,disabled:!0},help:"Nodes removed from the network: "+t.not_in_network.join(", ")}]),s.push(n)}),u.add_a_sortable_table(t,o,s,!0,'Showing <span class="badge" data-hivtrace-ui-role="table-count-shown">--</span>/<span class="badge" data-hivtrace-ui-role="table-count-total">--</span> clusters of interest.\n <button class = "btn btn-sm btn-warning pull-right" data-hivtrace-ui-role="priority-subclusters-export">Export to JSON</button>\n <button class = "btn btn-sm btn-primary pull-right" data-hivtrace-ui-role="priority-subclusters-export-csv">Export to CSV</button>',S()),r.select(d.get_ui_element_selector_by_role("priority-subclusters-export")).on("click",function(t){c.export_json_button(e.priority_groups_export(),l.DateViewFormatSlider(e.today))}),r.select(d.get_ui_element_selector_by_role("priority-subclusters-export-csv")).on("click",function(t){c.export_csv_button(e.priority_groups_export_nodes(),"clusters-of-interest")}),r.select("#priority_set_table_download").on("click",function(t){c.export_csv_button(e.priority_groups_export_sets(),"clusters_of_interest_table")})}}function C(e,t,n){n=n||{};var o=t.node_objects||t.network_nodes,a=l.getCurrentDate(),s=n["priority-edge-length"]||e.subcluster_threshold,u=n.timestamp||e.today,c=n.title||"clusterOI "+(t.prior_name||t.name||"unnamed"),p={};t.nodes?i.default.each(t.nodes,function(e){p[e.name]=e.added}):i.default.each(t.network_nodes,function(e){p[e.id]=e._priority_set_date});var h={};n.priority_set&&n.priority_set.nodes&&i.default.each(n.priority_set.nodes,function(e){h[e.name]=e.added}),i.default.each(o,function(e){e.priority_set=1,e._added_date=e.id in h?h[e.id]:e._priority_set_date,e._added_date?e._added_date=l.DateViewFormatSlider(e._added_date):e._added_date=null});var g=i.default.sortBy(i.default.keys(i.default.groupBy(o,function(e){return e._added_date}))),m=i.default.flatten((0,d.hivtrace_cluster_depthwise_traversal)(e.json.Nodes,e.json.Edges,function(e){return e.length<=s},null,o)),v=l.DateViewFormat(u),y=r.scale.ordinal().range(i.default.map(i.default.range(0,18,6),function(e){return"#"+"fee8c8fdbb84e34a33".substr(e,6)})),_=r.scale.ordinal().range(i.default.map(i.default.range(0,24,6),function(e){return"#"+"7b3294c2a5cfa6dba0008837".substr(e,6)})),b=[],w={};i.default.each(g,function(e,t){if(e){if(g.length>4){if(t<g.length-4)return void(w[e]=0);if(t===g.length-4)return w[e]=b.length,void b.push("In cluster of interest (added on or before "+e+")")}w[e]=b.length,b.push("In cluster of interest (added "+e+")")}});var x=b.length;b.push("Diagnosed and in network before "+v),b.push("Diagnosed or in network on or after "+v+" [directly linked to cluster of interest]"),b.push("Diagnosed or in network on or after "+v+" [indirectly linked to cluster of interest]");var k=[].concat(b,[f.missing.label]),C=i.default.map(k,function(e,t){return e!==f.missing.label?t<x?_(e):y(e):"gray"});i.default.each(i.default.groupBy(m,function(t){return e.primary_key(t)}),function(e,t){e.length>1&&i.default.each(["_added_date","priority_set"],function(t){var n=r.min(i.default.map(e,function(e){return e[t]}));i.default.each(e,function(e){e[t]=n})})}),e.view_subcluster(-1,m,c,{"simplified-mspp":!n.raw_mspp,skip_recent_rapid:!0,init_code:function(e){i.default.each(e.json.Edges,function(t){var n=null;1===e.json.Nodes[t.target].priority_set?n=e.json.Nodes[t.source]:1===e.json.Nodes[t.source].priority_set&&(n=e.json.Nodes[t.target]),n&&1!==n.priority_set&&(n.priority_set=2)})},"computed-attributes":{date_added:{depends:[l._networkCDCDateField],label:"Date added to cluster of interest",type:"Date",map:function(e){return e.id in p?p[e.id]:f.missing.label}},priority_set:{depends:[l._networkCDCDateField],label:"Cluster of Interest Status",enum:b,type:"String",map:function(t){return 1===t.priority_set?t._added_date?b[w[t._added_date]]:b[0]:e.filter_by_date(u,l._networkCDCDateField,a,t,!0)?2===t.priority_set?b[x+1]:b[x+2]:b[x]},color_scale:function(){return r.scale.ordinal().domain(k).range(C)}}}},null,null,s).handle_attribute_categorical("priority_set"),i.default.each(o,function(e){delete e.priority_set})}function D(e,t,n){var r={};i.default.each(n,function(t,n){r[t.name]={_priority_set_date:t.added||e.today,_priority_set_kind:t.kind||f.CDCCOINodeKindDefault,_priority_set_autoadded:t.autoadded||!1}}),i.default.each(t,function(e){e.id in r&&i.default.extend(e,r[e.id])})}function S(){return v}},8834:function(e,t,n){"use strict";function r(e,t){return'<div class="col-lg-2 hivtrace-color-picker">\n <input type="color" name="'.concat(e,'" value="').concat(t.category(e),'">\n <label for="').concat(e,'">').concat(e,"</label>\n </div>")}function i(e,t){return'<div class="col-lg-2 hivtrace-color-picker">\n <input type="color" name="'.concat(e.toLowerCase(),'" value="').concat(t,'">\n <label for="').concat(e.toLowerCase(),'">').concat(e,"</label>\n </div>")}function o(e,t){return'<div class="col-lg-2 hivtrace-color-stops">\n <label for="color-stop">'.concat(e,'</label>\n <input type="number" name="color-stop" value="').concat(t,'" min="0" max="20"">\n </div>')}n.r(t),n.d(t,{colorPickerInput:function(){return r},colorPickerInputContinuous:function(){return i},colorStops:function(){return o}})},5795:function(e,t,n){var r=n(9983),i=n(3857),o=n(9050),a=n(6822),s=n(1138),l=n(6221);e.exports={secure_hiv_trace_subcluster_columns:function(e){return[{description:{value:"Cases dx within 36 months",sort:function(t){return t.value.length?i.max(o.map(t.value,function(t){return e.unique_entity_list_from_ids(t).length})):0},help:"Number of cases diagnosed in the past 36 months connected only through cases diagnosed within the past 36 months"},generator:function(t){return{html:!0,value:t.recent_nodes,volatile:!0,format:function(t){return(t=t||[]).length?o.map(t,function(t){return e.unique_entity_list_from_ids(t).length}).join(", "):""},actions:function(e,n){return a.get_editor()&&0!==t.recent_nodes.length?o.map(t.recent_nodes,function(e){var n=new Set(e);return{icon:"fa-plus",action:function(e,r){return a.get_editor()&&a.get_editor().append_node_objects(o.filter(t.children,function(e){return n.has(e.id)&&e.priority_flag>0})),!1},help:"Add to cluster of interest"}}):null}}}},{description:{value:"Cases dx within 12 months",sort:function(t){var n=t.value||[];return n.length>0?i.max(o.map(n,function(t){return e.unique_entity_list_from_ids(t).length})):0},presort:"desc",help:"Number of cases diagnosed in the past 12 months connected only through cases diagnosed within the past 36 months"},generator:function(t){return{html:!0,value:t.priority_score,volatile:!0,format:function(t){if((t=t||[]).length){var n=o.map(t,function(t){return e.unique_entity_list_from_ids(t).length}),r=n.join(", ");return n[0]>=e.CDC_data["autocreate-priority-set-size"]?"<span style='color:red'>"+r+"</span>":r}return""},actions:function(n,u){var c=[];return t.priority_score.length>0&&(c=c.concat(o.map(t.priority_score,function(t){return{icon:"fa-question",help:"Do some of these "+t.length+" nodes belong to a cluster of interest?",action:function(n,a){var u=new Set(t);"shown"!==(n=r(n.node())).data("popover_shown")?(n.popover({sanitize:!1,placement:"right",container:"body",html:!0,content:s.HIVTxNetwork.lookup_form_generator,trigger:"manual"}).on("shown.bs.popover",function(t){var n=i.select(this),r=i.select("#"+n.attr("aria-describedby")).selectAll(e.get_ui_element_selector_by_role("priority-membership-list",!0));r.selectAll("li").remove();var a=o.filter(o.map(e.defined_priority_groups,function(e){return[e.name,o.filter(e.nodes,function(e){return u.has(e.name)}).length,o.filter(e.partitioned_nodes[1].new_direct,function(e){return u.has(e.id)}).length,o.filter(e.partitioned_nodes[1].new_indirect,function(e){return u.has(e.id)}).length]}),function(e){return e[1]+e[2]+e[3]>0});a=0===a.length?[["No nodes belong to any cluster of interest or are linked to any of the clusters of interest."]]:o.map(a,function(t){var n="";return t[1]&&(n+=" "+t[1]+" nodes belong"),t[2]&&(n+=(n.length?", ":" ")+t[2]+" nodes are directly linked @ "+l.formats.PercentFormatShort(e.subcluster_threshold)),t[3]&&(n+=(n.length?", ":" ")+t[3]+" nodes are indirectly linked @ "+l.formats.PercentFormatShort(e.subcluster_threshold)),n+" to cluster of interest <code>"+t[0]+"</code>"}),(r=r.selectAll("li").data(a)).enter().insert("li"),r.html(function(e){return e})}).popover("show"),n.data("popover_shown","shown"),n.off("hidden.bs.popover").on("hidden.bs.popover",function(){r(this).data("popover_shown","hidden")})):(n.data("popover_shown","hidden"),n.popover("destroy"))}}}))),a.get_editor()&&t.priority_score.length>0&&(c=c.concat(o.map(t.priority_score,function(e){var n=new Set(e);return{icon:"fa-plus",action:function(e,r){return a.get_editor()&&a.get_editor().append_node_objects(o.filter(t.children,function(e){return n.has(e.id)&&(2===e.priority_flag||1===e.priority_flag)})),!1},help:"Add to cluster of interest"}}))),c}}}}]}}},6221:function(e,t,n){var r=n(3857),i=n(9050),o=["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],a=[];i.each([0,-.8],function(e){i.each(o,function(t){a.push(r.rgb(t).darker(e).toString())})});var s=a.length,l=["01 state/local molecular cluster analysis","02 national molecular cluster analysis","03 state/local time-space cluster analysis","04 national time-space cluster analysis","05 provider notification","06 partner services notification","07 other"],u=["01. Add cases diagnosed in the past 3 years and linked at 0.5% to a member in this cluster of interest","02. Add cases (regardless of HIV diagnosis date) linked at 0.5% to a member in this cluster of interest","03. Add cases diagnosed in the past 3 years and linked at 1.5% to a member in this cluster of interest","04. Add cases (regardless of HIV diagnosis date) linked at 1.5% to a member in this cluster of interest","05. Do not add cases to this cluster of interest. I do not want to monitor growth in this cluster of interest over time."],c={};c[l[0]]=!0;var d=u[0],f=u[4],p={};p[u[0]]=function(e,t){return e.length<.005},p[u[1]]=function(e,t){return e.length<.005},p[u[2]]=function(e,t){return e.length<.015},p[u[3]]=function(e,t){return e.length<.015};var h={};h[u[0]]=36,h[u[1]]=1e5,h[u[2]]=36,h[u[3]]=1e5;var g={};g[u[0]]="3 years, 0.5% distance",g[u[1]]="0.5% distance",g[u[2]]="3 years, 1.5% distance",g[u[3]]="1.5% distance",g[u[4]]="None";var m=["01 through analysis/notification","02 through investigation"],v=new Set(["alaska","delaware","hawaii","idaho","iowa","kansas","maine","montana","nebraska","new hampshire","newhampshire","new mexico","newmexico","north dakota","northdakota","rhode island","rhodeisland","south dakota","southdakota","utah","vermont","virgin islands","virginislands","west virginia","westvirginia","wyoming"]),y=l[0],_=m[0],b={FloatFormat:r.format(",.2r"),PercentFormat:r.format(",.3p"),PercentFormatShort:r.format(".2p"),DotFormatPadder:r.format("08d")};e.exports={Categorical:a,CategoricalBase:o,CDCCOICanAutoExpand:c,CDCCOIConciseTrackingOptions:g,CDCCOICreatedBySystem:"System",CDCCOICreatedManually:"Manual",CDCCOIKind:l,CDCCOIKindAutomaticCreation:y,CDCCOINodeKind:m,CDCCOINodeKindDefault:_,CDCCOITrackingOptions:u,CDCCOITrackingOptionsDateFilter:h,CDCCOITrackingOptionsDefault:d,CDCCOITrackingOptionsDistanceFilter:p,CDCCOITrackingOptionsNone:f,CDCJurisdictionCodes:{alabama:"al",alaska:"ak",americansamoa:"as",arizona:"az",arkansas:"ar",california:"ca",colorado:"co",connecticut:"ct",delaware:"de",districtofcolumbia:"dc",federatedstatesofmicronesia:"fm",florida:"fl",georgia:"ga",guam:"gu",hawaii:"hi",houston:"hx",idaho:"id",illinois:"il",indiana:"in",iowa:"ia",kansas:"ks",kentucky:"ky",louisiana:"la",maine:"me",marshallislands:"mh",maryland:"md",massachusetts:"ma",michigan:"mi",minnesota:"mn",mississippi:"ms",missouri:"mo",montana:"mt",nebraska:"ne",nevada:"nv",newhampshire:"nh",newjersey:"nj",newmexico:"nm",newyorkstate:"ny",nyc:"nx",northcarolina:"nc",north_dakota:"nd",northernmarianaislands:"mp",ohio:"oh",oklahoma:"ok",oregon:"or",palau:"pw",pennsylvania:"pa",puertorico:"pr",rhodeisland:"ri",southcarolina:"sc",southdakota:"sd",tennessee:"tn",texas:"tx",utah:"ut",vermont:"vt",virginislands:"vi",virginia:"va",washington:"wa",washingtondc:"dc",westvirginia:"wv",wisconsin:"wi",wyoming:"wy",chicago:"cx",philadelphia:"px",losangeles:"lx",sanfrancisco:"sx",republicofpalau:"pw","u.s.virginislands":"vi"},CDCJurisdictionLowMorbidity:v,CDCNPMember:"Ever in national priority clusterOI?",EdgeColorBase:["#000000","#aaaaaa"],formats:b,MaximumValuesInCategories:s,missing:{color:"#999",opacity:"0.1",label:"缺失"},network:{GraphAttrbuteID:"patient_attribute_schema",NodeAttributeID:"patient_attributes",ReducedValue:"Different (other) value",ContinuousColorStops:9,WarnExecutiveMode:"This feature is not available in the executive mode.",AliasedSequencesID:"aliased_sequences"},PresetColorSchemes:{sex_trans:{"MSM-Male":"#1f78b4","MMSC-Male":"#FFBF00","MSM-Unknown sex":"#1f78b4","MMSC-Unknown sex":"#FFBF00","Heterosexual Contact-Male":"#AAFF00","Heterosexual Contact-Female":"#AAFF00","Heterosexual Contact-Unknown sex":"#AAFF00","IDU-Male":"#0096FF","MSM & IDU-Male":"#33a02c","MMSC & IDU-Unknown sex":"#0096FF","MMSC & IDU-Male":"#FFBF00","IDU-Female":"#0096FF","IDU-Unknown sex":"#0096FF","Other/Unknown-Male":"#636363","Other/Unknown-Female":"#636363","Other-Male":"#636363","Other-Female":"#636363",Missing:"#636363","":"#636363","Other/Unknown-Unknown sex":"#636363",Perinatal:"#D2042D","Other/Unknown-Child":"#D2042D","Other-Child":"#D2042D"},race_cat:{Asian:"#1f77b4","Black/African American":"#bcbd22","Hispanic/Latino":"#9467bd","American Indian/Alaska Native":"#2ca02c","Native Hawaiian/Other Pacific Islander":"#17becf","Multiple Races":"#e377c2",Multiracial:"#e377c2","Multiple races":"#e377c2","Unknown race":"#999",Missing:"#999",missing:"#999",White:"#d62728"},sex_birth:{Male:"#FF6700",Female:"#50c878",Unknown:"#999"},birth_sex:{Male:"#FF6700",Female:"#50c878",Unknown:"#999"},gender_identity:{Woman:"#AAFF00","Transgender woman":"#228B22",Man:"#FFBF00","Transgender man":"#FF5F1F","Declined to answer":"#FAFA33","Additional gender identity":"#D2042D",Missing:"#999",Unknown:"#999"}},PresetShapeSchemes:{birth_sex:{Male:"square",Female:"ellipse",Missing:"diamond",missing:"diamond",Unknown:"diamond"},sex_birth:{Male:"square",Female:"ellipse",Missing:"diamond",missing:"diamond",Unknown:"diamond"},gender_identity:{Man:"square",Woman:"ellipse","Transgender man":"hexagon","Transgender woman":"circle","Additional gender identity":"pentagon",Unknown:"diamond","Declined to answer":"diamond"},race_cat:{Asian:"hexagon","Black/African American":"square","Hispanic/Latino":"triangle","American Indian/Alaska Native":"pentagon","Native Hawaiian/Other Pacific Islander":"octagon","Multiple Races":"diamond","Unknown race":"diamond",Missing:"diamond",missing:"diamond",White:"ellipse"},current_gender:{Male:"square",Female:"ellipse","Transgender-Male to Female":"hexagon","Transgender-Female to Male":"pentagon","Additional Gender Identity":"diamond",Unknown:"diamond",Missing:"diamond",missing:"diamond"}},SequentialColor:{2:["#feb24c","#e31a1c"],3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},ShapeOrdering:["circle","square","hexagon","diamond","cross","octagon","ellipse","pentagon"],SubclusterSeparator:".",CoIAddLimit:128}},2033:function(e,t,n){var r=n(3857),i=n(9983),o=n(9050);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var s=n(3729);e.exports.export_csv_button=function(e,t){if(null!==(e=r.csv.format(e))){t=t?t+".csv":"export.csv";var n=document.createElement("a");n.setAttribute("href","data:text/csv;charset=utf-8,"+encodeURIComponent(e)),n.setAttribute("download",t),n.className="btn btn-default btn-sm",n.innerHTML='<span class="glyphicon glyphicon-floppy-save"></span> Download CSV',i("body").append(n),n.click(),n.remove()}},e.exports.export_json_button=function(e,t){if(null!==e){t=t||"export";var n=document.createElement("a");n.setAttribute("href","data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e))),n.setAttribute("download",t+".json"),n.className="btn btn-default btn-sm",n.innerHTML='<span class="glyphicon glyphicon-floppy-save"></span> Download JSON',i("body").append(n),n.click(),n.remove()}},e.exports.save_image=function(e,t){var n="http://www.w3.org/2000/xmlns/",r=i(t).find("svg")[0];r||(r=i(t)[0]);var o=function(e){function t(e){try{if(e.cssRules)for(var r=0;r<e.cssRules.length;r++){var i=e.cssRules[r];3===i.type?t(i.styleSheet):i.selectorText&&-1===i.selectorText.indexOf(">")&&(n+="\n"+i.cssText)}}catch(t){console.log("Could not process stylesheet : "+e)}}var n="",r=e.styleSheets;if(r)for(var i=0;i<r.length;i++)t(r[i]);return n}(window.document);r.setAttribute("version","1.1");var a=document.createElement("defs");r.insertBefore(a,r.firstChild);var l=document.createElement("style");a.appendChild(l),l.setAttribute("type","text/css"),r.removeAttribute("xmlns"),r.removeAttribute("xlink"),r.hasAttributeNS(n,"xmlns")||r.setAttributeNS(n,"xmlns","http://www.w3.org/2000/svg"),r.hasAttributeNS(n,"xmlns:xlink")||r.setAttributeNS(n,"xmlns:xlink","http://www.w3.org/1999/xlink");var u,c,d,f,p=(new XMLSerializer).serializeToString(r).replace("</style>","<![CDATA["+o+"]]></style>"),h="data:image/svg+xml;base66,"+encodeURIComponent(['<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+p]);if(navigator.msSaveBlob)s(h,"image.svg","image/svg+xml");else if("png"===e)u=h,c=function(e){var t=window.URL.createObjectURL(e),n=document.createElement("a");n.setAttribute("download","image.png"),n.setAttribute("href",t),i("body").append(n),n.click(),n.remove()},d=function(e){console.log(error)},(f=new Image).onerror=d,f.onload=function(){var e=document.getElementById("hyphy-chart-canvas");e.width=f.width,e.height=f.height;var t=e.getContext("2d");if(t.fillStyle="#FFFFFF",t.fillRect(0,0,e.width,e.height),t.drawImage(f,0,0,e.width,e.height),e.msToBlob){var n=e.msToBlob(c);c(n),window.navigator.msSaveBlob(n,"image.png")}else e.toBlob(c)},f.src=u;else{var g=document.createElement("a");g.setAttribute("download","image.svg"),g.setAttribute("href",h),i("body").append(g),g.click(),g.remove()}},e.exports.describe_vector=function(e,t){var n;return e.length?(e.sort(r.ascending),n={min:r.min(e),max:r.max(e),median:r.median(e),Q1:r.quantile(e,.25),Q3:r.quantile(e,.75),mean:r.mean(e)}):n={min:null,max:null,median:null,Q1:null,Q3:null,mean:null},t&&(n="<pre>Range :"+n.min+"-"+n.max+"\nIQR :"+n.Q1+"-"+n.Q3+"\nMean :"+n.mean+"\nMedian :"+n.median+"\n</pre>"),n},e.exports.table_to_text=function(e,t){t=t||"\t";var n=[],i=function(e){var t=r.select(e).node().firstChild;if(t&&(t=t.nodeValue),t&&t.length)return t;var n=r.select(e).selectAll("[data-text-export]");return n.empty()?(n=r.select(e).selectAll("p, span, button, abbr, select")).empty()?"":r.select(n.node()).text():r.select(n.node()).attr("data-text-export")};r.selectAll(e+" thead th").each(function(){n.push(i(this))});var o=[];return r.select(e+" tbody").selectAll("tr").each(function(e){if("none"!==r.select(this).style("display")){var t=o.length;o.push([]),r.select(this).selectAll("td").each(function(){o[t].push(i(this))})}}),(","===t?r.csv.format([n]):r.tsv.format([n]))+"\n"+(","===t?r.csv.format(o):r.tsv.format(o))},e.exports.export_handler=function(e,t,n){if(window.navigator.userAgent.indexOf("MSIE ")>0||navigator.userAgent.match(/Trident.*rv\:11\./)){var r=window.open();r.document.write(e),r.document.close(),r.document.execCommand("SaveAs",!0,t+".csv"),r.close()}else{var i=document.createElement("a");i.setAttribute("href","data:"+(n||"text/plain")+";charset=utf-8,"+encodeURIComponent(e)),i.setAttribute("download",t||"download.tsv"),i.click(),i.remove()}},e.exports.getUniqueValues=function(e,t){var n=o.keys(t),r={};o.each(n,function(e){return r[e]=new Set});var i=o.map(e,function(e){return o.omit(e.patient_attributes,"_id")});return o.each(i,function(e){o.each(n,function(t){r[t].add(e[t])})}),o.mapObject(r,function(e){return function(e){if(Array.isArray(e))return a(e)}(t=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var t})},e.exports.exportColorScheme=function(e,t){var n=o.map(e[t.category_id],function(e){return t.category(e)});return o.object(e[t.category_id],n)},e.exports.copyToClipboard=function(e){navigator.clipboard.writeText(e).then(function(){console.log("Copying to clipboard was successful!")},function(e){console.error("Could not copy text: ",e)})},e.exports.collapseLargeCategories=function(e,t){var n=o.keys(t),r={};o.each(n,function(e){return r[e]=[]});var i=o.map(e,function(e){return o.omit(e.patient_attributes,"_id")});o.each(i,function(e){o.each(n,function(t){r[t].push(e[t])})});var a=o.mapObject(r,function(e){return o.countBy(e)});return o.each(n,function(t){var n=Object.entries(a[t]),r=o.sortBy(n,function(e){return-e[1]});if(r.length>12){var i=r[12][1],s=o.map(o.partition(r,function(e){return e[1]<=i})[0],o.first);o.each(e,function(e){o.contains(s,e.patient_attributes[t])&&(e.patient_attributes[t]="其他")})}}),!0}},4358:function(e,t,n){var r=n(3857),i=n(9050);t.K=function(e,t,n){var i=r.format(",.2f");!function(e,t,n,i,o){var a=10,s=30,l=50,u=30,c=300-u-s,d=300-a-l,f=r.scale.linear().domain([0,e.length+1]).range([0,c]),p=r.scale.log().domain([1,r.max(e)]).range([d,0]),h=r.sum(e),g=r.svg.axis().scale(f).orient("bottom"),m=r.select(o).selectAll("svg");m&&m.remove();var v=e.map(function(e,t){return{x:t+1,y:e+1}});v.push({x:e.length+1,y:1}),v.push({x:0,y:1}),v.push({x:0,y:e[0]+1}),m=r.select(o).insert("svg",".histogram-label").attr("width",c+u+s).attr("height",d+a+l).append("g").attr("transform","translate("+u+","+a+")").datum(v);var y=r.svg.line().x(function(e){return f(e.x)}).y(function(e){return p(e.y)}).interpolate("step-before");if(m.selectAll("path").remove(),m.append("path").attr("d",function(e){return y(e)+"Z"}).attr("class","histogram"),t){var _=r.svg.line().interpolate("linear").x(function(e,t){return f(t+1)+(f(t+1)-f(t))/2}).y(function(e){return p(1+e*h)});m.append("path").datum(t).attr("class","line").attr("d",function(e){return _(e)})}m.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")").call(g).selectAll("text").attr("transform","rotate(45)").attr("dx","1em").attr("dy","0.5em")}(e.Degrees.Distribution,e.Degrees.fitted,0,0,t);var o="Network degree distribution is best described by the <strong>"+e.Degrees.Model+"</strong> model, with &rho; of "+i(e.Degrees.rho);void 0!==e.Degrees["rho CI"]&&(o+=" (95% CI "+i(e.Degrees["rho CI"][0])+" - "+i(e.Degrees["rho CI"][1])+")"),r.select(n).html(o)},t.w=function(e,t,n){!function(e,t,n,o){var a={top:10,right:30,bottom:50,left:40},s=300-a.right,l=300-a.top-a.bottom,u=r.select(o).selectAll("svg");if(u&&u.remove(),e.length>0){var c=r.layout.histogram()(e),d=r.scale.linear().domain(r.extent(e)),f=r.scale.linear().domain([0,r.max(i.map(c,function(e){return e.y}))]).range([l,0]);a.left+=12+10*Math.ceil(Math.log10(f.domain()[1])),a.top+=18,s-=a.left,d.range([0,s]);var p=r.svg.axis().scale(d).orient("bottom"),h=r.svg.axis().scale(f).orient("left");c.splice(0,0,{x:d.domain()[0],y:0,dx:0}),c.splice(c.length,0,{x:d.domain()[1],y:0,dx:0}),u=r.select(o).insert("svg",".histogram-label").attr("width",s+a.left+a.right).attr("height",l+a.top+a.bottom).append("g").attr("transform","translate("+a.left+","+a.top+")").datum(c);var g=r.svg.line().x(function(e){return d(e.x+e.dx)}).y(function(e){return f(e.y)}).interpolate("step-before");u.selectAll("path").remove(),u.append("path").attr("d",function(e){return g(e)+"Z"}).attr("class","histogram"),u.append("g").attr("class","x axis").attr("transform","translate(0,"+l+")").call(p).selectAll("text").attr("transform","rotate(45)").attr("dx","1em").attr("dy","0.5em"),u.append("text").attr("transform","rotate(-90)").attr("y",0-a.left+12).attr("x",0-l/2).style("text-anchor","middle").text("边"),u.append("text").attr("transform","translate("+s/2+" ,"+(l+a.top+20)+")").style("text-anchor","middle").text("遗传距离"),u.append("g").attr("class","y axis").call(h)}}(i.map(e.Edges,function(e){return e.length}),0,0,t),r.select(n).html("链接节点间的遗传距离")}},1138:function(e,t,n){var r=n(3857);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||s(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function c(e,t,n){return(t=d(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var f=n(9050),p=n(4861),h=n(6221),g=n(4835),m=n(6822),v=function(){function e(t,n,i,o){var l=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),c(this,"_calc_country_nodes",function(e){e&&"country-centers"in e&&(l.mapProjection=r.geo.mercator().translate([l.margin.left+l.width/2,l.margin.top+l.height/2]).scale(150*l.width/960),f.each(l.countryCentersObject,function(e){e.countryXY=l.mapProjection([e.longt,e.lat])}))}),c(this,"filter_by_size",function(e){return e.children.length>=l.minimum_cluster_size}),c(this,"unique_entity_list",function(e){return f.map(f.groupBy(e,function(e){return l.primary_key(e)}),function(e,t){return t})}),c(this,"unique_entity_list_from_ids",function(e){return l.unique_entity_list(f.map(e,function(e){return{id:e}}))}),c(this,"unique_entity_object_list",function(e){return f.groupBy(e,function(e){return l.primary_key(e)})}),c(this,"filter_singletons",function(e){return e.children.length>1}),c(this,"filter_if_added",function(e){return"existing"!==l.cluster_attributes[e.cluster_id].type}),c(this,"filter_time_period",function(e){return f.some(l.nodes_by_cluster[e.cluster_id],function(e){return l.attribute_node_value_by_id(e,p.getClusterTimeScale())>=l.using_time_filter})}),c(this,"priority_groups_find_by_name",function(e){return this.defined_priority_groups?f.find(this.defined_priority_groups,function(t){return t.name===e}):null}),c(this,"priority_groups_all_events",function(){var e=new Set;return this.defined_priority_groups&&f.each(this.defined_priority_groups,function(t){f.each(t.nodes,function(t){e.add(p.DateViewFormatSlider(t.added))})}),e}),c(this,"priority_groups_compute_overlap",function(e){var t=this;this.priority_node_overlap={};var n={},r={};f.each(e,function(e){n[e.name]=t.aggregate_indvidual_level_records(e.node_objects),r[e.name]=n[e.name].length,f.each(n[e.name],function(n){var r=t.entity_id(n);r in t.priority_node_overlap||(t.priority_node_overlap[r]=new Set),t.priority_node_overlap[r].add(e.name)})}),f.each(e,function(e){var i={sets:new Set,nodes:0,supersets:[],duplicates:[]},o={};f.each(n[e.name],function(n){var r=t.entity_id(n);t.priority_node_overlap[r].size>1&&(i.nodes++,t.priority_node_overlap[r].forEach(function(t){t!==e.name&&(t in o||(o[t]=[]),o[t].push(r)),i.sets.add(t)}))}),f.each(o,function(t,n){t.length==r[e.name]&&(r[n]==r[e.name]?i.duplicates.push(n):i.supersets.push(n))}),e.overlap={nodes:i.nodes,sets:Math.max(0,i.sets.size-1),superset:i.supersets,duplicate:i.duplicates}})}),c(this,"auto_expand_pg_handler",function(e,t,n){var r=this;t||(t={},f.each(this.json.Nodes,function(e,n){t[e.id]=n}));var i=new Set(f.map(e.nodes,function(e){return t[e.name]})),o=new Set,l=h.CDCCOITrackingOptionsDistanceFilter[e.tracking],u=this.get_reference_date();if(l){var c,d=p.n_months_ago(u,h.CDCCOITrackingOptionsDateFilter[e.tracking]);if(n){for(var m=a(i),v=new Set(m),y=0;y<m.length;y++){var _=m[y];_ in this.json.Nodes&&f.each(a(n[_]),function(e){var t=[];v.has(e.source)||t.push(e.source),v.has(e.target)||t.push(e.target),f.each(t,function(e){m.push(e),v.add(e)})})}c=new Set,f.each(f.filter(m,function(e){return e in r.json.Nodes}),function(e){var t,r=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=s(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(a)throw i}}}}(n[e]);try{for(r.s();!(t=r.n()).done;){var i=t.value;c.add(i)}}catch(e){r.e(e)}finally{r.f()}}),c=a(c)}else c=this.json.Edges;var b=g.hivtrace_cluster_depthwise_traversal(this.json.Nodes,c,function(e){var t=l(e);return t&&(i.has(e.source)&&i.has(e.target)||(t=t&&r.filter_by_date(d,p._networkCDCDateField,u,r.json.Nodes[e.source])&&r.filter_by_date(d,p._networkCDCDateField,u,r.json.Nodes[e.target]))),t},!1,f.filter(f.map(a(i),function(e){return r.json.Nodes[e]}),function(e){return e}));f.each(b,function(e){f.each(e,function(e){i.has(t[e.id])||o.add(t[e.id])})})}return o}),c(this,"priority_groups_export",function(e,t){return e=e||this.defined_priority_groups,f.map(f.filter(e,function(e){return t||e.validated}),function(e){return{name:e.name,description:e.description,nodes:e.nodes,modified:p.DateFormats[0](e.modified),kind:e.kind,created:p.DateFormats[0](e.created),createdBy:e.createdBy,tracking:e.tracking,autocreated:e.autocreated,autoexpanded:e.autoexpanded,pending:e.pending,history:e.history}})}),c(this,"priority_groups_update_node_sets",function(e,t){var n=this.priority_groups_find_by_name(e);if(n){var i=this.priority_groups_export([n]),o={operation:t,name:e,url:window.location.href,sets:JSON.stringify(i)};this.priority_set_table_write&&this.priority_set_table_writeable&&r.text(this.priority_set_table_write).header("Content-Type","application/json").post(JSON.stringify(o),function(e,t){e&&console.log("received fatal error:",e)})}}),c(this,"priority_groups_edit_set_description",function(e,t,n){var r=this.priority_groups_find_by_name(e);r&&(r.description=t,this.priority_groups_update_node_sets(e,"update"),n&&m.draw_priority_set_table(this))}),c(this,"priority_groups_remove_set",function(e,t){if(this.defined_priority_groups){var n=f.findIndex(this.defined_priority_groups,function(t){return t.name===e});n>=0&&(this.priority_groups_update_node_sets(e,"delete"),this.defined_priority_groups.splice(n,1),t&&m.draw_priority_set_table(this))}}),c(this,"priority_groups_export_nodes",function(e,t){var n=this;return e=e||this.defined_priority_groups,f.flatten(f.map(f.filter(e,function(e){return t||e.validated}),function(e){var t,i=new Set(e.not_in_network),o=n.aggregate_indvidual_level_records(e.node_objects);t=n.unique_entity_list_from_ids(f.map(f.filter(e.nodes,function(t){return t.added<=e.created}),function(e){return e.name})).length;var a=f.groupBy(f.filter(e.nodes,function(e){return!i.has(e.name)}),function(e){return n.entity_id_from_string(e.name)}),s=f.groupBy(f.filter(e.node_objects,function(e){return!i.has(e.id)}),function(e){return n.entity_id_from_string(e.id)});return f.map(f.filter(o,function(e){return new Set(n.list_of_aliased_sequences(e)).difference(i).size>0}),function(i){var l=n.entity_id(i);return{eHARS_uid:l,cluster_uid:e.name,cluster_ident_method:e.kind,person_ident_method:a[l][0].kind,person_ident_dt:p.hivtrace_date_or_na_if_missing(a[l][0].added),sample_dt:r.min(s[l],function(e){return p.hivtrace_date_or_na_if_missing(n.attribute_node_value_by_id(e,"sample_dt"))}),new_linked_case:n.priority_groups_is_new_node(a[l][0])?1:0,cluster_created_dt:p.hivtrace_date_or_na_if_missing(e.created),network_date:p.hivtrace_date_or_na_if_missing(n.today),cluster_detect_size:t,cluster_type:e.createdBy,cluster_modified_dt:p.hivtrace_date_or_na_if_missing(e.modified),cluster_growth:h.CDCCOIConciseTrackingOptions[e.tracking],national_priority:e.meets_priority_def,cluster_current_size:o.length,cluster_dx_recent12_mo:e.cluster_dx_recent12_mo,cluster_overlap:e.overlap.sets,SequenceID:n.list_of_aliased_sequences(i).map(function(e){return e.split("|")[1]}).join(";")}})}))}),c(this,"priority_groups_export_sets",function(){var e=this;return f.flatten(f.map(f.filter(this.defined_priority_groups,function(e){return e.validated}),function(t){return{cluster_type:t.createdBy,cluster_uid:t.name,cluster_modified_dt:p.hivtrace_date_or_na_if_missing(t.modified),cluster_created_dt:p.hivtrace_date_or_na_if_missing(t.created),cluster_ident_method:t.kind,cluster_growth:h.CDCCOIConciseTrackingOptions[t.tracking],cluster_current_size:e.aggregate_indvidual_level_records(t.node_objects).length,national_priority:t.meets_priority_def,cluster_dx_recent12_mo:t.cluster_dx_recent12_mo,cluster_dx_recent36_mo:t.cluster_dx_recent36_mo,cluster_overlap:t.overlap.sets}}))}),c(this,"priority_groups_is_new_node",function(e){return e.autoadded}),c(this,"check_for_time_series",function(e){var t=this,n=function(e,n){n&&(n=r.select(n)),e.network_cluster_dynamics?(n&&n.text("Show time-course plots"),e.network_cluster_dynamics.remove(),e.network_cluster_dynamics=null,e.handle_inline_charts=null):(e.network_cluster_dynamics=e.network_svg.append("g").attr("id",t.dom_prefix+"-dynamics-svg").attr("transform","translate ("+.45*e.width+",0)"),e.handle_inline_charts=function(t){var n=null,r=null;if(e.colorizer.category_id&&!e.colorizer.continuous){var i=e.json[h.network.GraphAttrbuteID][e.colorizer.category_id];(n={})[e.colorizer.category_id]=i.label,(r={})[i.label]=e.colorizer.category}g.cluster_dynamics(e.extract_network_time_series(p.getClusterTimeScale(),n,t),e.network_cluster_dynamics,"Quarter of Diagnosis","Number of Cases",null,null,{base_line:20,top:e.margin.top,right:e.margin.right,bottom:60,left:100,font_size:12,rect_size:14,width:e.width/2,height:e.height/2,colorizer:r,prefix:e.dom_prefix,barchart:!0,drag:{x:.45*e.width,y:0}})},e.handle_inline_charts(),n&&n.text("Hide time-course plots"))};p.getClusterTimeScale()&&(e?e.push(["Show time-course plots",n]):n(this))}),this.json=t,this.button_bar_ui=n,this.warning_string="",this.subcluster_table=null,this.priority_set_table_write=null,this.priority_set_table_writeable=null,this.cluster_attributes=[],this.minimum_cluster_size=0,this.isPrimaryGraph=!o,this.nodeFilterObject=null,this.primary_key=f.isFunction(i)?i:function(e){var t=e.id.indexOf("|");return t>=0?e.id.substr(0,t):e.id},this.tabulate_multiple_sequences(),this.initialize_ui_ux_elements(),this.defined_priority_groups=[],this.using_time_filter=null}return t=e,n=[{key:"group_edges_by_primary_key",value:function(){var e=this,t={};return f.each(this.json.Edges,function(n){try{var r=e.primary_key(e.json.Nodes[n.source]),i=e.primary_key(e.json.Nodes[n.target]);t[r]||(t[r]=[]),t[r].push(n),r!==i&&(t[i]||(t[i]=[]),t[i].push(n))}catch(e){throw console.log(e),e}}),t}},{key:"initialize_ui_ux_elements",value:function(){this.node_label_drag=r.behavior.drag().on("drag",function(e){e.label_x+=r.event.dx,e.label_y+=r.event.dy,r.select(this).attr("transform","translate("+(e.label_x+1.25*e.rendered_size)+","+(e.label_y+.5*e.rendered_size)+")")}).on("dragstart",function(){r.event.sourceEvent.stopPropagation()}).on("dragend",function(){r.event.sourceEvent.stopPropagation()}),this.colorizer={selected:function(e){return"selected"===e?r.rgb(51,122,183):"#FFF"}},this.highlight_unsuppored_edges=!0,this.node_shaper={id:null,shaper:function(){return"circle"}},this.charge_correction=5,this.cluster_filtering_functions={size:this.filter_by_size,singletons:this.filter_singletons}}},{key:"tabulate_multiple_sequences",value:function(){var e=this;this.primary_key_list={},this.has_multiple_sequences=!1,f.each(this.json.Nodes,function(t){var n=e.primary_key(t);n in e.primary_key_list?(e.primary_key_list[n].push(t),e.has_multiple_sequences=!0,e.legend_multiple_sequences=!0):e.primary_key_list[n]=[t],e.legend_multiple_sequences||t[h.network.AliasedSequencesID]&&(e.legend_multiple_sequences=!0)}),this.has_multiple_sequences&&f.each(this.primary_key_list,function(e,t){if(e.length>1){var n={};f.each(e,function(e){f.each(e[h.network.NodeAttributeID],function(e,t){t in n?n[t].push(e):n[t]=[e]})}),n=f.omit(f.mapObject(n,function(e,t){var n=f.countBy(e,function(e){return e});return 1==f.size(n)?f.keys(n)[0]:null}),function(e){return!e}),f.each(e,function(e){f.extend(e[h.network.NodeAttributeID],n)})}})}},{key:"cluster_display_filter",value:function(e){return f.every(this.cluster_filtering_functions,function(t){return t(e)})}},{key:"get_reference_date",value:function(){return!this.isPrimaryGraph&&this.parent_graph_object?this.parent_graph_object.today:this.today}},{key:"lookup_option",value:function(e,t,n){return this.json.Settings&&this.json.Settings[e]?this.json.Settings[e]:n&&n[e]?n[e]:t}},{key:"get_ui_element_selector_by_role",value:function(e,t){if(!t||this.isPrimaryGraph)return(t?"":"#"+this.button_bar_ui)+g.get_ui_element_selector_by_role(e)}},{key:"process_multiple_sequences",value:function(e,t){var n=this;if(this.has_multiple_sequences&&this.isPrimaryGraph){e=e||1e-6,t=t||.015;var r=g.hivtrace_cluster_depthwise_traversal(this.json.Nodes,this.json.Edges),i=g.hivtrace_cluster_depthwise_traversal(this.json.Nodes,this.json.Edges,function(t){return t.length<=e}),o=g.hivtrace_compute_adjacency(this.json.Nodes,this.json.Edges,function(e){return e.length<=t}),s=g.hivtrace_compute_adjacency(this.json.Nodes,this.json.Edges,function(e){return e.length<=.005}),l=new Set;f.each(r,function(e,t){1==n.unique_entity_list(e).length&&f.each(e,function(e){l.add(e.id)})});var u=l.size;if(console.log("Marked ",u," nodes in null clusters"),f.each(i,function(e,t){if(e.length>1){if(f.some(e,function(e){return l.has(e.id)}))return;var r=n.unique_entity_object_list(e);f.each(r,function(e,t){if(e.length>1){for(var n=new Set(f.map(e,function(e){return e.id})),r=new Set(f.map(f.filter(a(o[e[0].id]),function(e){return!n.has(e)}))),i=new Set(f.map(f.filter(a(s[e[0].id]),function(e){return!n.has(e)}))),u=!0,c=1;c<e.length;c+=1){var d=new Set(f.map(f.filter(a(o[e[c].id]),function(e){return!n.has(e)}))),p=new Set(f.map(f.filter(a(s[e[c].id]),function(e){return!n.has(e)})));if(!(d.isSubsetOf(r)&&r.isSubsetOf(d)&&d.isSubsetOf(i)&&r.isSubsetOf(p))){u=!1;break}}u&&(e[0][h.network.AliasedSequencesID]=f.map(e,function(e){return e.id}),f.each(e,function(e,t){t>0&&l.add(e.id)}))}})}}),console.log("Marked ",l.size-u," collapsible nodes"),l.size){var c=[],d=[],p=[],m=0;f.each(this.json.Nodes,function(e,t){l.has(e.id)?p.push(-1):(c.push(e),p.push(m),m++)}),f.each(this.json.Edges,function(e,t){var n=p[e.source],r=p[e.target];n>=0&&r>=0&&(e.source=n,e.target=r,d.push(e))}),this.json.Nodes=c,this.json.Edges=d,this.tabulate_multiple_sequences()}}}},{key:"annotate_multiple_clusters_on_nodes",value:function(){if(this.has_multiple_sequences){var e={};f.each(this.primary_key_list,function(t,n){if(t.length>=2){var r=f.groupBy(t,function(e){return e.cluster});f.size(r)>1?(e[n]=f.keys(r),f.each(t,function(e){e["multiple clusters"]=f.keys(r)})):f.each(t,function(e){delete e["multiple clusters"]}),r=f.filter(f.map(f.groupBy(t,function(e){return e.subcluster_label}),function(e,t){return t}),function(e){return"undefined"!=e}),f.size(r)>1?f.each(t,function(e){e["multiple subclusters"]=r}):f.each(t,function(e){delete e["multiple subclusters"]})}}),this.entities_in_multiple_clusters=e}}},{key:"simplify_multisequence_cluster",value:function(e){var t=this,n=f.pairs(f.mapObject(this.unique_entity_object_list(e.Nodes),function(e){return t.aggregate_indvidual_level_records(e)[0]})),r=f.object(f.map(n,function(e,t){return[e[0],t]})),i={};f.each(n,function(e){var t=e[1][h.network.AliasedSequencesID]||[e[1].id];f.each(t,function(t){i[t]=r[e[0]]})}),g.hivtrace_compute_adjacency(e.Nodes,e.Edges);var o=f.map(r,function(e){return f.map(r,function(e){return 0})}),a=f.map(r,function(e){return f.map(r,function(e){return 0})});f.each(e.Edges,function(t){var n=i[e.Nodes[t.source].id],r=i[e.Nodes[t.target].id];n!=r&&(o[n][r]+=1,o[r][n]+=1,a[n][r]+=t.length,a[r][n]+=t.length)});var s=[];return f.each(o,function(e,t){for(var n=t+1;n<e.length;n++)e[n]>0&&s.push({source:t,target:n,attributes:[],length:a[t][n]/e[n],weight:e[n]})}),e.Edges=s,e.Nodes=f.map(n,function(e){return e[1]}),e}},{key:"generate_cross_hatch_pattern",value:function(e){var t="id"+this.dom_prefix+"_diagonalHatch_"+e.substr(1,10);if(this.network_svg.select("#"+t).empty()){var n=this.network_svg.append("defs").append("pattern").attr("id",t).attr("patternUnits","userSpaceOnUse").attr("width","6").attr("height","6").attr("patternTransform","rotate(45)");n.append("rect").attr("width","3").attr("height","6").attr("fill",e).attr("transform","translate(0,0)"),n.append("rect").attr("width","3").attr("height","6").attr("fill",function(e){var t=r.rgb(e);return.299*t.r+.587*t.g+.114*t.b>128?"#000000":"#ffffff"}(e)).attr("transform","translate(3,0)")}return t}},{key:"priority_groups_pending",value:function(){return f.filter(this.defined_priority_groups,function(e){return e.pending}).length}},{key:"priority_groups_expanded",value:function(){return f.filter(this.defined_priority_groups,function(e){return e.expanded}).length}},{key:"priority_groups_automatic",value:function(){return f.filter(this.defined_priority_groups,function(e){return e.createdBy===h.CDCCOICreatedBySystem}).length}},{key:"generateClusterOfInterestID",value:function(e){for(var t=this.CDC_data.jurisdiction_code+"_"+p.DateViewFormatClusterCreate(this.CDC_data.timestamp)+"_"+e,n="",r=1,i=this.auto_create_priority_sets.find(function(e){return e.name===t+n})||this.defined_priority_groups.find(function(e){return e.name===t+n});void 0!==i;)n="_"+r,r++,i=this.auto_create_priority_sets.find(function(e){return e.name===t+n})||this.defined_priority_groups.find(function(e){return e.name===t+n});return t+n}},{key:"map_ids_to_objects",value:function(){var e=this;this.node_id_to_object||(this.node_id_to_object={},f.each(this.json.Nodes,function(t,n){e.node_id_to_object[t.id]=t}))}},{key:"attribute_node_value_by_id",value:function(e,t,n,r){try{if(h.network.NodeAttributeID in e&&t&&t in e[h.network.NodeAttributeID]){var i;if(i=this.json[h.network.GraphAttrbuteID][t].volatile?this.json[h.network.GraphAttrbuteID][t].map(e,this):e[h.network.NodeAttributeID][t],f.isString(i)){if(0===i.length)return h.missing.label;if(n)return i=Number(i),f.isNaN(i)?h.missing.label:i;if(date)return i.getTime()}return i}}catch(r){console.log("attribute_node_value_by_id",r,e,t,n)}return h.missing.label}},{key:"extract_single_cluster",value:function(t,n,r,i,o,a){var s={},l={};return s.Nodes=f.map(t,function(e,t){if(l[e.id]=t,r)return e;var n=f.clone(e);return n.cluster=1,n}),i=i||this.json,s.Edges=f.filter(a||i.Edges,function(t){return!f.isUndefined(t.source)&&!f.isUndefined(t.target)&&i.Nodes[t.source].id in l&&i.Nodes[t.target].id in l&&(o||!e.is_edge_injected(t))}),n&&(s.Edges=f.filter(s.Edges,n)),s.Edges=f.map(s.Edges,function(e){var t=f.clone(e);return t.source=l[i.Nodes[e.source].id],t.target=l[i.Nodes[e.target].id],t}),s}},{key:"parse_dates",value:function(e){if(e instanceof Date)return e;var t=null;if(f.any(p.DateFormats,function(n){return t=n.parse(e)})){if(this._is_CDC_&&(t.getFullYear()<1970||t.getFullYear()>p.DateUpperBoundYear))throw Error("Invalid date");return t}throw Error("Invalid date")}},{key:"filter_by_date",value:function(t,n,r,i,o){if(o&&e.is_new_node(i))return!0;var a=this.attribute_node_value_by_id(i,n);if(a instanceof Date)return a>=t&&a<=r;try{if((a=this.parse_dates(this.attribute_node_value_by_id(i,n)))instanceof Date)return a>=t&&a<=r}catch(e){return}return!1}},{key:"priority_group_entity_count",value:function(e){return this.unique_entity_list_from_ids(f.map(e.nodes,function(e){return e.name})).length}},{key:"priority_groups_validate",value:function(e,t){var n=this;if(f.some(e,function(e){return!e.validated})){var r=f.chain(this.clusters).map("subclusters").flatten().filter(function(e){return e.priority_score.length}).map("priority_score").flatten(1).map(function(e){return n.unique_entity_list_from_ids(e)}).filter(function(e){return e.length>=n.CDC_data["autocreate-priority-set-size"]}).map(function(e){return new Set(e)}).value();this.map_ids_to_objects();var i={},o={};f.each(this.json.Nodes,function(e,t){i[e.id]=t,o[t]=new Set}),f.each(this.json.Edges,function(e){o[e.source].add(e),o[e.target].add(e)});var s=null;f.each(e,function(e){if(!e.validated){e.node_objects=[],e.not_in_network=[],e.validated=!0,e.created=f.isDate(e.created)?e.created:p.DateFormats[0].parse(e.created),e.modified?e.modified=f.isDate(e.modified)?e.modified:p.DateFormats[0].parse(e.modified):e.modified=e.created,e.tracking||(e.kind===h.CDCCOIKind[0]?e.tracking=h.CDCCOITrackingOptions[0]:e.tracking=h.CDCCOITrackingOptions[4]),e.createdBy||(e.kind===h.CDCCOIKind[0]?e.createdBy=h.CDCCOICreatedBySystem:e.createdBy=h.CDCCOICreatedManually);var l=[],u={},c=new Set,d=new Set,m=new Set,v=new Set;f.each(e.nodes,function(t){var r=t.name;if(r in n.node_id_to_object){var i=n.node_id_to_object[r];c.add(i.subcluster_label),d.add(i.cluster),e.node_objects.push(i),v.add(r)}else{if(n.has_multiple_sequences){var o=n.primary_key_list[r];if(o)return 1==o.length?(t.name=o[0].id,e.node_objects.push(o[0]),c.add(o[0].subcluster_label),d.add(o[0].cluster),void v.add(r)):(u[r]={subclusters:new Set,clusters:new Set},void(u[r]=[o,f.clone(t)]))}e.not_in_network.push(r)}});var y=[];if(f.size(u)){var _=null;e.createdBy==h.CDCCOICreatedBySyste||e.tracking==h.CDCCOITrackingOptions[0]||e.tracking==h.CDCCOITrackingOptions[1]?_=c:e.tracking!=h.CDCCOITrackingOptions[2]&&e.tracking!=h.CDCCOITrackingOptions[3]||(_=d),_&&0!=_.size||((_={}).has=function(e){return!0}),f.each(u,function(t){var n=t[1];m.add(n.name),f.each(t[0],function(t){if(_.has(t.subcluster_label)){e.node_objects.push(t);var r=f.clone(n);r.name=t.id,r.added=n.added,l.push(r),e.nodes.push(r)}else y.push(t)})})}var b=f.groupBy(e.nodes,function(e){return e.name}),w=new Set;if(f.each(b,function(e,t){f.size(e)>1&&w.add(t)}),m.size&&(e.nodes=f.filter(e.nodes,function(e){return!m.has(e.name)})),w.size){var x=new Set,k=[];f.each(e.nodes,function(e){if(w.has(e.name)){if(x.has(e.name))return;x.add(e.name)}k.push(e)}),e.nodes=k;var C=[];x=new Set,f.each(e.node_objects,function(e){if(w.has(e.id)){if(x.has(e.id))return;x.add(e.id)}C.push(e)}),e.node_objects=C}var D=" Migrated to multiple sequences per person cluster";if(w.size||m.size){var S=e.description.split(D);if(S.length>1){var A=f.countBy(S.slice(1,-1));e.description=S[0]+D,f.each(A,function(t,n){e.description+=n})}}(l.length||y.length)&&(e.description+=D,f.each([[l,"used the following sequences "],[y,"ignored the following sequences "]],function(t,r){if(t[0].length){var i={};f.each(t[0],function(t){var o=n.primary_key("id"in t?t:{id:t.name});o in i||(i[o]=[]),i[o].push(t),0==r&&e.nodes.push(t)}),e.description+="; "+t[1]+f.map(i,function(e,t){return t+" ("+f.map(e,function(e){return e.id||e.name}).join(", ")+")"}).join("; ")}}));var E=new Set(f.map(e.node_objects,function(e){return e.id}));s||(s=[g.hivtrace_compute_adjacency_with_edges(n.json.Nodes,n.json.Edges,function(e){return e.length<=.015}),g.hivtrace_compute_adjacency_with_edges(n.json.Nodes,n.json.Edges,function(e){return e.length<=n.subcluster_threshold})]);var M=[],T=f.flatten(g.hivtrace_cluster_depthwise_traversal(n.json.Nodes,n.json.Edges,function(e){return e.length<=.015},M,e.node_objects,null,s[0])),j=[],N=f.flatten(g.hivtrace_cluster_depthwise_traversal(n.json.Nodes,n.json.Edges,function(e){return e.length<=n.subcluster_threshold},j,e.node_objects,null,s[1])),F=new Set,O=n.extract_single_cluster(T,function(e){return e.length<=.015&&(E.has(n.json.Nodes[e.target].id)||E.has(n.json.Nodes[e.source].id))},!0,M);f.each(O.Edges,function(e){f.each([e.source,e.target],function(e){E.has(O.Nodes[e].id)||F.add(O.Nodes[e].id)})});var I=n.get_reference_date(),z=n.extract_single_cluster(N,function(e){return e.length<=n.subcluster_threshold&&(E.has(n.json.Nodes[e.target].id)||E.has(n.json.Nodes[e.source].id))},!0,j),$=new Set,q=new Set;if(f.each(z.Edges,function(t){f.each([t.source,t.target],function(t){E.has(z.Nodes[t].id)||($.add(z.Nodes[t].id),n.filter_by_date(e.modified||e.created,p._networkCDCDateField,I,z.Nodes[t],!0)&&q.add(z.Nodes[t].id))})}),e.partitioned_nodes=f.map([[T,F],[N,$]],function(t){var r={existing_direct:[],new_direct:[],existing_indirect:[],new_indirect:[]};return f.each(t[0],function(i){var o;E.has(i.id)||(o=n.filter_by_date(e.modified||e.created,p._networkCDCDateField,I,i,!0)?"new":"existing",t[1].has(i.id)?o+="_direct":o+="_indirect",r[o].push(i))}),r}),t&&e.tracking!==h.CDCCOITrackingOptionsNone){var R=n.auto_expand_pg_handler(e,i,o);R.size&&(f.each(a(R),function(t){var r=n.json.Nodes[t];e.nodes.push({name:r.id,added:I,kind:h.CDCCOINodeKindDefault,autoadded:!0}),e.node_objects.push(r)}),e.validated=!1,e.autoexpanded=!0,e.pending=!0,e.expanded=R.size,e.modified=n.get_reference_date())}var P=new Set(n.unique_entity_list_from_ids(f.map(e.nodes,function(e){return e.name})));e.meets_priority_def=f.some(r,function(e){return f.filter(a(e),function(e){return P.has(e)}).length===e.size});for(var L=n.get_reference_date(),B=function(){var t=V[U],r=p.n_months_ago(n.get_reference_date(),t.months);e[t.field_name]=n.unique_entity_list(f.filter(e.node_objects,function(e){return n.filter_by_date(r,p._networkCDCDateField,L,e,!1)})).length},U=0,V=[{field_name:"cluster_dx_recent12_mo",months:12},{field_name:"cluster_dx_recent36_mo",months:36}];U<V.length;U++)B();e.history=e.history||[];var H=p.getCurrentDate(),W={date:H,size:n.priority_group_entity_count(e),new_nodes:0,national_priority:e.meets_priority_def,cluster_dx_recent12_mo:e.cluster_dx_recent12_mo,cluster_dx_recent36_mo:e.cluster_dx_recent36_mo};e.history=e.history.filter(function(e){return e.size!==W.size||e.national_priority!==W.national_priority||e.cluster_dx_recent12_mo!==W.cluster_dx_recent12_mo||e.cluster_dx_recent36_mo!==W.cluster_dx_recent36_mo||e.new_nodes!==W.new_nodes||new Date(e.date)<new Date(new Date(H)-864e5)}),e.history.push(W)}})}}},{key:"display_warning",value:function(e,t){if(this.network_warning_tag)if(e.length){var n=r.select(this.network_warning_tag);n.selectAll("div").remove(),t?n.append("div").html(e):n.append("div").text(e),n.style("display","block")}else r.select(this.network_warning_tag).style("display","none")}},{key:"priority_groups_compute_node_membership",value:function(){var e=[],t={};f.each(this.defined_priority_groups,function(n){e.push([n.name,n.createdBy===h.CDCCOICreatedBySystem]),f.each(n.nodes,function(n){n.name in t?t[n.name].push(e.length-1):t[n.name]=[e.length-1]})});for(var n=["Yes (dx≤12 months)","Yes (12<dx≤36 months)","Yes (dx>36 months)","No"],i=this.get_reference_date(),a=this,s={subcluster_or_priority_node:{depends:[p._networkCDCDateField],label:h.CDCNPMember,enum:n,type:"String",volatile:!0,color_scale:function(){return r.scale.ordinal().domain(n.concat([h.missing.label])).range(["red","orange","yellow","steelblue",h.missing.color])},map:function(r){if(r.id in t&&f.some(t[r.id],function(t){return e[t][1]})){var o=[p.n_months_ago(i,12),p.n_months_ago(i,36)];return a.filter_by_date(o[0],p._networkCDCDateField,i,r,!1)?n[0]:a.filter_by_date(o[1],p._networkCDCDateField,i,r,!1)?n[1]:n[2]}return n[3]}},cluster_uid:{depends:[p._networkCDCDateField],label:"Clusters of Interest",type:"String",volatile:!0,map:function(n){var r=t[n.id]||[];return 1===r.length?e[r[0]][0]:r.length>1?"Multiple":"None"}},subcluster_id:{depends:[p._networkCDCDateField],label:"Subcluster ID",type:"String",map:function(e){return e?e.subcluster_label||"None":h.missing.label}}},l=new Set,u=0,c=Object.entries(s);u<c.length;u++){var d=o(c[u],2),g=d[0],m=d[1];l.add(g),this.populate_predefined_attribute(m,g)}this._aux_populate_category_menus(),this._is_CDC_&&this.define_node_search_table()}},{key:"priority_group_node_record",value:function(e,t,n){return{name:e,added:t||this.get_reference_date(),kind:n||h.CDCCOINodeKindDefault,autoadded:!0}}},{key:"load_priority_sets",value:function(e,t){var n=this;r.json(e,function(e,i){if(e)throw Error("Failed loading cluster of interest file "+e.responseURL);var o=new Date;o.setFullYear(1900),n.defined_priority_groups=f.clone(i),f.each(n.defined_priority_groups,function(e){f.each(e.nodes,function(e){try{e.added=p.DateFormats[0].parse(e.added),e.added>o&&(o=e.added)}catch(e){}})}),n.priority_set_table_writeable="writeable"===t,n.priority_groups_validate(n.defined_priority_groups,n._is_CDC_auto_mode),n.auto_create_priority_sets=[];var s,l=p.DateFormats[0](n.get_reference_date());n.map_ids_to_objects(),n._is_CDC_auto_mode&&f.each(n.clusters,function(e,t){f.each(e.subclusters,function(e){f.each(e.priority_score,function(t,r){if(n.unique_entity_list(f.map(t,function(e){return{id:e}})).length>=n.CDC_data["autocreate-priority-set-size"]){var i={};if(f.each(e.recent_nodes[r],function(e){i[e]=1}),f.filter(f.filter(n.defined_priority_groups,function(e){return e.kind in h.CDCCOICanAutoExpand&&e.createdBy===h.CDCCOICreatedBySystem&&e.tracking===h.CDCCOITrackingOptionsDefault}),function(e){return f.countBy(f.map(e.nodes,function(e){return e.name in i}))[!0]>=1}).length>=1)return;var o=n.generateClusterOfInterestID(e.cluster_id);n.auto_create_priority_sets.push({name:o,description:"Automatically created cluster of interest "+o,nodes:f.map(e.recent_nodes[r],function(e){return n.priority_group_node_record(e,n.get_reference_date())}),created:l,kind:h.CDCCOIKindAutomaticCreation,tracking:h.CDCCOITrackingOptions[0],createdBy:h.CDCCOICreatedBySystem,autocreated:!0,autoexpanded:!1,pending:!0})}})})}),n.auto_create_priority_sets.length&&(s=n.defined_priority_groups).push.apply(s,a(n.auto_create_priority_sets));var u=n.defined_priority_groups.filter(function(e){return e.autocreated}).length,c=n.defined_priority_groups.filter(function(e){return e.autoexpanded}).length,d=u+c>0,g=n.defined_priority_groups.filter(function(e){return e.pending}).length;d&&(n.warning_string+="<br/>Automatically created <b>"+u+"</b> and expanded <b>"+c+"</b> clusters of interest."+(g>0?" <b>Please review <span id='banner_coi_counts'></span> clusters in the <code>Clusters of Interest</code> tab.</b><br>":""),n.display_warning(n.warning_string,!0));var v=n.get_ui_element_selector_by_role("priority_set_counts",!0);if(n.priority_set_table_writeable)v&&g>0&&(r.select(v).text(g),r.select("#banner_coi_counts").text(g));else{var y="old"===t?"the network is <b>older</b> than some of the Clusters of Interest":"the network was ran in <b>standalone</b> mode so no data is stored";n.warning_string+='<p class="alert alert-danger"class="alert alert-danger">READ-ONLY mode for Clusters of Interest is enabled because '.concat(y,". None of the changes to clustersOI made during this session will be recorded.</p>"),n.display_warning(n.warning_string,!0),v&&r.select(v).text("Read-only")}n.priority_groups_validate(n.defined_priority_groups);var _=n.auto_create_priority_sets.map(function(e){return e.name});f.each(n.defined_priority_groups,function(e){e.name in _?n.priority_groups_update_node_sets(e.name,"insert"):n.priority_groups_update_node_sets(e.name,"update")}),m.draw_priority_set_table(n),n.showing_diff&&n.has_network_attribute("subcluster_or_priority_node")&&n.handle_attribute_categorical("subcluster_or_priority_node")})}},{key:"inject_attribute_description",value:function(e,t){if(h.network.GraphAttrbuteID in this.json){var n={};n[e]=t,f.extend(this.json[h.network.GraphAttrbuteID],n)}}},{key:"populate_predefined_attribute",value:function(t,n){var r=this;if(f.isFunction(t)&&(t=t(this)),!t.depends||f.every(t.depends,function(e){return f.has(r.json[h.network.GraphAttrbuteID],e)})){if(this.inject_attribute_description(n,t),f.each(this.json.Nodes,function(i){var o=t.map(i,r);e.inject_attribute_node_value_by_id(i,n,o)}),t.enum)this.uniqValues[n]=t.enum;else{var i=new Set;"Date"===t.type?f.each(this.json.Nodes,function(e){try{i.add(r.attribute_node_value_by_id(e,n).getTime())}catch(e){}}):f.each(this.json.Nodes,function(e){return i.add(r.attribute_node_value_by_id(e,n,"Number"===t.type))}),this.uniqValues[n]=a(i),("Number"===t.type||"Date"==t.type)&&((t.color_stops||h.network.ContinuousColorStops)>this.uniqValues[n].length&&(t.color_stops=this.uniqValues[n].length),"Number"===t.type&&(t.is_integer=f.every(this.uniqValues[n],function(e){return Number.isInteger(e)})))}this.uniqs[n]=this.uniqValues[n].length;var o={};o[n]=t,"priority_set"==n&&console.log(),f.extend(this.json[h.network.GraphAttrbuteID],o),t.overwrites&&f.has(this.json[h.network.GraphAttrbuteID],t.overwrites)&&(this.json[h.network.GraphAttrbuteID][t.overwrites]._hidden_=!0)}}},{key:"define_attribute_COI_membership",value:function(e,t){t=t||this.get_reference_date();var n=["No, dx>36 months","No, but dx�12 months","Yes (dx�12 months)","Yes (12<dx� 36 months)","Future node","Not a member of subcluster","Not in a subcluster","No, but 12<dx� 36 months"];return{depends:[p._networkCDCDateField],label:"ClusterOI membership as of "+p.DateViewFormat(t),enum:n,volatile:!0,color_scale:function(){return r.scale.ordinal().domain(n.concat([h.missing.label])).range(f.union(["steelblue","pink","red","#FF8C00","#9A4EAE","yellow","#FFFFFF","#FFD580"],[h.missing.color]))},map:function(e){return e.subcluster_label?e.priority_flag>0?n[e.priority_flag]:n[0]:n[6]}}}},{key:"define_attribute_binned_vl",value:function(e,t){var n=this,i=["<200","200-10000",">10000"];return{depends:[e],label:t,enum:i,type:"String",color_scale:function(){return r.scale.ordinal().domain(i.concat([h.missing.label])).range(f.union(h.SequentialColor[3],[h.missing.color]))},map:function(t){var r=n.attribute_node_value_by_id(t,e,!0);return r!==h.missing.label?r<=200?i[0]:r<=1e4?i[1]:i[2]:h.missing.label}}}},{key:"define_attribute_vl_interpretaion",value:function(){var e=this;return{depends:["vl_recent_value","result_interpretation"],label:"Viral load result interpretation",color_stops:6,scale:r.scale.log(10).domain([10,1e6]).range([0,5]),category_values:["Suppressed","Viremic (above assay limit)"],type:"Number-categories",color_scale:function(e){var t=r.scale.linear().range(["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"]).domain(f.range(h.network.ContinuousColorStops,-1,-1));return function(n){if(f.isNumber(n))return t(e.scale(n));switch(n){case e.category_values[0]:return t(0);case e.category_values[1]:return t(5);default:return h.missing.color}}},label_format:r.format(",.0f"),map:function(t){var n=e.attribute_node_value_by_id(t,"vl_recent_value",!0),r=e.attribute_node_value_by_id(t,"result_interpretation");if(n!==h.missing.label||r!==h.missing.label){if(r===h.missing.label)return n;if("<"===r)return"Suppressed";if(">"===r)return"Viremic (above assay limit)";if(n!==h.missing.label)return n}return h.missing.label}}}},{key:"define_attribute_network_update",value:function(){return{label:"Sequence updates compared to previous network",enum:["Existing","New","Moved clusters"],type:"String",map:function(t){return e.is_new_node(t)?"New":t.attributes.indexOf("moved_clusters")>=0?"Moved clusters":"Existing"},color_scale:function(){return r.scale.ordinal().domain(["Existing","New","Moved clusters",h.missing.label]).range(["#7570b3","#d95f02","#1b9e77","gray"])}}}},{key:"define_attribute_dx_years",value:function(e,t){var n=this;return{depends:[p._networkCDCDateField],label:t,type:"Number",label_format:e?r.format(".2f"):r.format(".0f"),map:function(t){try{var r=n.parse_dates(n.attribute_node_value_by_id(t,p._networkCDCDateField));return r?e?(n.get_reference_date()-r)/31536e6:String(r.getFullYear()):h.missing.label}catch(e){return h.missing.label}},color_scale:function(e){var t=f.without(e.value_range,h.missing.label),n=f.compose(r.interpolateRgb("#ffffcc","#800026"),r.scale.linear().domain([t[0],t[t.length-1]]).range([0,1]));return function(e){return e===h.missing.label?h.missing.color:n(e)}}}}},{key:"fetch_sequence_objects_for_pid",value:function(e){return this.primary_key_list[e]}},{key:"fetch_sequences_for_pid",value:function(e){return this.has_multiple_sequences?f.flatten(f.map(this.primary_key_list[e],function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID]:e.id})):this.primary_key_list[e]}},{key:"define_attribute_sequence_count",value:function(e){var t=this;return{depends:[],label:e,type:"Number",label_format:r.format("d"),map:function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID].length:t.has_multiple_sequences?t.fetch_sequences_for_pid(t.primary_key(e)).length:1},color_scale:function(e){var t=f.without(e.value_range,h.missing.label),n=f.compose(r.interpolateRgb("#ffffcc","#800026"),r.scale.linear().domain([t[0],t[t.length-1]]).range([0,1]));return function(e){return e===h.missing.label?h.missing.color:n(e)}}}}},{key:"define_attribute_age_dx",value:function(){var e=this;return{depends:["age_dx"],overwrites:"age_dx",label:"Age at Diagnosis",enum:["<13","13-19","20-29","30-39","40-49","50-59","�60"],type:"String",color_scale:function(){return r.scale.ordinal().domain(["<13","13-19","20-29","30-39","40-49","50-59","�60",h.missing.label]).range(["#b10026","#e31a1c","#fc4e2a","#fd8d3c","#feb24c","#fed976","#ffffb2","#636363"])},map:function(t){var n=e.attribute_node_value_by_id(t,"age_dx");return">=60"===n||"�60"===n||Number(n)>=60?"�60":n}}}},{key:"annotate_cluster_changes",value:function(){this.cluster_attributes&&f.each(this.cluster_attributes,function(e){"old_size"in e&&"size"in e?(e.delta=e.size-e.old_size,e.deleted=e.old_size+(e.new_nodes?e.new_nodes:0)-e.size):"new"===e.type?(e.delta=e.size,"moved"in e&&(e.delta-=e.moved)):e.delta=0,e.flag=e.moved||e.deleted?2:3})}},{key:"extract_individual_level_records",value:function(){if(this.has_multiple_sequences&&this.primary_key_list){var e=[];return f.each(this.primary_key_list,function(t,n){t.length>1?e.push(f.find(t,function(e){return!e.missing_attributes})||t[0]):e.push(t[0])}),e}return this.json.Nodes}},{key:"aggregate_indvidual_level_records",value:function(e){var t=this;e=e||this.json.Nodes;var n=function(e,t,n,r){var i=f.countBy(e,function(e){return e[t]});delete i[void 0],1==f.size(i)?n[r]=e[0][t]:f.size(i)>0&&(n[r]=f.map(i,function(e,t){return t}).join(";"))};if(this.has_multiple_sequences){var i=f.groupBy(e,function(e){return t.primary_key(e)}),o=[];return f.each(i,function(e,i){if(1==e.length)o.push(f.clone(e[0]));else{var a=f.clone(e[0]);a[h.network.NodeAttributeID]=f.object(f.map(a[h.network.NodeAttributeID],function(n,i){var o=t.json[h.network.GraphAttrbuteID][i],a=f.countBy(e,function(e){return e[h.network.NodeAttributeID][i]});if(1==f.size(a))return[i,e[0][h.network.NodeAttributeID][i]];if("Date"!=o.type)return[i,f.sortBy(f.map(a,function(e,t){return t})).join(";")];try{return[i,new Date(Date.parse(r.min(f.map(a,function(e,t){return t}))))]}catch(e){return[i,null]}})),n(e,"cluster",a,"cluster"),n(e,"subcluster_label",a,"subcluster_label"),a[h.network.AliasedSequencesID]=f.flatten(f.map(e,function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID]:e.id})),a[h.network.NodeAttributeID].sequence_count=a[h.network.AliasedSequencesID].length,o.push(a)}}),o}return e}},{key:"entity_id_from_string",value:function(e){return this.primary_key({id:e})}},{key:"entity_id",value:function(e){return this.primary_key(e)}},{key:"apply_to_entities",value:function(e){this.has_multiple_sequences&&f.each(this.primary_key_list,function(t,n){e(n,t)})}},{key:"list_of_aliased_sequences",value:function(e){return e[h.network.AliasedSequencesID]?e[h.network.AliasedSequencesID]:[e.id]}}],i=[{key:"lookup_form_generator",value:function(){return'<div><ul data-hivtrace-ui-role = "priority-membership-list"></ul></div>'}},{key:"is_new_node",value:function(e){return e.attributes.indexOf("new_node")>=0}},{key:"is_edge_injected",value:function(e){return"edge_type"in e}},{key:"inject_attribute_node_value_by_id",value:function(e,t,n){h.network.NodeAttributeID in e&&t&&(e[h.network.NodeAttributeID][t]=n)}}],n&&u(t.prototype,n),i&&u(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,i}();e.exports={HIVTxNetwork:v}},3110:function(e,t,n){"use strict";n.r(t),n.d(t,{clusterNetwork:function(){return j},colorPicker:function(){return z},graphSummary:function(){return $},helpers:function(){return I},histogram:function(){return F.K},histogramDistances:function(){return F.w},misc:function(){return O},scatterPlot:function(){return d.M}});var r=n(3857),i=n(9050),o=n(4417);function a(e){return e}function s(e,t){var n=t.id,r=t.bbox,i=null==t.properties?{}:t.properties,o=function(e,t){var n=function(e){if(null==e)return a;var t,n,r=e.scale[0],i=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,a){a||(t=n=0);var l=2,u=e.length,c=new Array(u);for(c[0]=(t+=e[0])*r+o,c[1]=(n+=e[1])*i+s;l<u;)c[l]=e[l],++l;return c}}(e.transform),r=e.arcs;function i(e,t){t.length&&t.pop();for(var i=r[e<0?~e:e],o=0,a=i.length;o<a;++o)t.push(n(i[o],o));e<0&&function(e,t){for(var n,r=e.length,i=r-t;i<--r;)n=e[i],e[i++]=e[r],e[r]=n}(t,a)}function o(e){return n(e)}function s(e){for(var t=[],n=0,r=e.length;n<r;++n)i(e[n],t);return t.length<2&&t.push(t[0]),t}function l(e){for(var t=s(e);t.length<4;)t.push(t[0]);return t}function u(e){return e.map(l)}return function e(t){var n,r=t.type;switch(r){case"GeometryCollection":return{type:r,geometries:t.geometries.map(e)};case"Point":n=o(t.coordinates);break;case"MultiPoint":n=t.coordinates.map(o);break;case"LineString":n=s(t.arcs);break;case"MultiLineString":n=t.arcs.map(s);break;case"Polygon":n=u(t.arcs);break;case"MultiPolygon":n=t.arcs.map(u);break;default:return null}return{type:r,coordinates:n}}(t)}(e,t);return null==n&&null==r?{type:"Feature",properties:i,geometry:o}:null==r?{type:"Feature",id:n,properties:i,geometry:o}:{type:"Feature",id:n,bbox:r,properties:i,geometry:o}}var l=new ArrayBuffer(16);new Float64Array(l),new Uint32Array(l),Math.PI,Math.abs,Math.atan2,Math.cos,Math.sin;var u=n(2033),c=n(8834),d=n(8033),f=n(905),p=n(4861),h=n(7568),g=n(6822),m=n(4835),v=n(6221),y=n(4257),_=n(1138),b=n(5795);function w(e,t,n){i.default.each(t,function(t,r){r!==n&&_.HIVTxNetwork.inject_attribute_node_value_by_id(e,r,t)})}function x(e,t,n,r,i,o,a,s){var l={node_class:"injected",node_annotation:a,attributes:[],degree:0};l[v.network.NodeAttributeID]={},l.id=t,w(l,n,r),i[t]=e.json.Nodes.length,e.json.Nodes.push(l),o.push(l);var u=e.primary_key(l);u in s?s[u].push(l):s[u]=[l]}function k(e,t,n,r,i,o){e.open_exclusive_tab_view(t,n,o,e._social_view_options(r,i),!0)}function C(e,t,n,r,o){function a(t){return _.HIVTxNetwork.is_edge_injected(t)||t.length<=e.subcluster_threshold}var s=[],l=m.hivtrace_cluster_depthwise_traversal(e.json.Nodes,e.json.Edges,n||a,s,t.children),u={},c={};s[0]&&Array.isArray(s[0])&&i.default.each(s[0],function(e){e.edge_type&&(u[e.edge_type]=1,c[e.edge_type]=1)}),(u=i.default.keys(u)).sort(),u.push(""),c[""]=1,r=r||function(e){return"Subcluster "+t.cluster_id+"[+ "+o+"]"},e.view_subcluster(t,l[0],r(t.cluster_id),e._social_view_options(u,c),a,!0)._refresh_subcluster_view(e.today||p.getCurrentDate())}function D(e,t,n,o,a){var s=a||"Social",l=[],u={},c=0,d={},f={},p={};if(i.default.each(e.json.Nodes,function(t,n){d[t.id]=t;var r=e.primary_key(t);r in p?p[r].push(t):p[r]=[t],f[t.id]=n}),t&&t.length){if(!(n in t[0]))throw Error(n+" is not one of the attributes in the imported node records");i.default.each(t[0],function(t,r){if(r!==n){var i={label:r,type:"String",annotation:s};e.inject_attribute_description(r,i)}}),i.default.each(t,function(t){t[n]in d?(w(d[t[n]],t,n),c++):(e.primary_key({id:t[n]})in p&&c++,x(e,t[n],t,n,f,l,s,p))})}if(o&&o.length){var h=!(t&&t.length),g={};i.default.each(o,function(t){try{if(!("Index"in t&&"Partner"in t&&"Contact"in t))throw Error("Missing required attribute (Index, Partner, or Contact)");var r=i.default.map(["Index","Partner"],function(e){return{type:e,node:t[e]}});if(i.default.each(r,function(t){if(t.node in f)g[t.node]=!0;else{if(!h)throw Error("Invalid node: "+t.node);x(e,t.node,[],n,f,l,s,p)}}),u[t.Contact]=(u[t.Contact]||0)+1,e.has_multiple_sequences){var o=e.entity_id_from_string(t.Index),a=e.entity_id_from_string(t.Partner);i.default.each(p[o],function(n){i.default.each(p[a],function(r){var i={source:f[n.id],target:f[r.id],edge_type:t.Contact,length:.005,directed:!0};e.json.Edges.push(i)})})}else{var c={source:f[t.Index],target:f[t.Partner],edge_type:t.Contact,length:.005,directed:!0};e.json.Edges.push(c)}}catch(e){throw Error("Invalid edge specification ( "+e+") "+JSON.stringify(t))}}),h&&(c=i.default.size(g)),e._aux_populate_category_menus(),e.tabulate_multiple_sequences(),e.update_clusters_with_injected_nodes(null,null,s),e.extra_cluster_table_columns||(e.extra_cluster_table_columns=[]),e.extra_subcluster_table_columns||(e.extra_subcluster_table_columns=[]);var v={};i.default.each(e.json.Edges,function(t){try{if(e.json.Nodes[t.source]&&e.json.Nodes[t.target]){var n=i.default.union(i.default.keys(e.json.Nodes[t.source].extended_cluster),i.default.keys(e.json.Nodes[t.target].extended_cluster));i.default.each(n,function(e){e in v||(v[e]={}),t.edge_type&&(v[e][t.edge_type]=1)})}}catch(e){console.log("Error processing edge for cluster types:",e,t)}});var y={};i.default.each(v,function(e,t){var n=i.default.keys(e);n.sort(),y[t]=n});var _=[{description:{value:s+" network",help:"View subclusters with "+s+" data"},generator:function(t){return{value:t,callback:function(t,n){var o=r.select(t);o.append("button").classed("btn btn-primary btn-xs pull-right",!0).style("margin-left","1em").text("Complete "+s).on("click",function(t){return C(e,n,null,null,s)});var a={};i.default.each(n.children,function(e){a[e.id]=1}),o.append("button").classed("btn btn-primary btn-xs pull-right",!0).text("Directly linked "+s).on("click",function(t){return C(e,n,function(t){return e.json.Nodes[t.target].id in a||e.json.Nodes[t.source].id in a},function(e){return"Subcluster "+n.cluster_id+"[+ direct "+s+"]"})})}}}}],b=[{description:{value:s+" network",sort:function(e){return e.value[0]},help:"Nodes added and clusters merged through "+s},generator:function(t){return{value:[t.injected?t.injected[s]:0,t.linked_clusters,t.cluster_id],callback:function(n,o){var a=r.select(n);a.text(Number(o[0])+" "+s+" nodes. ");var l=[];o[1]&&(l=i.default.without(i.default.keys(o[1]),o[2])).length&&(l.sort(),a.append("span").classed("label label-info",!0).text("Bridges to "+l.length+" clusters").attr("title",l.join(", ")));var u=i.default.clone(y[o[2]]||[]);if(o[0]>0||l.length||y[o[2]]&&u.length){u.push("");var c={};i.default.each(u,function(e){c[e]=1}),a.append("button").classed("btn btn-primary btn-xs pull-right",!0).text("Directly linked "+s).style("margin-left","1em").on("click",function(n){var r={},a={};i.default.each(t.children,function(e){a[e.id]=1});var l=m.hivtrace_cluster_depthwise_traversal(e.json.Nodes,e.json.Edges,function(t){return e.json.Nodes[t.target].id in a||e.json.Nodes[t.source].id in a},!1,t.children);i.default.each(l[0],function(e){r[e.id]=!0}),k(e,o[2],function(e){return e.id in r},u,c,function(e){return"Cluster "+e+"[+ direct "+s+"]"})}),a.append("button").classed("btn btn-primary btn-xs pull-right",!0).text("Complete "+s).on("click",function(t){return k(e,o[2],function(e){return e.extended_cluster&&o[2]in e.extended_cluster},u,c,function(e){return"Cluster "+e+"[+ "+s+"]"})})}}}}}];e.extra_cluster_table_columns?e.extra_cluster_table_columns=e.extra_cluster_table_columns.concat(b):e.extra_cluster_table_columns=b,e.subcluster_table&&(e.extra_subcluster_table_columns?e.extra_subcluster_table_columns=e.extra_subcluster_table_columns.concat(_):e.extra_subcluster_table_columns=_)}return e.isPrimaryGraph&&(t||o)&&(e.draw_cluster_table(e.extra_cluster_table_columns,e.cluster_table),e.subcluster_table&&e.draw_cluster_table(e.extra_subcluster_table_columns,e.subcluster_table,{subclusters:!0,"no-clusters":!0}),e._is_CDC_||self.draw_node_table(self.extra_node_table_columns,self.json.Nodes)),{nodes:l,existing_nodes:c,edges:u}}n(5384),n(4728);var S=n(9983);function A(e){return function(e){if(Array.isArray(e))return T(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||M(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function E(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||M(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var j=function(e,t,n,a,l,w,x,k,C,M,T){e.Settings&&e.Settings.compact_json&&y.unpack_compact_json(e),e[v.network.GraphAttrbuteID]||(e[v.network.GraphAttrbuteID]={}),e[v.network.GraphAttrbuteID]=Object.fromEntries(Object.entries(e[v.network.GraphAttrbuteID]).map(function(e){var t=E(e,2),n=t[0],r=t[1];return[n.toLowerCase(),r]})),S("#filter_input").val("").attr("placeholder","在属性中搜索文本"),S("#show_as").html("显示为"),y.normalize_node_attributes(e),y.ensure_node_attributes_exist(e),e.Edges=i.default.filter(e.Edges,function(e){return"source"in e&&"target"in e});var N=y.check_network_option(T,"secondary",!0,!1),F=new _.HIVTxNetwork(e,l,null,!N);F.process_multiple_sequences(),F._is_CDC_=!T||!T.no_cdc,F._is_seguro=y.check_network_option(T,"seguro",!1,!0),F._is_CDC_executive_mode=y.check_network_option(T,"cdc-executive-mode",!1),F.uniqValues=u.getUniqueValues(F.json.Nodes,F.json[v.network.GraphAttrbuteID]),F.uniqs=i.default.mapObject(F.uniqValues,function(e){return e.length}),F.schema=F.json[v.network.GraphAttrbuteID],F.networkColorScheme=v.PresetColorSchemes,F.networkShapeScheme=v.PresetShapeSchemes,F.ww=y.check_network_option(T,"width",r.select(M).property("clientWidth")),F.margin={top:20,right:10,bottom:30,left:10},F.width=F.ww-F.margin.left-F.margin.right,F.height=9*F.width/16,F.container=t,F.nodes=[],F.edges=[],F.clusters=[],F.cluster_sizes=[],F.cluster_mapping={},F.percent_format=v.formats.PercentFormat,F.missing=v.missing.label,F.cluster_attributes=F.json["Cluster description"]||null,F.precomputed_subclusters=F.json.Subclusters||null,F.network_warning_tag=a,F.annotate_cluster_changes(),F.filter_edges=!0,F.hide_hxb2=!1,F.cluster_table=r.select(k),F._is_CDC_?(F.priority_set_table=y.check_network_option(T,"priority-table"),F.priority_set_table_write=y.check_network_option(T,"priority-table-writeback"),F.priority_set_table&&(F.priority_set_table=r.select(F.priority_set_table))):(F.priority_set_table=null,F.priority_set_table_write=null),F.needs_an_update=!1,F.hide_unselected=!1,F.show_percent_in_pairwise_table=!1,F.priority_set_table_writeable=!0,T&&i.default.isFunction(T.init_code)&&T.init_code.call(null,F,T),F.dom_prefix=y.check_network_option(T,"prefix","hiv-trace"),F.extra_cluster_table_columns=y.check_network_option(T,"cluster-table-columns",null),F.parent_graph_object=y.check_network_option(T,"parent_graph",null),F.json.Settings&&F.json.Settings.created?F.today=new Date(e.Settings.created):F.today=y.check_network_option(T,"today",p.getCurrentDate()),F._is_CDC_&&(F._is_CDC_auto_mode=y.check_network_option(T,"cdc-no-auto-priority-set-mode",!0,!1),F.displayed_node_subset=y.check_network_option(T,"node-attributes",[f._networkNodeIDField,"sex_trans","race_cat","hiv_aids_dx_dt","cur_city_name"]),F.subcluster_table=y.check_network_option(T,"subcluster-table",null,r.select(T["subcluster-table"])),F.extra_subcluster_table_columns=null,F.CDC_data={jurisdiction:F.lookup_option("jurisdiction","unknown",T).toLowerCase().replace(/\s/g,""),timestamp:F.today,"autocreate-priority-set-size":5},F.CDC_data.jurisdiction in v.CDCJurisdictionCodes?F.CDC_data.jurisdiction_code=v.CDCJurisdictionCodes[F.CDC_data.jurisdiction].toUpperCase():F.CDC_data.jurisdiction_code="PG",v.CDCJurisdictionLowMorbidity.has(F.CDC_data.jurisdiction)&&(F.CDC_data["autocreate-priority-set-size"]=3),F.subcluster_table?F.extra_subcluster_table_columns=b.secure_hiv_trace_subcluster_columns(F):F.extra_cluster_table_columns?F.extra_cluster_table_columns=F.extra_cluster_table_columns.concat(b.secure_hiv_trace_subcluster_columns(F)):F.extra_cluster_table_columns=b.secure_hiv_trace_subcluster_columns(F)),F._is_CDC_?F.extra_node_table_columns=null:F.extra_node_table_columns=y.check_network_option(T,"node-table-columns"),F.subcluster_threshold=y.check_network_option(T,"subcluster-thershold",.005),F.isPrimaryGraph&&(g.init(F),h.init(r.select(C))),F.countryCentersObject=y.check_network_option(T,"country-centers"),F.countryOutlines=y.check_network_option(T,"country-outlines"),F.countryCentersObject&&F.countryOutlines?(F._calc_country_nodes(T),F.showing_on_map=T.showing_on_map):F.showing_on_map=!1,F._additional_node_pop_fields=[],F.minimum_cluster_size=y.check_network_option(T,"minimum size",5),p.init(T,F._is_CDC_,p._networkCDCDateField),F._is_CDC_&&F._additional_node_pop_fields.push(p._networkCDCDateField),F.core_link_length=y.check_network_option(T,"core-link",-1),F.additional_edge_styler=y.check_network_option(T,"edge-styler"),F.json.Notes&&i.default.each(F.json.Notes,function(e){return F.warning_string+=e+"<br>"}),F.cluster_attributes?(F.warning_string+=" 由于渲染限制,某些簇可能已折叠",F.showing_diff=!0,F.cluster_filtering_functions.new=F.filter_if_added):(F.showing_diff=!1,p.getClusterTimeScale()&&"Cluster sizes"in F.json&&F.json["Cluster sizes"].length>250&&(F.using_time_filter=p.getCurrentDate(),F.warning_string+=" 由于渲染限制,某些簇可能已折叠",F.using_time_filter.setFullYear(F.using_time_filter.getFullYear()-1),F.cluster_filtering_functions.recent=F.filter_time_period)),F.initial_packed=!T||"tiled"!==T.initial_layout,F._networkPredefinedAttributeTransforms={binned_vl_recent_value:F.define_attribute_binned_vl("vl_recent_value","Most Recent Viral Load Category Binned"),binned_vl_recent_value_adj:F.define_attribute_binned_vl("vl_recent_value_adj","Most Recent Viral Load Category Binned"),vl_result_interpretation:F.define_attribute_vl_interpretaion(),age_dx_normalized:F.define_attribute_age_dx(),years_since_dx:F.define_attribute_dx_years(!0,"Years since diagnosis"),hiv_aids_dx_dt_year:F.define_attribute_dx_years(!1,"Diagnosis Year"),sequence_count:F.define_attribute_sequence_count("Number of sequences")},F.cluster_attributes&&(F._networkPredefinedAttributeTransforms._newly_added=F.define_attribute_network_update()),T&&T["computed-attributes"]&&i.default.extend(F._networkPredefinedAttributeTransforms,T["computed-attributes"]),F._get_node_country=function(e){var t=F.attribute_node_value_by_id(e,"country");return t===v.missing.label&&(t=F.attribute_node_value_by_id(e,"Country")),t},F._draw_topomap=function(e){if(T&&"showing_on_map"in T){var t=(a=F.countryOutlines,l=F.countryOutlines.objects.countries,"GeometryCollection"===l.type?{type:"FeatureCollection",features:l.geometries.map(function(e){return s(a,e)})}:s(a,l)).features,n=r.select("#"+F.dom_prefix+"-network-svg"),o=r.geo.path().projection(F.mapProjection);(t=n.selectAll(".country").data(t)).enter().append("path"),t.exit().remove(),F.countries_in_cluster={},i.default.each(F.nodes,function(e){var t=F._get_node_country(e),n=F.countryCentersObject[t].countryCodeNumeric;n in F.countries_in_cluster||(F.countries_in_cluster[n]=!0)}),t.attr("class","country").attr("d",o).attr("stroke","saddlebrown").attr("fill",function(e){return e.id in F.countries_in_cluster?"navajowhite":"bisque"}).attr("stroke-width",function(e){return e.id in F.countries_in_cluster?1.5:.5})}var a,l;return F},F.open_exclusive_tab_close=function(e,t,n){S(n).tab("show"),S("#"+e).remove(),S("#"+t).remove()},F.open_exclusive_tab_view=function(e,t,n,r,o){var a=i.default.find(F.clusters,function(t){return String(t.cluster_id)===String(e)});if(a){(r=r||{}).parent_graph=F;var s=F.extract_single_cluster(t?i.default.filter(F.json.Nodes,t):a.children,null,null,null,o);F.has_multiple_sequences&&(i.default.each(s.Nodes,function(e){e["multiple clusters"]&&(e.multiple_membership=!0)}),r["simplified-mspp"]&&(s=F.simplify_multisequence_cluster(s))),v.network.GraphAttrbuteID in F.json&&(s[v.network.GraphAttrbuteID]={},S.extend(!0,s[v.network.GraphAttrbuteID],F.json[v.network.GraphAttrbuteID]));var l=[];return F._is_CDC_executive_mode||l.push(["导出簇到 CSV",function(t){u.export_csv_button(F._extract_attributes_for_nodes(F._extract_nodes_by_id(e),F._extract_exportable_attributes()))}]),"extra_menu"in r?i.default.each(l,function(e){r.extra_menu.items.push(e)}):i.default.extend(r,{extra_menu:{title:"操作",items:l}}),F.open_exclusive_tab_view_aux(s,n?n(e):"簇 "+e,r)}},F.open_exclusive_tab_view_aux=function(e,t,n){for(var r=m.random_id(),o=r+"_tab",a=r+"_div",s=r+"_ui";S("#"+o).length||S("#"+a).length||S("#"+s).length;)r=m.random_id(),o=r+"_tab",a=r+"_div",s=r+"_ui";var l="#trace-default-tab",u=S("<li></li>").attr("id",o),c=S("<a></a>").attr("href","#"+a).attr("data-toggle","tab").text(t);S('<button type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>').appendTo(c).on("click",function(){F.open_exclusive_tab_close(o,a,l)}),c.appendTo(u),S("#top_level_tab_container").append(u);var d,f,p=S("<div></div>").addClass("tab-pane").attr("id",a).data("cluster",n.cluster_id);if("subcluster"===n.type&&p.addClass("subcluster-view").addClass("subcluster-"+n.cluster_id.replace(".","_")),e&&((d=S('[data-hivtrace="cluster-clone"]').clone().attr("data-hivtrace",null)).find("[data-hivtrace-button-bar='yes']").attr("id",s).addClass("cloned-cluster-tab"),d.appendTo(p)),p.appendTo("#top_level_tab_content"),S(c).on("show.bs.tab",function(e){e.relatedTarget&&(l=e.relatedTarget)}),S(c).tab("show"),!e)return p.attr("id");var h={no_cdc:T&&T.no_cdc,"minimum size":0,secondary:!0,prefix:r,extra_menu:T&&"extra_menu"in T?T.extra_menu:null,"edge-styler":T&&"edge-styler"in T?T["edge-styler"]:null,"no-subclusters":!0,"no-subcluster-compute":!1};return n&&i.default.extend(h,n),n.showing_on_map&&F.countryCentersObject&&F.countryOutlines&&(h.showing_on_map=!0,h["country-centers"]=F.countryCentersObject,h["country-outlines"]=F.countryOutlines,h["extra-graphics"]="extra-graphics"in h?i.default.wrap(function(e,t){return e(t),t._draw_topomap()},h["extra-graphics"]):function(e){return e._draw_topomap()}),h.today=F.today,h.auto_expand_single_cluster=!0,f=j(e,"#"+a,null,null,s,w,null,null,null,M,h),F.colorizer.category_id&&(F.colorizer.continuous?f.handle_attribute_continuous(F.colorizer.category_id):f.handle_attribute_categorical(F.colorizer.category_id)),F.node_shaper.id&&f.handle_shape_categorical(F.node_shaper.id),F.colorizer.opacity_id&&f.handle_attribute_opacity(F.colorizer.opacity_id),f},S('input[type="checkbox"]').prop("checked",!1);var O=function(e){if(!r.event.defaultPrevented){var t=r.select(F.container),n="d3_context_menu_id",i=t.select("#"+n);i.empty()&&(i=t.append("ul").attr("id",n).attr("class","dropdown-menu").attr("role","menu")),i.selectAll("li").remove(),e?(e.fixed=1,i.append("li").append("a").attr("tabindex","-1").text("折叠簇").on("click",function(t){e.fixed=0,function(e){J(F.clusters[F.cluster_mapping[e.cluster]]),F.update(!1,.4)}(e),i.style("display","none")}),i.append("li").append("a").attr("tabindex","-1").text(function(t){return e.show_label?"隐藏文本标签":"显示文本标签"}).on("click",function(t){e.fixed=0,function(e,t){t.show_label=!t.show_label,F.update(!0)}(0,e),i.style("display","none")}),g.get_editor()&&i.append("li").append("a").attr("tabindex","-1").text(function(e){return"将此节点添加到关注簇"}).on("click",function(t){g.get_editor().append_node(F.entity_id(e),!0)}),i.style("position","absolute").style("left",String(r.event.offsetX)+"px").style("top",String(r.event.offsetY)+"px").style("display","block")):i.style("display","none"),t.on("click",function(e){O(null)},!0)}};F._refresh_subcluster_view=function(e){F.annotate_priority_clusters(p._networkCDCDateField,36,12,e);var t=F.define_attribute_COI_membership(F,e);t&&(i.default.each(F.nodes,function(e){var n=t.map(e,F);_.HIVTxNetwork.inject_attribute_node_value_by_id(e,"subcluster_temporal_view",n)}),F.inject_attribute_description("subcluster_temporal_view",t),F._aux_process_category_values(F._aux_populate_category_fields(t,"subcluster_temporal_view")),F.handle_attribute_categorical("subcluster_temporal_view"))},F.view_subcluster=function(e,t,n,o,a,s,l){l=l||F.subcluster_threshold,(o=o||{}).parent_graph=F;var c=e.children;t&&(c=i.default.isArray(t)?t:i.default.filter(F.json.Nodes,t));var d=F.extract_single_cluster(c,a||function(e){return e.length<=l},!1,null,s);F.has_multiple_sequences&&(i.default.each(d.Nodes,function(e){e["multiple subclusters"]&&(e.multiple_membership=!0)}),o["simplified-mspp"]&&(d=F.simplify_multisequence_cluster(d))),i.default.each(d.Nodes,function(e){e.subcluster_label="1.1"}),v.network.GraphAttrbuteID in F.json&&(d[v.network.GraphAttrbuteID]={},S.extend(!0,d[v.network.GraphAttrbuteID],F.json[v.network.GraphAttrbuteID]));var f=[[function(e,t){var n=t.append("div").classed("form-group",!0);n.append("label").text("重新计算国家优先级,起始日期:").classed("control-label",!0),n.append("input").attr("type","date").classed("form-control",!0).attr("value",p.DateViewFormatSlider(F.today)).attr("max",p.DateViewFormatSlider(F.today)).attr("min",p.DateViewFormatSlider(r.min(e.nodes,function(t){return e.attribute_node_value_by_id(t,p._networkCDCDateField)}))).on("change",function(t){var r=p.DateViewFormatSlider.parse(this.value);this.value?(e._refresh_subcluster_view(r),n.classed("has-success",!0).classed("has-error",!1)):n.classed("has-success",!1).classed("has-error",!0)}).on("click",function(e){r.event.stopPropagation()})},null]];F._is_CDC_executive_mode||f.push(["导出簇到 CSV",function(e){u.export_csv_button(e._extract_attributes_for_nodes(e._extract_nodes_by_id("1.1"),e._extract_exportable_attributes()))}]),o.type="subcluster",o.cluster_id=e.cluster_id||"N/A","extra_menu"in o?o.extra_menu.items=o.extra_menu.items.concat(f):o.extra_menu={title:"操作",items:f};var h=F.open_exclusive_tab_view_aux(d,n||"子簇 "+e.cluster_id,o);return o.skip_recent_rapid||h.handle_attribute_categorical("subcluster_or_priority_node"),h};var I=function(e,t){var n=n||p._networkCDCDateField,r=F.attribute_node_value_by_id(e,n),i=F.attribute_node_value_by_id(t,n);return r===i?e.id<t.id?-1:1:r<i?-1:1};function z(e){var t=E(function(e){var t,n=(t=F.nodes,i.default.groupBy(t,"cluster")),o={id:"root",children:[]};F.exclude_cluster_ids&&(n=i.default.omit(n,F.exclude_cluster_ids));var a=i.default.map(n,function(e,t){return{cluster_id:t,children:e}});if(i.default.size(n)>ue){var s=i.default.chain(a).pairs().sortBy(function(e){return-e.children?e.children.length:0}).value();o.children=[];for(var l=0;l<ue;l++)o.children.push({cluster_id:s[l][0],children:s[l][1]})}else o.children=a;return[(e?r.layout.pack().size([F.width,F.height]).children(function(e){return e.children}).value(function(e){return Math.pow(e.parent.children.length,1.5)}).sort(function(e,t){return t.value-e.value}).padding(5):r.layout.treemap().size([F.width,F.height]).children(function(e){return e.children}).value(function(e){return Math.pow(e.parent.children.length,1)}).sort(function(e,t){return e.value-t.value}).ratio(1)).nodes(o),a]}(e),2),n=(t[0],t[1]);0===F.clusters.length&&(F.clusters=n);var o=e?function(e){"x"in e?(e.x+=.5*e.r,e.y+=.5*e.r):(e.x=Math.random()*F.width,e.y=Math.random()*F.height)}:function(e){"x"in e?(e.x+=.5*e.dx,e.y+=.5*e.dy):(e.x=Math.random()*F.width,e.y=Math.random()*F.height)};i.default.each([F.nodes,F.clusters],function(e){i.default.each(e,o)}),F.clusters.forEach(J)}function $(e){F.charge_correction*=e,he.start()}function q(e,t){if(e){var n=(F.width+e/2)/F.width,o=(F.height+e/2)/F.height;F.width+=e,F.height+=e;var a=r.scale.linear().domain(r.extent(he.nodes(),function(e){return e.x}));a.range(i.default.map(a.domain(),function(e){return e*n}));var s=r.scale.linear().domain(r.extent(he.nodes(),function(e){return e.y}));s.range(i.default.map(s.domain(),function(e){return e*o})),i.default.each(he.nodes(),function(e){e.x=a(e.x),e.y=s(e.y)})}F.width=Math.min(Math.max(F.width,200),4e3),F.height=Math.min(Math.max(F.height,200),4e3),he.size([F.width,F.height]),F.network_svg.attr("width",F.width).attr("height",F.height),F._calc_country_nodes(T),F._draw_topomap(!0),t?he.start():e&&F.update(!0)}F.annotate_priority_clusters=function(e,t,n,r){try{r=r||F.get_reference_date();var o,a=p.n_months_ago(r,t),s=p.n_months_ago(r,n);if(r===F.today)o=F.nodes;else{var l=p.getCurrentDate();l.setYear(1900),o=[],i.default.each(F.nodes,function(t){var n=F.filter_by_date(l,e,r,t);i.default.isUndefined(n)?t.priority_flag=6:n?(t.priority_flag=5,o.push(t)):t.priority_flag=4})}var c={},d={};i.default.each(o,function(e){e.nationalCOI=0,e.cluster&&(e.cluster in c||(c[e.cluster]={Nodes:[],Edges:[]}),d[e.id]=c[e.cluster].Nodes.length,c[e.cluster].Nodes.push(e))}),i.default.each(F.edges,function(e){if(e.length<=F.subcluster_threshold){var t=F.nodes[e.source].cluster,n=F.nodes[e.source].id,r=F.nodes[e.target].id;if(n in d&&r in d){var o=i.default.clone(e);o.source=d[n],o.target=d[r],c[t].Edges.push(o)}}});var f=F.precomputed_subclusters&&F.subcluster_threshold in F.precomputed_subclusters?F.precomputed_subclusters:null;i.default.each(c,function(t,n){var o=F.cluster_mapping[n];F.clusters[o].priority_score=0;var l=[],c=function(e){return e.length>1};F.has_multiple_sequences&&(c=function(e){return F.unique_entity_list(e).length>1});var d=i.default.filter((0,m.hivtrace_cluster_depthwise_traversal)(t.Nodes,t.Edges,null,l),c);l=i.default.filter(l,function(e){return e.length>1}),i.default.each(d,function(e,t){e.sort(I)}),d.sort(function(e,t){return I(e[0],t[0])});var p=d.length+1;d=i.default.map(d,function(e,t){var n=t+1;if(f){var r={};i.default.each(e,function(e){if("subcluster"in e){var t=i.default.find(e.subcluster,function(e){return e[0]===F.subcluster_threshold});if(t)return void(r[t[1].split(v.SubclusterSeparator)[1]]=1)}r.null=1}),n=null in r||1!==i.default.keys(r).length?p++:i.default.keys(r)[0]}var a=F.clusters[o].cluster_id+v.SubclusterSeparator+n;return i.default.each(e,function(e){e.subcluster_label=a,e.priority_flag=0}),{children:i.default.clone(e),parent_cluster:F.clusters[o],cluster_id:a,distances:u.describe_vector(i.default.map(l[t],function(e){return e.length}))}}),i.default.each(d,function(e){oe(e)}),F.clusters[o].subclusters=d,i.default.each(d,function(n){var l=F.extract_single_cluster(i.default.filter(n.children,function(t){return F.filter_by_date(a,e,r,t)}),null,!0,t),u=i.default.filter((0,m.hivtrace_cluster_depthwise_traversal)(l.Nodes,i.default.filter(l.Edges,function(e){return e.length<=F.subcluster_threshold})),function(e){return e.length>1});n.rr_count=u.length,u.sort(function(e,t){return t.length-e.length}),n.priority_score=[],n.recent_nodes=[];var c=new Date(r.getTime()+1e13);"2211.1"==n.cluster_id&&console.log(n,u,l),i.default.each(u,function(t){var o=i.default.groupBy(t,function(t){return F.filter_by_date(s,e,r,t)});n.recent_nodes.push(i.default.map(t,function(e){return e.id}));var l=!0 in o&&o[!0].length>=(F.CDC_data?F.CDC_data["autocreate-priority-set-size"]:3);!0 in o&&(n.priority_score.push(i.default.map(o[!0],function(e){return e.id})),i.default.each(o[!0],function(t){t.priority_flag=F.filter_by_date(r,e,c,t)?4:1,l&&(1===t.priority_flag&&(t.priority_flag=2),t.nationalCOI=1)})),!1 in o&&i.default.each(o[!1],function(t){t.priority_flag=3,l?F.filter_by_date(a,e,r,t)?t.nationalCOI=2:t.nationalCOI=3:t.priority_flag=7})}),F.clusters[o].priority_score=n.priority_score})})}catch(e){console.log(e)}},F.compute_adjacency_list=i.default.once(function(){F.nodes.forEach(function(e){e.neighbors=r.set()}),F.edges.forEach(function(e){F.nodes[e.source].neighbors.add(e.target),F.nodes[e.target].neighbors.add(e.source)})}),F.compute_local_clustering_coefficients=i.default.once(function(){F.compute_adjacency_list(),F.nodes.forEach(function(e){i.default.defer(function(e){var t=e.neighbors.size();if(t<2)e.lcc=m.undefined;else if(t>500)e.lcc=m.too_large;else{for(var n=e.neighbors.values(),r=0,i=0;i<t;i+=1)for(var o=i+1;o<t;o+=1)F.nodes[n[i]].neighbors.has(n[o])&&r++;e.lcc=2*r/t/(t-1)}},e)})}),F.get_node_by_id=function(e){return F.nodes.filter(function(t){return t.id===e})[0]},F.compute_local_clustering_coefficients_worker=i.default.once(function(){var e=new Worker("workers/lcc.js");e.onmessage=function(e){e.data.Nodes.forEach(function(e){F.get_node_by_id(e.id).lcc=e.lcc?e.lcc:m.undefined})};var t={};t.Nodes=F.nodes,t.Edges=F.edges,e.postMessage(t)});var R=i.default.memoize(function(e){return F.compute_adjacency_list(),i.default.reduce(i.default.first(i.default.pluck(e.children,"degree").sort(r.descending),3),function(e,t){return e*t},1)},function(e){return e.cluster_id});function P(e,t){var n=r.select(e);n.selectAll("*").remove();var o=t[1],a=t[0];o?(n.append("span").text(a).style("padding-right","0.5em"),F.has_multiple_sequences?i.default.each(["fa-eye","fa-user-circle"],function(e,r){n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.view_subcluster(t[2],null,0==r?"序列级视图 "+t[0]:null,1==r?{"simplified-mspp":1}:null)}).append("i").classed("fa "+e,!0).attr("title",1==r?"查看":"序列级视图")}):n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.view_subcluster(t[2])}).append("i").classed("fa fa-eye",!0).attr("title","查看")):(n.append("span").text(a).style("padding-right","0.5em"),F.has_multiple_sequences?i.default.each(["fa-eye","fa-user-circle"],function(e,t){n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.open_exclusive_tab_view(a,null,0==t?function(e){return"序列级视图 "+e}:null,1==t?{"simplified-mspp":1}:null)}).append("i").classed("fa "+e,!0).attr("title",1==t?"查看":"序列级视图")}):n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").on("click",function(e){F.open_exclusive_tab_view(a)}).append("i").classed("fa fa-eye",!0).attr("title","查看")),n.append("button").classed("btn btn-sm pull-right",!0).style("margin-right","0.25em").attr("data-toggle","modal").attr("data-target",F.get_ui_element_selector_by_role("cluster_list",!0)).attr("data-cluster",a).append("i").classed("fa fa-list",!0).attr("title","列表")}function L(e,t){var n=r.select(e),o=function(e){e.delta;var t=e.moved,n=e.deleted,r=e.new_nodes?e.new_nodes:0,i="";return t&&(i=" "+t+" moved "),r&&(i+="+"+r+" new "),n&&(i+="-"+n+" previous "),i},a=[];t[4]&&("new"===t[4].type?t[4].moved?a.push(["renamed "+o(t[4]),2]):a.push(["new",3]):"extended"===t[4].type?a.push([o(t[4]),t[4].flag]):"merged"===t[4].type&&a.push(["Merged "+t[4].old_clusters.join(", ")+" "+o(t[4]),t[4].flag])),a.push([[t[0]?"展开":"折叠",t[0]?"fa-expand":"fa-compress"],0]),t[1]&&a.push([["problematic","fa-exclamation-circle"],1]),t[2]&&a.push([["match","fa-check-square"],1]);var s=n.selectAll("button").data(a);s.enter().append("button"),s.exit().remove(),s.classed("btn btn-xs",!0).classed("btn-default",function(e){return 1!==e[1]&&2!==e[1]}).classed("btn-danger",function(e){return 2===e[1]}).classed("btn-success",function(e){return 3===e[1]}).style("margin-right","0.25em").attr("disabled",function(e){return 1===e[1]?"disabled":null}).on("click",function(e){0===e[1]?(t[0]?ee(F.clusters[t[3]-1],!0):J(F.clusters[t[3]-1]),F.update_volatile_elements(F.cluster_table),F.subcluster_table&&F.update_volatile_elements(F.subcluster_table)):2!==e[1]&&3!==e[1]||F.open_exclusive_tab_view(t[3],null,function(e){return"Cluster "+e+" [changes view]"},F._social_view_options(["Existing","Newly added"],{Existing:1,"Newly added":1},function(e){return i.default.isObject(e.source)&&_.HIVTxNetwork.is_new_node(e.source)||i.default.isObject(e.target)&&_.HIVTxNetwork.is_new_node(e.target)||e.attributes.indexOf("added-to-prior")>=0?"Newly added":"Existing"})).handle_attribute_categorical("_newly_added")}),s.each(function(e,t){var n=r.select(this);if(i.default.isString(e[0]))n.selectAll("i").remove(),n.text(e[0]);else{var o=n.selectAll("i").data([e[0]]);o.enter().append("i"),o.attr("class",function(e){return"fa "+e[1]},!0).attr("title",function(e){return e[0]})}})}function B(e,t){var n,o=r.select(e);n=1===t.length?i.default.isString(t[0])?[[t[0],1,"btn-warning"]]:["无法显示",1]:[[t[0]?"隐藏":"显示",0]],2===t.length&&t[1]>=1&&n.push(["查看簇",function(){F.open_exclusive_tab_view(t[1])}]);var a=o.selectAll("button").data(n);a.enter().append("button"),a.exit().remove(),a.classed("btn btn-xs btn-node-property",!0).classed("btn-primary",!0).text(function(e){return e[0]}).attr("disabled",function(e){return e[1]&&!i.default.isFunction(e[1])?"disabled":null}).on("click",function(e){i.default.isFunction(e[1])?e[1].call(e):0===e[1]&&(t[0]?J(F.clusters[t[3]-1],!0):ee(F.clusters[t[3]-1]),F.update_volatile_elements(h.getNodeTable()))}),a.each(function(e,t){e.length>=3&&r.select(this).classed("btn-primary",!1).classed(e[2],!0)})}function U(e,t){if(n){var o=i.default.filter(F.clusters,function(e){return!e.collapsed}).length,a=i.default.filter(F.clusters,function(e){return!e.is_hidden&&void 0!==e.match_filter&&e.match_filter>0}).length,s=i.default.filter(F.nodes,function(e){return e.match_filter&&!e.is_hidden}).length,l="<span class = 'badge'>"+F.clusters.length+"</span> 簇 <span class = 'label label-primary'>"+o+" 已展开 / "+a+" 匹配 </span> <span class = 'badge'> "+F.nodes.length+"</span> 节点 <span class = 'label label-primary'>"+e+" 已显示 / "+s+" 匹配 </span> <span class = 'badge'> "+F.edges.length+"</span> "+(F._is_CDC_?"链接":"边")+" <span class = 'label label-primary'>"+t+" 已显示</span>";r.select(n).html(l)}}function V(e){if(e in F.networkShapeScheme){var t=i.default.range(0,le[v.network.GraphAttrbuteID][e].value_range.length);return{domain:t,range:i.default.map(t,function(t){return F.networkShapeScheme[e][le[v.network.GraphAttrbuteID][e].value_range[t]]})}}return{domain:i.default.range(0,le[v.network.GraphAttrbuteID][e].dimension),range:v.ShapeOrdering}}function H(e,t){if(t){var n=F.dom_prefix+"-cluster-gradient-"+F.gradient_id++,r=F.network_svg.selectAll("defs").append("radialGradient").attr("id",n),o=i.default.map(e.children,function(e){var n=F.attribute_node_value_by_id(e,t);return n===v.missing.label?1/0:n}).sort(function(e,t){return 0+e-(0+t)}),a=i.default.filter(o,function(e){return e<1/0}),s=o.length-a.length;return s&&(r.append("stop").attr("offset","0%").attr("stop-color",v.missing.color),r.append("stop").attr("offset",String(s/o.length*100)+"%").attr("stop-color",v.missing.color)),i.default.each(a,function(e,t){r.append("stop").attr("offset",String(100*(1+t+s)/o.length)+"%").attr("stop-color",F.colorizer.category(e))}),n}return null}function W(e){if(F.showing_on_map)return 50;var t=5+Math.sqrt(e.degree);return 4*t*t}function G(e){return e.multiple_membership}function Y(e){return F.colorizer.opacity?F.colorizer.opacity(F.attribute_node_value_by_id(e,F.colorizer.opacity_id,!0)):1}function Q(e){r.event.defaultPrevented||ae(this,!0,(F._is_CDC_?"Individual ":"Node ")+F.entity_id(e),function(e){var t;if(F._is_CDC_){t="链接数 <em>"+e.degree+"</em>";try{e[v.network.AliasedSequencesID]&&e[v.network.AliasedSequencesID].length>1&&(t+="<br> 代表序列数 <em>"+e[v.network.AliasedSequencesID].length+"</em> 序列数")}catch(e){}}else t="度 <em>"+e.degree+"</em><br>聚类系数 <em> "+m.format_value(e.lcc,v.formats.FloatFormat)+"</em>";return i.default.each(i.default.union(F._additional_node_pop_fields,[F.colorizer.category_id,F.node_shaper.id,F.colorizer.opacity_id]),function(n){if(n&&n in le[v.network.GraphAttrbuteID]){var r=F.attribute_node_value_by_id(e,n);if("Date"===le[v.network.GraphAttrbuteID][n].type)try{r=p.DateViewFormat(r)}catch(e){}r&&(t+="<br>"+le[v.network.GraphAttrbuteID][n].label+" <em>"+r+"</em>")}}),t}(e),F.container)}function K(e){r.event.defaultPrevented||ae(this,!1)}function Z(e){var t,n;ae(this,!0,e.source.id+" - "+e.target.id,(t=e,n="Length <em>"+v.formats.FloatFormat(t.length)+"</em>","support"in t&&(n+="<br>Worst triangle-based support (p): <em>"+v.formats.FloatFormat(t.support)+"</em>"),n),F.container)}function X(e){ae(this,!1)}function J(e,t){if(F.needs_an_update=!0,e.collapsed=!0,se-=F.cluster_sizes[e.cluster_id-1]-1,!t){var n=de.indexOf(e.cluster_id);n>=0&&de.splice(n,1)}return function(e){for(var t in e){var n=e[t];n.x=0,n.y=0,i.default.has(n,"children")&&(n.children.forEach(function(e){n.x+=e.x,n.y+=e.y}),n.x/=n.children.length,n.y/=n.children.length)}}([e]),e.children.length}function ee(e,t){F.needs_an_update=!0,e.collapsed=!1,se+=F.cluster_sizes[e.cluster_id-1]-1,de.push(e.cluster_id),t?e.children.forEach(function(t){t.x=e.x+(Math.random()-.5)*e.children.length,t.y=e.y+(Math.random()-.5)*e.children.length}):e.children.forEach(function(t){t.x=.25*F.width+(Math.random()-.5)*e.children.length,t.y=.25*F.height+(Math.random()-.5)*e.children.length})}function te(e,t,n){var o=r.select(F.get_ui_element_selector_by_role(e,!0));if(!o.empty()&&(o.selectAll("thead").remove(),o.selectAll("tbody").remove(),r.select(F.get_ui_element_selector_by_role(e+"_enclosed",!0)).style("display",n?null:"none"),n)){var a=F.colorizer.category,s=t(null,"lookup"),l=o.append("thead").append("tr").selectAll("th").data([""].concat(n[0].map(function(e,t){return s[t]})));if(l.enter().append("th"),l.html(function(e){return"<span>&nbsp;"+e+"</span>"}).each(function(e,t){t&&r.select(this).insert("i",":first-child").classed("fa fa-circle",!0).style("color",function(){return a(e)})}),F.show_percent_in_pairwise_table){var u=i.default.map(n,function(e){return i.default.reduce(e,function(e,t){return e+t},0)});n=i.default.map(n,function(e,t){return i.default.map(e,function(e){return 0===u[t]?null:e/u[t]})})}var c=o.append("tbody").selectAll("tr").data(n.map(function(e,t){return[s[t]].concat(e)}));c.enter().append("tr"),c.selectAll("td").data(function(e){return e}).enter().append("td").html(function(e,t){return 0===t?"<span>&nbsp;"+e+"</span>":F.show_percent_in_pairwise_table?null==e||i.default.isNaN(e)?"-":v.formats.PercentFormat(e):e}).each(function(e,t){0===t&&r.select(this).insert("i",":first-child").classed("fa fa-circle",!0).style("color",function(){return a(e)})})}}function ne(e,t,n){var i=r.select(F.get_ui_element_selector_by_role(e,!0));if(!i.empty()&&(i.selectAll("svg").remove(),r.select(F.get_ui_element_selector_by_role(e+"_enclosed",!0)).style("display",n?null:"none"),n)){var o=t(null,"lookup"),a=i.append("svg"),s=r.layout.chord().padding(.05).sortSubgroups(r.descending).matrix(n),l=.41*Math.min(450,430),u=1.1*l,c=F.colorizer.category,d=a.append("g").attr("transform","translate(225,430)").append("text").attr("text-anchor","middle").attr("font-size",12).text(""),f=function(e,t){return function(n,r){d.text(t?o[r]:""),a.selectAll(".chord path").filter(function(e){return e.source.index!==r&&e.target.index!==r}).transition().style("opacity",e)}};(a=a.attr("width",450).attr("height",450).append("g").attr("transform","translate(225,215)")).append("g").selectAll("path").data(s.groups).enter().append("path").style("fill",function(e){return c(o[e.index])}).style("stroke",function(e){return c(o[e.index])}).attr("d",r.svg.arc().innerRadius(l).outerRadius(u)).on("mouseover",f(.1,!0)).on("mouseout",f(1,!1)),a.append("g").attr("class","chord").selectAll("path").data(s.chords).enter().append("path").attr("d",r.svg.chord().radius(l)).style("fill",function(e){return c(e.target.index)}).style("opacity",1)}}function re(e){var t,n,r,i;ae(this,!0,"簇 "+e.cluster_id,(t=e.cluster_id,i=(r=F.clusters[F.cluster_mapping[t]]).binned_attributes,n=F._is_CDC_?"<strong>"+(F.has_multiple_sequences?F.cluster_sizes_in_entities[t]:F.cluster_sizes[t-1])+"</strong> 个体数."+(F.has_multiple_sequences?"<br><strong> "+F.cluster_sizes[t-1]+"</strong> 序列数.":"")+"<br>平均链接数/个体 <em> = "+v.formats.FloatFormat(r.degrees.mean)+"</em><br>最大链接数/个体 <em> = "+r.degrees.max+"</em>":"<strong>"+F.cluster_sizes[t-1]+"</strong> 节点数.<br>平均度 <em>"+v.formats.FloatFormat(r.degrees.mean)+"</em><br>最大度 <em>"+r.degrees.max+"</em><br>聚类系数 <em> "+m.format_value(r.cc,v.formats.FloatFormat)+"</em>",i&&i.forEach(function(e){n+="<br>"+e[0]+" <em>"+e[1]+"</em>"}),n),F.container)}function ie(e){ae(this,!1)}function oe(e){var t=e.children.map(function(e){return e.degree});t.sort(r.ascending),e.degrees=u.describe_vector(t)}function ae(e,t,n,r,o){if(e)if(t&&!e.tooltip){S("[role='tooltip']").each(function(e){S(this).remove()});var a=S(e);e.tooltip=a.tooltip({title:n+"<br>"+r,html:!0,container:o||"body"}),i.default.delay(i.default.bind(e.tooltip.tooltip,e.tooltip),500,"show")}else!t&&e.tooltip&&(e.tooltip.tooltip("destroy"),e.tooltip=void 0)}F.compute_global_clustering_coefficients=i.default.once(function(){F.compute_adjacency_list(),F.clusters.forEach(function(e){i.default.defer(function(e){if(e.children.length<3)e.cc=m.undefined;else if(R(e,!0)>=5e6)e.cc=m.too_large;else{var t=[],n=0,i=0;F.nodes.forEach(function(n,r){n.cluster===e.cluster_id&&t.push(r)}),t.forEach(function(e){for(var t=F.nodes[e].neighbors.values().map(function(e){return Number(e)}).sort(r.ascending),o=0;o<t.length;o+=1)for(var a=o+1;a<t.length;a+=1)n+=1,F.nodes[t[o]].neighbors.has(t[a])&&(i+=1)}),e.cc=i/n}},e)})}),F.mark_nodes_as_processing=function(e){F.nodes.forEach(function(t){t[e]=m.processing})},F.compute_graph_stats=function(){r.select(this).classed("disabled",!0).select("i").classed({"fa-calculator":!1,"fa-cog":!0,"fa-spin":!0}),F.mark_nodes_as_processing("lcc"),F.compute_local_clustering_coefficients_worker(),F.compute_global_clustering_coefficients(),r.select(this).remove()},F.update_volatile_elements=function(e,t){var n=t?null:g.get_editor();e.selectAll("td, th").filter(function(e){return"volatile"in e}).each(function(e,t){f.format_a_cell(e,t,this,n)})},F.redraw_tables=function(){F.update_volatile_elements(F.cluster_table),F.subcluster_table&&F.update_volatile_elements(F.subcluster_table);var e=h.getNodeTable();F.update_volatile_elements(e,e.node_table_N>e.node_table_DN||e.node_table_DN>v.CoIAddLimit),F.priority_set_table&&F.update_volatile_elements(F.priority_set_table)},F.draw_extended_node_table=function(e,t,n,a){if(t=t||h.getNodeTable(),a=a||{},t){var s=(e=e||F.aggregate_indvidual_level_records()).length;e.length>ce&&(e=e.slice(0,ce)),t.node_table_N=s,t.node_table_DN=e.length;var l=F._extract_exportable_attributes(!0);F.displayed_node_subset=i.default.filter(i.default.map(F.displayed_node_subset,function(e,t){return i.default.isString(e)?(e=i.default.find(l,function(t){return t.raw_attribute_key===e}))||l[t]:e}),function(e){return e});var u=F._extract_attributes_for_nodes(e,F.displayed_node_subset);u.splice(0,1);var c=i.default.map(F.displayed_node_subset,function(s,u){return{value:s.raw_attribute_key,sort:"value",filter:!a||!a["no-filter"],volatile:!0,help:"label"in s?s.label:s.raw_attribute_key,callback:function(c,d){var f=r.select(c).append("div").classed("dropdown",!0),p="hivtrace_node_column_"+d+"_"+u,h=f.append("button").classed({btn:!0,"btn-default":!0,"btn-xs":!0,"dropdown-toggle":!0}).attr("type","button").attr("data-toggle","dropdown").attr("aria-haspopup","true").attr("aria-expanded","false").attr("id",p);function g(e){return e in F.json.patient_attribute_schema?F.json.patient_attribute_schema[e].label:function(e){var t=o.default.toHeaderCase(e).split(" ");return i.default.map(t,function(e){return"hivtrace"===e.toLowerCase()?"HIV-TRACE":"id"===e.toLowerCase()?"ID":e}).join(" ")}(e)}h.text(g(d)),h.append("i").classed({fa:!0,"fa-caret-down":!0,"fa-lg":!0});var m=f.append("ul").classed("dropdown-menu",!0).attr("aria-labelledby",p);return(m=m.selectAll("li").data(i.default.filter(l,function(e){return e.raw_attribute_key!==s.raw_attribute_key}))).enter().append("li"),m.each(function(i,o){var s=r.select(this).append("a").attr("href","#").text(function(e){return g(e.raw_attribute_key)});s.on("click",function(r){F.displayed_node_subset[u]=r,F.draw_extended_node_table(e,t,n,a)})}),f}}});n&&i.default.each(n,function(e){e.prepend?c.splice(0,0,e.description):c.push(e.description)});var d=u.map(function(t,o){var a=i.default.map(t,function(e,t){var n=null;return"Date"===F.displayed_node_subset[t].type?n={value:e,format:function(e){return e===v.missing.label?e:p.DateViewFormatSlider(e)}}:"Number"===F.displayed_node_subset[t].type&&(n={value:e,format:r.format(".2f")}),n||(n={value:e}),n});return n&&i.default.each(n,function(t){t.prepend?a.splice(0,0,t.generator(e[o],F)):a.push(t.generator(e[o],F))}),a});F.draw_node_table(null,e,[c],d,t,'Showing <span class="badge" data-hivtrace-ui-role="table-count-shown">--</span>/<span class="badge" data-hivtrace-ui-role="table-count-total">--</span> network entities <span class="label label-warning" data-hivtrace-ui-role="table-count-warning"></span>',s)}},F.generate_coi_temporal_report=function(e,t){if(!e)return{};t=t||.005;var n=(0,m.hivtrace_cluster_depthwise_traversal)(F.json.Nodes,F.json.Edges,function(e){return e.length<=t},null,e.node_objects),r=i.default.map(n,function(e){return F.extract_single_cluster(e,function(e){return e.length<=t})}),o=new Set(i.default.map(e.node_objects,function(e){return e.id})),a=i.default.map(r,function(e){return i.default.filter(e.Nodes,function(e){return o.has(e.id)})});i.default.each(a,function(e){return i.default.each(e,function(e){return e.visited=!1})});var s=p.getCurrentDate();s.setFullYear(1900);var l=i.default.sortBy(A(F.priority_groups_all_events()));l.reverse();var u={};return i.default.each(l,function(e){var n=p.DateViewFormatSlider.parse(e),o=p.DateViewFormatSlider.parse(e);o.setFullYear(n.getFullYear()-3);var l=p.DateViewFormatSlider.parse(e);l.setFullYear(n.getFullYear()-1);var c=function(e){return F.filter_by_date(s,p._networkCDCDateField,n,e)},d=function(e){return F.filter_by_date(o,p._networkCDCDateField,n,e)},f=function(e){return F.filter_by_date(l,p._networkCDCDateField,n,e)},h=i.default.map(r,function(e,n){var r=new Set(i.default.map(i.default.filter(e.Nodes,c),function(e){return e.id})),o=e.Nodes;return(0,m.hivtrace_cluster_depthwise_traversal)(o,e.Edges,function(e){return e.length<=t&&d(o[e.source])&&d(o[e.target])},null,i.default.filter(a[n],c),r)});h=i.default.flatten(h,1),u[e]={connected_componets:i.default.map(h,function(e){return e.length}),priority_nodes:i.default.map(h,function(e){return i.default.map(i.default.filter(e,f),function(e){return e.id})})},u[e].national_priority=i.default.map(u[e].priority_nodes,function(e){return e.length>=F.CDC_data["autocreate-priority-set-size"]})}),{node_info:i.default.map(e.node_objects,function(e){return[e.id,p.DateViewFormatSlider(F.attribute_node_value_by_id(e,p._networkCDCDateField))]}),event_info:u}},F.draw_node_table=function(e,t,n,r,o,a,s){(o=o||h.getNodeTable())&&(t=t||F.nodes,s=s||t.length,n||(n=[[{value:"ID",sort:"value",help:"Node ID"},{value:"操作",sort:"value"},{value:"链接数",sort:"value",help:"Number of links (Node degree)"},{value:"簇",sort:"value",help:"Which cluster does the node belong to"}]],e&&i.default.each(e,function(e){e.prepend?n[0].splice(0,0,e.description):n[0].push(e.description)}),r=t.map(function(t,n){var r=[{value:t.id,help:"Node ID"},{value:function(){if("injected"===t.node_class)return[t.node_annotation];try{return F.exclude_cluster_ids[t.cluster]?[t.cluster]:[!F.clusters[F.cluster_mapping[t.cluster]].collapsed,t.cluster]}catch(e){return[-1]}},callback:B,volatile:!0},{value:"degree"in t?t.degree:"Not defined",help:"Node degree"},{value:"cluster"in t?t.cluster:"Not defined",help:"Which cluster does the node belong to"}];return e&&i.default.each(e,function(e){e.prepend?r.splice(0,0,e.generator(t,F)):r.push(e.generator(t,F))}),r})),f.add_a_sortable_table(o,n,r,!0,a,g.get_editor(),s))},F.draw_cluster_table=function(e,t,n){var o=n&&n["no-clusters"],a=!(n&&n.subclusters);if(t=t||F.cluster_table){var s=[[{value:"簇 ID",sort:function(e){return i.default.map(e.value[0].split(v.SubclusterSeparator),function(e){return v.formats.DotFormatPadder(Number(e))}).join("|")},help:"Unique cluster ID"},{value:"属性",sort:function(e){return(e=e.value())[4]?e[4].delta:e[0]},help:"Visibility in the network tab and other attributes"},{value:"大小",sort:"value",help:"Number of nodes in the cluster"}]];F.cluster_attributes&&(s[0][1].presort="desc"),F._is_seguro&&(s[0].push({value:"过去 2 个月的基因型数量",sort:"value",help:"# of cases in cluster genotyped in the last 2 months"}),s[0].push({value:"缩放后的过去 2 个月基因型数量",sort:"value",help:"# of cases in cluster genotyped in the last 2 months divided by the square-root of the cluster size"})),F._is_CDC_||(s[0].push({value:"每节点的链接数<br>平均值[中位数, IQR]",html:!0}),s[0].push({value:"链接节点间的遗传距离<br>平均值[中位数, IQR]",help:"Genetic distance among nodes in the cluster",html:!0})),e&&i.default.each(e,function(e){s[0].push(e.description)}),n&&n.headers&&n.headers(s);var l=[];i.default.each(F.clusters,function(t){var n=function(t,n){var o=[{value:[t.cluster_id,n,t],callback:P},{value:function(){var e=n?t.parent_cluster:t;return[e.collapsed,e.hxb2_linked,e.match_filter,e.cluster_id,n?null:F.cluster_attributes?F.cluster_attributes[e.cluster_id]:null]},callback:L,volatile:!0},{value:F.unique_entity_list(t.children).length}];return F._is_CDC_&&(o[2].volatile=!0,o[2].actions=function(e,n){return g.get_editor()?[{icon:"fa-plus",action:function(e,n){return g.get_editor()&&g.get_editor().append_node_objects(t.children),!1},help:"Add to cluster of interest"}]:null}),F._is_seguro&&(o.push({value:t,format:function(e){return i.default.filter(e.children,function(e){return r.time.months(e.patient_attributes.sample_dt,p.getCurrentDate()).length<=2}).length}}),o.push({value:t,format:function(e){return(i.default.filter(e.children,function(e){return r.time.months(e.patient_attributes.sample_dt,p.getCurrentDate()).length<=2}).length/Math.sqrt(e.children.length)).toFixed(2)}})),F._is_CDC_||(o.push({value:t.degrees,format:function(e){try{return v.formats.FloatFormat(e.mean)+" ["+v.formats.FloatFormat(e.median)+", "+v.formats.FloatFormat(e.Q1)+" - "+v.formats.FloatFormat(e.Q3)+"]"}catch(e){return""}}}),o.push({value:t.distances,format:function(e){try{return v.formats.FloatFormat(e.mean)+" ["+v.formats.FloatFormat(e.median)+", "+v.formats.FloatFormat(e.Q1)+" - "+v.formats.FloatFormat(e.Q3)+"]"}catch(e){return""}}})),e&&i.default.each(e,function(e){o.push(e.generator(t,F))}),o};o||l.push(n(t,!1)),a||i.default.each(t.subclusters,function(e){l.push(n(e,!0))})}),f.add_a_sortable_table(t,s,l,!0,n&&n.caption?n.caption:null,g.get_editor())}},F.handle_shape_categorical=function(e){var t="None";if(["shapes"].forEach(function(n){r.select(F.get_ui_element_selector_by_role(n)).selectAll("li").selectAll("a").attr("style",function(n,r){return n[1]===e?(t=n[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(n+"_label")).html("形状: "+t+' <span class="caret"></span>')}),e){var n=V(e),i=r.scale.ordinal().domain(n.domain).range(n.range);F.node_shaper.id=e,F.node_shaper.shaper=function(t){return i(le[v.network.GraphAttrbuteID][e].value_map(F.attribute_node_value_by_id(t,e)))},F.node_shaper.category_map=le[v.network.GraphAttrbuteID][e].value_map}else F.node_shaper.id=null,F.node_shaper.shaper=function(){return"circle"},F.node_shaper.category_map=null;F.draw_attribute_labels(),F.update(!0),r.event.preventDefault()},F.renderColorPicker=function(e,t){"categorical"===t?function(e){var t=F.colorizer,n=i.default.map(i.default.filter(F.uniqValues[e]),function(e){return c.colorPickerInput(e,t)});S("#colorPickerRow").html(n.join("")),S(".hivtrace-color-picker").change(function(t){var n=t.target.value,r=t.target.name;i.default.isUndefined(le[v.network.GraphAttrbuteID][e]["user-defined"])&&(le[v.network.GraphAttrbuteID][e]["user-defined"]={}),le[v.network.GraphAttrbuteID][e]["user-defined"][r]=n,F.handle_attribute_categorical(e)})}(e):"continuous"===t?function(e,t){var n=[c.colorStops("Color Stops",t),c.colorPickerInputContinuous("Min",F.uniqValues[e].min),c.colorPickerInputContinuous("Max",F.uniqValues[e].max)];S("#colorPickerRow").html(n.join("")),S(".hivtrace-color-picker").change(function(t){var n=t.target.value,r=t.target.name;i.default.isUndefined(le[v.network.GraphAttrbuteID][e]["user-defined"])&&(le[v.network.GraphAttrbuteID][e]["user-defined"]={}),le[v.network.GraphAttrbuteID][e]["user-defined"][r]=n,F.handle_attribute_continuous(e)}),S(".hivtrace-color-stops").change(function(t){var n=parseInt(t.target.value);le[v.network.GraphAttrbuteID][F.colorizer.category_id].color_stops=n,F._aux_populate_category_menus(),F.handle_attribute_continuous(e),F.update()})}(e,le[v.network.GraphAttrbuteID][F.colorizer.category_id].color_stops):console.log("Error: type not recognized"),null!==e?S("#colorPickerOption").show():S("#colorPickerOption").hide()},F.draw_attribute_labels=function(){var e=function(e){return"label_format"in e?e.label_format:"Date"===e.type?p.DateViewFormatShort:r.format(",.4r")};F.legend_svg.selectAll("g.hiv-trace-legend").remove();var t=10;if(F.legend_caption&&(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text(F.legend_caption).style("font-weight","bold"),t+=18),F.legend_multiple_sequences&&F.rendered_object_counts&&F.rendered_object_counts.nodes>0&&(F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(3,"+(t+5)+")").append("circle").attr("cx","6").attr("cy","-4").attr("r","6").classed("multi_sequence",!0).style("fill","none"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+(t+5)+")").append("text").text("Represents >1 sequence"),t+=24),F.rendered_object_counts&&F.rendered_object_counts.has_hatching&&(F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill","url(#"+F.generate_cross_hatch_pattern("#cab")+")"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text("Contains sequences in >1 cluster/subcluster"),t+=24),F.edge_legend&&(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text(F.edge_legend.caption).style("font-weight","bold"),t+=18,i.default.each(F.edge_legend.types,function(e,n){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n),e.call(F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("line").attr("x1","0").attr("y1","-4").attr("x2","12").attr("y2","-4").classed("legend",!0)),t+=18})),F.colorizer.category_id)if(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text("Color: "+F.json[v.network.GraphAttrbuteID][F.colorizer.category_id].label).style("font-weight","bold"),t+=18,F.colorizer.continuous){var n=e(le[v.network.GraphAttrbuteID][F.colorizer.category_id]),o=le[v.network.GraphAttrbuteID][F.colorizer.category_id].color_stops||v.network.ContinuousColorStops,a=le[v.network.GraphAttrbuteID][F.colorizer.category_id].scale;i.default.each(i.default.range(o),function(e){var r=a.invert(e);F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n(r)),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",F.colorizer.category(r)),t+=18}),"category_values"in le[v.network.GraphAttrbuteID][F.colorizer.category_id]&&i.default.each(le[v.network.GraphAttrbuteID][F.colorizer.category_id].category_values,function(e){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(e),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",F.colorizer.category(e)),t+=18}),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text("missing"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",v.missing.color),t+=18}else i.default.each(F.colorizer.category_map(null,"map"),function(e,n){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill",F.colorizer.category(n)),t+=18});if(F.node_shaper.id){F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text("Shape: "+F.json[v.network.GraphAttrbuteID][F.node_shaper.id].label).style("font-weight","bold"),t+=18;var s=V(F.node_shaper.id),l=r.scale.ordinal().domain(s.domain).range(s.range);i.default.each(F.node_shaper.category_map(null,"map"),function(e,n){F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("path").attr("transform","translate(5,-5)").attr("d",m.symbol(l(e)).size(128)).classed("legend",!0).style("fill","none"),t+=18})}F.colorizer.opacity_id&&(F.legend_svg.append("g").attr("transform","translate(0,"+t+")").classed("hiv-trace-legend",!0).append("text").text("透明度: "+F.json[v.network.GraphAttrbuteID][F.colorizer.opacity_id].label).style("font-weight","bold"),t+=18,n=e(le[v.network.GraphAttrbuteID][F.colorizer.opacity_id]),a=le[v.network.GraphAttrbuteID][F.colorizer.opacity_id].scale,i.default.each(i.default.range(v.network.ContinuousColorStops),function(e){var r=a.invert(e);F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text(n(r)),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill","black").style("opacity",F.colorizer.opacity(r)),t+=18}),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(20,"+t+")").append("text").text("missing"),F.legend_svg.append("g").classed("hiv-trace-legend",!0).attr("transform","translate(0,"+t+")").append("circle").attr("cx","8").attr("cy","-4").attr("r","8").classed("legend",!0).style("fill","black").style("opacity",v.missing.opacity),t+=18)},F.handle_attribute_opacity=function(e){var t="None";if(["opacity"].forEach(function(n){r.select(F.get_ui_element_selector_by_role(n)).selectAll("li").selectAll("a").attr("style",function(n,r){return n[1]===e?(t=n[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(n+"_label")).html("透明度: "+t+' <span class="caret"></span>')}),r.select(F.get_ui_element_selector_by_role("opacity_invert")).style("display","None"===t?"none":"inline").classed("btn-active",!1).classed("btn-default",!0),F.colorizer.opacity_id=e,e){var n=le[v.network.GraphAttrbuteID][e].scale;F.colorizer.opacity_scale=r.scale.linear().domain([0,v.network.ContinuousColorStops-1]).range([.25,1]),F.colorizer.opacity=function(e){return e===v.missing.label?v.missing.opacity:F.colorizer.opacity_scale(n(e))}}else F.colorizer.opacity=null,F.colorizer.opacity_scale=null;F.draw_attribute_labels(),F.update(!0),r.event.preventDefault()},F.handle_attribute_continuous=function(e){var t="None";if(ne("aux_svg_holder",null,null),te("attribute_table",null,null),F.network_svg.selectAll("radialGradient").remove(),F.clusters.forEach(function(e){delete e.binned_attributes,delete e.gradient}),[["attributes",!1],["attributes_cat",!0]].forEach(function(n){r.select(F.get_ui_element_selector_by_role(n[0],n[1])).selectAll("li").selectAll("a").attr("style",function(n,r){return n[1]===e?(t=n[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(n[0]+"_label",n[1])).html("Color: "+t+' <span class="caret"></span>')}),r.select(F.get_ui_element_selector_by_role("attributes_invert")).style("display","None"===t?"none":"inline").classed("btn-active",!1).classed("btn-default",!0),e){var n=le[v.network.GraphAttrbuteID][e].color_stops||v.network.ContinuousColorStops;if(le[v.network.GraphAttrbuteID][e].color_scale?(F.colorizer.category=le[v.network.GraphAttrbuteID][e].color_scale(le[v.network.GraphAttrbuteID][e],F),F.uniqValues[e].min=F.colorizer.category(n),F.uniqValues[e].max=F.colorizer.category(n)):F.colorizer.category=i.default.wrap(r.scale.linear().domain(i.default.range(v.network.ContinuousColorStops)).range(["#fff7ec","#7f0000"]).interpolate(r.interpolateRgb),function(t,n){return F.uniqValues[e].min="#fff7ec",F.uniqValues[e].max="#7f0000",t(le[v.network.GraphAttrbuteID][e].scale(n)*(1/v.network.ContinuousColorStops))}),le[v.network.GraphAttrbuteID][e]["user-defined"]){var o=le[v.network.GraphAttrbuteID][e]["user-defined"].min||F.uniqValues[e].min,a=le[v.network.GraphAttrbuteID][e]["user-defined"].max||F.uniqValues[e].max;F.uniqValues[e].min=le[v.network.GraphAttrbuteID][e]["user-defined"].min||F.uniqValues[e].min,F.uniqValues[e].max=le[v.network.GraphAttrbuteID][e]["user-defined"].max||F.uniqValues[e].max,F.colorizer.category=i.default.wrap(r.scale.linear().domain(i.default.range(n)).range([o,a]).interpolate(r.interpolateRgb),function(t,r){return t(le[v.network.GraphAttrbuteID][e].scale(r)*(1/n))})}F.colorizer.category_id=e,F.colorizer.continuous=!0,F.clusters.forEach(function(t){t.gradient=H(t,e)});var s=[],l=null;if(F.attributes_selected_cluster){var u=i.default.find(F.clusters,function(e){return String(e.cluster_id)===String(F.attributes_selected_cluster)});u&&u.children&&(l=new Set(i.default.map(u.children,function(e){return e.id})))}i.default.each(F.edges,function(t){if(l){var n=F.nodes[t.source],r=F.nodes[t.target];if(!n||!r)return;if(!l.has(n.id)||!l.has(r.id))return}var i=F.attribute_node_value_by_id(F.nodes[t.source],e,!0),o=F.attribute_node_value_by_id(F.nodes[t.target],e,!0);i!==v.missing.label&&o!==v.missing.label&&s.push({x:i,y:o,title:F.nodes[t.source].id+" ("+i+") -- "+F.nodes[t.target].id+" ("+o+")"})}),r.select(F.get_ui_element_selector_by_role("aux_svg_holder_enclosed",!0)).style("display",null),d.M(s,400,400,F.get_ui_element_selector_by_role("aux_svg_holder",!0),{x:"Source",y:"Target"},"Date"===le[v.network.GraphAttrbuteID][e].type)}else F.colorizer.category=null,F.colorizer.category_id=null,F.colorizer.continuous=!1,F.colorizer.category_pairwise=null,F.colorizer.category_map=null;F.renderColorPicker(e,"continuous"),F.draw_attribute_labels(),F.update(!0),r.event&&r.event.preventDefault()},F.define_node_search_table=function(){if(F.node_search_div=F.get_ui_element_selector_by_role("node_search_div",!0),F.node_search_div&&F.isPrimaryGraph){var e=function(e,t){return"String"==e?"string":"Number"==e?t.is_integer?"integer":"double":"Date"==e?"date":"string"};if(F.node_search_attributes=F._extract_exportable_attributes(!1),F.qb_filter_def=i.default.sortBy(i.default.map(F.node_search_attributes,function(t){var n={id:t.raw_attribute_key,label:t.label,type:e(t.type,t)};return t.enum&&(n.values=i.default.map(i.default.clone(t.enum),function(e){return{value:e,label:i.default.escape(e)}}),n.input="select"),"date"==n.type?(n.plugin="datepicker",n.plugin_config={format:"yyyy/mm/dd",todayBtn:"linked",todayHighlight:!0,autoclose:!0},n.operators=["equal","not equal","less","less_or_equal","greater","greater_or_equal"]):"string"==n.type?n.operators=["equal","not equal","contains","begins_with","ends_with","is_empty","is_not_empty"]:"integer"!=n.type&&"double"!=n.type||(n.operators=["equal","not equal","less","less_or_equal","greater","greater_or_equal","between"]),n}),function(e){return e.label}),F.nodeFilterObject){try{if(i.default.isEqual(F.nodeFilterObject,F.qb_filter_def))return}catch(e){console.log(e)}S(F.node_search_div).queryBuilder("destroy"),F.nodeFilterObject=null,F.aggregate_entity_data=null}var t=r.select(F.node_search_div).selectAll('[data-hivtrace-ui-role="node-selector-search-buttonbar"]');t.empty()&&(r.select(F.node_search_div).append("div").classed("alert alert-info alert-dismissible",!0).style("font-size","150%").text("Please define some search criteria to find and display information on persons in the network. By default, no persons are displayed.").append("button").classed("close",!0).attr("data-dismiss","alert").append("span").html("&times;"),t=r.select(F.node_search_div).append("div").classed("btn-group btn-group-sm",!0).attr("data-hivtrace-ui-role","node-selector-search-buttonbar"),F.node_query_button_reset=t.append("button").text("Reset").classed("btn btn-warning",!0),F.node_query_button_search=t.append("button").text("Search").classed("btn btn-primary",!0)),F.nodeFilterObject=i.default.clone(F.qb_filter_def),S(F.node_search_div).queryBuilder({plugins:{"filter-description":null,"bt-tooltip-errors":null,"not-group":null},filters:F.qb_filter_def}),r.select(S(F.node_search_div).get(0)).selectAll(".group-conditions").selectAll("label").classed("btn-primary",!1).classed("btn-default",!0),S(F.node_search_div).on("afterInit.queryBuilder afterSetRules.queryBuilder afterAddGroup.queryBuilder",function(e,t){r.select(S(F.node_search_div).get(0)).selectAll(".group-conditions").selectAll("label").classed("btn-primary",!1).classed("btn-default",!0)}),F.process_search_field=function(e,t){switch(t.type){case"string":switch(e||(e=""),e=e.toLowerCase(),t.operator){case"equal":return e==t.value;case"not equal":return e!=t.value;case"contains":return e.indexOf(t.value)>=0;case"begins_with":return 0==e.indexOf(t.value);case"ends_with":return e.indexOf(t.value)==Math.max(0,e.length-t.value.length);case"is_not_empty":return e.length>0;case"is_empty":return 0==e.length}break;case"date":case"integer":case"double":if(!e)return!1;switch(t.operator){case"equal":return e==t.value;case"not equal":return e!=t.value;case"less":return e<t.value;case"less_or_equal":return e<=t.value;case"greater":return e>t.value;case"greater_or_equal":return e>=t.value;case"between":return e>=t.value[0]&&e<=t.value[1]}}return!1},F.process_search=function(e,t){var n;return t.rules?(n=i.default.map(t.rules,function(t){return F.process_search(e,t)}),n="AND"==t.condition?i.default.every(n,function(e){return e}):"OR"==t.condition&&i.default.some(n,function(e){return e}),t.not?!n:n):F.process_search_field(F.attribute_node_value_by_id(e,t.id,"number"==t.type),t)},F.rule_lc=function(e){e.rules?i.default.each(e.rules,function(e){F.rule_lc(e)}):e.value&&("string"==e.type?e.value=e.value.toLowerCase():"date"==e.type&&(e.value=p.DateViewNodeSearch.parse(e.value)))},F.aggregate_entity_data||(F.aggregate_entity_data=F.aggregate_indvidual_level_records()),F.node_query_button_reset.on("click",function(e){S(F.node_search_div).queryBuilder("reset"),F.draw_extended_node_table([],null,null,{"no-filter":!0})}),F.node_query_button_search.on("click",function(e){var t=S(F.node_search_div).queryBuilder("getRules");S.isEmptyObject(t)?F.draw_extended_node_table([],null,null,{"no-filter":!0}):(F.rule_lc(t),F.draw_extended_node_table(i.default.filter(F.aggregate_entity_data,function(e){return F.process_search(e,t)}),null,null,{"no-filter":!0}))})}F.isPrimaryGraph&&F.draw_extended_node_table([],null,null,{"no-filter":!0})},F.handle_attribute_categorical=function(e,t){var n="None";if(r.select(F.get_ui_element_selector_by_role("attributes_invert")).style("display","none"),F.network_svg.selectAll("radialGradient").remove(),[["attributes",!1],["attributes_cat",!0]].forEach(function(t){r.select(F.get_ui_element_selector_by_role(t[0],t[1])).selectAll("li").selectAll("a").attr("style",function(t,r){return t[1]===e?(n=t[0]," font-weight: bold;"):null}),r.select(F.get_ui_element_selector_by_role(t[0]+"_label",t[1])).html("Color: "+n+' <span class="caret"></span>')}),F.clusters.forEach(function(t){delete t.gradient,t.binned_attributes=function(e){if(e){var t={},n=[];for(var r in e.forEach(function(e){e in t?t[e]+=1:t[e]=1}),t)n.push([r,t[r]]);return n.sort(function(e,t){return e[0]-t[0]})}return e}(function(e,t){return t&&e?e.children.map(function(e){return F.attribute_node_value_by_id(e,t)}):null}(t,e))}),F.colorizer.continuous=!1,e){if(e in F.networkColorScheme){var o=le[v.network.GraphAttrbuteID][e].enum;o&&(o=new Set(i.default.map(o,function(e){return e.toLowerCase()})));var a=[],s=[];i.default.each(F.networkColorScheme[e],function(e,t){o&&!o.has(t.toLowerCase())||(a.push(t),s.push(e))}),F.colorizer.category=r.scale.ordinal().domain(a).range(s)}else if(le[v.network.GraphAttrbuteID][e].color_scale)F.colorizer.category=le[v.network.GraphAttrbuteID][e].color_scale(le[v.network.GraphAttrbuteID][e],F);else{F.colorizer.category=r.scale.ordinal().range(v.Categorical);var l=i.default.clone(F.colorizer.category.range());l.push(v.missing.color),F.colorizer.category.domain(i.default.range(v.MaximumValuesInCategories+1)),F.colorizer.category.range(l),le[v.network.GraphAttrbuteID][e]["stable-ish order"]&&(F.colorizer.category=i.default.wrap(F.colorizer.category,function(t,n){if(n===v.missing.label)return t(v.MaximumValuesInCategories);var r=le[v.network.GraphAttrbuteID][e];return r.reduced_value_range&&(n in r.reduced_value_range||(n=v.network.ReducedValue)),t(r["stable-ish order"][n])}))}le[v.network.GraphAttrbuteID][e]["user-defined"]&&(F.colorizer.category=i.default.wrap(F.colorizer.category,function(t,n){return n in le[v.network.GraphAttrbuteID][e]["user-defined"]?le[v.network.GraphAttrbuteID][e]["user-defined"][n]:t(n)})),F.colorizer.category_id=e,F.colorizer.category_map=le[v.network.GraphAttrbuteID][e].value_map,F.colorizer.category_pairwise=function(e,t,n){for(var r=F.edges,o=[],a=0;a<t;a+=1){o.push([]);for(var s=0;s<t;s+=1)o[a].push(0)}var l=null;if(F.attributes_selected_cluster){var u=i.default.find(F.clusters,function(e){return String(e.cluster_id)===String(F.attributes_selected_cluster)});u&&u.children&&(l=new Set(i.default.map(u.children,function(e){return e.id})))}if(i.default.each(r,function(t){if(l){var r=F.nodes[t.source],i=F.nodes[t.target];if(!r||!i)return;if(!l.has(r.id)||!l.has(i.id))return}o[n(F.attribute_node_value_by_id(F.nodes[t.source],e))][n(F.attribute_node_value_by_id(F.nodes[t.target],e))]+=1}),!o.some(function(e,n){return n===t-1?e.some(function(e){return e>0}):e[t-1]>0})){o.pop();for(var c=0;c<t-1;c+=1)o[c].pop()}t=o.length;for(var d=0;d<t;d+=1)for(var f=d;f<t;f+=1)o[d][f]+=o[f][d],o[f][d]=o[d][f];return o}(e,F._aux_get_attribute_dimension(e),F.colorizer.category_map),ne("aux_svg_holder",F.colorizer.category_map,F.colorizer.category_pairwise),te("attribute_table",F.colorizer.category_map,F.colorizer.category_pairwise)}else F.colorizer.category=null,F.colorizer.category_id=null,F.colorizer.category_pairwise=null,F.colorizer.category_map=null,ne("aux_svg_holder",null,null),te("attribute_table",null,null);F.handle_inline_charts&&F.handle_inline_charts(),F.draw_attribute_labels(),F.update(!0),r.event&&r.event.preventDefault(),F.renderColorPicker(e,"categorical")},F.filter_visibility=function(){F.clusters.forEach(function(e){e.is_hidden=F.hide_unselected&&!e.match_filter}),F.nodes.forEach(function(e){e.is_hidden=F.hide_unselected&&!e.match_filter})},F.filter=function(e,t){var n=!1;(e=i.default.map(["re","distance","date"],function(t){return i.default.map(i.default.filter(e,function(e){return e.type===t}),function(e){return"distance"===t?e:e.value})}))[1].length?(F.nodes.forEach(function(e){e.length_filter=!1}),i.default.each(F.edges,function(t){var n=i.default.some(e[1],function(e){return e.greater_than?t.length>=e.value:t.length<e.value});n&&(F.nodes[t.source].length_filter=!0,F.nodes[t.target].length_filter=!0),t.length_filter=n})):(F.nodes.forEach(function(e){e.length_filter=!1}),F.edges.forEach(function(e){e.length_filter=!1})),e[2].length?F.nodes.forEach(function(t){var n=F.attribute_node_value_by_id(t,p.getClusterTimeScale());t.date_filter=i.default.some(e[2],function(e){return n>=e[0]&&n<=e[1]})}):F.nodes.forEach(function(e){e.date_filter=!1}),F.clusters.forEach(function(e){e.match_filter=0}),F.edges.forEach(function(e){e.length_filter&&(n=!0)}),F.nodes.forEach(function(t){var r=i.default.some(e[0],function(e){return e.test(t.id)||i.default.some(t[v.network.NodeAttributeID],function(t){return e.test(t)})});(r=r||t.length_filter||t.date_filter)!==t.match_filter&&(t.match_filter=r,n=!0),t.match_filter&&t.parent&&(t.parent.match_filter+=1)}),n&&F.handle_inline_charts&&F.handle_inline_charts(function(e){return e.match_filter}),n&&!t&&(F.hide_unselected&&F.filter_visibility(),F.update(!0))},F.is_empty=function(){return 0===F.cluster_sizes.length},F.link_generator_function=function(e){var t,n=e.pull||0;if(0!==n){var i=e.target.x-e.source.x,o=e.target.y-e.source.y;n*=Math.sqrt(i*i+o*o);var a=Math.PI/6,s=i?Math.atan(-o/i):Math.PI/2;n<0&&(a=-a,n=-n);var l,u,c=Math.cos(a+s)*n,d=Math.cos(a-s)*n,f=Math.sin(a+s)*n,p=Math.sin(a-s)*n;e.target.x>=e.source.x?(l=[c,-f],u=[-d,-p]):(l=[-d,-p],u=[c,-f]),t="M"+e.source.x+" "+e.source.y+" C "+(e.source.x+l[0])+" "+(e.source.y+l[1])+", "+(e.target.x+u[0])+" "+(e.target.y+u[1])+", "+e.target.x+" "+e.target.y}else t="M"+e.source.x+" "+e.source.y+" L "+e.target.x+" "+e.target.y;r.select(this).attr("d",t)},F.update=function(e,t){var n,o,a,s,l,c;if(F.needs_an_update=!1,T&&T["extra-graphics"]&&T["extra-graphics"].call(null,F,T),t&&he.friction(t),F.display_warning(F.warning_string,!0),e)n=F.network_svg.selectAll(".node"),o=F.network_svg.selectAll(".cluster-group"),a=F.network_svg.selectAll(".link"),U(n.size(),a.size());else{var d=(s={all:[],edges:[],nodes:[],clusters:[]},l=[],c=[],F.clusters.forEach(function(e){F.cluster_display_filter(e)&&(e.children.some(function(e){return e.hxb2_linked})&&F.hide_hxb2||(e.collapsed?(s.clusters.push(e),s.all.push(e)):l[e.cluster_id]=!0))}),F.nodes.forEach(function(e,t){l[e.cluster]&&(c[t]=s.nodes.length+s.clusters.length,s.nodes.push(e),s.all.push(e))}),F.edges.forEach(function(e){if(!(e.removed&&F.filter_edges||void 0===c[e.source]||void 0===c[e.target])){var t={};for(var n in e)t[n]=e[n];t.source=c[e.source],t.target=c[e.target],t.ref=e,s.edges.push(t)}}),s);he.nodes(d.all).links(d.edges),U(d.nodes.length,d.edges.length);var f={};i.default.each(d.edges,function(e){var t;e.pull=0,(t=e.source<e.target?String(e.source)+"|"+e.target:String(e.target)+"|"+e.source)in f?f[t].push(e):f[t]=[e]}),i.default.each(f,function(e){if(e.length>1){var t=1/(e.length-1);i.default.each(e,function(e,n){e.pull=n*t-.5})}}),(a=F.network_svg.selectAll(".link").data(d.edges,function(e){return e.id})).enter().append("path").classed("link",!0),a.exit().remove(),a.classed("removed",function(e){return F.highlight_unsuppored_edges&&e.removed}).classed("unsupported",function(e){return F.highlight_unsuppored_edges&&"support"in e&&e.support>.05}).classed("core-link",function(e){return e.length<=F.core_link_length}).classed("mspp-link",function(e){return e.weight>1}),a.on("mouseover",Z).on("mouseout",X).filter(function(e){return e.directed}).attr("marker-end","url(#"+F.dom_prefix+"_arrowhead)"),(n=F.network_svg.selectAll(".node").data(d.nodes,function(e){return e.id})).exit().remove(),n.enter().append("g").append("path"),(o=F.network_svg.selectAll(".cluster-group").data(d.clusters.map(function(e){return e}),function(e){return e.cluster_id})).exit().remove(),o.enter().append("g").attr("class","cluster-group").attr("transform",function(e){return"translate("+e.x+","+e.y+")"}).on("click",function(e){return y.handle_cluster_click(F,e,null)}).on("mouseover",re).on("mouseout",ie).call(he.drag().on("dragstart",ie)),F.draw_cluster_table(F.extra_cluster_table_columns,F.cluster_table),!F._is_CDC_||T&&T["no-subclusters"]&&T["no-subcluster-compute"]||F.annotate_priority_clusters(p._networkCDCDateField,36,12),!F._is_CDC_||T&&T["no-subclusters"]||!T||!T["no-subcluster-compute"]||i.default.each(F.clusters,function(e,t){var n=i.default.groupBy(e.children,function(e){return e.subcluster_id});n=i.default.values(i.default.reject(n,function(e,t){return"undefined"===t})),i.default.each(n,function(e,t){e.sort(I)}),n.sort(function(e,t){return I(e[0],t[0])}),n=i.default.map(n,function(t,n){var r=t[0].parent_cluster_id,o=t[0].subcluster_id,a=t[0].subcluster_label,s=[];s=i.default.filter(s,function(e){return e.length>1});var l=F.json.subcluster_summary_stats[r][o];return{children:i.default.clone(t),parent_cluster:e,cluster_id:a,subcluster_label:o,recent_nodes:l.recent_nodes,priority_score:l.priority_score,distances:u.describe_vector(i.default.map(s[n],function(e){return e.length}))}}),i.default.each(n,function(e){oe(e)}),e.subclusters=n||[];var r=F.json.subcluster_summary_stats[e.cluster_id];e.recent_nodes=i.default.map(i.default.values(r),function(e){return e.recent_nodes[0]||0}),e.priority_score=i.default.map(i.default.values(r),function(e){return e.priority_score[0]||0})}),F.subcluster_table&&F.draw_cluster_table(F.extra_subcluster_table_columns,F.subcluster_table,{"no-clusters":!0,subclusters:!0,headers:function(e){e[0][0].value="Subcluster ID",e[0][0].help="Unique subcluster ID",e[0][2].help="Number of total cases in the subcluster"}}),F._is_CDC_||F.draw_node_table(F.extra_node_table_columns,null,null,{"no-filter":!0})}F.rendered_object_counts={nodes:n.size(),edges:a.size(),clusters:o.size(),has_hatching:!1},n.each(function(e){(function(e,t){var n;t&&(e=r.select(e),n=t.hxb2_linked&&!t.is_lanl?"cross":t.is_lanl?"triangle-down":F.node_shaper.shaper(t),t.rendered_size=Math.sqrt(W(t))/2+2,e.selectAll("path").attr("d",m.symbol(n).size(W(t))).style("fill",function(e){return function(e){var t=function(e,t){return G(e)?"url(#"+F.generate_cross_hatch_pattern(t)+")":t};if(F.colorizer.category_id){var n=F.attribute_node_value_by_id(e,F.colorizer.category_id);return F.colorizer.continuous&&n===v.missing.label?t(e,v.missing.color):t(e,F.colorizer.category(n))}return e.hxb2_linked?t(e,"black"):e.is_lanl?t(e,"red"):t(e,"gray")}(e)}).classed("multi_sequence",function(e){return i.default.isArray(e[v.network.AliasedSequencesID])&&e[v.network.AliasedSequencesID].length>1}),t.show_label?e.selectAll("text").empty()&&(t.label_x=0,t.label_y=0,e.append("text").classed("node-label",!0).text(t.id).attr("transform","translate("+1.25*t.rendered_size+","+.5*t.rendered_size+")").datum(t).call(F.node_label_drag)):e.selectAll("text").remove(),e.attr("class","node").classed("selected_object",function(e){return e.match_filter&&!F.hide_unselected}).classed("injected_object",function(e){return"injected"===e.node_class}).attr("transform",function(e){return"translate("+e.x+","+e.y+")"}).style("opacity",function(e){return Y(e)}).style("display",function(e){return e.is_hidden?"none":null}).call(he.drag().on("dragstart",function(e){r.event.sourceEvent.stopPropagation(),K()})).on("dragend",function(e){r.event.sourceEvent.stopPropagation()}).on("click",O).on("mouseover",Q).on("mouseout",K))})(this,e),F.rendered_object_counts.has_hatching=F.rendered_object_counts.has_hatching||G(e)}),o.each(function(e){!function(e,t){var n=r.select(e),i=t.binned_attributes?t.binned_attributes.map(function(e){return e.concat([0])}):[[null,1,0]];t.match_filter&&(i=i.concat([["selected",t.match_filter,1],["not selected",t.children.length-t.match_filter,1]]));var o=[r.sum(i.filter(function(e){return 0===e[2]}),function(e){return e[1]}),r.sum(i.filter(function(e){return 0!==e[2]}),function(e){return e[1]})],a=[0,0];i=i.map(function(n){var r=n[2],i={container:e,cluster:t,startAngle:a[r]/o[r]*2*Math.PI,endAngle:(a[r]+n[1])/o[r]*2*Math.PI,name:n[0],rim:r>0};return a[r]+=n[1],i});var s,l,u=.5*(s=t,F.cluster_sizes_in_entities&&(l=F.cluster_sizes_in_entities[s.cluster_id]),l=l||s.children.length,8*Math.sqrt(l));t.rendered_size=u+2;var c=n.selectAll("path").data(i);c.enter().append("path"),c.exit().remove(),c.classed("cluster",!0).classed("hiv-trace-problematic",function(e){return t.hxb2_linked&&!e.rim}).classed("hiv-trace-selected",function(e){return e.rim}).attr("d",function(e){return(e.rim?r.svg.arc().innerRadius(u+2).outerRadius(u+5):r.svg.arc().innerRadius(0).outerRadius(u))(e)}).style("fill",function(e,n){return e.rim?F.colorizer.selected(e.name):t.gradient?"url(#"+t.gradient+")":function(e,t){return e.binned_attributes?F.colorizer.category(t):"#bdbdbd"}(t,e.name)}).style("stroke-linejoin",function(e,t){return i.length>1?"round":""}).style("display",function(e){return t.is_hidden?"none":null})}(this,e)}),a.style("opacity",function(e){return Math.max(Y(e.target),Y(e.source))}),F.additional_edge_styler&&a.each(function(e){F.additional_edge_styler(this,e,F)}),a.style("display",function(e){return e.target.is_hidden||e.source.is_hidden||e.is_hidden?"none":null}).classed("selected_object",function(e){return e.ref.length_filter&&!F.hide_unselected}),e?a.each(F.link_generator_function):(se=o[0].length+n[0].length,he.on("tick",function(){var e=he.size();n.attr("transform",function(t){var n=10,r=e[0]-10,i=10,o=e[1]-10;if(F.showing_on_map){var a=F._get_node_country(t);if(a in F.countryCentersObject){var s=F.countryCentersObject[a].countryXY;n=s[0]-15,r=s[0]+15,i=s[1]-15,o=s[1]+15}}return"translate("+(t.x=Math.max(n,Math.min(r,t.x)))+","+(t.y=Math.max(i,Math.min(o,t.y)))+")"}),o.attr("transform",function(t){return"translate("+(t.x=Math.max(t.rendered_size,Math.min(e[0]-t.rendered_size,t.x)))+","+(t.y=Math.max(t.rendered_size,Math.min(e[1]-t.rendered_size,t.y)))+")"}),a.each(F.link_generator_function)}),he.start())},F.attribute_node_value_by_id=function(e,t,n){try{if(v.network.NodeAttributeID in e&&t&&t in e[v.network.NodeAttributeID]){var r;if(r=F.json[v.network.GraphAttrbuteID][t].volatile?F.json[v.network.GraphAttrbuteID][t].map(e,F):e[v.network.NodeAttributeID][t],i.default.isString(r)){if(0===r.length)return v.missing.label;if(n)return r=Number(r),i.default.isNaN(r)?v.missing.label:r}return r}}catch(r){console.log("self.attribute_node_value_by_id",r,e,t,n)}return v.missing.label},F.has_network_attribute=function(e){return v.network.GraphAttrbuteID in F.json&&e in F.json[v.network.GraphAttrbuteID]},F._aux_populate_category_fields=function(e,t){return e.raw_attribute_key=t,"label"in e||(e.label=t),e.discrete=!1,"enum"in e&&(e.discrete=!0,e.value_range=new Set(e.enum),e.value_range.add(v.missing.label),i.default.every(le.Nodes,function(n){return e.value_range.has(F.attribute_node_value_by_id(n,t))}))?(e.value_range=i.default.clone(e.enum),v.missing.label in e.value_range||e.value_range.push(v.missing.label),e.dimension=e.value_range.length,e["no-sort"]=!0,e):("String"===e.type&&(e.discrete=!0,e.value_range=new Set,le.Nodes.forEach(function(n){e.value_range.add(F.attribute_node_value_by_id(n,t))}),e.value_range=A(e.value_range),e.dimension=e.value_range.length),e)},F._aux_get_attribute_dimension=function(e){if(e in le[v.network.GraphAttrbuteID]){var t=le[v.network.GraphAttrbuteID][e];return"reduced_value_range"in t?i.default.size(t.reduced_value_range):t.dimension}return 0},F._aux_process_category_values=function(e){var t,n=null;if(delete e.reduced_value_range,e["no-sort"])t=e.value_range;else if("String"===e.type){if(t=e.value_range.sort(),e.dimension>v.MaximumValuesInCategories){var r=i.default.chain(F.nodes).countBy(function(t){return F.attribute_node_value_by_id(t,e.raw_attribute_key)}).pairs().sortBy(function(e){return-e[1]}).value();n=[];for(var o=0;n.length<v.MaximumValuesInCategories-1&&o<r.length;)r[o][0]!==v.missing.label&&n.push(r[o][0]),o++;(n=n.sort()).push(v.network.ReducedValue)}for(var a=n||t,s=i.default.map(a,function(e){null==e&&(e=""),e=String(e);for(var t=5801,n=0;n<e.length;n++)t=(t<<5+t)+e.charCodeAt(n);return t}),l={},u={},c=0;c<v.MaximumValuesInCategories;c++)l[c]=!0;i.default.each(s,function(e,t){e<0&&(e=-e);var n=e%v.MaximumValuesInCategories;if(n in l)return u[a[t]]=n,void delete l[n];var r=Math.floor(e/v.MaximumValuesInCategories)%v.MaximumValuesInCategories;if(r in l)return u[a[t]]=r,void delete l[r];var o=parseInt(i.default.keys(l).sort()[0]);u[a[t]]=o,delete l[o]}),e["stable-ish order"]=u}var d={};if(n){var f=i.default.object(i.default.map(i.default.pairs(n),function(e){return[e[1],e[0]]}));i.default.each(t,function(e,t){d[e]=e in f?f[e]:f[v.network.ReducedValue]}),e.reduced_value_range=f,e.value_map=function(e,t){return t?"lookup"===t?i.default.invert(f):f:d[e]}}else i.default.each(t,function(e,t){d[e]=t}),e.value_map=function(e,t){return t?"lookup"===t?i.default.invert(d):d:d[e]};return e},F.expand_cluster_handler=function(e,t,n){if(e.collapsed){var r=F.cluster_sizes[e.cluster_id-1]-1;if(r>ue)F.warning_string="This cluster is too large to be displayed";else{var i=r+se-ue;if(i>0){for(var o=0;o<de.length&&i>0;o++){var a=F.clusters[F.cluster_mapping[de[o]]];i-=a.children.length-1,J(a,!0)}(o||de.length)&&de.splice(0,o)}i<=0&&ee(e,!n)}t&&F.update(!1,.6)}return""},F.extract_network_time_series=function(e,t,n){var r=n?i.default.filter(F.nodes,n):F.nodes,o=i.default.map(r,function(n){var r={time:F.attribute_node_value_by_id(n,e)};return t&&i.default.each(t,function(e,t){r[e]=F.attribute_node_value_by_id(n,t)}),r});return o.sort(function(e,t){return e.time<t.time?-1:e.time===t.time?0:1}),o},F.expand_some_clusters=function(e){(e=e||F.clusters).forEach(function(e){e.is_hidden||F.expand_cluster_handler(e,!1)}),F.update()},F.select_some_clusters=function(e){return F.clusters.filter(function(t,n){return i.default.some(t.children,function(t){return e(t)})})},F.collapse_some_clusters=function(e){(e=e||F.clusters).forEach(function(e){e.collapsed||J(e)}),F.update()},F.toggle_hxb2=function(){F.hide_hxb2=!F.hide_hxb2,F.update()},F.toggle_diff=function(){F.showing_diff=!F.showing_diff,F.showing_diff?F.cluster_filtering_functions.new=F.filter_if_added:delete F.cluster_filtering_functions.new,F.update()},F.toggle_highlight_unsupported_edges=function(){F.highlight_unsuppored_edges=!F.highlight_unsuppored_edges,F.update()},F.toggle_time_filter=function(){F.using_time_filter?F.using_time_filter=null:(F.using_time_filter=p.getCurrentDate(),F.using_time_filter.setFullYear(F.using_time_filter.getFullYear()-1)),F.using_time_filter?F.cluster_filtering_functions.recent=F.filter_time_period:delete F.cluster_filtering_functions.recent,F.update()},F._distance_gate_options=function(e){return e=e||.005,{"edge-styler":function(e,t,n){var i=m.edge_typer(t,n.edge_types,n.edge_cluster_threshold);""!==i&&r.select(e).style("stroke",n._edge_colorizer(m.edge_typer(t,n.edge_types,n.edge_cluster_threshold))),t.is_hidden=!n.shown_types[i],r.select(e).style("stroke-width","4px")},init_code:function(t){function n(e){if(this.style("stroke-width","5px"),e.length)this.style("stroke",t._edge_colorizer(e));else{this.classed("link",!0);var n=this.style("stroke");this.classed("link",null),this.style("stroke",n)}}t.update_cluster_threshold_display=function(e){t.edge_cluster_threshold=e,t.edge_types=["≤"+t.edge_cluster_threshold,">"+t.edge_cluster_threshold],t._edge_colorizer=r.scale.ordinal().range(v.EdgeColorBase).domain(t.edge_types),t.shown_types=i.default.object(i.default.map(t.edge_types,function(e){return[e,1]})),t.edge_legend={caption:"Links by distance",types:{}},i.default.each(t.shown_types,function(e,r){r.length&&(t.edge_legend.types[r]=i.default.partial(n,r))})},t.update_cluster_threshold_display(e)},extra_menu:{title:"更多选项",items:[[function(e,t){var n=t.append("div").classed("form-group",!0);n.append("label").text("遗传距离阈值 ").classed("control-label",!0),n.append("input").classed("form-control",!0).attr("value",String(e.edge_cluster_threshold)).on("change",function(t){if(this.value){var r=parseFloat(this.value);if(i.default.isNumber(r)&&r>0&&r<1)return e.update_cluster_threshold_display(r),e.draw_attribute_labels(),e.update(!0),void n.classed("has-success",!0).classed("has-error",!1)}n.classed("has-success",!1).classed("has-error",!0)}).on("click",function(e){r.event.stopPropagation()})},null]]}}},F._social_view_options=function(e,t,n){return n=n||function(e){return i.default.has(e,"edge_type")?e.edge_type:""},{"edge-styler":function(e,t,i){var o=n(t);""!==o?(r.select(e).style("stroke",i._edge_colorizer(n(t))),t.is_hidden=!i.shown_types[o]):t.is_hidden=!i.shown_types[""],r.select(e).style("stroke-width","5px")},init_code:function(e){function n(t){if(this.style("stroke-width","5px"),t.length)this.style("stroke",e._edge_colorizer(t));else{this.classed("link",!0);var n=this.style("stroke");this.classed("link",null),this.style("stroke",n)}}var o=i.default.keys(t);o.sort(),e._edge_colorizer=r.scale.ordinal().range(v.CategoricalBase).domain(o),e.shown_types=i.default.clone(t),e.edge_legend={caption:"Network links",types:{}},i.default.each(e.shown_types,function(t,r){r.length?e.edge_legend.types[r]=i.default.partial(n,r):e.edge_legend.types["Molecular links"]=i.default.partial(n,r)})},extra_menu:{title:"更多选项",items:i.default.map(e,function(e){return[function(t,n){function r(){t.shown_types[e]=!t.shown_types[e],i.attr("checked",t.shown_types[e]?"":null),t.update(!0)}var i=(e.length?n.append("a").text(e+" links").style("color",t._edge_colorizer(e)).on("click",r):n.append("a").text("Molecular links").on("click",r)).append("input").attr("type","checkbox").attr("checked","")}]})}}},F.load_nodes_edges=function(e,t,n,r){return D(F,e,t,n,r)},F.update_clusters_with_injected_nodes=function(e,t,n){var r;try{e=e||function(){return!0},t=t||function(){return!0},r=(0,m.hivtrace_cluster_depthwise_traversal)(i.default.filter(F.json.Nodes,e),F.json.Edges,null,!1),i.default.each(r,function(e){var t={},r=0;i.default.each(e,function(e){t[e.cluster]=1,r+=e.cluster?0:1}),r&&delete t[void 0],i.default.each(e,function(e){"extended_cluster"in e?i.default.extend(e.extended_cluster,t):e.extended_cluster=t}),i.default.each(t,function(e,o){var a=F.clusters[F.cluster_mapping[o]];a.injected||(a.injected={}),a.injected[n]=r,"linked_clusters"in a?i.default.extend(a.linked_clusters,t):a.linked_clusters=t})})}catch(e){throw console.log(e),e}return r};var se,le=F.json,ue=1536,ce=4096,de=[],fe=r.scale.pow().exponent(.5).domain([1,1e5]).range([.1,.15]),pe=r.scale.pow().exponent(1.25).clamp(!0).domain([0,.1]),he=r.layout.force().on("tick",function(){var e=he.size();node.attr("cx",function(t){return t.x=Math.max(10,Math.min(e[0]-10,t.x))}).attr("cy",function(t){return t.y=Math.max(10,Math.min(e[1]-10,t.y))}),link.attr("x1",function(e){return e.source.x}).attr("y1",function(e){return e.source.y}).attr("x2",function(e){return e.target.x}).attr("y2",function(e){return e.target.y})}).charge(function(e){return F.showing_on_map?-60:e.cluster_id?F.charge_correction*(-15-5*Math.pow(e.children.length,.4)):F.charge_correction*(-10-5*Math.sqrt(e.degree))}).linkDistance(function(e){return 5e3*pe(e.length)*.2}).linkStrength(function(e){return F.showing_on_map?.01:void 0!==e.support?.75-.5*e.support:1}).chargeDistance(500).gravity(F.showing_on_map?0:fe(F.json.Nodes.length)).friction(.25);r.select(F.container).selectAll("svg").remove(),F.isPrimaryGraph&&(r.select(F.container).selectAll(".my_progress").style("display","none"),h.getNodeTable().selectAll("*").remove(),F.cluster_table.selectAll("*").remove()),F.network_svg=r.select(F.container).append("svg:svg").attr("id",F.dom_prefix+"-network-svg").attr("width",F.width+F.margin.left+F.margin.right).attr("height",F.height+F.margin.top+F.margin.bottom),F.network_cluster_dynamics=null;var ge=r.behavior.drag().on("dragstart",function(){r.event.sourceEvent.stopPropagation()}).on("drag",function(e){r.select(this).attr("transform","translate("+[r.event.x,r.event.y]+")")}),me=F.showing_on_map?100:5;if(F.legend_svg=F.network_svg.append("g").attr("transform","translate(5,"+me+")").call(ge),F.network_svg.append("defs").append("marker").attr("id",F.dom_prefix+"_arrowhead").attr("refX",18).attr("refY",6).attr("markerWidth",20).attr("markerHeight",16).attr("orient","auto").attr("stroke","#666666").attr("markerUnits","userSpaceOnUse").attr("fill","#AAAAAA").append("path").attr("d","M 0,0 L 2,6 L 0,12 L14,6 Z"),q(),function(){var e={},t=0;F.exclude_cluster_ids={},F.has_hxb2_links=!1,F.cluster_sizes=[],F.cluster_sizes_in_entities={};var n=new Set;if(le.Nodes.forEach(function(e){void 0===F.cluster_sizes[e.cluster-1]?F.cluster_sizes[e.cluster-1]=1:F.cluster_sizes[e.cluster-1]++,n.add(e.cluster),"is_lanl"in e&&(e.is_lanl="true"===e.is_lanl),"attributes"in e||(e.attributes=[]),e.attributes.indexOf("problematic")>=0&&(F.has_hxb2_links=!0,e.hxb2_linked=!0)}),F.has_multiple_sequences){var o=0;F.apply_to_entities(function(e,t){F.cluster_sizes_in_entities[t[0].cluster]?F.cluster_sizes_in_entities[t[0].cluster]++:F.cluster_sizes_in_entities[t[0].cluster]=1,o++}),F.json["Network Summary"]&&(F.json["Network Summary"].Nodes=o,F.json["Network Summary"].Clusters=i.default.size(F.cluster_sizes_in_entities),F.json["Cluster sizes"]=[],i.default.each(F.cluster_sizes_in_entities,function(e,t){F.json["Cluster sizes"].push(e)}))}else F.json["Network Summary"]&&(F.json["Network Summary"].Clusters=n.size);if(F._extract_attributes_for_nodes=function(e,t){var n=this,r=[i.default.map(t,function(e){return e.raw_attribute_key})];return i.default.each(e,function(e){r.push(i.default.map(t,function(t){if(t.raw_attribute_key===f._networkNodeIDField){var r=F.primary_key(e);if(F.has_multiple_sequences){if(i.default.every(n.primary_key_list[r],function(e){return _.HIVTxNetwork.is_new_node(e)}))return r+f._networkNewNodeMarker}else if(_.HIVTxNetwork.is_new_node(e))return r+f._networkNewNodeMarker;return r}return i.default.has(e,t.raw_attribute_key)?e[t.raw_attribute_key]:F.attribute_node_value_by_id(e,t.raw_attribute_key)}))}),r},F._extract_exportable_attributes=function(e){var t={String:1,Date:1,Number:1},n=[];return e&&(n=[{raw_attribute_key:f._networkNodeIDField,type:"String",label:"Node ID",format:function(){return"Node ID"}},{raw_attribute_key:"cluster",type:"String",label:"Which cluster the individual belongs to",format:function(){return"簇 ID"}}]),n.push(i.default.filter(F.json[v.network.GraphAttrbuteID],function(e){return e.type in t})),i.default.flatten(n,!0)},F._extract_nodes_by_id=function(e){var t=i.default.filter(F.nodes,function(t){return t.cluster.toString()===e.toString()||t.subcluster_label===e.toString()});return F.has_multiple_sequences&&(t=F.aggregate_indvidual_level_records(t)),t},F._cluster_list_view_render=function(e,t,n,o){var a=this;n.selectAll("*").remove();var s,l=F._extract_exportable_attributes();if(o){if(!(s=F.priority_groups_find_by_name(o)))return;s=F.has_multiple_sequences?F.aggregate_indvidual_level_records(s.node_objects):s.node_objects}else s=F._extract_nodes_by_id(e);r.select(F.get_ui_element_selector_by_role("cluster_list_data_export",!0)).on("click",function(e){F._is_CDC_executive_mode?alert(v.network.WarnExecutiveMode):u.export_csv_button(F._extract_attributes_for_nodes(s,l))}),t?i.default.each(l,function(e){var t=i.default.groupBy(s,function(t){return F.attribute_node_value_by_id(t,e.raw_attribute_key)}),r=i.default.keys(t).sort(),o=n.append("li");o.append("code").text(e.label||e.raw_attribute_key);var l=o.append("dl").classed("dl-horizontal",!0);i.default.each(r,function(e){l.append("dt").text(e),l.append("dd").text(i.default.map(t[e],function(e){return a.entity_id(e)}).join(", "))})}):i.default.each(s,function(e){var t=n.append("li");t.append("code").text(a.entity_id(e));var r=t.append("dl").classed("dl-horizontal",!0);i.default.each(l,function(t){r.append("dt").text(t.label||t.raw_attribute_key),r.append("dd").text(F.attribute_node_value_by_id(e,t.raw_attribute_key))})})},F._setup_cluster_list_view=function(){r.select(F.get_ui_element_selector_by_role("cluster_list_view_toggle",!0)).on("click",function(){var e;r.event.preventDefault();var t=S(this);"id"===t.data("查看")?(t.data("查看","attribute"),t.text("按 ID 分组"),e=!1):(t.data("查看","id"),t.text("按属性分组"),e=!0);var n=t.data("cluster");F._cluster_list_view_render(n?n.toString():"",!e,r.select(F.get_ui_element_selector_by_role("cluster_list_payload",!0)),t.data("priority_list"))}),S(F.get_ui_element_selector_by_role("cluster_list",!0)).on("show.bs.modal",function(e){var t=S(e.relatedTarget),n=t.data("cluster"),i=t.data("priority_set"),o=r.select(F.get_ui_element_selector_by_role("cluster_list",!0));o.selectAll(".modal-title").text("列出节点"+(i?" in cluster of interest "+i:" 簇 "+n));var a=S(F.get_ui_element_selector_by_role("cluster_list_view_toggle",!0));i?(a.data("priority_list",i),a.data("cluster","")):(a.data("cluster",n),a.data("priority_list",null)),F._cluster_list_view_render(n,"id"!==S(F.get_ui_element_selector_by_role("cluster_list_view_toggle",!0)).data("查看"),o.select(F.get_ui_element_selector_by_role("cluster_list_payload",!0)),i)}),S(F.get_ui_element_selector_by_role("overlap_list",!0)).on("show.bs.modal",function(e){var t=S(e.relatedTarget).data("priority_set"),n=r.select(F.get_ui_element_selector_by_role("overlap_list",!0));n.selectAll(".modal-title").text("View how nodes in cluster of interest "+t+" overlap with other clusterOI");var o=F.priority_groups_find_by_name(t);if(o&&F.priority_node_overlap){var a=[],s=[["Overlapping Cluster of Interest","Node","Other clusterOI"]];i.default.each(F.aggregate_indvidual_level_records(o.node_objects),function(e){var n=F.entity_id(e),r=F.priority_node_overlap[n],l="None";r.size>1&&(l=i.default.sortBy(i.default.filter(A(r),function(e){return e!==t})).join("; ")),a.push([{value:n},{value:l}]),s.push([o.name,n,l])}),r.select(F.get_ui_element_selector_by_role("overlap_list_data_export",!0)).on("click",function(e){u.export_csv_button(s,"overlap")}),f.add_a_sortable_table(n.select(F.get_ui_element_selector_by_role("overlap_list_data_table",!0)),[[{value:"Node",help:"EHARS_ID of the node that overlaps with other clusterOI",sort:"value"},{value:"Other Cluster(s) of Interest",help:"Names of other clusterOI where this node is included",sort:"value"}]],a,!0,null,g.get_editor())}})},S(F.get_ui_element_selector_by_role("priority_set_merge",!0)).on("show.bs.modal",function(e){var t=r.select(F.get_ui_element_selector_by_role("priority_set_merge",!0)),n=t.selectAll(".modal-desc"),o=r.select(F.get_ui_element_selector_by_role("priority_set_merge_table_proceed",!0));if(F.defined_priority_groups&&F.defined_priority_groups.length>1){n.text("Select two or more clusters of interest to merge");var a=new Set,s=null,l=null;o.attr("disabled","disabled").on("click",function(){s&&(g.open_editor(F,[],"","Merged from "+A(a).join(" and ")),g.get_editor().append_nodes(A(s),l,!0)),S(t.node()).modal("hide")});var u=[];i.default.each(F.defined_priority_groups,function(e){var t=new Set;i.default.each(e.node_objects,function(n){i.default.each(A(F.priority_node_overlap[F.entity_id(n)]),function(n){n!==e.name&&t.add(n)})}),u.push([{value:e,callback:function(e,t){r.select(e).append("input").attr("type","checkbox").style("margin-left","1em").on("click",function(e){!function(e,t){if(t?a.add(e):a.delete(e),a.size>1){var r=0;s=new Set,l={},i.default.each(F.defined_priority_groups,function(e){a.has(e.name)&&(r+=F.unique_entity_list(e.node_objects).length,i.default.each(e.nodes,function(e){s.add(e.name),l[e.name]={_priority_set_date:e.added,_priority_set_kind:e.kind}}))}),n.html("Merge "+a.size+" clusterOI with "+r+" persons, creating a new clusterOI with "+F.unique_entity_list_from_ids(A(s)).length+" persons. <br><small>Note that the clusters of interest being merged will <b>not</b> be automatically deleted</small>"),o.attr("disabled",null)}else n.text("Select two or more clusters of interest to merge"),o.attr("disabled","disabled")}(t.name,S(this).prop("checked"))})}},{value:e.name},{value:F.unique_entity_list(e.node_objects).length},{value:A(t),format:function(e){return e.join("<br>")},html:!0}])}),f.add_a_sortable_table(t.select(F.get_ui_element_selector_by_role("priority_set_merge_table",!0)),[[{value:"Select"},{value:"Cluster of interest",help:"Cluster of interest Name",sort:"value"},{value:"Persons",help:"How many persons are in this cluster of interest",sort:"value"},{value:"Overlaps",help:"Overlaps with",sort:"value"}]],u,!0,null,g.get_editor())}}),l){F._setup_cluster_list_view();var a=r.select(F.get_ui_element_selector_by_role("cluster_operations_container"));a.selectAll("li").remove();var s=function(e){i.default.each([F.clusters,F.nodes],function(t){i.default.each(t,function(t){t.fixed=e})})},c=function(e){var t=F.network_svg.selectAll(".node");t.empty()||(t.each(function(t){t.show_label=e}),F.update(!0))},d=function(e){var t=[];i.default.each(F.clusters,function(e){e.fixed&&t.push(e),e.fixed=!1}),z(e),he.tick(),F.update(),i.default.each(t,function(e){e.fixed=!0})},h=[["复制配色方案",function(){var e=u.exportColorScheme(F.uniqValues,F.colorizer);u.copyToClipboard(JSON.stringify(e))},!0,"hivtrace-export-color-scheme"],["展开全部",function(){return F.expand_some_clusters()},!0,"hivtrace-expand-all"],["折叠全部",function(){return F.collapse_some_clusters()},!0,"hivtrace-collapse-all"],["展开已过滤",function(){return F.expand_some_clusters(F.select_some_clusters(function(e){return e.match_filter}))},!0,"hivtrace-expand-filtered"],["折叠已过滤",function(){return F.collapse_some_clusters(F.select_some_clusters(function(e){return e.match_filter}))},!0,"hivtrace-collapse-filtered"],["固定所有对象位置",i.default.partial(s,!0),!0,"hivtrace-fix-in-place"],["允许所有对象浮动",i.default.partial(s,!1),!0,"hivtrace-allow-to-float"],["重置布局(紧凑)",i.default.partial(d,!0),!0,"hivtrace-reset-layout"],["重置布局(平铺)",i.default.partial(d,!1),!0,"hivtrace-reset-layout"],["显示所有标签",i.default.partial(c,!0),!0,"hivtrace-node-labels-on"],["隐藏所有标签",i.default.partial(c,!1),!0,"hivtrace-node-labels-off"],["隐藏问题簇",function(e){r.select(e).text(F.hide_hxb2?"隐藏问题簇":"显示问题簇"),F.toggle_hxb2()},F.has_hxb2_links,"hivtrace-hide-problematic-clusters"],["高亮不支持的边",function(e){F.highlight_unsuppored_edges?r.select(e).selectAll(".fa-check-square").remove():r.select(e).insert("i",":first-child").classed("fa fa-check-square",!0),F.toggle_highlight_unsupported_edges()},!0,"hivtrace-highlight-unsuppored_edges",F.highlight_unsuppored_edges]];F.cluster_attributes&&h.push(["Show only changes since last network update",function(e){F.showing_diff?r.select(e).selectAll(".fa-check-square").remove():r.select(e).insert("i",":first-child").classed("fa fa-check-square",!0),F.toggle_diff()},!0,"hivtrace-show-network-diff",F.showing_diff]),p.getClusterTimeScale()&&h.push(["仅显示近期簇",function(e){F.using_time_filter?r.select(e).selectAll(".fa-check-square").remove():r.select(e).insert("i",":first-child").classed("fa fa-check-square",!0),F.toggle_time_filter()},!0,"hivtrace-show-using-time-filter",F.using_time_filter]),F._is_CDC_?h.push(["Add filtered objects to cluster of interest",function(e){g.get_editor()&&g.get_editor().append_node_objects(i.default.filter(F.json.Nodes,function(e){return e.match_filter}))},g.get_editor,"hivtrace-add-filtered-to-panel"]):h.push(["Show removed edges",function(e){F.filter_edges=!F.filter_edges,r.select(e).text(F.filter_edges?"Show removed edges":"Hide removed edges"),F.update(!1)},function(){return i.default.some(F.edges,function(e){return e.removed})},"hivtrace-show-removed-edges"]),h.forEach(function(e,t){var n=e[2];if(i.default.isFunction(n)&&(n=n(e)),n){var r=e[1],o=this.append("li").append("a").text(e[0]).attr("href","#").on("click",function(e){r(this)});e.length>4&&(o.text(""),e[4]&&o.insert("i",":first-child").classed("fa fa-check-square",!0),o.insert("span").text(e[0]))}},a);var m=r.select(F.get_ui_element_selector_by_role("button_group"));if(!m.empty()){m.selectAll("button").remove(),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","扩展间距").on("click",function(e){$(5/4)}).append("i").classed("fa fa-plus",!0),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","压缩间距").on("click",function(e){$(.8)}).append("i").classed("fa fa-minus",!0),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","放大窗口").on("click",function(e){q(100,!0)}).append("i").classed("fa fa-expand",!0),m.append("button").classed("btn btn-default btn-sm",!0).attr("title","缩小窗口").on("click",function(e){q(-100,!0)}).append("i").classed("fa fa-compress",!0),F._is_CDC_?m.append("button").classed("btn btn-default btn-sm",!0).attr("title","切换流行曲线").attr("id","hivtrace-toggle-epi-curve").on("click",function(e){F.check_for_time_series()}).append("i").classed("fa fa-line-chart",!0):m.append("button").classed("btn btn-default btn-sm",!0).attr("title","Compute graph statistics").attr("id","hivtrace-compute-graph-statistics").on("click",function(e){i.default.bind(F.compute_graph_stats,this)()}).append("i").classed("fa fa-calculator",!0);var b=r.select(F.get_ui_element_selector_by_role("export_image"));if(!b.empty()){b.selectAll("div").remove();var x=b.insert("div",":first-child").classed("input-group-btn dropdown-img",!0),k=x.append("ul").classed("dropdown-menu",!0).attr("aria-labelledby","dropdownImg");k.append("li").classed("dropdown-item export-img-item",!0).append("a").attr("href","#").text("SVG").on("click",function(e){u.save_image("svg","#"+F.dom_prefix+"-network-svg")}),k.append("li").classed("dropdown-item export-img-item",!0).append("a").attr("href","#").text("PNG").on("click",function(e){u.save_image("png","#"+F.dom_prefix+"-network-svg")});var C=x.append("button").attr("id","dropdownImg").attr("data-toggle","dropdown").classed("btn btn-default btn-sm dropdown-toggle",!0).attr("title","保存图像").attr("id","hivtrace-export-image");C.append("i").classed("fa fa-image",!0),C.append("span").classed("caret",!0)}}S(F.get_ui_element_selector_by_role("filter")).off("input propertychange").on("input propertychange",i.default.throttle(function(e){var t=S(this).val();F.filter(f.filter_parse(t))},250)),S(F.get_ui_element_selector_by_role("hide_filter")).off("change").on("change",i.default.throttle(function(e){F.hide_unselected=!F.hide_unselected,F.filter_visibility(),F.update(!0)},250)),S(F.get_ui_element_selector_by_role("show_small_clusters")).off("change").on("change",i.default.throttle(function(e){"size"in F.cluster_filtering_functions?delete F.cluster_filtering_functions.size:F.cluster_filtering_functions.size=F.filter_by_size,F.update(!1)},250)),S(F.get_ui_element_selector_by_role("set_min_cluster_size")).val(F.minimum_cluster_size).off("change").on("change",i.default.throttle(function(e){F.minimum_cluster_size=e.target.value,F.update(!1)},250)),S(F.get_ui_element_selector_by_role("pairwise_table_pecentage",!0)).off("change").on("change",i.default.throttle(function(e){F.show_percent_in_pairwise_table=!F.show_percent_in_pairwise_table,te("attribute_table",F.colorizer.category_map,F.colorizer.category_pairwise)},250))}v.network.GraphAttrbuteID in F.json?w=F.json[v.network.GraphAttrbuteID]:w&&"hivtrace"in w&&(w=w.hivtrace),le.Nodes.filter(function(e,t){return null===e.cluster}).length,F.nodes_by_cluster={},F.attributes_selected_cluster=null,F.getClusterUniqs=function(e){if(!e)return F.uniqs;var t=i.default.find(F.clusters,function(t){return String(t.cluster_id)===String(e)});if(!t||!t.children)return F.uniqs;var n={},r=F.json[v.network.GraphAttrbuteID];return i.default.each(r,function(e,r){if("String"===e.type){var o=new Set;i.default.each(t.children,function(e){var t=F.attribute_node_value_by_id(e,r);t!==v.missing.label&&null!=t&&o.add(t)}),n[r]=o.size}}),n},F.updateAttributePillCounts=function(e){var t=F.getClusterUniqs(e);r.select(F.get_ui_element_selector_by_role("attributes_cat",!0)).selectAll(".hivtrace-pill .badge").text(function(){var e=r.select(this.parentNode).datum();return e&&e[1]&&e[1]in t?t[e[1]]:""})},F.nodes=le.Nodes.filter(function(n,r){return!(!n.cluster||void 0!==F.exclude_cluster_ids[n.cluster]||(n.cluster in F.nodes_by_cluster?F.nodes_by_cluster[n.cluster].push(n):F.nodes_by_cluster[n.cluster]=[n],e[r]=t++,0))}),F.edges=le.Edges.filter(function(t,n){return t.source in e&&t.target in e}),F.edges=F.edges.map(function(t,n){var r=i.default.clone(t);return r.source=e[t.source],r.target=e[t.target],r.id=n,r}),function(e,t){for(var n in e)e[n].degree=0;for(var r in t)e[t[r].source].degree++,e[t[r].target].degree++}(F.nodes,F.edges),z(F.initial_packed),F.clusters.forEach(function(e,t){F.cluster_mapping[e.cluster_id]=t,e.hxb2_linked=e.children.some(function(e){return e.hxb2_linked}),oe(e),e.distances=[]});try{if(T&&T.extra_menu){var D=r.select(F.get_ui_element_selector_by_role("extra_operations_container"));r.select(F.get_ui_element_selector_by_role("extra_operations_enclosure")).selectAll("button").text(T.extra_menu.title).append("span").classed("caret","true"),D.selectAll("li").remove(),T.extra_menu.items.forEach(function(e,t){var n=e[1];i.default.isFunction(e[0])?e[0](F,this.append("li")):this.append("li").append("a").text(e[0]).attr("href","#").on("click",function(e){n(F,this),r.event.preventDefault()})},D),r.select(F.get_ui_element_selector_by_role("extra_operations_enclosure")).style("display",null)}}catch(e){console.log(e)}if(F._aux_populate_category_menus=function(e){var t=this;if(l){var n=i.default.filter(i.default.map(le[v.network.GraphAttrbuteID],F._aux_populate_category_fields),function(t,n){return t.discrete&&"value_range"in t&&!t._hidden_&&(!e||e.has(t.raw_attribute_key))}),o=i.default.filter(n,function(t){return(!e||e.has(t.raw_attribute_key))&&(t.discrete&&t.dimension<=7||t.raw_attribute_key in F.networkShapeScheme&&!t._hidden_)});i.default.each([n,o],function(e){i.default.each(e,F._aux_process_category_values)});var a=i.default.filter(i.default.map(le[v.network.GraphAttrbuteID],function(e,n){var o=i.default.get(F.json,[v.network.GraphAttrbuteID,n,"color_stops"],v.network.ContinuousColorStops);function a(e,t,n){var a=1/0;e.value_range=r.extent(t),i.default.each(n,function(n,r){var s=i.default.map(i.default.range(o),function(){return 0});n.range([0,o-1]).domain(e.value_range);for(var l=t.length;l--;)s[~~n(t[l])]++;var u=t.length/o,c=i.default.reduce(s,function(e,t){return e+(t-u)*(t-u)});c<a&&(a=c,e.scale=n)})}if(e.raw_attribute_key=n,"Number"===e.type||"Number-categories"===e.type){for(var s=[],l=F.json.Nodes.length;l--;){var u=F.attribute_node_value_by_id(F.json.Nodes[l],n,"Number"===e.type);i.default.isNumber(u)&&s.push(u)}var c=r.extent(s),d=[r.scale.linear()];e.is_integer||(c[0]>0&&d.push(r.scale.log()),c[0]>=0&&(d.push(r.scale.pow().exponent(1/3)),d.push(r.scale.pow().exponent(1/4)),d.push(r.scale.pow().exponent(.5)),d.push(r.scale.pow().exponent(1/8)),d.push(r.scale.pow().exponent(1/16)))),a(e,s,d)}else if("Date"===e.type){if(s=i.default.filter(i.default.map(le.Nodes,function(r){try{var i=F.attribute_node_value_by_id(r,n);e.raw_attribute_key,_.HIVTxNetwork.inject_attribute_node_value_by_id(r,n,t.parse_dates(i))}catch(e){_.HIVTxNetwork.inject_attribute_node_value_by_id(r,n,v.missing.label)}return F.attribute_node_value_by_id(r,n)}),function(e){return e===v.missing.label?null:e}),0===s.length)return{};a(e,s,[r.time.scale()])}return e}),function(e){return("Number"===e.type||"Date"===e.type||"Number-categories"===e.type)&&!e._hidden_}),s=function(e){return(e.annotation?"["+e.annotation+"] ":"")+e.label};[r.select(F.get_ui_element_selector_by_role("attributes")),r.select(F.get_ui_element_selector_by_role("attributes_cat",!0))].forEach(function(e){if(!e.empty())if("div"===e.node().tagName.toLowerCase()){e.selectAll("*").remove();var t=[["概览","_overview",function(){F.colorizer.category_id="_overview",F.colorizer.continuous=!1;var e=document.querySelector(".hivtrace-attributes-content");e&&(e.style.display="none");var t=document.getElementById("attrs_stats_content");t&&(t.style.display=""),"function"==typeof window.renderOverviewStats&&window.renderOverviewStats(F.attributes_selected_cluster)}]].concat(n.map(function(e,t){return[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_categorical,e.raw_attribute_key)]}));a.length&&(t=t.concat(a.map(function(e,t){return[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_continuous,e.raw_attribute_key)]}))),e.selectAll(".hivtrace-pill").data(t).enter().append("span").classed("hivtrace-pill",!0).classed("active",function(e,t){return 0===t}).html(function(e){var t=e[0],n="unknown";return e[1]in F.schema&&(n=F.schema[e[1]].type),e[1]in F.uniqs&&"String"===n&&(t=t+'<span class="badge">'+F.uniqs[e[1]]+"</span>"),t}).on("click",function(t){if(t[2]){if(e.selectAll(".hivtrace-pill").classed("active",!1),r.select(this).classed("active",!0),"_overview"!==t[1]){var n=document.getElementById("attrs_stats_content"),i=document.querySelector(".hivtrace-attributes-content");n&&(n.style.display="none"),i&&(i.style.display="")}t[2].call()}}),t.length>0&&t[0][2]&&setTimeout(function(){t[0][2].call()},100)}else{var o=[[["None",null,i.default.partial(F.handle_attribute_categorical,null)]],[["分类","heading",null]]].concat(n.map(function(e,t){return[[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_categorical,e.raw_attribute_key)]]}));a.length&&(o=o.concat([[["连续","heading",null]]]).concat(a.map(function(e,t){return[[s(e),e.raw_attribute_key,i.default.partial(F.handle_attribute_continuous,e.raw_attribute_key)]]}))),e.selectAll("li").remove();var l=e.selectAll("li").data(o);l.enter().append("li").classed("disabled",function(e){return"heading"===e[0][1]}).style("font-variant",function(e){return e[0][1]<-1?"small-caps":"normal"}),l.selectAll("a").data(function(e){return e}).enter().append("a").html(function(e,t,n){var r=e[0],i="unknown";return e[1]in F.schema&&(i=F.schema[e[1]].type),e[1]in F.uniqs&&"String"===i&&(r=r+'<span title="Number of unique values" class="badge pull-right">'+F.uniqs[e[1]]+"</span>"),r}).attr("style",function(e,t,n){return"heading"===e[1]?"font-style: italic":0===n?" font-weight: bold;":null}).attr("href","#").on("click",function(e){e[2]&&e[2].call()})}}),[r.select(F.get_ui_element_selector_by_role("shapes"))].forEach(function(e){e.selectAll("li").remove();var t=e.selectAll("li").data([[["None",null,i.default.partial(F.handle_shape_categorical,null)]]].concat(o.map(function(e,t){return[[s(e),e.raw_attribute_key,i.default.partial(F.handle_shape_categorical,e.raw_attribute_key)]]})));t.enter().append("li").style("font-variant",function(e){return e[0][1]<-1?"small-caps":"normal"}),t.selectAll("a").data(function(e){return e}).enter().append("a").html(function(e,t,n){var r=e[0],o="unknown";return i.default.contains(i.default.keys(F.schema),e[1])&&(o=F.schema[e[1]].type),i.default.contains(i.default.keys(F.uniqs),e[1])&&"String"===o&&(r=r+'<span title="Number of unique values" class="badge pull-right">'+F.uniqs[e[1]]+"</span>"),r}).attr("style",function(e,t,n){return 0===n?" font-weight: bold;":null}).attr("href","#").on("click",function(e){e[2]&&e[2].call()})}),S(F.get_ui_element_selector_by_role("opacity_invert")).off("click").on("click",function(e){F.colorizer.opacity_scale&&(F.colorizer.opacity_scale.range(F.colorizer.opacity_scale.range().reverse()),F.update(!0),F.draw_attribute_labels()),S(this).toggleClass("btn-active btn-default")}),S(F.get_ui_element_selector_by_role("attributes_invert")).off("click").on("click",function(e){F.colorizer.category_id&&(le[v.network.GraphAttrbuteID][F.colorizer.category_id].scale.range(le[v.network.GraphAttrbuteID][F.colorizer.category_id].scale.range().reverse()),F.clusters.forEach(function(e){e.gradient=H(e,F.colorizer.category_id)}),F.update(!0),F.draw_attribute_labels()),S(this).toggleClass("btn-active btn-default")}),[r.select(F.get_ui_element_selector_by_role("opacity"))].forEach(function(e){e.selectAll("li").remove();var t=e.selectAll("li").data([[["None",null,i.default.partial(F.handle_attribute_opacity,null)]]].concat(a.map(function(e,t){return[[e.label,e.raw_attribute_key,i.default.partial(F.handle_attribute_opacity,e.raw_attribute_key)]]})));t.enter().append("li").style("font-variant",function(e){return e[0][1]<-1?"small-caps":"normal"}),t.selectAll("a").data(function(e){return e}).enter().append("a").text(function(e,t,n){return e[0]}).attr("style",function(e,t,n){return 0===n?" font-weight: bold;":null}).attr("href","#").on("click",function(e){e[2]&&e[2].call()})})}},w){if("attribute_map"in w){var M=w.attribute_map;"map"in M&&M.map.length>0&&(le[v.network.GraphAttrbuteID]=M.map.map(function(e,t){return{label:e,type:null,values:{},index:t,range:0}}),le.Nodes.forEach(function(e){e[v.network.GraphAttrbuteID]=e.id.split(M.delimiter),e[v.network.GraphAttrbuteID].forEach(function(e,t){t<le[v.network.GraphAttrbuteID].length&&(e in le[v.network.GraphAttrbuteID][t].values||(le[v.network.GraphAttrbuteID][t].values[e]=le[v.network.GraphAttrbuteID][t].range,le[v.network.GraphAttrbuteID][t].range+=1))})}),le[v.network.GraphAttrbuteID].forEach(function(e){e.range<le.Nodes.length&&e.range>1&&e.range<=20&&(e.type="category")}))}for(var j=0,N=Object.entries(F._networkPredefinedAttributeTransforms);j<N.length;j++){var O=E(N[j],2),I=O[0],R=O[1];F.populate_predefined_attribute(R,I)}F._aux_populate_category_menus()}if(F.cluster_sizes.length>ue){var P=i.default.filter(i.default.map(F.cluster_sizes,function(e,t){return[e,t+1]}),function(e){return!i.default.isUndefined(e[0])});P=P.sort(function(e,t){return e[0]-t[0]});for(var L=0;L<P.length-ue;L++)F.exclude_cluster_ids[P[L][1]]=1;i.default.size(F.exclude_cluster_ids)&&(F.warning_string+=(F.warning_string.length?"<br>":"")+"Excluded "+(P.length-ue)+" clusters (maximum size "+P[L-1][0]+" nodes) because only "+ue+" objects can be shown at once.")}F.edges.forEach(function(e,t){F.clusters[F.cluster_mapping[F.nodes[e.target].cluster]].distances.push(e.length)}),F.clusters.forEach(function(e,t){e.distances=u.describe_vector(e.distances)}),y.check_network_option(T,"auto_expand_single_cluster",!1,!0)&&1==F.clusters.length&&(F.clusters[0].collapsed=!1),F.update()}(),T){if(i.default.isNumber(T.charge)&&(F.charge_correction=T.charge),"colorizer"in T&&(F.colorizer=T.colorizer),"node_shaper"in T&&(F.node_shaper=T.node_shaper),"callbacks"in T&&T.callbacks(F),i.default.isArray(T.expand)&&F.expand_some_clusters(i.default.filter(F.clusters,function(e){return T.expand.indexOf(e.cluster_id)>=0})),T["priority-sets-url"]){var ve=T["is-writeable"];F.load_priority_sets(T["priority-sets-url"],ve)}F.showing_diff&&F.handle_attribute_categorical("_newly_added")}return F.isPrimaryGraph&&F.annotate_multiple_clusters_on_nodes(),F._is_CDC_&&F.define_node_search_table(),F.draw_attribute_labels(),r.select(F.container).selectAll(".my_progress").style("display","none"),he.start(),F},N=n(8745),F=n(4358),O=n(4835),I=n(2033),z=n(8834),$=N.i},8745:function(e,t,n){var r=n(9050),i=n(3857),o=n(2033),a=i.format(",.2r"),s=i.format(",.3p");e.exports.i=function(e,t,n){var l=i.select(t).select("tbody");l.empty()&&(l=i.select(t).append("tbody"));var u=e.json,c=[];l.empty()||r.each(u["Network Summary"],function(e,t){n&&"Clusters"===t&&(e=r.size(u["Cluster description"])),r.isNumber(e)&&c.push([{cluster_sizes:"簇大小",genetic_distances_among_linked_nodes:"链接节点间的遗传距离",interquartile_range:"四分位距",links_per_node:"每节点的链接数",mean:"平均值",median:"中位数",range:"范围",edges:"边",nodes:"节点",clusters:"簇",sequences:"序列",individuals:"个体",sequences_used_to_make_links:"用于建立链接的序列数",singletons:"单节点",select_cluster:"选择簇",all_network:"总览",cluster_statistics:"簇统计"}[t.replace(/ /g,"_").toLowerCase()],e])});var d=[];r.each(u.Degrees.Distribution,function(e,t){for(var n=0;n<e;n++)d.push(t+1)}),d=o.describe_vector(d),c.push(["每节点的链接数",""]),c.push(["&nbsp;&nbsp;<i>平均值</i>",a(d.mean)]),c.push(["&nbsp;&nbsp;<i>中位数</i>",a(d.median)]),c.push(["&nbsp;&nbsp;<i>范围</i>",d.min+" - "+d.max]),c.push(["&nbsp;&nbsp;<i>四分位距</i>",d.Q1+" - "+d.Q3]),d=o.describe_vector(u["Cluster sizes"]),c.push(["簇大小",""]),c.push(["&nbsp;&nbsp;<i>平均值</i>",a(d.mean)]),c.push(["&nbsp;&nbsp;<i>中位数</i>",a(d.median)]),c.push(["&nbsp;&nbsp;<i>范围</i>",d.min+" - "+d.max]),c.push(["&nbsp;&nbsp;<i>四分位距</i>",d.Q1+" - "+d.Q3]),e.has_multiple_sequences&&(c.push(["Persons with >1 sequence",r.filter(e.primary_key_list,function(e,t){return e.length>1}).length]),c.push(["Persons in multiple clusters",r.size(e.entities_in_multiple_clusters)])),n||(d=o.describe_vector(r.map(u.Edges,function(e){return e.length})),c.push(["链接节点间的遗传距离",""]),c.push(["&nbsp;&nbsp;<i>平均值</i>",s(d.mean)]),c.push(["&nbsp;&nbsp;<i>中位数</i>",s(d.median)]),c.push(["&nbsp;&nbsp;<i>范围</i>",s(d.min)+" - "+s(d.max)]),c.push(["&nbsp;&nbsp;<i>四分位距</i>",s(d.Q1)+" - "+s(d.Q3)]));var f=l.selectAll("tr").data(c);f.enter().append("tr"),f.exit().remove();var p=f.selectAll("td").data(function(e){return e});p.enter().append("td"),p.exit(),p.html(function(e){return e})}},4835:function(e,t,n){var r=n(3857),i=n(9050),o=n(2033),a={};i.each(i.range(3,20),function(e){var t=2*Math.PI/e;a[e]=i.map(i.range(1,e),function(e){return[Math.cos(t*e),Math.sin(t*e)]})});var s=function(){var e=this;return e.ellipse=function(){return"M "+e.radius+" 0 A "+1*e.radius+" "+.75*e.radius+" 0 1 0 "+e.radius+" 0.00001"},e.ellipse.type=function(){return e.ellipse},e.ellipse.size=function(t){return i.isNumber(t)?(e.size=t,e.radius=Math.sqrt(1.25*t/Math.PI),e.ellipse):e.size},e.ellipse.size(64),e.ellipse};function l(){var e=this;return e.polygon=function(){var t=" M"+e.radius+" 0";if(e.sides in a)t+=a[e.sides].map(function(t){return" L"+e.radius*t[0]+" "+e.radius*t[1]}).join(" ");else for(var n=2*Math.PI/e.sides,r=0,i=0;i<e.sides-1;i++)r+=n,t+=" L"+e.radius*Math.cos(r)+" "+e.radius*Math.sin(r);return t+" Z"},e.polygon.sides=function(t){return i.isNumber(t)&&t>2?(e.sides=t,e.polygon):e.sides},e.polygon.type=function(){return e.polygon},e.polygon.size=function(t){return i.isNumber(t)?(e.size=t,e.radius=Math.sqrt(t/Math.PI),e.polygon):e.size},e.polygon.size(64),e.sides=6,e.polygon}e.exports={edge_typer:function(e,t,n){return t[e.length<=n?0:1]},coi_timeseries:function(e,t,n){var o=r.time.format("%Y-%m-%d"),a=i.sortBy(i.map(e.node_info,function(e){return[e[0],o.parse(e[1])]}),function(e){return e[1]}),s=Math.ceil(15*(a.length+.1))+30+10,l=i.map(e.event_info,function(e,t){return[t,o.parse(t)]}),u=r.extent(i.map(a,function(e){return e[1]}).concat(i.map(l,function(e){return e[1]})));n=n||1e3;var c=r.time.scale().domain(u).rangeRound([120,n-60]),d=r.scale.ordinal().domain(r.range(a.length+1)).rangeRoundPoints([30,s-10],.1),f=r.svg.axis().scale(c).orient("top").ticks(n/80).tickFormat(r.time.format("%m/%y"));t.selectAll("svg").remove();var p=t.append("svg").attr("width",n).attr("height",s).attr("viewBox",[0,0,n,s]);p.append("g").attr("transform","translate(0,18)").attr("class","y time_axis").call(f).call(function(e){return e.select(".domain").remove()}),p.append("g").attr("stroke","#ddd").attr("stroke-width",2).attr("opacity",.8).selectAll("line").data(l).enter().append("line").attr("x1",function(e){return c(e[1])}).attr("x2",function(e){return c(e[1])}).attr("y1",function(e,t){return d(0)}).attr("y2",function(e,t){return d(a.length)});var h=p.append("g").selectAll("line").data(a).enter().append("line").attr("stroke","#aaa").attr("stroke-width",2).attr("x1",function(e){return c(u[1])}).attr("x2",function(e){return c(e[1])}).attr("y1",function(e,t){return d(t)}).attr("y2",function(e,t){return d(t)}),g=[null,null],m=new Set,v=a.concat([["Nat'l priority",u[0]]]),y=p.append("g").attr("font-family","sans-serif").attr("font-size",10).attr("font-weight",700).selectAll("text").data(v).enter().append("text").attr("text-anchor","end").attr("x",function(e){return c(e[1])}).attr("y",function(e,t){return d(t)+d.rangeBand()/2}).attr("dy","0.35em").attr("dx","-0.25em").attr("fill","black").text(function(e){return e[0]});p.append("g").selectAll("circle").data(a).enter().append("circle").attr("fill","black").attr("stroke","black").attr("cx",function(e){return c(e[1])}).attr("cy",function(e,t){return d(t)}).attr("r",1),p.append("g").selectAll("circle").data(l).enter().append("circle").attr("fill",function(t,n){return i.some(e.event_info[t[0]].national_priority)?"firebrick":"steelblue"}).attr("stroke","black").attr("cx",function(e){return c(e[1])}).attr("cy",function(e,t){return d(a.length)}).attr("r",function(t){return 2+Math.sqrt(r.sum(e.event_info[t[0]].connected_componets))}).on("mouseover",function(t,n){var r=e.event_info[t[0]];i.each(r.national_priority,function(e,t){e&&i.each(r.priority_nodes[t],function(e){return m.add(e)})});var o=i.map([1,3],function(e){var n=new Date(t[1]);return n.setFullYear(t[1].getFullYear()-e),n<u[0]&&(n=u[0]),n}),s=["firebrick","grey"];g=i.map(o,function(e,n){return p.append("g").selectAll("rect").data([t]).enter().append("rect").attr("fill",s[n]).attr("x",function(t){return c(e)}).attr("y",function(e){return d(0)}).attr("width",c(t[1])-c(e)).attr("height",function(e){return-d(0)+d(a.length-1)}).attr("opacity",.25)}),h.attr("stroke-width",function(e){return m.has(e[0])?5:2}).attr("stroke",function(e){return m.has(e[0])?"black":"#aaa"}),y.attr("fill",function(e){return m.has(e[0])?"firebrick":"black"})}).on("mouseout",function(e,t){h.attr("stroke-width",2).attr("stroke","#aaa"),y.attr("fill","black"),m=new Set,i.each(g,function(e){return e?e.remove():0}),g=[null,null]}).append("title").text(function(t){var n=e.event_info[t[0]],o=t[0]+". ";return i.some(n.national_priority)&&(o+="National priority clusterOI. "),o+=String(r.sum(n.connected_componets))+" nodes in "+n.connected_componets.length+" components. ",o+="A total of "+r.sum(n.priority_nodes,function(e){return e.length})+" nodes dx'ed in the previous 12 months; maximum of "+r.max(n.priority_nodes,function(e){return e.length})+" in a subcluster",o})},compute_node_degrees:function(e){var t=e.Nodes,n=e.Edges;for(var r in t)t[r].degree=0;for(var i in n)t[n[i].source].degree++,t[n[i].target].degree++},export_table_to_text:function(e,t,n,i){var a=r.select(e);return a.selectAll("[data-type='download-button']").remove(),(a=a.append("a").attr("target","_blank").attr("data-type","download-button").on("click",function(e,t){r.event.preventDefault();var a=r.select(this).attr("data-table"),s=o.table_to_text(a,n?",":"\t");i=i||a.substring(1),n?o.export_handler(s,i+".csv","text/comma-separated-values"):o.export_handler(s,i+".tsv","text/tab-separated-values")}).attr("data-table",t)).append("i").classed("fa fa-download fa-2x",!0),a},symbol:function(e){switch(e){case"circle":case"cross":case"diamond":case"square":case"triangle-down":case"triangle-up":return r.svg.symbol().type(e);case"triangle":return(new l).sides(3);case"pentagon":return(new l).sides(5);case"hexagon":return(new l).sides(6);case"septagon":return(new l).sides(7);case"octagon":return(new l).sides(8);case"ellipse":return new s;default:return r.svg.symbol().type("circle")}},cluster_dynamics:function(e,t,n,o,a,s,l){if(l=l||{base_line:20,top:40,right:30,bottom:60,left:100,font_size:18,rect_size:22,width:1024,height:600},0!==(e=i.filter(e,function(e){return i.isDate(e.time)})).length){var u,c=l&&l.barchart,d=l&&l.skip_cumulative||c,f=l.width-l.left-l.right,p=l.height-l.top-l.bottom;s||(s=function(e){var t=e.getFullYear(),n=new Date,r=new Date;n.setDate(1),n.setFullYear(t),r.setFullYear(t);var i=Math.floor(e.getMonth()/3);return n.setMonth(3*i),n.setHours(0,0,0),r.setHours(0,0,0),n.setFullYear(t),r.setMonth(3*i+1),r.setDate(15),["Q"+(i+1)+" "+t,n,r]},u=new Date(2018,3,0)-new Date(2018,0,0));var h=function(e){var t=e.getFullYear(),n=Math.floor(e.getMonth()/3)+1;return String(t)+"-Q"+n};l&&l["x-tick-format"]&&(h=l["x-tick-format"]);var g=r.time.scale().range([0,f]),m=a||r.scale.linear();a?m.range([p,0]):m.rangeRound([p,0]);var v=r.svg.axis().scale(g).orient("bottom").ticks(r.time.month,3).tickFormat(r.time.format("%m/%Y"));h&&v.tickFormat(h);var y=r.svg.axis().scale(m).orient("left").tickFormat(function(e){return(0|e)===e?e:null}),_={},b={},w="total",x=l&&l.prefix?l.prefix:"",k=0;i.each(e,function(e,t){var n=s(e.time);n[0]in _||(_[n[0]]={time:n[1],x:n[2]},_[n[0]][w]=0,i.each(e,function(e,t){"time"!==t&&(_[n[0]][t]={})})),_[n[0]][w]+=1,k=Math.max(k,_[n[0]][w]);var r={};r[w]=t+1,i.each(e,function(e,t){"time"!==t&&(_[n[0]][t][e]=_[n[0]][t][e]?_[n[0]][t][e]+1:1,t in b||(b[t]={}),e in b[t]?b[t][e]++:b[t][e]=1,k=Math.max(k,_[n[0]][t][e]),r[t]=i.clone(b[t]))}),e.y=r,e._bin=n[1]});var C=[];i.each(_,function(e,t){e.id=t,C.push(e)}),C.sort(function(e,t){return t.time-e.time}),c&&(i.isUndefined(u)&&i.each(C,function(e,t){t>0&&(u=Math.min(u,-(e.time-C[t-1].time)))}),u*=.8);var D=r.min(e,function(e){return e.time<e._bin?e.time:e._bin}),S=r.max(e,function(e){return e.time>e._bin?e.time:e._bin});if(c){var A=new Date;A.setTime(S.getTime()+u),S=A,(A=new Date).setTime(D.getTime()-u),D=A}var E=Math.floor((S-D)/3600/24/1e3/30);E>8&&v.ticks(r.time.month,3*Math.ceil(E/8)),g.domain([D,S]).clamp(!0),m.domain([0,Math.round(d?k+1:1.2*e.length)]).clamp(!0),t.selectAll("*").remove();var M=t.append("g").attr("transform","translate("+l.left+","+l.top+")"),T=t.append("g").attr("transform","translate("+(l.left+2.5*l.font_size)+","+(l.top+l.font_size)+")"),j=i.keys(b)[0],N="colorizer"in l&&l.colorizer&&j in l.colorizer?l.colorizer[j]:r.scale.category10();N=i.wrap(N,function(e,t){return t===w?"#555555":e(t)});var F=i.keys(b[j]);if(c?0===F.length&&F.push(w):F.push(w),F.sort(),l&&l.drag){var O=r.behavior.drag();O.on("drag",function(){l.drag.x+=r.event.dx,l.drag.y+=r.event.dy,r.select(this).attr("transform","translate("+l.drag.x+","+l.drag.y+")")}),t.call(O)}if(!c||F.length>1||F[0]!==w){var I=T.selectAll("g").data(F);I.enter().append("g").attr("class","annotation-text"),I.selectAll("text").data(function(e){return[e]}).enter().append("text").attr("transform",function(e,t,n){return"translate("+l.rect_size+","+(l.rect_size*(F.length-1-n)-(l.rect_size-l.font_size))+")"}).attr("dx","0.2em").style("font-size",l.font_size).text(function(e){return e}).on("mouseover",function(e){q(x+e,!0)}).on("mouseout",function(e){q(x+e,!1)}),I.selectAll("rect").data(function(e){return[e]}).enter().append("rect").attr("x",0).attr("y",function(e,t,n){return l.rect_size*(F.length-2-n)}).attr("width",l.rect_size).attr("height",l.rect_size).attr("class","area").style("fill",function(e,t,n){return N(e)}).on("mouseover",function(e){q(x+e,!0)}).on("mouseout",function(e){q(x+e,!1)})}var z=i.clone(e[e.length-1]);z.time=g.domain()[1],e.push(z),i.each(F,function(t,n){var i=N(t),o=function(e){return j&&t in e[j]?e[j][t]:t in e?e[t]:0};if(!d){var a=r.svg.area().x(function(e){return g(e.time)}).y1(function(e){return m(function(e){return t in e.y?e.y[t]:j in e.y&&t in e.y[j]?e.y[j][t]:0}(e))}).y0(function(e){return m(0)}).interpolate("step");M.append("path").datum(e).classed("trend",!0).style("fill",i).style("stroke",i).attr("d",a).attr("data-plotid",x+t)}if(c)C.forEach(function(e){var n=new Date;n.setTime(e.time.getTime()-.5*u);var a=new Date;a.setTime(e.time.getTime()+.5*u);var s=g(n),l=g(a)-g(n),c="last_y"in e?e.last_y:0,d=o(e);M.append("rect").attr("x",s).attr("y",m(c+d)).attr("height",m(0)-m(d)).attr("width",l).attr("data-plotid",x+t).classed("tracer",!0).style("fill",i).style("stroke",r.rgb(i).darker(2)).style("fill-opacity",1).append("title").text(t+" "+d+" cases in "+(h?h(e.time):e.time)),e.last_y=(e.last_y?e.last_y:0)+d});else{C.forEach(function(e){M.append("circle").attr("cx",g(e.time)).attr("cy",m(o(e))).attr("r","5").classed("node",!0).style("fill",i).style("stroke",i).attr("title",t+" : "+o(e))});var s=r.svg.line().x(function(e){return g(e.time)}).y(function(e){return m(o(e))}).interpolate("cardinal");M.append("path").datum(C).classed("tracer",!0).style("stroke",i).attr("d",s).attr("data-curveid",x+t)}});var $=M.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").style("font-size",l.font_size).call(v);$.selectAll("text").attr("transform","rotate(-45)").attr("dy","0.9em").attr("dx","-1.75em"),$.append("text").attr("x",f/2).attr("dy","3.5em").style("text-anchor","middle").style("font-size",1.5*l.font_size).text(n),M.append("g").attr("class","y axis").style("font-size",l.font_size).call(y).append("text").style("font-size",1.5*l.font_size).attr("transform","rotate(-90)").attr("y",6).attr("dy","-2em").style("text-anchor","end").text(o)}function q(e,t){c?r.selectAll('[data-plotid="'+e+'"]').style("stroke-width",t?4:1):r.selectAll('[data-plotid="'+e+'"]').style("fill-opacity",t?.5:.1),r.selectAll('[data-curveid="'+e+'"]').style("stroke-width",t?3:1)}},hivtrace_cluster_depthwise_traversal:function(e,t,n,r,o,a,s){var l=[],u={},c={};if(o=o||e,s){for(var d=e.length;d--;)e[d].visited=!1;u=s}else{for(d=e.length;d--;)e[d].visited=!1,u[e[d].id]=[];n&&(t=i.filter(t,n)),a&&(t=i.filter(t,function(t){return a.has(e[t.source].id)&&a.has(e[t.target].id)})),i.each(t,function(t){try{u[e[t.source].id].push([e[t.target],t]),u[e[t.target].id].push([e[t.source],t])}catch(e){throw Error("Edge does not map to an existing node "+t.source+" to "+t.target)}})}var f=function(e){e.id in c||(l.push([e]),c[e.id]=l.length-1,r&&r.push([])),e.visited=!0;for(var t=u[e.id]?u[e.id].length:0;t--;){var n=u[e.id][t];n[0].visited||(c[n[0].id]=c[e.id],l[c[n[0].id]].push(n[0]),r&&r[c[n[0].id]].push(n[1]),f(n[0]))}};return i.each(o,function(e){e.visited||f(e)}),l},random_id:function(e,t){e=e||["a","b","c","d","e","f","g"],t=t||32;for(var n="",r=0;r<t;r++)n+=i.sample(e);return n},get_ui_element_selector_by_role:function(e){return" [data-hivtrace-ui-role='".concat(e,"']")},hivtrace_cluster_complete_clusters:function(e,t,n){var r=[],o={},a={};i.each(e,function(e){e.visited=!1,o[e.id]=[]}),n&&(t=i.filter(t,n)),i.each(t,function(t){try{o[e[t.source].id].push([e[t.target],t]),o[e[t.target].id].push([e[t.source],t])}catch(e){throw Error("Edge does not map to an existing node "+t.source+" to "+t.target)}});var s=function(e){e.id in a||(r.push([e]),a[e.id]=r.length-1),e.visited=!0,i.each(o[e.id],function(t){t[0].visited||(i.every(r[a[e.id]]),function(e){i.find(o[e.id],function(e){return e[0]==t[0].id})}?(a[t[0].id]=a[e.id],r[a[t[0].id]].push(t[0]),s(t[0])):s(t[0]))})};return i.each(e,function(e){e.visited||s(e)}),r},hivtrace_compute_adjacency:function(e,t,n){var r={};return i.each(t,function(t){if(!n||n(t)){var i=e[t.source],o=e[t.target];i.id in r||(r[i.id]=new Set),r[i.id].add(o.id),o.id in r||(r[o.id]=new Set),r[o.id].add(i.id)}}),r},hivtrace_compute_adjacency_with_edges:function(e,t,n){var r={};return i.each(t,function(t){if(!n||n(t)){var i=e[t.source],o=e[t.target];i.id in r||(r[i.id]=[]),r[i.id].push([o,t]),o.id in r||(r[o.id]=[]),r[o.id].push([i,t])}}),r},format_value:function(e,t){return null==e||isNaN(e)?"N/A":t?t(e):String(e)}}},4257:function(e,t,n){function r(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var o=n(3857),a=n(9050),s=n(6822),l=n(6221);e.exports={check_network_option:function(e,t,n,r){return e&&t in e?void 0===r?e[t]:r:n},ensure_node_attributes_exist:function(e){var t=new Set(["attributes",l.network.NodeAttributeID]);e.Nodes.forEach(function(e){var n,i=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=r(e))){t&&(e=t);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;e[o]||(e[o]=[])}}catch(e){i.e(e)}finally{i.f()}})},normalize_node_attributes:function(e){var t=a.object(a.map(e[l.network.GraphAttrbuteID],function(e,t){return[e.label,t]}));a.each(e.Nodes,function(n){if(l.network.NodeAttributeID in n){var i={};null!==n[l.network.NodeAttributeID]&&(i=Object.fromEntries(Object.entries(n[l.network.NodeAttributeID]).map(function(e){var t,n,i=(n=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(t,n)||r(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=i[0],a=i[1];return[o.toLowerCase(),a]})));var o=a.difference(a.keys(i),a.keys(e[l.network.GraphAttrbuteID]));o.length&&a.each(o,function(e){a.contains(a.keys(t),e)&&(i[t[e]]=i[e],delete i[e])}),n[l.network.NodeAttributeID]=i}})},unpack_compact_json:function(e){a.each(["Nodes","Edges"],function(t){var n=a.keys(e[t]),r=[];a.each(n,function(n,i){var o=e[t][n];if(!a.isArray(o)&&"values"in o){var s=[];a.each(o.values,function(e){s.push(o.keys[e])}),o=s}a.each(o,function(e,t){0===i&&r.push({}),r[t][n]=e})}),e[t]=r})},handle_cluster_click:function e(t,n,r){var i=o.select(t.container),l="d3_context_menu_id",u=i.select("#"+l);u.empty()&&(u=i.append("ul").attr("id",l).attr("class","dropdown-menu").attr("role","menu")),u.selectAll("li").remove();var c=n&&n.fixed;n?(u.append("li").append("a").attr("tabindex","-1").text("展开簇").on("click",function(e){n.fixed=0,t.expand_cluster_handler(n,!0),u.style("display","none")}),u.append("li").append("a").attr("tabindex","-1").text("居中显示").on("click",function(e){n.fixed=0,function(e,t){t.x=e.width/2,t.y=e.height/2,e.update(!1,.4)}(t,n),u.style("display","none")}),u.append("li").append("a").attr("tabindex","-1").text(function(e){return n.fixed?"允许簇浮动":"固定簇位置"}).on("click",function(e){n.fixed=!n.fixed,u.style("display","none")}),t.isPrimaryGraph&&u.append("li").append("a").attr("tabindex","-1").text(function(e){return"在单独标签页显示此簇"}).on("click",function(e){t.open_exclusive_tab_view(n.cluster_id,null,null,a.extend(t._distance_gate_options(),{"simplified-mspp":1})),u.style("display","none")}),s.get_editor()&&u.append("li").append("a").attr("tabindex","-1").text(function(e){return"将此簇添加到关注簇"}).on("click",function(e){s.get_editor().append_nodes(a.map(n.children,function(e){return t.entity_id(e)}))}),t.customContextMenuItems&&Array.isArray(t.customContextMenuItems)&&t.customContextMenuItems.length>0&&(u.append("li").attr("class","divider"),t.customContextMenuItems.forEach(function(e){var r=u.append("li");e.disabled&&r.attr("class","disabled");var i=r.append("a").attr("tabindex","-1").style("cursor",e.disabled?"not-allowed":"pointer");e.icon&&i.append("i").attr("class","fa "+e.icon).style("margin-right","6px"),i.append("span").text(e.label),e.disabled||i.on("click",function(){var r={cluster_id:n.cluster_id,node_count:n.children?n.children.length:0,cluster_size:n.cluster_size,nodes:n.children,x:n.x,y:n.y,expanded:n.expanded,fixed:n.fixed};t.onCustomMenuItemClick&&"function"==typeof t.onCustomMenuItemClick&&t.onCustomMenuItemClick(e.id,r),u.style("display","none")})})),u.style("position","absolute").style("left",String(o.event.offsetX)+"px").style("top",String(o.event.offsetY)+"px").style("display","block")):(r&&(r.fixed=0),u.style("display","none")),i.on("click",function(r){e(t,null,c?null:n)},!0)}}},7568:function(e){var t;e.exports={init:function(e){t=e},getNodeTable:function(){return t}}},8033:function(e,t,n){var r=n(3857);e.exports.M=function(e,t,n,i,o,a){var s=r.format(",.2r"),l=r.time.format("%B %Y"),u=t-100-10,c=n-10-100,d=(a?r.time.scale():r.scale.linear()).domain(r.extent(e,function(e){return e.x})).range([0,u]),f=(a?r.time.scale():r.scale.linear()).domain(r.extent(e,function(e){return e.y})).range([c,0]),p=r.svg.axis().scale(d).orient("bottom").tickFormat(a?l:s),h=r.svg.axis().scale(f).orient("left").tickFormat(a?l:s),g=r.select(i).selectAll("svg");g.empty()||g.remove(),(e=(g=r.select(i).append("svg").attr("width",t).attr("height",n).append("g").attr("transform","translate(100,10)")).selectAll("circle").data(e)).enter().append("circle"),e.attr("cx",function(e){return d(e.x)}).attr("cy",function(e){return f(e.y)}).attr("r",3).classed("node scatter",!0),e.each(function(e){"title"in e&&r.select(this).append("title").text(e.title)});var m=g.append("g").attr("class","x axis").attr("transform","translate(0,"+c+")").call(p);m.selectAll("text").attr("transform","rotate(-45)").attr("dx","-.5em").attr("dy",".25em").style("text-anchor","end"),m.append("text").text(o.x).attr("transform","translate("+u+",0)").attr("dy","-1em").attr("text-anchor","end");var v=g.append("g").attr("class","y axis").attr("transform","translate(0,0)").call(h);v.selectAll("text").attr("transform","rotate(-45)").attr("dx","-.5em").attr("dy",".25em").style("text-anchor","end"),v.append("text").text(o.y).attr("transform","rotate(-90)").attr("dy","1em").attr("text-anchor","end")}},905:function(e,t,n){var r=n(9983),i=n(3857),o=n(9050),a=n(4835),s=n(4861),l=n(7568),u=n(6221),c="hivtrace_node_id";function d(e){return o.isFunction(e.value)?e.value():e.value}function f(e,t,n,s){var u=i.select(n),f=d(e),p=u;if(p.selectAll("*").remove(),"callback"in e)p=e.callback(n,f);else{var g="format"in e?e.format(f):f;"html"in e&&e.html?u.html(g):u.text(g)}if("filter"in e){if(e.filter_term="",e.column_id=t,e.value===c&&s){var v=p.append("a").property("href","#");v.append("i").classed("fa fa-plus-square fa-lg",!0).style("margin-left","0.2em").attr("title","Add currently visible nodes to the Cluster of Interest"),v.on("click",function(t){var n=[];l.getNodeTable().selectAll("tr").each(function(t,r){var o=i.select(this);"none"!==o.style("display")&&o.selectAll("td").each(function(t,r){if(r===e.column_id){var i=t.value.indexOf("[+]");i>0?n.push(t.value.substring(0,i)):n.push(t.value)}})}),s.append_nodes(n)})}if(e.filter){var y=p.append("a").property("href","#");y.append("i").classed("fa fa-search",!0).style("margin-left","0.2em"),r(y.node()).popover({html:!0,sanitize:!1,content:function(){return'<form class="form-inline" data-hivtrace-ui-role = "table-filter-form"> \n <div class="form-group"> \n <div class="input-group">\n <input type="text" class="form-control input-sm" data-hivtrace-ui-role = "table-filter-term" placeholder="Filter On" style = "min-width: 100px">\n <div class="input-group-addon"><a data-hivtrace-ui-role = "table-filter-reset"><i class="fa fa-times-circle"></i></a> </div>\n <div class="input-group-addon"><a data-hivtrace-ui-role = "table-filter-apply"><i class="fa fa-filter"></i></a> </div> \n <div class="input-group-addon">\n <i class="fa fa-question" data-toggle="collapse" data-target="#filter-help-column\' +\n index +\n \'" aria-expanded="false" aria-controls="collapseExample"></i>\n </div> \n </div>\n </div>\n </form>\n <div class="collapse" id="filter-help-column\' +\n index +\n \'">\n <div class="well">\n Type in text to select columns which \n <em>contain the term</em>. <br />\n For example, typing in <code>MSM</code> will select rows\n that have "MSM" as a part of the column value.\n <p />\n Type in space separated terms (<code>MSM IDU</code>) to\n search for <b>either</b> term. <p/>\n Type in terms in quotes (<code>"male"</code>) to search\n for this <b>exact</b> term. <p/>\n If columns have date information you can use\n <code>YYYYMMDD:YYYYMMDD</code> to search for date ranges.<p/>\n Use <code>&lt;value</code> or <code>&gt;value</code>\n to search numerical columns<p/>\n </div>\n </div>\n '},placement:"bottom"}).on("shown.bs.popover",function(t){var n=i.select(this),o=function(t){e.filter_term=t,n.selectAll("i").classed("fa-search",!t.length).classed("fa-search-plus",t.length)},s=i.select("#"+i.select(this).attr("aria-describedby")),l=s.selectAll(a.get_ui_element_selector_by_role("table-filter-apply")),u=s.selectAll(a.get_ui_element_selector_by_role("table-filter-reset")),c=s.selectAll(a.get_ui_element_selector_by_role("table-filter-term"));c.property("value",e.filter_term),r(a.get_ui_element_selector_by_role("table-filter-term")).on("keydown",function(e){"Enter"==e.key&&(o(c.property("value")),h(y.node()),e.preventDefault())}),l.on("click",function(e){o(c.property("value")),h(y.node())}),u.on("click",function(e){c.property("value",""),o(""),h(y.node())})})}}if(p&&"sort"in e&&((y=p.append("a").property("href","#").on("click",function(e){m(this,e)}).attr("data-sorted","unsorted").attr("data-column-id",t)).append("i").classed("fa fa-sort",!0).style("margin-left","0.2em"),"presort"in e&&("desc"===e.presort&&y.attr("data-sorted","asc"),m(y.node(),e))),"actions"in e){var _=e.actions;o.isArray(e.actions)&&o.isArray(e.actions[0])||(_=[e.actions]),o.each(_,function(e){var t=p.append("div").classed("btn-group btn-group-xs",!0).attr("style","padding-left:0.5em");o.each(o.isFunction(e)?e(t,f):e,function(e){if(o.isFunction(e)&&(e=e(t,f)),e){var n=null;if(o.isArray(e.dropdown)){var r=t.append("div").classed("btn-group btn-group-xs",!0);n=r.append("button").classed("btn btn-default btn-xs dropdown-toggle",!0).attr("data-toggle","dropdown");var a=r.append("ul").classed("dropdown-menu",!0),s=e.dropdown;function l(e){return o.has(e,"label")?e.label:e}(a=a.selectAll("li").data(s)).enter().append("li"),a.each(function(t,r){var a=i.select(this).append("a").attr("href","#").text(function(e){return l(e)});o.has(t,"data")&&t.data&&o.each(t.data,function(e,t){a.attr("data-"+t,e)}),a.on("click",function(t){o.has(t,"action")&&t.action?t.action(n,t.label):e.action&&e.action(n,l(t))})})}else n=t.append("button").classed("btn btn-default btn-xs",!0),e.action&&n.on("click",function(t){i.event.preventDefault(),e.action(n,f)});e.icon?n.append("i").classed("fa "+e.icon,!0):n.text(e.text).style("font-size","12px"),e.data&&o.each(e.data,function(e,t){n.attr("data-"+t,e)}),e.classed&&o.each(e.classed,function(e,t){n.classed(t,e)}),e.help&&n.attr("title",e.help)}})})}"help"in e&&u.attr("title",e.help)}function p(e,t){return!t.length||o.some(t,function(t){return"re"===t.type?t.value.test(e):"date"===t.type?e>=t.value[0]&&e<=t.value[1]:"distance"===t.type&&(t.greater_than?e>t.value:e<=t.value)})}function h(e){i.event&&i.event.preventDefault();var t=r(e).closest("table");if(t.length){var n=[],s=[];i.select(t[0]).selectAll("thead th").each(function(e,t){e.filter&&(o.isString(e.filter_term)&&e.filter_term.length?(n[e.column_id]=g(e.filter_term),s[e.column_id]=o.isFunction(e.filter)?e.filter:p):(n[e.column_id]=null,s[e.column_id]=null))});var l=0;i.select(t[0]).select("tbody").selectAll("tr").each(function(e,t){var r=i.select(this),o=!1;r.selectAll("td").each(function(e,t){o||n[t]&&(s[t](d(e),n[t])||(o=!0))}),o?r.style("display","none"):(l+=1,r.style("display",null))}),i.select(t[0]).select("caption").select(a.get_ui_element_selector_by_role("table-count-shown")).text(l)}}function g(e){var t=[],n=0,r=[];return o.each(e,function(e){" "===e?0===n?r.length&&(t.push(r.join("")),r=[]):r.push(e):('"'===e&&(n=1-n),r.push(e))}),0===n&&t.push(r.join("")),t.filter(function(e){return e.length>0}).map(function(e){if(e.length>=2){if('"'===e[0]&&'"'===e[e.length-1]&&e.length>2)return{type:"re",value:new RegExp("^"+e.substr(1,e.length-2)+"$","i")};if("<"===e[0]||">"===e[0]){var t=parseFloat(e.substr(1));if(t>0)return{type:"distance",greater_than:">"===e[0],value:t}}if(s.getClusterTimeScale()){var n=s._networkTimeQuery.exec(e);if(n)return{type:"date",value:o.map([n[1],n[2]],function(e){return new Date(e.substring(0,4)+"-"+e.substring(4,6)+"-"+e.substring(6,8))})}}}return{type:"re",value:new RegExp(e,"i")}})}function m(e,t){i.event&&i.event.preventDefault();var n=r(e).closest("table");if(n.length){var a,s=parseInt(r(e).data("column-id")),l=t.sort,u=v(e);a=l?o.isFunction(l)?function(e){return l(e)}:function(e){var t=e[l];return o.isFunction(t)?t():t}:function(e){return e},i.select(n[0]).select("tbody").selectAll("tr").sort(function(e,t){return u(a(e[s]),a(t[s]))}),r(n).find("thead [data-column-id]").filter(function(){return parseInt(r(this).data("column-id"))!==s}).each(function(){v(this,"unsorted")})}}function v(e,t){if(!t){var n=r(e).data("sorted");return v(e,"asc"===n?"desc":"asc"),"asc"===n?i.descending:i.ascending}r(e).data("sorted",t),i.select(e).selectAll("i").classed("fa-sort-amount-desc","desc"===t).classed("fa-sort-amount-asc","asc"===t).classed("fa-sort","unsorted"===t)}e.exports={_networkNodeIDField:c,_networkNewNodeMarker:"[+]",add_a_sortable_table:function(e,t,n,r,o,s,l){if(e&&e.node()){e.style("display","none");var c=e.selectAll("thead"),d=e.selectAll("tbody"),p=function(e,t){(e.width||e.text_wrap)&&(t=i.select(t),e.width&&t.style("width",String(e.width)+"px"),e.text_wrap&&t.style("overflow","hidden").style("white-space","nowrap").style("text-overflow","ellipsis"))};if((d.empty()||r)&&(d.remove(),(d=i.select(document.createElement("tbody"))).selectAll("tr").data(n).enter().append("tr").selectAll("td").data(function(e){return e}).enter().append("td").call(function(e){return e.each(function(e,t){p(e,this),f(e,t,this,s)})}),e.node().appendChild(d.node())),(c.empty()||r)&&(c.remove(),(c=e.insert("thead",":first-child")).selectAll("tr").data(t).enter().append("tr").selectAll("th").data(function(e){return e}).enter().append("th").call(function(e){return e.each(function(e,t){p(e,this),f(e,t,this,l&&l>n.length||n.length>u.CoIAddLimit?null:s)})})),o){var h=e.selectAll("caption").data([o]);h.enter().insert("caption",":first-child"),h.html(function(e){return e}),h.select(a.get_ui_element_selector_by_role("table-count-total")).text(n.length),h.select(a.get_ui_element_selector_by_role("table-count-shown")).text(n.length),l&&l>n.length&&h.select(a.get_ui_element_selector_by_role("table-count-warning")).style("color","black").text("Truncated due to the large number of rows ("+l+")")}e.style("display",null)}},format_a_cell:f,sort_table_by_column:m,sort_table_toggle_icon:v,filter_parse:g}},4861:function(e,t,n){var r,i=n(3857),o="hiv_aids_dx_dt",a=i.time.format.utc("%m/%d/%Y"),s=i.time.format("%m%d%Y"),l=i.time.format("%B %Y"),u=i.time.format("%b %d, %Y"),c=[i.time.format.iso,i.time.format("%Y%m%d")],d=i.time.format("%Y-%m-%d"),f=i.time.format("%Y/%m/%d"),p=(new Date).getFullYear(),h=i.time.format("%Y%m");e.exports={hivtrace_date_or_na_if_missing:function(e,t){if(e){t=t||a;try{return t(e)}catch(t){console.log(e)}}return"N/A"},_networkCDCDateField:o,_networkTimeQuery:/([0-9]{8}):([0-9]{8})/i,getClusterTimeScale:function(){return r},getCurrentDate:function(){return new Date},getAncientDate:function(){return new Date(1900,0,1)},DateFormats:c,DateUpperBoundYear:p,DateViewFormat:u,DateViewFormatExport:a,DateViewFormatClusterCreate:h,DateViewFormatMMDDYYY:s,DateViewFormatShort:l,DateViewFormatSlider:d,DateViewNodeSearch:f,n_months_ago:function(e,t){var n=new Date(e),r=n.getMonth(),i=Math.floor(t/12),o=t-12*i;return o>r?(n.setFullYear(n.getFullYear()-i-1),n.setMonth(12-(o-r))):(n.setFullYear(n.getFullYear()-i),n.setMonth(r-o)),n.setDate(n.getDate()+1),n.setUTCHours(0,0,0),n},init:function(e,t){r=null==e?void 0:e["cluster-time"],t&&!r&&(r=o)}}},4728:function(e,t,n){var r,i,o;i=[n(9983)],r=function(e,t){function n(){return new Date(Date.UTC.apply(Date,arguments))}function r(){var e=new Date;return n(e.getFullYear(),e.getMonth(),e.getDate())}function i(e,t){return e.getUTCFullYear()===t.getUTCFullYear()&&e.getUTCMonth()===t.getUTCMonth()&&e.getUTCDate()===t.getUTCDate()}function o(n,r){return function(){return r!==t&&e.fn.datepicker.deprecated(r),this[n].apply(this,arguments)}}var a,s=(a={get:function(e){return this.slice(e)[0]},contains:function(e){for(var t=e&&e.valueOf(),n=0,r=this.length;n<r;n++)if(0<=this[n].valueOf()-t&&this[n].valueOf()-t<864e5)return n;return-1},remove:function(e){this.splice(e,1)},replace:function(e){e&&(Array.isArray(e)||(e=[e]),this.clear(),this.push.apply(this,e))},clear:function(){this.length=0},copy:function(){var e=new s;return e.replace(this),e}},function(){var t=[];return t.push.apply(t,arguments),e.extend(t,a),t}),l=function(t,n){e.data(t,"datepicker",this),this._events=[],this._secondaryEvents=[],this._process_options(n),this.dates=new s,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=e(t),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn"),this.component&&0===this.component.length&&(this.component=!1),null===this.o.isInline?this.isInline=!this.component&&!this.isInput:this.isInline=this.o.isInline,this.picker=e(g.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(e,t){return Number(t)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};l.prototype={constructor:l,_resolveViewName:function(t){return e.each(g.viewModes,function(n,r){if(t===n||-1!==e.inArray(t,r.names))return t=n,!1}),t},_resolveDaysOfWeek:function(t){return Array.isArray(t)||(t=t.split(/[,\s]*/)),e.map(t,Number)},_check_template:function(n){try{return n!==t&&""!==n&&((n.match(/[<>]/g)||[]).length<=0||e(n).length>0)}catch(e){return!1}},_process_options:function(t){this._o=e.extend({},this._o,t);var i=this.o=e.extend({},this._o),o=i.language;h[o]||(o=o.split("-")[0],h[o]||(o=f.language)),i.language=o,i.startView=this._resolveViewName(i.startView),i.minViewMode=this._resolveViewName(i.minViewMode),i.maxViewMode=this._resolveViewName(i.maxViewMode),i.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,i.startView)),!0!==i.multidate&&(i.multidate=Number(i.multidate)||!1,!1!==i.multidate&&(i.multidate=Math.max(0,i.multidate))),i.multidateSeparator=String(i.multidateSeparator),i.weekStart%=7,i.weekEnd=(i.weekStart+6)%7;var a=g.parseFormat(i.format);i.startDate!==-1/0&&(i.startDate?i.startDate instanceof Date?i.startDate=this._local_to_utc(this._zero_time(i.startDate)):i.startDate=g.parseDate(i.startDate,a,i.language,i.assumeNearbyYear):i.startDate=-1/0),i.endDate!==1/0&&(i.endDate?i.endDate instanceof Date?i.endDate=this._local_to_utc(this._zero_time(i.endDate)):i.endDate=g.parseDate(i.endDate,a,i.language,i.assumeNearbyYear):i.endDate=1/0),i.daysOfWeekDisabled=this._resolveDaysOfWeek(i.daysOfWeekDisabled||[]),i.daysOfWeekHighlighted=this._resolveDaysOfWeek(i.daysOfWeekHighlighted||[]),i.datesDisabled=i.datesDisabled||[],Array.isArray(i.datesDisabled)||(i.datesDisabled=i.datesDisabled.split(",")),i.datesDisabled=e.map(i.datesDisabled,function(e){return g.parseDate(e,a,i.language,i.assumeNearbyYear)});var s=String(i.orientation).toLowerCase().split(/\s+/g),l=i.orientation.toLowerCase();if(s=e.grep(s,function(e){return/^auto|left|right|top|bottom$/.test(e)}),i.orientation={x:"auto",y:"auto"},l&&"auto"!==l)if(1===s.length)switch(s[0]){case"top":case"bottom":i.orientation.y=s[0];break;case"left":case"right":i.orientation.x=s[0]}else l=e.grep(s,function(e){return/^left|right$/.test(e)}),i.orientation.x=l[0]||"auto",l=e.grep(s,function(e){return/^top|bottom$/.test(e)}),i.orientation.y=l[0]||"auto";if(i.defaultViewDate instanceof Date||"string"==typeof i.defaultViewDate)i.defaultViewDate=g.parseDate(i.defaultViewDate,a,i.language,i.assumeNearbyYear);else if(i.defaultViewDate){var u=i.defaultViewDate.year||(new Date).getFullYear(),c=i.defaultViewDate.month||0,d=i.defaultViewDate.day||1;i.defaultViewDate=n(u,c,d)}else i.defaultViewDate=r()},_applyEvents:function(e){for(var n,r,i,o=0;o<e.length;o++)n=e[o][0],2===e[o].length?(r=t,i=e[o][1]):3===e[o].length&&(r=e[o][1],i=e[o][2]),n.on(i,r)},_unapplyEvents:function(e){for(var n,r,i,o=0;o<e.length;o++)n=e[o][0],2===e[o].length?(i=t,r=e[o][1]):3===e[o].length&&(i=e[o][1],r=e[o][2]),n.off(r,i)},_buildEvents:function(){var t={keyup:e.proxy(function(t){-1===e.inArray(t.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:e.proxy(this.keydown,this),paste:e.proxy(this.paste,this)};!0===this.o.showOnFocus&&(t.focus=e.proxy(this.show,this)),this.isInput?this._events=[[this.element,t]]:this.component&&this.inputField.length?this._events=[[this.inputField,t],[this.component,{click:e.proxy(this.show,this)}]]:this._events=[[this.element,{click:e.proxy(this.show,this),keydown:e.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:e.proxy(function(e){this._focused_from=e.target},this)}],[this.element,{blur:e.proxy(function(e){this._focused_from=e.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":e.proxy(function(e){this.update(e.date)},this)}]),this._secondaryEvents=[[this.picker,{click:e.proxy(this.click,this)}],[this.picker,".prev, .next",{click:e.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:e.proxy(this.dayCellClick,this)}],[e(window),{resize:e.proxy(this.place,this)}],[e(document),{"mousedown touchstart":e.proxy(function(e){this.element.is(e.target)||this.element.find(e.target).length||this.picker.is(e.target)||this.picker.find(e.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(t,n){var r=n||this.dates.get(-1),i=this._utc_to_local(r);this.element.trigger({type:t,date:i,viewMode:this.viewMode,dates:e.map(this.dates,this._utc_to_local),format:e.proxy(function(e,t){0===arguments.length?(e=this.dates.length-1,t=this.o.format):"string"==typeof e&&(t=e,e=this.dates.length-1),t=t||this.o.format;var n=this.dates.get(e);return g.formatDate(n,t,this.o.language)},this)})},show:function(){if(!(this.inputField.is(":disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&e(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")||(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide")),this},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(t){var n;if(t.originalEvent.clipboardData&&t.originalEvent.clipboardData.types&&-1!==e.inArray("text/plain",t.originalEvent.clipboardData.types))n=t.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;n=window.clipboardData.getData("Text")}this.setDate(n),this.update(),t.preventDefault()},_utc_to_local:function(e){if(!e)return e;var t=new Date(e.getTime()+6e4*e.getTimezoneOffset());return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(t=new Date(e.getTime()+6e4*t.getTimezoneOffset())),t},_local_to_utc:function(e){return e&&new Date(e.getTime()-6e4*e.getTimezoneOffset())},_zero_time:function(e){return e&&new Date(e.getFullYear(),e.getMonth(),e.getDate())},_zero_utc_time:function(e){return e&&n(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())},getDates:function(){return e.map(this.dates,this._utc_to_local)},getUTCDates:function(){return e.map(this.dates,function(e){return new Date(e)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var e=this.dates.get(-1);return e!==t?new Date(e):null},clearDates:function(){this.inputField.val(""),this._trigger("changeDate"),this.update(),this.o.autoclose&&this.hide()},setDates:function(){var e=Array.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,e),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var t=Array.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,e.map(t,this._utc_to_local)),this},setDate:o("setDates"),setUTCDate:o("setUTCDates"),remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var e=this.getFormattedDate();return this.inputField.val(e),this},getFormattedDate:function(n){n===t&&(n=this.o.format);var r=this.o.language;return e.map(this.dates,function(e){return g.formatDate(e,n,r)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(e){return this._process_options({startDate:e}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(e){return this._process_options({endDate:e}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(e){return this._process_options({daysOfWeekDisabled:e}),this.update(),this},setDaysOfWeekHighlighted:function(e){return this._process_options({daysOfWeekHighlighted:e}),this.update(),this},setDatesDisabled:function(e){return this._process_options({datesDisabled:e}),this.update(),this},place:function(){if(this.isInline)return this;var t=this.picker.outerWidth(),n=this.picker.outerHeight(),r=e(this.o.container),i=r.width(),o="body"===this.o.container?e(document).scrollTop():r.scrollTop(),a=r.offset(),s=[0];this.element.parents().each(function(){var t=e(this).css("z-index");"auto"!==t&&0!==Number(t)&&s.push(Number(t))});var l=Math.max.apply(Math,s)+this.o.zIndexOffset,u=this.component?this.component.parent().offset():this.element.offset(),c=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),d=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),f=u.left-a.left,p=u.top-a.top;"body"!==this.o.container&&(p+=o),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(f-=t-d)):u.left<0?(this.picker.addClass("datepicker-orient-left"),f-=u.left-10):f+t>i?(this.picker.addClass("datepicker-orient-right"),f+=d-t):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var h=this.o.orientation.y;if("auto"===h&&(h=-o+p-n<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+h),"top"===h?p-=n+parseInt(this.picker.css("padding-top")):p+=c,this.o.rtl){var g=i-(f+d);this.picker.css({top:p,right:g,zIndex:l})}else this.picker.css({top:p,left:f,zIndex:l});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var t=this.dates.copy(),n=[],r=!1;return arguments.length?(e.each(arguments,e.proxy(function(e,t){t instanceof Date&&(t=this._local_to_utc(t)),n.push(t)},this)),r=!0):(n=(n=this.isInput?this.element.val():this.element.data("date")||this.inputField.val())&&this.o.multidate?n.split(this.o.multidateSeparator):[n],delete this.element.data().date),n=e.map(n,e.proxy(function(e){return g.parseDate(e,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),n=e.grep(n,e.proxy(function(e){return!this.dateWithinRange(e)||!e},this),!0),this.dates.replace(n),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),r?(this.setValue(),this.element.change()):this.dates.length&&String(t)!==String(this.dates)&&r&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&t.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var t=this.o.weekStart,n="<tr>";for(this.o.calendarWeeks&&(n+='<th class="cw">&#160;</th>');t<this.o.weekStart+7;)n+='<th class="dow',-1!==e.inArray(t,this.o.daysOfWeekDisabled)&&(n+=" disabled"),n+='">'+h[this.o.language].daysMin[t++%7]+"</th>";n+="</tr>",this.picker.find(".datepicker-days thead").append(n)}},fillMonths:function(){for(var e=this._utc_to_local(this.viewDate),t="",n=0;n<12;n++)t+='<span class="month'+(e&&e.getMonth()===n?" focused":"")+'">'+h[this.o.language].monthsShort[n]+"</span>";this.picker.find(".datepicker-months td").html(t)},setRange:function(t){t&&t.length?this.range=e.map(t,function(e){return e.valueOf()}):delete this.range,this.fill()},getClassNames:function(t){var n=[],o=this.viewDate.getUTCFullYear(),a=this.viewDate.getUTCMonth(),s=r();return t.getUTCFullYear()<o||t.getUTCFullYear()===o&&t.getUTCMonth()<a?n.push("old"):(t.getUTCFullYear()>o||t.getUTCFullYear()===o&&t.getUTCMonth()>a)&&n.push("new"),this.focusDate&&t.valueOf()===this.focusDate.valueOf()&&n.push("focused"),this.o.todayHighlight&&i(t,s)&&n.push("today"),-1!==this.dates.contains(t)&&n.push("active"),this.dateWithinRange(t)||n.push("disabled"),this.dateIsDisabled(t)&&n.push("disabled","disabled-date"),-1!==e.inArray(t.getUTCDay(),this.o.daysOfWeekHighlighted)&&n.push("highlighted"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&n.push("range"),-1!==e.inArray(t.valueOf(),this.range)&&n.push("selected"),t.valueOf()===this.range[0]&&n.push("range-start"),t.valueOf()===this.range[this.range.length-1]&&n.push("range-end")),n},_fill_yearsView:function(n,r,i,o,a,s,l){for(var u,c,d,f="",p=i/10,h=this.picker.find(n),g=Math.floor(o/i)*i,m=g+9*p,v=Math.floor(this.viewDate.getFullYear()/p)*p,y=e.map(this.dates,function(e){return Math.floor(e.getUTCFullYear()/p)*p}),_=g-p;_<=m+p;_+=p)u=[r],c=null,_===g-p?u.push("old"):_===m+p&&u.push("new"),-1!==e.inArray(_,y)&&u.push("active"),(_<a||_>s)&&u.push("disabled"),_===v&&u.push("focused"),l!==e.noop&&((d=l(new Date(_,0,1)))===t?d={}:"boolean"==typeof d?d={enabled:d}:"string"==typeof d&&(d={classes:d}),!1===d.enabled&&u.push("disabled"),d.classes&&(u=u.concat(d.classes.split(/\s+/))),d.tooltip&&(c=d.tooltip)),f+='<span class="'+u.join(" ")+'"'+(c?' title="'+c+'"':"")+">"+_+"</span>";h.find(".datepicker-switch").text(g+"-"+m),h.find("td").html(f)},fill:function(){var i,o,a=new Date(this.viewDate),s=a.getUTCFullYear(),l=a.getUTCMonth(),u=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,c=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,d=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,f=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,p=h[this.o.language].today||h.en.today||"",m=h[this.o.language].clear||h.en.clear||"",v=h[this.o.language].titleFormat||h.en.titleFormat,y=r(),_=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&y>=this.o.startDate&&y<=this.o.endDate&&!this.weekOfDateIsDisabled(y);if(!isNaN(s)&&!isNaN(l)){this.picker.find(".datepicker-days .datepicker-switch").text(g.formatDate(a,v,this.o.language)),this.picker.find("tfoot .today").text(p).css("display",_?"table-cell":"none"),this.picker.find("tfoot .clear").text(m).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var b=n(s,l,0),w=b.getUTCDate();b.setUTCDate(w-(b.getUTCDay()-this.o.weekStart+7)%7);var x=new Date(b);b.getUTCFullYear()<100&&x.setUTCFullYear(b.getUTCFullYear()),x.setUTCDate(x.getUTCDate()+42),x=x.valueOf();for(var k,C,D=[];b.valueOf()<x;){if((k=b.getUTCDay())===this.o.weekStart&&(D.push("<tr>"),this.o.calendarWeeks)){var S=new Date(+b+(this.o.weekStart-k-7)%7*864e5),A=new Date(Number(S)+(11-S.getUTCDay())%7*864e5),E=new Date(Number(E=n(A.getUTCFullYear(),0,1))+(11-E.getUTCDay())%7*864e5),M=(A-E)/864e5/7+1;D.push('<td class="cw">'+M+"</td>")}(C=this.getClassNames(b)).push("day");var T=b.getUTCDate();this.o.beforeShowDay!==e.noop&&((o=this.o.beforeShowDay(this._utc_to_local(b)))===t?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),!1===o.enabled&&C.push("disabled"),o.classes&&(C=C.concat(o.classes.split(/\s+/))),o.tooltip&&(i=o.tooltip),o.content&&(T=o.content)),C="function"==typeof e.uniqueSort?e.uniqueSort(C):e.unique(C),D.push('<td class="'+C.join(" ")+'"'+(i?' title="'+i+'"':"")+' data-date="'+b.getTime().toString()+'">'+T+"</td>"),i=null,k===this.o.weekEnd&&D.push("</tr>"),b.setUTCDate(b.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(D.join(""));var j=h[this.o.language].monthsTitle||h.en.monthsTitle||"Months",N=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?j:s).end().find("tbody span").removeClass("active");if(e.each(this.dates,function(e,t){t.getUTCFullYear()===s&&N.eq(t.getUTCMonth()).addClass("active")}),(s<u||s>d)&&N.addClass("disabled"),s===u&&N.slice(0,c).addClass("disabled"),s===d&&N.slice(f+1).addClass("disabled"),this.o.beforeShowMonth!==e.noop){var F=this;e.each(N,function(n,r){var i=new Date(s,n,1),o=F.o.beforeShowMonth(i);o===t?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),!1!==o.enabled||e(r).hasClass("disabled")||e(r).addClass("disabled"),o.classes&&e(r).addClass(o.classes),o.tooltip&&e(r).prop("title",o.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,s,u,d,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,s,u,d,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,s,u,d,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var e,t,n=new Date(this.viewDate),r=n.getUTCFullYear(),i=n.getUTCMonth(),o=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,a=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,s=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,u=1;switch(this.viewMode){case 4:u*=10;case 3:u*=10;case 2:u*=10;case 1:e=Math.floor(r/u)*u<=o,t=Math.floor(r/u)*u+u>s;break;case 0:e=r<=o&&i<=a,t=r>=s&&i>=l}this.picker.find(".prev").toggleClass("disabled",e),this.picker.find(".next").toggleClass("disabled",t)}},click:function(t){var i,o,a;t.preventDefault(),t.stopPropagation(),(i=e(t.target)).hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),i.hasClass("today")&&!i.hasClass("day")&&(this.setViewMode(0),this._setDate(r(),"linked"===this.o.todayBtn?null:"view")),i.hasClass("clear")&&this.clearDates(),i.hasClass("disabled")||(i.hasClass("month")||i.hasClass("year")||i.hasClass("decade")||i.hasClass("century"))&&(this.viewDate.setUTCDate(1),1===this.viewMode?(a=i.parent().find("span").index(i),o=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(a)):(a=0,o=Number(i.text()),this.viewDate.setUTCFullYear(o)),this._trigger(g.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(n(o,a,1)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(t){var n=e(t.currentTarget).data("date"),r=new Date(n);this.o.updateViewDate&&(r.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),r.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(r)},navArrowsClick:function(t){var n=e(t.currentTarget).hasClass("prev")?-1:1;0!==this.viewMode&&(n*=12*g.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,n),this._trigger(g.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(e){var t=this.dates.contains(e);if(e||this.dates.clear(),-1!==t?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(t):!1===this.o.multidate?(this.dates.clear(),this.dates.push(e)):this.dates.push(e),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(e,t){t&&"date"!==t||this._toggle_multidate(e&&new Date(e)),(!t&&this.o.updateViewDate||"view"===t)&&(this.viewDate=e&&new Date(e)),this.fill(),this.setValue(),t&&"view"===t||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||t&&"date"!==t||this.hide()},moveDay:function(e,t){var n=new Date(e);return n.setUTCDate(e.getUTCDate()+t),n},moveWeek:function(e,t){return this.moveDay(e,7*t)},moveMonth:function(e,t){if(!(n=e)||isNaN(n.getTime()))return this.o.defaultViewDate;var n;if(!t)return e;var r,i,o=new Date(e.valueOf()),a=o.getUTCDate(),s=o.getUTCMonth(),l=Math.abs(t);if(t=t>0?1:-1,1===l)i=-1===t?function(){return o.getUTCMonth()===s}:function(){return o.getUTCMonth()!==r},r=s+t,o.setUTCMonth(r),r=(r+12)%12;else{for(var u=0;u<l;u++)o=this.moveMonth(o,t);r=o.getUTCMonth(),o.setUTCDate(a),i=function(){return r!==o.getUTCMonth()}}for(;i();)o.setUTCDate(--a),o.setUTCMonth(r);return o},moveYear:function(e,t){return this.moveMonth(e,12*t)},moveAvailableDate:function(e,t,n){do{if(e=this[n](e,t),!this.dateWithinRange(e))return!1;n="moveDay"}while(this.dateIsDisabled(e));return e},weekOfDateIsDisabled:function(t){return-1!==e.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(t){return this.weekOfDateIsDisabled(t)||e.grep(this.o.datesDisabled,function(e){return i(t,e)}).length>0},dateWithinRange:function(e){return e>=this.o.startDate&&e<=this.o.endDate},keydown:function(e){if(this.picker.is(":visible")){var t,n,r=!1,i=this.focusDate||this.viewDate;switch(e.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),e.preventDefault(),e.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;t=37===e.keyCode||38===e.keyCode?-1:1,0===this.viewMode?e.ctrlKey?(n=this.moveAvailableDate(i,t,"moveYear"))&&this._trigger("changeYear",this.viewDate):e.shiftKey?(n=this.moveAvailableDate(i,t,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===e.keyCode||39===e.keyCode?n=this.moveAvailableDate(i,t,"moveDay"):this.weekOfDateIsDisabled(i)||(n=this.moveAvailableDate(i,t,"moveWeek")):1===this.viewMode?(38!==e.keyCode&&40!==e.keyCode||(t*=4),n=this.moveAvailableDate(i,t,"moveMonth")):2===this.viewMode&&(38!==e.keyCode&&40!==e.keyCode||(t*=4),n=this.moveAvailableDate(i,t,"moveYear")),n&&(this.focusDate=this.viewDate=n,this.setValue(),this.fill(),e.preventDefault());break;case 13:if(!this.o.forceParse)break;i=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(i),r=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(e.preventDefault(),e.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}r&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))}else 40!==e.keyCode&&27!==e.keyCode||(this.show(),e.stopPropagation())},setViewMode:function(e){this.viewMode=e,this.picker.children("div").hide().filter(".datepicker-"+g.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var u=function(t,n){e.data(t,"datepicker",this),this.element=e(t),this.inputs=e.map(n.inputs,function(e){return e.jquery?e[0]:e}),delete n.inputs,this.keepEmptyValues=n.keepEmptyValues,delete n.keepEmptyValues,d.call(e(this.inputs),n).on("changeDate",e.proxy(this.dateUpdated,this)),this.pickers=e.map(this.inputs,function(t){return e.data(t,"datepicker")}),this.updateDates()};u.prototype={updateDates:function(){this.dates=e.map(this.pickers,function(e){return e.getUTCDate()}),this.updateRanges()},updateRanges:function(){var t=e.map(this.dates,function(e){return e.valueOf()});e.each(this.pickers,function(e,n){n.setRange(t)})},clearDates:function(){e.each(this.pickers,function(e,t){t.clearDates()})},dateUpdated:function(n){if(!this.updating){this.updating=!0;var r=e.data(n.target,"datepicker");if(r!==t){var i=r.getUTCDate(),o=this.keepEmptyValues,a=e.inArray(n.target,this.inputs),s=a-1,l=a+1,u=this.inputs.length;if(-1!==a){if(e.each(this.pickers,function(e,t){t.getUTCDate()||t!==r&&o||t.setUTCDate(i)}),i<this.dates[s])for(;s>=0&&i<this.dates[s]&&(this.pickers[s].element.val()||"").length>0;)this.pickers[s--].setUTCDate(i);else if(i>this.dates[l])for(;l<u&&i>this.dates[l]&&(this.pickers[l].element.val()||"").length>0;)this.pickers[l++].setUTCDate(i);this.updateDates(),delete this.updating}}}},destroy:function(){e.map(this.pickers,function(e){e.destroy()}),e(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var c=e.fn.datepicker,d=function(n){var r,i=Array.apply(null,arguments);if(i.shift(),this.each(function(){var t=e(this),o=t.data("datepicker"),a="object"==typeof n&&n;if(!o){var s=function(t,n){var r=e(t).data(),i={},o=new RegExp("^"+n.toLowerCase()+"([A-Z])");function a(e,t){return t.toLowerCase()}for(var s in n=new RegExp("^"+n.toLowerCase()),r)n.test(s)&&(i[s.replace(o,a)]=r[s]);return i}(this,"date"),c=function(t){var n={};if(h[t]||(t=t.split("-")[0],h[t])){var r=h[t];return e.each(p,function(e,t){t in r&&(n[t]=r[t])}),n}}(e.extend({},f,s,a).language),d=e.extend({},f,c,s,a);t.hasClass("input-daterange")||d.inputs?(e.extend(d,{inputs:d.inputs||t.find("input").toArray()}),o=new u(this,d)):o=new l(this,d),t.data("datepicker",o)}"string"==typeof n&&"function"==typeof o[n]&&(r=o[n].apply(o,i))}),r===t||r instanceof l||r instanceof u)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+n+" function)");return r};e.fn.datepicker=d;var f=e.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:e.noop,beforeShowMonth:e.noop,beforeShowYear:e.noop,beforeShowDecade:e.noop,beforeShowCentury:e.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",isInline:null,keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&#x00AB;",rightArrow:"&#x00BB;"},showWeekDays:!0},p=e.fn.datepicker.locale_opts=["format","rtl","weekStart"];e.fn.datepicker.Constructor=l;var h=e.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},g={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(e){if("function"==typeof e.toValue&&"function"==typeof e.toDisplay)return e;var t=e.replace(this.validParts,"\0").split("\0"),n=e.match(this.validParts);if(!t||!t.length||!n||0===n.length)throw new Error("Invalid date format.");return{separators:t,parts:n}},parseDate:function(n,i,o,a){if(!n)return t;if(n instanceof Date)return n;if("string"==typeof i&&(i=g.parseFormat(i)),i.toValue)return i.toValue(n,i,o);var s,u,c,d,f,p={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},m={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(n in m&&(n=m[n]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(n)){for(s=n.match(/([\-+]\d+)([dmwy])/gi),n=new Date,d=0;d<s.length;d++)u=s[d].match(/([\-+]\d+)([dmwy])/i),c=Number(u[1]),f=p[u[2].toLowerCase()],n=l.prototype[f](n,c);return l.prototype._zero_utc_time(n)}s=n&&n.match(this.nonpunctuation)||[];var v,y,_={},b=["yyyy","yy","M","MM","m","mm","d","dd"],w={yyyy:function(e,t){return e.setUTCFullYear(a?(!0===(r=a)&&(r=10),(n=t)<100&&(n+=2e3)>(new Date).getFullYear()+r&&(n-=100),n):t);var n,r},m:function(e,t){if(isNaN(e))return e;for(t-=1;t<0;)t+=12;for(t%=12,e.setUTCMonth(t);e.getUTCMonth()!==t;)e.setUTCDate(e.getUTCDate()-1);return e},d:function(e,t){return e.setUTCDate(t)}};w.yy=w.yyyy,w.M=w.MM=w.mm=w.m,w.dd=w.d,n=r();var x=i.parts.slice();function k(){var e=this.slice(0,s[d].length),t=s[d].slice(0,e.length);return e.toLowerCase()===t.toLowerCase()}if(s.length!==x.length&&(x=e(x).filter(function(t,n){return-1!==e.inArray(n,b)}).toArray()),s.length===x.length){var C,D,S;for(d=0,C=x.length;d<C;d++){if(v=parseInt(s[d],10),u=x[d],isNaN(v))switch(u){case"MM":y=e(h[o].months).filter(k),v=e.inArray(y[0],h[o].months)+1;break;case"M":y=e(h[o].monthsShort).filter(k),v=e.inArray(y[0],h[o].monthsShort)+1}_[u]=v}for(d=0;d<b.length;d++)(S=b[d])in _&&!isNaN(_[S])&&(D=new Date(n),w[S](D,_[S]),isNaN(D)||(n=D))}return n},formatDate:function(t,n,r){if(!t)return"";if("string"==typeof n&&(n=g.parseFormat(n)),n.toDisplay)return n.toDisplay(t,n,r);var i={d:t.getUTCDate(),D:h[r].daysShort[t.getUTCDay()],DD:h[r].days[t.getUTCDay()],m:t.getUTCMonth()+1,M:h[r].monthsShort[t.getUTCMonth()],MM:h[r].months[t.getUTCMonth()],yy:t.getUTCFullYear().toString().substring(2),yyyy:t.getUTCFullYear()};i.dd=(i.d<10?"0":"")+i.d,i.mm=(i.m<10?"0":"")+i.m,t=[];for(var o=e.extend([],n.separators),a=0,s=n.parts.length;a<=s;a++)o.length&&t.push(o.shift()),t.push(i[n.parts[a]]);return t.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+f.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+f.templates.rightArrow+"</th></tr></thead>",contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};g.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+g.headTemplate+"<tbody></tbody>"+g.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+g.headTemplate+g.contTemplate+g.footTemplate+"</table></div></div>",e.fn.datepicker.DPGlobal=g,e.fn.datepicker.noConflict=function(){return e.fn.datepicker=c,this},e.fn.datepicker.version="1.10.1",e.fn.datepicker.deprecated=function(e){var t=window.console;t&&t.warn&&t.warn("DEPRECATED: "+e)},e(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var n=e(this);n.data("datepicker")||(t.preventDefault(),d.call(n,"show"))}),e(function(){d.call(e('[data-provide="datepicker-inline"]'))})},void 0===(o=r.apply(t,i))||(e.exports=o)},7915:function(e,t,n){n(8294),n(1309),n(3929),n(4050),n(63),n(9737),n(8852),n(6278),n(6927),n(3497),n(7814),n(5377)},5377:function(e,t,n){!function(e){"use strict";var t=function(n,r){this.options=e.extend({},t.DEFAULTS,r);var i=this.options.target===t.DEFAULTS.target?e(this.options.target):e(document).find(this.options.target);this.$target=i.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 r=e(this),i=r.data("bs.affix"),o="object"==typeof n&&n;i||r.data("bs.affix",i=new t(this,o)),"string"==typeof n&&i[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,r){var i=this.$target.scrollTop(),o=this.$element.offset(),a=this.$target.height();if(null!=n&&"top"==this.affixed)return i<n&&"top";if("bottom"==this.affixed)return null!=n?!(i+this.unpin<=o.top)&&"bottom":!(i+a<=e-r)&&"bottom";var s=null==this.affixed,l=s?i:o.top;return null!=n&&i<=n?"top":null!=r&&l+(s?a:t)>=e-r&&"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(),r=this.options.offset,i=r.top,o=r.bottom,a=Math.max(e(document).height(),e(document.body).height());"object"!=typeof r&&(o=i=r),"function"==typeof i&&(i=r.top(this.$element)),"function"==typeof o&&(o=r.bottom(this.$element));var s=this.getState(a,n,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var l="affix"+(s?"-"+s:""),u=e.Event(l+".bs.affix");if(this.$element.trigger(u),u.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:a-n-o})}};var r=e.fn.affix;e.fn.affix=n,e.fn.affix.Constructor=t,e.fn.affix.noConflict=function(){return e.fn.affix=r,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),r=t.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),n.call(t,r)})})}(n(9983))},1309:function(e,t,n){!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 r=e(this),i=r.attr("data-target");i||(i=(i=r.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=e(document).find(i);function a(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=r.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",a).emulateTransitionEnd(n.TRANSITION_DURATION):a())};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("bs.alert");i||r.data("bs.alert",i=new n(this)),"string"==typeof t&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",t,n.prototype.close)}(n(9983))},3929:function(e,t,n){!function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),this.isLoading=!1};function n(n){return this.each(function(){var r=e(this),i=r.data("bs.button"),o="object"==typeof n&&n;i||r.data("bs.button",i=new t(this,o)),"toggle"==n?i.toggle():n&&i.setState(n)})}t.VERSION="3.4.1",t.DEFAULTS={loadingText:"loading..."},t.prototype.setState=function(t){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",o=r.data();t+="Text",null==o.resetText&&r.data("resetText",r[i]()),setTimeout(e.proxy(function(){r[i](null==o[t]?this.options[t]:o[t]),"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,r.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 r=e.fn.button;e.fn.button=n,e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=e(t.target).closest(".btn");n.call(r,"toggle"),e(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),r.is("input,button")?r.trigger("focus"):r.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))})}(n(9983))},4050:function(e,t,n){!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 r=e(this),i=r.data("bs.carousel"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n),a="string"==typeof n?n:o.slide;i||r.data("bs.carousel",i=new t(this,o)),"number"==typeof n?i.to(n):a?i[a]():o.interval&&i.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 r=(n+("prev"==e?-1:1))%this.$items.length;return this.$items.eq(r)},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,r){var i=this.$element.find(".item.active"),o=r||this.getItemForDirection(n,i),a=this.interval,s="next"==n?"left":"right",l=this;if(o.hasClass("active"))return this.sliding=!1;var u=o[0],c=e.Event("slide.bs.carousel",{relatedTarget:u,direction:s});if(this.$element.trigger(c),!c.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=e(this.$indicators.children()[this.getItemIndex(o)]);d&&d.addClass("active")}var f=e.Event("slid.bs.carousel",{relatedTarget:u,direction:s});return e.support.transition&&this.$element.hasClass("slide")?(o.addClass(n),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([n,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(f)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(f)),a&&this.cycle(),this}};var r=e.fn.carousel;e.fn.carousel=n,e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=r,this};var i=function(t){var r=e(this),i=r.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=r.attr("data-target")||i,a=e(document).find(o);if(a.hasClass("carousel")){var s=e.extend({},a.data(),r.data()),l=r.attr("data-slide-to");l&&(s.interval=!1),n.call(a,s),l&&a.data("bs.carousel").to(l),t.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",i).on("click.bs.carousel.data-api","[data-slide-to]",i),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var t=e(this);n.call(t,t.data())})})}(n(9983))},63:function(e,t,n){!function(e){"use strict";var t=function(n,r){this.$element=e(n),this.options=e.extend({},t.DEFAULTS,r),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,r=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(document).find(r)}function r(n){return this.each(function(){var r=e(this),i=r.data("bs.collapse"),o=e.extend({},t.DEFAULTS,r.data(),"object"==typeof n&&n);!i&&o.toggle&&/show|hide/.test(n)&&(o.toggle=!1),i||r.data("bs.collapse",i=new t(this,o)),"string"==typeof n&&i[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,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(n=i.data("bs.collapse"))&&n.transitioning)){var o=e.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){i&&i.length&&(r.call(i,"hide"),n||i.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var l=e.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",e.proxy(s,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[a](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 r=this.dimension();this.$element[r](this.$element[r]())[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 i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return i.call(this);this.$element[r](0).one("bsTransitionEnd",e.proxy(i,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,r){var i=e(r);this.addAriaAndCollapsedClass(n(i),i)},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 i=e.fn.collapse;e.fn.collapse=r,e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=i,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var i=e(this);i.attr("data-target")||t.preventDefault();var o=n(i),a=o.data("bs.collapse")?"toggle":i.data();r.call(o,a)})}(n(9983))},9737:function(e,t,n){!function(e){"use strict";var t='[data-toggle="dropdown"]',n=function(t){e(t).on("click.bs.dropdown",this.toggle)};function r(t){var n=t.attr("data-target");n||(n=(n=t.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r="#"!==n?e(document).find(n):null;return r&&r.length?r:t.parent()}function i(n){n&&3===n.which||(e(".dropdown-backdrop").remove(),e(t).each(function(){var t=e(this),i=r(t),o={relatedTarget:this};i.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(i[0],n.target)||(i.trigger(n=e.Event("hide.bs.dropdown",o)),n.isDefaultPrevented()||(t.attr("aria-expanded","false"),i.removeClass("open").trigger(e.Event("hidden.bs.dropdown",o)))))}))}n.VERSION="3.4.1",n.prototype.toggle=function(t){var n=e(this);if(!n.is(".disabled, :disabled")){var o=r(n),a=o.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",i);var s={relatedTarget:this};if(o.trigger(t=e.Event("show.bs.dropdown",s)),t.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(e.Event("shown.bs.dropdown",s))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var i=e(this);if(n.preventDefault(),n.stopPropagation(),!i.is(".disabled, :disabled")){var o=r(i),a=o.hasClass("open");if(!a&&27!=n.which||a&&27==n.which)return 27==n.which&&o.find(t).trigger("focus"),i.trigger("click");var s=o.find(".dropdown-menu li:not(.disabled):visible a");if(s.length){var l=s.index(n.target);38==n.which&&l>0&&l--,40==n.which&&l<s.length-1&&l++,~l||(l=0),s.eq(l).trigger("focus")}}}};var o=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("bs.dropdown");i||r.data("bs.dropdown",i=new n(this)),"string"==typeof t&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=o,this},e(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",t,n.prototype.toggle).on("keydown.bs.dropdown.data-api",t,n.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",n.prototype.keydown)}(n(9983))},8852:function(e,t,n){!function(e){"use strict";var t=function(t,n){this.options=n,this.$body=e(document.body),this.$element=e(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function n(n,r){return this.each(function(){var i=e(this),o=i.data("bs.modal"),a=e.extend({},t.DEFAULTS,i.data(),"object"==typeof n&&n);o||i.data("bs.modal",o=new t(this,a)),"string"==typeof n?o[n](r):a.show&&o.show(r)})}t.VERSION="3.4.1",t.TRANSITION_DURATION=300,t.BACKDROP_TRANSITION_DURATION=150,t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},t.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},t.prototype.show=function(n){var r=this,i=e.Event("show.bs.modal",{relatedTarget:n});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var i=e.support.transition&&r.$element.hasClass("fade");r.$element.parent().length||r.$element.appendTo(r.$body),r.$element.show().scrollTop(0),r.adjustDialog(),i&&r.$element[0].offsetWidth,r.$element.addClass("in"),r.enforceFocus();var o=e.Event("shown.bs.modal",{relatedTarget:n});i?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(o)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(o)}))},t.prototype.hide=function(n){n&&n.preventDefault(),n=e.Event("hide.bs.modal"),this.$element.trigger(n),this.isShown&&!n.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):this.hideModal())},t.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){document===e.target||this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},t.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},t.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},t.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},t.prototype.backdrop=function(n){var r=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=e.support.transition&&i;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!n)return;o?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):n()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){r.removeBackdrop(),n&&n()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):a()}else n&&n()},t.prototype.handleUpdate=function(){this.adjustDialog()},t.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},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<e,this.scrollbarWidth=this.measureScrollbar()},t.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),e(this.fixedContent).each(function(t,r){var i=r.style.paddingRight,o=e(r).css("padding-right");e(r).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),e(this.fixedContent).each(function(t,n){var r=e(n).data("padding-right");e(n).removeData("padding-right"),n.style.paddingRight=r||""})},t.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var r=e.fn.modal;e.fn.modal=n,e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=r,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=e(this),i=r.attr("href"),o=r.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),a=e(document).find(o),s=a.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},a.data(),r.data());r.is("a")&&t.preventDefault(),a.one("show.bs.modal",function(e){e.isDefaultPrevented()||a.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})}),n.call(a,s,this)})}(n(9983))},6927:function(e,t,n){!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:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),(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 r=typeof n;this.options.sanitize&&(t=this.sanitizeHtml(t),"string"===r&&(n=this.sanitizeHtml(n))),e.find(".popover-title").html(t),e.find(".popover-content").children().detach().end()["string"===r?"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 r=e(this),i=r.data("bs.popover"),o="object"==typeof n&&n;!i&&/destroy|hide/.test(n)||(i||r.data("bs.popover",i=new t(this,o)),"string"==typeof n&&i[n]())})},e.fn.popover.Constructor=t,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(n(9983))},3497:function(e,t,n){!function(e){"use strict";function t(n,r){this.$body=e(document.body),this.$scrollElement=e(n).is(document.body)?e(window):e(n),this.options=e.extend({},t.DEFAULTS,r),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 r=e(this),i=r.data("bs.scrollspy"),o="object"==typeof n&&n;i||r.data("bs.scrollspy",i=new t(this,o)),"string"==typeof n&&i[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",r=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",r=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=e(this),i=t.data("target")||t.attr("href"),o=/^#./.test(i)&&e(i);return o&&o.length&&o.is(":visible")&&[[o[n]().top+r,i]]||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(),r=this.options.offset+n-this.$scrollElement.height(),i=this.offsets,o=this.targets,a=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=r)return a!=(e=o[o.length-1])&&this.activate(e);if(a&&t<i[0])return this.activeTarget=null,this.clear();for(e=i.length;e--;)a!=o[e]&&t>=i[e]&&(void 0===i[e+1]||t<i[e+1])&&this.activate(o[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',r=e(n).parents("li").addClass("active");r.parent(".dropdown-menu").length&&(r=r.closest("li.dropdown").addClass("active")),r.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=e.fn.scrollspy;e.fn.scrollspy=n,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=r,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);n.call(t,t.data())})})}(n(9983))},7814:function(e,t,n){!function(e){"use strict";var t=function(t){this.element=e(t)};function n(n){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new t(this)),"string"==typeof n&&i[n]()})}t.VERSION="3.4.1",t.TRANSITION_DURATION=150,t.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.data("target");if(r||(r=(r=t.attr("href"))&&r.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var i=n.find(".active:last a"),o=e.Event("hide.bs.tab",{relatedTarget:t[0]}),a=e.Event("show.bs.tab",{relatedTarget:i[0]});if(i.trigger(o),t.trigger(a),!a.isDefaultPrevented()&&!o.isDefaultPrevented()){var s=e(document).find(r);this.activate(t.closest("li"),n),this.activate(s,s.parent(),function(){i.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:i[0]})})}}},t.prototype.activate=function(n,r,i){var o=r.find("> .active"),a=i&&e.support.transition&&(o.length&&o.hasClass("fade")||!!r.find("> .fade").length);function s(){o.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),a?(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),i&&i()}o.length&&a?o.one("bsTransitionEnd",s).emulateTransitionEnd(t.TRANSITION_DURATION):s(),o.removeClass("in")};var r=e.fn.tab;e.fn.tab=n,e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(t){t.preventDefault(),n.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(n(9983))},6278:function(e,t,n){!function(e){"use strict";var t=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,i=/^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 o(t,o){var a=t.nodeName.toLowerCase();if(-1!==e.inArray(a,o))return-1===e.inArray(a,n)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(i));for(var s=e(o).filter(function(e,t){return t instanceof RegExp}),l=0,u=s.length;l<u;l++)if(a.match(s[l]))return!0;return!1}function a(t,n,r){if(0===t.length)return t;if(r&&"function"==typeof r)return r(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var i=document.implementation.createHTMLDocument("sanitization");i.body.innerHTML=t;for(var a=e.map(n,function(e,t){return t}),s=e(i.body).find("*"),l=0,u=s.length;l<u;l++){var c=s[l],d=c.nodeName.toLowerCase();if(-1!==e.inArray(d,a))for(var f=e.map(c.attributes,function(e){return e}),p=[].concat(n["*"]||[],n[d]||[]),h=0,g=f.length;h<g;h++)o(f[h],p)||c.removeAttribute(f[h].nodeName);else c.parentNode.removeChild(c)}return i.body.innerHTML}var s=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};s.VERSION="3.4.1",s.TRANSITION_DURATION=150,s.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^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.prototype.init=function(t,n,r){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r),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 i=this.options.trigger.split(" "),o=i.length;o--;){var a=i[o];if("click"==a)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=a){var s="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(s+"."+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()},s.prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.getOptions=function(n){var r=this.$element.data();for(var i in r)r.hasOwnProperty(i)&&-1!==e.inArray(i,t)&&delete r[i];return(n=e.extend({},this.getDefaults(),r,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},s.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},s.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)}},s.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},s.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)}},s.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 r=this,i=this.tip(),o=this.getUID(this.type);this.setContent(),i.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&i.addClass("fade");var a="function"==typeof this.options.placement?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,u=l.test(a);u&&(a=a.replace(l,"")||"top"),i.detach().css({top:0,left:0,display:"block"}).addClass(a).data("bs."+this.type,this),this.options.container?i.appendTo(e(document).find(this.options.container)):i.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var c=this.getPosition(),d=i[0].offsetWidth,f=i[0].offsetHeight;if(u){var p=a,h=this.getPosition(this.$viewport);a="bottom"==a&&c.bottom+f>h.bottom?"top":"top"==a&&c.top-f<h.top?"bottom":"right"==a&&c.right+d>h.width?"left":"left"==a&&c.left-d<h.left?"right":a,i.removeClass(p).addClass(a)}var g=this.getCalculatedOffset(a,c,d,f);this.applyPlacement(g,a);var m=function(){var e=r.hoverState;r.$element.trigger("shown.bs."+r.type),r.hoverState=null,"out"==e&&r.leave(r)};e.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",m).emulateTransitionEnd(s.TRANSITION_DURATION):m()}},s.prototype.applyPlacement=function(t,n){var r=this.tip(),i=r[0].offsetWidth,o=r[0].offsetHeight,a=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(s)&&(s=0),t.top+=a,t.left+=s,e.offset.setOffset(r[0],e.extend({using:function(e){r.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),r.addClass("in");var l=r[0].offsetWidth,u=r[0].offsetHeight;"top"==n&&u!=o&&(t.top=t.top+o-u);var c=this.getViewportAdjustedDelta(n,t,l,u);c.left?t.left+=c.left:t.top+=c.top;var d=/top|bottom/.test(n),f=d?2*c.left-i+l:2*c.top-o+u,p=d?"offsetWidth":"offsetHeight";r.offset(t),this.replaceArrow(f,r[0][p],d)},s.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},s.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();this.options.html?(this.options.sanitize&&(t=a(t,this.options.whiteList,this.options.sanitizeFn)),e.find(".tooltip-inner").html(t)):e.find(".tooltip-inner").text(t),e.removeClass("fade in top bottom left right")},s.prototype.hide=function(t){var n=this,r=e(this.$tip),i=e.Event("hide.bs."+this.type);function o(){"in"!=n.hoverState&&r.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),t&&t()}if(this.$element.trigger(i),!i.isDefaultPrevented())return r.removeClass("in"),e.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",o).emulateTransitionEnd(s.TRANSITION_DURATION):o(),this.hoverState=null,this},s.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},s.prototype.hasContent=function(){return this.getTitle()},s.prototype.getPosition=function(t){var n=(t=t||this.$element)[0],r="BODY"==n.tagName,i=n.getBoundingClientRect();null==i.width&&(i=e.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var o=window.SVGElement&&n instanceof window.SVGElement,a=r?{top:0,left:0}:o?null:t.offset(),s={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},l=r?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},i,s,l,a)},s.prototype.getCalculatedOffset=function(e,t,n,r){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-r,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},s.prototype.getViewportAdjustedDelta=function(e,t,n,r){var i={top:0,left:0};if(!this.$viewport)return i;var o=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(e)){var s=t.top-o-a.scroll,l=t.top+o-a.scroll+r;s<a.top?i.top=a.top-s:l>a.top+a.height&&(i.top=a.top+a.height-l)}else{var u=t.left-o,c=t.left+o+n;u<a.left?i.left=a.left-u:c>a.right&&(i.left=a.left+a.width-c)}return i},s.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)},s.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},s.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},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},s.prototype.enable=function(){this.enabled=!0},s.prototype.disable=function(){this.enabled=!1},s.prototype.toggleEnabled=function(){this.enabled=!this.enabled},s.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)},s.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})},s.prototype.sanitizeHtml=function(e){return a(e,this.options.whiteList,this.options.sanitizeFn)};var l=e.fn.tooltip;e.fn.tooltip=function(t){return this.each(function(){var n=e(this),r=n.data("bs.tooltip"),i="object"==typeof t&&t;!r&&/destroy|hide/.test(t)||(r||n.data("bs.tooltip",r=new s(this,i)),"string"==typeof t&&r[t]())})},e.fn.tooltip.Constructor=s,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=l,this}}(n(9983))},8294:function(e,t,n){!function(e){"use strict";e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;return e(this).one("bsTransitionEnd",function(){n=!0}),setTimeout(function(){n||e(r).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)}})})}(n(9983))},5078:function(e,t,n){var r,i;!function(){var o={version:"3.5.17"},a=[].slice,s=function(e){return a.call(e)},l=this.document;function u(e){return e&&(e.ownerDocument||e.document||e).documentElement}function c(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(l)try{s(l.documentElement.childNodes)[0].nodeType}catch(e){s=function(e){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}}if(Date.now||(Date.now=function(){return+new Date}),l)try{l.createElement("DIV").style.setProperty("opacity",0,"")}catch(e){var d=this.Element.prototype,f=d.setAttribute,p=d.setAttributeNS,h=this.CSSStyleDeclaration.prototype,g=h.setProperty;d.setAttribute=function(e,t){f.call(this,e,t+"")},d.setAttributeNS=function(e,t,n){p.call(this,e,t,n+"")},h.setProperty=function(e,t,n){g.call(this,e,t+"",n)}}function m(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function v(e){return null===e?NaN:+e}function y(e){return!isNaN(e)}function _(e){return{left:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}o.ascending=m,o.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},o.min=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&n>r&&(n=r)}return n},o.max=function(e,t){var n,r,i=-1,o=e.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=e[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=e[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=t.call(e,e[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=t.call(e,e[i],i))&&r>n&&(n=r)}return n},o.extent=function(e,t){var n,r,i,o=-1,a=e.length;if(1===arguments.length){for(;++o<a;)if(null!=(r=e[o])&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=e[o])&&(n>r&&(n=r),i<r&&(i=r))}else{for(;++o<a;)if(null!=(r=t.call(e,e[o],o))&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=t.call(e,e[o],o))&&(n>r&&(n=r),i<r&&(i=r))}return[n,i]},o.sum=function(e,t){var n,r=0,i=e.length,o=-1;if(1===arguments.length)for(;++o<i;)y(n=+e[o])&&(r+=n);else for(;++o<i;)y(n=+t.call(e,e[o],o))&&(r+=n);return r},o.mean=function(e,t){var n,r=0,i=e.length,o=-1,a=i;if(1===arguments.length)for(;++o<i;)y(n=v(e[o]))?r+=n:--a;else for(;++o<i;)y(n=v(t.call(e,e[o],o)))?r+=n:--a;if(a)return r/a},o.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],o=n-r;return o?i+o*(e[r]-i):i},o.median=function(e,t){var n,r=[],i=e.length,a=-1;if(1===arguments.length)for(;++a<i;)y(n=v(e[a]))&&r.push(n);else for(;++a<i;)y(n=v(t.call(e,e[a],a)))&&r.push(n);if(r.length)return o.quantile(r.sort(m),.5)},o.variance=function(e,t){var n,r,i=e.length,o=0,a=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)y(n=v(e[s]))&&(a+=(r=n-o)*(n-(o+=r/++l)));else for(;++s<i;)y(n=v(t.call(e,e[s],s)))&&(a+=(r=n-o)*(n-(o+=r/++l)));if(l>1)return a/(l-1)},o.deviation=function(){var e=o.variance.apply(this,arguments);return e?Math.sqrt(e):e};var b=_(m);function w(e){return e.length}o.bisectLeft=b.left,o.bisect=o.bisectRight=b.right,o.bisector=function(e){return _(1===e.length?function(t,n){return m(e(t),n)}:e)},o.shuffle=function(e,t,n){(o=arguments.length)<3&&(n=e.length,o<2&&(t=0));for(var r,i,o=n-t;o;)i=Math.random()*o--|0,r=e[o+t],e[o+t]=e[i+t],e[i+t]=r;return e},o.permute=function(e,t){for(var n=t.length,r=new Array(n);n--;)r[n]=e[t[n]];return r},o.pairs=function(e){for(var t=0,n=e.length-1,r=e[0],i=new Array(n<0?0:n);t<n;)i[t]=[r,r=e[++t]];return i},o.transpose=function(e){if(!(i=e.length))return[];for(var t=-1,n=o.min(e,w),r=new Array(n);++t<n;)for(var i,a=-1,s=r[t]=new Array(i);++a<i;)s[a]=e[a][t];return r},o.zip=function(){return o.transpose(arguments)},o.keys=function(e){var t=[];for(var n in e)t.push(n);return t},o.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},o.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},o.merge=function(e){for(var t,n,r,i=e.length,o=-1,a=0;++o<i;)a+=e[o].length;for(n=new Array(a);--i>=0;)for(t=(r=e[i]).length;--t>=0;)n[--a]=r[t];return n};var x=Math.abs;function k(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function C(){this._=Object.create(null)}function D(e){return"__proto__"==(e+="")||"\0"===e[0]?"\0"+e:e}function S(e){return"\0"===(e+="")[0]?e.slice(1):e}function A(e){return D(e)in this._}function E(e){return(e=D(e))in this._&&delete this._[e]}function M(){var e=[];for(var t in this._)e.push(S(t));return e}function T(){var e=0;for(var t in this._)++e;return e}function j(){for(var e in this._)return!1;return!0}function N(){this._=Object.create(null)}function F(e){return e}function O(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function I(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=z.length;n<r;++n){var i=z[n]+t;if(i in e)return i}}o.range=function(e,t,n){if(arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0)),(t-e)/n===1/0)throw new Error("infinite range");var r,i=[],o=function(e){for(var t=1;e*t%1;)t*=10;return t}(x(n)),a=-1;if(e*=o,t*=o,(n*=o)<0)for(;(r=e+n*++a)>t;)i.push(r/o);else for(;(r=e+n*++a)<t;)i.push(r/o);return i},o.map=function(e,t){var n=new C;if(e instanceof C)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(1===arguments.length)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t.call(e,r=e[i],i),r)}else for(var a in e)n.set(a,e[a]);return n},k(C,{has:A,get:function(e){return this._[D(e)]},set:function(e,t){return this._[D(e)]=t},remove:E,keys:M,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:S(t),value:this._[t]});return e},size:T,empty:j,forEach:function(e){for(var t in this._)e.call(this,S(t),this._[t])}}),o.nest=function(){var e,t,n={},r=[],i=[];function a(i,o,s){if(s>=r.length)return t?t.call(n,o):e?o.sort(e):o;for(var l,u,c,d,f=-1,p=o.length,h=r[s++],g=new C;++f<p;)(d=g.get(l=h(u=o[f])))?d.push(u):g.set(l,[u]);return i?(u=i(),c=function(e,t){u.set(e,a(i,t,s))}):(u={},c=function(e,t){u[e]=a(i,t,s)}),g.forEach(c),u}function s(e,t){if(t>=r.length)return e;var n=[],o=i[t++];return e.forEach(function(e,r){n.push({key:e,values:s(r,t)})}),o?n.sort(function(e,t){return o(e.key,t.key)}):n}return n.map=function(e,t){return a(t,e,0)},n.entries=function(e){return s(a(o.map,e,0),0)},n.key=function(e){return r.push(e),n},n.sortKeys=function(e){return i[r.length-1]=e,n},n.sortValues=function(t){return e=t,n},n.rollup=function(e){return t=e,n},n},o.set=function(e){var t=new N;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},k(N,{has:A,add:function(e){return this._[D(e+="")]=!0,e},remove:E,values:M,size:T,empty:j,forEach:function(e){for(var t in this._)e.call(this,S(t))}}),o.behavior={},o.rebind=function(e,t){for(var n,r=1,i=arguments.length;++r<i;)e[n=arguments[r]]=O(e,t,t[n]);return e};var z=["webkit","ms","moz","Moz","o","O"];function $(){}function q(){}function R(e){var t=[],n=new C;function r(){for(var n,r=t,i=-1,o=r.length;++i<o;)(n=r[i].on)&&n.apply(this,arguments);return e}return r.on=function(r,i){var o,a=n.get(r);return arguments.length<2?a&&a.on:(a&&(a.on=null,t=t.slice(0,o=t.indexOf(a)).concat(t.slice(o+1)),n.remove(r)),i&&t.push(n.set(r,{on:i})),e)},r}function P(){o.event.preventDefault()}function L(){for(var e,t=o.event;e=t.sourceEvent;)t=e;return t}function B(e){for(var t=new q,n=0,r=arguments.length;++n<r;)t[arguments[n]]=R(t);return t.of=function(n,r){return function(i){try{var a=i.sourceEvent=o.event;i.target=e,o.event=i,t[i.type].apply(n,r)}finally{o.event=a}}},t}o.dispatch=function(){for(var e=new q,t=-1,n=arguments.length;++t<n;)e[arguments[t]]=R(e);return e},q.prototype.on=function(e,t){var n=e.indexOf("."),r="";if(n>=0&&(r=e.slice(n+1),e=e.slice(0,n)),e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},o.event=null,o.requote=function(e){return e.replace(U,"\\$&")};var U=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,V={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]};function H(e){return V(e,Q),e}var W=function(e,t){return t.querySelector(e)},G=function(e,t){return t.querySelectorAll(e)},Y=function(e,t){var n=e.matches||e[I(e,"matchesSelector")];return Y=function(e,t){return n.call(e,t)},Y(e,t)};"function"==typeof Sizzle&&(W=function(e,t){return Sizzle(e,t)[0]||null},G=Sizzle,Y=Sizzle.matchesSelector),o.selection=function(){return o.select(l.documentElement)};var Q=o.selection.prototype=[];function K(e){return"function"==typeof e?e:function(){return W(e,this)}}function Z(e){return"function"==typeof e?e:function(){return G(e,this)}}Q.select=function(e){var t,n,r,i,o=[];e=K(e);for(var a=-1,s=this.length;++a<s;){o.push(t=[]),t.parentNode=(r=this[a]).parentNode;for(var l=-1,u=r.length;++l<u;)(i=r[l])?(t.push(n=e.call(i,i.__data__,l,a)),n&&"__data__"in i&&(n.__data__=i.__data__)):t.push(null)}return H(o)},Q.selectAll=function(e){var t,n,r=[];e=Z(e);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],l=-1,u=a.length;++l<u;)(n=a[l])&&(r.push(t=s(e.call(n,n.__data__,l,i))),t.parentNode=n);return H(r)};var X="http://www.w3.org/1999/xhtml",J={svg:"http://www.w3.org/2000/svg",xhtml:X,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ee(e,t){return e=o.ns.qualify(e),null==t?e.local?function(){this.removeAttributeNS(e.space,e.local)}:function(){this.removeAttribute(e)}:"function"==typeof t?e.local?function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}:function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}:e.local?function(){this.setAttributeNS(e.space,e.local,t)}:function(){this.setAttribute(e,t)}}function te(e){return e.trim().replace(/\s+/g," ")}function ne(e){return new RegExp("(?:^|\\s+)"+o.requote(e)+"(?:\\s+|$)","g")}function re(e){return(e+"").trim().split(/^|\s+/)}function ie(e,t){var n=(e=re(e).map(oe)).length;return"function"==typeof t?function(){for(var r=-1,i=t.apply(this,arguments);++r<n;)e[r](this,i)}:function(){for(var r=-1;++r<n;)e[r](this,t)}}function oe(e){var t=ne(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||n.setAttribute("class",te(i+" "+e))):n.setAttribute("class",te(i.replace(t," ")))}}function ae(e,t,n){return null==t?function(){this.style.removeProperty(e)}:"function"==typeof t?function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}:function(){this.style.setProperty(e,t,n)}}function se(e,t){return null==t?function(){delete this[e]}:"function"==typeof t?function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}:function(){this[e]=t}}function le(e){return"function"==typeof e?e:(e=o.ns.qualify(e)).local?function(){return this.ownerDocument.createElementNS(e.space,e.local)}:function(){var t=this.ownerDocument,n=this.namespaceURI;return n===X&&t.documentElement.namespaceURI===X?t.createElement(e):t.createElementNS(n,e)}}function ue(){var e=this.parentNode;e&&e.removeChild(this)}function ce(e){return{__data__:e}}function de(e){return function(){return Y(this,e)}}function fe(e){return arguments.length||(e=m),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function pe(e,t){for(var n=0,r=e.length;n<r;n++)for(var i,o=e[n],a=0,s=o.length;a<s;a++)(i=o[a])&&t(i,a,n);return e}function he(e){return V(e,ge),e}o.ns={prefix:J,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&"xmlns"!==(n=e.slice(0,t))&&(e=e.slice(t+1)),J.hasOwnProperty(n)?{space:J[n],local:e}:e}},Q.attr=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node();return(e=o.ns.qualify(e)).local?n.getAttributeNS(e.space,e.local):n.getAttribute(e)}for(t in e)this.each(ee(t,e[t]));return this}return this.each(ee(e,t))},Q.classed=function(e,t){if(arguments.length<2){if("string"==typeof e){var n=this.node(),r=(e=re(e)).length,i=-1;if(t=n.classList){for(;++i<r;)if(!t.contains(e[i]))return!1}else for(t=n.getAttribute("class");++i<r;)if(!ne(e[i]).test(t))return!1;return!0}for(t in e)this.each(ie(t,e[t]));return this}return this.each(ie(e,t))},Q.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.each(ae(n,e[n],t));return this}if(r<2){var i=this.node();return c(i).getComputedStyle(i,null).getPropertyValue(e)}n=""}return this.each(ae(e,t,n))},Q.property=function(e,t){if(arguments.length<2){if("string"==typeof e)return this.node()[e];for(t in e)this.each(se(t,e[t]));return this}return this.each(se(e,t))},Q.text=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},Q.html=function(e){return arguments.length?this.each("function"==typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},Q.append=function(e){return e=le(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},Q.insert=function(e,t){return e=le(e),t=K(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},Q.remove=function(){return this.each(ue)},Q.data=function(e,t){var n,r,i=-1,o=this.length;if(!arguments.length){for(e=new Array(o=(n=this[0]).length);++i<o;)(r=n[i])&&(e[i]=r.__data__);return e}function a(e,n){var r,i,o,a=e.length,c=n.length,d=Math.min(a,c),f=new Array(c),p=new Array(c),h=new Array(a);if(t){var g,m=new C,v=new Array(a);for(r=-1;++r<a;)(i=e[r])&&(m.has(g=t.call(i,i.__data__,r))?h[r]=i:m.set(g,i),v[r]=g);for(r=-1;++r<c;)(i=m.get(g=t.call(n,o=n[r],r)))?!0!==i&&(f[r]=i,i.__data__=o):p[r]=ce(o),m.set(g,!0);for(r=-1;++r<a;)r in v&&!0!==m.get(v[r])&&(h[r]=e[r])}else{for(r=-1;++r<d;)i=e[r],o=n[r],i?(i.__data__=o,f[r]=i):p[r]=ce(o);for(;r<c;++r)p[r]=ce(n[r]);for(;r<a;++r)h[r]=e[r]}p.update=f,p.parentNode=f.parentNode=h.parentNode=e.parentNode,s.push(p),l.push(f),u.push(h)}var s=he([]),l=H([]),u=H([]);if("function"==typeof e)for(;++i<o;)a(n=this[i],e.call(n,n.parentNode.__data__,i));else for(;++i<o;)a(n=this[i],e);return l.enter=function(){return s},l.exit=function(){return u},l},Q.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},Q.filter=function(e){var t,n,r,i=[];"function"!=typeof e&&(e=de(e));for(var o=0,a=this.length;o<a;o++){i.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var s=0,l=n.length;s<l;s++)(r=n[s])&&e.call(r,r.__data__,s,o)&&t.push(r)}return H(i)},Q.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n,r=this[e],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},Q.sort=function(e){e=fe.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},Q.each=function(e){return pe(this,function(t,n,r){e.call(t,t.__data__,n,r)})},Q.call=function(e){var t=s(arguments);return e.apply(t[0]=this,t),this},Q.empty=function(){return!this.node()},Q.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var o=n[r];if(o)return o}return null},Q.size=function(){var e=0;return pe(this,function(){++e}),e};var ge=[];function me(e,t,n){var r="__on"+e,i=e.indexOf("."),a=ye;i>0&&(e=e.slice(0,i));var l=ve.get(e);function u(){var t=this[r];t&&(this.removeEventListener(e,t,t.$),delete this[r])}return l&&(e=l,a=_e),i?t?function(){var i=a(t,s(arguments));u.call(this),this.addEventListener(e,this[r]=i,i.$=n),i._=t}:u:t?$:function(){var t,n=new RegExp("^__on([^.]+)"+o.requote(e)+"$");for(var r in this)if(t=r.match(n)){var i=this[r];this.removeEventListener(t[1],i,i.$),delete this[r]}}}o.selection.enter=he,o.selection.enter.prototype=ge,ge.append=Q.append,ge.empty=Q.empty,ge.node=Q.node,ge.call=Q.call,ge.size=Q.size,ge.select=function(e){for(var t,n,r,i,o,a=[],s=-1,l=this.length;++s<l;){r=(i=this[s]).update,a.push(t=[]),t.parentNode=i.parentNode;for(var u=-1,c=i.length;++u<c;)(o=i[u])?(t.push(r[u]=n=e.call(i.parentNode,o.__data__,u,s)),n.__data__=o.__data__):t.push(null)}return H(a)},ge.insert=function(e,t){var n,r,i;return arguments.length<2&&(n=this,t=function(e,t,o){var a,s=n[o].update,l=s.length;for(o!=i&&(i=o,r=0),t>=r&&(r=t+1);!(a=s[r])&&++r<l;);return a}),Q.insert.call(this,e,t)},o.select=function(e){var t;return"string"==typeof e?(t=[W(e,l)]).parentNode=l.documentElement:(t=[e]).parentNode=u(e),H([t])},o.selectAll=function(e){var t;return"string"==typeof e?(t=s(G(e,l))).parentNode=l.documentElement:(t=s(e)).parentNode=null,H([t])},Q.on=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=!1),e)this.each(me(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(me(e,t,n))};var ve=o.map({mouseenter:"mouseover",mouseleave:"mouseout"});function ye(e,t){return function(n){var r=o.event;o.event=n,t[0]=this.__data__;try{e.apply(this,t)}finally{o.event=r}}}function _e(e,t){var n=ye(e,t);return function(e){var t=this,r=e.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||n.call(t,e)}}l&&ve.forEach(function(e){"on"+e in l&&ve.remove(e)});var be,we=0;function xe(e){var t=".dragsuppress-"+ ++we,n="click"+t,r=o.select(c(e)).on("touchmove"+t,P).on("dragstart"+t,P).on("selectstart"+t,P);if(null==be&&(be=!("onselectstart"in e)&&I(e.style,"userSelect")),be){var i=u(e).style,a=i[be];i[be]="none"}return function(e){if(r.on(t,null),be&&(i[be]=a),e){var o=function(){r.on(n,null)};r.on(n,function(){P(),o()},!0),setTimeout(o,0)}}}o.mouse=function(e){return Ce(e,L())};var ke=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function Ce(e,t){t.changedTouches&&(t=t.changedTouches[0]);var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(ke<0){var i=c(e);if(i.scrollX||i.scrollY){var a=(n=o.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();ke=!(a.f||a.e),n.remove()}}return ke?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}function De(){return o.event.changedTouches[0].identifier}o.touch=function(e,t,n){if(arguments.length<3&&(n=t,t=L().changedTouches),t)for(var r,i=0,o=t.length;i<o;++i)if((r=t[i]).identifier===n)return Ce(e,r)},o.behavior.drag=function(){var e=B(i,"drag","dragstart","dragend"),t=null,n=a($,o.mouse,c,"mousemove","mouseup"),r=a(De,o.touch,F,"touchmove","touchend");function i(){this.on("mousedown.drag",n).on("touchstart.drag",r)}function a(n,r,i,a,s){return function(){var l,u=this,c=o.event.target.correspondingElement||o.event.target,d=u.parentNode,f=e.of(u,arguments),p=0,h=n(),g=".drag"+(null==h?"":"-"+h),m=o.select(i(c)).on(a+g,function(){var e,t,n=r(d,h);n&&(e=n[0]-y[0],t=n[1]-y[1],p|=e|t,y=n,f({type:"drag",x:n[0]+l[0],y:n[1]+l[1],dx:e,dy:t}))}).on(s+g,function(){r(d,h)&&(m.on(a+g,null).on(s+g,null),v(p),f({type:"dragend"}))}),v=xe(c),y=r(d,h);l=t?[(l=t.apply(u,arguments)).x-y[0],l.y-y[1]]:[0,0],f({type:"dragstart"})}}return i.origin=function(e){return arguments.length?(t=e,i):t},o.rebind(i,e,"on")},o.touches=function(e,t){return arguments.length<2&&(t=L().touches),t?s(t).map(function(t){var n=Ce(e,t);return n.identifier=t.identifier,n}):[]};var Se=1e-6,Ae=Se*Se,Ee=Math.PI,Me=2*Ee,Te=Me-Se,je=Ee/2,Ne=Ee/180,Fe=180/Ee;function Oe(e){return e>0?1:e<0?-1:0}function Ie(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function ze(e){return e>1?0:e<-1?Ee:Math.acos(e)}function $e(e){return e>1?je:e<-1?-je:Math.asin(e)}function qe(e){return((e=Math.exp(e))+1/e)/2}function Re(e){return(e=Math.sin(e/2))*e}var Pe=Math.SQRT2;o.interpolateZoom=function(e,t){var n,r,i=e[0],o=e[1],a=e[2],s=t[0],l=t[1],u=t[2],c=s-i,d=l-o,f=c*c+d*d;if(f<Ae)r=Math.log(u/a)/Pe,n=function(e){return[i+e*c,o+e*d,a*Math.exp(Pe*e*r)]};else{var p=Math.sqrt(f),h=(u*u-a*a+4*f)/(2*a*2*p),g=(u*u-a*a-4*f)/(2*u*2*p),m=Math.log(Math.sqrt(h*h+1)-h),v=Math.log(Math.sqrt(g*g+1)-g);r=(v-m)/Pe,n=function(e){var t,n=e*r,s=qe(m),l=a/(2*p)*(s*(t=Pe*n+m,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(m));return[i+l*c,o+l*d,a*s/qe(Pe*n+m)]}}return n.duration=1e3*r,n},o.behavior.zoom=function(){var e,t,n,r,i,a,s,u,d,f={x:0,y:0,k:1},p=[960,500],h=Ue,g=250,m=0,v="mousedown.zoom",y="mousemove.zoom",_="mouseup.zoom",b="touchstart.zoom",w=B(x,"zoomstart","zoom","zoomend");function x(e){e.on(v,j).on(Be+".zoom",F).on("dblclick.zoom",O).on(b,N)}function k(e){return[(e[0]-f.x)/f.k,(e[1]-f.y)/f.k]}function C(e){f.k=Math.max(h[0],Math.min(h[1],e))}function D(e,t){t=function(e){return[e[0]*f.k+f.x,e[1]*f.k+f.y]}(t),f.x+=e[0]-t[0],f.y+=e[1]-t[1]}function S(e,n,r,i){e.__chart__={x:f.x,y:f.y,k:f.k},C(Math.pow(2,i)),D(t=n,r),e=o.select(e),g>0&&(e=e.transition().duration(g)),e.call(x.event)}function A(){s&&s.domain(a.range().map(function(e){return(e-f.x)/f.k}).map(a.invert)),d&&d.domain(u.range().map(function(e){return(e-f.y)/f.k}).map(u.invert))}function E(e){m++||e({type:"zoomstart"})}function M(e){A(),e({type:"zoom",scale:f.k,translate:[f.x,f.y]})}function T(e){--m||(e({type:"zoomend"}),t=null)}function j(){var e=this,t=w.of(e,arguments),n=0,r=o.select(c(e)).on(y,function(){n=1,D(o.mouse(e),i),M(t)}).on(_,function(){r.on(y,null).on(_,null),a(n),T(t)}),i=k(o.mouse(e)),a=xe(e);Ts.call(e),E(t)}function N(){var e,t=this,n=w.of(t,arguments),r={},a=0,s=".zoom-"+o.event.changedTouches[0].identifier,l="touchmove"+s,u="touchend"+s,c=[],d=o.select(t),p=xe(t);function h(){var n=o.touches(t);return e=f.k,n.forEach(function(e){e.identifier in r&&(r[e.identifier]=k(e))}),n}function g(){var e=o.event.target;o.select(e).on(l,m).on(u,y),c.push(e);for(var n=o.event.changedTouches,s=0,d=n.length;s<d;++s)r[n[s].identifier]=null;var p=h(),g=Date.now();if(1===p.length){if(g-i<500){var v=p[0];S(t,v,r[v.identifier],Math.floor(Math.log(f.k)/Math.LN2)+1),P()}i=g}else if(p.length>1){v=p[0];var _=p[1],b=v[0]-_[0],w=v[1]-_[1];a=b*b+w*w}}function m(){var s,l,u,c,d=o.touches(t);Ts.call(t);for(var f=0,p=d.length;f<p;++f,c=null)if(u=d[f],c=r[u.identifier]){if(l)break;s=u,l=c}if(c){var h=(h=u[0]-s[0])*h+(h=u[1]-s[1])*h,g=a&&Math.sqrt(h/a);s=[(s[0]+u[0])/2,(s[1]+u[1])/2],l=[(l[0]+c[0])/2,(l[1]+c[1])/2],C(g*e)}i=null,D(s,l),M(n)}function y(){if(o.event.touches.length){for(var e=o.event.changedTouches,t=0,i=e.length;t<i;++t)delete r[e[t].identifier];for(var a in r)return void h()}o.selectAll(c).on(s,null),d.on(v,j).on(b,N),p(),T(n)}g(),E(n),d.on(v,null).on(b,g)}function F(){var i=w.of(this,arguments);r?clearTimeout(r):(Ts.call(this),e=k(t=n||o.mouse(this)),E(i)),r=setTimeout(function(){r=null,T(i)},50),P(),C(Math.pow(2,.002*Le())*f.k),D(t,e),M(i)}function O(){var e=o.mouse(this),t=Math.log(f.k)/Math.LN2;S(this,e,k(e),o.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}return Be||(Be="onwheel"in l?(Le=function(){return-o.event.deltaY*(o.event.deltaMode?120:1)},"wheel"):"onmousewheel"in l?(Le=function(){return o.event.wheelDelta},"mousewheel"):(Le=function(){return-o.event.detail},"MozMousePixelScroll")),x.event=function(e){e.each(function(){var e=w.of(this,arguments),n=f;Fs?o.select(this).transition().each("start.zoom",function(){f=this.__chart__||{x:0,y:0,k:1},E(e)}).tween("zoom:zoom",function(){var r=p[0],i=p[1],a=t?t[0]:r/2,s=t?t[1]:i/2,l=o.interpolateZoom([(a-f.x)/f.k,(s-f.y)/f.k,r/f.k],[(a-n.x)/n.k,(s-n.y)/n.k,r/n.k]);return function(t){var n=l(t),i=r/n[2];this.__chart__=f={x:a-n[0]*i,y:s-n[1]*i,k:i},M(e)}}).each("interrupt.zoom",function(){T(e)}).each("end.zoom",function(){T(e)}):(this.__chart__=f,E(e),M(e),T(e))})},x.translate=function(e){return arguments.length?(f={x:+e[0],y:+e[1],k:f.k},A(),x):[f.x,f.y]},x.scale=function(e){return arguments.length?(f={x:f.x,y:f.y,k:null},C(+e),A(),x):f.k},x.scaleExtent=function(e){return arguments.length?(h=null==e?Ue:[+e[0],+e[1]],x):h},x.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],x):n},x.size=function(e){return arguments.length?(p=e&&[+e[0],+e[1]],x):p},x.duration=function(e){return arguments.length?(g=+e,x):g},x.x=function(e){return arguments.length?(s=e,a=e.copy(),f={x:0,y:0,k:1},x):s},x.y=function(e){return arguments.length?(d=e,u=e.copy(),f={x:0,y:0,k:1},x):d},o.rebind(x,w,"on")};var Le,Be,Ue=[0,1/0];function Ve(){}function He(e,t,n){return this instanceof He?(this.h=+e,this.s=+t,void(this.l=+n)):arguments.length<2?e instanceof He?new He(e.h,e.s,e.l):ft(""+e,pt,He):new He(e,t,n)}o.color=Ve,Ve.prototype.toString=function(){return this.rgb()+""},o.hsl=He;var We=He.prototype=new Ve;function Ge(e,t,n){var r,i;function o(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,r=2*(n=n<0?0:n>1?1:n)-(i=n<=.5?n*(1+t):n+t-n*t),new st(o(e+120),o(e),o(e-120))}function Ye(e,t,n){return this instanceof Ye?(this.h=+e,this.c=+t,void(this.l=+n)):arguments.length<2?e instanceof Ye?new Ye(e.h,e.c,e.l):function(e,t,n){return e>0?new Ye(Math.atan2(n,t)*Fe,Math.sqrt(t*t+n*n),e):new Ye(NaN,NaN,e)}(e instanceof Ze?e.l:(e=ht((e=o.rgb(e)).r,e.g,e.b)).l,e.a,e.b):new Ye(e,t,n)}We.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new He(this.h,this.s,this.l/e)},We.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new He(this.h,this.s,e*this.l)},We.rgb=function(){return Ge(this.h,this.s,this.l)},o.hcl=Ye;var Qe=Ye.prototype=new Ve;function Ke(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new Ze(n,Math.cos(e*=Ne)*t,Math.sin(e)*t)}function Ze(e,t,n){return this instanceof Ze?(this.l=+e,this.a=+t,void(this.b=+n)):arguments.length<2?e instanceof Ze?new Ze(e.l,e.a,e.b):e instanceof Ye?Ke(e.h,e.c,e.l):ht((e=st(e)).r,e.g,e.b):new Ze(e,t,n)}Qe.brighter=function(e){return new Ye(this.h,this.c,Math.min(100,this.l+Xe*(arguments.length?e:1)))},Qe.darker=function(e){return new Ye(this.h,this.c,Math.max(0,this.l-Xe*(arguments.length?e:1)))},Qe.rgb=function(){return Ke(this.h,this.c,this.l).rgb()},o.lab=Ze;var Xe=18,Je=.95047,et=1,tt=1.08883,nt=Ze.prototype=new Ve;function rt(e,t,n){var r=(e+16)/116,i=r+t/500,o=r-n/200;return new st(at(3.2404542*(i=it(i)*Je)-1.5371385*(r=it(r)*et)-.4985314*(o=it(o)*tt)),at(-.969266*i+1.8760108*r+.041556*o),at(.0556434*i-.2040259*r+1.0572252*o))}function it(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function ot(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function at(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function st(e,t,n){return this instanceof st?(this.r=~~e,this.g=~~t,void(this.b=~~n)):arguments.length<2?e instanceof st?new st(e.r,e.g,e.b):ft(""+e,st,Ge):new st(e,t,n)}function lt(e){return new st(e>>16,e>>8&255,255&e)}function ut(e){return lt(e)+""}nt.brighter=function(e){return new Ze(Math.min(100,this.l+Xe*(arguments.length?e:1)),this.a,this.b)},nt.darker=function(e){return new Ze(Math.max(0,this.l-Xe*(arguments.length?e:1)),this.a,this.b)},nt.rgb=function(){return rt(this.l,this.a,this.b)},o.rgb=st;var ct=st.prototype=new Ve;function dt(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function ft(e,t,n){var r,i,o,a=0,s=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(mt(i[0]),mt(i[1]),mt(i[2]))}return(o=vt.get(e))?t(o.r,o.g,o.b):(null==e||"#"!==e.charAt(0)||isNaN(o=parseInt(e.slice(1),16))||(4===e.length?(a=(3840&o)>>4,a|=a>>4,s=240&o,s|=s>>4,l=15&o,l|=l<<4):7===e.length&&(a=(16711680&o)>>16,s=(65280&o)>>8,l=255&o)),t(a,s,l))}function pt(e,t,n){var r,i,o=Math.min(e/=255,t/=255,n/=255),a=Math.max(e,t,n),s=a-o,l=(a+o)/2;return s?(i=l<.5?s/(a+o):s/(2-a-o),r=e==a?(t-n)/s+(t<n?6:0):t==a?(n-e)/s+2:(e-t)/s+4,r*=60):(r=NaN,i=l>0&&l<1?0:r),new He(r,i,l)}function ht(e,t,n){var r=ot((.4124564*(e=gt(e))+.3575761*(t=gt(t))+.1804375*(n=gt(n)))/Je),i=ot((.2126729*e+.7151522*t+.072175*n)/et);return Ze(116*i-16,500*(r-i),200*(i-ot((.0193339*e+.119192*t+.9503041*n)/tt)))}function gt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function mt(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}ct.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return t||n||r?(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new st(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e))):new st(i,i,i)},ct.darker=function(e){return new st((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},ct.hsl=function(){return pt(this.r,this.g,this.b)},ct.toString=function(){return"#"+dt(this.r)+dt(this.g)+dt(this.b)};var vt=o.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function yt(e){return"function"==typeof e?e:function(){return e}}function _t(e){return function(t,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),bt(t,n,e,r)}}function bt(e,t,n,r){var i={},a=o.dispatch("beforesend","progress","load","error"),l={},u=new XMLHttpRequest,c=null;function d(){var e,t=u.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(u)||t>=200&&t<300||304===t){try{e=n.call(i,u)}catch(e){return void a.error.call(i,e)}a.load.call(i,e)}else a.error.call(i,u)}return this.XDomainRequest&&!("withCredentials"in u)&&/^(http(s)?:)?\/\//.test(e)&&(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=d:u.onreadystatechange=function(){u.readyState>3&&d()},u.onprogress=function(e){var t=o.event;o.event=e;try{a.progress.call(i,u)}finally{o.event=t}},i.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",i)},i.mimeType=function(e){return arguments.length?(t=null==e?null:e+"",i):t},i.responseType=function(e){return arguments.length?(c=e,i):c},i.response=function(e){return n=e,i},["get","post"].forEach(function(e){i[e]=function(){return i.send.apply(i,[e].concat(s(arguments)))}}),i.send=function(n,r,o){if(2===arguments.length&&"function"==typeof r&&(o=r,r=null),u.open(n,e,!0),null==t||"accept"in l||(l.accept=t+",*/*"),u.setRequestHeader)for(var s in l)u.setRequestHeader(s,l[s]);return null!=t&&u.overrideMimeType&&u.overrideMimeType(t),null!=c&&(u.responseType=c),null!=o&&i.on("error",o).on("load",function(e){o(null,e)}),a.beforesend.call(i,u),u.send(null==r?null:r),i},i.abort=function(){return u.abort(),i},o.rebind(i,a,"on"),null==r?i:i.get(function(e){return 1===e.length?function(t,n){e(null==t?n:null)}:e}(r))}vt.forEach(function(e,t){vt.set(e,lt(t))}),o.functor=yt,o.xhr=_t(F),o.dsv=function(e,t){var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=bt(e,t,null==n?o:a(n),r);return i.row=function(e){return arguments.length?i.response(null==(n=e)?o:a(e)):n},i}function o(e){return i.parse(e.responseText)}function a(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var n;return i.parseRows(e,function(e,r){if(n)return n(e,r-1);var i=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");n=t?function(e,n){return t(i(e),n)}:i})},i.parseRows=function(e,t){var n,i,o={},a={},s=[],l=e.length,u=0,c=0;function d(){if(u>=l)return a;if(i)return i=!1,o;var t=u;if(34===e.charCodeAt(t)){for(var n=t;n++<l;)if(34===e.charCodeAt(n)){if(34!==e.charCodeAt(n+1))break;++n}return u=n+2,13===(s=e.charCodeAt(n+1))?(i=!0,10===e.charCodeAt(n+2)&&++u):10===s&&(i=!0),e.slice(t+1,n).replace(/""/g,'"')}for(;u<l;){var s,c=1;if(10===(s=e.charCodeAt(u++)))i=!0;else if(13===s)i=!0,10===e.charCodeAt(u)&&(++u,++c);else if(s!==r)continue;return e.slice(t,u-c)}return e.slice(t)}for(;(n=d())!==a;){for(var f=[];n!==o&&n!==a;)f.push(n),n=d();t&&null==(f=t(f,c++))||s.push(f)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var n=new N,r=[];return t.forEach(function(e){for(var t in e)n.has(t)||r.push(n.add(t))}),[r.map(l).join(e)].concat(t.map(function(t){return r.map(function(e){return l(t[e])}).join(e)})).join("\n")},i.formatRows=function(e){return e.map(s).join("\n")},i},o.csv=o.dsv(",","text/csv"),o.tsv=o.dsv("\t","text/tab-separated-values");var wt,xt,kt,Ct,Dt=this[I(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function St(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i={c:e,t:n+t,n:null};return xt?xt.n=i:wt=i,xt=i,kt||(Ct=clearTimeout(Ct),kt=1,Dt(At)),i}function At(){var e=Et(),t=Mt()-e;t>24?(isFinite(t)&&(clearTimeout(Ct),Ct=setTimeout(At,t)),kt=0):(kt=1,Dt(At))}function Et(){for(var e=Date.now(),t=wt;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Mt(){for(var e,t=wt,n=1/0;t;)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:wt=t.n;return xt=e,n}function Tt(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}o.timer=function(){St.apply(this,arguments)},o.timer.flush=function(){Et(),Mt()},o.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var jt=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(function(e,t){var n=Math.pow(10,3*x(8-t));return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}});function Nt(e){var t=e.decimal,n=e.thousands,r=e.grouping,i=e.currency,a=r&&n?function(e,t){for(var i=e.length,o=[],a=0,s=r[0],l=0;i>0&&s>0&&(l+s+1>t&&(s=Math.max(1,t-l)),o.push(e.substring(i-=s,i+s)),!((l+=s+1)>t));)s=r[a=(a+1)%r.length];return o.reverse().join(n)}:F;return function(e){var n=Ft.exec(e),r=n[1]||" ",s=n[2]||">",l=n[3]||"-",u=n[4]||"",c=n[5],d=+n[6],f=n[7],p=n[8],h=n[9],g=1,m="",v="",y=!1,_=!0;switch(p&&(p=+p.substring(1)),(c||"0"===r&&"="===s)&&(c=r="0",s="="),h){case"n":f=!0,h="g";break;case"%":g=100,v="%",h="f";break;case"p":g=100,v="%",h="r";break;case"b":case"o":case"x":case"X":"#"===u&&(m="0"+h.toLowerCase());case"c":_=!1;case"d":y=!0,p=0;break;case"s":g=-1,h="r"}"$"===u&&(m=i[0],v=i[1]),"r"!=h||p||(h="g"),null!=p&&("g"==h?p=Math.max(1,Math.min(21,p)):"e"!=h&&"f"!=h||(p=Math.max(0,Math.min(20,p)))),h=Ot.get(h)||It;var b=c&&f;return function(e){var n=v;if(y&&e%1)return"";var i=e<0||0===e&&1/e<0?(e=-e,"-"):"-"===l?"":l;if(g<0){var u=o.formatPrefix(e,p);e=u.scale(e),n=u.symbol+v}else e*=g;var w,x,k=(e=h(e,p)).lastIndexOf(".");if(k<0){var C=_?e.lastIndexOf("e"):-1;C<0?(w=e,x=""):(w=e.substring(0,C),x=e.substring(C))}else w=e.substring(0,k),x=t+e.substring(k+1);!c&&f&&(w=a(w,1/0));var D=m.length+w.length+x.length+(b?0:i.length),S=D<d?new Array(D=d-D+1).join(r):"";return b&&(w=a(S+w,S.length?d-x.length:1/0)),i+=m,e=w+x,("<"===s?i+e+S:">"===s?S+i+e:"^"===s?S.substring(0,D>>=1)+i+e+S.substring(D):i+(b?e:S+e))+n}}}o.formatPrefix=function(e,t){var n=0;return(e=+e)&&(e<0&&(e*=-1),t&&(e=o.round(e,Tt(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),jt[8+n/3]};var Ft=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ot=o.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return(e=o.round(e,Tt(e,t))).toFixed(Math.max(0,Math.min(20,Tt(e*(1+1e-15),t))))}});function It(e){return e+""}var zt=o.time={},$t=Date;function qt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}qt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Rt.setUTCDate.apply(this._,arguments)},setDay:function(){Rt.setUTCDay.apply(this._,arguments)},setFullYear:function(){Rt.setUTCFullYear.apply(this._,arguments)},setHours:function(){Rt.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Rt.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Rt.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Rt.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Rt.setUTCSeconds.apply(this._,arguments)},setTime:function(){Rt.setTime.apply(this._,arguments)}};var Rt=Date.prototype;function Pt(e,t,n){function r(t){var n=e(t),r=o(n,1);return t-n<r-t?n:r}function i(n){return t(n=e(new $t(n-1)),1),n}function o(e,n){return t(e=new $t(+e),n),e}function a(e,r,o){var a=i(e),s=[];if(o>1)for(;a<r;)n(a)%o||s.push(new Date(+a)),t(a,1);else for(;a<r;)s.push(new Date(+a)),t(a,1);return s}e.floor=e,e.round=r,e.ceil=i,e.offset=o,e.range=a;var s=e.utc=Lt(e);return s.floor=s,s.round=Lt(r),s.ceil=Lt(i),s.offset=Lt(o),s.range=function(e,t,n){try{$t=qt;var r=new qt;return r._=e,a(r,t,n)}finally{$t=Date}},e}function Lt(e){return function(t,n){try{$t=qt;var r=new qt;return r._=t,e(r,n)._}finally{$t=Date}}}function Bt(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,s=e.shortDays,l=e.months,u=e.shortMonths;function c(e){var t=e.length;function n(n){for(var r,i,o,a=[],s=-1,l=0;++s<t;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Ut[r=e.charAt(++s)])&&(r=e.charAt(++s)),(o=w[r])&&(r=o(n,null==i?"e"===r?" ":"0":i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}return n.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null};if(d(n,e,t,0)!=t.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var r=null!=n.Z&&$t!==qt,i=new(r?qt:$t);return"j"in n?i.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),i.setFullYear(n.y,0,1),i.setFullYear(n.y,0,"W"in n?(n.w+6)%7+7*n.W-(i.getDay()+5)%7:n.w+7*n.U-(i.getDay()+6)%7)):i.setFullYear(n.y,n.m,n.d),i.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),r?i._:i},n.toString=function(){return e},n}function d(e,t,n,r){for(var i,o,a,s=0,l=t.length,u=n.length;s<l;){if(r>=u)return-1;if(37===(i=t.charCodeAt(s++))){if(a=t.charAt(s++),!(o=x[a in Ut?t.charAt(s++):a])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}c.utc=function(e){var t=c(e);function n(e){try{var n=new($t=qt);return n._=e,t(n)}finally{$t=Date}}return n.parse=function(e){try{$t=qt;var n=t.parse(e);return n&&n._}finally{$t=Date}},n.toString=t.toString,n},c.multi=c.utc.multi=dn;var f=o.map(),p=Gt(a),h=Yt(a),g=Gt(s),m=Yt(s),v=Gt(l),y=Yt(l),_=Gt(u),b=Yt(u);i.forEach(function(e,t){f.set(e.toLowerCase(),t)});var w={a:function(e){return s[e.getDay()]},A:function(e){return a[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return l[e.getMonth()]},c:c(t),d:function(e,t){return Wt(e.getDate(),t,2)},e:function(e,t){return Wt(e.getDate(),t,2)},H:function(e,t){return Wt(e.getHours(),t,2)},I:function(e,t){return Wt(e.getHours()%12||12,t,2)},j:function(e,t){return Wt(1+zt.dayOfYear(e),t,3)},L:function(e,t){return Wt(e.getMilliseconds(),t,3)},m:function(e,t){return Wt(e.getMonth()+1,t,2)},M:function(e,t){return Wt(e.getMinutes(),t,2)},p:function(e){return i[+(e.getHours()>=12)]},S:function(e,t){return Wt(e.getSeconds(),t,2)},U:function(e,t){return Wt(zt.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return Wt(zt.mondayOfYear(e),t,2)},x:c(n),X:c(r),y:function(e,t){return Wt(e.getFullYear()%100,t,2)},Y:function(e,t){return Wt(e.getFullYear()%1e4,t,4)},Z:un,"%":function(){return"%"}},x={a:function(e,t,n){g.lastIndex=0;var r=g.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){p.lastIndex=0;var r=p.exec(t.slice(n));return r?(e.w=h.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){_.lastIndex=0;var r=_.exec(t.slice(n));return r?(e.m=b.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){v.lastIndex=0;var r=v.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,t,n){return d(e,w.c.toString(),t,n)},d:nn,e:nn,H:on,I:on,j:rn,L:ln,m:tn,M:an,p:function(e,t,n){var r=f.get(t.slice(n,n+=2).toLowerCase());return null==r?-1:(e.p=r,n)},S:sn,U:Kt,w:Qt,W:Zt,x:function(e,t,n){return d(e,w.x.toString(),t,n)},X:function(e,t,n){return d(e,w.X.toString(),t,n)},y:Jt,Y:Xt,Z:en,"%":cn};return c}zt.year=Pt(function(e){return(e=zt.day(e)).setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),zt.years=zt.year.range,zt.years.utc=zt.year.utc.range,zt.day=Pt(function(e){var t=new $t(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),zt.days=zt.day.range,zt.days.utc=zt.day.utc.range,zt.dayOfYear=function(e){var t=zt.year(e);return Math.floor((e-t-6e4*(e.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=zt[e]=Pt(function(e){return(e=zt.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+7*Math.floor(t))},function(e){var n=zt.year(e).getDay();return Math.floor((zt.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});zt[e+"s"]=n.range,zt[e+"s"].utc=n.utc.range,zt[e+"OfYear"]=function(e){var n=zt.year(e).getDay();return Math.floor((zt.dayOfYear(e)+(n+t)%7)/7)}}),zt.week=zt.sunday,zt.weeks=zt.sunday.range,zt.weeks.utc=zt.sunday.utc.range,zt.weekOfYear=zt.sundayOfYear;var Ut={"-":"",_:" ",0:"0"},Vt=/^\s*\d+/,Ht=/^%/;function Wt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function Gt(e){return new RegExp("^(?:"+e.map(o.requote).join("|")+")","i")}function Yt(e){for(var t=new C,n=-1,r=e.length;++n<r;)t.set(e[n].toLowerCase(),n);return t}function Qt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Kt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function Zt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function Xt(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function Jt(e,t,n){Vt.lastIndex=0;var r,i=Vt.exec(t.slice(n,n+2));return i?(e.y=(r=+i[0])+(r>68?1900:2e3),n+i[0].length):-1}function en(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function tn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function nn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function rn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function on(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function an(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function sn(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ln(e,t,n){Vt.lastIndex=0;var r=Vt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function un(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=x(t)/60|0,i=x(t)%60;return n+Wt(r,"0",2)+Wt(i,"0",2)}function cn(e,t,n){Ht.lastIndex=0;var r=Ht.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function dn(e){for(var t=e.length,n=-1;++n<t;)e[n][0]=this(e[n][0]);return function(t){for(var n=0,r=e[n];!r[1](t);)r=e[++n];return r[0](t)}}o.locale=function(e){return{numberFormat:Nt(e),timeFormat:Bt(e)}};var fn=o.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function pn(){}o.format=fn.numberFormat,o.geo={},pn.prototype={s:0,t:0,add:function(e){gn(e,this.t,hn),gn(hn.s,this.s,this),this.s?this.t+=hn.t:this.s=hn.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var hn=new pn;function gn(e,t,n){var r=n.s=e+t,i=r-e,o=r-i;n.t=e-o+(t-i)}function mn(e,t){e&&yn.hasOwnProperty(e.type)&&yn[e.type](e,t)}o.geo.stream=function(e,t){e&&vn.hasOwnProperty(e.type)?vn[e.type](e,t):mn(e,t)};var vn={Feature:function(e,t){mn(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++r<i;)mn(n[r].geometry,t)}},yn={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){_n(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)_n(n[r],t,0)},Polygon:function(e,t){bn(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,i=n.length;++r<i;)bn(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,i=n.length;++r<i;)mn(n[r],t)}};function _n(e,t,n){var r,i=-1,o=e.length-n;for(t.lineStart();++i<o;)r=e[i],t.point(r[0],r[1],r[2]);t.lineEnd()}function bn(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)_n(e[n],t,1);t.polygonEnd()}o.geo.area=function(e){return wn=0,o.geo.stream(e,On),wn};var wn,xn,kn,Cn,Dn,Sn,An,En,Mn,Tn,jn,Nn,Fn=new pn,On={sphere:function(){wn+=4*Ee},point:$,lineStart:$,lineEnd:$,polygonStart:function(){Fn.reset(),On.lineStart=In},polygonEnd:function(){var e=2*Fn;wn+=e<0?4*Ee+e:e,On.lineStart=On.lineEnd=On.point=$}};function In(){var e,t,n,r,i;function o(e,t){t=t*Ne/2+Ee/4;var o=(e*=Ne)-n,a=o>=0?1:-1,s=a*o,l=Math.cos(t),u=Math.sin(t),c=i*u,d=r*l+c*Math.cos(s),f=c*a*Math.sin(s);Fn.add(Math.atan2(f,d)),n=e,r=l,i=u}On.point=function(a,s){On.point=o,n=(e=a)*Ne,r=Math.cos(s=(t=s)*Ne/2+Ee/4),i=Math.sin(s)},On.lineEnd=function(){o(e,t)}}function zn(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function $n(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function qn(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Rn(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Pn(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Ln(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Bn(e){return[Math.atan2(e[1],e[0]),$e(e[2])]}function Un(e,t){return x(e[0]-t[0])<Se&&x(e[1]-t[1])<Se}o.geo.bounds=function(){var e,t,n,r,i,a,s,l,u,c,d,f={point:p,lineStart:g,lineEnd:m,polygonStart:function(){f.point=v,f.lineStart=y,f.lineEnd=_,u=0,On.polygonStart()},polygonEnd:function(){On.polygonEnd(),f.point=p,f.lineStart=g,f.lineEnd=m,Fn<0?(e=-(n=180),t=-(r=90)):u>Se?r=90:u<-Se&&(t=-90),d[0]=e,d[1]=n}};function p(i,o){c.push(d=[e=i,n=i]),o<t&&(t=o),o>r&&(r=o)}function h(o,a){var s=zn([o*Ne,a*Ne]);if(l){var u=qn(l,s),c=qn([u[1],-u[0],0],u);Ln(c),c=Bn(c);var d=o-i,f=d>0?1:-1,h=c[0]*Fe*f,g=x(d)>180;if(g^(f*i<h&&h<f*o))(m=c[1]*Fe)>r&&(r=m);else if(g^(f*i<(h=(h+360)%360-180)&&h<f*o)){var m;(m=-c[1]*Fe)<t&&(t=m)}else a<t&&(t=a),a>r&&(r=a);g?o<i?b(e,o)>b(e,n)&&(n=o):b(o,n)>b(e,n)&&(e=o):n>=e?(o<e&&(e=o),o>n&&(n=o)):o>i?b(e,o)>b(e,n)&&(n=o):b(o,n)>b(e,n)&&(e=o)}else p(o,a);l=s,i=o}function g(){f.point=h}function m(){d[0]=e,d[1]=n,f.point=p,l=null}function v(e,t){if(l){var n=e-i;u+=x(n)>180?n+(n>0?360:-360):n}else a=e,s=t;On.point(e,t),h(e,t)}function y(){On.lineStart()}function _(){v(a,s),On.lineEnd(),x(u)>Se&&(e=-(n=180)),d[0]=e,d[1]=n,l=null}function b(e,t){return(t-=e)<0?t+360:t}function w(e,t){return e[0]-t[0]}function k(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}return function(i){if(r=n=-(e=t=1/0),c=[],o.geo.stream(i,f),u=c.length){c.sort(w);for(var a=1,s=[g=c[0]];a<u;++a)k((p=c[a])[0],g)||k(p[1],g)?(b(g[0],p[1])>b(g[0],g[1])&&(g[1]=p[1]),b(p[0],g[1])>b(g[0],g[1])&&(g[0]=p[0])):s.push(g=p);for(var l,u,p,h=-1/0,g=(a=0,s[u=s.length-1]);a<=u;g=p,++a)p=s[a],(l=b(g[1],p[0]))>h&&(h=l,e=p[0],n=g[1])}return c=d=null,e===1/0||t===1/0?[[NaN,NaN],[NaN,NaN]]:[[e,t],[n,r]]}}(),o.geo.centroid=function(e){xn=kn=Cn=Dn=Sn=An=En=Mn=Tn=jn=Nn=0,o.geo.stream(e,Vn);var t=Tn,n=jn,r=Nn,i=t*t+n*n+r*r;return i<Ae&&(t=An,n=En,r=Mn,kn<Se&&(t=Cn,n=Dn,r=Sn),(i=t*t+n*n+r*r)<Ae)?[NaN,NaN]:[Math.atan2(n,t)*Fe,$e(r/Math.sqrt(i))*Fe]};var Vn={sphere:$,point:Hn,lineStart:Gn,lineEnd:Yn,polygonStart:function(){Vn.lineStart=Qn},polygonEnd:function(){Vn.lineStart=Gn}};function Hn(e,t){e*=Ne;var n=Math.cos(t*=Ne);Wn(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function Wn(e,t,n){++xn,Cn+=(e-Cn)/xn,Dn+=(t-Dn)/xn,Sn+=(n-Sn)/xn}function Gn(){var e,t,n;function r(r,i){r*=Ne;var o=Math.cos(i*=Ne),a=o*Math.cos(r),s=o*Math.sin(r),l=Math.sin(i),u=Math.atan2(Math.sqrt((u=t*l-n*s)*u+(u=n*a-e*l)*u+(u=e*s-t*a)*u),e*a+t*s+n*l);kn+=u,An+=u*(e+(e=a)),En+=u*(t+(t=s)),Mn+=u*(n+(n=l)),Wn(e,t,n)}Vn.point=function(i,o){i*=Ne;var a=Math.cos(o*=Ne);e=a*Math.cos(i),t=a*Math.sin(i),n=Math.sin(o),Vn.point=r,Wn(e,t,n)}}function Yn(){Vn.point=Hn}function Qn(){var e,t,n,r,i;function o(e,t){e*=Ne;var o=Math.cos(t*=Ne),a=o*Math.cos(e),s=o*Math.sin(e),l=Math.sin(t),u=r*l-i*s,c=i*a-n*l,d=n*s-r*a,f=Math.sqrt(u*u+c*c+d*d),p=n*a+r*s+i*l,h=f&&-ze(p)/f,g=Math.atan2(f,p);Tn+=h*u,jn+=h*c,Nn+=h*d,kn+=g,An+=g*(n+(n=a)),En+=g*(r+(r=s)),Mn+=g*(i+(i=l)),Wn(n,r,i)}Vn.point=function(a,s){e=a,t=s,Vn.point=o,a*=Ne;var l=Math.cos(s*=Ne);n=l*Math.cos(a),r=l*Math.sin(a),i=Math.sin(s),Wn(n,r,i)},Vn.lineEnd=function(){o(e,t),Vn.lineEnd=Yn,Vn.point=Hn}}function Kn(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return(n=t.invert(n,r))&&e.invert(n[0],n[1])}),n}function Zn(){return!0}function Xn(e,t,n,r,i){var o=[],a=[];if(e.forEach(function(e){if(!((t=e.length-1)<=0)){var t,n=e[0],r=e[t];if(Un(n,r)){i.lineStart();for(var s=0;s<t;++s)i.point((n=e[s])[0],n[1]);i.lineEnd()}else{var l=new er(n,e,null,!0),u=new er(n,null,l,!1);l.o=u,o.push(l),a.push(u),l=new er(r,e,null,!1),u=new er(r,null,l,!0),l.o=u,o.push(l),a.push(u)}}}),a.sort(t),Jn(o),Jn(a),o.length){for(var s=0,l=n,u=a.length;s<u;++s)a[s].e=l=!l;for(var c,d,f=o[0];;){for(var p=f,h=!0;p.v;)if((p=p.n)===f)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(s=0,u=c.length;s<u;++s)i.point((d=c[s])[0],d[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(h)for(s=(c=p.p.z).length-1;s>=0;--s)i.point((d=c[s])[0],d[1]);else r(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,h=!h}while(!p.v);i.lineEnd()}}}function Jn(e){if(t=e.length){for(var t,n,r=0,i=e[0];++r<t;)i.n=n=e[r],n.p=i,i=n;i.n=n=e[0],n.p=i}}function er(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function tr(e,t,n,r){return function(i,a){var s,l=t(a),u=i.invert(r[0],r[1]),c={point:d,lineStart:p,lineEnd:h,polygonStart:function(){c.point=b,c.lineStart=w,c.lineEnd=x,s=[],g=[]},polygonEnd:function(){c.point=d,c.lineStart=p,c.lineEnd=h,s=o.merge(s);var e=function(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;Fn.reset();for(var s=0,l=t.length;s<l;++s){var u=t[s],c=u.length;if(c)for(var d=u[0],f=d[0],p=d[1]/2+Ee/4,h=Math.sin(p),g=Math.cos(p),m=1;;){m===c&&(m=0);var v=(e=u[m])[0],y=e[1]/2+Ee/4,_=Math.sin(y),b=Math.cos(y),w=v-f,x=w>=0?1:-1,k=x*w,C=k>Ee,D=h*_;if(Fn.add(Math.atan2(D*x*Math.sin(k),g*b+D*Math.cos(k))),o+=C?w+x*Me:w,C^f>=n^v>=n){var S=qn(zn(d),zn(e));Ln(S);var A=qn(i,S);Ln(A);var E=(C^w>=0?-1:1)*$e(A[2]);(r>E||r===E&&(S[0]||S[1]))&&(a+=C^w>=0?1:-1)}if(!m++)break;f=v,h=_,g=b,d=e}}return(o<-Se||o<Se&&Fn<-Se)^1&a}(u,g);s.length?(_||(a.polygonStart(),_=!0),Xn(s,ir,e,n,a)):e&&(_||(a.polygonStart(),_=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),s=g=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function d(t,n){var r=i(t,n);e(t=r[0],n=r[1])&&a.point(t,n)}function f(e,t){var n=i(e,t);l.point(n[0],n[1])}function p(){c.point=f,l.lineStart()}function h(){c.point=d,l.lineEnd()}var g,m,v=rr(),y=t(v),_=!1;function b(e,t){m.push([e,t]);var n=i(e,t);y.point(n[0],n[1])}function w(){y.lineStart(),m=[]}function x(){b(m[0][0],m[0][1]),y.lineEnd();var e,t=y.clean(),n=v.buffer(),r=n.length;if(m.pop(),g.push(m),m=null,r)if(1&t){var i,o=-1;if((r=(e=n[0]).length-1)>0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o<r;)a.point((i=e[o])[0],i[1]);a.lineEnd()}}else r>1&&2&t&&n.push(n.pop().concat(n.shift())),s.push(n.filter(nr))}return c}}function nr(e){return e.length>1}function rr(){var e,t=[];return{lineStart:function(){t.push(e=[])},point:function(t,n){e.push([t,n])},lineEnd:$,buffer:function(){var n=t;return t=[],e=null,n},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function ir(e,t){return((e=e.x)[0]<0?e[1]-je-Se:je-e[1])-((t=t.x)[0]<0?t[1]-je-Se:je-t[1])}var or=tr(Zn,function(e){var t,n=NaN,r=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(o,a){var s=o>0?Ee:-Ee,l=x(o-n);x(l-Ee)<Se?(e.point(n,r=(r+a)/2>0?je:-je),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(o,r),t=0):i!==s&&l>=Ee&&(x(n-i)<Se&&(n-=i*Se),x(o-s)<Se&&(o-=s*Se),r=function(e,t,n,r){var i,o,a=Math.sin(e-n);return x(a)>Se?Math.atan((Math.sin(t)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*o*a)):(t+r)/2}(n,r,o,a),e.point(i,r),e.lineEnd(),e.lineStart(),e.point(s,r),t=0),e.point(n=o,r=a),i=s},lineEnd:function(){e.lineEnd(),n=r=NaN},clean:function(){return 2-t}}},function(e,t,n,r){var i;if(null==e)i=n*je,r.point(-Ee,i),r.point(0,i),r.point(Ee,i),r.point(Ee,0),r.point(Ee,-i),r.point(0,-i),r.point(-Ee,-i),r.point(-Ee,0),r.point(-Ee,i);else if(x(e[0]-t[0])>Se){var o=e[0]<t[0]?Ee:-Ee;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(t[0],t[1])},[-Ee,-Ee/2]);function ar(e,t,n,r){return function(i){var o,a=i.a,s=i.b,l=a.x,u=a.y,c=0,d=1,f=s.x-l,p=s.y-u;if(o=e-l,f||!(o>0)){if(o/=f,f<0){if(o<c)return;o<d&&(d=o)}else if(f>0){if(o>d)return;o>c&&(c=o)}if(o=n-l,f||!(o<0)){if(o/=f,f<0){if(o>d)return;o>c&&(c=o)}else if(f>0){if(o<c)return;o<d&&(d=o)}if(o=t-u,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<d&&(d=o)}else if(p>0){if(o>d)return;o>c&&(c=o)}if(o=r-u,p||!(o<0)){if(o/=p,p<0){if(o>d)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<d&&(d=o)}return c>0&&(i.a={x:l+c*f,y:u+c*p}),d<1&&(i.b={x:l+d*f,y:u+d*p}),i}}}}}}var sr=1e9;function lr(e,t,n,r){return function(l){var u,c,d,f,p,h,g,m,v,y,_,b=l,w=rr(),x=ar(e,t,n,r),k={point:S,lineStart:function(){k.point=A,c&&c.push(d=[]),y=!0,v=!1,g=m=NaN},lineEnd:function(){u&&(A(f,p),h&&v&&w.rejoin(),u.push(w.buffer())),k.point=S,v&&l.lineEnd()},polygonStart:function(){l=w,u=[],c=[],_=!0},polygonEnd:function(){l=b,u=o.merge(u);var t=function(e){for(var t=0,n=c.length,r=e[1],i=0;i<n;++i)for(var o,a=1,s=c[i],l=s.length,u=s[0];a<l;++a)o=s[a],u[1]<=r?o[1]>r&&Ie(u,o,e)>0&&++t:o[1]<=r&&Ie(u,o,e)<0&&--t,u=o;return 0!==t}([e,r]),n=_&&t,i=u.length;(n||i)&&(l.polygonStart(),n&&(l.lineStart(),C(null,null,1,l),l.lineEnd()),i&&Xn(u,a,t,C,l),l.polygonEnd()),u=c=d=null}};function C(o,a,l,u){var c=0,d=0;if(null==o||(c=i(o,l))!==(d=i(a,l))||s(o,a)<0^l>0)do{u.point(0===c||3===c?e:n,c>1?r:t)}while((c=(c+l+4)%4)!==d);else u.point(a[0],a[1])}function D(i,o){return e<=i&&i<=n&&t<=o&&o<=r}function S(e,t){D(e,t)&&l.point(e,t)}function A(e,t){var n=D(e=Math.max(-1e9,Math.min(sr,e)),t=Math.max(-1e9,Math.min(sr,t)));if(c&&d.push([e,t]),y)f=e,p=t,h=n,y=!1,n&&(l.lineStart(),l.point(e,t));else if(n&&v)l.point(e,t);else{var r={a:{x:g,y:m},b:{x:e,y:t}};x(r)?(v||(l.lineStart(),l.point(r.a.x,r.a.y)),l.point(r.b.x,r.b.y),n||l.lineEnd(),_=!1):n&&(l.lineStart(),l.point(e,t),_=!1)}g=e,m=t,v=n}return k};function i(r,i){return x(r[0]-e)<Se?i>0?0:3:x(r[0]-n)<Se?i>0?2:1:x(r[1]-t)<Se?i>0?1:0:i>0?3:2}function a(e,t){return s(e.x,t.x)}function s(e,t){var n=i(e,1),r=i(t,1);return n!==r?n-r:0===n?t[1]-e[1]:1===n?e[0]-t[0]:2===n?e[1]-t[1]:t[0]-e[0]}}function ur(e){var t=0,n=Ee/3,r=Fr(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*Ee/180,n=e[1]*Ee/180):[t/Ee*180,n/Ee*180]},i}function cr(e,t){var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),o=Math.sqrt(i)/r;function a(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),o-n*Math.cos(e)]}return a.invert=function(e,t){var n=o-t;return[Math.atan2(e,n)/r,$e((i-(e*e+n*n)*r*r)/(2*r))]},a}o.geo.clipExtent=function(){var e,t,n,r,i,o,a={stream:function(e){return i&&(i.valid=!1),(i=o(e)).valid=!0,i},extent:function(s){return arguments.length?(o=lr(e=+s[0][0],t=+s[0][1],n=+s[1][0],r=+s[1][1]),i&&(i.valid=!1,i=null),a):[[e,t],[n,r]]}};return a.extent([[0,0],[960,500]])},(o.geo.conicEqualArea=function(){return ur(cr)}).raw=cr,o.geo.albers=function(){return o.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},o.geo.albersUsa=function(){var e,t,n,r,i=o.geo.albers(),a=o.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=o.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,n){e=[t,n]}};function u(i){var o=i[0],a=i[1];return e=null,t(o,a),e||(n(o,a),e)||r(o,a),e}return u.invert=function(e){var t=i.scale(),n=i.translate(),r=(e[0]-n[0])/t,o=(e[1]-n[1])/t;return(o>=.12&&o<.234&&r>=-.425&&r<-.214?a:o>=.166&&o<.234&&r>=-.214&&r<-.115?s:i).invert(e)},u.stream=function(e){var t=i.stream(e),n=a.stream(e),r=s.stream(e);return{point:function(e,i){t.point(e,i),n.point(e,i),r.point(e,i)},sphere:function(){t.sphere(),n.sphere(),r.sphere()},lineStart:function(){t.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},u.precision=function(e){return arguments.length?(i.precision(e),a.precision(e),s.precision(e),u):i.precision()},u.scale=function(e){return arguments.length?(i.scale(e),a.scale(.35*e),s.scale(e),u.translate(i.translate())):i.scale()},u.translate=function(e){if(!arguments.length)return i.translate();var o=i.scale(),c=+e[0],d=+e[1];return t=i.translate(e).clipExtent([[c-.455*o,d-.238*o],[c+.455*o,d+.238*o]]).stream(l).point,n=a.translate([c-.307*o,d+.201*o]).clipExtent([[c-.425*o+Se,d+.12*o+Se],[c-.214*o-Se,d+.234*o-Se]]).stream(l).point,r=s.translate([c-.205*o,d+.212*o]).clipExtent([[c-.214*o+Se,d+.166*o+Se],[c-.115*o-Se,d+.234*o-Se]]).stream(l).point,u},u.scale(1070)};var dr,fr,pr,hr,gr,mr,vr={point:$,lineStart:$,lineEnd:$,polygonStart:function(){fr=0,vr.lineStart=yr},polygonEnd:function(){vr.lineStart=vr.lineEnd=vr.point=$,dr+=x(fr/2)}};function yr(){var e,t,n,r;function i(e,t){fr+=r*e-n*t,n=e,r=t}vr.point=function(o,a){vr.point=i,e=n=o,t=r=a},vr.lineEnd=function(){i(e,t)}}var _r={point:function(e,t){e<pr&&(pr=e),e>gr&&(gr=e),t<hr&&(hr=t),t>mr&&(mr=t)},lineStart:$,lineEnd:$,polygonStart:$,polygonEnd:$};function br(){var e=wr(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(t){return e=wr(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=o}function o(e,n){t.push("L",e,",",n)}function a(){n.point=r}function s(){t.push("Z")}return n}function wr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}var xr,kr={point:Cr,lineStart:Dr,lineEnd:Sr,polygonStart:function(){kr.lineStart=Ar},polygonEnd:function(){kr.point=Cr,kr.lineStart=Dr,kr.lineEnd=Sr}};function Cr(e,t){Cn+=e,Dn+=t,++Sn}function Dr(){var e,t;function n(n,r){var i=n-e,o=r-t,a=Math.sqrt(i*i+o*o);An+=a*(e+n)/2,En+=a*(t+r)/2,Mn+=a,Cr(e=n,t=r)}kr.point=function(r,i){kr.point=n,Cr(e=r,t=i)}}function Sr(){kr.point=Cr}function Ar(){var e,t,n,r;function i(e,t){var i=e-n,o=t-r,a=Math.sqrt(i*i+o*o);An+=a*(n+e)/2,En+=a*(r+t)/2,Mn+=a,Tn+=(a=r*e-n*t)*(n+e),jn+=a*(r+t),Nn+=3*a,Cr(n=e,r=t)}kr.point=function(o,a){kr.point=i,Cr(e=n=o,t=r=a)},kr.lineEnd=function(){i(e,t)}}function Er(e){var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:a,polygonStart:function(){n.lineEnd=s},polygonEnd:function(){n.lineEnd=a,n.point=r},pointRadius:function(e){return t=e,n},result:$};function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,Me)}function i(t,r){e.moveTo(t,r),n.point=o}function o(t,n){e.lineTo(t,n)}function a(){n.point=r}function s(){e.closePath()}return n}function Mr(e){var t=.5,n=Math.cos(30*Ne),r=16;function i(e){return(r?a:o)(e)}function o(t){return jr(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function a(t){var n,i,o,a,l,u,c,d,f,p,h,g,m={point:v,lineStart:y,lineEnd:b,polygonStart:function(){t.polygonStart(),m.lineStart=w},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function v(n,r){n=e(n,r),t.point(n[0],n[1])}function y(){d=NaN,m.point=_,t.lineStart()}function _(n,i){var o=zn([n,i]),a=e(n,i);s(d,f,c,p,h,g,d=a[0],f=a[1],c=n,p=o[0],h=o[1],g=o[2],r,t),t.point(d,f)}function b(){m.point=v,t.lineEnd()}function w(){y(),m.point=x,m.lineEnd=k}function x(e,t){_(n=e,t),i=d,o=f,a=p,l=h,u=g,m.point=_}function k(){s(d,f,c,p,h,g,i,o,n,a,l,u,r,t),m.lineEnd=b,b()}return m}function s(r,i,o,a,l,u,c,d,f,p,h,g,m,v){var y=c-r,_=d-i,b=y*y+_*_;if(b>4*t&&m--){var w=a+p,k=l+h,C=u+g,D=Math.sqrt(w*w+k*k+C*C),S=Math.asin(C/=D),A=x(x(C)-1)<Se||x(o-f)<Se?(o+f)/2:Math.atan2(k,w),E=e(A,S),M=E[0],T=E[1],j=M-r,N=T-i,F=_*j-y*N;(F*F/b>t||x((y*j+_*N)/b-.5)>.3||a*p+l*h+u*g<n)&&(s(r,i,o,a,l,u,M,T,A,w/=D,k/=D,C,m,v),v.point(M,T),s(M,T,A,w,k,C,c,d,f,p,h,g,m,v))}}return i.precision=function(e){return arguments.length?(r=(t=e*e)>0&&16,i):Math.sqrt(t)},i}function Tr(e){this.stream=e}function jr(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Nr(e){return Fr(function(){return e})()}function Fr(e){var t,n,r,i,a,s,l=Mr(function(e,n){return[(e=t(e,n))[0]*u+i,a-e[1]*u]}),u=150,c=480,d=250,f=0,p=0,h=0,g=0,m=0,v=or,y=F,_=null,b=null;function w(e){return[(e=r(e[0]*Ne,e[1]*Ne))[0]*u+i,a-e[1]*u]}function k(e){return(e=r.invert((e[0]-i)/u,(a-e[1])/u))&&[e[0]*Fe,e[1]*Fe]}function C(){r=Kn(n=$r(h,g,m),t);var e=t(f,p);return i=c-e[0]*u,a=d+e[1]*u,D()}function D(){return s&&(s.valid=!1,s=null),w}return w.stream=function(e){return s&&(s.valid=!1),(s=Or(v(n,l(y(e))))).valid=!0,s},w.clipAngle=function(e){return arguments.length?(v=null==e?(_=e,or):function(e){var t=Math.cos(e),n=t>0,r=x(t)>Se;return tr(i,function(e){var t,s,l,u,c;return{lineStart:function(){u=l=!1,c=1},point:function(d,f){var p,h=[d,f],g=i(d,f),m=n?g?0:a(d,f):g?a(d+(d<0?Ee:-Ee),f):0;if(!t&&(u=l=g)&&e.lineStart(),g!==l&&(p=o(t,h),(Un(t,p)||Un(h,p))&&(h[0]+=Se,h[1]+=Se,g=i(h[0],h[1]))),g!==l)c=0,g?(e.lineStart(),p=o(h,t),e.point(p[0],p[1])):(p=o(t,h),e.point(p[0],p[1]),e.lineEnd()),t=p;else if(r&&t&&n^g){var v;m&s||!(v=o(h,t,!0))||(c=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1])))}!g||t&&Un(t,h)||e.point(h[0],h[1]),t=h,l=g,s=m},lineEnd:function(){l&&e.lineEnd(),t=null},clean:function(){return c|(u&&l)<<1}}},Lr(e,6*Ne),n?[0,-e]:[-Ee,e-Ee]);function i(e,n){return Math.cos(e)*Math.cos(n)>t}function o(e,n,r){var i=[1,0,0],o=qn(zn(e),zn(n)),a=$n(o,o),s=o[0],l=a-s*s;if(!l)return!r&&e;var u=t*a/l,c=-t*s/l,d=qn(i,o),f=Pn(i,u);Rn(f,Pn(o,c));var p=d,h=$n(f,p),g=$n(p,p),m=h*h-g*($n(f,f)-1);if(!(m<0)){var v=Math.sqrt(m),y=Pn(p,(-h-v)/g);if(Rn(y,f),y=Bn(y),!r)return y;var _,b=e[0],w=n[0],k=e[1],C=n[1];w<b&&(_=b,b=w,w=_);var D=w-b,S=x(D-Ee)<Se;if(!S&&C<k&&(_=k,k=C,C=_),S||D<Se?S?k+C>0^y[1]<(x(y[0]-b)<Se?k:C):k<=y[1]&&y[1]<=C:D>Ee^(b<=y[0]&&y[0]<=w)){var A=Pn(p,(-h+v)/g);return Rn(A,f),[y,Bn(A)]}}}function a(t,r){var i=n?e:Ee-e,o=0;return t<-i?o|=1:t>i&&(o|=2),r<-i?o|=4:r>i&&(o|=8),o}}((_=+e)*Ne),D()):_},w.clipExtent=function(e){return arguments.length?(b=e,y=e?lr(e[0][0],e[0][1],e[1][0],e[1][1]):F,D()):b},w.scale=function(e){return arguments.length?(u=+e,C()):u},w.translate=function(e){return arguments.length?(c=+e[0],d=+e[1],C()):[c,d]},w.center=function(e){return arguments.length?(f=e[0]%360*Ne,p=e[1]%360*Ne,C()):[f*Fe,p*Fe]},w.rotate=function(e){return arguments.length?(h=e[0]%360*Ne,g=e[1]%360*Ne,m=e.length>2?e[2]%360*Ne:0,C()):[h*Fe,g*Fe,m*Fe]},o.rebind(w,l,"precision"),function(){return t=e.apply(this,arguments),w.invert=t.invert&&k,C()}}function Or(e){return jr(e,function(t,n){e.point(t*Ne,n*Ne)})}function Ir(e,t){return[e,t]}function zr(e,t){return[e>Ee?e-Me:e<-Ee?e+Me:e,t]}function $r(e,t,n){return e?t||n?Kn(Rr(e),Pr(t,n)):Rr(e):t||n?Pr(t,n):zr}function qr(e){return function(t,n){return[(t+=e)>Ee?t-Me:t<-Ee?t+Me:t,n]}}function Rr(e){var t=qr(e);return t.invert=qr(-e),t}function Pr(e,t){var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),o=Math.sin(t);function a(e,t){var a=Math.cos(t),s=Math.cos(e)*a,l=Math.sin(e)*a,u=Math.sin(t),c=u*n+s*r;return[Math.atan2(l*i-c*o,s*n-u*r),$e(c*i+l*o)]}return a.invert=function(e,t){var a=Math.cos(t),s=Math.cos(e)*a,l=Math.sin(e)*a,u=Math.sin(t),c=u*i-l*o;return[Math.atan2(l*i+u*o,s*n+c*r),$e(c*n-s*r)]},a}function Lr(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,o,a,s){var l=a*t;null!=i?(i=Br(n,i),o=Br(n,o),(a>0?i<o:i>o)&&(i+=a*Me)):(i=e+a*Me,o=e-.5*l);for(var u,c=i;a>0?c>o:c<o;c-=l)s.point((u=Bn([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],u[1])}}function Br(e,t){var n=zn(t);n[0]-=e,Ln(n);var r=ze(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Se)%(2*Math.PI)}function Ur(e,t,n){var r=o.range(e,t-Se,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function Vr(e,t,n){var r=o.range(e,t-Se,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function Hr(e){return e.source}function Wr(e){return e.target}o.geo.path=function(){var e,t,n,r,i,a=4.5;function s(e){return e&&("function"==typeof a&&r.pointRadius(+a.apply(this,arguments)),i&&i.valid||(i=n(r)),o.geo.stream(e,i)),r.result()}function l(){return i=null,s}return s.area=function(e){return dr=0,o.geo.stream(e,n(vr)),dr},s.centroid=function(e){return Cn=Dn=Sn=An=En=Mn=Tn=jn=Nn=0,o.geo.stream(e,n(kr)),Nn?[Tn/Nn,jn/Nn]:Mn?[An/Mn,En/Mn]:Sn?[Cn/Sn,Dn/Sn]:[NaN,NaN]},s.bounds=function(e){return gr=mr=-(pr=hr=1/0),o.geo.stream(e,n(_r)),[[pr,hr],[gr,mr]]},s.projection=function(t){return arguments.length?(n=(e=t)?t.stream||(r=t,i=Mr(function(e,t){return r([e*Fe,t*Fe])}),function(e){return Or(i(e))}):F,l()):e;var r,i},s.context=function(e){return arguments.length?(r=null==(t=e)?new br:new Er(e),"function"!=typeof a&&r.pointRadius(a),l()):t},s.pointRadius=function(e){return arguments.length?(a="function"==typeof e?e:(r.pointRadius(+e),+e),s):a},s.projection(o.geo.albersUsa()).context(null)},o.geo.transform=function(e){return{stream:function(t){var n=new Tr(t);for(var r in e)n[r]=e[r];return n}}},Tr.prototype={point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},o.geo.projection=Nr,o.geo.projectionMutator=Fr,(o.geo.equirectangular=function(){return Nr(Ir)}).raw=Ir.invert=Ir,o.geo.rotation=function(e){function t(t){return(t=e(t[0]*Ne,t[1]*Ne))[0]*=Fe,t[1]*=Fe,t}return e=$r(e[0]%360*Ne,e[1]*Ne,e.length>2?e[2]*Ne:0),t.invert=function(t){return(t=e.invert(t[0]*Ne,t[1]*Ne))[0]*=Fe,t[1]*=Fe,t},t},zr.invert=Ir,o.geo.circle=function(){var e,t,n=[0,0],r=6;function i(){var e="function"==typeof n?n.apply(this,arguments):n,r=$r(-e[0]*Ne,-e[1]*Ne,0).invert,i=[];return t(null,null,1,{point:function(e,t){i.push(e=r(e,t)),e[0]*=Fe,e[1]*=Fe}}),{type:"Polygon",coordinates:[i]}}return i.origin=function(e){return arguments.length?(n=e,i):n},i.angle=function(n){return arguments.length?(t=Lr((e=+n)*Ne,r*Ne),i):e},i.precision=function(n){return arguments.length?(t=Lr(e*Ne,(r=+n)*Ne),i):r},i.angle(90)},o.geo.distance=function(e,t){var n,r=(t[0]-e[0])*Ne,i=e[1]*Ne,o=t[1]*Ne,a=Math.sin(r),s=Math.cos(r),l=Math.sin(i),u=Math.cos(i),c=Math.sin(o),d=Math.cos(o);return Math.atan2(Math.sqrt((n=d*a)*n+(n=u*c-l*d*s)*n),l*c+u*d*s)},o.geo.graticule=function(){var e,t,n,r,i,a,s,l,u,c,d,f,p=10,h=p,g=90,m=360,v=2.5;function y(){return{type:"MultiLineString",coordinates:_()}}function _(){return o.range(Math.ceil(r/g)*g,n,g).map(d).concat(o.range(Math.ceil(l/m)*m,s,m).map(f)).concat(o.range(Math.ceil(t/p)*p,e,p).filter(function(e){return x(e%g)>Se}).map(u)).concat(o.range(Math.ceil(a/h)*h,i,h).filter(function(e){return x(e%m)>Se}).map(c))}return y.lines=function(){return _().map(function(e){return{type:"LineString",coordinates:e}})},y.outline=function(){return{type:"Polygon",coordinates:[d(r).concat(f(s).slice(1),d(n).reverse().slice(1),f(l).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.majorExtent(e).minorExtent(e):y.minorExtent()},y.majorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],l=+e[0][1],s=+e[1][1],r>n&&(e=r,r=n,n=e),l>s&&(e=l,l=s,s=e),y.precision(v)):[[r,l],[n,s]]},y.minorExtent=function(n){return arguments.length?(t=+n[0][0],e=+n[1][0],a=+n[0][1],i=+n[1][1],t>e&&(n=t,t=e,e=n),a>i&&(n=a,a=i,i=n),y.precision(v)):[[t,a],[e,i]]},y.step=function(e){return arguments.length?y.majorStep(e).minorStep(e):y.minorStep()},y.majorStep=function(e){return arguments.length?(g=+e[0],m=+e[1],y):[g,m]},y.minorStep=function(e){return arguments.length?(p=+e[0],h=+e[1],y):[p,h]},y.precision=function(o){return arguments.length?(v=+o,u=Ur(a,i,90),c=Vr(t,e,v),d=Ur(l,s,90),f=Vr(r,n,v),y):v},y.majorExtent([[-180,-90+Se],[180,90-Se]]).minorExtent([[-180,-80-Se],[180,80+Se]])},o.geo.greatArc=function(){var e,t,n=Hr,r=Wr;function i(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),t||r.apply(this,arguments)]}}return i.distance=function(){return o.geo.distance(e||n.apply(this,arguments),t||r.apply(this,arguments))},i.source=function(t){return arguments.length?(n=t,e="function"==typeof t?null:t,i):n},i.target=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,i):r},i.precision=function(){return arguments.length?i:0},i},o.geo.interpolate=function(e,t){return n=e[0]*Ne,r=e[1]*Ne,i=t[0]*Ne,o=t[1]*Ne,a=Math.cos(r),s=Math.sin(r),l=Math.cos(o),u=Math.sin(o),c=a*Math.cos(n),d=a*Math.sin(n),f=l*Math.cos(i),p=l*Math.sin(i),h=2*Math.asin(Math.sqrt(Re(o-r)+a*l*Re(i-n))),g=1/Math.sin(h),(m=h?function(e){var t=Math.sin(e*=h)*g,n=Math.sin(h-e)*g,r=n*c+t*f,i=n*d+t*p,o=n*s+t*u;return[Math.atan2(i,r)*Fe,Math.atan2(o,Math.sqrt(r*r+i*i))*Fe]}:function(){return[n*Fe,r*Fe]}).distance=h,m;var n,r,i,o,a,s,l,u,c,d,f,p,h,g,m},o.geo.length=function(e){return xr=0,o.geo.stream(e,Gr),xr};var Gr={sphere:$,point:$,lineStart:function(){var e,t,n;function r(r,i){var o=Math.sin(i*=Ne),a=Math.cos(i),s=x((r*=Ne)-e),l=Math.cos(s);xr+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=n*o-t*a*l)*s),t*o+n*a*l),e=r,t=o,n=a}Gr.point=function(i,o){e=i*Ne,t=Math.sin(o*=Ne),n=Math.cos(o),Gr.point=r},Gr.lineEnd=function(){Gr.point=Gr.lineEnd=$}},lineEnd:$,polygonStart:$,polygonEnd:$};function Yr(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),o=e(r*i);return[o*i*Math.sin(t),o*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(e*o,r*a),Math.asin(r&&n*o/r)]},n}var Qr=Yr(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(o.geo.azimuthalEqualArea=function(){return Nr(Qr)}).raw=Qr;var Kr=Yr(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},F);function Zr(e,t){var n=Math.cos(e),r=function(e){return Math.tan(Ee/4+e/2)},i=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),o=n*Math.pow(r(e),i)/i;if(!i)return ei;function a(e,t){o>0?t<-je+Se&&(t=-je+Se):t>je-Se&&(t=je-Se);var n=o/Math.pow(r(t),i);return[n*Math.sin(i*e),o-n*Math.cos(i*e)]}return a.invert=function(e,t){var n=o-t,r=Oe(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(o/r,1/i))-je]},a}function Xr(e,t){var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),i=n/r+e;if(x(r)<Se)return Ir;function o(e,t){var n=i-t;return[n*Math.sin(r*e),i-n*Math.cos(r*e)]}return o.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,i-Oe(r)*Math.sqrt(e*e+n*n)]},o}(o.geo.azimuthalEquidistant=function(){return Nr(Kr)}).raw=Kr,(o.geo.conicConformal=function(){return ur(Zr)}).raw=Zr,(o.geo.conicEquidistant=function(){return ur(Xr)}).raw=Xr;var Jr=Yr(function(e){return 1/e},Math.atan);function ei(e,t){return[e,Math.log(Math.tan(Ee/4+t/2))]}function ti(e){var t,n=Nr(e),r=n.scale,i=n.translate,o=n.clipExtent;return n.scale=function(){var e=r.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.translate=function(){var e=i.apply(n,arguments);return e===n?t?n.clipExtent(null):n:e},n.clipExtent=function(e){var a=o.apply(n,arguments);if(a===n){if(t=null==e){var s=Ee*r(),l=i();o([[l[0]-s,l[1]-s],[l[0]+s,l[1]+s]])}}else t&&(a=null);return a},n.clipExtent(null)}(o.geo.gnomonic=function(){return Nr(Jr)}).raw=Jr,ei.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-je]},(o.geo.mercator=function(){return ti(ei)}).raw=ei;var ni=Yr(function(){return 1},Math.asin);(o.geo.orthographic=function(){return Nr(ni)}).raw=ni;var ri=Yr(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});function ii(e,t){return[Math.log(Math.tan(Ee/4+t/2)),-e]}function oi(e){return e[0]}function ai(e){return e[1]}function si(e){for(var t=e.length,n=[0,1],r=2,i=2;i<t;i++){for(;r>1&&Ie(e[n[r-2]],e[n[r-1]],e[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function li(e,t){return e[0]-t[0]||e[1]-t[1]}(o.geo.stereographic=function(){return Nr(ri)}).raw=ri,ii.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-je]},(o.geo.transverseMercator=function(){var e=ti(ii),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):[(e=n())[0],e[1],e[2]-90]},n([0,0,90])}).raw=ii,o.geom={},o.geom.hull=function(e){var t=oi,n=ai;if(arguments.length)return r(e);function r(e){if(e.length<3)return[];var r,i=yt(t),o=yt(n),a=e.length,s=[],l=[];for(r=0;r<a;r++)s.push([+i.call(this,e[r],r),+o.call(this,e[r],r),r]);for(s.sort(li),r=0;r<a;r++)l.push([s[r][0],-s[r][1]]);var u=si(s),c=si(l),d=c[0]===u[0],f=c[c.length-1]===u[u.length-1],p=[];for(r=u.length-1;r>=0;--r)p.push(e[s[u[r]][2]]);for(r=+d;r<c.length-f;++r)p.push(e[s[c[r]][2]]);return p}return r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r},o.geom.polygon=function(e){return V(e,ui),e};var ui=o.geom.polygon.prototype=[];function ci(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function di(e,t,n,r){var i=e[0],o=n[0],a=t[0]-i,s=r[0]-o,l=e[1],u=n[1],c=t[1]-l,d=r[1]-u,f=(s*(l-u)-d*(i-o))/(d*a-s*c);return[i+f*a,l+f*c]}function fi(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}ui.area=function(){for(var e,t=-1,n=this.length,r=this[n-1],i=0;++t<n;)e=r,r=this[t],i+=e[1]*r[0]-e[0]*r[1];return.5*i},ui.centroid=function(e){var t,n,r=-1,i=this.length,o=0,a=0,s=this[i-1];for(arguments.length||(e=-1/(6*this.area()));++r<i;)t=s,s=this[r],n=t[0]*s[1]-s[0]*t[1],o+=(t[0]+s[0])*n,a+=(t[1]+s[1])*n;return[o*e,a*e]},ui.clip=function(e){for(var t,n,r,i,o,a,s=fi(e),l=-1,u=this.length-fi(this),c=this[u-1];++l<u;){for(t=e.slice(),e.length=0,i=this[l],o=t[(r=t.length-s)-1],n=-1;++n<r;)ci(a=t[n],c,i)?(ci(o,c,i)||e.push(di(o,a,c,i)),e.push(a)):ci(o,c,i)&&e.push(di(o,a,c,i)),o=a;s&&e.push(e[0]),c=i}return e};var pi,hi,gi,mi,vi,yi=[],_i=[];function bi(){Ri(this),this.edge=this.site=this.circle=null}function wi(e){var t=yi.pop()||new bi;return t.site=e,t}function xi(e){ji(e),gi.remove(e),yi.push(e),Ri(e)}function ki(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},o=e.P,a=e.N,s=[e];xi(e);for(var l=o;l.circle&&x(n-l.circle.x)<Se&&x(r-l.circle.cy)<Se;)o=l.P,s.unshift(l),xi(l),l=o;s.unshift(l),ji(l);for(var u=a;u.circle&&x(n-u.circle.x)<Se&&x(r-u.circle.cy)<Se;)a=u.N,s.push(u),xi(u),u=a;s.push(u),ji(u);var c,d=s.length;for(c=1;c<d;++c)u=s[c],l=s[c-1],zi(u.edge,l.site,u.site,i);l=s[0],(u=s[d-1]).edge=Oi(l.site,u.site,null,i),Ti(l),Ti(u)}function Ci(e){for(var t,n,r,i,o=e.x,a=e.y,s=gi._;s;)if((r=Di(s,a)-o)>Se)s=s.L;else{if(!((i=o-Si(s,a))>Se)){r>-Se?(t=s.P,n=s):i>-Se?(t=s,n=s.N):t=n=s;break}if(!s.R){t=s;break}s=s.R}var l=wi(e);if(gi.insert(t,l),t||n){if(t===n)return ji(t),n=wi(t.site),gi.insert(l,n),l.edge=n.edge=Oi(t.site,l.site),Ti(t),void Ti(n);if(n){ji(t),ji(n);var u=t.site,c=u.x,d=u.y,f=e.x-c,p=e.y-d,h=n.site,g=h.x-c,m=h.y-d,v=2*(f*m-p*g),y=f*f+p*p,_=g*g+m*m,b={x:(m*y-p*_)/v+c,y:(f*_-g*y)/v+d};zi(n.edge,u,h,b),l.edge=Oi(u,e,null,b),n.edge=Oi(e,h,null,b),Ti(t),Ti(n)}else l.edge=Oi(t.site,l.site)}}function Di(e,t){var n=e.site,r=n.x,i=n.y,o=i-t;if(!o)return r;var a=e.P;if(!a)return-1/0;var s=(n=a.site).x,l=n.y,u=l-t;if(!u)return s;var c=s-r,d=1/o-1/u,f=c/u;return d?(-f+Math.sqrt(f*f-2*d*(c*c/(-2*u)-l+u/2+i-o/2)))/d+r:(r+s)/2}function Si(e,t){var n=e.N;if(n)return Di(n,t);var r=e.site;return r.y===t?r.x:1/0}function Ai(e){this.site=e,this.edges=[]}function Ei(e,t){return t.angle-e.angle}function Mi(){Ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Ti(e){var t=e.P,n=e.N;if(t&&n){var r=t.site,i=e.site,o=n.site;if(r!==o){var a=i.x,s=i.y,l=r.x-a,u=r.y-s,c=o.x-a,d=2*(l*(m=o.y-s)-u*c);if(!(d>=-Ae)){var f=l*l+u*u,p=c*c+m*m,h=(m*f-u*p)/d,g=(l*p-c*f)/d,m=g+s,v=_i.pop()||new Mi;v.arc=e,v.site=i,v.x=h+a,v.y=m+Math.sqrt(h*h+g*g),v.cy=m,e.circle=v;for(var y=null,_=vi._;_;)if(v.y<_.y||v.y===_.y&&v.x<=_.x){if(!_.L){y=_.P;break}_=_.L}else{if(!_.R){y=_;break}_=_.R}vi.insert(y,v),y||(mi=v)}}}}function ji(e){var t=e.circle;t&&(t.P||(mi=t.N),vi.remove(t),_i.push(t),Ri(t),e.circle=null)}function Ni(e,t){var n=e.b;if(n)return!0;var r,i,o=e.a,a=t[0][0],s=t[1][0],l=t[0][1],u=t[1][1],c=e.l,d=e.r,f=c.x,p=c.y,h=d.x,g=d.y,m=(f+h)/2,v=(p+g)/2;if(g===p){if(m<a||m>=s)return;if(f>h){if(o){if(o.y>=u)return}else o={x:m,y:l};n={x:m,y:u}}else{if(o){if(o.y<l)return}else o={x:m,y:u};n={x:m,y:l}}}else if(i=v-(r=(f-h)/(g-p))*m,r<-1||r>1)if(f>h){if(o){if(o.y>=u)return}else o={x:(l-i)/r,y:l};n={x:(u-i)/r,y:u}}else{if(o){if(o.y<l)return}else o={x:(u-i)/r,y:u};n={x:(l-i)/r,y:l}}else if(p<g){if(o){if(o.x>=s)return}else o={x:a,y:r*a+i};n={x:s,y:r*s+i}}else{if(o){if(o.x<a)return}else o={x:s,y:r*s+i};n={x:a,y:r*a+i}}return e.a=o,e.b=n,!0}function Fi(e,t){this.l=e,this.r=t,this.a=this.b=null}function Oi(e,t,n,r){var i=new Fi(e,t);return pi.push(i),n&&zi(i,e,t,n),r&&zi(i,t,e,r),hi[e.i].edges.push(new $i(i,e,t)),hi[t.i].edges.push(new $i(i,t,e)),i}function Ii(e,t,n){var r=new Fi(e,null);return r.a=t,r.b=n,pi.push(r),r}function zi(e,t,n,r){e.a||e.b?e.l===n?e.b=r:e.a=r:(e.a=r,e.l=t,e.r=n)}function $i(e,t,n){var r=e.a,i=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function qi(){this._=null}function Ri(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function Pi(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function Li(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function Bi(e){for(;e.L;)e=e.L;return e}function Ui(e,t){var n,r,i,o=e.sort(Vi).pop();for(pi=[],hi=new Array(e.length),gi=new qi,vi=new qi;;)if(i=mi,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))o.x===n&&o.y===r||(hi[o.i]=new Ai(o),Ci(o),n=o.x,r=o.y),o=e.pop();else{if(!i)break;ki(i.arc)}t&&(function(e){for(var t,n=pi,r=ar(e[0][0],e[0][1],e[1][0],e[1][1]),i=n.length;i--;)(!Ni(t=n[i],e)||!r(t)||x(t.a.x-t.b.x)<Se&&x(t.a.y-t.b.y)<Se)&&(t.a=t.b=null,n.splice(i,1))}(t),function(e){for(var t,n,r,i,o,a,s,l,u,c,d=e[0][0],f=e[1][0],p=e[0][1],h=e[1][1],g=hi,m=g.length;m--;)if((o=g[m])&&o.prepare())for(l=(s=o.edges).length,a=0;a<l;)r=(c=s[a].end()).x,i=c.y,t=(u=s[++a%l].start()).x,n=u.y,(x(r-t)>Se||x(i-n)>Se)&&(s.splice(a,0,new $i(Ii(o.site,c,x(r-d)<Se&&h-i>Se?{x:d,y:x(t-d)<Se?n:h}:x(i-h)<Se&&f-r>Se?{x:x(n-h)<Se?t:f,y:h}:x(r-f)<Se&&i-p>Se?{x:f,y:x(t-f)<Se?n:p}:x(i-p)<Se&&r-d>Se?{x:x(n-p)<Se?t:d,y:p}:null),o.site,null)),++l)}(t));var a={cells:hi,edges:pi};return gi=vi=pi=hi=null,a}function Vi(e,t){return t.y-e.y||t.x-e.x}Ai.prototype.prepare=function(){for(var e,t=this.edges,n=t.length;n--;)(e=t[n].edge).b&&e.a||t.splice(n,1);return t.sort(Ei),t.length},$i.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},qi.prototype={insert:function(e,t){var n,r,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=Bi(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);for(t.L=t.R=null,t.U=n,t.C=!0,e=t;n&&n.C;)n===(r=n.U).L?(i=r.R)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(Pi(this,n),n=(e=n).U),n.C=!1,r.C=!0,Li(this,r)):(i=r.L)&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(Li(this,n),n=(e=n).U),n.C=!1,r.C=!0,Pi(this,r)),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,n,r,i=e.U,o=e.L,a=e.R;if(n=o?a?Bi(a):o:a,i?i.L===e?i.L=n:i.R=n:this._=n,o&&a?(r=n.C,n.C=e.C,n.L=o,o.U=n,n!==a?(i=n.U,n.U=e.U,e=n.R,i.L=e,n.R=a,a.U=n):(n.U=i,i=n,e=n.R)):(r=e.C,e=n),e&&(e.U=i),!r)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,Pi(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,Li(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,Pi(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,Li(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,Pi(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,Li(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},o.geom.voronoi=function(e){var t=oi,n=ai,r=t,i=n,o=Hi;if(e)return a(e);function a(e){var t=new Array(e.length),n=o[0][0],r=o[0][1],i=o[1][0],a=o[1][1];return Ui(s(e),o).cells.forEach(function(o,s){var l=o.edges,u=o.site;(t[s]=l.length?l.map(function(e){var t=e.start();return[t.x,t.y]}):u.x>=n&&u.x<=i&&u.y>=r&&u.y<=a?[[n,a],[i,a],[i,r],[n,r]]:[]).point=e[s]}),t}function s(e){return e.map(function(e,t){return{x:Math.round(r(e,t)/Se)*Se,y:Math.round(i(e,t)/Se)*Se,i:t}})}return a.links=function(e){return Ui(s(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},a.triangles=function(e){var t=[];return Ui(s(e)).cells.forEach(function(n,r){for(var i,o=n.site,a=n.edges.sort(Ei),s=-1,l=a.length,u=a[l-1].edge,c=u.l===o?u.r:u.l;++s<l;)i=c,c=(u=a[s].edge).l===o?u.r:u.l,r<i.i&&r<c.i&&Wi(o,i,c)<0&&t.push([e[r],e[i.i],e[c.i]])}),t},a.x=function(e){return arguments.length?(r=yt(t=e),a):t},a.y=function(e){return arguments.length?(i=yt(n=e),a):n},a.clipExtent=function(e){return arguments.length?(o=null==e?Hi:e,a):o===Hi?null:o},a.size=function(e){return arguments.length?a.clipExtent(e&&[[0,0],e]):o===Hi?null:o&&o[1]},a};var Hi=[[-1e6,-1e6],[1e6,1e6]];function Wi(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}function Gi(e){return e.x}function Yi(e){return e.y}function Qi(e,t,n,r,i,o){if(!e(t,n,r,i,o)){var a=.5*(n+i),s=.5*(r+o),l=t.nodes;l[0]&&Qi(e,l[0],n,r,a,s),l[1]&&Qi(e,l[1],a,r,i,s),l[2]&&Qi(e,l[2],n,s,a,o),l[3]&&Qi(e,l[3],a,s,i,o)}}function Ki(e,t){e=o.rgb(e),t=o.rgb(t);var n=e.r,r=e.g,i=e.b,a=t.r-n,s=t.g-r,l=t.b-i;return function(e){return"#"+dt(Math.round(n+a*e))+dt(Math.round(r+s*e))+dt(Math.round(i+l*e))}}function Zi(e,t){var n,r={},i={};for(n in e)n in t?r[n]=no(e[n],t[n]):i[n]=e[n];for(n in t)n in e||(i[n]=t[n]);return function(e){for(n in r)i[n]=r[n](e);return i}}function Xi(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Ji(e,t){var n,r,i,o=eo.lastIndex=to.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=eo.exec(e))&&(r=to.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Xi(n,r)})),o=to.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?(t=l[0].x,function(e){return t(e)+""}):function(){return t}:(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}o.geom.delaunay=function(e){return o.geom.voronoi().triangles(e)},o.geom.quadtree=function(e,t,n,r,i){var o,a=oi,s=ai;if(o=arguments.length)return a=Gi,s=Yi,3===o&&(i=n,r=t,n=t=0),l(e);function l(e){var l,u,c,d,f,p,h,g,m,v=yt(a),y=yt(s);if(null!=t)p=t,h=n,g=r,m=i;else if(g=m=-(p=h=1/0),u=[],c=[],f=e.length,o)for(d=0;d<f;++d)(l=e[d]).x<p&&(p=l.x),l.y<h&&(h=l.y),l.x>g&&(g=l.x),l.y>m&&(m=l.y),u.push(l.x),c.push(l.y);else for(d=0;d<f;++d){var _=+v(l=e[d],d),b=+y(l,d);_<p&&(p=_),b<h&&(h=b),_>g&&(g=_),b>m&&(m=b),u.push(_),c.push(b)}var w=g-p,k=m-h;function C(e,t,n,r,i,o,a,s){if(!isNaN(n)&&!isNaN(r))if(e.leaf){var l=e.x,u=e.y;if(null!=l)if(x(l-n)+x(u-r)<.01)D(e,t,n,r,i,o,a,s);else{var c=e.point;e.x=e.y=e.point=null,D(e,c,l,u,i,o,a,s),D(e,t,n,r,i,o,a,s)}else e.x=n,e.y=r,e.point=t}else D(e,t,n,r,i,o,a,s)}function D(e,t,n,r,i,o,a,s){var l=.5*(i+a),u=.5*(o+s),c=n>=l,d=r>=u,f=d<<1|c;e.leaf=!1,c?i=l:a=l,d?o=u:s=u,C(e=e.nodes[f]||(e.nodes[f]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,n,r,i,o,a,s)}w>k?m=h+w:g=p+k;var S={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){C(S,e,+v(e,++d),+y(e,d),p,h,g,m)}};if(S.visit=function(e){Qi(e,S,p,h,g,m)},S.find=function(e){return function(e,t,n,r,i,o,a){var s,l=1/0;return function e(u,c,d,f,p){if(!(c>o||d>a||f<r||p<i)){if(h=u.point){var h,g=t-u.x,m=n-u.y,v=g*g+m*m;if(v<l){var y=Math.sqrt(l=v);r=t-y,i=n-y,o=t+y,a=n+y,s=h}}for(var _=u.nodes,b=.5*(c+f),w=.5*(d+p),x=(n>=w)<<1|t>=b,k=x+4;x<k;++x)if(u=_[3&x])switch(3&x){case 0:e(u,c,d,b,w);break;case 1:e(u,b,d,f,w);break;case 2:e(u,c,w,b,p);break;case 3:e(u,b,w,f,p)}}}(e,r,i,o,a),s}(S,e[0],e[1],p,h,g,m)},d=-1,null==t){for(;++d<f;)C(S,e[d],u[d],c[d],p,h,g,m);--d}else e.forEach(S.add);return u=c=e=l=null,S}return l.x=function(e){return arguments.length?(a=e,l):a},l.y=function(e){return arguments.length?(s=e,l):s},l.extent=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),l):null==t?null:[[t,n],[r,i]]},l.size=function(e){return arguments.length?(null==e?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),l):null==t?null:[r-t,i-n]},l},o.interpolateRgb=Ki,o.interpolateObject=Zi,o.interpolateNumber=Xi,o.interpolateString=Ji;var eo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,to=new RegExp(eo.source,"g");function no(e,t){for(var n,r=o.interpolators.length;--r>=0&&!(n=o.interpolators[r](e,t)););return n}function ro(e,t){var n,r=[],i=[],o=e.length,a=t.length,s=Math.min(e.length,t.length);for(n=0;n<s;++n)r.push(no(e[n],t[n]));for(;n<o;++n)i[n]=e[n];for(;n<a;++n)i[n]=t[n];return function(e){for(n=0;n<s;++n)i[n]=r[n](e);return i}}o.interpolate=no,o.interpolators=[function(e,t){var n=typeof t;return("string"===n?vt.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?Ki:Ji:t instanceof Ve?Ki:Array.isArray(t)?ro:"object"===n&&isNaN(t)?Zi:Xi)(e,t)}],o.interpolateArray=ro;var io=function(){return F},oo=o.map({linear:io,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return uo},cubic:function(){return co},sin:function(){return po},exp:function(){return ho},circle:function(){return go},elastic:function(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Me*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Me/t)}},back:function(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}},bounce:function(){return mo}}),ao=o.map({in:F,out:so,"in-out":lo,"out-in":function(e){return lo(so(e))}});function so(e){return function(t){return 1-e(1-t)}}function lo(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function uo(e){return e*e}function co(e){return e*e*e}function fo(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function po(e){return 1-Math.cos(e*je)}function ho(e){return Math.pow(2,10*(e-1))}function go(e){return 1-Math.sqrt(1-e*e)}function mo(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function vo(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function yo(e){var t,n,r,i=[e.a,e.b],o=[e.c,e.d],a=bo(i),s=_o(i,o),l=bo(((t=o)[0]+=(r=-s)*(n=i)[0],t[1]+=r*n[1],t))||0;i[0]*o[1]<o[0]*i[1]&&(i[0]*=-1,i[1]*=-1,a*=-1,s*=-1),this.rotate=(a?Math.atan2(i[1],i[0]):Math.atan2(-o[0],o[1]))*Fe,this.translate=[e.e,e.f],this.scale=[a,l],this.skew=l?Math.atan2(s,l)*Fe:0}function _o(e,t){return e[0]*t[0]+e[1]*t[1]}function bo(e){var t=Math.sqrt(_o(e,e));return t&&(e[0]/=t,e[1]/=t),t}o.ease=function(e){var t,n=e.indexOf("-"),r=n>=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):"in";return r=oo.get(r)||io,i=ao.get(i)||F,t=i(r.apply(null,a.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},o.interpolateHcl=function(e,t){e=o.hcl(e),t=o.hcl(t);var n=e.h,r=e.c,i=e.l,a=t.h-n,s=t.c-r,l=t.l-i;return isNaN(s)&&(s=0,r=isNaN(r)?t.c:r),isNaN(a)?(a=0,n=isNaN(n)?t.h:n):a>180?a-=360:a<-180&&(a+=360),function(e){return Ke(n+a*e,r+s*e,i+l*e)+""}},o.interpolateHsl=function(e,t){e=o.hsl(e),t=o.hsl(t);var n=e.h,r=e.s,i=e.l,a=t.h-n,s=t.s-r,l=t.l-i;return isNaN(s)&&(s=0,r=isNaN(r)?t.s:r),isNaN(a)?(a=0,n=isNaN(n)?t.h:n):a>180?a-=360:a<-180&&(a+=360),function(e){return Ge(n+a*e,r+s*e,i+l*e)+""}},o.interpolateLab=function(e,t){e=o.lab(e),t=o.lab(t);var n=e.l,r=e.a,i=e.b,a=t.l-n,s=t.a-r,l=t.b-i;return function(e){return rt(n+a*e,r+s*e,i+l*e)+""}},o.interpolateRound=vo,o.transform=function(e){var t=l.createElementNS(o.ns.prefix.svg,"g");return(o.transform=function(e){if(null!=e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate()}return new yo(n?n.matrix:wo)})(e)},yo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var wo={a:1,b:0,c:0,d:1,e:0,f:0};function xo(e){return e.length?e.pop()+",":""}function ko(e,t){var n=[],r=[];return e=o.transform(e),t=o.transform(t),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:Xi(e[0],t[0])},{i:i-2,x:Xi(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}(e.translate,t.translate,n,r),function(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(xo(n)+"rotate(",null,")")-2,x:Xi(e,t)})):t&&n.push(xo(n)+"rotate("+t+")")}(e.rotate,t.rotate,n,r),function(e,t,n,r){e!==t?r.push({i:n.push(xo(n)+"skewX(",null,")")-2,x:Xi(e,t)}):t&&n.push(xo(n)+"skewX("+t+")")}(e.skew,t.skew,n,r),function(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(xo(n)+"scale(",null,",",null,")");r.push({i:i-4,x:Xi(e[0],t[0])},{i:i-2,x:Xi(e[1],t[1])})}else 1===t[0]&&1===t[1]||n.push(xo(n)+"scale("+t+")")}(e.scale,t.scale,n,r),e=t=null,function(e){for(var t,i=-1,o=r.length;++i<o;)n[(t=r[i]).i]=t.x(e);return n.join("")}}function Co(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function Do(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function So(e){for(var t=e.source,n=e.target,r=function(e,t){if(e===t)return e;for(var n=Ao(e),r=Ao(t),i=n.pop(),o=r.pop(),a=null;i===o;)a=i,i=n.pop(),o=r.pop();return a}(t,n),i=[t];t!==r;)t=t.parent,i.push(t);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function Ao(e){for(var t=[],n=e.parent;null!=n;)t.push(e),e=n,n=n.parent;return t.push(e),t}function Eo(e){e.fixed|=2}function Mo(e){e.fixed&=-7}function To(e){e.fixed|=4,e.px=e.x,e.py=e.y}function jo(e){e.fixed&=-5}function No(e,t,n){var r=0,i=0;if(e.charge=0,!e.leaf)for(var o,a=e.nodes,s=a.length,l=-1;++l<s;)null!=(o=a[l])&&(No(o,t,n),e.charge+=o.charge,r+=o.charge*o.cx,i+=o.charge*o.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var u=t*n[e.point.index];e.charge+=e.pointCharge=u,r+=u*e.point.x,i+=u*e.point.y}e.cx=r/e.charge,e.cy=i/e.charge}o.interpolateTransform=ko,o.layout={},o.layout.bundle=function(){return function(e){for(var t=[],n=-1,r=e.length;++n<r;)t.push(So(e[n]));return t}},o.layout.chord=function(){var e,t,n,r,i,a,s,l={},u=0;function c(){var l,c,f,p,h,g={},m=[],v=o.range(r),y=[];for(e=[],t=[],l=0,p=-1;++p<r;){for(c=0,h=-1;++h<r;)c+=n[p][h];m.push(c),y.push(o.range(r)),l+=c}for(i&&v.sort(function(e,t){return i(m[e],m[t])}),a&&y.forEach(function(e,t){e.sort(function(e,r){return a(n[t][e],n[t][r])})}),l=(Me-u*r)/l,c=0,p=-1;++p<r;){for(f=c,h=-1;++h<r;){var _=v[p],b=y[_][h],w=n[_][b],x=c,k=c+=w*l;g[_+"-"+b]={index:_,subindex:b,startAngle:x,endAngle:k,value:w}}t[_]={index:_,startAngle:f,endAngle:c,value:m[_]},c+=u}for(p=-1;++p<r;)for(h=p-1;++h<r;){var C=g[p+"-"+h],D=g[h+"-"+p];(C.value||D.value)&&e.push(C.value<D.value?{source:D,target:C}:{source:C,target:D})}s&&d()}function d(){e.sort(function(e,t){return s((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}return l.matrix=function(i){return arguments.length?(r=(n=i)&&n.length,e=t=null,l):n},l.padding=function(n){return arguments.length?(u=n,e=t=null,l):u},l.sortGroups=function(n){return arguments.length?(i=n,e=t=null,l):i},l.sortSubgroups=function(t){return arguments.length?(a=t,e=null,l):a},l.sortChords=function(t){return arguments.length?(s=t,e&&d(),l):s},l.chords=function(){return e||c(),e},l.groups=function(){return t||c(),t},l},o.layout.force=function(){var e,t,n,r,i,a,s={},l=o.dispatch("start","tick","end"),u=[1,1],c=.9,d=Fo,f=Oo,p=-30,h=Io,g=.1,m=.64,v=[],y=[];function _(e){return function(t,n,r,i){if(t.point!==e){var o=t.cx-e.x,a=t.cy-e.y,s=i-n,l=o*o+a*a;if(s*s/m<l){if(l<h){var u=t.charge/l;e.px-=o*u,e.py-=a*u}return!0}t.point&&l&&l<h&&(u=t.pointCharge/l,e.px-=o*u,e.py-=a*u)}return!t.charge}}function b(e){e.px=o.event.x,e.py=o.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return e=null,l.end({type:"end",alpha:n=0}),!0;var t,s,d,f,h,m,b,w,x,k=v.length,C=y.length;for(s=0;s<C;++s)f=(d=y[s]).source,(m=(w=(h=d.target).x-f.x)*w+(x=h.y-f.y)*x)&&(w*=m=n*i[s]*((m=Math.sqrt(m))-r[s])/m,x*=m,h.x-=w*(b=f.weight+h.weight?f.weight/(f.weight+h.weight):.5),h.y-=x*b,f.x+=w*(b=1-b),f.y+=x*b);if((b=n*g)&&(w=u[0]/2,x=u[1]/2,s=-1,b))for(;++s<k;)(d=v[s]).x+=(w-d.x)*b,d.y+=(x-d.y)*b;if(p)for(No(t=o.geom.quadtree(v),n,a),s=-1;++s<k;)(d=v[s]).fixed||t.visit(_(d));for(s=-1;++s<k;)(d=v[s]).fixed?(d.x=d.px,d.y=d.py):(d.x-=(d.px-(d.px=d.x))*c,d.y-=(d.py-(d.py=d.y))*c);l.tick({type:"tick",alpha:n})},s.nodes=function(e){return arguments.length?(v=e,s):v},s.links=function(e){return arguments.length?(y=e,s):y},s.size=function(e){return arguments.length?(u=e,s):u},s.linkDistance=function(e){return arguments.length?(d="function"==typeof e?e:+e,s):d},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(f="function"==typeof e?e:+e,s):f},s.friction=function(e){return arguments.length?(c=+e,s):c},s.charge=function(e){return arguments.length?(p="function"==typeof e?e:+e,s):p},s.chargeDistance=function(e){return arguments.length?(h=e*e,s):Math.sqrt(h)},s.gravity=function(e){return arguments.length?(g=+e,s):g},s.theta=function(e){return arguments.length?(m=e*e,s):Math.sqrt(m)},s.alpha=function(t){return arguments.length?(t=+t,n?t>0?n=t:(e.c=null,e.t=NaN,e=null,l.end({type:"end",alpha:n=0})):t>0&&(l.start({type:"start",alpha:n=t}),e=St(s.tick)),s):n},s.start=function(){var e,t,n,o=v.length,l=y.length,c=u[0],h=u[1];for(e=0;e<o;++e)(n=v[e]).index=e,n.weight=0;for(e=0;e<l;++e)"number"==typeof(n=y[e]).source&&(n.source=v[n.source]),"number"==typeof n.target&&(n.target=v[n.target]),++n.source.weight,++n.target.weight;for(e=0;e<o;++e)n=v[e],isNaN(n.x)&&(n.x=g("x",c)),isNaN(n.y)&&(n.y=g("y",h)),isNaN(n.px)&&(n.px=n.x),isNaN(n.py)&&(n.py=n.y);if(r=[],"function"==typeof d)for(e=0;e<l;++e)r[e]=+d.call(this,y[e],e);else for(e=0;e<l;++e)r[e]=d;if(i=[],"function"==typeof f)for(e=0;e<l;++e)i[e]=+f.call(this,y[e],e);else for(e=0;e<l;++e)i[e]=f;if(a=[],"function"==typeof p)for(e=0;e<o;++e)a[e]=+p.call(this,v[e],e);else for(e=0;e<o;++e)a[e]=p;function g(n,r){if(!t){for(t=new Array(o),u=0;u<o;++u)t[u]=[];for(u=0;u<l;++u){var i=y[u];t[i.source.index].push(i.target),t[i.target.index].push(i.source)}}for(var a,s=t[e],u=-1,c=s.length;++u<c;)if(!isNaN(a=s[u][n]))return a;return Math.random()*r}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(t||(t=o.behavior.drag().origin(F).on("dragstart.force",Eo).on("drag.force",b).on("dragend.force",Mo)),!arguments.length)return t;this.on("mouseover.force",To).on("mouseout.force",jo).call(t)},o.rebind(s,l,"on")};var Fo=20,Oo=1,Io=1/0;function zo(e,t){return o.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=Bo,e}function $o(e,t){for(var n=[e];null!=(e=n.pop());)if(t(e),(i=e.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function qo(e,t){for(var n=[e],r=[];null!=(e=n.pop());)if(r.push(e),(o=e.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a]);for(;null!=(e=r.pop());)t(e)}function Ro(e){return e.children}function Po(e){return e.value}function Lo(e,t){return t.value-e.value}function Bo(e){return o.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}o.layout.hierarchy=function(){var e=Lo,t=Ro,n=Po;function r(i){var o,a=[i],s=[];for(i.depth=0;null!=(o=a.pop());)if(s.push(o),(u=t.call(r,o,o.depth))&&(l=u.length)){for(var l,u,c;--l>=0;)a.push(c=u[l]),c.parent=o,c.depth=o.depth+1;n&&(o.value=0),o.children=u}else n&&(o.value=+n.call(r,o,o.depth)||0),delete o.children;return qo(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&($o(e,function(e){e.children&&(e.value=0)}),qo(e,function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)})),e},r},o.layout.partition=function(){var e=o.layout.hierarchy(),t=[1,1];function n(e,t,r,i){var o=e.children;if(e.x=t,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,s,l,u=-1;for(r=e.value?r/e.value:0;++u<a;)n(s=o[u],t,l=s.value*r,i),t+=l}}function r(e){var t=e.children,n=0;if(t&&(i=t.length))for(var i,o=-1;++o<i;)n=Math.max(n,r(t[o]));return 1+n}function i(i,o){var a=e.call(this,i,o);return n(a[0],0,t[0],t[1]/r(a[0])),a}return i.size=function(e){return arguments.length?(t=e,i):t},zo(i,e)},o.layout.pie=function(){var e=Number,t=Uo,n=0,r=Me,i=0;function a(s){var l,u=s.length,c=s.map(function(t,n){return+e.call(a,t,n)}),d=+("function"==typeof n?n.apply(this,arguments):n),f=("function"==typeof r?r.apply(this,arguments):r)-d,p=Math.min(Math.abs(f)/u,+("function"==typeof i?i.apply(this,arguments):i)),h=p*(f<0?-1:1),g=o.sum(c),m=g?(f-u*h)/g:0,v=o.range(u),y=[];return null!=t&&v.sort(t===Uo?function(e,t){return c[t]-c[e]}:function(e,n){return t(s[e],s[n])}),v.forEach(function(e){y[e]={data:s[e],value:l=c[e],startAngle:d,endAngle:d+=l*m+h,padAngle:p}}),y}return a.value=function(t){return arguments.length?(e=t,a):e},a.sort=function(e){return arguments.length?(t=e,a):t},a.startAngle=function(e){return arguments.length?(n=e,a):n},a.endAngle=function(e){return arguments.length?(r=e,a):r},a.padAngle=function(e){return arguments.length?(i=e,a):i},a};var Uo={};function Vo(e){return e.x}function Ho(e){return e.y}function Wo(e,t,n){e.y0=t,e.y=n}o.layout.stack=function(){var e=F,t=Qo,n=Ko,r=Wo,i=Vo,a=Ho;function s(l,u){if(!(p=l.length))return l;var c=l.map(function(t,n){return e.call(s,t,n)}),d=c.map(function(e){return e.map(function(e,t){return[i.call(s,e,t),a.call(s,e,t)]})}),f=t.call(s,d,u);c=o.permute(c,f),d=o.permute(d,f);var p,h,g,m,v=n.call(s,d,u),y=c[0].length;for(g=0;g<y;++g)for(r.call(s,c[0][g],m=v[g],d[0][g][1]),h=1;h<p;++h)r.call(s,c[h][g],m+=d[h-1][g][1],d[h][g][1]);return l}return s.values=function(t){return arguments.length?(e=t,s):e},s.order=function(e){return arguments.length?(t="function"==typeof e?e:Go.get(e)||Qo,s):t},s.offset=function(e){return arguments.length?(n="function"==typeof e?e:Yo.get(e)||Ko,s):n},s.x=function(e){return arguments.length?(i=e,s):i},s.y=function(e){return arguments.length?(a=e,s):a},s.out=function(e){return arguments.length?(r=e,s):r},s};var Go=o.map({"inside-out":function(e){var t,n,r=e.length,i=e.map(Zo),a=e.map(Xo),s=o.range(r).sort(function(e,t){return i[e]-i[t]}),l=0,u=0,c=[],d=[];for(t=0;t<r;++t)n=s[t],l<u?(l+=a[n],c.push(n)):(u+=a[n],d.push(n));return d.reverse().concat(c)},reverse:function(e){return o.range(e.length).reverse()},default:Qo}),Yo=o.map({silhouette:function(e){var t,n,r,i=e.length,o=e[0].length,a=[],s=0,l=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];r>s&&(s=r),a.push(r)}for(n=0;n<o;++n)l[n]=(s-a[n])/2;return l},wiggle:function(e){var t,n,r,i,o,a,s,l,u,c=e.length,d=e[0],f=d.length,p=[];for(p[0]=l=u=0,n=1;n<f;++n){for(t=0,i=0;t<c;++t)i+=e[t][n][1];for(t=0,o=0,s=d[n][0]-d[n-1][0];t<c;++t){for(r=0,a=(e[t][n][1]-e[t][n-1][1])/(2*s);r<t;++r)a+=(e[r][n][1]-e[r][n-1][1])/s;o+=a*e[t][n][1]}p[n]=l-=i?o/i*s:0,l<u&&(u=l)}for(n=0;n<f;++n)p[n]-=u;return p},expand:function(e){var t,n,r,i=e.length,o=e[0].length,a=1/i,s=[];for(n=0;n<o;++n){for(t=0,r=0;t<i;t++)r+=e[t][n][1];if(r)for(t=0;t<i;t++)e[t][n][1]/=r;else for(t=0;t<i;t++)e[t][n][1]=a}for(n=0;n<o;++n)s[n]=0;return s},zero:Ko});function Qo(e){return o.range(e.length)}function Ko(e){for(var t=-1,n=e[0].length,r=[];++t<n;)r[t]=0;return r}function Zo(e){for(var t,n=1,r=0,i=e[0][1],o=e.length;n<o;++n)(t=e[n][1])>i&&(r=n,i=t);return r}function Xo(e){return e.reduce(Jo,0)}function Jo(e,t){return e+t[1]}function ea(e,t){return ta(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ta(e,t){for(var n=-1,r=+e[0],i=(e[1]-r)/t,o=[];++n<=t;)o[n]=i*n+r;return o}function na(e){return[o.min(e),o.max(e)]}function ra(e,t){return e.value-t.value}function ia(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function oa(e,t){e._pack_next=t,t._pack_prev=e}function aa(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return.999*i*i>n*n+r*r}function sa(e){if((t=e.children)&&(l=t.length)){var t,n,r,i,o,a,s,l,u=1/0,c=-1/0,d=1/0,f=-1/0;if(t.forEach(la),(n=t[0]).x=-n.r,n.y=0,_(n),l>1&&((r=t[1]).x=r.r,r.y=0,_(r),l>2))for(da(n,r,i=t[2]),_(i),ia(n,i),n._pack_prev=i,ia(i,r),r=n._pack_next,o=3;o<l;o++){da(n,r,i=t[o]);var p=0,h=1,g=1;for(a=r._pack_next;a!==r;a=a._pack_next,h++)if(aa(a,i)){p=1;break}if(1==p)for(s=n._pack_prev;s!==a._pack_prev&&!aa(s,i);s=s._pack_prev,g++);p?(h<g||h==g&&r.r<n.r?oa(n,r=a):oa(n=s,r),o--):(ia(n,i),r=i,_(i))}var m=(u+c)/2,v=(d+f)/2,y=0;for(o=0;o<l;o++)(i=t[o]).x-=m,i.y-=v,y=Math.max(y,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=y,t.forEach(ua)}function _(e){u=Math.min(e.x-e.r,u),c=Math.max(e.x+e.r,c),d=Math.min(e.y-e.r,d),f=Math.max(e.y+e.r,f)}}function la(e){e._pack_next=e._pack_prev=e}function ua(e){delete e._pack_next,delete e._pack_prev}function ca(e,t,n,r){var i=e.children;if(e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r,i)for(var o=-1,a=i.length;++o<a;)ca(i[o],t,n,r)}function da(e,t,n){var r=e.r+n.r,i=t.x-e.x,o=t.y-e.y;if(r&&(i||o)){var a=t.r+n.r,s=i*i+o*o,l=.5+((r*=r)-(a*=a))/(2*s),u=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=e.x+l*i+u*o,n.y=e.y+l*o-u*i}else n.x=e.x+r,n.y=e.y}function fa(e,t){return e.parent==t.parent?1:2}function pa(e){var t=e.children;return t.length?t[0]:e.t}function ha(e){var t,n=e.children;return(t=n.length)?n[t-1]:e.t}function ga(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function ma(e,t,n){return e.a.parent===t.parent?e.a:n}function va(e){var t=e.children;return t&&t.length?va(t[0]):e}function ya(e){var t,n=e.children;return n&&(t=n.length)?ya(n[t-1]):e}function _a(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function ba(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],o=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),o<0&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function wa(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function xa(e){return e.rangeExtent?e.rangeExtent():wa(e.range())}function ka(e,t,n,r){var i=n(e[0],e[1]),o=r(t[0],t[1]);return function(e){return o(i(e))}}function Ca(e,t){var n,r=0,i=e.length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}function Da(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:Sa}o.layout.histogram=function(){var e=!0,t=Number,n=na,r=ea;function i(i,a){for(var s,l,u=[],c=i.map(t,this),d=n.call(this,c,a),f=r.call(this,d,c,a),p=(a=-1,c.length),h=f.length-1,g=e?1:1/p;++a<h;)(s=u[a]=[]).dx=f[a+1]-(s.x=f[a]),s.y=0;if(h>0)for(a=-1;++a<p;)(l=c[a])>=d[0]&&l<=d[1]&&((s=u[o.bisect(f,l,1,h)-1]).y+=g,s.push(i[a]));return u}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(n=yt(e),i):n},i.bins=function(e){return arguments.length?(r="number"==typeof e?function(t){return ta(t,e)}:yt(e),i):r},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},o.layout.pack=function(){var e,t=o.layout.hierarchy().sort(ra),n=0,r=[1,1];function i(i,o){var a=t.call(this,i,o),s=a[0],l=r[0],u=r[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,qo(s,function(e){e.r=+c(e.value)}),qo(s,sa),n){var d=n*(e?1:Math.max(2*s.r/l,2*s.r/u))/2;qo(s,function(e){e.r+=d}),qo(s,sa),qo(s,function(e){e.r-=d})}return ca(s,l/2,u/2,e?1:1/Math.max(2*s.r/l,2*s.r/u)),a}return i.size=function(e){return arguments.length?(r=e,i):r},i.radius=function(t){return arguments.length?(e=null==t||"function"==typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(n=+e,i):n},zo(i,t)},o.layout.tree=function(){var e=o.layout.hierarchy().sort(null).value(null),t=fa,n=[1,1],r=null;function i(i,o){var u=e.call(this,i,o),c=u[0],d=function(e){for(var t,n={A:null,children:[e]},r=[n];null!=(t=r.pop());)for(var i,o=t.children,a=0,s=o.length;a<s;++a)r.push((o[a]=i={_:o[a],parent:t,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}(c);if(qo(d,a),d.parent.m=-d.z,$o(d,s),r)$o(c,l);else{var f=c,p=c,h=c;$o(c,function(e){e.x<f.x&&(f=e),e.x>p.x&&(p=e),e.depth>h.depth&&(h=e)});var g=t(f,p)/2-f.x,m=n[0]/(p.x+t(p,f)/2+g),v=n[1]/(h.depth||1);$o(c,function(e){e.x=(e.x+g)*m,e.y=e.depth*v})}return u}function a(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n.length){!function(e){for(var t,n=0,r=0,i=e.children,o=i.length;--o>=0;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,l=o.parent.children[0],u=o.m,c=a.m,d=s.m,f=l.m;s=ha(s),o=pa(o),s&&o;)l=pa(l),(a=ha(a)).a=e,(i=s.z+d-o.z-u+t(s._,o._))>0&&(ga(ma(s,e,r),e,i),u+=i,c+=i),d+=s.m,u+=o.m,f+=l.m,c+=a.m;s&&!ha(a)&&(a.t=s,a.m+=d-c),o&&!pa(l)&&(l.t=o,l.m+=u-f,r=e)}return r}(e,i,e.parent.A||r[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e)?l:null,i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null==(n=e)?null:l,i):r?n:null},zo(i,e)},o.layout.cluster=function(){var e=o.layout.hierarchy().sort(null).value(null),t=fa,n=[1,1],r=!1;function i(i,a){var s,l=e.call(this,i,a),u=l[0],c=0;qo(u,function(e){var n=e.children;n&&n.length?(e.x=function(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}(n),e.y=function(e){return 1+o.max(e,function(e){return e.y})}(n)):(e.x=s?c+=t(e,s):0,e.y=0,s=e)});var d=va(u),f=ya(u),p=d.x-t(d,f)/2,h=f.x+t(f,d)/2;return qo(u,r?function(e){e.x=(e.x-u.x)*n[0],e.y=(u.y-e.y)*n[1]}:function(e){e.x=(e.x-p)/(h-p)*n[0],e.y=(1-(u.y?e.y/u.y:1))*n[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(r=null==(n=e),i):r?null:n},i.nodeSize=function(e){return arguments.length?(r=null!=(n=e),i):r?n:null},zo(i,e)},o.layout.treemap=function(){var e,t=o.layout.hierarchy(),n=Math.round,r=[1,1],i=null,a=_a,s=!1,l="squarify",u=.5*(1+Math.sqrt(5));function c(e,t){for(var n,r,i=-1,o=e.length;++i<o;)r=(n=e[i]).value*(t<0?0:t),n.area=isNaN(r)||r<=0?0:r}function d(e){var t=e.children;if(t&&t.length){var n,r,i,o=a(e),s=[],u=t.slice(),f=1/0,g="slice"===l?o.dx:"dice"===l?o.dy:"slice-dice"===l?1&e.depth?o.dy:o.dx:Math.min(o.dx,o.dy);for(c(u,o.dx*o.dy/e.value),s.area=0;(i=u.length)>0;)s.push(n=u[i-1]),s.area+=n.area,"squarify"!==l||(r=p(s,g))<=f?(u.pop(),f=r):(s.area-=s.pop().area,h(s,g,o,!1),g=Math.min(o.dx,o.dy),s.length=s.area=0,f=1/0);s.length&&(h(s,g,o,!0),s.length=s.area=0),t.forEach(d)}}function f(e){var t=e.children;if(t&&t.length){var n,r=a(e),i=t.slice(),o=[];for(c(i,r.dx*r.dy/e.value),o.area=0;n=i.pop();)o.push(n),o.area+=n.area,null!=n.z&&(h(o,n.z?r.dx:r.dy,r,!i.length),o.length=o.area=0);t.forEach(f)}}function p(e,t){for(var n,r=e.area,i=0,o=1/0,a=-1,s=e.length;++a<s;)(n=e[a].area)&&(n<o&&(o=n),n>i&&(i=n));return t*=t,(r*=r)?Math.max(t*i*u/r,r/(t*o*u)):1/0}function h(e,t,r,i){var o,a=-1,s=e.length,l=r.x,u=r.y,c=t?n(e.area/t):0;if(t==r.dx){for((i||c>r.dy)&&(c=r.dy);++a<s;)(o=e[a]).x=l,o.y=u,o.dy=c,l+=o.dx=Math.min(r.x+r.dx-l,c?n(o.area/c):0);o.z=!0,o.dx+=r.x+r.dx-l,r.y+=c,r.dy-=c}else{for((i||c>r.dx)&&(c=r.dx);++a<s;)(o=e[a]).x=l,o.y=u,o.dx=c,u+=o.dy=Math.min(r.y+r.dy-u,c?n(o.area/c):0);o.z=!1,o.dy+=r.y+r.dy-u,r.x+=c,r.dx-=c}}function g(n){var i=e||t(n),o=i[0];return o.x=o.y=0,o.value?(o.dx=r[0],o.dy=r[1]):o.dx=o.dy=0,e&&t.revalue(o),c([o],o.dx*o.dy/o.value),(e?f:d)(o),s&&(e=i),i}return g.size=function(e){return arguments.length?(r=e,g):r},g.padding=function(e){if(!arguments.length)return i;function t(t){return ba(t,e)}var n;return a=null==(i=e)?_a:"function"==(n=typeof e)?function(t){var n=e.call(g,t,t.depth);return null==n?_a(t):ba(t,"number"==typeof n?[n,n,n,n]:n)}:"number"===n?(e=[e,e,e,e],t):t,g},g.round=function(e){return arguments.length?(n=e?Math.round:Number,g):n!=Number},g.sticky=function(t){return arguments.length?(s=t,e=null,g):s},g.ratio=function(e){return arguments.length?(u=e,g):u},g.mode=function(e){return arguments.length?(l=e+"",g):l},zo(g,t)},o.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do{i=(n=2*Math.random()-1)*n+(r=2*Math.random()-1)*r}while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=o.random.normal.apply(o,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=o.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},o.scale={};var Sa={floor:F,ceil:F};function Aa(e,t,n,r){var i=[],a=[],s=0,l=Math.min(e.length,t.length)-1;for(e[l]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++s<=l;)i.push(n(e[s-1],e[s])),a.push(r(t[s-1],t[s]));return function(t){var n=o.bisect(e,t,1,l)-1;return a[n](i[n](t))}}function Ea(e,t,n,r){var i,o;function a(){var a=Math.min(e.length,t.length)>2?Aa:ka,l=r?Do:Co;return i=a(e,t,l,n),o=a(t,e,l,no),s}function s(e){return i(e)}return s.invert=function(e){return o(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),a()):e},s.range=function(e){return arguments.length?(t=e,a()):t},s.rangeRound=function(e){return s.range(e).interpolate(vo)},s.clamp=function(e){return arguments.length?(r=e,a()):r},s.interpolate=function(e){return arguments.length?(n=e,a()):n},s.ticks=function(t){return Na(e,t)},s.tickFormat=function(t,n){return Fa(e,t,n)},s.nice=function(t){return Ta(e,t),a()},s.copy=function(){return Ea(e,t,n,r)},a()}function Ma(e,t){return o.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Ta(e,t){return Ca(e,Da(ja(e,t)[2])),Ca(e,Da(ja(e,t)[2])),e}function ja(e,t){null==t&&(t=10);var n=wa(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),o=t/r*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Na(e,t){return o.range.apply(o,ja(e,t))}function Fa(e,t,n){var r=ja(e,t);if(n){var i=Ft.exec(n);if(i.shift(),"s"===i[8]){var a=o.formatPrefix(Math.max(x(r[0]),x(r[1])));return i[7]||(i[7]="."+Ia(a.scale(r[2]))),i[8]="f",n=o.format(i.join("")),function(e){return n(a.scale(e))+a.symbol}}i[7]||(i[7]="."+function(e,t){var n=Ia(t[2]);return e in Oa?Math.abs(n-Ia(Math.max(x(t[0]),x(t[1]))))+ +("e"!==e):n-2*("%"===e)}(i[8],r)),n=i.join("")}else n=",."+Ia(r[2])+"f";return o.format(n)}o.scale.linear=function(){return Ea([0,1],[0,1],no,!1)};var Oa={s:1,g:1,p:1,r:1,e:1};function Ia(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function za(e,t,n,r){function i(e){return(n?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return n?Math.pow(t,e):-Math.pow(t,-e)}function s(t){return e(i(t))}return s.invert=function(t){return a(e.invert(t))},s.domain=function(t){return arguments.length?(n=t[0]>=0,e.domain((r=t.map(Number)).map(i)),s):r},s.base=function(n){return arguments.length?(t=+n,e.domain(r.map(i)),s):t},s.nice=function(){var t=Ca(r.map(i),n?Math:qa);return e.domain(t),r=t.map(a),s},s.ticks=function(){var e=wa(r),o=[],s=e[0],l=e[1],u=Math.floor(i(s)),c=Math.ceil(i(l)),d=t%1?2:t;if(isFinite(c-u)){if(n){for(;u<c;u++)for(var f=1;f<d;f++)o.push(a(u)*f);o.push(a(u))}else for(o.push(a(u));u++<c;)for(f=d-1;f>0;f--)o.push(a(u)*f);for(u=0;o[u]<s;u++);for(c=o.length;o[c-1]>l;c--);o=o.slice(u,c)}return o},s.tickFormat=function(e,n){if(!arguments.length)return $a;arguments.length<2?n=$a:"function"!=typeof n&&(n=o.format(n));var r=Math.max(1,t*e/s.ticks().length);return function(e){var o=e/a(Math.round(i(e)));return o*t<t-.5&&(o*=t),o<=r?n(e):""}},s.copy=function(){return za(e.copy(),t,n,r)},Ma(s,e)}o.scale.log=function(){return za(o.scale.linear().domain([0,1]),10,!0,[1,10])};var $a=o.format(".0e"),qa={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Ra(e,t,n){var r=Pa(t),i=Pa(1/t);function o(t){return e(r(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(r)),o):n},o.ticks=function(e){return Na(n,e)},o.tickFormat=function(e,t){return Fa(n,e,t)},o.nice=function(e){return o.domain(Ta(n,e))},o.exponent=function(a){return arguments.length?(r=Pa(t=a),i=Pa(1/t),e.domain(n.map(r)),o):t},o.copy=function(){return Ra(e.copy(),t,n)},Ma(o,e)}function Pa(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function La(e,t){var n,r,i;function a(i){return r[((n.get(i)||("range"===t.t?n.set(i,e.push(i)):NaN))-1)%r.length]}function s(t,n){return o.range(e.length).map(function(e){return t+n*e})}return a.domain=function(r){if(!arguments.length)return e;e=[],n=new C;for(var i,o=-1,s=r.length;++o<s;)n.has(i=r[o])||n.set(i,e.push(i));return a[t.t].apply(a,t.a)},a.range=function(e){return arguments.length?(r=e,i=0,t={t:"range",a:arguments},a):r},a.rangePoints=function(n,o){arguments.length<2&&(o=0);var l=n[0],u=n[1],c=e.length<2?(l=(l+u)/2,0):(u-l)/(e.length-1+o);return r=s(l+c*o/2,c),i=0,t={t:"rangePoints",a:arguments},a},a.rangeRoundPoints=function(n,o){arguments.length<2&&(o=0);var l=n[0],u=n[1],c=e.length<2?(l=u=Math.round((l+u)/2),0):(u-l)/(e.length-1+o)|0;return r=s(l+Math.round(c*o/2+(u-l-(e.length-1+o)*c)/2),c),i=0,t={t:"rangeRoundPoints",a:arguments},a},a.rangeBands=function(n,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var u=n[1]<n[0],c=n[u-0],d=(n[1-u]-c)/(e.length-o+2*l);return r=s(c+d*l,d),u&&r.reverse(),i=d*(1-o),t={t:"rangeBands",a:arguments},a},a.rangeRoundBands=function(n,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var u=n[1]<n[0],c=n[u-0],d=n[1-u],f=Math.floor((d-c)/(e.length-o+2*l));return r=s(c+Math.round((d-c-(e.length-o)*f)/2),f),u&&r.reverse(),i=Math.round(f*(1-o)),t={t:"rangeRoundBands",a:arguments},a},a.rangeBand=function(){return i},a.rangeExtent=function(){return wa(t.a[0])},a.copy=function(){return La(e,t)},a.domain(e)}o.scale.pow=function(){return Ra(o.scale.linear(),1,[0,1])},o.scale.sqrt=function(){return o.scale.pow().exponent(.5)},o.scale.ordinal=function(){return La([],{t:"range",a:[[]]})},o.scale.category10=function(){return o.scale.ordinal().range(Ba)},o.scale.category20=function(){return o.scale.ordinal().range(Ua)},o.scale.category20b=function(){return o.scale.ordinal().range(Va)},o.scale.category20c=function(){return o.scale.ordinal().range(Ha)};var Ba=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(ut),Ua=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(ut),Va=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(ut),Ha=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(ut);function Wa(e,t){var n;function r(){var r=0,a=t.length;for(n=[];++r<a;)n[r-1]=o.quantile(e,r/a);return i}function i(e){if(!isNaN(e=+e))return t[o.bisect(n,e)]}return i.domain=function(t){return arguments.length?(e=t.map(v).filter(y).sort(m),r()):e},i.range=function(e){return arguments.length?(t=e,r()):t},i.quantiles=function(){return n},i.invertExtent=function(r){return(r=t.indexOf(r))<0?[NaN,NaN]:[r>0?n[r-1]:e[0],r<n.length?n[r]:e[e.length-1]]},i.copy=function(){return Wa(e,t)},r()}function Ga(e,t,n){var r,i;function o(t){return n[Math.max(0,Math.min(i,Math.floor(r*(t-e))))]}function a(){return r=n.length/(t-e),i=n.length-1,o}return o.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],a()):[e,t]},o.range=function(e){return arguments.length?(n=e,a()):n},o.invertExtent=function(t){return[t=(t=n.indexOf(t))<0?NaN:t/r+e,t+1/r]},o.copy=function(){return Ga(e,t,n)},a()}function Ya(e,t){function n(n){if(n<=n)return t[o.bisect(e,n)]}return n.domain=function(t){return arguments.length?(e=t,n):e},n.range=function(e){return arguments.length?(t=e,n):t},n.invertExtent=function(n){return n=t.indexOf(n),[e[n-1],e[n]]},n.copy=function(){return Ya(e,t)},n}function Qa(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return Na(e,t)},t.tickFormat=function(t,n){return Fa(e,t,n)},t.copy=function(){return Qa(e)},t}function Ka(){return 0}o.scale.quantile=function(){return Wa([],[])},o.scale.quantize=function(){return Ga(0,1,[0,1])},o.scale.threshold=function(){return Ya([.5],[0,1])},o.scale.identity=function(){return Qa([0,1])},o.svg={},o.svg.arc=function(){var e=Xa,t=Ja,n=Ka,r=Za,i=es,o=ts,a=ns;function s(){var s=Math.max(0,+e.apply(this,arguments)),u=Math.max(0,+t.apply(this,arguments)),c=i.apply(this,arguments)-je,d=o.apply(this,arguments)-je,f=Math.abs(d-c),p=c>d?0:1;if(u<s&&(h=u,u=s,s=h),f>=Te)return l(u,p)+(s?l(s,1-p):"")+"Z";var h,g,m,v,y,_,b,w,x,k,C,D,S=0,A=0,E=[];if((v=(+a.apply(this,arguments)||0)/2)&&(m=r===Za?Math.sqrt(s*s+u*u):+r.apply(this,arguments),p||(A*=-1),u&&(A=$e(m/u*Math.sin(v))),s&&(S=$e(m/s*Math.sin(v)))),u){y=u*Math.cos(c+A),_=u*Math.sin(c+A),b=u*Math.cos(d-A),w=u*Math.sin(d-A);var M=Math.abs(d-c-2*A)<=Ee?0:1;if(A&&rs(y,_,b,w)===p^M){var T=(c+d)/2;y=u*Math.cos(T),_=u*Math.sin(T),b=w=null}}else y=_=0;if(s){x=s*Math.cos(d-S),k=s*Math.sin(d-S),C=s*Math.cos(c+S),D=s*Math.sin(c+S);var j=Math.abs(c-d+2*S)<=Ee?0:1;if(S&&rs(x,k,C,D)===1-p^j){var N=(c+d)/2;x=s*Math.cos(N),k=s*Math.sin(N),C=D=null}}else x=k=0;if(f>Se&&(h=Math.min(Math.abs(u-s)/2,+n.apply(this,arguments)))>.001){g=s<u^p?0:1;var F=h,O=h;if(f<Ee){var I=null==C?[x,k]:null==b?[y,_]:di([y,_],[C,D],[b,w],[x,k]),z=y-I[0],$=_-I[1],q=b-I[0],R=w-I[1],P=1/Math.sin(Math.acos((z*q+$*R)/(Math.sqrt(z*z+$*$)*Math.sqrt(q*q+R*R)))/2),L=Math.sqrt(I[0]*I[0]+I[1]*I[1]);O=Math.min(h,(s-L)/(P-1)),F=Math.min(h,(u-L)/(P+1))}if(null!=b){var B=is(null==C?[x,k]:[C,D],[y,_],u,F,p),U=is([b,w],[x,k],u,F,p);h===F?E.push("M",B[0],"A",F,",",F," 0 0,",g," ",B[1],"A",u,",",u," 0 ",1-p^rs(B[1][0],B[1][1],U[1][0],U[1][1]),",",p," ",U[1],"A",F,",",F," 0 0,",g," ",U[0]):E.push("M",B[0],"A",F,",",F," 0 1,",g," ",U[0])}else E.push("M",y,",",_);if(null!=C){var V=is([y,_],[C,D],s,-O,p),H=is([x,k],null==b?[y,_]:[b,w],s,-O,p);h===O?E.push("L",H[0],"A",O,",",O," 0 0,",g," ",H[1],"A",s,",",s," 0 ",p^rs(H[1][0],H[1][1],V[1][0],V[1][1]),",",1-p," ",V[1],"A",O,",",O," 0 0,",g," ",V[0]):E.push("L",H[0],"A",O,",",O," 0 0,",g," ",V[0])}else E.push("L",x,",",k)}else E.push("M",y,",",_),null!=b&&E.push("A",u,",",u," 0 ",M,",",p," ",b,",",w),E.push("L",x,",",k),null!=C&&E.push("A",s,",",s," 0 ",j,",",1-p," ",C,",",D);return E.push("Z"),E.join("")}function l(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return s.innerRadius=function(t){return arguments.length?(e=yt(t),s):e},s.outerRadius=function(e){return arguments.length?(t=yt(e),s):t},s.cornerRadius=function(e){return arguments.length?(n=yt(e),s):n},s.padRadius=function(e){return arguments.length?(r=e==Za?Za:yt(e),s):r},s.startAngle=function(e){return arguments.length?(i=yt(e),s):i},s.endAngle=function(e){return arguments.length?(o=yt(e),s):o},s.padAngle=function(e){return arguments.length?(a=yt(e),s):a},s.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-je;return[Math.cos(r)*n,Math.sin(r)*n]},s};var Za="auto";function Xa(e){return e.innerRadius}function Ja(e){return e.outerRadius}function es(e){return e.startAngle}function ts(e){return e.endAngle}function ns(e){return e&&e.padAngle}function rs(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function is(e,t,n,r,i){var o=e[0]-t[0],a=e[1]-t[1],s=(i?r:-r)/Math.sqrt(o*o+a*a),l=s*a,u=-s*o,c=e[0]+l,d=e[1]+u,f=t[0]+l,p=t[1]+u,h=(c+f)/2,g=(d+p)/2,m=f-c,v=p-d,y=m*m+v*v,_=n-r,b=c*p-f*d,w=(v<0?-1:1)*Math.sqrt(Math.max(0,_*_*y-b*b)),x=(b*v-m*w)/y,k=(-b*m-v*w)/y,C=(b*v+m*w)/y,D=(-b*m+v*w)/y,S=x-h,A=k-g,E=C-h,M=D-g;return S*S+A*A>E*E+M*M&&(x=C,k=D),[[x-l,k-u],[x*n/_,k*n/_]]}function os(e){var t=oi,n=ai,r=Zn,i=ss,o=i.key,a=.7;function s(o){var s,l=[],u=[],c=-1,d=o.length,f=yt(t),p=yt(n);function h(){l.push("M",i(e(u),a))}for(;++c<d;)r.call(this,s=o[c],c)?u.push([+f.call(this,s,c),+p.call(this,s,c)]):u.length&&(h(),u=[]);return u.length&&h(),l.length?l.join(""):null}return s.x=function(e){return arguments.length?(t=e,s):t},s.y=function(e){return arguments.length?(n=e,s):n},s.defined=function(e){return arguments.length?(r=e,s):r},s.interpolate=function(e){return arguments.length?(o="function"==typeof e?i=e:(i=as.get(e)||ss).key,s):o},s.tension=function(e){return arguments.length?(a=e,s):a},s}o.svg.line=function(){return os(F)};var as=o.map({linear:ss,"linear-closed":ls,step:function(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);return n>1&&i.push("H",r[0]),i.join("")},"step-before":us,"step-after":cs,basis:ps,"basis-open":function(e){if(e.length<4)return ss(e);for(var t,n=[],r=-1,i=e.length,o=[0],a=[0];++r<3;)t=e[r],o.push(t[0]),a.push(t[1]);for(n.push(hs(vs,o)+","+hs(vs,a)),--r;++r<i;)t=e[r],o.shift(),o.push(t[0]),a.shift(),a.push(t[1]),ys(n,o,a);return n.join("")},"basis-closed":function(e){for(var t,n,r=-1,i=e.length,o=i+4,a=[],s=[];++r<4;)n=e[r%i],a.push(n[0]),s.push(n[1]);for(t=[hs(vs,a),",",hs(vs,s)],--r;++r<o;)n=e[r%i],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),ys(t,a,s);return t.join("")},bundle:function(e,t){var n=e.length-1;if(n)for(var r,i,o=e[0][0],a=e[0][1],s=e[n][0]-o,l=e[n][1]-a,u=-1;++u<=n;)i=u/n,(r=e[u])[0]=t*r[0]+(1-t)*(o+i*s),r[1]=t*r[1]+(1-t)*(a+i*l);return ps(e)},cardinal:function(e,t){return e.length<3?ss(e):e[0]+ds(e,fs(e,t))},"cardinal-open":function(e,t){return e.length<4?ss(e):e[1]+ds(e.slice(1,-1),fs(e,t))},"cardinal-closed":function(e,t){return e.length<3?ls(e):e[0]+ds((e.push(e[0]),e),fs([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?ss(e):e[0]+ds(e,function(e){for(var t,n,r,i,o=[],a=function(e){for(var t=0,n=e.length-1,r=[],i=e[0],o=e[1],a=r[0]=_s(i,o);++t<n;)r[t]=(a+(a=_s(i=o,o=e[t+1])))/2;return r[t]=a,r}(e),s=-1,l=e.length-1;++s<l;)t=_s(e[s],e[s+1]),x(t)<Se?a[s]=a[s+1]=0:(i=(n=a[s]/t)*n+(r=a[s+1]/t)*r)>9&&(i=3*t/Math.sqrt(i),a[s]=i*n,a[s+1]=i*r);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}(e))}});function ss(e){return e.length>1?e.join("L"):e+"Z"}function ls(e){return e.join("L")+"Z"}function us(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("V",(r=e[t])[1],"H",r[0]);return i.join("")}function cs(e){for(var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];++t<n;)i.push("H",(r=e[t])[0],"V",r[1]);return i.join("")}function ds(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return ss(e);var n=e.length!=t.length,r="",i=e[0],o=e[1],a=t[0],s=a,l=1;if(n&&(r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=e[1],l=2),t.length>1){s=t[1],o=e[l],l++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var u=2;u<t.length;u++,l++)o=e[l],s=t[u],r+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}if(n){var c=e[l];r+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+c[0]+","+c[1]}return r}function fs(e,t){for(var n,r=[],i=(1-t)/2,o=e[0],a=e[1],s=1,l=e.length;++s<l;)n=o,o=a,a=e[s],r.push([i*(a[0]-n[0]),i*(a[1]-n[1])]);return r}function ps(e){if(e.length<3)return ss(e);var t=1,n=e.length,r=e[0],i=r[0],o=r[1],a=[i,i,i,(r=e[1])[0]],s=[o,o,o,r[1]],l=[i,",",o,"L",hs(vs,a),",",hs(vs,s)];for(e.push(e[n-1]);++t<=n;)r=e[t],a.shift(),a.push(r[0]),s.shift(),s.push(r[1]),ys(l,a,s);return e.pop(),l.push("L",r),l.join("")}function hs(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}as.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var gs=[0,2/3,1/3,0],ms=[0,1/3,2/3,0],vs=[0,1/6,2/3,1/6];function ys(e,t,n){e.push("C",hs(gs,t),",",hs(gs,n),",",hs(ms,t),",",hs(ms,n),",",hs(vs,t),",",hs(vs,n))}function _s(e,t){return(t[1]-e[1])/(t[0]-e[0])}function bs(e){for(var t,n,r,i=-1,o=e.length;++i<o;)n=(t=e[i])[0],r=t[1]-je,t[0]=n*Math.cos(r),t[1]=n*Math.sin(r);return e}function ws(e){var t=oi,n=oi,r=0,i=ai,o=Zn,a=ss,s=a.key,l=a,u="L",c=.7;function d(s){var d,f,p,h=[],g=[],m=[],v=-1,y=s.length,_=yt(t),b=yt(r),w=t===n?function(){return f}:yt(n),x=r===i?function(){return p}:yt(i);function k(){h.push("M",a(e(m),c),u,l(e(g.reverse()),c),"Z")}for(;++v<y;)o.call(this,d=s[v],v)?(g.push([f=+_.call(this,d,v),p=+b.call(this,d,v)]),m.push([+w.call(this,d,v),+x.call(this,d,v)])):g.length&&(k(),g=[],m=[]);return g.length&&k(),h.length?h.join(""):null}return d.x=function(e){return arguments.length?(t=n=e,d):n},d.x0=function(e){return arguments.length?(t=e,d):t},d.x1=function(e){return arguments.length?(n=e,d):n},d.y=function(e){return arguments.length?(r=i=e,d):i},d.y0=function(e){return arguments.length?(r=e,d):r},d.y1=function(e){return arguments.length?(i=e,d):i},d.defined=function(e){return arguments.length?(o=e,d):o},d.interpolate=function(e){return arguments.length?(s="function"==typeof e?a=e:(a=as.get(e)||ss).key,l=a.reverse||a,u=a.closed?"M":"L",d):s},d.tension=function(e){return arguments.length?(c=e,d):c},d}function xs(e){return e.radius}function ks(e){return[e.x,e.y]}function Cs(){return 64}function Ds(){return"circle"}function Ss(e){var t=Math.sqrt(e/Ee);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}o.svg.line.radial=function(){var e=os(bs);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},us.reverse=cs,cs.reverse=us,o.svg.area=function(){return ws(F)},o.svg.area.radial=function(){var e=ws(bs);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},o.svg.chord=function(){var e=Hr,t=Wr,n=xs,r=es,i=ts;function o(n,r){var i,o,u=a(this,e,n,r),c=a(this,t,n,r);return"M"+u.p0+s(u.r,u.p1,u.a1-u.a0)+(o=c,((i=u).a0==o.a0&&i.a1==o.a1?l(u.r,u.p1,u.r,u.p0):l(u.r,u.p1,c.r,c.p0)+s(c.r,c.p1,c.a1-c.a0)+l(c.r,c.p1,u.r,u.p0))+"Z")}function a(e,t,o,a){var s=t.call(e,o,a),l=n.call(e,s,a),u=r.call(e,s,a)-je,c=i.call(e,s,a)-je;return{r:l,a0:u,a1:c,p0:[l*Math.cos(u),l*Math.sin(u)],p1:[l*Math.cos(c),l*Math.sin(c)]}}function s(e,t,n){return"A"+e+","+e+" 0 "+ +(n>Ee)+",1 "+t}function l(e,t,n,r){return"Q 0,0 "+r}return o.radius=function(e){return arguments.length?(n=yt(e),o):n},o.source=function(t){return arguments.length?(e=yt(t),o):e},o.target=function(e){return arguments.length?(t=yt(e),o):t},o.startAngle=function(e){return arguments.length?(r=yt(e),o):r},o.endAngle=function(e){return arguments.length?(i=yt(e),o):i},o},o.svg.diagonal=function(){var e=Hr,t=Wr,n=ks;function r(r,i){var o=e.call(this,r,i),a=t.call(this,r,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return r.source=function(t){return arguments.length?(e=yt(t),r):e},r.target=function(e){return arguments.length?(t=yt(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},o.svg.diagonal.radial=function(){var e=o.svg.diagonal(),t=ks,n=e.projection;return e.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-je;return[n*Math.cos(r),n*Math.sin(r)]}}(t=e)):t},e},o.svg.symbol=function(){var e=Ds,t=Cs;function n(n,r){return(As.get(e.call(this,n,r))||Ss)(t.call(this,n,r))}return n.type=function(t){return arguments.length?(e=yt(t),n):e},n.size=function(e){return arguments.length?(t=yt(e),n):t},n};var As=o.map({circle:Ss,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Ms)),n=t*Ms;return"M0,"+-t+"L"+n+",0 0,"+t+" "+-n+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Es),n=t*Es/2;return"M0,"+n+"L"+t+","+-n+" "+-t+","+-n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Es),n=t*Es/2;return"M0,"+-n+"L"+t+","+n+" "+-t+","+n+"Z"}});o.svg.symbolTypes=As.keys();var Es=Math.sqrt(3),Ms=Math.tan(30*Ne);Q.transition=function(e){for(var t,n,r=Fs||++zs,i=Rs(e),o=[],a=Os||{time:Date.now(),ease:fo,delay:0,duration:250},s=-1,l=this.length;++s<l;){o.push(t=[]);for(var u=this[s],c=-1,d=u.length;++c<d;)(n=u[c])&&Ps(n,c,i,r,a),t.push(n)}return Ns(o,i,r)},Q.interrupt=function(e){return this.each(null==e?Ts:js(Rs(e)))};var Ts=js(Rs());function js(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Ns(e,t,n){return V(e,Is),e.namespace=t,e.id=n,e}var Fs,Os,Is=[],zs=0;function $s(e,t,n,r){var i=e.id,o=e.namespace;return pe(e,"function"==typeof n?function(e,a,s){e[o][i].tween.set(t,r(n.call(e,e.__data__,a,s)))}:(n=r(n),function(e){e[o][i].tween.set(t,n)}))}function qs(e){return null==e&&(e=""),function(){this.textContent=e}}function Rs(e){return null==e?"__transition__":"__transition_"+e+"__"}function Ps(e,t,n,r,i){var o,a,s,l,u,c=e[n]||(e[n]={active:0,count:0}),d=c[r];function f(n){var i=c.active,f=c[i];for(var h in f&&(f.timer.c=null,f.timer.t=NaN,--c.count,delete c[i],f.event&&f.event.interrupt.call(e,e.__data__,f.index)),c)if(+h<r){var g=c[h];g.timer.c=null,g.timer.t=NaN,--c.count,delete c[h]}a.c=p,St(function(){return a.c&&p(n||1)&&(a.c=null,a.t=NaN),1},0,o),c.active=r,d.event&&d.event.start.call(e,e.__data__,t),u=[],d.tween.forEach(function(n,r){(r=r.call(e,e.__data__,t))&&u.push(r)}),l=d.ease,s=d.duration}function p(i){for(var o=i/s,a=l(o),f=u.length;f>0;)u[--f].call(e,a);if(o>=1)return d.event&&d.event.end.call(e,e.__data__,t),--c.count?delete c[r]:delete e[n],1}d||(o=i.time,a=St(function(e){var t=d.delay;if(a.t=t+o,t<=e)return f(e-t);a.c=f},0,o),d=c[r]={tween:new C,time:o,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++c.count)}Is.call=Q.call,Is.empty=Q.empty,Is.node=Q.node,Is.size=Q.size,o.transition=function(e,t){return e&&e.transition?Fs?e.transition(t):e:o.selection().transition(e)},o.transition.prototype=Is,Is.select=function(e){var t,n,r,i=this.id,o=this.namespace,a=[];e=K(e);for(var s=-1,l=this.length;++s<l;){a.push(t=[]);for(var u=this[s],c=-1,d=u.length;++c<d;)(r=u[c])&&(n=e.call(r,r.__data__,c,s))?("__data__"in r&&(n.__data__=r.__data__),Ps(n,c,o,i,r[o][i]),t.push(n)):t.push(null)}return Ns(a,o,i)},Is.selectAll=function(e){var t,n,r,i,o,a=this.id,s=this.namespace,l=[];e=Z(e);for(var u=-1,c=this.length;++u<c;)for(var d=this[u],f=-1,p=d.length;++f<p;)if(r=d[f]){o=r[s][a],n=e.call(r,r.__data__,f,u),l.push(t=[]);for(var h=-1,g=n.length;++h<g;)(i=n[h])&&Ps(i,h,s,a,o),t.push(i)}return Ns(l,s,a)},Is.filter=function(e){var t,n,r=[];"function"!=typeof e&&(e=de(e));for(var i=0,o=this.length;i<o;i++){r.push(t=[]);for(var a,s=0,l=(a=this[i]).length;s<l;s++)(n=a[s])&&e.call(n,n.__data__,s,i)&&t.push(n)}return Ns(r,this.namespace,this.id)},Is.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):pe(this,null==t?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Is.attr=function(e,t){if(arguments.length<2){for(t in e)this.attr(t,e[t]);return this}var n="transform"==e?ko:no,r=o.ns.qualify(e);function i(){this.removeAttribute(r)}function a(){this.removeAttributeNS(r.space,r.local)}return $s(this,"attr."+e,t,r.local?function(e){return null==e?a:(e+="",function(){var t,i=this.getAttributeNS(r.space,r.local);return i!==e&&(t=n(i,e),function(e){this.setAttributeNS(r.space,r.local,t(e))})})}:function(e){return null==e?i:(e+="",function(){var t,i=this.getAttribute(r);return i!==e&&(t=n(i,e),function(e){this.setAttribute(r,t(e))})})})},Is.attrTween=function(e,t){var n=o.ns.qualify(e);return this.tween("attr."+e,n.local?function(e,r){var i=t.call(this,e,r,this.getAttributeNS(n.space,n.local));return i&&function(e){this.setAttributeNS(n.space,n.local,i(e))}}:function(e,r){var i=t.call(this,e,r,this.getAttribute(n));return i&&function(e){this.setAttribute(n,i(e))}})},Is.style=function(e,t,n){var r=arguments.length;if(r<3){if("string"!=typeof e){for(n in r<2&&(t=""),e)this.style(n,e[n],t);return this}n=""}function i(){this.style.removeProperty(e)}return $s(this,"style."+e,t,function(t){return null==t?i:(t+="",function(){var r,i=c(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(r=no(i,t),function(t){this.style.setProperty(e,r(t),n)})})})},Is.styleTween=function(e,t,n){return arguments.length<3&&(n=""),this.tween("style."+e,function(r,i){var o=t.call(this,r,i,c(this).getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),n)}})},Is.text=function(e){return $s(this,"text",e,qs)},Is.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Is.ease=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].ease:("function"!=typeof e&&(e=o.ease.apply(o,arguments)),pe(this,function(r){r[n][t].ease=e}))},Is.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:pe(this,"function"==typeof e?function(r,i,o){r[n][t].delay=+e.call(r,r.__data__,i,o)}:(e=+e,function(r){r[n][t].delay=e}))},Is.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:pe(this,"function"==typeof e?function(r,i,o){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,o))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Is.each=function(e,t){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Os,a=Fs;try{Fs=n,pe(this,function(t,i,o){Os=t[r][n],e.call(t,t.__data__,i,o)})}finally{Os=i,Fs=a}}else pe(this,function(i){var a=i[r][n];(a.event||(a.event=o.dispatch("start","end","interrupt"))).on(e,t)});return this},Is.transition=function(){for(var e,t,n,r=this.id,i=++zs,o=this.namespace,a=[],s=0,l=this.length;s<l;s++){a.push(e=[]);for(var u,c=0,d=(u=this[s]).length;c<d;c++)(t=u[c])&&Ps(t,c,o,i,{time:(n=t[o][r]).time,ease:n.ease,delay:n.delay+n.duration,duration:n.duration}),e.push(t)}return Ns(a,o,i)},o.svg.axis=function(){var e,t=o.scale.linear(),n=Ls,r=6,i=6,a=3,l=[10],u=null;function c(s){s.each(function(){var s,c=o.select(this),d=this.__chart__||t,f=this.__chart__=t.copy(),p=null==u?f.ticks?f.ticks.apply(f,l):f.domain():u,h=null==e?f.tickFormat?f.tickFormat.apply(f,l):F:e,g=c.selectAll(".tick").data(p,f),m=g.enter().insert("g",".domain").attr("class","tick").style("opacity",Se),v=o.transition(g.exit()).style("opacity",Se).remove(),y=o.transition(g.order()).style("opacity",1),_=Math.max(r,0)+a,b=xa(f),w=c.selectAll(".domain").data([0]),x=(w.enter().append("path").attr("class","domain"),o.transition(w));m.append("line"),m.append("text");var k,C,D,S,A=m.select("line"),E=y.select("line"),M=g.select("text").text(h),T=m.select("text"),j=y.select("text"),N="top"===n||"left"===n?-1:1;if("bottom"===n||"top"===n?(s=Us,k="x",D="y",C="x2",S="y2",M.attr("dy",N<0?"0em":".71em").style("text-anchor","middle"),x.attr("d","M"+b[0]+","+N*i+"V0H"+b[1]+"V"+N*i)):(s=Vs,k="y",D="x",C="y2",S="x2",M.attr("dy",".32em").style("text-anchor",N<0?"end":"start"),x.attr("d","M"+N*i+","+b[0]+"H0V"+b[1]+"H"+N*i)),A.attr(S,N*r),T.attr(D,N*_),E.attr(C,0).attr(S,N*r),j.attr(k,0).attr(D,N*_),f.rangeBand){var O=f,I=O.rangeBand()/2;d=f=function(e){return O(e)+I}}else d.rangeBand?d=f:v.call(s,f,d);m.call(s,d,f),y.call(s,f,f)})}return c.scale=function(e){return arguments.length?(t=e,c):t},c.orient=function(e){return arguments.length?(n=e in Bs?e+"":Ls,c):n},c.ticks=function(){return arguments.length?(l=s(arguments),c):l},c.tickValues=function(e){return arguments.length?(u=e,c):u},c.tickFormat=function(t){return arguments.length?(e=t,c):e},c.tickSize=function(e){var t=arguments.length;return t?(r=+e,i=+arguments[t-1],c):r},c.innerTickSize=function(e){return arguments.length?(r=+e,c):r},c.outerTickSize=function(e){return arguments.length?(i=+e,c):i},c.tickPadding=function(e){return arguments.length?(a=+e,c):a},c.tickSubdivide=function(){return arguments.length&&c},c};var Ls="bottom",Bs={top:1,right:1,bottom:1,left:1};function Us(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"})}function Vs(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"})}o.svg.brush=function(){var e,t,n=B(f,"brushstart","brush","brushend"),r=null,i=null,a=[0,0],s=[0,0],l=!0,u=!0,d=Ws[0];function f(e){e.each(function(){var e=o.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),t=e.selectAll(".background").data([0]);t.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),e.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=e.selectAll(".resize").data(d,F);n.exit().remove(),n.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return Hs[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",f.empty()?"none":null);var a,s=o.transition(e),l=o.transition(t);r&&(a=xa(r),l.attr("x",a[0]).attr("width",a[1]-a[0]),h(s)),i&&(a=xa(i),l.attr("y",a[0]).attr("height",a[1]-a[0]),g(s)),p(s)})}function p(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+a[+/e$/.test(e)]+","+s[+/^s/.test(e)]+")"})}function h(e){e.select(".extent").attr("x",a[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",a[1]-a[0])}function g(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function m(){var d,m,v=this,y=o.select(o.event.target),_=n.of(v,arguments),b=o.select(v),w=y.datum(),x=!/^(n|s)$/.test(w)&&r,k=!/^(e|w)$/.test(w)&&i,C=y.classed("extent"),D=xe(v),S=o.mouse(v),A=o.select(c(v)).on("keydown.brush",function(){32==o.event.keyCode&&(C||(d=null,S[0]-=a[1],S[1]-=s[1],C=2),P())}).on("keyup.brush",function(){32==o.event.keyCode&&2==C&&(S[0]+=a[1],S[1]+=s[1],C=0,P())});if(o.event.changedTouches?A.on("touchmove.brush",T).on("touchend.brush",N):A.on("mousemove.brush",T).on("mouseup.brush",N),b.interrupt().selectAll("*").interrupt(),C)S[0]=a[0]-S[0],S[1]=s[0]-S[1];else if(w){var E=+/w$/.test(w),M=+/^n/.test(w);m=[a[1-E]-S[0],s[1-M]-S[1]],S[0]=a[E],S[1]=s[M]}else o.event.altKey&&(d=S.slice());function T(){var e=o.mouse(v),t=!1;m&&(e[0]+=m[0],e[1]+=m[1]),C||(o.event.altKey?(d||(d=[(a[0]+a[1])/2,(s[0]+s[1])/2]),S[0]=a[+(e[0]<d[0])],S[1]=s[+(e[1]<d[1])]):d=null),x&&j(e,r,0)&&(h(b),t=!0),k&&j(e,i,1)&&(g(b),t=!0),t&&(p(b),_({type:"brush",mode:C?"move":"resize"}))}function j(n,r,i){var o,c,f=xa(r),p=f[0],h=f[1],g=S[i],m=i?s:a,v=m[1]-m[0];if(C&&(p-=g,h-=v+g),o=(i?u:l)?Math.max(p,Math.min(h,n[i])):n[i],C?c=(o+=g)+v:(d&&(g=Math.max(p,Math.min(h,2*d[i]-o))),g<o?(c=o,o=g):c=g),m[0]!=o||m[1]!=c)return i?t=null:e=null,m[0]=o,m[1]=c,!0}function N(){T(),b.style("pointer-events","all").selectAll(".resize").style("display",f.empty()?"none":null),o.select("body").style("cursor",null),A.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),D(),_({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),o.select("body").style("cursor",y.style("cursor")),_({type:"brushstart"}),T()}return f.event=function(r){r.each(function(){var r=n.of(this,arguments),i={x:a,y:s,i:e,j:t},l=this.__chart__||i;this.__chart__=i,Fs?o.select(this).transition().each("start.brush",function(){e=l.i,t=l.j,a=l.x,s=l.y,r({type:"brushstart"})}).tween("brush:brush",function(){var n=ro(a,i.x),o=ro(s,i.y);return e=t=null,function(e){a=i.x=n(e),s=i.y=o(e),r({type:"brush",mode:"resize"})}}).each("end.brush",function(){e=i.i,t=i.j,r({type:"brush",mode:"resize"}),r({type:"brushend"})}):(r({type:"brushstart"}),r({type:"brush",mode:"resize"}),r({type:"brushend"}))})},f.x=function(e){return arguments.length?(d=Ws[!(r=e)<<1|!i],f):r},f.y=function(e){return arguments.length?(d=Ws[!r<<1|!(i=e)],f):i},f.clamp=function(e){return arguments.length?(r&&i?(l=!!e[0],u=!!e[1]):r?l=!!e:i&&(u=!!e),f):r&&i?[l,u]:r?l:i?u:null},f.extent=function(n){var o,l,u,c,d;return arguments.length?(r&&(o=n[0],l=n[1],i&&(o=o[0],l=l[0]),e=[o,l],r.invert&&(o=r(o),l=r(l)),l<o&&(d=o,o=l,l=d),o==a[0]&&l==a[1]||(a=[o,l])),i&&(u=n[0],c=n[1],r&&(u=u[1],c=c[1]),t=[u,c],i.invert&&(u=i(u),c=i(c)),c<u&&(d=u,u=c,c=d),u==s[0]&&c==s[1]||(s=[u,c])),f):(r&&(e?(o=e[0],l=e[1]):(o=a[0],l=a[1],r.invert&&(o=r.invert(o),l=r.invert(l)),l<o&&(d=o,o=l,l=d))),i&&(t?(u=t[0],c=t[1]):(u=s[0],c=s[1],i.invert&&(u=i.invert(u),c=i.invert(c)),c<u&&(d=u,u=c,c=d))),r&&i?[[o,u],[l,c]]:r?[o,l]:i&&[u,c])},f.clear=function(){return f.empty()||(a=[0,0],s=[0,0],e=t=null),f},f.empty=function(){return!!r&&a[0]==a[1]||!!i&&s[0]==s[1]},o.rebind(f,n,"on")};var Hs={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ws=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Gs=zt.format=fn.timeFormat,Ys=Gs.utc,Qs=Ys("%Y-%m-%dT%H:%M:%S.%LZ");function Ks(e){return e.toISOString()}function Zs(e,t,n){function r(t){return e(t)}function i(e,n){var r=(e[1]-e[0])/n,i=o.bisect(Js,r);return i==Js.length?[t.year,ja(e.map(function(e){return e/31536e6}),n)[2]]:i?t[r/Js[i-1]<Js[i]/r?i-1:i]:[nl,ja(e,n)[2]]}return r.invert=function(t){return Xs(e.invert(t))},r.domain=function(t){return arguments.length?(e.domain(t),r):e.domain().map(Xs)},r.nice=function(e,t){var n=r.domain(),o=wa(n),a=null==e?i(o,10):"number"==typeof e&&i(o,e);function s(n){return!isNaN(n)&&!e.range(n,Xs(+n+1),t).length}return a&&(e=a[0],t=a[1]),r.domain(Ca(n,t>1?{floor:function(t){for(;s(t=e.floor(t));)t=Xs(t-1);return t},ceil:function(t){for(;s(t=e.ceil(t));)t=Xs(+t+1);return t}}:e))},r.ticks=function(e,t){var n=wa(r.domain()),o=null==e?i(n,10):"number"==typeof e?i(n,e):!e.range&&[{range:e},t];return o&&(e=o[0],t=o[1]),e.range(n[0],Xs(+n[1]+1),t<1?1:t)},r.tickFormat=function(){return n},r.copy=function(){return Zs(e.copy(),t,n)},Ma(r,e)}function Xs(e){return new Date(e)}Gs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ks:Qs,Ks.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Ks.toString=Qs.toString,zt.second=Pt(function(e){return new $t(1e3*Math.floor(e/1e3))},function(e,t){e.setTime(e.getTime()+1e3*Math.floor(t))},function(e){return e.getSeconds()}),zt.seconds=zt.second.range,zt.seconds.utc=zt.second.utc.range,zt.minute=Pt(function(e){return new $t(6e4*Math.floor(e/6e4))},function(e,t){e.setTime(e.getTime()+6e4*Math.floor(t))},function(e){return e.getMinutes()}),zt.minutes=zt.minute.range,zt.minutes.utc=zt.minute.utc.range,zt.hour=Pt(function(e){var t=e.getTimezoneOffset()/60;return new $t(36e5*(Math.floor(e/36e5-t)+t))},function(e,t){e.setTime(e.getTime()+36e5*Math.floor(t))},function(e){return e.getHours()}),zt.hours=zt.hour.range,zt.hours.utc=zt.hour.utc.range,zt.month=Pt(function(e){return(e=zt.day(e)).setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),zt.months=zt.month.range,zt.months.utc=zt.month.utc.range;var Js=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],el=[[zt.second,1],[zt.second,5],[zt.second,15],[zt.second,30],[zt.minute,1],[zt.minute,5],[zt.minute,15],[zt.minute,30],[zt.hour,1],[zt.hour,3],[zt.hour,6],[zt.hour,12],[zt.day,1],[zt.day,2],[zt.week,1],[zt.month,1],[zt.month,3],[zt.year,1]],tl=Gs.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&1!=e.getDate()}],["%b %d",function(e){return 1!=e.getDate()}],["%B",function(e){return e.getMonth()}],["%Y",Zn]]),nl={range:function(e,t,n){return o.range(Math.ceil(e/n)*n,+t,n).map(Xs)},floor:F,ceil:F};el.year=zt.year,zt.scale=function(){return Zs(o.scale.linear(),el,tl)};var rl=el.map(function(e){return[e[0].utc,e[1]]}),il=Ys.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&1!=e.getUTCDate()}],["%b %d",function(e){return 1!=e.getUTCDate()}],["%B",function(e){return e.getUTCMonth()}],["%Y",Zn]]);function ol(e){return JSON.parse(e.responseText)}function al(e){var t=l.createRange();return t.selectNode(l.body),t.createContextualFragment(e.responseText)}rl.year=zt.year.utc,zt.scale.utc=function(){return Zs(o.scale.linear(),rl,il)},o.text=_t(function(e){return e.responseText}),o.json=function(e,t){return bt(e,"application/json",ol,t)},o.html=function(e,t){return bt(e,"text/html",al,t)},o.xml=_t(function(e){return e.responseXML}),this.d3=o,void 0===(i="function"==typeof(r=o)?r.call(t,n,t,e):r)||(e.exports=i)}()},3729:function(e,t){var n,r;void 0===(r="function"==typeof(n=function(){return function e(t,n,r){var i,o,a=window,s="application/octet-stream",l=r||s,u=t,c=!n&&!r&&u,d=document.createElement("a"),f=function(e){return String(e)},p=a.Blob||a.MozBlob||a.WebKitBlob||f,h=n||"download";if(p=p.call?p.bind(a):Blob,"true"===String(this)&&(l=(u=[u,l])[0],u=u[1]),c&&c.length<2048&&(h=c.split("/").pop().split("?")[0],d.href=c,-1!==d.href.indexOf(c))){var g=new XMLHttpRequest;return g.open("GET",c,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,h,s)},setTimeout(function(){g.send()},0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&p!==f))return navigator.msSaveBlob?navigator.msSaveBlob(_(u),h):b(u);l=(u=_(u)).type||s}else if(/([\x80-\xff])/.test(u)){for(var m=0,v=new Uint8Array(u.length),y=v.length;m<y;++m)v[m]=u.charCodeAt(m);u=new p([v],{type:l})}function _(e){for(var t=e.split(/[:;,]/),n=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),i=r.length,o=0,a=new Uint8Array(i);o<i;++o)a[o]=r.charCodeAt(o);return new p([a],{type:n})}function b(e,t){if("download"in d)return d.href=e,d.setAttribute("download",h),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout(function(){d.click(),document.body.removeChild(d),!0===t&&setTimeout(function(){a.URL.revokeObjectURL(d.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout(function(){document.body.removeChild(n)},333)}if(i=u instanceof p?u:new p([u],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(i,h);if(a.URL)b(a.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===f)try{return b("data:"+l+";base64,"+a.btoa(i))}catch(e){return b("data:"+l+","+encodeURIComponent(i))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(i)}return!0}})?n.apply(t,[]):n)||(e.exports=r)},9983:function(e,t,n){var r=n(9755),i=n(7672);void 0===i.jQuery&&(i.jQuery={}),void 0===i.jQuery.$&&(i.jQuery.$=r),e.exports=r},3857:function(e,t,n){var r=n(5078);n(7672).d3=r,e.exports=r},4663:function(e,t,n){var r=n(6107);n(7672).jsPanel=r,e.exports=r},7672:function(e,t,n){"use strict";e.exports=function(){if("object"==typeof globalThis)return globalThis;var e;try{e=this||new Function("return this")()}catch(e){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return e}()},624:function(e,t,n){"use strict";var r,i,o,a=[n(5525),n(4785),n(8291),n(2709),n(2506),n(9176)],s=-1,l=[],u=!1;function c(){r&&i&&(r=!1,i.length?l=i.concat(l):s=-1,l.length&&d())}function d(){if(!r){u=!1,r=!0;for(var e=l.length,t=setTimeout(c);e;){for(i=l,l=[];i&&++s<e;)i[s].run();s=-1,e=l.length}i=null,s=-1,r=!1,clearTimeout(t)}}for(var f=-1,p=a.length;++f<p;)if(a[f]&&a[f].test&&a[f].test()){o=a[f].install(d);break}function h(e,t){this.fun=e,this.array=t}h.prototype.run=function(){var e=this.fun,t=this.array;switch(t.length){case 0:return e();case 1:return e(t[0]);case 2:return e(t[0],t[1]);case 3:return e(t[0],t[1],t[2]);default:return e.apply(null,t)}},e.exports=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),u||r||(u=!0,o())}},2709:function(e,t,n){"use strict";t.test=function(){return!n.g.setImmediate&&void 0!==n.g.MessageChannel},t.install=function(e){var t=new n.g.MessageChannel;return t.port1.onmessage=e,function(){t.port2.postMessage(0)}}},8291:function(e,t,n){"use strict";var r=n.g.MutationObserver||n.g.WebKitMutationObserver;t.test=function(){return r},t.install=function(e){var t=0,i=new r(e),o=n.g.document.createTextNode("");return i.observe(o,{characterData:!0}),function(){o.data=t=++t%2}}},4785:function(e,t,n){"use strict";t.test=function(){return"function"==typeof n.g.queueMicrotask},t.install=function(e){return function(){n.g.queueMicrotask(e)}}},2506:function(e,t,n){"use strict";t.test=function(){return"document"in n.g&&"onreadystatechange"in n.g.document.createElement("script")},t.install=function(e){return function(){var t=n.g.document.createElement("script");return t.onreadystatechange=function(){e(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},n.g.document.documentElement.appendChild(t),e}}},9176:function(e,t){"use strict";t.test=function(){return!0},t.install=function(e){return function(){setTimeout(e,0)}}},5384:function(e,t,n){var r,i,o;i=[n(9983),n(1491)],r=function(e){"use strict";var t=function(i,o){i[0].queryBuilder=this,this.$el=i,this.settings=e.extendext(!0,"replace",{},t.DEFAULTS,o),this.model=new r,this.status={id:null,generated_id:!1,group_id:0,rule_id:0,has_optgroup:!1,has_operator_optgroup:!1},this.filters=this.settings.filters,this.icons=this.settings.icons,this.operators=this.settings.operators,this.templates=this.settings.templates,this.plugins=this.settings.plugins,this.lang=null,void 0===t.regional.en&&n.error("Config",'"i18n/en.js" not loaded.'),this.lang=e.extendext(!0,"replace",{},t.regional.en,t.regional[this.settings.lang_code],this.settings.lang),!1===this.settings.allow_groups?this.settings.allow_groups=0:!0===this.settings.allow_groups&&(this.settings.allow_groups=-1),Object.keys(this.templates).forEach(function(e){if(this.templates[e]||(this.templates[e]=t.templates[e]),"function"!=typeof this.templates[e])throw new Error(`Template ${e} must be a function`)},this),this.$el.attr("id")||(this.$el.attr("id","qb_"+Math.floor(99999*Math.random())),this.status.generated_id=!0),this.status.id=this.$el.attr("id"),this.$el.addClass("query-builder form-inline"),this.filters=this.checkFilters(this.filters),this.operators=this.checkOperators(this.operators),this.bindEvents(),this.initPlugins()};e.extend(t.prototype,{trigger:function(t){var n=new e.Event(this._tojQueryEvent(t),{builder:this});return this.$el.triggerHandler(n,Array.prototype.slice.call(arguments,1)),n},change:function(t,n){var r=new e.Event(this._tojQueryEvent(t,!0),{builder:this,value:n});return this.$el.triggerHandler(r,Array.prototype.slice.call(arguments,2)),r.value},on:function(e,t){return this.$el.on(this._tojQueryEvent(e),t),this},off:function(e,t){return this.$el.off(this._tojQueryEvent(e),t),this},once:function(e,t){return this.$el.one(this._tojQueryEvent(e),t),this},_tojQueryEvent:function(e,t){return e.split(" ").map(function(e){return e+".queryBuilder"+(t?".filter":"")}).join(" ")}}),t.types={string:"string",integer:"number",double:"number",date:"datetime",time:"datetime",datetime:"datetime",boolean:"boolean"},t.inputs=["text","number","textarea","radio","checkbox","select"],t.modifiable_options=["display_errors","allow_groups","allow_empty","default_condition","default_filter"],t.selectors={group_container:".rules-group-container",rule_container:".rule-container",filter_container:".rule-filter-container",operator_container:".rule-operator-container",value_container:".rule-value-container",error_container:".error-container",condition_container:".rules-group-header .group-conditions",rule_header:".rule-header",group_header:".rules-group-header",group_actions:".group-actions",rule_actions:".rule-actions",rules_list:".rules-group-body>.rules-list",group_condition:".rules-group-header [name$=_cond]",rule_filter:".rule-filter-container [name$=_filter]",rule_operator:".rule-operator-container [name$=_operator]",rule_value:".rule-value-container [name*=_value_]",add_rule:"[data-add=rule]",delete_rule:"[data-delete=rule]",add_group:"[data-add=group]",delete_group:"[data-delete=group]"},t.templates={},t.regional={},t.OPERATORS={equal:{type:"equal",nb_inputs:1,multiple:!1,apply_to:["string","number","datetime","boolean"]},not_equal:{type:"not_equal",nb_inputs:1,multiple:!1,apply_to:["string","number","datetime","boolean"]},in:{type:"in",nb_inputs:1,multiple:!0,apply_to:["string","number","datetime"]},not_in:{type:"not_in",nb_inputs:1,multiple:!0,apply_to:["string","number","datetime"]},less:{type:"less",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},less_or_equal:{type:"less_or_equal",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},greater:{type:"greater",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},greater_or_equal:{type:"greater_or_equal",nb_inputs:1,multiple:!1,apply_to:["number","datetime"]},between:{type:"between",nb_inputs:2,multiple:!1,apply_to:["number","datetime"]},not_between:{type:"not_between",nb_inputs:2,multiple:!1,apply_to:["number","datetime"]},begins_with:{type:"begins_with",nb_inputs:1,multiple:!1,apply_to:["string"]},not_begins_with:{type:"not_begins_with",nb_inputs:1,multiple:!1,apply_to:["string"]},contains:{type:"contains",nb_inputs:1,multiple:!1,apply_to:["string"]},not_contains:{type:"not_contains",nb_inputs:1,multiple:!1,apply_to:["string"]},ends_with:{type:"ends_with",nb_inputs:1,multiple:!1,apply_to:["string"]},not_ends_with:{type:"not_ends_with",nb_inputs:1,multiple:!1,apply_to:["string"]},is_empty:{type:"is_empty",nb_inputs:0,multiple:!1,apply_to:["string"]},is_not_empty:{type:"is_not_empty",nb_inputs:0,multiple:!1,apply_to:["string"]},is_null:{type:"is_null",nb_inputs:0,multiple:!1,apply_to:["string","number","datetime","boolean"]},is_not_null:{type:"is_not_null",nb_inputs:0,multiple:!1,apply_to:["string","number","datetime","boolean"]}},t.DEFAULTS={filters:[],plugins:[],sort_filters:!1,display_errors:!0,allow_groups:-1,allow_empty:!1,conditions:["AND","OR"],default_condition:"AND",inputs_separator:" , ",select_placeholder:"------",display_empty_filter:!0,default_filter:null,optgroups:{},default_rule_flags:{filter_readonly:!1,operator_readonly:!1,value_readonly:!1,no_delete:!1},default_group_flags:{condition_readonly:!1,no_add_rule:!1,no_add_group:!1,no_delete:!1},templates:{group:null,rule:null,filterSelect:null,operatorSelect:null,ruleValueSelect:null},lang_code:"en",lang:{},operators:["equal","not_equal","in","not_in","less","less_or_equal","greater","greater_or_equal","between","not_between","begins_with","not_begins_with","contains","not_contains","ends_with","not_ends_with","is_empty","is_not_empty","is_null","is_not_null"],icons:{add_group:"glyphicon glyphicon-plus-sign",add_rule:"glyphicon glyphicon-plus",remove_group:"glyphicon glyphicon-remove",remove_rule:"glyphicon glyphicon-remove",error:"glyphicon glyphicon-warning-sign"}},t.plugins={},t.defaults=function(n){if("object"!=typeof n)return"string"==typeof n?"object"==typeof t.DEFAULTS[n]?e.extend(!0,{},t.DEFAULTS[n]):t.DEFAULTS[n]:e.extend(!0,{},t.DEFAULTS);e.extendext(!0,"replace",t.DEFAULTS,n)},t.define=function(e,n,r){t.plugins[e]={fct:n,def:r||{}}},t.extend=function(n){e.extend(t.prototype,n)},t.prototype.initPlugins=function(){if(this.plugins){if(e.isArray(this.plugins)){var r={};this.plugins.forEach(function(e){r[e]=null}),this.plugins=r}Object.keys(this.plugins).forEach(function(r){r in t.plugins?(this.plugins[r]=e.extend(!0,{},t.plugins[r].def,this.plugins[r]||{}),t.plugins[r].fct.call(this,this.plugins[r])):n.error("Config",'Unable to find plugin "{0}"',r)},this)}},t.prototype.getPluginOptions=function(e,r){var i;if(this.plugins&&this.plugins[e]?i=this.plugins[e]:t.plugins[e]&&(i=t.plugins[e].def),i)return r?i[r]:i;n.error("Config",'Unable to find plugin "{0}"',e)},t.prototype.init=function(e){this.trigger("afterInit"),e?(this.setRules(e),delete this.settings.rules):this.setRoot(!0)},t.prototype.checkFilters=function(e){var r=[];if(e&&0!==e.length||n.error("Config","Missing filters list"),e.forEach(function(e,i){switch(e.id||n.error("Config","Missing filter {0} id",i),-1!=r.indexOf(e.id)&&n.error("Config",'Filter "{0}" already defined',e.id),r.push(e.id),e.type?t.types[e.type]||n.error("Config",'Invalid type "{0}"',e.type):e.type="string",e.input?"function"!=typeof e.input&&-1==t.inputs.indexOf(e.input)&&n.error("Config",'Invalid input "{0}"',e.input):e.input="number"===t.types[e.type]?"number":"text",e.operators&&e.operators.forEach(function(e){"string"!=typeof e&&n.error("Config","Filter operators must be global operators types (string)")}),e.field||(e.field=e.id),e.label||(e.label=e.field),e.optgroup?(this.status.has_optgroup=!0,this.settings.optgroups[e.optgroup]||(this.settings.optgroups[e.optgroup]=e.optgroup)):e.optgroup=null,e.input){case"radio":case"checkbox":(!e.values||e.values.length<1)&&n.error("Config",'Missing filter "{0}" values',e.id);break;case"select":var o=[];e.has_optgroup=!1,n.iterateOptions(e.values,function(t,n,r){o.push({value:t,label:n,optgroup:r||null}),r&&(e.has_optgroup=!0,this.settings.optgroups[r]||(this.settings.optgroups[r]=r))}.bind(this)),e.has_optgroup?e.values=n.groupSort(o,"optgroup"):e.values=o,e.placeholder&&(void 0===e.placeholder_value&&(e.placeholder_value=-1),e.values.forEach(function(t){t.value==e.placeholder_value&&n.error("Config",'Placeholder of filter "{0}" overlaps with one of its values',e.id)}))}},this),this.settings.sort_filters)if("function"==typeof this.settings.sort_filters)e.sort(this.settings.sort_filters);else{var i=this;e.sort(function(e,t){return i.translate(e.label).localeCompare(i.translate(t.label))})}return this.status.has_optgroup&&(e=n.groupSort(e,"optgroup")),e},t.prototype.checkOperators=function(r){var i=[];return r.forEach(function(o,a){"string"==typeof o?(t.OPERATORS[o]||n.error("Config",'Unknown operator "{0}"',o),r[a]=o=e.extendext(!0,"replace",{},t.OPERATORS[o])):(o.type||n.error("Config",'Missing "type" for operator {0}',a),t.OPERATORS[o.type]&&(r[a]=o=e.extendext(!0,"replace",{},t.OPERATORS[o.type],o)),void 0!==o.nb_inputs&&void 0!==o.apply_to||n.error("Config",'Missing "nb_inputs" and/or "apply_to" for operator "{0}"',o.type)),-1!=i.indexOf(o.type)&&n.error("Config",'Operator "{0}" already defined',o.type),i.push(o.type),o.optgroup?(this.status.has_operator_optgroup=!0,this.settings.optgroups[o.optgroup]||(this.settings.optgroups[o.optgroup]=o.optgroup)):o.optgroup=null},this),this.status.has_operator_optgroup&&(r=n.groupSort(r,"optgroup")),r},t.prototype.bindEvents=function(){var n=this,r=t.selectors;this.$el.on("change.queryBuilder",r.group_condition,function(){if(e(this).is(":checked")){var t=e(this).closest(r.group_container);n.getModel(t).condition=e(this).val()}}),this.$el.on("change.queryBuilder",r.rule_filter,function(){var t=e(this).closest(r.rule_container);n.getModel(t).filter=n.getFilterById(e(this).val())}),this.$el.on("change.queryBuilder",r.rule_operator,function(){var t=e(this).closest(r.rule_container);n.getModel(t).operator=n.getOperatorByType(e(this).val())}),this.$el.on("click.queryBuilder",r.add_rule,function(){var t=e(this).closest(r.group_container);n.addRule(n.getModel(t))}),this.$el.on("click.queryBuilder",r.delete_rule,function(){var t=e(this).closest(r.rule_container);n.deleteRule(n.getModel(t))}),0!==this.settings.allow_groups&&(this.$el.on("click.queryBuilder",r.add_group,function(){var t=e(this).closest(r.group_container);n.addGroup(n.getModel(t))}),this.$el.on("click.queryBuilder",r.delete_group,function(){var t=e(this).closest(r.group_container);n.deleteGroup(n.getModel(t))})),this.model.on({drop:function(e,t){t.$el.remove(),n.refreshGroupsConditions()},add:function(e,r,i,o){0===o?i.$el.prependTo(r.$el.find(">"+t.selectors.rules_list)):i.$el.insertAfter(r.rules[o-1].$el),n.refreshGroupsConditions()},move:function(e,r,i,o){r.$el.detach(),0===o?r.$el.prependTo(i.$el.find(">"+t.selectors.rules_list)):r.$el.insertAfter(i.rules[o-1].$el),n.refreshGroupsConditions()},update:function(e,t,r,i,o){if(t instanceof a)switch(r){case"error":n.updateError(t);break;case"flags":n.applyRuleFlags(t);break;case"filter":n.updateRuleFilter(t,o);break;case"operator":n.updateRuleOperator(t,o);break;case"value":n.updateRuleValue(t,o)}else switch(r){case"error":n.updateError(t);break;case"flags":n.applyGroupFlags(t);break;case"condition":n.updateGroupCondition(t,o)}}})},t.prototype.setRoot=function(t,n,r){t=void 0===t||!0===t;var i=this.nextGroupId(),a=e(e.parseHTML(this.getGroupTemplate(i,1)));return this.$el.append(a),this.model.root=new o(null,a),this.model.root.model=this.model,this.model.root.data=n,this.model.root.flags=e.extend({},this.settings.default_group_flags,r),this.model.root.condition=this.settings.default_condition,this.trigger("afterAddGroup",this.model.root),t&&this.addRule(this.model.root),this.model.root},t.prototype.addGroup=function(t,n,r,i){n=void 0===n||!0===n;var o=t.level+1;if(this.trigger("beforeAddGroup",t,n,o).isDefaultPrevented())return null;var a=this.nextGroupId(),s=e(this.getGroupTemplate(a,o)),l=t.addGroup(s);return l.data=r,l.flags=e.extend({},this.settings.default_group_flags,i),l.condition=this.settings.default_condition,this.trigger("afterAddGroup",l),this.trigger("rulesChanged"),n&&this.addRule(l),l},t.prototype.deleteGroup=function(e){if(e.isRoot())return!1;if(this.trigger("beforeDeleteGroup",e).isDefaultPrevented())return!1;var t=!0;return e.each("reverse",function(e){t&=this.deleteRule(e)},function(e){t&=this.deleteGroup(e)},this),t&&(e.drop(),this.trigger("afterDeleteGroup"),this.trigger("rulesChanged")),t},t.prototype.updateGroupCondition=function(n,r){n.$el.find(">"+t.selectors.group_condition).each(function(){var t=e(this);t.prop("checked",t.val()===n.condition),t.parent().toggleClass("active",t.val()===n.condition)}),this.trigger("afterUpdateGroupCondition",n,r),this.trigger("rulesChanged")},t.prototype.refreshGroupsConditions=function(){!function e(n){(!n.flags||n.flags&&!n.flags.condition_readonly)&&n.$el.find(">"+t.selectors.group_condition).prop("disabled",n.rules.length<=1).parent().toggleClass("disabled",n.rules.length<=1),n.each(null,function(t){e(t)},this)}(this.model.root)},t.prototype.addRule=function(t,n,r){if(this.trigger("beforeAddRule",t).isDefaultPrevented())return null;var i=this.nextRuleId(),o=e(e.parseHTML(this.getRuleTemplate(i))),a=t.addRule(o);return a.data=n,a.flags=e.extend({},this.settings.default_rule_flags,r),this.trigger("afterAddRule",a),this.trigger("rulesChanged"),this.createRuleFilters(a),!this.settings.default_filter&&this.settings.display_empty_filter||(a.filter=this.change("getDefaultFilter",this.getFilterById(this.settings.default_filter||this.filters[0].id),a)),a},t.prototype.deleteRule=function(e){return!e.flags.no_delete&&!this.trigger("beforeDeleteRule",e).isDefaultPrevented()&&(e.drop(),this.trigger("afterDeleteRule"),this.trigger("rulesChanged"),!0)},t.prototype.createRuleFilters=function(n){var r=this.change("getRuleFilters",this.filters,n),i=e(e.parseHTML(this.getRuleFilterSelect(n,r)));n.$el.find(t.selectors.filter_container).html(i),this.trigger("afterCreateRuleFilters",n),this.applyRuleFlags(n)},t.prototype.createRuleOperators=function(n){var r=n.$el.find(t.selectors.operator_container).empty();if(n.filter){var i=this.getOperators(n.filter),o=e(e.parseHTML(this.getRuleOperatorSelect(n,i)));r.html(o),n.filter.default_operator?n.__.operator=this.getOperatorByType(n.filter.default_operator):n.__.operator=i[0],n.$el.find(t.selectors.rule_operator).val(n.operator.type),this.trigger("afterCreateRuleOperators",n,i),this.applyRuleFlags(n)}},t.prototype.createRuleInput=function(n){var r=n.$el.find(t.selectors.value_container).empty();if(n.__.value=void 0,n.filter&&n.operator&&0!==n.operator.nb_inputs){for(var i=this,o=e(),a=n.filter,s=0;s<n.operator.nb_inputs;s++){var l=e(e.parseHTML(e.trim(this.getRuleInput(n,s))));s>0&&r.append(this.settings.inputs_separator),r.append(l),o=o.add(l)}r.css("display",""),o.on("change "+(a.input_event||""),function(){n._updating_input||(n._updating_value=!0,n.value=i.getRuleInputValue(n),n._updating_value=!1)}),a.plugin&&o[a.plugin](a.plugin_config||{}),this.trigger("afterCreateRuleInput",n),void 0!==a.default_value?n.value=a.default_value:(n._updating_value=!0,n.value=i.getRuleInputValue(n),n._updating_value=!1),this.applyRuleFlags(n)}},t.prototype.updateRuleFilter=function(e,n){this.createRuleOperators(e),this.createRuleInput(e),e.$el.find(t.selectors.rule_filter).val(e.filter?e.filter.id:"-1"),n&&e.filter&&n.id!==e.filter.id&&(e.data=void 0),this.trigger("afterUpdateRuleFilter",e,n),this.trigger("rulesChanged")},t.prototype.updateRuleOperator=function(e,n){var r=e.$el.find(t.selectors.value_container);e.operator&&0!==e.operator.nb_inputs?(r.css("display",""),!r.is(":empty")&&n&&e.operator.nb_inputs===n.nb_inputs&&e.operator.optgroup===n.optgroup||this.createRuleInput(e)):(r.hide(),e.__.value=void 0),e.operator&&(e.$el.find(t.selectors.rule_operator).val(e.operator.type),e.__.value=this.getRuleInputValue(e)),this.trigger("afterUpdateRuleOperator",e,n),this.trigger("rulesChanged")},t.prototype.updateRuleValue=function(e,t){e._updating_value||this.setRuleInputValue(e,e.value),this.trigger("afterUpdateRuleValue",e,t),this.trigger("rulesChanged")},t.prototype.applyRuleFlags=function(e){var n=e.flags,r=t.selectors;e.$el.find(r.rule_filter).prop("disabled",n.filter_readonly),e.$el.find(r.rule_operator).prop("disabled",n.operator_readonly),e.$el.find(r.rule_value).prop("disabled",n.value_readonly),n.no_delete&&e.$el.find(r.delete_rule).remove(),this.trigger("afterApplyRuleFlags",e)},t.prototype.applyGroupFlags=function(e){var n=e.flags,r=t.selectors;e.$el.find(">"+r.group_condition).prop("disabled",n.condition_readonly).parent().toggleClass("readonly",n.condition_readonly),n.no_add_rule&&e.$el.find(r.add_rule).remove(),n.no_add_group&&e.$el.find(r.add_group).remove(),n.no_delete&&e.$el.find(r.delete_group).remove(),this.trigger("afterApplyGroupFlags",e)},t.prototype.clearErrors=function(e){(e=e||this.model.root)&&(e.error=null,e instanceof o&&e.each(function(e){e.error=null},function(e){this.clearErrors(e)},this))},t.prototype.updateError=function(e){if(this.settings.display_errors)if(null===e.error)e.$el.removeClass("has-error");else{var r=this.translate("errors",e.error[0]);r=n.fmt(r,e.error.slice(1)),r=this.change("displayError",r,e.error,e),e.$el.addClass("has-error").find(t.selectors.error_container).eq(0).attr("title",r)}},t.prototype.triggerValidationError=function(t,n,r){e.isArray(n)||(n=[n]),this.trigger("validationError",t,n,r).isDefaultPrevented()||(t.error=n)},t.prototype.destroy=function(){this.trigger("beforeDestroy"),this.status.generated_id&&this.$el.removeAttr("id"),this.clear(),this.model=null,this.$el.off(".queryBuilder").removeClass("query-builder").removeData("queryBuilder"),delete this.$el[0].queryBuilder},t.prototype.reset=function(){this.trigger("beforeReset").isDefaultPrevented()||(this.status.group_id=1,this.status.rule_id=0,this.model.root.empty(),this.model.root.data=void 0,this.model.root.flags=e.extend({},this.settings.default_group_flags),this.model.root.condition=this.settings.default_condition,this.addRule(this.model.root),this.trigger("afterReset"),this.trigger("rulesChanged"))},t.prototype.clear=function(){this.trigger("beforeClear").isDefaultPrevented()||(this.status.group_id=0,this.status.rule_id=0,this.model.root&&(this.model.root.drop(),this.model.root=null),this.trigger("afterClear"),this.trigger("rulesChanged"))},t.prototype.setOptions=function(n){e.each(n,function(e,n){-1!==t.modifiable_options.indexOf(e)&&(this.settings[e]=n)}.bind(this))},t.prototype.getModel=function(t){return t?t instanceof i?t:e(t).data("queryBuilderModel"):this.model.root},t.prototype.validate=function(t){t=e.extend({skip_empty:!1},t),this.clearErrors();var n=this,r=function e(r){var i=0,o=0;return r.each(function(e){if(e.filter||!t.skip_empty){if(!e.filter)return n.triggerValidationError(e,"no_filter",null),void o++;if(!e.operator)return n.triggerValidationError(e,"no_operator",null),void o++;if(0!==e.operator.nb_inputs){var r=n.validateValue(e,e.value);if(!0!==r)return n.triggerValidationError(e,r,e.value),void o++}i++}},function(t){var n=e(t);!0===n?i++:!1===n&&o++}),!(o>0)&&(0===i&&!r.isRoot()&&t.skip_empty?null:!!(0!==i||n.settings.allow_empty&&r.isRoot())||(n.triggerValidationError(r,"empty_group",null),!1))}(this.model.root);return this.change("validate",r)},t.prototype.getRules=function(t){t=e.extend({get_flags:!1,allow_invalid:!1,skip_empty:!1},t);var n=this.validate(t);if(!n&&!t.allow_invalid)return null;var r=this,i=function n(i){var o={condition:i.condition,rules:[]};if(i.data&&(o.data=e.extendext(!0,"replace",{},i.data)),t.get_flags){var a=r.getGroupFlags(i.flags,"all"===t.get_flags);e.isEmptyObject(a)||(o.flags=a)}return i.each(function(n){if(n.filter||!t.skip_empty){var i=null;n.operator&&0===n.operator.nb_inputs||(i=n.value);var a={id:n.filter?n.filter.id:null,field:n.filter?n.filter.field:null,type:n.filter?n.filter.type:null,input:n.filter?n.filter.input:null,operator:n.operator?n.operator.type:null,value:i};if((n.filter&&n.filter.data||n.data)&&(a.data=e.extendext(!0,"replace",{},n.filter?n.filter.data:{},n.data)),t.get_flags){var s=r.getRuleFlags(n.flags,"all"===t.get_flags);e.isEmptyObject(s)||(a.flags=s)}o.rules.push(r.change("ruleToJson",a,n))}},function(e){var r=n(e);0===r.rules.length&&t.skip_empty||o.rules.push(r)},this),r.change("groupToJson",o,i)}(this.model.root);return i.valid=n,this.change("getRules",i)},t.prototype.setRules=function(t,r){r=e.extend({allow_invalid:!1},r),e.isArray(t)&&(t={condition:this.settings.default_condition,rules:t}),t&&t.rules&&(0!==t.rules.length||this.settings.allow_empty)||n.error("RulesParse","Incorrect data object passed"),this.clear(),this.setRoot(!1,t.data,this.parseGroupFlags(t)),t=this.change("setRules",t,r);var i=this;!function e(t,o){null!==o&&(void 0===t.condition?t.condition=i.settings.default_condition:-1==i.settings.conditions.indexOf(t.condition)&&(n.error(!r.allow_invalid,"UndefinedCondition",'Invalid condition "{0}"',t.condition),t.condition=i.settings.default_condition),o.condition=t.condition,t.rules.forEach(function(t){var a;if(void 0!==t.rules)if(-1!==i.settings.allow_groups&&i.settings.allow_groups<o.level)n.error(!r.allow_invalid,"RulesParse","No more than {0} groups are allowed",i.settings.allow_groups),i.reset();else{if(null===(a=i.addGroup(o,!1,t.data,i.parseGroupFlags(t))))return;e(t,a)}else{if(t.empty||(void 0===t.id&&(n.error(!r.allow_invalid,"RulesParse","Missing rule field id"),t.empty=!0),void 0===t.operator&&(t.operator="equal")),null===(a=i.addRule(o,t.data,i.parseRuleFlags(t))))return;t.empty||(a.filter=i.getFilterById(t.id,!r.allow_invalid)),a.filter&&(a.operator=i.getOperatorByType(t.operator,!r.allow_invalid),a.operator||(a.operator=i.getOperators(a.filter)[0])),a.operator&&0!==a.operator.nb_inputs&&(void 0!==t.value?a.value=t.value:void 0!==a.filter.default_value&&(a.value=a.filter.default_value)),i.change("jsonToRule",a,t)!=a&&n.error("RulesParse","Plugin tried to change rule reference")}}),i.change("jsonToGroup",o,t)!=o&&n.error("RulesParse","Plugin tried to change group reference"))}(t,this.model.root),this.trigger("afterSetRules")},t.prototype.validateValue=function(e,t){var n,r=e.filter.validation||{};return n=r.callback?r.callback.call(this,t,e):this._validateValue(e,t),this.change("validateValue",n,t,e)},t.prototype._validateValue=function(r,i){var o,a,s=r.filter,l=r.operator,u=s.validation||{},c=!0;1===r.operator.nb_inputs&&(i=[i]);for(var d=0;d<l.nb_inputs;d++){if(!l.multiple&&e.isArray(i[d])&&i[d].length>1){c=["operator_not_multiple",l.type,this.translate("operators",l.type)];break}switch(s.input){case"radio":if(void 0===i[d]||0===i[d].length){u.allow_empty_value||(c=["radio_empty"]);break}break;case"checkbox":if(void 0===i[d]||0===i[d].length){u.allow_empty_value||(c=["checkbox_empty"]);break}break;case"select":if(void 0===i[d]||0===i[d].length||s.placeholder&&i[d]==s.placeholder_value){u.allow_empty_value||(c=["select_empty"]);break}break;default:a=e.isArray(i[d])?i[d]:[i[d]];for(var f=0;f<a.length;f++){switch(t.types[s.type]){case"string":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["string_empty"]);break}if(void 0!==u.min&&a[f].length<parseInt(u.min)){c=[this.getValidationMessage(u,"min","string_exceed_min_length"),u.min];break}if(void 0!==u.max&&a[f].length>parseInt(u.max)){c=[this.getValidationMessage(u,"max","string_exceed_max_length"),u.max];break}if(u.format&&("string"==typeof u.format&&(u.format=new RegExp(u.format)),!u.format.test(a[f]))){c=[this.getValidationMessage(u,"format","string_invalid_format"),u.format];break}break;case"number":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["number_nan"]);break}if(isNaN(a[f])){c=["number_nan"];break}if("integer"==s.type){if(parseInt(a[f])!=a[f]){c=["number_not_integer"];break}}else if(parseFloat(a[f])!=a[f]){c=["number_not_double"];break}if(void 0!==u.min&&a[f]<parseFloat(u.min)){c=[this.getValidationMessage(u,"min","number_exceed_min"),u.min];break}if(void 0!==u.max&&a[f]>parseFloat(u.max)){c=[this.getValidationMessage(u,"max","number_exceed_max"),u.max];break}if(void 0!==u.step&&"any"!==u.step){var p=(a[f]/u.step).toPrecision(14);if(parseInt(p)!=p){c=[this.getValidationMessage(u,"step","number_wrong_step"),u.step];break}}break;case"datetime":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["datetime_empty"]);break}if(u.format){"moment"in window||n.error("MissingLibrary","MomentJS is required for Date/Time validation. Get it here http://momentjs.com");var h=moment(a[f],u.format);if(!h.isValid()){c=[this.getValidationMessage(u,"format","datetime_invalid"),u.format];break}if(u.min&&h<moment(u.min,u.format)){c=[this.getValidationMessage(u,"min","datetime_exceed_min"),u.min];break}if(u.max&&h>moment(u.max,u.format)){c=[this.getValidationMessage(u,"max","datetime_exceed_max"),u.max];break}}break;case"boolean":if(void 0===a[f]||0===a[f].length){u.allow_empty_value||(c=["boolean_not_valid"]);break}if("true"!==(o=(""+a[f]).trim().toLowerCase())&&"false"!==o&&"1"!==o&&"0"!==o&&1!==a[f]&&0!==a[f]){c=["boolean_not_valid"];break}}if(!0!==c)break}}if(!0!==c)break}if(("between"===r.operator.type||"not_between"===r.operator.type)&&2===i.length)switch(t.types[s.type]){case"number":i[0]>i[1]&&(c=["number_between_invalid",i[0],i[1]]);break;case"datetime":u.format&&("moment"in window||n.error("MissingLibrary","MomentJS is required for Date/Time validation. Get it here http://momentjs.com"),moment(i[0],u.format).isAfter(moment(i[1],u.format))&&(c=["datetime_between_invalid",i[0],i[1]]))}return c},t.prototype.nextGroupId=function(){return this.status.id+"_group_"+this.status.group_id++},t.prototype.nextRuleId=function(){return this.status.id+"_rule_"+this.status.rule_id++},t.prototype.getOperators=function(e){"string"==typeof e&&(e=this.getFilterById(e));for(var n=[],r=0,i=this.operators.length;r<i;r++){if(e.operators){if(-1==e.operators.indexOf(this.operators[r].type))continue}else if(-1==this.operators[r].apply_to.indexOf(t.types[e.type]))continue;n.push(this.operators[r])}return e.operators&&n.sort(function(t,n){return e.operators.indexOf(t.type)-e.operators.indexOf(n.type)}),this.change("getOperators",n,e)},t.prototype.getFilterById=function(e,t){if("-1"==e)return null;for(var r=0,i=this.filters.length;r<i;r++)if(this.filters[r].id==e)return this.filters[r];return n.error(!1!==t,"UndefinedFilter",'Undefined filter "{0}"',e),null},t.prototype.getOperatorByType=function(e,t){if("-1"==e)return null;for(var r=0,i=this.operators.length;r<i;r++)if(this.operators[r].type==e)return this.operators[r];return n.error(!1!==t,"UndefinedOperator",'Undefined operator "{0}"',e),null},t.prototype.getRuleInputValue=function(r){var i=r.filter,o=r.operator,a=[];if(i.valueGetter)a=i.valueGetter.call(this,r);else{for(var s=r.$el.find(t.selectors.value_container),l=0;l<o.nb_inputs;l++){var u,c=n.escapeElementId(r.id+"_value_"+l);switch(i.input){case"radio":a.push(s.find("[name="+c+"]:checked").val());break;case"checkbox":u=[],s.find("[name="+c+"]:checked").each(function(){u.push(e(this).val())}),a.push(u);break;case"select":i.multiple?(u=[],s.find("[name="+c+"] option:selected").each(function(){u.push(e(this).val())}),a.push(u)):a.push(s.find("[name="+c+"] option:selected").val());break;default:a.push(s.find("[name="+c+"]").val())}}a=a.map(function(t){return o.multiple&&i.value_separator&&"string"==typeof t&&(t=t.split(i.value_separator)),e.isArray(t)?t.map(function(e){return n.changeType(e,i.type)}):n.changeType(t,i.type)}),1===o.nb_inputs&&(a=a[0]),i.valueParser&&(a=i.valueParser.call(this,r,a))}return this.change("getRuleValue",a,r)},t.prototype.setRuleInputValue=function(r,i){var o=r.filter,a=r.operator;if(o&&a){if(r._updating_input=!0,o.valueSetter)o.valueSetter.call(this,r,i);else{var s=r.$el.find(t.selectors.value_container);1==a.nb_inputs&&(i=[i]);for(var l=0;l<a.nb_inputs;l++){var u=n.escapeElementId(r.id+"_value_"+l);switch(o.input){case"radio":s.find("[name="+u+'][value="'+i[l]+'"]').prop("checked",!0).trigger("change");break;case"checkbox":e.isArray(i[l])||(i[l]=[i[l]]),i[l].forEach(function(e){s.find("[name="+u+'][value="'+e+'"]').prop("checked",!0).trigger("change")});break;default:a.multiple&&o.value_separator&&e.isArray(i[l])&&(i[l]=i[l].join(o.value_separator)),s.find("[name="+u+"]").val(i[l]).trigger("change")}}}r._updating_input=!1}},t.prototype.parseRuleFlags=function(t){var n=e.extend({},this.settings.default_rule_flags);return t.readonly&&e.extend(n,{filter_readonly:!0,operator_readonly:!0,value_readonly:!0,no_delete:!0}),t.flags&&e.extend(n,t.flags),this.change("parseRuleFlags",n,t)},t.prototype.getRuleFlags=function(t,n){if(n)return e.extend({},t);var r={};return e.each(this.settings.default_rule_flags,function(e,n){t[e]!==n&&(r[e]=t[e])}),r},t.prototype.parseGroupFlags=function(t){var n=e.extend({},this.settings.default_group_flags);return t.readonly&&e.extend(n,{condition_readonly:!0,no_add_rule:!0,no_add_group:!0,no_delete:!0}),t.flags&&e.extend(n,t.flags),this.change("parseGroupFlags",n,t)},t.prototype.getGroupFlags=function(t,n){if(n)return e.extend({},t);var r={};return e.each(this.settings.default_group_flags,function(e,n){t[e]!==n&&(r[e]=t[e])}),r},t.prototype.translate=function(e,t){var n;return t||(t=e,e=void 0),n="object"==typeof t?t[this.settings.lang_code]||t.en:(e?this.lang[e]:this.lang)[t]||t,this.change("translate",n,t,e)},t.prototype.getValidationMessage=function(e,t,n){return e.messages&&e.messages[t]||n},t.templates.group=({group_id:e,level:t,conditions:n,icons:r,settings:i,translate:o,builder:a})=>`\n<div id="${e}" class="rules-group-container">\n <div class="rules-group-header">\n <div class="btn-group pull-right group-actions">\n <button type="button" class="btn btn-xs btn-success" data-add="rule">\n <i class="${r}"></i> ${o("add_rule")}\n </button>\n ${-1===i.allow_groups||i.allow_groups>=t?`\n <button type="button" class="btn btn-xs btn-success" data-add="group">\n <i class="${r.add_group}"></i> ${o("add_group")}\n </button>\n `:""}\n ${t>1?`\n <button type="button" class="btn btn-xs btn-danger" data-delete="group">\n <i class="${r.remove_group}"></i> ${o("delete_group")}\n </button>\n `:""}\n </div>\n <div class="btn-group group-conditions">\n ${n.map(t=>`\n <label class="btn btn-xs btn-primary">\n <input type="radio" name="${e}_cond" value="${t}"> ${o("conditions",t)}\n </label>\n `).join("\n")}\n </div>\n ${i.display_errors?`\n <div class="error-container"><i class="${r.error}"></i></div>\n `:""}\n </div>\n <div class=rules-group-body>\n <div class=rules-list></div>\n </div>\n</div>`,t.templates.rule=({rule_id:e,icons:t,settings:n,translate:r,builder:i})=>`\n<div id="${e}" class="rule-container">\n <div class="rule-header">\n <div class="btn-group pull-right rule-actions">\n <button type="button" class="btn btn-xs btn-danger" data-delete="rule">\n <i class="${t.remove_rule}"></i> ${r("delete_rule")}\n </button>\n </div>\n </div>\n ${n.display_errors?`\n <div class="error-container"><i class="${t.error}"></i></div>\n `:""}\n <div class="rule-filter-container"></div>\n <div class="rule-operator-container"></div>\n <div class="rule-value-container"></div>\n</div>`,t.templates.filterSelect=({rule:e,filters:t,icons:n,settings:r,translate:i,builder:o})=>{let a=null;return`\n<select class="form-control" name="${e.id}_filter">\n ${r.display_empty_filter?`\n <option value="-1">${r.select_placeholder}</option>\n `:""}\n ${t.map(e=>`\n ${a!==e.optgroup?`\n ${null!==a?"</optgroup>":""}\n ${null!==(a=e.optgroup)?`\n <optgroup label="${i(r.optgroups[a])}">\n `:""}\n `:""}\n <option value="${e.id}" ${e.icon?`data-icon="${e.icon}"`:""}>${i(e.label)}</option>\n `).join("")}\n ${null!==a?"</optgroup>":""}\n</select>`},t.templates.operatorSelect=({rule:e,operators:t,icons:n,settings:r,translate:i,builder:o})=>{let a=null;return`\n${1===t.length?`\n<span>\n${i("operators",t[0].type)}\n</span>\n`:""}\n<select class="form-control ${1===t.length?"hide":""}" name="${e.id}_operator">\n ${t.map(e=>`\n ${a!==e.optgroup?`\n ${null!==a?"</optgroup>":""}\n ${null!==(a=e.optgroup)?`\n <optgroup label="${i(r.optgroups[a])}">\n `:""}\n `:""}\n <option value="${e.type}" ${e.icon?`data-icon="${e.icon}"`:""}>${i("operators",e.type)}</option>\n `).join("")}\n ${null!==a?"</optgroup>":""}\n</select>`},t.templates.ruleValueSelect=({name:e,rule:t,icons:n,settings:r,translate:i,builder:o})=>{let a=null;return`\n<select class="form-control" name="${e}" ${t.filter.multiple?"multiple":""}>\n ${t.filter.placeholder?`\n <option value="${t.filter.placeholder_value}" disabled selected>${t.filter.placeholder}</option>\n `:""}\n ${t.filter.values.map(e=>`\n ${a!==e.optgroup?`\n ${null!==a?"</optgroup>":""}\n ${null!==(a=e.optgroup)?`\n <optgroup label="${i(r.optgroups[a])}">\n `:""}\n `:""}\n <option value="${e.value}">${e.label}</option>\n `).join("")}\n ${null!==a?"</optgroup>":""}\n</select>`},t.prototype.getGroupTemplate=function(e,t){var n=this.templates.group({builder:this,group_id:e,level:t,conditions:this.settings.conditions,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getGroupTemplate",n,t)},t.prototype.getRuleTemplate=function(e){var t=this.templates.rule({builder:this,rule_id:e,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleTemplate",t)},t.prototype.getRuleFilterSelect=function(e,t){var n=this.templates.filterSelect({builder:this,rule:e,filters:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleFilterSelect",n,e,t)},t.prototype.getRuleOperatorSelect=function(e,t){var n=this.templates.operatorSelect({builder:this,rule:e,operators:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleOperatorSelect",n,e,t)},t.prototype.getRuleValueSelect=function(e,t){var n=this.templates.ruleValueSelect({builder:this,name:e,rule:t,icons:this.icons,settings:this.settings,translate:this.translate.bind(this)}).trim();return this.change("getRuleValueSelect",n,e,t)},t.prototype.getRuleInput=function(e,t){var r=e.filter,i=e.filter.validation||{},o=e.id+"_value_"+t,a=r.vertical?" class=block":"",s="",l=Array.isArray(r.placeholder)?r.placeholder[t]:r.placeholder;if("function"==typeof r.input)s=r.input.call(this,e,o);else switch(r.input){case"radio":case"checkbox":n.iterateOptions(r.values,function(e,t){s+="<label"+a+'><input type="'+r.input+'" name="'+o+'" value="'+e+'"> '+t+"</label> "});break;case"select":s=this.getRuleValueSelect(o,e);break;case"textarea":s+='<textarea class="form-control" name="'+o+'"',r.size&&(s+=' cols="'+r.size+'"'),r.rows&&(s+=' rows="'+r.rows+'"'),void 0!==i.min&&(s+=' minlength="'+i.min+'"'),void 0!==i.max&&(s+=' maxlength="'+i.max+'"'),l&&(s+=' placeholder="'+l+'"'),s+="></textarea>";break;case"number":s+='<input class="form-control" type="number" name="'+o+'"',void 0!==i.step&&(s+=' step="'+i.step+'"'),void 0!==i.min&&(s+=' min="'+i.min+'"'),void 0!==i.max&&(s+=' max="'+i.max+'"'),l&&(s+=' placeholder="'+l+'"'),r.size&&(s+=' size="'+r.size+'"'),s+=">";break;default:s+='<input class="form-control" type="text" name="'+o+'"',l&&(s+=' placeholder="'+l+'"'),"string"===r.type&&void 0!==i.min&&(s+=' minlength="'+i.min+'"'),"string"===r.type&&void 0!==i.max&&(s+=' maxlength="'+i.max+'"'),r.size&&(s+=' size="'+r.size+'"'),s+=">"}return this.change("getRuleInput",s,e,o)};var n={};function r(){this.root=null,this.$=e(this)}t.utils=n,n.iterateOptions=function(t,n){t&&(e.isArray(t)?t.forEach(function(t){e.isPlainObject(t)?"value"in t?n(t.value,t.label||t.value,t.optgroup):e.each(t,function(e,t){return n(e,t),!1}):n(t,t)}):e.each(t,function(e,t){n(e,t)}))},n.fmt=function(e,t){return Array.isArray(t)||(t=Array.prototype.slice.call(arguments,1)),e.replace(/{([0-9]+)}/g,function(e,n){return t[parseInt(n)]})},n.error=function(){var e=0,t="boolean"!=typeof arguments[e]||arguments[e++],r=arguments[e++],i=arguments[e++],o=Array.isArray(arguments[e])?arguments[e]:Array.prototype.slice.call(arguments,e);if(t){var a=new Error(n.fmt(i,o));throw a.name=r+"Error",a.args=o,a}console.error(r+"Error: "+n.fmt(i,o))},n.changeType=function(e,t){if(""!==e&&void 0!==e)switch(t){case"integer":return"string"!=typeof e||/^-?\d+$/.test(e)?parseInt(e):e;case"double":return"string"!=typeof e||/^-?\d+\.?\d*$/.test(e)?parseFloat(e):e;case"boolean":return"string"!=typeof e||/^(0|1|true|false){1}$/i.test(e)?!0===e||1===e||"true"===e.toLowerCase()||"1"===e:e;default:return e}},n.escapeString=function(e,t){if("string"!=typeof e)return e;var n=e.replace(/[\0\n\r\b\\\'\"]/g,function(e){switch(e){case"\0":return"\\0";case"\n":return"\\n";case"\r":return"\\r";case"\b":return"\\b";case"'":return"''";default:return"\\"+e}}).replace(/\t/g,"\\t").replace(/\x1a/g,"\\Z");return t&&(n=n.replace(new RegExp("["+t+"]","g"),function(e){return"\\"+e})),n},n.escapeRegExp=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},n.escapeElementId=function(e){return e?e.replace(/(\\)?([:.\[\],])/g,function(e,t,n){return t?e:"\\"+n}):e},n.groupSort=function(e,t){var n=[],r=[];return e.forEach(function(e){var i;e[t]?-1==(i=n.lastIndexOf(e[t]))?i=n.length:i++:i=n.length,n.splice(i,0,e[t]),r.splice(i,0,e)}),r},n.defineModelProperties=function(t,n){n.forEach(function(n){Object.defineProperty(t.prototype,n,{enumerable:!0,get:function(){return this.__[n]},set:function(t){var r=null!==this.__[n]&&"object"==typeof this.__[n]?e.extend({},this.__[n]):this.__[n];this.__[n]=t,null!==this.model&&this.model.trigger("update",this,n,t,r)}})})},e.extend(r.prototype,{trigger:function(t){var n=new e.Event(t);return this.$.triggerHandler(n,Array.prototype.slice.call(arguments,1)),n},on:function(){return this.$.on.apply(this.$,Array.prototype.slice.call(arguments)),this},off:function(){return this.$.off.apply(this.$,Array.prototype.slice.call(arguments)),this},once:function(){return this.$.one.apply(this.$,Array.prototype.slice.call(arguments)),this}});var i=function(e,t){if(!(this instanceof i))return new i(e,t);Object.defineProperty(this,"__",{value:{}}),t.data("queryBuilderModel",this),this.__.level=1,this.__.error=null,this.__.flags={},this.__.data=void 0,this.$el=t,this.id=t[0].id,this.model=null,this.parent=e};n.defineModelProperties(i,["level","error","data","flags"]),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){return this.__.parent},set:function(e){this.__.parent=e,this.level=null===e?1:e.level+1,this.model=null===e?null:e.model}}),i.prototype.isRoot=function(){return 1===this.level},i.prototype.getPos=function(){return this.isRoot()?-1:this.parent.getNodePos(this)},i.prototype.drop=function(){var e=this.model;this.parent&&this.parent.removeNode(this),this.$el.removeData("queryBuilderModel"),null!==e&&e.trigger("drop",this)},i.prototype.moveAfter=function(e){this.isRoot()||this.move(e.parent,e.getPos()+1)},i.prototype.moveAtBegin=function(e){this.isRoot()||(void 0===e&&(e=this.parent),this.move(e,0))},i.prototype.moveAtEnd=function(e){this.isRoot()||(void 0===e&&(e=this.parent),this.move(e,0===e.length()?0:e.length()-1))},i.prototype.move=function(e,t){this.isRoot()||("number"==typeof e&&(t=e,e=this.parent),this.parent.removeNode(this),e.insertNode(this,t,!1),null!==this.model&&this.model.trigger("move",this,e,t))};var o=function(e,t){if(!(this instanceof o))return new o(e,t);i.call(this,e,t),this.rules=[],this.__.condition=null};o.prototype=Object.create(i.prototype),o.prototype.constructor=o,n.defineModelProperties(o,["condition"]),o.prototype.empty=function(){this.each("reverse",function(e){e.drop()},function(e){e.drop()})},o.prototype.drop=function(){this.empty(),i.prototype.drop.call(this)},o.prototype.length=function(){return this.rules.length},o.prototype.insertNode=function(e,t,n){return void 0===t&&(t=this.length()),this.rules.splice(t,0,e),e.parent=this,n&&null!==this.model&&this.model.trigger("add",this,e,t),e},o.prototype.addGroup=function(e,t){return this.insertNode(new o(this,e),t,!0)},o.prototype.addRule=function(e,t){return this.insertNode(new a(this,e),t,!0)},o.prototype.removeNode=function(e){var t=this.getNodePos(e);-1!==t&&(e.parent=null,this.rules.splice(t,1))},o.prototype.getNodePos=function(e){return this.rules.indexOf(e)},o.prototype.each=function(e,t,n,r){"boolean"!=typeof e&&"string"!=typeof e&&(r=n,n=t,t=e,e=!1),r=void 0===r?null:r;for(var i=e?this.rules.length-1:0,a=e?0:this.rules.length-1,s=e?-1:1,l=function(){return e?i>=a:i<=a},u=!1;l()&&(this.rules[i]instanceof o?n&&(u=!1===n.call(r,this.rules[i])):t&&(u=!1===t.call(r,this.rules[i])),!u);i+=s);return!u},o.prototype.contains=function(e,t){return-1!==this.getNodePos(e)||!!t&&!this.each(function(){return!0},function(t){return!t.contains(e,!0)})};var a=function(e,t){if(!(this instanceof a))return new a(e,t);i.call(this,e,t),this._updating_value=!1,this._updating_input=!1,this.__.filter=null,this.__.operator=null,this.__.value=void 0};function s(e,n,r){var i,o,s=t.selectors;(i=n.closest(s.rule_container)).length&&(o="moveAfter"),o||(i=n.closest(s.group_header)).length&&(i=n.closest(s.group_container),o="moveAtBegin"),o||(i=n.closest(s.group_container)).length&&(o="moveAtEnd"),o&&(e[o](r.getModel(i)),r&&e instanceof a&&r.setRuleInputValue(e,e.value))}function l(e){var t=e.match(/(question_mark|numbered|named)(?:\((.)\))?/);return t||(t=[null,"question_mark",void 0]),t}return a.prototype=Object.create(i.prototype),a.prototype.constructor=a,n.defineModelProperties(a,["filter","operator","value"]),a.prototype.isRoot=function(){return!1},t.Group=o,t.Rule=a,e.fn.queryBuilder=function(e){0===this.length&&n.error("Config","No target defined"),this.length>1&&n.error("Config","Unable to initialize on multiple target");var r=this.data("queryBuilder"),i="object"==typeof e&&e||{};if(!r&&"destroy"==e)return this;if(!r){var o=new t(this,i);this.data("queryBuilder",o),o.init(i.rules)}return"string"==typeof e?r[e].apply(r,Array.prototype.slice.call(arguments,1)):this},e.fn.queryBuilder.constructor=t,e.fn.queryBuilder.defaults=t.defaults,e.fn.queryBuilder.extend=t.extend,e.fn.queryBuilder.define=t.define,e.fn.queryBuilder.regional=t.regional,t.define("bt-checkbox",function(e){"glyphicons"==e.font&&this.$el.addClass("bt-checkbox-glyphicons"),this.on("getRuleInput.filter",function(t,r,i){var o=r.filter;if(("radio"===o.input||"checkbox"===o.input)&&!o.plugin){t.value="",o.colors||(o.colors={}),o.color&&(o.colors._def_=o.color);var a=o.vertical?' style="display:block"':"",s=0;n.iterateOptions(o.values,function(n,r){var l=o.colors[n]||o.colors._def_||e.color,u=i+"_"+s++;t.value+="<div"+a+' class="'+o.input+" "+o.input+"-"+l+'"> <input type="'+o.input+'" name="'+i+'" id="'+u+'" value="'+n+'"> <label for="'+u+'">'+r+"</label> </div>"})}})},{font:"glyphicons",color:"default"}),t.define("bt-selectpicker",function(r){e.fn.selectpicker&&e.fn.selectpicker.Constructor||n.error("MissingLibrary",'Bootstrap Select is required to use "bt-selectpicker" plugin. Get it here: http://silviomoreto.github.io/bootstrap-select');var i=t.selectors;this.on("afterCreateRuleFilters",function(e,t){t.$el.find(i.rule_filter).removeClass("form-control").selectpicker(r)}),this.on("afterCreateRuleOperators",function(e,t){t.$el.find(i.rule_operator).removeClass("form-control").selectpicker(r)}),this.on("afterUpdateRuleFilter",function(e,t){t.$el.find(i.rule_filter).selectpicker("render")}),this.on("afterUpdateRuleOperator",function(e,t){t.$el.find(i.rule_operator).selectpicker("render")}),this.on("beforeDeleteRule",function(e,t){t.$el.find(i.rule_filter).selectpicker("destroy"),t.$el.find(i.rule_operator).selectpicker("destroy")})},{container:"body",style:"btn-inverse btn-xs",width:"auto",showIcon:!1}),t.define("bt-tooltip-errors",function(r){e.fn.tooltip&&e.fn.tooltip.Constructor&&e.fn.tooltip.Constructor.prototype.fixTitle||n.error("MissingLibrary",'Bootstrap Tooltip is required to use "bt-tooltip-errors" plugin. Get it here: http://getbootstrap.com');var i=this;this.on("getRuleTemplate.filter getGroupTemplate.filter",function(n){var r=e(e.parseHTML(n.value));r.find(t.selectors.error_container).attr("data-toggle","tooltip"),n.value=r.prop("outerHTML")}),this.model.on("update",function(e,n,o){"error"==o&&i.settings.display_errors&&n.$el.find(t.selectors.error_container).eq(0).tooltip(r).tooltip("hide").tooltip("fixTitle")})},{placement:"right"}),t.extend({setFilters:function(e,r){var i=this;void 0===r&&(r=e,e=!1),r=this.checkFilters(r);var o=(r=this.change("setFilters",r)).map(function(e){return e.id});if(e||function e(t){t.each(function(e){e.filter&&-1===o.indexOf(e.filter.id)&&n.error("ChangeFilter",'A rule is using filter "{0}"',e.filter.id)},e)}(this.model.root),this.filters=r,function e(n){n.each(!0,function(e){e.filter&&-1===o.indexOf(e.filter.id)?(e.drop(),i.trigger("rulesChanged")):(i.createRuleFilters(e),e.$el.find(t.selectors.rule_filter).val(e.filter?e.filter.id:"-1"),i.trigger("afterUpdateRuleFilter",e))},e)}(this.model.root),this.settings.plugins&&(this.settings.plugins["unique-filter"]&&this.updateDisabledFilters(),this.settings.plugins["bt-selectpicker"]&&this.$el.find(t.selectors.rule_filter).selectpicker("render")),this.settings.default_filter)try{this.getFilterById(this.settings.default_filter)}catch(e){this.settings.default_filter=null}this.trigger("afterSetFilters",r)},addFilter:function(t,n){void 0===n||"#end"==n?n=this.filters.length:"#start"==n&&(n=0),e.isArray(t)||(t=[t]);var r=e.extend(!0,[],this.filters);parseInt(n)==n||this.filters.some(function(e,t){if(e.id==n)return n=t+1,!0})?Array.prototype.splice.apply(r,[n,0].concat(t)):Array.prototype.push.apply(r,t),this.setFilters(r)},removeFilter:function(t,n){var r=e.extend(!0,[],this.filters);"string"==typeof t&&(t=[t]),r=r.filter(function(e){return-1===t.indexOf(e.id)}),this.setFilters(n,r)}}),t.define("chosen-selectpicker",function(r){e.fn.chosen||n.error("MissingLibrary",'chosen is required to use "chosen-selectpicker" plugin. Get it here: https://github.com/harvesthq/chosen'),this.settings.plugins["bt-selectpicker"]&&n.error("Conflict","bt-selectpicker is already selected as the dropdown plugin. Please remove chosen-selectpicker from the plugin list");var i=t.selectors;this.on("afterCreateRuleFilters",function(e,t){t.$el.find(i.rule_filter).removeClass("form-control").chosen(r)}),this.on("afterCreateRuleOperators",function(e,t){e.builder.getOperators(t.filter).length>1&&t.$el.find(i.rule_operator).removeClass("form-control").chosen(r)}),this.on("afterUpdateRuleFilter",function(e,t){t.$el.find(i.rule_filter).trigger("chosen:updated")}),this.on("afterUpdateRuleOperator",function(e,t){t.$el.find(i.rule_operator).trigger("chosen:updated")}),this.on("beforeDeleteRule",function(e,t){t.$el.find(i.rule_filter).chosen("destroy"),t.$el.find(i.rule_operator).chosen("destroy")})}),t.define("filter-description",function(r){"inline"===r.mode?this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(t,n){var i=n.$el.find("p.filter-description"),o=t.builder.getFilterDescription(n.filter,n);o?(0===i.length?(i=e(e.parseHTML('<p class="filter-description"></p>'))).appendTo(n.$el):i.css("display",""),i.html('<i class="'+r.icon+'"></i> '+o)):i.hide()}):"popover"===r.mode?(e.fn.popover&&e.fn.popover.Constructor&&e.fn.popover.Constructor.prototype.fixTitle||n.error("MissingLibrary",'Bootstrap Popover is required to use "filter-description" plugin. Get it here: http://getbootstrap.com'),this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(n,i){var o=i.$el.find("button.filter-description"),a=n.builder.getFilterDescription(i.filter,i);a?(0===o.length?((o=e(e.parseHTML('<button type="button" class="btn btn-xs btn-info filter-description" data-toggle="popover"><i class="'+r.icon+'"></i></button>'))).prependTo(i.$el.find(t.selectors.rule_actions)),o.popover({placement:"left",container:"body",html:!0}),o.on("mouseout",function(){o.popover("hide")})):o.css("display",""),o.data("bs.popover").options.content=a,o.attr("aria-describedby")&&o.popover("show")):(o.hide(),o.data("bs.popover")&&o.popover("hide"))})):"bootbox"===r.mode&&("bootbox"in window||n.error("MissingLibrary",'Bootbox is required to use "filter-description" plugin. Get it here: http://bootboxjs.com'),this.on("afterUpdateRuleFilter afterUpdateRuleOperator",function(n,i){var o=i.$el.find("button.filter-description"),a=n.builder.getFilterDescription(i.filter,i);a?(0===o.length?((o=e(e.parseHTML('<button type="button" class="btn btn-xs btn-info filter-description" data-toggle="bootbox"><i class="'+r.icon+'"></i></button>'))).prependTo(i.$el.find(t.selectors.rule_actions)),o.on("click",function(){bootbox.alert(o.data("description"))})):o.css("display",""),o.data("description",a)):o.hide()}))},{icon:"glyphicon glyphicon-info-sign",mode:"popover"}),t.extend({getFilterDescription:function(e,t){return e?"function"==typeof e.description?e.description.call(this,t):e.description:void 0}}),t.define("invert",function(n){var r=this,i=t.selectors;this.on("afterInit",function(){r.$el.on("click.queryBuilder","[data-invert=group]",function(){var t=e(this).closest(i.group_container);r.invert(r.getModel(t),n)}),n.display_rules_button&&n.invert_rules&&r.$el.on("click.queryBuilder","[data-invert=rule]",function(){var t=e(this).closest(i.rule_container);r.invert(r.getModel(t),n)})}),n.disable_template||(this.on("getGroupTemplate.filter",function(t){var o=e(e.parseHTML(t.value));o.find(i.condition_container).after('<button type="button" class="btn btn-xs btn-default" data-invert="group"><i class="'+n.icon+'"></i> '+r.translate("invert")+"</button>"),t.value=o.prop("outerHTML")}),n.display_rules_button&&n.invert_rules&&this.on("getRuleTemplate.filter",function(t){var o=e(e.parseHTML(t.value));o.find(i.rule_actions).prepend('<button type="button" class="btn btn-xs btn-default" data-invert="rule"><i class="'+n.icon+'"></i> '+r.translate("invert")+"</button>"),t.value=o.prop("outerHTML")}))},{icon:"glyphicon glyphicon-random",recursive:!0,invert_rules:!0,display_rules_button:!1,silent_fail:!1,disable_template:!1}),t.defaults({operatorOpposites:{equal:"not_equal",not_equal:"equal",in:"not_in",not_in:"in",less:"greater_or_equal",less_or_equal:"greater",greater:"less_or_equal",greater_or_equal:"less",between:"not_between",not_between:"between",begins_with:"not_begins_with",not_begins_with:"begins_with",contains:"not_contains",not_contains:"contains",ends_with:"not_ends_with",not_ends_with:"ends_with",is_empty:"is_not_empty",is_not_empty:"is_empty",is_null:"is_not_null",is_not_null:"is_null"},conditionOpposites:{AND:"OR",OR:"AND"}}),t.extend({invert:function(t,r){if(!(t instanceof i)){if(!this.model.root)return;r=t,t=this.model.root}if("object"!=typeof r&&(r={}),void 0===r.recursive&&(r.recursive=!0),void 0===r.invert_rules&&(r.invert_rules=!0),void 0===r.silent_fail&&(r.silent_fail=!1),void 0===r.trigger&&(r.trigger=!0),t instanceof o){if(this.settings.conditionOpposites[t.condition]?t.condition=this.settings.conditionOpposites[t.condition]:r.silent_fail||n.error("InvertCondition",'Unknown inverse of condition "{0}"',t.condition),r.recursive){var s=e.extend({},r,{trigger:!1});t.each(function(e){r.invert_rules&&this.invert(e,s)},function(e){this.invert(e,s)},this)}}else if(t instanceof a&&t.operator&&!t.filter.no_invert)if(this.settings.operatorOpposites[t.operator.type]){var l=this.settings.operatorOpposites[t.operator.type];t.filter.operators&&-1==t.filter.operators.indexOf(l)||(t.operator=this.getOperatorByType(l))}else r.silent_fail||n.error("InvertOperator",'Unknown inverse of operator "{0}"',t.operator.type);r.trigger&&(this.trigger("afterInvert",t,r),this.trigger("rulesChanged"))}}),t.defaults({mongoOperators:{equal:function(e){return e[0]},not_equal:function(e){return{$ne:e[0]}},in:function(e){return{$in:e}},not_in:function(e){return{$nin:e}},less:function(e){return{$lt:e[0]}},less_or_equal:function(e){return{$lte:e[0]}},greater:function(e){return{$gt:e[0]}},greater_or_equal:function(e){return{$gte:e[0]}},between:function(e){return{$gte:e[0],$lte:e[1]}},not_between:function(e){return{$lt:e[0],$gt:e[1]}},begins_with:function(e){return{$regex:"^"+n.escapeRegExp(e[0])}},not_begins_with:function(e){return{$regex:"^(?!"+n.escapeRegExp(e[0])+")"}},contains:function(e){return{$regex:n.escapeRegExp(e[0])}},not_contains:function(e){return{$regex:"^((?!"+n.escapeRegExp(e[0])+").)*$",$options:"s"}},ends_with:function(e){return{$regex:n.escapeRegExp(e[0])+"$"}},not_ends_with:function(e){return{$regex:"(?<!"+n.escapeRegExp(e[0])+")$"}},is_empty:function(e){return""},is_not_empty:function(e){return{$ne:""}},is_null:function(e){return null},is_not_null:function(e){return{$ne:null}}},mongoRuleOperators:{$eq:function(e){return{val:e,op:null===e?"is_null":""===e?"is_empty":"equal"}},$ne:function(e){return{val:e=e.$ne,op:null===e?"is_not_null":""===e?"is_not_empty":"not_equal"}},$regex:function(e){return"^(?!"==(e=e.$regex).slice(0,4)&&")"==e.slice(-1)?{val:e.slice(4,-1),op:"not_begins_with"}:"^((?!"==e.slice(0,5)&&").)*$"==e.slice(-5)?{val:e.slice(5,-5),op:"not_contains"}:"(?<!"==e.slice(0,4)&&")$"==e.slice(-2)?{val:e.slice(4,-2),op:"not_ends_with"}:"$"==e.slice(-1)?{val:e.slice(0,-1),op:"ends_with"}:"^"==e.slice(0,1)?{val:e.slice(1),op:"begins_with"}:{val:e,op:"contains"}},between:function(e){return{val:[e.$gte,e.$lte],op:"between"}},not_between:function(e){return{val:[e.$lt,e.$gt],op:"not_between"}},$in:function(e){return{val:e.$in,op:"in"}},$nin:function(e){return{val:e.$nin,op:"not_in"}},$lt:function(e){return{val:e.$lt,op:"less"}},$lte:function(e){return{val:e.$lte,op:"less_or_equal"}},$gt:function(e){return{val:e.$gt,op:"greater"}},$gte:function(e){return{val:e.$gte,op:"greater_or_equal"}}}}),t.extend({getMongo:function(e){if(!(e=void 0===e?this.getRules():e))return null;var t=this;return function e(r){if(r.condition||(r.condition=t.settings.default_condition),-1===["AND","OR"].indexOf(r.condition.toUpperCase())&&n.error("UndefinedMongoCondition",'Unable to build MongoDB query with condition "{0}"',r.condition),!r.rules)return{};var i=[];r.rules.forEach(function(r){if(r.rules&&r.rules.length>0)i.push(e(r));else{var o=t.settings.mongoOperators[r.operator],a=t.getOperatorByType(r.operator);void 0===o&&n.error("UndefinedMongoOperator",'Unknown MongoDB operation for operator "{0}"',r.operator),0!==a.nb_inputs&&(r.value instanceof Array||(r.value=[r.value]));var s={};s[t.change("getMongoDBField",r.field,r)]=o.call(t,r.value),i.push(t.change("ruleToMongo",s,r,r.value,o))}});var o={};return o["$"+r.condition.toLowerCase()]=i,t.change("groupToMongo",o,r)}(e)},getRulesFromMongo:function(e){if(null==e)return null;var t=this;if("rules"in(e=t.change("parseMongoNode",e))&&"condition"in e)return e;if("id"in e&&"operator"in e&&"value"in e)return{condition:this.settings.default_condition,rules:[e]};var r=t.getMongoCondition(e);return r||n.error("MongoParse","Invalid MongoDB query format"),function e(r,i){var o=r[i],a=[];return o.forEach(function(r){if("rules"in(r=t.change("parseMongoNode",r))&&"condition"in r)a.push(r);else if("id"in r&&"operator"in r&&"value"in r)a.push(r);else{var i=t.getMongoCondition(r);if(i)a.push(e(r,i));else{var o=Object.keys(r)[0],s=r[o],l=t.getMongoOperator(s);void 0===l&&n.error("MongoParse","Invalid MongoDB query format");var u=t.settings.mongoRuleOperators[l];void 0===u&&n.error("UndefinedMongoOperator",'JSON Rule operation unknown for operator "{0}"',l);var c=u.call(t,s),d=t.getMongoDBFieldID(o,s),f=t.change("mongoToRule",{id:d,field:o,operator:c.op,value:c.val},r);a.push(f)}}}),t.change("mongoToGroup",{condition:i.replace("$","").toUpperCase(),rules:a},r)}(e,r)},setRulesFromMongo:function(e){this.setRules(this.getRulesFromMongo(e))},getMongoDBFieldID:function(e,t){var n=this.filters.filter(function(t){return t.field===e});return 1===n.length?n[0].id:this.change("getMongoDBFieldID",e,t)},getMongoOperator:function(e){if(null===e||"object"!=typeof e)return"$eq";if(void 0!==e.$gte&&void 0!==e.$lte)return"between";if(void 0!==e.$lt&&void 0!==e.$gt)return"not_between";var t=Object.keys(e).filter(function(e){return!!this.settings.mongoRuleOperators[e]}.bind(this));return 1===t.length?t[0]:void 0},getMongoCondition:function(e){for(var t=Object.keys(e),n=0,r=t.length;n<r;n++)if("$or"===t[n].toLowerCase()||"$and"===t[n].toLowerCase())return t[n]}}),t.define("not-group",function(n){var r=this;this.on("afterInit",function(){r.$el.on("click.queryBuilder","[data-not=group]",function(){var n=e(this).closest(t.selectors.group_container),i=r.getModel(n);i.not=!i.not}),r.model.on("update",function(e,t,n){t instanceof o&&"not"===n&&r.updateGroupNot(t)})}),this.on("afterAddGroup",function(e,t){t.__.not=!1}),n.disable_template||this.on("getGroupTemplate.filter",function(i){var o=e(e.parseHTML(i.value));o.find(t.selectors.condition_container).prepend('<button type="button" class="btn btn-xs btn-default" data-not="group"><i class="'+n.icon_unchecked+'"></i> '+r.translate("NOT")+"</button>"),i.value=o.prop("outerHTML")}),this.on("groupToJson.filter",function(e,t){e.value.not=t.not}),this.on("jsonToGroup.filter",function(e,t){e.value.not=!!t.not}),this.on("groupToSQL.filter",function(e,t){t.not&&(e.value="NOT ( "+e.value+" )")}),this.on("parseSQLNode.filter",function(e){e.value.name&&"NOT"==e.value.name.toUpperCase()&&(e.value=e.value.arguments.value[0],-1===["AND","OR"].indexOf(e.value.operation.toUpperCase())&&(e.value=new SQLParser.nodes.Op(r.settings.default_condition,e.value,null)),e.value.not=!0)}),this.on("sqlGroupsDistinct.filter",function(e,t,n,r){n.not&&r>0&&(e.value=!0)}),this.on("sqlToGroup.filter",function(e,t){e.value.not=!!t.not}),this.on("groupToMongo.filter",function(e,t){var n="$"+t.condition.toLowerCase();t.not&&e.value[n]&&(e.value={$nor:[e.value]})}),this.on("parseMongoNode.filter",function(e){var t=Object.keys(e.value);"$nor"==t[0]&&(e.value=e.value[t[0]][0],e.value.not=!0)}),this.on("mongoToGroup.filter",function(e,t){e.value.not=!!t.not})},{icon_unchecked:"glyphicon glyphicon-unchecked",icon_checked:"glyphicon glyphicon-check",disable_template:!1}),n.defineModelProperties(o,["not"]),t.selectors.group_not=t.selectors.group_header+" [data-not=group]",t.extend({updateGroupNot:function(e){var n=this.plugins["not-group"];e.$el.find(">"+t.selectors.group_not).toggleClass("active",e.not).find("i").attr("class",e.not?n.icon_checked:n.icon_unchecked),this.trigger("afterUpdateGroupNot",e),this.trigger("rulesChanged")}}),t.define("sortable",function(r){var i,a,l,u;"interact"in window||n.error("MissingLibrary",'interact.js is required to use "sortable" plugin. Get it here: http://interactjs.io'),void 0!==r.default_no_sortable&&(n.error(!1,"Config",'Sortable plugin : "default_no_sortable" options is deprecated, use standard "default_rule_flags" and "default_group_flags" instead'),this.settings.default_rule_flags.no_sortable=this.settings.default_group_flags.no_sortable=r.default_no_sortable),interact.dynamicDrop(!0),interact.pointerMoveTolerance(10),this.on("afterAddRule afterAddGroup",function(n,c){if(c!=i){var d=n.builder;r.inherit_no_sortable&&c.parent&&c.parent.flags.no_sortable&&(c.flags.no_sortable=!0),r.inherit_no_drop&&c.parent&&c.parent.flags.no_drop&&(c.flags.no_drop=!0),c.flags.no_sortable||interact(c.$el[0]).draggable({allowFrom:t.selectors.drag_handle,onstart:function(t){u=!1,l=d.getModel(t.target),a=l.$el.clone().appendTo(l.$el.parent()).width(l.$el.outerWidth()).addClass("dragging");var n=e(e.parseHTML('<div class="rule-placeholder">&nbsp;</div>')).height(l.$el.outerHeight());i=l.parent.addRule(n,l.getPos()),l.$el.hide()},onmove:function(e){a[0].style.top=e.clientY-15+"px",a[0].style.left=e.clientX-15+"px"},onend:function(t){t.dropzone&&(s(l,e(t.relatedTarget),d),u=!0),a.remove(),a=void 0,i.drop(),i=void 0,l.$el.css("display",""),d.trigger("afterMove",l),d.trigger("rulesChanged")}}),c.flags.no_drop||(interact(c.$el[0]).dropzone({accept:t.selectors.rule_and_group_containers,ondragenter:function(t){s(i,e(t.target),d)},ondrop:function(t){u||s(l,e(t.target),d)}}),c instanceof o&&interact(c.$el.find(t.selectors.group_header)[0]).dropzone({accept:t.selectors.rule_and_group_containers,ondragenter:function(t){s(i,e(t.target),d)},ondrop:function(t){u||s(l,e(t.target),d)}}))}}),this.on("beforeDeleteRule beforeDeleteGroup",function(e,n){e.isDefaultPrevented()||(interact(n.$el[0]).unset(),n instanceof o&&interact(n.$el.find(t.selectors.group_header)[0]).unset())}),this.on("afterApplyRuleFlags afterApplyGroupFlags",function(e,t){t.flags.no_sortable&&t.$el.find(".drag-handle").remove()}),r.disable_template||(this.on("getGroupTemplate.filter",function(n,i){if(i>1){var o=e(e.parseHTML(n.value));o.find(t.selectors.condition_container).after('<div class="drag-handle"><i class="'+r.icon+'"></i></div>'),n.value=o.prop("outerHTML")}}),this.on("getRuleTemplate.filter",function(n){var i=e(e.parseHTML(n.value));i.find(t.selectors.rule_header).after('<div class="drag-handle"><i class="'+r.icon+'"></i></div>'),n.value=i.prop("outerHTML")}))},{inherit_no_sortable:!0,inherit_no_drop:!0,icon:"glyphicon glyphicon-sort",disable_template:!1}),t.selectors.rule_and_group_containers=t.selectors.rule_container+", "+t.selectors.group_container,t.selectors.drag_handle=".drag-handle",t.defaults({default_rule_flags:{no_sortable:!1,no_drop:!1},default_group_flags:{no_sortable:!1,no_drop:!1}}),t.define("sql-support",function(e){},{boolean_as_integer:!0}),t.defaults({sqlOperators:{equal:{op:"= ?"},not_equal:{op:"!= ?"},in:{op:"IN(?)",sep:", "},not_in:{op:"NOT IN(?)",sep:", "},less:{op:"< ?"},less_or_equal:{op:"<= ?"},greater:{op:"> ?"},greater_or_equal:{op:">= ?"},between:{op:"BETWEEN ?",sep:" AND "},not_between:{op:"NOT BETWEEN ?",sep:" AND "},begins_with:{op:"LIKE ?",mod:"{0}%",escape:"%_"},not_begins_with:{op:"NOT LIKE ?",mod:"{0}%",escape:"%_"},contains:{op:"LIKE ?",mod:"%{0}%",escape:"%_"},not_contains:{op:"NOT LIKE ?",mod:"%{0}%",escape:"%_"},ends_with:{op:"LIKE ?",mod:"%{0}",escape:"%_"},not_ends_with:{op:"NOT LIKE ?",mod:"%{0}",escape:"%_"},is_empty:{op:"= ''"},is_not_empty:{op:"!= ''"},is_null:{op:"IS NULL"},is_not_null:{op:"IS NOT NULL"}},sqlRuleOperator:{"=":function(e){return{val:e,op:""===e?"is_empty":"equal"}},"!=":function(e){return{val:e,op:""===e?"is_not_empty":"not_equal"}},LIKE:function(e){return"%"==e.slice(0,1)&&"%"==e.slice(-1)?{val:e.slice(1,-1),op:"contains"}:"%"==e.slice(0,1)?{val:e.slice(1),op:"ends_with"}:"%"==e.slice(-1)?{val:e.slice(0,-1),op:"begins_with"}:void n.error("SQLParse",'Invalid value for LIKE operator "{0}"',e)},"NOT LIKE":function(e){return"%"==e.slice(0,1)&&"%"==e.slice(-1)?{val:e.slice(1,-1),op:"not_contains"}:"%"==e.slice(0,1)?{val:e.slice(1),op:"not_ends_with"}:"%"==e.slice(-1)?{val:e.slice(0,-1),op:"not_begins_with"}:void n.error("SQLParse",'Invalid value for NOT LIKE operator "{0}"',e)},IN:function(e){return{val:e,op:"in"}},"NOT IN":function(e){return{val:e,op:"not_in"}},"<":function(e){return{val:e,op:"less"}},"<=":function(e){return{val:e,op:"less_or_equal"}},">":function(e){return{val:e,op:"greater"}},">=":function(e){return{val:e,op:"greater_or_equal"}},BETWEEN:function(e){return{val:e,op:"between"}},"NOT BETWEEN":function(e){return{val:e,op:"not_between"}},IS:function(e){return null!==e&&n.error("SQLParse","Invalid value for IS operator"),{val:null,op:"is_null"}},"IS NOT":function(e){return null!==e&&n.error("SQLParse","Invalid value for IS operator"),{val:null,op:"is_not_null"}}},sqlStatements:{question_mark:function(){var e=[];return{add:function(t,n){return e.push(n),"?"},run:function(){return e}}},numbered:function(e){(!e||e.length>1)&&(e="$");var t=0,n=[];return{add:function(r,i){return n.push(i),t++,e+t},run:function(){return n}}},named:function(e){(!e||e.length>1)&&(e=":");var t={},n={};return{add:function(r,i){t[r.field]||(t[r.field]=1);var o=r.field+"_"+t[r.field]++;return n[o]=i,e+o},run:function(){return n}}}},sqlRuleStatement:{question_mark:function(e){var t=0;return{parse:function(n){return"?"==n?e[t++]:n},esc:function(e){return e.replace(/\?/g,"'?'")}}},numbered:function(e,t){(!t||t.length>1)&&(t="$");var n=new RegExp("^\\"+t+"[0-9]+$"),r=new RegExp("\\"+t+"([0-9]+)","g");return{parse:function(t){return n.test(t)?e[t.slice(1)-1]:t},esc:function(e){return e.replace(r,"'"+("$"==t?"$$":t)+"$1'")}}},named:function(e,t){(!t||t.length>1)&&(t=":");var n=new RegExp("^\\"+t),r=new RegExp("\\"+t+"("+Object.keys(e).join("|")+")\\b","g");return{parse:function(t){return n.test(t)?e[t.slice(1)]:t},esc:function(e){return e.replace(r,"'"+("$"==t?"$$":t)+"$1'")}}}}}),t.extend({getSQL:function(e,t,r){if(!(r=void 0===r?this.getRules():r))return null;t=t?"\n":" ";var i=this.getPluginOptions("sql-support","boolean_as_integer");if(!0===e&&(e="question_mark"),"string"==typeof e){var o=l(e);e=this.settings.sqlStatements[o[1]](o[2])}var a=this,s=function r(o){if(o.condition||(o.condition=a.settings.default_condition),-1===["AND","OR"].indexOf(o.condition.toUpperCase())&&n.error("UndefinedSQLCondition",'Unable to build SQL query with condition "{0}"',o.condition),!o.rules)return"";var s=[];o.rules.forEach(function(o){if(o.rules&&o.rules.length>0)s.push("("+t+r(o)+t+")"+t);else{var l=a.settings.sqlOperators[o.operator],u=a.getOperatorByType(o.operator),c="";void 0===l&&n.error("UndefinedSQLOperator",'Unknown SQL operation for operator "{0}"',o.operator),0!==u.nb_inputs&&(o.value instanceof Array||(o.value=[o.value]),o.value.forEach(function(t,r){r>0&&(c+=l.sep),"boolean"==o.type&&i?t=t?1:0:e||"integer"===o.type||"double"===o.type||"boolean"===o.type||(t=n.escapeString(t,l.escape)),l.mod&&(t=n.fmt(l.mod,t)),e?c+=e.add(o,t):("string"==typeof t&&(t="'"+t+"'"),c+=t)}));var d=function(e){return l.op.replace("?",function(){return e})},f=a.change("getSQLField",o.field,o)+" "+d(c);s.push(a.change("ruleToSQL",f,o,c,d))}});var l=s.join(" "+o.condition+t);return a.change("groupToSQL",l,o)}(r);return e?{sql:s,params:e.run()}:{sql:s}},getRulesFromSQL:function(t,r){"SQLParser"in window||n.error("MissingLibrary","SQLParser is required to parse SQL queries. Get it here https://github.com/mistic100/sql-parser");var i=this;if("string"==typeof t&&(t={sql:t}),!0===r&&(r="question_mark"),"string"==typeof r){var o=l(r);r=this.settings.sqlRuleStatement[o[1]](t.params,o[2])}r&&(t.sql=r.esc(t.sql)),0!==t.sql.toUpperCase().indexOf("SELECT")&&(t.sql="SELECT * FROM table WHERE "+t.sql);var a=SQLParser.parse(t.sql);a.where||n.error("SQLParse","No WHERE clause found");var s=i.change("parseSQLNode",a.where.conditions);if("rules"in s&&"condition"in s)return s;if("id"in s&&"operator"in s&&"value"in s)return{condition:this.settings.default_condition,rules:[s]};var u=i.change("sqlToGroup",{condition:this.settings.default_condition,rules:[]},s),c=u;return function t(o,a){if(null!==o)if("rules"in(o=i.change("parseSQLNode",o))&&"condition"in o)c.rules.push(o);else if("id"in o&&"operator"in o&&"value"in o)c.rules.push(o);else if("left"in o&&"right"in o&&"operation"in o||n.error("SQLParse","Unable to parse WHERE clause"),-1!==["AND","OR"].indexOf(o.operation.toUpperCase())){if(i.change("sqlGroupsDistinct",a>0&&c.condition!=o.operation.toUpperCase(),c,o,a)){var s=i.change("sqlToGroup",{condition:i.settings.default_condition,rules:[]},o);c.rules.push(s),c=s}c.condition=o.operation.toUpperCase(),a++;var l=c;t(o.left,a),c=l,t(o.right,a)}else{var u;e.isPlainObject(o.right.value)&&n.error("SQLParse","Value format not supported for {0}.",o.left.value),u=e.isArray(o.right.value)?o.right.value.map(function(e){return e.value}):o.right.value,r&&(u=e.isArray(u)?u.map(r.parse):r.parse(u));var d=o.operation.toUpperCase();"<>"==d&&(d="!=");var f=i.settings.sqlRuleOperator[d];void 0===f&&n.error("UndefinedSQLOperator",'Invalid SQL operation "{0}".',o.operation);var p,h=f.call(this,u,o.operation);"values"in o.left?p=o.left.values.join("."):"value"in o.left?p=o.left.value:n.error("SQLParse","Cannot find field name in {0}",JSON.stringify(o.left));var g=h.val,m=i.settings.sqlOperators[h.op];if(!r&&m&&m.escape){var v=m.escape.split("").map(function(e){return"\\\\"+e}).join("|");g=g.replace(new RegExp("("+v+")","g"),function(e){return e[1]})}var y=i.getSQLFieldID(p,u),_=i.change("sqlToRule",{id:y,field:p,operator:h.op,value:g},o);c.rules.push(_)}}(s,0),u},setRulesFromSQL:function(e,t){this.setRules(this.getRulesFromSQL(e,t))},getSQLFieldID:function(e,t){var n=this.filters.filter(function(t){return t.field.toLowerCase()===e.toLowerCase()});return 1===n.length?n[0].id:this.change("getSQLFieldID",e,t)}}),t.define("unique-filter",function(){this.status.used_filters={},this.on("afterUpdateRuleFilter",this.updateDisabledFilters),this.on("afterDeleteRule",this.updateDisabledFilters),this.on("afterCreateRuleFilters",this.applyDisabledFilters),this.on("afterReset",this.clearDisabledFilters),this.on("afterClear",this.clearDisabledFilters),this.on("getDefaultFilter.filter",function(e,t){var r=e.builder;r.updateDisabledFilters(),e.value.id in r.status.used_filters&&(r.filters.some(function(n){if(!(n.id in r.status.used_filters)||r.status.used_filters[n.id].length>0&&-1===r.status.used_filters[n.id].indexOf(t.parent))return e.value=n,!0})||(n.error(!1,"UniqueFilter","No more non-unique filters available"),e.value=void 0))})}),t.extend({updateDisabledFilters:function(e){var t=e?e.builder:this;t.status.used_filters={},t.model&&(function e(n){n.each(function(e){e.filter&&e.filter.unique&&(t.status.used_filters[e.filter.id]||(t.status.used_filters[e.filter.id]=[]),"group"==e.filter.unique&&t.status.used_filters[e.filter.id].push(e.parent))},function(t){e(t)})}(t.model.root),t.applyDisabledFilters(e))},clearDisabledFilters:function(e){var t=e?e.builder:this;t.status.used_filters={},t.applyDisabledFilters(e)},applyDisabledFilters:function(n){var r=n?n.builder:this;r.$el.find(t.selectors.filter_container+" option").prop("disabled",!1),e.each(r.status.used_filters,function(e,n){0===n.length?r.$el.find(t.selectors.filter_container+' option[value="'+e+'"]:not(:selected)').prop("disabled",!0):n.forEach(function(n){n.each(function(n){n.$el.find(t.selectors.filter_container+' option[value="'+e+'"]:not(:selected)').prop("disabled",!0)})})}),r.settings.plugins&&r.settings.plugins["bt-selectpicker"]&&r.$el.find(t.selectors.rule_filter).selectpicker("render")}}),t.regional.en={__locale:"English (en)",__author:'Damien "Mistic" Sorel, http://www.strangeplanet.fr',add_rule:"Add rule",add_group:"Add group",delete_rule:"Delete",delete_group:"Delete",conditions:{AND:"AND",OR:"OR"},operators:{equal:"equal",not_equal:"not equal",in:"in",not_in:"not in",less:"less",less_or_equal:"less or equal",greater:"greater",greater_or_equal:"greater or equal",between:"between",not_between:"not between",begins_with:"begins with",not_begins_with:"doesn't begin with",contains:"contains",not_contains:"doesn't contain",ends_with:"ends with",not_ends_with:"doesn't end with",is_empty:"is empty",is_not_empty:"is not empty",is_null:"is null",is_not_null:"is not null"},errors:{no_filter:"No filter selected",empty_group:"The group is empty",radio_empty:"No value selected",checkbox_empty:"No value selected",select_empty:"No value selected",string_empty:"Empty value",string_exceed_min_length:"Must contain at least {0} characters",string_exceed_max_length:"Must not contain more than {0} characters",string_invalid_format:"Invalid format ({0})",number_nan:"Not a number",number_not_integer:"Not an integer",number_not_double:"Not a real number",number_exceed_min:"Must be greater than {0}",number_exceed_max:"Must be lower than {0}",number_wrong_step:"Must be a multiple of {0}",number_between_invalid:"Invalid values, {0} is greater than {1}",datetime_empty:"Empty value",datetime_invalid:"Invalid date format ({0})",datetime_exceed_min:"Must be after {0}",datetime_exceed_max:"Must be before {0}",datetime_between_invalid:"Invalid values, {0} is greater than {1}",boolean_not_valid:"Not a boolean",operator_not_multiple:'Operator "{1}" cannot accept multiple values'},invert:"Invert",NOT:"NOT"},t.defaults({lang_code:"en"}),t},void 0===(o=r.apply(t,i))||(e.exports=o)},1491:function(e,t,n){var r,i,o;i=[n(9983)],r=function(e){"use strict";e.extendext=function(){var t,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1,d="default";for("boolean"==typeof s&&(c=s,s=arguments[l++]||{}),"string"==typeof s&&("concat"!==(d=s.toLowerCase())&&"replace"!==d&&"extend"!==d&&(d="default"),s=arguments[l++]||{}),"object"==typeof s||e.isFunction(s)||(s={}),l===u&&(s=this,l--);l<u;l++)if(null!==(t=arguments[l]))if(e.isArray(t)&&"default"!==d)switch(a=s&&e.isArray(s)?s:[],d){case"concat":s=a.concat(e.extend(c,[],t));break;case"replace":s=e.extend(c,[],t);break;case"extend":t.forEach(function(t,n){if("object"==typeof t){var r=e.isArray(t)?[]:{};a[n]=e.extendext(c,d,a[n]||r,t)}else-1===a.indexOf(t)&&a.push(t)}),s=a}else for(n in t)i=t[n],"__proto__"!==n&&s!==i&&(c&&i&&(e.isPlainObject(i)||(o=e.isArray(i)))?(r=s[n],a=o&&!Array.isArray(r)?[]:o||e.isPlainObject(r)?r:{},o=!1,s[n]=e.extendext(c,d,a,i)):void 0!==i&&(s[n]=i));return s}},void 0===(o=r.apply(t,i))||(e.exports=o)},9755:function(e,t){var n;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(r,i){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(e){return o.flat.call(e)}:function(e){return o.concat.apply([],e)},u=o.push,c=o.indexOf,d={},f=d.toString,p=d.hasOwnProperty,h=p.toString,g=h.call(Object),m={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},_=r.document,b={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var r,i,o=(n=n||_).createElement("script");if(o.text=e,t)for(r in b)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[f.call(e)]||"object":typeof e}var k="3.7.1",C=/HTML$/i,D=function(e,t){return new D.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}D.fn=D.prototype={jquery:k,constructor:D,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=D.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return D.each(this,e)},map:function(e){return this.pushStack(D.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(D.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(D.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},D.extend=D.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(D.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||D.isPlainObject(n)?n:{},i=!1,a[t]=D.extend(u,o,r)):void 0!==r&&(a[t]=r));return a},D.extend({expando:"jQuery"+(k+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==f.call(e)||(t=a(e))&&("function"!=typeof(n=p.call(t,"constructor")&&t.constructor)||h.call(n)!==g))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){w(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(S(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)for(;t=e[r++];)n+=D.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?D.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:c.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!C.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(S(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return l(a)},guid:1,support:m}),"function"==typeof Symbol&&(D.fn[Symbol.iterator]=o[Symbol.iterator]),D.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){d["[object "+t+"]"]=t.toLowerCase()});var E=o.pop,M=o.sort,T=o.splice,j="[\\x20\\t\\r\\n\\f]",N=new RegExp("^"+j+"+|((?:^|[^\\\\])(?:\\\\.)*)"+j+"+$","g");D.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var F=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function O(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}D.escapeSelector=function(e){return(e+"").replace(F,O)};var I=_,z=u;!function(){var e,t,n,i,a,l,u,d,f,h,g=z,v=D.expando,y=0,_=0,b=ee(),w=ee(),x=ee(),k=ee(),C=function(e,t){return e===t&&(a=!0),0},S="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="(?:\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",O="\\["+j+"*("+F+")(?:"+j+"*([*^$|!~]?=)"+j+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+F+"))|)"+j+"*\\]",$=":("+F+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",q=new RegExp(j+"+","g"),R=new RegExp("^"+j+"*,"+j+"*"),P=new RegExp("^"+j+"*([>+~]|"+j+")"+j+"*"),L=new RegExp(j+"|>"),B=new RegExp($),U=new RegExp("^"+F+"$"),V={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),TAG:new RegExp("^("+F+"|[*])"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+j+"*(even|odd|(([+-]|)(\\d*)n|)"+j+"*(?:([+-]|)"+j+"*(\\d+)|))"+j+"*\\)|)","i"),bool:new RegExp("^(?:"+S+")$","i"),needsContext:new RegExp("^"+j+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+j+"*((?:-\\d)?\\d*)"+j+"*\\)|)(?=[^-]|$)","i")},H=/^(?:input|select|textarea|button)$/i,W=/^h\d$/i,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/[+~]/,Q=new RegExp("\\\\[\\da-fA-F]{1,6}"+j+"?|\\\\([^\\r\\n\\f])","g"),K=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},Z=function(){le()},X=fe(function(e){return!0===e.disabled&&A(e,"fieldset")},{dir:"parentNode",next:"legend"});try{g.apply(o=s.call(I.childNodes),I.childNodes),o[I.childNodes.length].nodeType}catch(e){g={apply:function(e,t){z.apply(e,s.call(t))},call:function(e){z.apply(e,s.call(arguments,1))}}}function J(e,t,n,r){var i,o,a,s,u,c,p,h=t&&t.ownerDocument,y=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return n;if(!r&&(le(t),t=t||l,d)){if(11!==y&&(u=G.exec(e)))if(i=u[1]){if(9===y){if(!(a=t.getElementById(i)))return n;if(a.id===i)return g.call(n,a),n}else if(h&&(a=h.getElementById(i))&&J.contains(t,a)&&a.id===i)return g.call(n,a),n}else{if(u[2])return g.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&t.getElementsByClassName)return g.apply(n,t.getElementsByClassName(i)),n}if(!(k[e+" "]||f&&f.test(e))){if(p=e,h=t,1===y&&(L.test(e)||P.test(e))){for((h=Y.test(e)&&se(t.parentNode)||t)==t&&m.scope||((s=t.getAttribute("id"))?s=D.escapeSelector(s):t.setAttribute("id",s=v)),o=(c=ce(e)).length;o--;)c[o]=(s?"#"+s:":scope")+" "+de(c[o]);p=c.join(",")}try{return g.apply(n,h.querySelectorAll(p)),n}catch(t){k(e,!0)}finally{s===v&&t.removeAttribute("id")}}}return ye(e.replace(N,"$1"),t,n,r)}function ee(){var e=[];return function n(r,i){return e.push(r+" ")>t.cacheLength&&delete n[e.shift()],n[r+" "]=i}}function te(e){return e[v]=!0,e}function ne(e){var t=l.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return A(t,"input")&&t.type===e}}function ie(e){return function(t){return(A(t,"input")||A(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&X(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ae(e){return te(function(t){return t=+t,te(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function se(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var n,r=e?e.ownerDocument||e:I;return r!=l&&9===r.nodeType&&r.documentElement?(u=(l=r).documentElement,d=!D.isXMLDoc(l),h=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&I!=l&&(n=l.defaultView)&&n.top!==n&&n.addEventListener("unload",Z),m.getById=ne(function(e){return u.appendChild(e).id=D.expando,!l.getElementsByName||!l.getElementsByName(D.expando).length}),m.disconnectedMatch=ne(function(e){return h.call(e,"*")}),m.scope=ne(function(){return l.querySelectorAll(":scope")}),m.cssHas=ne(function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),m.getById?(t.filter.ID=function(e){var t=e.replace(Q,K);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(Q,K);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},f=[],ne(function(e){var t;u.appendChild(e).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||f.push("\\["+j+"*(?:value|"+S+")"),e.querySelectorAll("[id~="+v+"-]").length||f.push("~="),e.querySelectorAll("a#"+v+"+*").length||f.push(".#.+[+~]"),e.querySelectorAll(":checked").length||f.push(":checked"),(t=l.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),u.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&f.push(":enabled",":disabled"),(t=l.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||f.push("\\["+j+"*name"+j+"*="+j+"*(?:''|\"\")")}),m.cssHas||f.push(":has"),f=f.length&&new RegExp(f.join("|")),C=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!m.sortDetached&&t.compareDocumentPosition(e)===n?e===l||e.ownerDocument==I&&J.contains(I,e)?-1:t===l||t.ownerDocument==I&&J.contains(I,t)?1:i?c.call(i,e)-c.call(i,t):0:4&n?-1:1)},l):l}for(e in J.matches=function(e,t){return J(e,null,null,t)},J.matchesSelector=function(e,t){if(le(e),d&&!k[t+" "]&&(!f||!f.test(t)))try{var n=h.call(e,t);if(n||m.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){k(t,!0)}return J(t,l,null,[e]).length>0},J.contains=function(e,t){return(e.ownerDocument||e)!=l&&le(e),D.contains(e,t)},J.attr=function(e,n){(e.ownerDocument||e)!=l&&le(e);var r=t.attrHandle[n.toLowerCase()],i=r&&p.call(t.attrHandle,n.toLowerCase())?r(e,n,!d):void 0;return void 0!==i?i:e.getAttribute(n)},J.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},D.uniqueSort=function(e){var t,n=[],r=0,o=0;if(a=!m.sortStable,i=!m.sortStable&&s.call(e,0),M.call(e,C),a){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)T.call(e,n[r],1)}return i=null,e},D.fn.uniqueSort=function(){return this.pushStack(D.uniqueSort(s.apply(this)))},t=D.expr={cacheLength:50,createPseudo:te,match:V,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(Q,K),e[3]=(e[3]||e[4]||e[5]||"").replace(Q,K),"~="===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]||J.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]&&J.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=ce(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(Q,K).toLowerCase();return"*"===e?function(){return!0}:function(e){return A(e,t)}},CLASS:function(e){var t=b[e+" "];return t||(t=new RegExp("(^|"+j+")"+e+"("+j+"|$)"))&&b(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(r){var i=J.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,d,f,p,h=o!==a?"nextSibling":"previousSibling",g=t.parentNode,m=s&&t.nodeName.toLowerCase(),_=!l&&!s,b=!1;if(g){if(o){for(;h;){for(d=t;d=d[h];)if(s?A(d,m):1===d.nodeType)return!1;p=h="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&_){for(b=(f=(u=(c=g[v]||(g[v]={}))[e]||[])[0]===y&&u[1])&&u[2],d=f&&g.childNodes[f];d=++f&&d&&d[h]||(b=f=0)||p.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[y,f,b];break}}else if(_&&(b=f=(u=(c=t[v]||(t[v]={}))[e]||[])[0]===y&&u[1]),!1===b)for(;(d=++f&&d&&d[h]||(b=f=0)||p.pop())&&(!(s?A(d,m):1===d.nodeType)||!++b||(_&&((c=d[v]||(d[v]={}))[e]=[y,b]),d!==t)););return(b-=i)===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,n){var r,i=t.pseudos[e]||t.setFilters[e.toLowerCase()]||J.error("unsupported pseudo: "+e);return i[v]?i(n):i.length>1?(r=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te(function(e,t){for(var r,o=i(e,n),a=o.length;a--;)e[r=c.call(e,o[a])]=!(t[r]=o[a])}):function(e){return i(e,0,r)}):i}},pseudos:{not:te(function(e){var t=[],n=[],r=ve(e.replace(N,"$1"));return r[v]?te(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:te(function(e){return function(t){return J(e,t).length>0}}),contains:te(function(e){return e=e.replace(Q,K),function(t){return(t.textContent||D.text(t)).indexOf(e)>-1}}),lang:te(function(e){return U.test(e||"")||J.error("unsupported lang: "+e),e=e.replace(Q,K).toLowerCase(),function(t){var n;do{if(n=d?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(e){var t=r.location&&r.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===function(){try{return l.activeElement}catch(e){}}()&&l.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return A(e,"input")&&!!e.checked||A(e,"option")&&!!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!t.pseudos.empty(e)},header:function(e){return W.test(e.nodeName)},input:function(e){return H.test(e.nodeName)},button:function(e){return A(e,"input")&&"button"===e.type||A(e,"button")},text:function(e){var t;return A(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ae(function(){return[0]}),last:ae(function(e,t){return[t-1]}),eq:ae(function(e,t,n){return[n<0?n+t:n]}),even:ae(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ae(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ae(function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:ae(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},t.pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=re(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=ie(e);function ue(){}function ce(e,n){var r,i,o,a,s,l,u,c=w[e+" "];if(c)return n?0:c.slice(0);for(s=e,l=[],u=t.preFilter;s;){for(a in r&&!(i=R.exec(s))||(i&&(s=s.slice(i[0].length)||s),l.push(o=[])),r=!1,(i=P.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(N," ")}),s=s.slice(r.length)),t.filter)!(i=V[a].exec(s))||u[a]&&!(i=u[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?J.error(e):w(e,l).slice(0)}function de(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function fe(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=_++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,l){var u,c,d=[y,s];if(l){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(c=t[v]||(t[v]={}),i&&A(t,i))t=t[r]||t;else{if((u=c[o])&&u[0]===y&&u[1]===s)return d[2]=u[2];if(c[o]=d,d[2]=e(t,n,l))return!0}return!1}}function pe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function he(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,u=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),u&&t.push(s)));return a}function ge(e,t,n,r,i,o){return r&&!r[v]&&(r=ge(r)),i&&!i[v]&&(i=ge(i,o)),te(function(o,a,s,l){var u,d,f,p,h=[],m=[],v=a.length,y=o||function(e,t,n){for(var r=0,i=t.length;r<i;r++)J(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),_=!e||!o&&t?y:he(y,h,e,s,l);if(n?n(_,p=i||(o?e:v||r)?[]:a,s,l):p=_,r)for(u=he(p,m),r(u,[],s,l),d=u.length;d--;)(f=u[d])&&(p[m[d]]=!(_[m[d]]=f));if(o){if(i||e){if(i){for(u=[],d=p.length;d--;)(f=p[d])&&u.push(_[d]=f);i(null,p=[],u,l)}for(d=p.length;d--;)(f=p[d])&&(u=i?c.call(o,f):h[d])>-1&&(o[u]=!(a[u]=f))}}else p=he(p===a?p.splice(v,p.length):p),i?i(null,a,p,l):g.apply(a,p)})}function me(e){for(var r,i,o,a=e.length,s=t.relative[e[0].type],l=s||t.relative[" "],u=s?1:0,d=fe(function(e){return e===r},l,!0),f=fe(function(e){return c.call(r,e)>-1},l,!0),p=[function(e,t,i){var o=!s&&(i||t!=n)||((r=t).nodeType?d(e,t,i):f(e,t,i));return r=null,o}];u<a;u++)if(i=t.relative[e[u].type])p=[fe(pe(p),i)];else{if((i=t.filter[e[u].type].apply(null,e[u].matches))[v]){for(o=++u;o<a&&!t.relative[e[o].type];o++);return ge(u>1&&pe(p),u>1&&de(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(N,"$1"),i,u<o&&me(e.slice(u,o)),o<a&&me(e=e.slice(o)),o<a&&de(e))}p.push(i)}return pe(p)}function ve(e,r){var i,o=[],a=[],s=x[e+" "];if(!s){for(r||(r=ce(e)),i=r.length;i--;)(s=me(r[i]))[v]?o.push(s):a.push(s);s=x(e,function(e,r){var i=r.length>0,o=e.length>0,a=function(a,s,u,c,f){var p,h,m,v=0,_="0",b=a&&[],w=[],x=n,k=a||o&&t.find.TAG("*",f),C=y+=null==x?1:Math.random()||.1,S=k.length;for(f&&(n=s==l||s||f);_!==S&&null!=(p=k[_]);_++){if(o&&p){for(h=0,s||p.ownerDocument==l||(le(p),u=!d);m=e[h++];)if(m(p,s||l,u)){g.call(c,p);break}f&&(y=C)}i&&((p=!m&&p)&&v--,a&&b.push(p))}if(v+=_,i&&_!==v){for(h=0;m=r[h++];)m(b,w,s,u);if(a){if(v>0)for(;_--;)b[_]||w[_]||(w[_]=E.call(c));w=he(w)}g.apply(c,w),f&&!a&&w.length>0&&v+r.length>1&&D.uniqueSort(c)}return f&&(y=C,n=x),b};return i?te(a):a}(a,o)),s.selector=e}return s}function ye(e,n,r,i){var o,a,s,l,u,c="function"==typeof e&&e,f=!i&&ce(e=c.selector||e);if(r=r||[],1===f.length){if((a=f[0]=f[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===n.nodeType&&d&&t.relative[a[1].type]){if(!(n=(t.find.ID(s.matches[0].replace(Q,K),n)||[])[0]))return r;c&&(n=n.parentNode),e=e.slice(a.shift().value.length)}for(o=V.needsContext.test(e)?0:a.length;o--&&(s=a[o],!t.relative[l=s.type]);)if((u=t.find[l])&&(i=u(s.matches[0].replace(Q,K),Y.test(a[0].type)&&se(n.parentNode)||n))){if(a.splice(o,1),!(e=i.length&&de(a)))return g.apply(r,i),r;break}}return(c||ve(e,f))(i,n,!d,r,!n||Y.test(e)&&se(n.parentNode)||n),r}ue.prototype=t.filters=t.pseudos,t.setFilters=new ue,m.sortStable=v.split("").sort(C).join("")===v,le(),m.sortDetached=ne(function(e){return 1&e.compareDocumentPosition(l.createElement("fieldset"))}),D.find=J,D.expr[":"]=D.expr.pseudos,D.unique=D.uniqueSort,J.compile=ve,J.select=ye,J.setDocument=le,J.tokenize=ce,J.escape=D.escapeSelector,J.getText=D.text,J.isXML=D.isXMLDoc,J.selectors=D.expr,J.support=D.support,J.uniqueSort=D.uniqueSort}();var $=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&D(e).is(n))break;r.push(e)}return r},q=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},R=D.expr.match.needsContext,P=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function L(e,t,n){return v(t)?D.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?D.grep(e,function(e){return e===t!==n}):"string"!=typeof t?D.grep(e,function(e){return c.call(t,e)>-1!==n}):D.filter(t,e,n)}D.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?D.find.matchesSelector(r,e)?[r]:[]:D.find.matches(e,D.grep(t,function(e){return 1===e.nodeType}))},D.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(D(e).filter(function(){for(t=0;t<r;t++)if(D.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)D.find(e,i[t],n);return r>1?D.uniqueSort(n):n},filter:function(e){return this.pushStack(L(this,e||[],!1))},not:function(e){return this.pushStack(L(this,e||[],!0))},is:function(e){return!!L(this,"string"==typeof e&&R.test(e)?D(e):e||[],!1).length}});var B,U=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(D.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||B,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:U.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof D?t[0]:t,D.merge(this,D.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:_,!0)),P.test(r[1])&&D.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=_.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(D):D.makeArray(e,this)}).prototype=D.fn,B=D(_);var V=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function W(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}D.fn.extend({has:function(e){var t=D(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(D.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&D(e);if(!R.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&D.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?D.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?c.call(D(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(D.uniqueSort(D.merge(this.get(),D(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),D.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return $(e,"parentNode")},parentsUntil:function(e,t,n){return $(e,"parentNode",n)},next:function(e){return W(e,"nextSibling")},prev:function(e){return W(e,"previousSibling")},nextAll:function(e){return $(e,"nextSibling")},prevAll:function(e){return $(e,"previousSibling")},nextUntil:function(e,t,n){return $(e,"nextSibling",n)},prevUntil:function(e,t,n){return $(e,"previousSibling",n)},siblings:function(e){return q((e.parentNode||{}).firstChild,e)},children:function(e){return q(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),D.merge([],e.childNodes))}},function(e,t){D.fn[e]=function(n,r){var i=D.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=D.filter(r,i)),this.length>1&&(H[e]||D.uniqueSort(i),V.test(e)&&i.reverse()),this.pushStack(i)}});var G=/[^\x20\t\r\n\f]+/g;function Y(e){return e}function Q(e){throw e}function K(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}D.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return D.each(e.match(G)||[],function(e,n){t[n]=!0}),t}(e):D.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},u={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){D.each(n,function(n,r){v(r)?e.unique&&u.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&l()),this},remove:function(){return D.each(arguments,function(e,t){for(var n;(n=D.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?D.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},D.extend({Deferred:function(e){var t=[["notify","progress",D.Callbacks("memory"),D.Callbacks("memory"),2],["resolve","done",D.Callbacks("once memory"),D.Callbacks("once memory"),0,"resolved"],["reject","fail",D.Callbacks("once memory"),D.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return D.Deferred(function(n){D.each(t,function(t,r){var i=v(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var s=this,l=arguments,u=function(){var r,u;if(!(e<o)){if((r=n.apply(s,l))===t.promise())throw new TypeError("Thenable self-resolution");u=r&&("object"==typeof r||"function"==typeof r)&&r.then,v(u)?i?u.call(r,a(o,t,Y,i),a(o,t,Q,i)):(o++,u.call(r,a(o,t,Y,i),a(o,t,Q,i),a(o,t,Y,t.notifyWith))):(n!==Y&&(s=void 0,l=[r]),(i||t.resolveWith)(s,l))}},c=i?u:function(){try{u()}catch(r){D.Deferred.exceptionHook&&D.Deferred.exceptionHook(r,c.error),e+1>=o&&(n!==Q&&(s=void 0,l=[r]),t.rejectWith(s,l))}};e?c():(D.Deferred.getErrorHook?c.error=D.Deferred.getErrorHook():D.Deferred.getStackHook&&(c.error=D.Deferred.getStackHook()),r.setTimeout(c))}}return D.Deferred(function(r){t[0][3].add(a(0,r,v(i)?i:Y,r.notifyWith)),t[1][3].add(a(0,r,v(e)?e:Y)),t[2][3].add(a(0,r,v(n)?n:Q))}).promise()},promise:function(e){return null!=e?D.extend(e,i):i}},o={};return D.each(t,function(e,r){var a=r[2],s=r[5];i[r[1]]=a.add,s&&a.add(function(){n=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=D.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(K(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||v(i[n]&&i[n].then)))return o.then();for(;n--;)K(i[n],a(n),o.reject);return o.promise()}});var Z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;D.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&Z.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},D.readyException=function(e){r.setTimeout(function(){throw e})};var X=D.Deferred();function J(){_.removeEventListener("DOMContentLoaded",J),r.removeEventListener("load",J),D.ready()}D.fn.ready=function(e){return X.then(e).catch(function(e){D.readyException(e)}),this},D.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--D.readyWait:D.isReady)||(D.isReady=!0,!0!==e&&--D.readyWait>0||X.resolveWith(_,[D]))}}),D.ready.then=X.then,"complete"===_.readyState||"loading"!==_.readyState&&!_.documentElement.doScroll?r.setTimeout(D.ready):(_.addEventListener("DOMContentLoaded",J),r.addEventListener("load",J));var ee=function(e,t,n,r,i,o,a){var s=0,l=e.length,u=null==n;if("object"===x(n))for(s in i=!0,n)ee(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(D(e),n)})),t))for(;s<l;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:u?t.call(e):l?t(e[0],n):o},te=/^-ms-/,ne=/-([a-z])/g;function re(e,t){return t.toUpperCase()}function ie(e){return e.replace(te,"ms-").replace(ne,re)}var oe=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function ae(){this.expando=D.expando+ae.uid++}ae.uid=1,ae.prototype={cache:function(e){var t=e[this.expando];return t||(t={},oe(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[ie(t)]=n;else for(r in t)i[ie(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][ie(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(ie):(t=ie(t))in r?[t]:t.match(G)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||D.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!D.isEmptyObject(t)}};var se=new ae,le=new ae,ue=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ce=/[A-Z]/g;function de(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ce,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ue.test(e)?JSON.parse(e):e)}(n)}catch(e){}le.set(e,t,n)}else n=void 0;return n}D.extend({hasData:function(e){return le.hasData(e)||se.hasData(e)},data:function(e,t,n){return le.access(e,t,n)},removeData:function(e,t){le.remove(e,t)},_data:function(e,t,n){return se.access(e,t,n)},_removeData:function(e,t){se.remove(e,t)}}),D.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=le.get(o),1===o.nodeType&&!se.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=ie(r.slice(5)),de(o,r,i[r]));se.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){le.set(this,e)}):ee(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=le.get(o,e))||void 0!==(n=de(o,e))?n:void 0;this.each(function(){le.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){le.remove(this,e)})}}),D.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=se.get(e,t),n&&(!r||Array.isArray(n)?r=se.access(e,t,D.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=D.queue(e,t),r=n.length,i=n.shift(),o=D._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){D.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return se.get(e,n)||se.access(e,n,{empty:D.Callbacks("once memory").add(function(){se.remove(e,[t+"queue",n])})})}}),D.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?D.queue(this[0],e):void 0===t?this:this.each(function(){var n=D.queue(this,e,t);D._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&D.dequeue(this,e)})},dequeue:function(e){return this.each(function(){D.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=D.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=se.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var fe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,pe=new RegExp("^(?:([+-])=|)("+fe+")([a-z%]*)$","i"),he=["Top","Right","Bottom","Left"],ge=_.documentElement,me=function(e){return D.contains(e.ownerDocument,e)},ve={composed:!0};ge.getRootNode&&(me=function(e){return D.contains(e.ownerDocument,e)||e.getRootNode(ve)===e.ownerDocument});var ye=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&me(e)&&"none"===D.css(e,"display")};function _e(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return D.css(e,t,"")},l=s(),u=n&&n[3]||(D.cssNumber[t]?"":"px"),c=e.nodeType&&(D.cssNumber[t]||"px"!==u&&+l)&&pe.exec(D.css(e,t));if(c&&c[3]!==u){for(l/=2,u=u||c[3],c=+l||1;a--;)D.style(e,t,c+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),c/=o;c*=2,D.style(e,t,c+u),n=n||[]}return n&&(c=+c||+l||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=c,r.end=i)),i}var be={};function we(e){var t,n=e.ownerDocument,r=e.nodeName,i=be[r];return i||(t=n.body.appendChild(n.createElement(r)),i=D.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),be[r]=i,i)}function xe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=se.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ye(r)&&(i[o]=we(r))):"none"!==n&&(i[o]="none",se.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}D.fn.extend({show:function(){return xe(this,!0)},hide:function(){return xe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ye(this)?D(this).show():D(this).hide()})}});var ke,Ce,De=/^(?:checkbox|radio)$/i,Se=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ae=/^$|^module$|\/(?:java|ecma)script/i;ke=_.createDocumentFragment().appendChild(_.createElement("div")),(Ce=_.createElement("input")).setAttribute("type","radio"),Ce.setAttribute("checked","checked"),Ce.setAttribute("name","t"),ke.appendChild(Ce),m.checkClone=ke.cloneNode(!0).cloneNode(!0).lastChild.checked,ke.innerHTML="<textarea>x</textarea>",m.noCloneChecked=!!ke.cloneNode(!0).lastChild.defaultValue,ke.innerHTML="<option></option>",m.option=!!ke.lastChild;var Ee={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Me(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?D.merge([e],n):n}function Te(e,t){for(var n=0,r=e.length;n<r;n++)se.set(e[n],"globalEval",!t||se.get(t[n],"globalEval"))}Ee.tbody=Ee.tfoot=Ee.colgroup=Ee.caption=Ee.thead,Ee.th=Ee.td,m.option||(Ee.optgroup=Ee.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ne(e,t,n,r,i){for(var o,a,s,l,u,c,d=t.createDocumentFragment(),f=[],p=0,h=e.length;p<h;p++)if((o=e[p])||0===o)if("object"===x(o))D.merge(f,o.nodeType?[o]:o);else if(je.test(o)){for(a=a||d.appendChild(t.createElement("div")),s=(Se.exec(o)||["",""])[1].toLowerCase(),l=Ee[s]||Ee._default,a.innerHTML=l[1]+D.htmlPrefilter(o)+l[2],c=l[0];c--;)a=a.lastChild;D.merge(f,a.childNodes),(a=d.firstChild).textContent=""}else f.push(t.createTextNode(o));for(d.textContent="",p=0;o=f[p++];)if(r&&D.inArray(o,r)>-1)i&&i.push(o);else if(u=me(o),a=Me(d.appendChild(o),"script"),u&&Te(a),n)for(c=0;o=a[c++];)Ae.test(o.type||"")&&n.push(o);return d}var Fe=/^([^.]*)(?:\.(.+)|)/;function Oe(){return!0}function Ie(){return!1}function ze(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ze(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ie;else if(!i)return e;return 1===o&&(a=i,i=function(e){return D().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=D.guid++)),e.each(function(){D.event.add(this,t,i,r,n)})}function $e(e,t,n){n?(se.set(e,t,!1),D.event.add(e,t,{namespace:!1,handler:function(e){var n,r=se.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(D.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),se.set(this,t,r),this[t](),n=se.get(this,t),se.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(se.set(this,t,D.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Oe)}})):void 0===se.get(e,t)&&D.event.add(e,t,Oe)}D.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,f,p,h,g,m=se.get(e);if(oe(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&D.find.matchesSelector(ge,i),n.guid||(n.guid=D.guid++),(l=m.events)||(l=m.events=Object.create(null)),(a=m.handle)||(a=m.handle=function(t){return void 0!==D&&D.event.triggered!==t.type?D.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(G)||[""]).length;u--;)p=g=(s=Fe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p&&(d=D.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=D.event.special[p]||{},c=D.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&D.expr.match.needsContext.test(i),namespace:h.join(".")},o),(f=l[p])||((f=l[p]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,c):f.push(c),D.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,f,p,h,g,m=se.hasData(e)&&se.get(e);if(m&&(l=m.events)){for(u=(t=(t||"").match(G)||[""]).length;u--;)if(p=g=(s=Fe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=D.event.special[p]||{},f=l[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||D.removeEvent(e,p,m.handle),delete l[p])}else for(p in l)D.event.remove(e,p+t[u],n,r,!0);D.isEmptyObject(l)&&se.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=D.event.fix(e),u=(se.get(this,"events")||Object.create(null))[l.type]||[],c=D.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,l)){for(a=D.event.handlers.call(this,l,u),t=0;(i=a[t++])&&!l.isPropagationStopped();)for(l.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(r=((D.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(l.result=r)&&(l.preventDefault(),l.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,r,i,o,a,s=[],l=t.delegateCount,u=e.target;if(l&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?D(i,this).index(u)>-1:D.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l<t.length&&s.push({elem:u,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(D.Event.prototype,e,{enumerable:!0,configurable:!0,get:v(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[D.expando]?e:new D.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return De.test(t.type)&&t.click&&A(t,"input")&&$e(t,"click",!0),!1},trigger:function(e){var t=this||e;return De.test(t.type)&&t.click&&A(t,"input")&&$e(t,"click"),!0},_default:function(e){var t=e.target;return De.test(t.type)&&t.click&&A(t,"input")&&se.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},D.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},D.Event=function(e,t){if(!(this instanceof D.Event))return new D.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Oe:Ie,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&D.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[D.expando]=!0},D.Event.prototype={constructor:D.Event,isDefaultPrevented:Ie,isPropagationStopped:Ie,isImmediatePropagationStopped:Ie,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Oe,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Oe,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Oe,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},D.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},D.event.addProp),D.each({focus:"focusin",blur:"focusout"},function(e,t){function n(e){if(_.documentMode){var n=se.get(this,"handle"),r=D.event.fix(e);r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else D.event.simulate(t,e.target,D.event.fix(e))}D.event.special[e]={setup:function(){var r;if($e(this,e,!0),!_.documentMode)return!1;(r=se.get(this,t))||this.addEventListener(t,n),se.set(this,t,(r||0)+1)},trigger:function(){return $e(this,e),!0},teardown:function(){var e;if(!_.documentMode)return!1;(e=se.get(this,t)-1)?se.set(this,t,e):(this.removeEventListener(t,n),se.remove(this,t))},_default:function(t){return se.get(t.target,e)},delegateType:t},D.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,o=se.get(i,t);o||(_.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),se.set(i,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,i=_.documentMode?this:r,o=se.get(i,t)-1;o?se.set(i,t,o):(_.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),se.remove(i,t))}}}),D.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){D.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,i=e.handleObj;return r&&(r===this||D.contains(this,r))||(e.type=i.origType,n=i.handler.apply(this,arguments),e.type=t),n}}}),D.fn.extend({on:function(e,t,n,r){return ze(this,e,t,n,r)},one:function(e,t,n,r){return ze(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,D(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ie),this.each(function(){D.event.remove(this,e,n,t)})}});var qe=/<script|<style|<link/i,Re=/checked\s*(?:[^=]|=\s*.checked.)/i,Pe=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Le(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&D(e).children("tbody")[0]||e}function Be(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ue(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Ve(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(se.hasData(e)&&(s=se.get(e).events))for(i in se.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)D.event.add(t,i,s[i][n]);le.hasData(e)&&(o=le.access(e),a=D.extend({},o),le.set(t,a))}}function He(e,t){var n=t.nodeName.toLowerCase();"input"===n&&De.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function We(e,t,n,r){t=l(t);var i,o,a,s,u,c,d=0,f=e.length,p=f-1,h=t[0],g=v(h);if(g||f>1&&"string"==typeof h&&!m.checkClone&&Re.test(h))return e.each(function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),We(o,t,n,r)});if(f&&(o=(i=Ne(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=o),o||r)){for(s=(a=D.map(Me(i,"script"),Be)).length;d<f;d++)u=i,d!==p&&(u=D.clone(u,!0,!0),s&&D.merge(a,Me(u,"script"))),n.call(e[d],u,d);if(s)for(c=a[a.length-1].ownerDocument,D.map(a,Ue),d=0;d<s;d++)u=a[d],Ae.test(u.type||"")&&!se.access(u,"globalEval")&&D.contains(c,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?D._evalUrl&&!u.noModule&&D._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},c):w(u.textContent.replace(Pe,""),u,c))}return e}function Ge(e,t,n){for(var r,i=t?D.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||D.cleanData(Me(r)),r.parentNode&&(n&&me(r)&&Te(Me(r,"script")),r.parentNode.removeChild(r));return e}D.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=me(e);if(!(m.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||D.isXMLDoc(e)))for(a=Me(s),r=0,i=(o=Me(e)).length;r<i;r++)He(o[r],a[r]);if(t)if(n)for(o=o||Me(e),a=a||Me(s),r=0,i=o.length;r<i;r++)Ve(o[r],a[r]);else Ve(e,s);return(a=Me(s,"script")).length>0&&Te(a,!l&&Me(e,"script")),s},cleanData:function(e){for(var t,n,r,i=D.event.special,o=0;void 0!==(n=e[o]);o++)if(oe(n)){if(t=n[se.expando]){if(t.events)for(r in t.events)i[r]?D.event.remove(n,r):D.removeEvent(n,r,t.handle);n[se.expando]=void 0}n[le.expando]&&(n[le.expando]=void 0)}}}),D.fn.extend({detach:function(e){return Ge(this,e,!0)},remove:function(e){return Ge(this,e)},text:function(e){return ee(this,function(e){return void 0===e?D.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return We(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return We(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return We(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return We(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(D.cleanData(Me(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return D.clone(this,e,t)})},html:function(e){return ee(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!Ee[(Se.exec(e)||["",""])[1].toLowerCase()]){e=D.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(D.cleanData(Me(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return We(this,arguments,function(t){var n=this.parentNode;D.inArray(this,e)<0&&(D.cleanData(Me(this)),n&&n.replaceChild(t,this))},e)}}),D.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){D.fn[e]=function(e){for(var n,r=[],i=D(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),D(i[a])[t](n),u.apply(r,n.get());return this.pushStack(r)}});var Ye=new RegExp("^("+fe+")(?!px)[a-z%]+$","i"),Qe=/^--/,Ke=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=r),t.getComputedStyle(e)},Ze=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Xe=new RegExp(he.join("|"),"i");function Je(e,t,n){var r,i,o,a,s=Qe.test(t),l=e.style;return(n=n||Ke(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(N,"$1")||void 0),""!==a||me(e)||(a=D.style(e,t)),!m.pixelBoxStyles()&&Ye.test(a)&&Xe.test(t)&&(r=l.width,i=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=n.width,l.width=r,l.minWidth=i,l.maxWidth=o)),void 0!==a?a+"":a}function et(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ge.appendChild(u).appendChild(c);var e=r.getComputedStyle(c);n="1%"!==e.top,l=12===t(e.marginLeft),c.style.right="60%",a=36===t(e.right),i=36===t(e.width),c.style.position="absolute",o=12===t(c.offsetWidth/3),ge.removeChild(u),c=null}}function t(e){return Math.round(parseFloat(e))}var n,i,o,a,s,l,u=_.createElement("div"),c=_.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",m.clearCloneStyle="content-box"===c.style.backgroundClip,D.extend(m,{boxSizingReliable:function(){return e(),i},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),l},scrollboxSize:function(){return e(),o},reliableTrDimensions:function(){var e,t,n,i;return null==s&&(e=_.createElement("table"),t=_.createElement("tr"),n=_.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",ge.appendChild(e).appendChild(t).appendChild(n),i=r.getComputedStyle(t),s=parseInt(i.height,10)+parseInt(i.borderTopWidth,10)+parseInt(i.borderBottomWidth,10)===t.offsetHeight,ge.removeChild(e)),s}}))}();var tt=["Webkit","Moz","ms"],nt=_.createElement("div").style,rt={};function it(e){return D.cssProps[e]||rt[e]||(e in nt?e:rt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=tt.length;n--;)if((e=tt[n]+t)in nt)return e}(e)||e)}var ot=/^(none|table(?!-c[ea]).+)/,at={position:"absolute",visibility:"hidden",display:"block"},st={letterSpacing:"0",fontWeight:"400"};function lt(e,t,n){var r=pe.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function ut(e,t,n,r,i,o){var a="width"===t?1:0,s=0,l=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=D.css(e,n+he[a],!0,i)),r?("content"===n&&(l-=D.css(e,"padding"+he[a],!0,i)),"margin"!==n&&(l-=D.css(e,"border"+he[a]+"Width",!0,i))):(l+=D.css(e,"padding"+he[a],!0,i),"padding"!==n?l+=D.css(e,"border"+he[a]+"Width",!0,i):s+=D.css(e,"border"+he[a]+"Width",!0,i));return!r&&o>=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l+u}function ct(e,t,n){var r=Ke(e),i=(!m.boxSizingReliable()||n)&&"border-box"===D.css(e,"boxSizing",!1,r),o=i,a=Je(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ye.test(a)){if(!n)return a;a="auto"}return(!m.boxSizingReliable()&&i||!m.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===D.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===D.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+ut(e,t,n||(i?"border":"content"),o,r,a)+"px"}function dt(e,t,n,r,i){return new dt.prototype.init(e,t,n,r,i)}D.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Je(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=ie(t),l=Qe.test(t),u=e.style;if(l||(t=it(s)),a=D.cssHooks[t]||D.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:u[t];"string"==(o=typeof n)&&(i=pe.exec(n))&&i[1]&&(n=_e(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(D.cssNumber[s]?"":"px")),m.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var i,o,a,s=ie(t);return Qe.test(t)||(t=it(s)),(a=D.cssHooks[t]||D.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Je(e,t,r)),"normal"===i&&t in st&&(i=st[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),D.each(["height","width"],function(e,t){D.cssHooks[t]={get:function(e,n,r){if(n)return!ot.test(D.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ct(e,t,r):Ze(e,at,function(){return ct(e,t,r)})},set:function(e,n,r){var i,o=Ke(e),a=!m.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===D.css(e,"boxSizing",!1,o),l=r?ut(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-ut(e,t,"border",!1,o)-.5)),l&&(i=pe.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=D.css(e,t)),lt(0,n,l)}}}),D.cssHooks.marginLeft=et(m.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Je(e,"marginLeft"))||e.getBoundingClientRect().left-Ze(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),D.each({margin:"",padding:"",border:"Width"},function(e,t){D.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+he[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(D.cssHooks[e+t].set=lt)}),D.fn.extend({css:function(e,t){return ee(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ke(e),i=t.length;a<i;a++)o[t[a]]=D.css(e,t[a],!1,r);return o}return void 0!==n?D.style(e,t,n):D.css(e,t)},e,t,arguments.length>1)}}),D.Tween=dt,dt.prototype={constructor:dt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||D.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(D.cssNumber[n]?"":"px")},cur:function(){var e=dt.propHooks[this.prop];return e&&e.get?e.get(this):dt.propHooks._default.get(this)},run:function(e){var t,n=dt.propHooks[this.prop];return this.options.duration?this.pos=t=D.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):dt.propHooks._default.set(this),this}},dt.prototype.init.prototype=dt.prototype,dt.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=D.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){D.fx.step[e.prop]?D.fx.step[e.prop](e):1!==e.elem.nodeType||!D.cssHooks[e.prop]&&null==e.elem.style[it(e.prop)]?e.elem[e.prop]=e.now:D.style(e.elem,e.prop,e.now+e.unit)}}},dt.propHooks.scrollTop=dt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},D.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},D.fx=dt.prototype.init,D.fx.step={};var ft,pt,ht=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;function mt(){pt&&(!1===_.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(mt):r.setTimeout(mt,D.fx.interval),D.fx.tick())}function vt(){return r.setTimeout(function(){ft=void 0}),ft=Date.now()}function yt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=he[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function _t(e,t,n){for(var r,i=(bt.tweeners[t]||[]).concat(bt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function bt(e,t,n){var r,i,o=0,a=bt.prefilters.length,s=D.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;for(var t=ft||vt(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(r);return s.notifyWith(e,[u,r,n]),r<1&&a?n:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:D.extend({},t),opts:D.extend(!0,{specialEasing:{},easing:D.easing._default},n),originalProperties:t,originalOptions:n,startTime:ft||vt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=D.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),c=u.props;for(function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=ie(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=D.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,u.opts.specialEasing);o<a;o++)if(r=bt.prefilters[o].call(u,e,c,u.opts))return v(r.stop)&&(D._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return D.map(c,_t,u),v(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),D.fx.timer(D.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u}D.Animation=D.extend(bt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return _e(n.elem,e,pe.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(G);for(var n,r=0,i=e.length;r<i;r++)n=e[r],bt.tweeners[n]=bt.tweeners[n]||[],bt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,l,u,c,d="width"in t||"height"in t,f=this,p={},h=e.style,g=e.nodeType&&ye(e),m=se.get(e,"fxshow");for(r in n.queue||(null==(a=D._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,f.always(function(){f.always(function(){a.unqueued--,D.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ht.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}p[r]=m&&m[r]||D.style(e,r)}if((l=!D.isEmptyObject(t))||!D.isEmptyObject(p))for(r in d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(u=m&&m.display)&&(u=se.get(e,"display")),"none"===(c=D.css(e,"display"))&&(u?c=u:(xe([e],!0),u=e.style.display||u,c=D.css(e,"display"),xe([e]))),("inline"===c||"inline-block"===c&&null!=u)&&"none"===D.css(e,"float")&&(l||(f.done(function(){h.display=u}),null==u&&(c=h.display,u="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",f.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),l=!1,p)l||(m?"hidden"in m&&(g=m.hidden):m=se.access(e,"fxshow",{display:u}),o&&(m.hidden=!g),g&&xe([e],!0),f.done(function(){for(r in g||xe([e]),se.remove(e,"fxshow"),p)D.style(e,r,p[r])})),l=_t(g?m[r]:0,r,f),r in m||(m[r]=l.start,g&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?bt.prefilters.unshift(e):bt.prefilters.push(e)}}),D.speed=function(e,t,n){var r=e&&"object"==typeof e?D.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return D.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in D.fx.speeds?r.duration=D.fx.speeds[r.duration]:r.duration=D.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&D.dequeue(this,r.queue)},r},D.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ye).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=D.isEmptyObject(e),o=D.speed(t,n,r),a=function(){var t=bt(this,D.extend({},e),o);(i||se.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=D.timers,a=se.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&gt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||D.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=se.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=D.timers,a=r?r.length:0;for(n.finish=!0,D.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),D.each(["toggle","show","hide"],function(e,t){var n=D.fn[t];D.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(yt(t,!0),e,r,i)}}),D.each({slideDown:yt("show"),slideUp:yt("hide"),slideToggle:yt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){D.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),D.timers=[],D.fx.tick=function(){var e,t=0,n=D.timers;for(ft=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||D.fx.stop(),ft=void 0},D.fx.timer=function(e){D.timers.push(e),D.fx.start()},D.fx.interval=13,D.fx.start=function(){pt||(pt=!0,mt())},D.fx.stop=function(){pt=null},D.fx.speeds={slow:600,fast:200,_default:400},D.fn.delay=function(e,t){return e=D.fx&&D.fx.speeds[e]||e,t=t||"fx",this.queue(t,function(t,n){var i=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(i)}})},function(){var e=_.createElement("input"),t=_.createElement("select").appendChild(_.createElement("option"));e.type="checkbox",m.checkOn=""!==e.value,m.optSelected=t.selected,(e=_.createElement("input")).value="t",e.type="radio",m.radioValue="t"===e.value}();var wt,xt=D.expr.attrHandle;D.fn.extend({attr:function(e,t){return ee(this,D.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){D.removeAttr(this,e)})}}),D.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?D.prop(e,t,n):(1===o&&D.isXMLDoc(e)||(i=D.attrHooks[t.toLowerCase()]||(D.expr.match.bool.test(t)?wt:void 0)),void 0!==n?null===n?void D.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=D.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!m.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(G);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),wt={set:function(e,t,n){return!1===t?D.removeAttr(e,n):e.setAttribute(n,n),n}},D.each(D.expr.match.bool.source.match(/\w+/g),function(e,t){var n=xt[t]||D.find.attr;xt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=xt[a],xt[a]=i,i=null!=n(e,t,r)?a:null,xt[a]=o),i}});var kt=/^(?:input|select|textarea|button)$/i,Ct=/^(?:a|area)$/i;function Dt(e){return(e.match(G)||[]).join(" ")}function St(e){return e.getAttribute&&e.getAttribute("class")||""}function At(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(G)||[]}D.fn.extend({prop:function(e,t){return ee(this,D.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[D.propFix[e]||e]})}}),D.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&D.isXMLDoc(e)||(t=D.propFix[t]||t,i=D.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=D.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||Ct.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(D.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),D.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){D.propFix[this.toLowerCase()]=this}),D.fn.extend({addClass:function(e){var t,n,r,i,o,a;return v(e)?this.each(function(t){D(this).addClass(e.call(this,t,St(this)))}):(t=At(e)).length?this.each(function(){if(r=St(this),n=1===this.nodeType&&" "+Dt(r)+" "){for(o=0;o<t.length;o++)i=t[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Dt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(e){var t,n,r,i,o,a;return v(e)?this.each(function(t){D(this).removeClass(e.call(this,t,St(this)))}):arguments.length?(t=At(e)).length?this.each(function(){if(r=St(this),n=1===this.nodeType&&" "+Dt(r)+" "){for(o=0;o<t.length;o++)for(i=t[o];n.indexOf(" "+i+" ")>-1;)n=n.replace(" "+i+" "," ");a=Dt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=typeof e,s="string"===a||Array.isArray(e);return v(e)?this.each(function(n){D(this).toggleClass(e.call(this,n,St(this),t),t)}):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=At(e),this.each(function(){if(s)for(o=D(this),i=0;i<n.length;i++)r=n[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==e&&"boolean"!==a||((r=St(this))&&se.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":se.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Dt(St(n))+" ").indexOf(t)>-1)return!0;return!1}});var Et=/\r/g;D.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=v(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,D(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=D.map(i,function(e){return null==e?"":e+""})),(t=D.valHooks[this.type]||D.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=D.valHooks[i.type]||D.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Et,""):null==n?"":n:void 0}}),D.extend({valHooks:{option:{get:function(e){var t=D.find.attr(e,"value");return null!=t?t:Dt(D.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r<l;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=D(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=D.makeArray(t),a=i.length;a--;)((r=i[a]).selected=D.inArray(D.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),D.each(["radio","checkbox"],function(){D.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=D.inArray(D(e).val(),t)>-1}},m.checkOn||(D.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Mt=r.location,Tt={guid:Date.now()},jt=/\?/;D.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||D.error("Invalid XML: "+(n?D.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Nt=/^(?:focusinfocus|focusoutblur)$/,Ft=function(e){e.stopPropagation()};D.extend(D.event,{trigger:function(e,t,n,i){var o,a,s,l,u,c,d,f,h=[n||_],g=p.call(e,"type")?e.type:e,m=p.call(e,"namespace")?e.namespace.split("."):[];if(a=f=s=n=n||_,3!==n.nodeType&&8!==n.nodeType&&!Nt.test(g+D.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(e=e[D.expando]?e:new D.Event(g,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=m.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:D.makeArray(t,[e]),d=D.event.special[g]||{},i||!d.trigger||!1!==d.trigger.apply(n,t))){if(!i&&!d.noBubble&&!y(n)){for(l=d.delegateType||g,Nt.test(l+g)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(n.ownerDocument||_)&&h.push(s.defaultView||s.parentWindow||r)}for(o=0;(a=h[o++])&&!e.isPropagationStopped();)f=a,e.type=o>1?l:d.bindType||g,(c=(se.get(a,"events")||Object.create(null))[e.type]&&se.get(a,"handle"))&&c.apply(a,t),(c=u&&a[u])&&c.apply&&oe(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=g,i||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(h.pop(),t)||!oe(n)||u&&v(n[g])&&!y(n)&&((s=n[u])&&(n[u]=null),D.event.triggered=g,e.isPropagationStopped()&&f.addEventListener(g,Ft),n[g](),e.isPropagationStopped()&&f.removeEventListener(g,Ft),D.event.triggered=void 0,s&&(n[u]=s)),e.result}},simulate:function(e,t,n){var r=D.extend(new D.Event,n,{type:e,isSimulated:!0});D.event.trigger(r,null,t)}}),D.fn.extend({trigger:function(e,t){return this.each(function(){D.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return D.event.trigger(e,t,n,!0)}});var Ot=/\[\]$/,It=/\r?\n/g,zt=/^(?:submit|button|image|reset|file)$/i,$t=/^(?:input|select|textarea|keygen)/i;function qt(e,t,n,r){var i;if(Array.isArray(t))D.each(t,function(t,i){n||Ot.test(e)?r(e,i):qt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)qt(e+"["+i+"]",t[i],n,r)}D.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!D.isPlainObject(e))D.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},D.fn.extend({serialize:function(){return D.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=D.prop(this,"elements");return e?D.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!D(this).is(":disabled")&&$t.test(this.nodeName)&&!zt.test(e)&&(this.checked||!De.test(e))}).map(function(e,t){var n=D(this).val();return null==n?null:Array.isArray(n)?D.map(n,function(e){return{name:t.name,value:e.replace(It,"\r\n")}}):{name:t.name,value:n.replace(It,"\r\n")}}).get()}});var Rt=/%20/g,Pt=/#.*$/,Lt=/([?&])_=[^&]*/,Bt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ut=/^(?:GET|HEAD)$/,Vt=/^\/\//,Ht={},Wt={},Gt="*/".concat("*"),Yt=_.createElement("a");function Qt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(G)||[];if(v(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Kt(e,t,n,r){var i={},o=e===Wt;function a(s){var l;return i[s]=!0,D.each(e[s]||[],function(e,s){var u=s(t,n,r);return"string"!=typeof u||o||i[u]?o?!(l=u):void 0:(t.dataTypes.unshift(u),a(u),!1)}),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Zt(e,t){var n,r,i=D.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&D.extend(!0,e,r),e}Yt.href=Mt.href,D.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Mt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Mt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Gt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":D.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Zt(Zt(e,D.ajaxSettings),t):Zt(D.ajaxSettings,e)},ajaxPrefilter:Qt(Ht),ajaxTransport:Qt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,a,s,l,u,c,d,f,p=D.ajaxSetup({},t),h=p.context||p,g=p.context&&(h.nodeType||h.jquery)?D(h):D.event,m=D.Deferred(),v=D.Callbacks("once memory"),y=p.statusCode||{},b={},w={},x="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Bt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(e,t){return null==u&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==u&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||x;return n&&n.abort(t),C(0,t),this}};if(m.promise(k),p.url=((e||p.url||Mt.href)+"").replace(Vt,Mt.protocol+"//"),p.type=t.method||t.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(G)||[""],null==p.crossDomain){l=_.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Yt.protocol+"//"+Yt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=D.param(p.data,p.traditional)),Kt(Ht,p,t,k),u)return k;for(d in(c=D.event&&p.global)&&0===D.active++&&D.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ut.test(p.type),i=p.url.replace(Pt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Rt,"+")):(f=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(jt.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Lt,"$1"),f=(jt.test(i)?"&":"?")+"_="+Tt.guid+++f),p.url=i+f),p.ifModified&&(D.lastModified[i]&&k.setRequestHeader("If-Modified-Since",D.lastModified[i]),D.etag[i]&&k.setRequestHeader("If-None-Match",D.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||t.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Gt+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(!1===p.beforeSend.call(h,k,p)||u))return k.abort();if(x="abort",v.add(p.complete),k.done(p.success),k.fail(p.error),n=Kt(Wt,p,t,k)){if(k.readyState=1,c&&g.trigger("ajaxSend",[k,p]),u)return k;p.async&&p.timeout>0&&(s=r.setTimeout(function(){k.abort("timeout")},p.timeout));try{u=!1,n.send(b,C)}catch(e){if(u)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,a,l){var d,f,_,b,w,x=t;u||(u=!0,s&&r.clearTimeout(s),n=void 0,o=l||"",k.readyState=e>0?4:0,d=e>=200&&e<300||304===e,a&&(b=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,k,a)),!d&&D.inArray("script",p.dataTypes)>-1&&D.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(i in u)if((s=i.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[i]:!0!==u[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(p,b,k,d),d?(p.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(D.lastModified[i]=w),(w=k.getResponseHeader("etag"))&&(D.etag[i]=w)),204===e||"HEAD"===p.type?x="nocontent":304===e?x="notmodified":(x=b.state,f=b.data,d=!(_=b.error))):(_=x,!e&&x||(x="error",e<0&&(e=0))),k.status=e,k.statusText=(t||x)+"",d?m.resolveWith(h,[f,x,k]):m.rejectWith(h,[k,x,_]),k.statusCode(y),y=void 0,c&&g.trigger(d?"ajaxSuccess":"ajaxError",[k,p,d?f:_]),v.fireWith(h,[k,x]),c&&(g.trigger("ajaxComplete",[k,p]),--D.active||D.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return D.get(e,t,n,"json")},getScript:function(e,t){return D.get(e,void 0,t,"script")}}),D.each(["get","post"],function(e,t){D[t]=function(e,n,r,i){return v(n)&&(i=i||r,r=n,n=void 0),D.ajax(D.extend({url:e,type:t,dataType:i,data:n,success:r},D.isPlainObject(e)&&e))}}),D.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),D._evalUrl=function(e,t,n){return D.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){D.globalEval(e,t,n)}})},D.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=D(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return v(e)?this.each(function(t){D(this).wrapInner(e.call(this,t))}):this.each(function(){var t=D(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v(e);return this.each(function(n){D(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){D(this).replaceWith(this.childNodes)}),this}}),D.expr.pseudos.hidden=function(e){return!D.expr.pseudos.visible(e)},D.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},D.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Xt={0:200,1223:204},Jt=D.ajaxSettings.xhr();m.cors=!!Jt&&"withCredentials"in Jt,m.ajax=Jt=!!Jt,D.ajaxTransport(function(e){var t,n;if(m.cors||Jt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Xt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout(function(){t&&n()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),D.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),D.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 D.globalEval(e),e}}}),D.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),D.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=D("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),_.head.appendChild(t[0])},abort:function(){n&&n()}}});var en,tn=[],nn=/(=)\?(?=&|$)|\?\?/;D.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=tn.pop()||D.expando+"_"+Tt.guid++;return this[e]=!0,e}}),D.ajaxPrefilter("json jsonp",function(e,t,n){var i,o,a,s=!1!==e.jsonp&&(nn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&nn.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(nn,"$1"+i):!1!==e.jsonp&&(e.url+=(jt.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||D.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=r[i],r[i]=function(){a=arguments},n.always(function(){void 0===o?D(r).removeProp(i):r[i]=o,e[i]&&(e.jsonpCallback=t.jsonpCallback,tn.push(i)),a&&v(o)&&o(a[0]),a=o=void 0}),"script"}),m.createHTMLDocument=((en=_.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===en.childNodes.length),D.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(m.createHTMLDocument?((r=(t=_.implementation.createHTMLDocument("")).createElement("base")).href=_.location.href,t.head.appendChild(r)):t=_),o=!n&&[],(i=P.exec(e))?[t.createElement(i[1])]:(i=Ne([e],t,o),o&&o.length&&D(o).remove(),D.merge([],i.childNodes)));var r,i,o},D.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=Dt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&D.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?D("<div>").append(D.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},D.expr.pseudos.animated=function(e){return D.grep(D.timers,function(t){return e===t.elem}).length},D.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u=D.css(e,"position"),c=D(e),d={};"static"===u&&(e.style.position="relative"),s=c.offset(),o=D.css(e,"top"),l=D.css(e,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),v(t)&&(t=t.call(e,n,D.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):c.css(d)}},D.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){D.offset.setOffset(this,e,t)});var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===D.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===D.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=D(e).offset()).top+=D.css(e,"borderTopWidth",!0),i.left+=D.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-D.css(r,"marginTop",!0),left:t.left-i.left-D.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===D.css(e,"position");)e=e.offsetParent;return e||ge})}}),D.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;D.fn[e]=function(r){return ee(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),D.each(["top","left"],function(e,t){D.cssHooks[t]=et(m.pixelPosition,function(e,n){if(n)return n=Je(e,t),Ye.test(n)?D(e).position()[t]+"px":n})}),D.each({Height:"height",Width:"width"},function(e,t){D.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){D.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return ee(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]: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?D.css(t,n,s):D.style(t,n,i,s)},t,a?i:void 0,a)}})}),D.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){D.fn[t]=function(e){return this.on(t,e)}}),D.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,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),D.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){D.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var rn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;D.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=s.call(arguments,2),i=function(){return e.apply(t||this,r.concat(s.call(arguments)))},i.guid=e.guid=e.guid||D.guid++,i},D.holdReady=function(e){e?D.readyWait++:D.ready(!0)},D.isArray=Array.isArray,D.parseJSON=JSON.parse,D.nodeName=A,D.isFunction=v,D.isWindow=y,D.camelCase=ie,D.type=x,D.now=Date.now,D.isNumeric=function(e){var t=D.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},D.trim=function(e){return null==e?"":(e+"").replace(rn,"$1")},void 0===(n=function(){return D}.apply(t,[]))||(e.exports=n);var on=r.jQuery,an=r.$;return D.noConflict=function(e){return r.$===D&&(r.$=an),e&&r.jQuery===D&&(r.jQuery=on),D},void 0===i&&(r.jQuery=r.$=D),D})},4417:function(e,t,n){e.exports=n(2217)},2217:function(e,t,n){"use strict";var r=n(8319);r.default;var i=n(2888);i.default;var o=n(707);o.default;var a=n(9017);a.default;var s=n(6293);s.default;var l=n(68);l.default;var u=n(6433);u.default;var c=n(5202);c.default;var d=n(5896);d.default;var f=n(9102);f.default;var p=n(5745);p.default;var h=n(7658);h.default;var g=n(6509);g.default;var m=n(9278);m.default;var v=n(4703);v.default;var y={toCamelCase:r.default,toSnakeCase:i.default,toPascalCase:o.default,toDotCase:a.default,toPathCase:s.default,toTextCase:l.default,toSentenceCase:u.default,toHeaderCase:c.default,toKebabCase:d.default,toUpperCase:function(e){return String(e||"").toUpperCase()},toLowerCase:function(e){return String(e||"").toLowerCase()},lowerKeys:f.default,upperKeys:p.default,camelKeys:h.default,snakeKeys:g.default,pascalKeys:m.default,kebabKeys:v.default};t.default=y},7658:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(8319);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},4703:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(5896);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},9102:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var o={};return Object.keys(t).forEach(function(a){var s=t[a],l=a.toLowerCase();n.recursive&&(i.isValidObject(s)?i.belongToTypes(s,n.keepTypesOnRecursion)||(s=e(s,n)):n.recursiveInArray&&i.isArrayObject(s)&&(s=r(s).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),o[l]=s}),o}},9278:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(707);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},6509:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920),o=n(2888);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var a={};return Object.keys(t).forEach(function(s){var l=t[s],u=o.default(s);n.recursive&&(i.isValidObject(l)?i.belongToTypes(l,n.keepTypesOnRecursion)||(l=e(l,n)):n.recursiveInArray&&i.isArrayObject(l)&&(l=r(l).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),a[u]=l}),a}},5745:function(e,t,n){"use strict";var r=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r};Object.defineProperty(t,"__esModule",{value:!0});var i=n(5920);t.default=function e(t,n){if(void 0===n&&(n=i.DefaultOption),!i.isValidObject(t))return null;n=i.validateOptions(n);var o={};return Object.keys(t).forEach(function(a){var s=t[a],l=a.toUpperCase();n.recursive&&(i.isValidObject(s)?i.belongToTypes(s,n.keepTypesOnRecursion)||(s=e(s,n)):n.recursiveInArray&&i.isArrayObject(s)&&(s=r(s).map(function(t){var r=t;return i.isValidObject(t)?i.belongToTypes(r,n.keepTypesOnRecursion)||(r=e(t,n)):i.isArrayObject(t)&&(r=e({key:t},n).key),r}))),o[l]=s}),o}},5920:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.belongToTypes=t.isValidObject=t.isArrayObject=t.validateOptions=t.DefaultOption=void 0,t.DefaultOption={recursive:!1,recursiveInArray:!1,keepTypesOnRecursion:[]},t.validateOptions=function(e){return void 0===e&&(e=t.DefaultOption),null==e.recursive?e=t.DefaultOption:null==e.recursiveInArray&&(e.recursiveInArray=!1),e},t.isArrayObject=function(e){return null!=e&&Array.isArray(e)},t.isValidObject=function(e){return null!=e&&"object"==typeof e&&!Array.isArray(e)},t.belongToTypes=function(e,t){return(t||[]).some(function(t){return e instanceof t})}},8319:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"$"+n}).toLowerCase().replace(/(\$)(\w)/g,function(e,t,n){return n.toUpperCase()}):""}},9017:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,".").toLowerCase():""}},5202:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase().replace(/( ?)(\w+)( ?)/g,function(e,t,n,r){return t+n.charAt(0).toUpperCase()+n.slice(1)+r}):""}},5896:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"-").toLowerCase():""}},707:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"$").replace(/[^A-Za-z0-9]+/g,"$").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"$"+n}).toLowerCase().replace(/(\$)(\w?)/g,function(e,t,n){return n.toUpperCase()}):""}},6293:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"/").toLowerCase():""}},6433:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(void 0===e&&(e=""),!e)return"";var t=String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}},2888:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g,"_").toLowerCase():""}},68:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return void 0===e&&(e=""),e?String(e).replace(/^[^A-Za-z0-9]*|[^A-Za-z0-9]*$/g,"").replace(/([a-z])([A-Z])/g,function(e,t,n){return t+"_"+n.toLowerCase()}).replace(/[^A-Za-z0-9]+|_+/g," ").toLowerCase():""}},6107:function(e,t,n){"use strict";n.r(t),n.d(t,{jsPanel:function(){return r}});let r={version:"4.16.1",date:"2022-11-03 09:18",ajaxAlwaysCallbacks:[],autopositionSpacing:4,closeOnEscape:void document.addEventListener("keydown",e=>{"Escape"!==e.key&&"Escape"!==e.code&&"Esc"!==e.key||r.getPanels(e=>e.classList.contains("jsPanel")).some(e=>!!e.options.closeOnEscape&&("function"==typeof e.options.closeOnEscape?e.options.closeOnEscape.call(e,e):(e.close(null,!0),!0)))},!1),defaults:{boxShadow:3,container:"window",contentSize:{width:"400px",height:"200px"},dragit:{cursor:"move",handles:".jsPanel-headerlogo, .jsPanel-titlebar, .jsPanel-ftr",opacity:.8,disableOnMaximized:!0},header:!0,headerTitle:"jsPanel",headerControls:{size:"md"},iconfont:void 0,maximizedMargin:0,minimizeTo:"default",paneltype:"standard",position:{my:"center",at:"center"},resizeit:{handles:"n, e, s, w, ne, se, sw, nw",minWidth:128,minHeight:38},theme:"default"},defaultAutocloseConfig:{time:"8s",progressbar:!0},defaultSnapConfig:{sensitivity:70,trigger:"panel",active:"both"},extensions:{},globalCallbacks:!1,icons:{close:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M13.7,11l6.1-6.1c0.4-0.4,0.4-0.9,0-1.3l-1.4-1.4c-0.4-0.4-0.9-0.4-1.3,0L11,8.3L4.9,2.3C4.6,1.9,4,1.9,3.7,2.3L2.3,3.7 C1.9,4,1.9,4.6,2.3,4.9L8.3,11l-6.1,6.1c-0.4,0.4-0.4,0.9,0,1.3l1.4,1.4c0.4,0.4,0.9,0.4,1.3,0l6.1-6.1l6.1,6.1 c0.4,0.4,0.9,0.4,1.3,0l1.4-1.4c0.4-0.4,0.4-0.9,0-1.3L13.7,11z"/></svg>',maximize:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M18.3,2H3.7C2.8,2,2,2.9,2,3.9v14.1C2,19.1,2.8,20,3.7,20h14.6c0.9,0,1.7-0.9,1.7-1.9V3.9C20,2.9,19.2,2,18.3,2z M18.3,17.8 c0,0.1-0.1,0.2-0.2,0.2H3.9c-0.1,0-0.2-0.1-0.2-0.2V8.4h14.6V17.8z"/></svg>',normalize:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M18.3,2H7.1C6.1,2,5.4,2.8,5.4,3.7v1.7H3.7C2.8,5.4,2,6.1,2,7.1v11.3C2,19.2,2.8,20,3.7,20h11.3c0.9,0,1.7-0.8,1.7-1.7v-1.7 h1.7c0.9,0,1.7-0.8,1.7-1.7V3.7C20,2.8,19.2,2,18.3,2z M14.9,18.3H3.7V11h11.3V18.3z M18.3,14.9h-1.7V7.1c0-0.9-0.8-1.7-1.7-1.7H7.1 V3.7h11.3V14.9z"/></svg>',minimize:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M18.9,19.8H3.1c-0.6,0-1.1-0.5-1.1-1.1s0.5-1.1,1.1-1.1h15.8c0.6,0,1.1,0.5,1.1,1.1S19.5,19.8,18.9,19.8z"/></svg>',smallify:'<svg focusable="false" class="jsPanel-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path fill="currentColor" d="M2.1,15.2L2.9,16c0.2,0.2,0.5,0.2,0.7,0L11,8.7l7.4,7.3c0.2,0.2,0.5,0.2,0.7,0l0.8-0.8c0.2-0.2,0.2-0.5,0-0.7L11.3,6 c-0.2-0.2-0.5-0.2-0.7,0l-8.5,8.5C2,14.7,2,15,2.1,15.2z"/></svg>'},idCounter:0,isIE:document.documentMode||!1,pointerdown:"onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],pointermove:"onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],pointerup:"onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"],polyfills:(Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");let t=Object(e);for(let e=1;e<arguments.length;e++){let n=arguments[e];if(null==n)continue;n=Object(n);let r=Object.keys(Object(n));for(let e=0,i=r.length;e<i;e++){let i=r[e],o=Object.getOwnPropertyDescriptor(n,i);void 0!==o&&o.enumerable&&(t[i]=n[i])}}return t}}),Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}),window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=function(e,t){t=t||window;for(let n=0;n<this.length;n++)e.call(t,this[n],n,this)}),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach(function(e){e.append=e.append||function(){let e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach(function(e){let n=e instanceof Node;t.appendChild(n?e:document.createTextNode(String(e)))}),this.appendChild(t)}}),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){let t,n=(this.document||this.ownerDocument).querySelectorAll(e),r=this;do{for(t=n.length;--t>=0&&n.item(t)!==r;);}while(t<0&&(r=r.parentElement));return r}),function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};let n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),String.prototype.endsWith||(String.prototype.endsWith=function(e,t){return(void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(e,t){var n=t>0?0|t:0;return this.substring(n,n+e.length)===e}}),String.prototype.includes||(String.prototype.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)}),String.prototype.repeat||(String.prototype.repeat=function(e){if(null==this)throw new TypeError("can't convert "+this+" to object");var t=""+this;if((e=+e)!=e&&(e=0),e<0)throw new RangeError("repeat count must be non-negative");if(e==1/0)throw new RangeError("repeat count must be less than infinity");if(e=Math.floor(e),0==t.length||0==e)return"";if(t.length*e>=1<<28)throw new RangeError("repeat count must not overflow maximum string size");var n=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,n-t.length)}),Number.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},void(Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(null==this)throw new TypeError('"this" is null or not defined');let n=Object(this),r=n.length>>>0;if(0===r)return!1;let i=0|t,o=Math.max(i>=0?i:r-Math.abs(i),0);for(;o<r;){if((a=n[o])===(s=e)||"number"==typeof a&&"number"==typeof s&&isNaN(a)&&isNaN(s))return!0;o++}var a,s;return!1}}))),ziBase:100,colorFilledLight:.81,colorFilledDark:.08,colorFilled:0,colorBrightnessThreshold:.55,colorNames:{default:"b0bec5",secondary:"b0bec5",primary:"01579b",info:"039be5",success:"2e7d32",warning:"f57f17",danger:"dd2c00",light:"e0e0e0",dark:"263238",aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightslategrey:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",grey50:"fafafa",grey100:"f5f5f5",grey200:"eeeeee",grey300:"e0e0e0",grey400:"bdbdbd",grey500:"9e9e9e",grey600:"757575",grey700:"616161",grey800:"424242",grey900:"212121",gray50:"fafafa",gray100:"f5f5f5",gray200:"eeeeee",gray300:"e0e0e0",gray400:"bdbdbd",gray500:"9e9e9e",gray600:"757575",gray700:"616161",gray800:"424242",gray900:"212121",bluegrey50:"eceff1",bluegrey100:"CFD8DC",bluegrey200:"B0BEC5",bluegrey300:"90A4AE",bluegrey400:"78909C",bluegrey500:"607D8B",bluegrey600:"546E7A",bluegrey700:"455A64",bluegrey800:"37474F",bluegrey900:"263238",bluegray50:"eceff1",bluegray100:"CFD8DC",bluegray200:"B0BEC5",bluegray300:"90A4AE",bluegray400:"78909C",bluegray500:"607D8B",bluegray600:"546E7A",bluegray700:"455A64",bluegray800:"37474F",bluegray900:"263238",red50:"FFEBEE",red100:"FFCDD2",red200:"EF9A9A",red300:"E57373",red400:"EF5350",red500:"F44336",red600:"E53935",red700:"D32F2F",red800:"C62828",red900:"B71C1C",reda100:"FF8A80",reda200:"FF5252",reda400:"FF1744",reda700:"D50000",pink50:"FCE4EC",pink100:"F8BBD0",pink200:"F48FB1",pink300:"F06292",pink400:"EC407A",pink500:"E91E63",pink600:"D81B60",pink700:"C2185B",pink800:"AD1457",pink900:"880E4F",pinka100:"FF80AB",pinka200:"FF4081",pinka400:"F50057",pinka700:"C51162",purple50:"F3E5F5",purple100:"E1BEE7",purple200:"CE93D8",purple300:"BA68C8",purple400:"AB47BC",purple500:"9C27B0",purple600:"8E24AA",purple700:"7B1FA2",purple800:"6A1B9A",purple900:"4A148C",purplea100:"EA80FC",purplea200:"E040FB",purplea400:"D500F9",purplea700:"AA00FF",deeppurple50:"EDE7F6",deeppurple100:"D1C4E9",deeppurple200:"B39DDB",deeppurple300:"9575CD",deeppurple400:"7E57C2",deeppurple500:"673AB7",deeppurple600:"5E35B1",deeppurple700:"512DA8",deeppurple800:"4527A0",deeppurple900:"311B92",deeppurplea100:"B388FF",deeppurplea200:"7C4DFF",deeppurplea400:"651FFF",deeppurplea700:"6200EA",indigo50:"E8EAF6",indigo100:"C5CAE9",indigo200:"9FA8DA",indigo300:"7986CB",indigo400:"5C6BC0",indigo500:"3F51B5",indigo600:"3949AB",indigo700:"303F9F",indigo800:"283593",indigo900:"1A237E",indigoa100:"8C9EFF",indigoa200:"536DFE",indigoa400:"3D5AFE",indigoa700:"304FFE",blue50:"E3F2FD",blue100:"BBDEFB",blue200:"90CAF9",blue300:"64B5F6",blue400:"42A5F5",blue500:"2196F3",blue600:"1E88E5",blue700:"1976D2",blue800:"1565C0",blue900:"0D47A1",bluea100:"82B1FF",bluea200:"448AFF",bluea400:"2979FF",bluea700:"2962FF",lightblue50:"E1F5FE",lightblue100:"B3E5FC",lightblue200:"81D4FA",lightblue300:"4FC3F7",lightblue400:"29B6F6",lightblue500:"03A9F4",lightblue600:"039BE5",lightblue700:"0288D1",lightblue800:"0277BD",lightblue900:"01579B",lightbluea100:"80D8FF",lightbluea200:"40C4FF",lightbluea400:"00B0FF",lightbluea700:"0091EA",cyan50:"E0F7FA",cyan100:"B2EBF2",cyan200:"80DEEA",cyan300:"4DD0E1",cyan400:"26C6DA",cyan500:"00BCD4",cyan600:"00ACC1",cyan700:"0097A7",cyan800:"00838F",cyan900:"006064",cyana100:"84FFFF",cyana200:"18FFFF",cyana400:"00E5FF",cyana700:"00B8D4",teal50:"E0F2F1",teal100:"B2DFDB",teal200:"80CBC4",teal300:"4DB6AC",teal400:"26A69A",teal500:"009688",teal600:"00897B",teal700:"00796B",teal800:"00695C",teal900:"004D40",teala100:"A7FFEB",teala200:"64FFDA",teala400:"1DE9B6",teala700:"00BFA5",green50:"E8F5E9",green100:"C8E6C9",green200:"A5D6A7",green300:"81C784",green400:"66BB6A",green500:"4CAF50",green600:"43A047",green700:"388E3C",green800:"2E7D32",green900:"1B5E20",greena100:"B9F6CA",greena200:"69F0AE",greena400:"00E676",greena700:"00C853",lightgreen50:"F1F8E9",lightgreen100:"DCEDC8",lightgreen200:"C5E1A5",lightgreen300:"AED581",lightgreen400:"9CCC65",lightgreen500:"8BC34A",lightgreen600:"7CB342",lightgreen700:"689F38",lightgreen800:"558B2F",lightgreen900:"33691E",lightgreena100:"CCFF90",lightgreena200:"B2FF59",lightgreena400:"76FF03",lightgreena700:"64DD17",lime50:"F9FBE7",lime100:"F0F4C3",lime200:"E6EE9C",lime300:"DCE775",lime400:"D4E157",lime500:"CDDC39",lime600:"C0CA33",lime700:"AFB42B",lime800:"9E9D24",lime900:"827717",limea100:"F4FF81",limea200:"EEFF41",limea400:"C6FF00",limea700:"AEEA00",yellow50:"FFFDE7",yellow100:"FFF9C4",yellow200:"FFF59D",yellow300:"FFF176",yellow400:"FFEE58",yellow500:"FFEB3B",yellow600:"FDD835",yellow700:"FBC02D",yellow800:"F9A825",yellow900:"F57F17",yellowa100:"FFFF8D",yellowa200:"FFFF00",yellowa400:"FFEA00",yellowa700:"FFD600",amber50:"FFF8E1",amber100:"FFECB3",amber200:"FFE082",amber300:"FFD54F",amber400:"FFCA28",amber500:"FFC107",amber600:"FFB300",amber700:"FFA000",amber800:"FF8F00",amber900:"FF6F00",ambera100:"FFE57F",ambera200:"FFD740",ambera400:"FFC400",ambera700:"FFAB00",orange50:"FFF3E0",orange100:"FFE0B2",orange200:"FFCC80",orange300:"FFB74D",orange400:"FFA726",orange500:"FF9800",orange600:"FB8C00",orange700:"F57C00",orange800:"EF6C00",orange900:"E65100",orangea100:"FFD180",orangea200:"FFAB40",orangea400:"FF9100",orangea700:"FF6D00",deeporange50:"FBE9E7",deeporange100:"FFCCBC",deeporange200:"FFAB91",deeporange300:"FF8A65",deeporange400:"FF7043",deeporange500:"FF5722",deeporange600:"F4511E",deeporange700:"E64A19",deeporange800:"D84315",deeporange900:"BF360C",deeporangea100:"FF9E80",deeporangea200:"FF6E40",deeporangea400:"FF3D00",deeporangea700:"DD2C00",brown50:"EFEBE9",brown100:"D7CCC8",brown200:"BCAAA4",brown300:"A1887F",brown400:"8D6E63",brown500:"795548",brown600:"6D4C41",brown700:"5D4037",brown800:"4E342E",brown900:"3E2723","mdb-default":"2BBBAD","mdb-default-dark":"00695c","mdb-primary":"4285F4","mdb-primary-dark":"0d47a1","mdb-secondary":"aa66cc","mdb-secondary-dark":"9933CC","mdb-danger":"ff4444","mdb-danger-dark":"CC0000","mdb-warning":"ffbb33","mdb-warning-dark":"FF8800","mdb-success":"00C851","mdb-success-dark":"007E33","mdb-info":"33b5e5","mdb-info-dark":"0099CC","mdb-elegant":"2E2E2E","mdb-elegant-dark":"212121","mdb-stylish":"4B515D","mdb-stylish-dark":"3E4551","mdb-unique":"3F729B","mdb-unique-dark":"1C2331","mdb-special":"37474F","mdb-special-dark":"263238"},errorReporting:1,modifier:!1,helper:(document.addEventListener("keydown",e=>r.modifier=e),void document.addEventListener("keyup",()=>r.modifier=!1)),usePointerEvents(e=!0){e?(this.pointerdown="onpointerdown"in window?["pointerdown"]:"ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="onpointermove"in window?["pointermove"]:"ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="onpointerup"in window?["pointerup"]:"ontouchend"in window?["touchend","mouseup"]:["mouseup"]):(this.pointerdown="ontouchend"in window?["touchstart","mousedown"]:["mousedown"],this.pointermove="ontouchend"in window?["touchmove","mousemove"]:["mousemove"],this.pointerup="ontouchend"in window?["touchend","mouseup"]:["mouseup"])},pOcontainer(e){if("window"===e)return document.body;if("string"==typeof e){let t=document.querySelectorAll(e);return!!(t.length&&t.length>0)&&t}return 1===e.nodeType?e:!!e.length&&e[0]},pOcontainment(e){let t=e;if("function"==typeof e&&(t=e()),"number"==typeof t)return[t,t,t,t];if(Array.isArray(t)){if(1===t.length)return[t[0],t[0],t[0],t[0]];if(2===t.length)return t.concat(t);3===t.length&&(t[3]=t[1])}return t},pOsize(e,t){let n=t||this.defaults.contentSize;const r=e.parentElement;if("string"==typeof n){const e=n.trim().split(" ");(n={}).width=e[0],2===e.length?n.height=e[1]:n.height=e[0]}else n.width&&!n.height?n.height=n.width:n.height&&!n.width&&(n.width=n.height);if(String(n.width).match(/^[\d.]+$/gi))n.width+="px";else if("string"==typeof n.width&&n.width.endsWith("%"))if(r===document.body)n.width=window.innerWidth*(parseFloat(n.width)/100)+"px";else{const e=window.getComputedStyle(r),t=parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth);n.width=(parseFloat(e.width)-t)*(parseFloat(n.width)/100)+"px"}else"function"==typeof n.width&&(n.width=n.width.call(e,e),("number"==typeof n.width||"string"==typeof n.width&&n.width.match(/^[\d.]+$/gi))&&(n.width+="px"));if(String(n.height).match(/^[\d.]+$/gi))n.height+="px";else if("string"==typeof n.height&&n.height.endsWith("%"))if(r===document.body)n.height=window.innerHeight*(parseFloat(n.height)/100)+"px";else{const e=window.getComputedStyle(r),t=parseFloat(e.borderTopWidth)+parseFloat(e.borderBottomWidth);n.height=(parseFloat(e.height)-t)*(parseFloat(n.height)/100)+"px"}else"function"==typeof n.height&&(n.height=n.height.call(e,e),("number"==typeof n.height||"string"==typeof n.height&&n.height.match(/^[\d.]+$/gi))&&(n.height+="px"));return n},pOborder(e){let t=[],n=e.trim().replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," ").split(" ");return n.forEach((e,t)=>{(e.startsWith("--")||e.startsWith("var"))&&(n[t]=r.getCssVariableValue(e))}),n.forEach(e=>{r.colorNames[e]?t[2]="#"+r.colorNames[e]:e.match(/(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)/)?t[1]=e:e.match(/(thin|medium|thick)|(\d*\.?\d*(cap|ch|em|ex|ic|lh|rem|rlh|vh|vw|vmax|vmin|vb|vi|px|cm|mm|Q|in|pc|pt))/)?t[0]=e:t[2]=e}),t[0]||(t[0]="medium"),t[1]||(t[1]="solid"),t[2]||(t[2]=""),t},pOheaderControls(e){if("string"==typeof e){let t={},n=e.toLowerCase(),r=n.match(/xl|lg|md|sm|xs/),i=n.match(/closeonly|none/);return r&&(t.size=r[0]),i&&(t=Object.assign({},t,{maximize:"remove",normalize:"remove",minimize:"remove",smallify:"remove"}),"none"===i[0]&&(t.close="remove")),Object.assign({},this.defaults.headerControls,t)}return Object.assign({},this.defaults.headerControls,e)},pOtheme(e){let t,n="";if((e=e.trim()).match(/^(rgb|hsl|var)/)){let i=e.indexOf(")");(t=e.slice(0,i+1).replace(/\s+/g,"")).startsWith("var")&&(t=r.getCssVariableValue(t)),n=e.slice(i+1,e.length).trim()}else if(e.match(/^(#|\w|--)/)){let i=e.indexOf(" ");i>0?(t=e.slice(0,i+1).replace(/\s+/g,""),n=e.slice(i+1,e.length).trim()):t=e,t.startsWith("--")&&(t=r.getCssVariableValue(t))}if(t.match(/^([\da-f]{3}|[\da-f]{6})$/gi)&&(t="#"+t),n.startsWith("fillcolor")){let e=n.indexOf(" ");n=(n=n.slice(e+1,n.length).trim().replace(/\s+/g,"")).match(/^([\da-f]{3}|[\da-f]{6})$/gi)?"#"+n:r.colorNames[n]?"#"+r.colorNames[n]:n.match(/^(--|var)/)?r.getCssVariableValue(n):"#fff"}return{color:t,colors:!1,filling:n}},color(e){let t,n,r,i,o,a,s,l,u,c=e.toLowerCase(),d={};const f=/^rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3}),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,p=/^hsla?\((\d{1,3}),(\d{1,3}%),(\d{1,3}%),?(0|1|0\.\d{1,2}|\.\d{1,2})?\)$/gi,h=this.colorNames;return h[c]&&(c=h[c]),null!==c.match(/^#?([\da-f]{3}|[\da-f]{6})$/gi)?((c=c.replace("#","")).length%2==1?(t=c.slice(0,1).repeat(2),n=c.slice(1,2).repeat(2),r=c.slice(2,3).repeat(2),d.rgb={r:parseInt(t,16),g:parseInt(n,16),b:parseInt(r,16)},d.hex=`#${t}${n}${r}`):(d.rgb={r:parseInt(c.slice(0,2),16),g:parseInt(c.slice(2,4),16),b:parseInt(c.slice(4,6),16)},d.hex=`#${c}`),u=this.rgbToHsl(d.rgb.r,d.rgb.g,d.rgb.b),d.hsl=u,d.rgb.css=`rgb(${d.rgb.r},${d.rgb.g},${d.rgb.b})`):c.match(f)?(s=f.exec(c),d.rgb={css:c,r:s[1],g:s[2],b:s[3]},d.hex=this.rgbToHex(s[1],s[2],s[3]),u=this.rgbToHsl(s[1],s[2],s[3]),d.hsl=u):c.match(p)?(i=(s=p.exec(c))[1]/360,o=s[2].slice(0,s[2].length-1)/100,a=s[3].slice(0,s[3].length-1)/100,l=this.hslToRgb(i,o,a),d.rgb={css:`rgb(${l[0]},${l[1]},${l[2]})`,r:l[0],g:l[1],b:l[2]},d.hex=this.rgbToHex(d.rgb.r,d.rgb.g,d.rgb.b),d.hsl={css:`hsl(${s[1]},${s[2]},${s[3]})`,h:s[1],s:s[2],l:s[3]}):(d.hex="#f5f5f5",d.rgb={css:"rgb(245,245,245)",r:245,g:245,b:245},d.hsl={css:"hsl(0,0%,96%)",h:0,s:"0%",l:"96%"}),d},calcColors(e){const t=this.colorBrightnessThreshold,n=this.color(e),r=this.lighten(e,this.colorFilledLight),i=this.darken(e,this.colorFilled),o=this.perceivedBrightness(e)<=t?"#ffffff":"#000000",a=this.perceivedBrightness(r)<=t?"#ffffff":"#000000",s=this.perceivedBrightness(i)<=t?"#ffffff":"#000000",l=this.lighten(e,this.colorFilledDark),u=this.perceivedBrightness(l)<=t?"#ffffff":"#000000";return[n.hsl.css,r,i,o,a,s,l,u]},darken(e,t){const n=this.color(e).hsl,r=parseFloat(n.l),i=Math.round(r-r*t)+"%";return`hsl(${n.h},${n.s},${i})`},lighten(e,t){const n=this.color(e).hsl,r=parseFloat(n.l),i=Math.round(r+(100-r)*t)+"%";return`hsl(${n.h},${n.s},${i})`},hslToRgb(e,t,n){let r,i,o;if(0===t)r=i=o=n;else{let a=(e,t,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e),s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),i=a(l,s,e),o=a(l,s,e-1/3)}return[Math.round(255*r),Math.round(255*i),Math.round(255*o)]},rgbToHsl(e,t,n){e/=255,t/=255,n/=255;let r,i,o=Math.max(e,t,n),a=Math.min(e,t,n),s=(o+a)/2;if(o===a)r=i=0;else{let l=o-a;switch(i=s>.5?l/(2-o-a):l/(o+a),o){case e:r=(t-n)/l+(t<n?6:0);break;case t:r=(n-e)/l+2;break;case n:r=(e-t)/l+4}r/=6}return{css:"hsl("+(r=Math.round(360*r))+","+(i=Math.round(100*i)+"%")+","+(s=Math.round(100*s)+"%")+")",h:r,s:i,l:s}},rgbToHex(e,t,n){let r=Number(e).toString(16),i=Number(t).toString(16),o=Number(n).toString(16);return 1===r.length&&(r=`0${r}`),1===i.length&&(i=`0${i}`),1===o.length&&(o=`0${o}`),`#${r}${i}${o}`},perceivedBrightness(e){const t=this.color(e).rgb;return t.r/255*.2126+t.g/255*.7152+t.b/255*.0722},pOposition(e){let t={},n=e.trim().split(/\s+/),r=n.filter(e=>e.match(/^(down|right|up|left)$/i));r.length&&(t.autoposition=r[0],n.splice(n.indexOf(r[0]),1));let i=n.filter(e=>e.match(/^(left-|right-)(top|center|bottom)$|(^center-)(top|bottom)$|(^center$)/i));i.length?(t.my=i[0],t.at=i[1]||i[0],n.splice(n.indexOf(i[0]),1),i[1]&&n.splice(n.indexOf(i[1]),1)):(t.my="center",t.at="center");let o=n.filter(e=>e.match(/^[+-]?\d*\.?\d+[a-z%]*$/i));return o.length&&(t.offsetX=o[0].match(/^[+-]?\d*\.?\d+$/i)?`${o[0]}px`:o[0],o[1]?t.offsetY=o[1].match(/^[+-]?\d*\.?\d+$/i)?`${o[1]}px`:o[1]:t.offsetY=t.offsetX,n.splice(n.indexOf(o[0]),1),o[1]&&n.splice(n.indexOf(o[1]),1)),n.length&&(t.of=n.join(" ")),t},position(e,t){if(!t)return e.style.opacity=1,e;t="string"==typeof t?Object.assign({},this.defaults.position,this.pOposition(t)):Object.assign({},this.defaults.position,t),["my","at","of"].forEach(n=>{"function"==typeof t[n]&&(t[n]=t[n].call(e,e))}),"window"===e.options.container&&(e.style.position="fixed"),"string"==typeof e?e=document.querySelector(e):Object.getPrototypeOf(e).jquery&&(e=e[0]);const n="window"===e.options.container?"window":e.parentElement,r=e.getBoundingClientRect(),i=e.parentElement.getBoundingClientRect(),o="window"===n?{left:0,top:0,width:document.documentElement.clientWidth,height:window.innerHeight}:{width:i.width,height:i.height,left:i.left,top:i.top},a="window"===n?{x:1,y:1}:{x:o.width/n.offsetWidth,y:o.height/n.offsetHeight},s="window"===n?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:window.getComputedStyle(n);let l;o.width-=(parseFloat(s.borderLeftWidth)+parseFloat(s.borderRightWidth))*a.x,o.height-=(parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth))*a.y,l=t.of?"string"==typeof t.of?"window"===t.of?{borderTopWidth:"0px",borderRightWidth:"0px",borderBottomWidth:"0px",borderLeftWidth:"0px"}:document.querySelector(t.of).getBoundingClientRect():Object.getPrototypeOf(t.of).jquery?t.of[0].getBoundingClientRect():t.of.getBoundingClientRect():o;let u=this.getScrollbarWidth(document.body),c=this.getScrollbarWidth(e.parentElement),d="0px";t.my.startsWith("left-")?t.at.startsWith("left-")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+"px":"0px":t.at.startsWith("center")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+l.width/2+"px":o.width/2+"px":t.at.startsWith("right-")&&(d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+l.width+"px":o.width+"px"):t.my.startsWith("center")?t.at.startsWith("left-")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-r.width/2+"px":-r.width/2+"px":t.at.startsWith("center")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-(r.width-l.width)/2+"px":o.width/2-r.width/2+"px":t.at.startsWith("right-")&&(d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+(l.width-r.width/2)+"px":o.width-r.width/2+"px"):t.my.startsWith("right-")&&(t.at.startsWith("left-")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-r.width+"px":-r.width+"px":t.at.startsWith("center")?d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)-r.width+l.width/2+"px":o.width/2-r.width+"px":t.at.startsWith("right-")&&(d=t.of?l.left-o.left-parseFloat(s.borderLeftWidth)+l.width-r.width+"px":o.width-r.width+"px","window"!==n&&(d=parseFloat(d)-c.y+"px")));let f="0px";t.my.endsWith("-top")?t.at.endsWith("-top")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)+"px":"0px":t.at.endsWith("center")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)+l.height/2+"px":o.height/2+"px":t.at.endsWith("-bottom")&&(f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)+l.height+"px":o.height+"px"):t.my.endsWith("center")?t.at.endsWith("-top")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height/2+"px":-r.height/2+"px":t.at.endsWith("center")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height/2+l.height/2+"px":o.height/2-r.height/2+"px":t.at.endsWith("-bottom")&&(f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height/2+l.height+"px":o.height-r.height/2+"px"):t.my.endsWith("-bottom")&&(t.at.endsWith("-top")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height+"px":-r.height+"px":t.at.endsWith("center")?f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height+l.height/2+"px":o.height/2-r.height+"px":t.at.endsWith("-bottom")&&(f=t.of?l.top-o.top-parseFloat(s.borderTopWidth)-r.height+l.height+"px":o.height-r.height+"px",f="window"!==n?parseFloat(f)-c.x+"px":parseFloat(f)-u.x+"px")),e.style.left=1===a.x?d:parseFloat(d)/a.x+"px",e.style.top=1===a.y?f:parseFloat(f)/a.y+"px";let p=getComputedStyle(e),h={left:p.left,top:p.top};return t.autoposition&&t.my===t.at&&["left-top","center-top","right-top","left-bottom","center-bottom","right-bottom"].indexOf(t.my)>=0&&(h=this.applyPositionAutopos(e,h,t)),(t.offsetX||t.offsetY)&&(h=this.applyPositionOffset(e,h,t)),(t.minLeft||t.minTop||t.maxLeft||t.maxTop)&&(h=this.applyPositionMinMax(e,h,t)),t.modify&&(h=this.applyPositionModify(e,h,t)),"number"==typeof e.options.opacity?e.style.opacity=e.options.opacity:e.style.opacity=1,e},applyPositionAutopos(e,t,n){const i=`${n.my}-${n.autoposition.toLowerCase()}`;e.classList.add(i);const o=Array.prototype.slice.call(document.querySelectorAll(`.${i}`)),a=o.indexOf(e);if(o.length>1){switch(n.autoposition){case"down":o.forEach((e,n)=>{n>0&&n<=a&&(t.top=parseFloat(t.top)+o[--n].getBoundingClientRect().height+r.autopositionSpacing+"px")});break;case"up":o.forEach((e,n)=>{n>0&&n<=a&&(t.top=parseFloat(t.top)-o[--n].getBoundingClientRect().height-r.autopositionSpacing+"px")});break;case"right":o.forEach((e,n)=>{n>0&&n<=a&&(t.left=parseFloat(t.left)+o[--n].getBoundingClientRect().width+r.autopositionSpacing+"px")});break;case"left":o.forEach((e,n)=>{n>0&&n<=a&&(t.left=parseFloat(t.left)-o[--n].getBoundingClientRect().width-r.autopositionSpacing+"px")})}e.style.left=t.left,e.style.top=t.top}return{left:t.left,top:t.top}},applyPositionOffset(e,t,n){["offsetX","offsetY"].forEach(e=>{n[e]?("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),!1===isNaN(n[e])&&(n[e]=`${n[e]}px`)):n[e]="0px"}),e.style.left=`calc(${e.style.left} + ${n.offsetX})`,e.style.top=`calc(${e.style.top} + ${n.offsetY})`;const r=getComputedStyle(e);return{left:r.left,top:r.top}},applyPositionMinMax(e,t,n){if(["minLeft","minTop","maxLeft","maxTop"].forEach(e=>{n[e]&&("function"==typeof n[e]&&(n[e]=n[e].call(t,t,n)),(Number.isInteger(n[e])||n[e].match(/^\d+$/))&&(n[e]=`${n[e]}px`))}),n.minLeft){e.style.left=n.minLeft;let r=getComputedStyle(e).left;parseFloat(r)<parseFloat(t.left)?e.style.left=t.left:t.left=r}if(n.minTop){e.style.top=n.minTop;let r=getComputedStyle(e).top;parseFloat(r)<parseFloat(t.top)?e.style.top=t.top:t.top=r}if(n.maxLeft){e.style.left=n.maxLeft;let r=getComputedStyle(e).left;parseFloat(r)>parseFloat(t.left)?e.style.left=t.left:t.left=r}if(n.maxTop){e.style.top=n.maxTop;let r=getComputedStyle(e).top;parseFloat(r)>parseFloat(t.top)?e.style.top=t.top:t.top=r}const r=getComputedStyle(e);return{left:r.left,top:r.top}},applyPositionModify(e,t,n){if(n.modify&&"function"==typeof n.modify){const r=n.modify.call(t,t,n);e.style.left=Number.isInteger(r.left)||r.left.match(/^\d+$/)?`${r.left}px`:r.left,e.style.top=Number.isInteger(r.top)||r.top.match(/^\d+$/)?`${r.top}px`:r.top}const r=getComputedStyle(e);return{left:r.left,top:r.top}},autopositionRemaining(e){let t,n=e.options.container;["left-top-down","left-top-right","center-top-down","right-top-down","right-top-left","left-bottom-up","left-bottom-right","center-bottom-up","right-bottom-up","right-bottom-left"].forEach(n=>{e.classList.contains(n)&&(t=n)}),t&&("window"===n?document.body:"string"==typeof n?document.querySelector(n):n).querySelectorAll(`.${t}`).forEach(e=>e.reposition())},getThemeDetails(e){const t=this.pOtheme(e);if(t.color.startsWith("bootstrap-")){let e=t.color.indexOf("-"),n=document.createElement("button");n.className="btn btn"+t.color.slice(e),document.body.appendChild(n),t.color=getComputedStyle(n).backgroundColor.replace(/\s+/gi,""),document.body.removeChild(n),n=void 0}return t.colors=this.calcColors(t.color),t},clearTheme(e,t){return e.content.classList.remove("jsPanel-content-filled","jsPanel-content-filledlight"),e.header.classList.remove("jsPanel-hdr-light"),e.header.classList.remove("jsPanel-hdr-dark"),e.style.backgroundColor="",this.setStyles(e.headertoolbar,{boxShadow:"",width:"",marginLeft:"",borderTopColor:"transparent"}),this.setStyles(e.content,{background:"",borderTopColor:"transparent"}),e.header.style.background="",Array.prototype.slice.call(e.controlbar.querySelectorAll(".jsPanel-icon")).concat([e.headerlogo,e.headertitle,e.headertoolbar,e.content]).forEach(e=>e.style.color=""),t&&t.call(e,e),e},applyColorTheme(e,t){if(e.style.backgroundColor=t.colors[0],e.header.style.backgroundColor=t.colors[0],e.header.style.color=t.colors[3],[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(n=>e.querySelector(n).style.color=t.colors[3]),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=t.colors[3]),"string"==typeof e.options.theme&&"filled"===t.filling&&(e.content.style.borderTop="#000000"===t.colors[3]?"1px solid rgba(0,0,0,0.15)":"1px solid rgba(255,255,255,0.15)"),"#000000"===t.colors[3]?e.header.classList.add("jsPanel-hdr-light"):e.header.classList.add("jsPanel-hdr-dark"),t.filling)switch(t.filling){case"filled":this.setStyles(e.content,{backgroundColor:t.colors[2],color:t.colors[3]});break;case"filledlight":e.content.style.backgroundColor=t.colors[1];break;case"filleddark":this.setStyles(e.content,{backgroundColor:t.colors[6],color:t.colors[7]});break;default:e.content.style.backgroundColor=t.filling,e.content.style.color=this.perceivedBrightness(t.filling)<=this.colorBrightnessThreshold?"#fff":"#000"}return e},applyCustomTheme(e,t){let n={bgPanel:"#ffffff",bgContent:"#ffffff",bgFooter:"#f5f5f5",colorHeader:"#000000",colorContent:"#000000",colorFooter:"#000000",border:void 0,borderRadius:void 0},r="object"==typeof t?Object.assign(n,t):n,i=r.bgPanel,o=r.bgContent,a=r.colorHeader,s=r.colorContent,l=r.bgFooter,u=r.colorFooter;return this.colorNames[i]?e.style.background="#"+this.colorNames[i]:e.style.background=this.getCssVariableValue(i),this.colorNames[a]&&(a="#"+this.colorNames[a]),[".jsPanel-headerlogo",".jsPanel-title",".jsPanel-hdr-toolbar"].forEach(t=>e.querySelector(t).style.color=this.getCssVariableValue(a)),e.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>e.style.color=this.getCssVariableValue(a)),this.colorNames[o]?e.content.style.background="#"+this.colorNames[o]:e.content.style.background=this.getCssVariableValue(o),this.colorNames[s]?e.content.style.color="#"+this.colorNames[s]:e.content.style.color=this.getCssVariableValue(s),this.perceivedBrightness(a)>this.colorBrightnessThreshold?e.header.classList.add("jsPanel-hdr-dark"):e.header.classList.add("jsPanel-hdr-light"),this.perceivedBrightness(s)>this.colorBrightnessThreshold?e.content.style.borderTop="1px solid rgba(255,255,255,0.15)":e.content.style.borderTop="1px solid rgba(0,0,0,0.15)",this.colorNames[l]?e.footer.style.background="#"+this.colorNames[l]:e.footer.style.background=this.getCssVariableValue(l),this.colorNames[u]?e.footer.style.color="#"+this.colorNames[u]:e.footer.style.color=this.getCssVariableValue(u),r.border&&e.setBorder(r.border),r.borderRadius&&(e.options.borderRadius=void 0,e.setBorderRadius(r.borderRadius)),e},getCssVariableValue(e){if(e.startsWith("--"))return getComputedStyle(document.documentElement).getPropertyValue(e).replace(/\s+/g,"");if(e.startsWith("var")){let t=e.slice(e.indexOf("(")+1,e.indexOf(")"));return getComputedStyle(document.documentElement).getPropertyValue(t).replace(/\s+/g,"")}return e},getScrollbarWidth(e=document.body){if(e===document.body)return{y:window.innerWidth-document.documentElement.clientWidth,x:window.innerHeight-document.documentElement.clientHeight};{let t=getComputedStyle(e);return{y:e.offsetWidth-e.clientWidth-parseFloat(t.borderRightWidth)-parseFloat(t.borderLeftWidth),x:e.offsetHeight-e.clientHeight-parseFloat(t.borderBottomWidth)-parseFloat(t.borderTopWidth)}}},remClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.remove(t)),e),setClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.add(t)),e),setStyles(e,t){for(const[n,i]of Object.entries(t))e.style[n]="string"==typeof i?r.getCssVariableValue(i):i;return e},setStyle(e,t){return this.setStyles.call(e,e,t)},strToHtml:e=>document.createRange().createContextualFragment(e),toggleClass:(e,t)=>(t.trim().split(/\s+/).forEach(t=>e.classList.contains(t)?e.classList.remove(t):e.classList.add(t)),e),emptyNode(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e},addScript(e,t="application/javascript",n){if(!document.querySelector(`script[src="${e}"]`)){const r=document.createElement("script");r.src=e,r.type=t,document.head.appendChild(r),n&&(r.onload=n)}},ajax(e,t){let n,i,o=new XMLHttpRequest;const a={method:"GET",async:!0,user:"",pwd:"",done:function(){if(t){let e=r.strToHtml(this.responseText);n.urlSelector&&(e=e.querySelector(n.urlSelector)),t.contentRemove(),t.content.append(e)}},autoresize:!0,autoreposition:!0};if(t&&"string"==typeof e)n=Object.assign({},a,{url:e});else{if("object"!=typeof e||!e.url){if(this.errorReporting){let e="XMLHttpRequest seems to miss the <mark>url</mark> parameter!";r.errorpanel(e)}return}(n=Object.assign({},a,e)).url=e.url,!1===n.async&&(n.timeout=0,n.withCredentials&&(n.withCredentials=void 0),n.responseType&&(n.responseType=void 0))}i=n.url.trim().split(/\s+/),n.url=encodeURI(i[0]),i.length>1&&(i.shift(),n.urlSelector=i.join(" ")),o.onreadystatechange=()=>{4===o.readyState&&(200===o.status?t?n.done.call(o,o,t):n.done.call(o,o):n.fail&&(t?n.fail.call(o,o,t):n.fail.call(o,o)),n.always&&(t?n.always.call(o,o,t):n.always.call(o,o)),t&&(n.autoresize||n.autoreposition)&&r.ajaxAutoresizeAutoreposition(t,n),r.ajaxAlwaysCallbacks.length&&r.ajaxAlwaysCallbacks.forEach(e=>{t?e.call(o,o,t):e.call(o,o)}))},o.open(n.method,n.url,n.async,n.user,n.pwd),o.timeout=n.timeout||0,n.withCredentials&&(o.withCredentials=n.withCredentials),n.responseType&&(o.responseType=n.responseType),n.beforeSend&&(t?n.beforeSend.call(o,o,t):n.beforeSend.call(o,o)),n.data?o.send(n.data):o.send(null)},fetch(e,t){let n;const i={bodyMethod:"text",autoresize:!0,autoreposition:!0,done:function(e,t){if(t){let n=r.strToHtml(e);t.contentRemove(),t.content.append(n)}}};if(t&&"string"==typeof e)n=Object.assign({},i,{resource:encodeURI(e)});else{if("object"!=typeof e||!e.resource){if(this.errorReporting){let e="Fetch Request seems to miss the <mark>resource</mark> parameter!";r.errorpanel(e)}return}(n=Object.assign({},i,e)).resource=encodeURI(e.resource)}const o=n.fetchInit||{};n.beforeSend&&(t?n.beforeSend.call(e,e,t):n.beforeSend.call(e,e)),fetch(n.resource,o).then(e=>{if(e.ok)return e[n.bodyMethod]()}).then(e=>{t?n.done.call(e,e,t):n.done.call(e,e),t&&(n.autoresize||n.autoreposition)&&r.ajaxAutoresizeAutoreposition(t,n)})},ajaxAutoresizeAutoreposition(e,t){const n=e.options.contentSize;if("string"==typeof n&&n.match(/auto/i)){const r=n.split(" "),i=Object.assign({},{width:r[0],height:r[1]});t.autoresize&&e.resize(i),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition()}else if("object"==typeof n&&("auto"===n.width||"auto"===n.height)){const r=Object.assign({},n);t.autoresize&&e.resize(r),e.classList.contains("jsPanel-contextmenu")||t.autoreposition&&e.reposition()}},createPanelTemplate(e=!0){const t=document.createElement("div");return t.className="jsPanel",t.style.left="0",t.style.top="0",e&&["close","maximize","normalize","minimize","smallify"].forEach(e=>{t.setAttribute(`data-btn${e}`,"enabled")}),t.innerHTML=`<div class="jsPanel-hdr">\n <div class="jsPanel-headerbar">\n <div class="jsPanel-headerlogo"></div>\n <div class="jsPanel-titlebar">\n <div class="jsPanel-title"></div>\n </div>\n <div class="jsPanel-controlbar">\n <button type="button" class="jsPanel-btn jsPanel-btn-smallify" aria-label="Smallify">${this.icons.smallify}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-minimize" aria-label="Minimize">${this.icons.minimize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-normalize" aria-label="Normalize">${this.icons.normalize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-maximize" aria-label="Maximize">${this.icons.maximize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-close" aria-label="Close">${this.icons.close}</button>\n </div>\n </div>\n <div class="jsPanel-hdr-toolbar"></div>\n </div>\n <div class="jsPanel-progressbar">\n <div class="jsPanel-progressbar-slider"></div>\n </div>\n <div class="jsPanel-content"></div>\n <div class="jsPanel-minimized-box"></div>\n <div class="jsPanel-ftr"></div>`,t},createMinimizedTemplate(){const e=document.createElement("div");return e.className="jsPanel-replacement",e.innerHTML=`<div class="jsPanel-hdr">\n <div class="jsPanel-headerbar">\n <div class="jsPanel-headerlogo"></div>\n <div class="jsPanel-titlebar">\n <div class="jsPanel-title"></div>\n </div>\n <div class="jsPanel-controlbar">\n <button type="button" class="jsPanel-btn jsPanel-btn-sm jsPanel-btn-normalize" aria-label="Normalize">${this.icons.normalize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-sm jsPanel-btn-maximize" aria-label="Maximize">${this.icons.maximize}</button>\n <button type="button" class="jsPanel-btn jsPanel-btn-sm jsPanel-btn-close" aria-label="Close">${this.icons.close}</button>\n </div>\n </div>\n </div>`,e},createSnapArea(e,t,n){const r=document.createElement("div"),i=e.parentElement;r.className=`jsPanel-snap-area jsPanel-snap-area-${t}`,"lt"===t||"rt"===t||"rb"===t||"lb"===t?(r.style.width=n+"px",r.style.height=n+"px"):"ct"===t||"cb"===t?r.style.height=n+"px":"lc"!==t&&"rc"!==t||(r.style.width=n+"px"),i!==document.body&&(r.style.position="absolute"),document.querySelector(`.jsPanel-snap-area.jsPanel-snap-area-${t}`)||e.parentElement.appendChild(r)},removeSnapAreas(){document.querySelectorAll(".jsPanel-snap-area").forEach(e=>e.parentElement.removeChild(e))},extend(e){if("[object Object]"===Object.prototype.toString.call(e))for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.extensions[t]=e[t])},getPanels:(e=function(){return this.classList.contains("jsPanel-standard")})=>Array.prototype.slice.call(document.querySelectorAll(".jsPanel")).filter(t=>e.call(t,t)).sort((e,t)=>t.style.zIndex-e.style.zIndex),processCallbacks(e,t,n="some",r,i){if("function"==typeof t&&(t=[t]),n)return t[n](t=>t.call(e,e,r,i));t.forEach(t=>t.call(e,e,r,i))},resetZi(){this.zi=((e=r.ziBase)=>{let t=e;return{next:()=>t++}})(),Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).sort((e,t)=>e.style.zIndex-t.style.zIndex).forEach(e=>e.style.zIndex=r.zi.next())},errorpanel(e){this.create({paneltype:"error",dragit:!1,resizeit:!1,theme:{bgPanel:"white",bgContent:"white",colorHeader:"rebeccapurple",colorContent:"#333333",border:"2px solid rebeccapurple"},borderRadius:".33rem",headerControls:"closeonly xs",headerTitle:"&#9888; jsPanel Error",contentSize:{width:"50%",height:"auto"},position:"center-top 0 5 down",animateIn:"jsPanelFadeIn",content:`<div class="jsPanel-error-content-separator"></div><p>${e}</p>`})},create(e={},t){r.zi||(r.zi=((e=r.ziBase)=>{let t=e;return{next:()=>t++}})()),e.config?delete(e=Object.assign({},this.defaults,e.config,e)).config:e=Object.assign({},this.defaults,e),e.id?"function"==typeof e.id&&(e.id=e.id()):e.id=`jsPanel-${r.idCounter+=1}`;const n=document.getElementById(e.id);if(null!==n){if(n.classList.contains("jsPanel")&&n.front(),this.errorReporting){let t=`&#9664; COULD NOT CREATE NEW JSPANEL &#9658;<br>An element with the ID <mark>${e.id}</mark> already exists in the document.`;r.errorpanel(t)}return!1}let i=this.pOcontainer(e.container);if("object"==typeof i&&i.length&&i.length>0&&(i=i[0]),!i){if(this.errorReporting){let e="&#9664; COULD NOT CREATE NEW JSPANEL &#9658;<br>The container to append the panel to does not exist";r.errorpanel(e)}return!1}["onbeforeclose","onbeforemaximize","onbeforeminimize","onbeforenormalize","onbeforesmallify","onbeforeunsmallify","onclosed","onfronted","onmaximized","onminimized","onnormalized","onsmallified","onstatuschange","onunsmallified"].forEach(t=>{e[t]?"function"==typeof e[t]&&(e[t]=[e[t]]):e[t]=[]});const o=e.template||this.createPanelTemplate();o.options=e,o.closetimer=void 0,o.status="initialized",o.currentData={},o.header=o.querySelector(".jsPanel-hdr"),o.headerbar=o.header.querySelector(".jsPanel-headerbar"),o.titlebar=o.header.querySelector(".jsPanel-titlebar"),o.headerlogo=o.headerbar.querySelector(".jsPanel-headerlogo"),o.headertitle=o.headerbar.querySelector(".jsPanel-title"),o.controlbar=o.headerbar.querySelector(".jsPanel-controlbar"),o.headertoolbar=o.header.querySelector(".jsPanel-hdr-toolbar"),o.content=o.querySelector(".jsPanel-content"),o.footer=o.querySelector(".jsPanel-ftr"),o.snappableTo=!1,o.snapped=!1,o.droppableTo=!1,o.progressbar=o.autocloseProgressbar=o.querySelector(".jsPanel-progressbar");const a=new CustomEvent("jspanelloaded",{detail:e.id,cancelable:!0}),s=new CustomEvent("jspanelstatuschange",{detail:e.id,cancelable:!0}),l=new CustomEvent("jspanelbeforenormalize",{detail:e.id,cancelable:!0}),u=new CustomEvent("jspanelnormalized",{detail:e.id,cancelable:!0}),c=new CustomEvent("jspanelbeforemaximize",{detail:e.id,cancelable:!0}),d=new CustomEvent("jspanelmaximized",{detail:e.id,cancelable:!0}),f=new CustomEvent("jspanelbeforeminimize",{detail:e.id,cancelable:!0}),p=new CustomEvent("jspanelminimized",{detail:e.id,cancelable:!0}),h=new CustomEvent("jspanelbeforesmallify",{detail:e.id,cancelable:!0}),g=new CustomEvent("jspanelsmallified",{detail:e.id,cancelable:!0}),m=new CustomEvent("jspanelsmallifiedmax",{detail:e.id,cancelable:!0}),v=new CustomEvent("jspanelbeforeunsmallify",{detail:e.id,cancelable:!0}),y=new CustomEvent("jspanelfronted",{detail:e.id,cancelable:!0}),_=new CustomEvent("jspanelbeforeclose",{detail:e.id,cancelable:!0}),b=new CustomEvent("jspanelclosed",{detail:e.id,cancelable:!0}),w=new CustomEvent("jspanelcloseduser",{detail:e.id,cancelable:!0});[a,s,l,u,c,d,f,p,h,g,m,v,y,_].forEach(e=>e.panel=o);const x=o.querySelector(".jsPanel-btn-close"),k=o.querySelector(".jsPanel-btn-maximize"),C=o.querySelector(".jsPanel-btn-normalize"),D=o.querySelector(".jsPanel-btn-smallify"),S=o.querySelector(".jsPanel-btn-minimize");x&&r.pointerup.forEach(e=>{x.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.close(null,!0)})}),k&&r.pointerup.forEach(e=>{k.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.maximize()})}),C&&r.pointerup.forEach(e=>{C.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.normalize()})}),D&&r.pointerup.forEach(e=>{D.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;"normalized"===o.status||"maximized"===o.status?o.smallify():"smallified"!==o.status&&"smallifiedmax"!==o.status||o.unsmallify()})}),S&&r.pointerup.forEach(e=>{S.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.minimize()})});let A=r.extensions;for(let e in A)Object.prototype.hasOwnProperty.call(A,e)&&(o[e]=A[e]);if(o.setBorder=e=>{let t=r.pOborder(e);return t[2].length||(t[2]=o.style.backgroundColor),t=t.join(" "),o.style.border=t,o.options.border=t,o},o.setBorderRadius=e=>{"string"==typeof e&&(e.startsWith("--")||e.startsWith("var"))&&(e=e.replace(/\s*\(\s*/g,"(").replace(/\s*\)/g,")").replace(/\s+/g," "),e=r.getCssVariableValue(e)),"number"==typeof e&&(e+="px"),o.style.borderRadius=e;const t=getComputedStyle(o);return o.options.header?(o.header.style.borderTopLeftRadius=t.borderTopLeftRadius,o.header.style.borderTopRightRadius=t.borderTopRightRadius):(o.content.style.borderTopLeftRadius=t.borderTopLeftRadius,o.content.style.borderTopRightRadius=t.borderTopRightRadius),o.options.footerToolbar?(o.footer.style.borderBottomRightRadius=t.borderBottomRightRadius,o.footer.style.borderBottomLeftRadius=t.borderBottomLeftRadius):(o.content.style.borderBottomRightRadius=t.borderBottomRightRadius,o.content.style.borderBottomLeftRadius=t.borderBottomLeftRadius),o},o.setTheme=(t=e.theme,n)=>{let i;if("minimized"===o.status&&(i=!0,o.normalize()),r.clearTheme(o),"object"==typeof t)e.border=void 0,r.applyCustomTheme(o,t);else if("string"==typeof t){"none"===t&&(t="white");let e=r.getThemeDetails(t);r.applyColorTheme(o,e)}return i&&o.minimize(),n&&n.call(o,o),o},o.remove=(e,t,n)=>{o.parentElement.removeChild(o),document.getElementById(e)?n&&n.call(o,e,o):(o.removeMinimizedReplacement(),o.status="closed",t&&document.dispatchEvent(w),document.dispatchEvent(b),o.options.onclosed&&r.processCallbacks(o,o.options.onclosed,"every",t),r.autopositionRemaining(o),n&&n.call(e,e)),window.removeEventListener("resize",o.windowResizeHandler),document.removeEventListener("jspanelresize",o.parentResizeHandler)},o.close=(e,t)=>{if(o.parentElement){if(o.closetimer&&window.clearInterval(o.closetimer),document.dispatchEvent(_),o.statusBefore=o.status,o.options.onbeforeclose&&o.options.onbeforeclose.length>0&&!r.processCallbacks(o,o.options.onbeforeclose,"some",o.status,t))return o;o.options.animateOut?(o.options.animateIn&&r.remClass(o,o.options.animateIn),r.setClass(o,o.options.animateOut),o.addEventListener("animationend",n=>{n.stopPropagation(),o.remove(o.id,t,e)})):o.remove(o.id,t,e)}},o.maximize=(t,n)=>{if(o.statusBefore=o.status,e.onbeforemaximize&&e.onbeforemaximize.length>0&&!r.processCallbacks(o,e.onbeforemaximize,"some",o.statusBefore))return o;document.dispatchEvent(c);const i=o.parentElement,a=r.pOcontainment(e.maximizedMargin);return i===document.body?(o.style.width=document.documentElement.clientWidth-a[1]-a[3]+"px",o.style.height=document.documentElement.clientHeight-a[0]-a[2]+"px",o.style.left=a[3]+"px",o.style.top=a[0]+"px"):(o.style.width=i.clientWidth-a[1]-a[3]+"px",o.style.height=i.clientHeight-a[0]-a[2]+"px",o.style.left=a[3]+"px",o.style.top=a[0]+"px"),D.style.transform="unset",o.removeMinimizedReplacement(),o.status="maximized",o.setControls([".jsPanel-btn-maximize"]),n||o.front(),document.dispatchEvent(d),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore),t&&t.call(o,o,o.statusBefore),e.onmaximized&&r.processCallbacks(o,e.onmaximized,"every",o.statusBefore),o},o.minimize=t=>{if("minimized"===o.status)return o;if(o.statusBefore=o.status,e.onbeforeminimize&&e.onbeforeminimize.length>0&&!r.processCallbacks(o,e.onbeforeminimize,"some",o.statusBefore))return o;if(document.dispatchEvent(f),!document.getElementById("jsPanel-replacement-container")){const e=document.createElement("div");e.id="jsPanel-replacement-container",document.body.append(e)}if(o.style.left="-9999px",o.status="minimized",document.dispatchEvent(p),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore),e.minimizeTo){let t,n,r,i=o.createMinimizedReplacement();switch(e.minimizeTo){case"default":document.getElementById("jsPanel-replacement-container").append(i);break;case"parentpanel":(t=(r=(n=o.closest(".jsPanel-content").parentElement).querySelectorAll(".jsPanel-minimized-box"))[r.length-1]).append(i);break;case"parent":(t=(n=o.parentElement).querySelector(".jsPanel-minimized-container"))||((t=document.createElement("div")).className="jsPanel-minimized-container",n.append(t)),t.append(i);break;default:document.querySelector(e.minimizeTo).append(i)}}return t&&t.call(o,o,o.statusBefore),e.onminimized&&r.processCallbacks(o,e.onminimized,"every",o.statusBefore),o},o.normalize=t=>("normalized"===o.status||(o.statusBefore=o.status,e.onbeforenormalize&&e.onbeforenormalize.length>0&&!r.processCallbacks(o,e.onbeforenormalize,"some",o.statusBefore)||(document.dispatchEvent(l),o.style.width=o.currentData.width,o.style.height=o.currentData.height,o.snapped?o.snap(o.snapped,!0):(o.style.left=o.currentData.left,o.style.top=o.currentData.top),D.style.transform="unset",o.removeMinimizedReplacement(),o.status="normalized",o.setControls([".jsPanel-btn-normalize"]),o.front(),document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore),t&&t.call(o,o,o.statusBefore),e.onnormalized&&r.processCallbacks(o,e.onnormalized,"every",o.statusBefore))),o),o.smallify=t=>{if("smallified"===o.status||"smallifiedmax"===o.status)return o;if(o.statusBefore=o.status,e.onbeforesmallify&&e.onbeforesmallify.length>0&&!r.processCallbacks(o,e.onbeforesmallify,"some",o.statusBefore))return o;document.dispatchEvent(h),o.style.overflow="hidden";const n=window.getComputedStyle(o),i=parseFloat(window.getComputedStyle(o.headerbar).height);o.style.height=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth)+i+"px",D.style.transform="rotate(180deg)","normalized"===o.status?(o.setControls([".jsPanel-btn-normalize"]),o.status="smallified",document.dispatchEvent(g),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore)):"maximized"===o.status&&(o.setControls([".jsPanel-btn-maximize"]),o.status="smallifiedmax",document.dispatchEvent(m),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore));const a=o.querySelectorAll(".jsPanel-minimized-box");return a[a.length-1].style.display="none",t&&t.call(o,o,o.statusBefore),e.onsmallified&&r.processCallbacks(o,e.onsmallified,"every",o.statusBefore),o},o.unsmallify=t=>{if(o.statusBefore=o.status,"smallified"===o.status||"smallifiedmax"===o.status){if(e.onbeforeunsmallify&&e.onbeforeunsmallify.length>0&&!r.processCallbacks(o,e.onbeforeunsmallify,"some",o.statusBefore))return o;document.dispatchEvent(v),o.style.overflow="visible",o.front(),"smallified"===o.status?(o.style.height=o.currentData.height,o.setControls([".jsPanel-btn-normalize"]),o.status="normalized",document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every",o.statusBefore)):"smallifiedmax"===o.status?o.maximize():"minimized"===o.status&&o.normalize(),D.style.transform="rotate(0deg)";const n=o.querySelectorAll(".jsPanel-minimized-box");n[n.length-1].style.display="flex",t&&t.call(o,o,o.statusBefore),e.onunsmallified&&r.processCallbacks(o,e.onunsmallified,"every",o.statusBefore)}return o},o.front=(t,n=!0)=>{if("minimized"===o.status)"maximized"===o.statusBefore?o.maximize():o.normalize();else{const e=Array.prototype.slice.call(document.querySelectorAll(".jsPanel-standard")).map(e=>e.style.zIndex);Math.max(...e)>o.style.zIndex&&(o.style.zIndex=r.zi.next()),r.resetZi()}return document.dispatchEvent(y),t&&t.call(o,o),e.onfronted&&n&&r.processCallbacks(o,e.onfronted,"every",o.status),o},o.snap=(e,t=!1)=>{if(t||(o.currentData.beforeSnap={width:o.currentData.width,height:o.currentData.height}),e&&"function"==typeof e&&!t)e.call(o,o,o.snappableTo);else if(!1!==e){let e=[0,0];if(o.options.dragit.snap.containment&&o.options.dragit.containment){const t=r.pOcontainment(o.options.dragit.containment),n=o.snappableTo;n.startsWith("left")?e[0]=t[3]:n.startsWith("right")&&(e[0]=-t[1]),n.endsWith("top")?e[1]=t[0]:n.endsWith("bottom")&&(e[1]=-t[2])}o.reposition(`${o.snappableTo} ${e[0]} ${e[1]}`)}t||(o.snapped=o.snappableTo)},o.move=(e,t)=>{let n=o.overlaps(e,"paddingbox"),r=o.parentElement;return e.appendChild(o),o.options.container=e,o.style.left=n.left+"px",o.style.top=n.top+"px",o.saveCurrentDimensions(),o.saveCurrentPosition(),o.calcSizeFactors(),t&&t.call(o,o,e,r),o},o.closeChildpanels=e=>(o.getChildpanels().forEach(e=>e.close()),e&&e.call(o,o),o),o.getChildpanels=e=>{const t=o.content.querySelectorAll(".jsPanel");return e&&t.forEach((t,n,r)=>{e.call(t,t,n,r)}),t},o.isChildpanel=e=>{const t=o.closest(".jsPanel-content"),n=t?t.parentElement:null;return e&&e.call(o,o,n),!!t&&n},o.contentRemove=e=>(r.emptyNode(o.content),e&&e.call(o,o),o),o.createMinimizedReplacement=()=>{const t=r.createMinimizedTemplate(),n=window.getComputedStyle(o.headertitle).color,i=window.getComputedStyle(o),a=e.iconfont,s=t.querySelector(".jsPanel-controlbar");return"auto-show-hide"!==o.options.header?r.setStyles(t,{backgroundColor:i.backgroundColor,backgroundPositionX:i.backgroundPositionX,backgroundPositionY:i.backgroundPositionY,backgroundRepeat:i.backgroundRepeat,backgroundAttachment:i.backgroundAttachment,backgroundImage:i.backgroundImage,backgroundSize:i.backgroundSize,backgroundOrigin:i.backgroundOrigin,backgroundClip:i.backgroundClip}):t.style.backgroundColor=window.getComputedStyle(o.header).backgroundColor,t.id=o.id+"-min",t.querySelector(".jsPanel-headerbar").replaceChild(o.headerlogo.cloneNode(!0),t.querySelector(".jsPanel-headerlogo")),t.querySelector(".jsPanel-titlebar").replaceChild(o.headertitle.cloneNode(!0),t.querySelector(".jsPanel-title")),t.querySelector(".jsPanel-titlebar").setAttribute("title",o.headertitle.textContent),t.querySelector(".jsPanel-title").style.color=n,s.style.color=n,s.querySelectorAll("button").forEach(e=>e.style.color=n),["jsPanel-hdr-dark","jsPanel-hdr-light"].forEach(e=>{o.header.classList.contains(e)&&t.querySelector(".jsPanel-hdr").classList.add(e)}),o.setIconfont(a,t),"enabled"===o.dataset.btnnormalize?r.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-normalize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.normalize()})}):s.querySelector(".jsPanel-btn-normalize").style.display="none","enabled"===o.dataset.btnmaximize?r.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-maximize").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.maximize()})}):s.querySelector(".jsPanel-btn-maximize").style.display="none","enabled"===o.dataset.btnclose?r.pointerup.forEach(e=>{t.querySelector(".jsPanel-btn-close").addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.close(null,!0)})}):s.querySelector(".jsPanel-btn-close").style.display="none",t},o.removeMinimizedReplacement=()=>{const e=document.getElementById(`${o.id}-min`);e&&e.parentElement.removeChild(e)},o.drag=(e={})=>{let t,n,i;const a=new CustomEvent("jspaneldragstart",{detail:o.id}),s=new CustomEvent("jspaneldrag",{detail:o.id}),l=new CustomEvent("jspaneldragstop",{detail:o.id});[a,s,l].forEach(e=>e.panel=o);const u=e=>{let t=e.split("-");return t.forEach((e,n)=>{t[n]=e.charAt(0).toUpperCase()+e.slice(1)}),"snap"+t.join("")};function c(e){null===e.relatedTarget&&r.pointermove.forEach(e=>{document.removeEventListener(e,n,!1),o.style.opacity=1})}let d=e.handles||r.defaults.dragit.handles,f=e.cursor||r.defaults.dragit.cursor;function p(e){if(r.pointermove.forEach(e=>document.removeEventListener(e,n)),r.removeSnapAreas(),t){if(o.style.opacity=1,t=void 0,i.snap){switch(o.snappableTo){case"left-top":o.snap(i.snap.snapLeftTop);break;case"center-top":o.snap(i.snap.snapCenterTop);break;case"right-top":o.snap(i.snap.snapRightTop);break;case"right-center":o.snap(i.snap.snapRightCenter);break;case"right-bottom":o.snap(i.snap.snapRightBottom);break;case"center-bottom":o.snap(i.snap.snapCenterBottom);break;case"left-bottom":o.snap(i.snap.snapLeftBottom);break;case"left-center":o.snap(i.snap.snapLeftCenter)}i.snap.callback&&o.snappableTo&&"function"==typeof i.snap.callback&&(i.snap.callback.call(o,o),i.snap.repositionOnSnap&&!1!==i.snap[u(o.snappableTo)]&&o.repositionOnSnap(o.snappableTo)),o.snappableTo&&i.snap.repositionOnSnap&&i.snap[u(o.snappableTo)]&&o.repositionOnSnap(o.snappableTo)}if(o.droppableTo&&o.droppableTo){let e=o.parentElement;o.move(o.droppableTo),i.drop.callback&&i.drop.callback.call(o,o,o.droppableTo,e)}if(document.dispatchEvent(l),i.stop.length){let t=window.getComputedStyle(o),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};r.processCallbacks(o,i.stop,!1,n,e)}o.saveCurrentPosition(),o.calcSizeFactors()}o.controlbar.style.pointerEvents="inherit",o.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),document.removeEventListener(e,p)}return o.querySelectorAll(d).forEach(l=>{l.style.touchAction="none",l.style.cursor=f,r.pointerdown.forEach(u=>{l.addEventListener(u,l=>{if(l.button&&l.button>0)return!1;if((i=Object.assign({},r.defaults.dragit,e)).disableOnMaximized&&"maximized"===o.status)return!1;if((i.containment||0===i.containment)&&(i.containment=r.pOcontainment(i.containment)),i.grid&&Array.isArray(i.grid)&&1===i.grid.length&&(i.grid[1]=i.grid[0]),i.snap&&("object"==typeof i.snap?i.snap=Object.assign({},r.defaultSnapConfig,i.snap):i.snap=r.defaultSnapConfig),l.target.closest(".jsPanel-ftr-btn"))return;o.controlbar.style.pointerEvents="none",o.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");let u=window.getComputedStyle(o),d=parseFloat(u.left),f=parseFloat(u.top),p=parseFloat(u.width),h=parseFloat(u.height),g=l.touches?l.touches[0].clientX:l.clientX,m=l.touches?l.touches[0].clientY:l.clientY,v=o.parentElement,y=v.getBoundingClientRect(),_=window.getComputedStyle(v),b=o.getScaleFactor(),w=0,x=r.getScrollbarWidth(v);n=e=>{if(e.preventDefault(),!t){if(document.dispatchEvent(a),o.style.opacity=i.opacity,o.snapped&&i.snap.resizeToPreSnap&&o.currentData.beforeSnap){o.resize(o.currentData.beforeSnap.width+" "+o.currentData.beforeSnap.height),o.setControls([".jsPanel-btn-normalize"]);let e=o.getBoundingClientRect(),t=g-(e.left+e.width),n=e.width/2;t>-n&&(w=t+n)}if(o.front(),o.snapped=!1,"maximized"===o.status&&(o.setControls([".jsPanel-btn-normalize"]),o.status="normalized"),i.drop&&i.drop.dropZones){let e=i.drop.dropZones.map(e=>r.pOcontainer(e)),t=[];e.forEach(function(e){e.length?e.forEach(function(e){t.push(e)}):t.push(e)}),t=t.filter(function(e,t,n){return n.indexOf(e)===t}),i.drop.dropZones=t}i.start.length&&r.processCallbacks(o,i.start,!1,{left:d,top:f,width:p,height:h},e)}let n,l,u,c,k,C,D,S,A,E;t=1;let M,T=e.touches?e.touches[0].clientX:e.clientX,j=e.touches?e.touches[0].clientY:e.clientY,N=window.getComputedStyle(o);if(v===document.body){let e=o.getBoundingClientRect();A=window.innerWidth-parseInt(_.borderLeftWidth,10)-parseInt(_.borderRightWidth,10)-(e.left+e.width),E=window.innerHeight-parseInt(_.borderTopWidth,10)-parseInt(_.borderBottomWidth,10)-(e.top+e.height)}else A=parseInt(_.width,10)-parseInt(_.borderLeftWidth,10)-parseInt(_.borderRightWidth,10)-(parseInt(N.left,10)+parseInt(N.width,10)),E=parseInt(_.height,10)-parseInt(_.borderTopWidth,10)-parseInt(_.borderBottomWidth,10)-(parseInt(N.top,10)+parseInt(N.height,10));n=parseFloat(N.left),u=parseFloat(N.top),k=A,D=E,i.snap&&("panel"===i.snap.trigger?(l=n**2,c=u**2,C=k**2,S=D**2):"pointer"===i.snap.trigger&&("window"===o.options.container?(n=T,l=T**2,c=(u=j)**2,C=(k=window.innerWidth-T)**2,S=(D=window.innerHeight-j)**2):(n=(M=o.overlaps(v,"paddingbox",e)).pointer.left,u=M.pointer.top,k=M.pointer.right,D=M.pointer.bottom,l=M.pointer.left**2,c=M.pointer.top**2,C=M.pointer.right**2,S=M.pointer.bottom**2)));let F=Math.sqrt(l+c),O=Math.sqrt(l+S),I=Math.sqrt(C+c),z=Math.sqrt(C+S),$=Math.abs(n-k)/2,q=Math.abs(u-D)/2,R=Math.sqrt(l+q**2),P=Math.sqrt(c+$**2),L=Math.sqrt(C+q**2),B=Math.sqrt(S+$**2);if(window.getSelection().removeAllRanges(),document.dispatchEvent(s),i.axis&&"x"!==i.axis||(o.style.left=d+(T-g)/b.x+w+"px"),i.axis&&"y"!==i.axis||(o.style.top=f+(j-m)/b.y+"px"),i.grid){let e=i.grid,t=i.axis,n=e[0]*Math.round((d+(T-g))/e[0]),r=e[1]*Math.round((f+(j-m))/e[1]);t&&"x"!==t||(o.style.left=`${n}px`),t&&"y"!==t||(o.style.top=`${r}px`)}if(i.containment||0===i.containment){let e,t,n=i.containment;if("window"===o.options.container)e=window.innerWidth-parseFloat(N.width)-n[1]-x.y,t=window.innerHeight-parseFloat(N.height)-n[2]-x.x;else{let r=parseFloat(_.borderLeftWidth)+parseFloat(_.borderRightWidth),i=parseFloat(_.borderTopWidth)+parseFloat(_.borderBottomWidth);e=y.width/b.x-parseFloat(N.width)-n[1]-r-x.y,t=y.height/b.y-parseFloat(N.height)-n[2]-i-x.x}parseFloat(o.style.left)<=n[3]&&(o.style.left=n[3]+"px"),parseFloat(o.style.top)<=n[0]&&(o.style.top=n[0]+"px"),parseFloat(o.style.left)>=e&&(o.style.left=e+"px"),parseFloat(o.style.top)>=t&&(o.style.top=t+"px")}if(i.drag.length){let t={left:n,top:u,right:k,bottom:D,width:parseFloat(N.width),height:parseFloat(N.height)};r.processCallbacks(o,i.drag,!1,t,e)}if(i.snap){let e=i.snap.sensitivity,t=v===document.body?window.innerWidth/8:y.width/8,a=v===document.body?window.innerHeight/8:y.height/8;o.snappableTo=!1,r.removeSnapAreas(),F<e?!1!==i.snap.snapLeftTop&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.left>0&&M.pointer.top>0?(o.snappableTo="left-top",r.createSnapArea(o,"lt",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="left-top",r.createSnapArea(o,"lt",e))):O<e?!1!==i.snap.snapLeftBottom&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.left>0&&M.pointer.bottom>0?(o.snappableTo="left-bottom",r.createSnapArea(o,"lb",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="left-bottom",r.createSnapArea(o,"lb",e))):I<e?!1!==i.snap.snapRightTop&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.right>0&&M.pointer.top>0?(o.snappableTo="right-top",r.createSnapArea(o,"rt",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="right-top",r.createSnapArea(o,"rt",e))):z<e?!1!==i.snap.snapRightBottom&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.right>0&&M.pointer.bottom>0?(o.snappableTo="right-bottom",r.createSnapArea(o,"rb",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="right-bottom",r.createSnapArea(o,"rb",e))):u<e&&P<t?!1!==i.snap.snapCenterTop&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.top>0?(o.snappableTo="center-top",r.createSnapArea(o,"ct",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="center-top",r.createSnapArea(o,"ct",e))):n<e&&R<a?!1!==i.snap.snapLeftCenter&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.left>0?(o.snappableTo="left-center",r.createSnapArea(o,"lc",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="left-center",r.createSnapArea(o,"lc",e))):k<e&&L<a?!1!==i.snap.snapRightCenter&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.right>0?(o.snappableTo="right-center",r.createSnapArea(o,"rc",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="right-center",r.createSnapArea(o,"rc",e))):D<e&&B<t&&!1!==i.snap.snapCenterBottom&&(i.snap.active&&"both"!==i.snap.active?"pointer"===i.snap.trigger&&i.snap.active&&"inside"===i.snap.active&&(M.pointer.bottom>0?(o.snappableTo="center-bottom",r.createSnapArea(o,"cb",e)):(o.snappableTo=!1,r.removeSnapAreas())):(o.snappableTo="center-bottom",r.createSnapArea(o,"cb",e)))}if(i.drop&&i.drop.dropZones){let t=r.isIE?"msElementsFromPoint":"elementsFromPoint",n=document[t](e.clientX,e.clientY);Array.isArray(n)||(n=Array.prototype.slice.call(n)),i.drop.dropZones.forEach(e=>{n.includes(e)&&(o.droppableTo=e)}),n.includes(o.droppableTo)||(o.droppableTo=!1)}},r.pointermove.forEach(e=>document.addEventListener(e,n)),window.addEventListener("mouseout",c,!1)})}),r.pointerup.forEach(e=>{document.addEventListener(e,p),window.removeEventListener("mouseout",c)}),e.disable&&(l.style.pointerEvents="none")}),o},o.dragit=t=>{const n=Object.assign({},r.defaults.dragit,e.dragit),i=o.querySelectorAll(n.handles);return"disable"===t?i.forEach(e=>e.style.pointerEvents="none"):i.forEach(e=>e.style.pointerEvents="auto"),o},o.sizeit=(e={})=>{const t=new CustomEvent("jspanelresizestart",{detail:o.id}),n=new CustomEvent("jspanelresize",{detail:o.id}),i=new CustomEvent("jspanelresizestop",{detail:o.id});[t,n,i].forEach(e=>e.panel=o);let a,s,l,u,c,d,f={};f.handles=e.handles||r.defaults.resizeit.handles,f.handles.split(",").forEach(e=>{const t=document.createElement("DIV");t.className=`jsPanel-resizeit-handle jsPanel-resizeit-${e.trim()}`,o.append(t)});let p=!!e.aspectRatio&&e.aspectRatio;function h(e){null===e.relatedTarget&&r.pointermove.forEach(e=>document.removeEventListener(e,a,!1))}function g(e){if(r.pointermove.forEach(e=>document.removeEventListener(e,a,!1)),e.target.classList&&e.target.classList.contains("jsPanel-resizeit-handle")){let t,n,r=e.target.className;if(r.match(/jsPanel-resizeit-nw|jsPanel-resizeit-w|jsPanel-resizeit-sw/i)&&(t=!0),r.match(/jsPanel-resizeit-nw|jsPanel-resizeit-n|jsPanel-resizeit-ne/i)&&(n=!0),f.grid&&Array.isArray(f.grid)){1===f.grid.length&&(f.grid[1]=f.grid[0]);const e=parseFloat(o.style.width),r=parseFloat(o.style.height),i=e%f.grid[0],a=r%f.grid[1],s=parseFloat(o.style.left),l=parseFloat(o.style.top),u=s%f.grid[0],c=l%f.grid[1];i<f.grid[0]/2?o.style.width=e-i+"px":o.style.width=e+(f.grid[0]-i)+"px",a<f.grid[1]/2?o.style.height=r-a+"px":o.style.height=r+(f.grid[1]-a)+"px",t&&(u<f.grid[0]/2?o.style.left=s-u+"px":o.style.left=s+(f.grid[0]-u)+"px"),n&&(c<f.grid[1]/2?o.style.top=l-c+"px":o.style.top=l+(f.grid[1]-c)+"px")}}if(s){o.content.style.pointerEvents="inherit",s=void 0,o.saveCurrentDimensions(),o.saveCurrentPosition(),o.calcSizeFactors();let t=o.controlbar.querySelector(".jsPanel-btn-smallify"),n=o.getBoundingClientRect();if(t&&n.height>d+5&&(t.style.transform="rotate(0deg)"),document.dispatchEvent(i),f.stop.length){let t=window.getComputedStyle(o),n={left:parseFloat(t.left),top:parseFloat(t.top),width:parseFloat(t.width),height:parseFloat(t.height)};r.processCallbacks(o,f.stop,!1,n,e)}}o.content.style.pointerEvents="inherit",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="auto"),f.aspectRatio=p,document.removeEventListener(e,g)}return o.querySelectorAll(".jsPanel-resizeit-handle").forEach(i=>{i.style.touchAction="none",r.pointerdown.forEach(p=>{i.addEventListener(p,i=>{if(i.preventDefault(),i.stopPropagation(),i.button&&i.button>0)return!1;let p=1;if(((f=Object.assign({},r.defaults.resizeit,e)).containment||0===f.containment)&&(f.containment=r.pOcontainment(f.containment)),f.aspectRatio&&!0===f.aspectRatio&&(f.aspectRatio="panel"),r.modifier){let e=r.modifier;e.altKey?f.aspectRatio="content":e.ctrlKey?f.aspectRatio="panel":e.shiftKey&&(f.aspectRatio=!1,p=2)}let g="function"==typeof f.maxWidth?f.maxWidth():f.maxWidth||1e4,m="function"==typeof f.maxHeight?f.maxHeight():f.maxHeight||1e4,v="function"==typeof f.minWidth?f.minWidth():f.minWidth,y="function"==typeof f.minHeight?f.minHeight():f.minHeight;o.content.style.pointerEvents="none",document.querySelectorAll("iframe").forEach(e=>e.style.pointerEvents="none");const _=o.parentElement,b=_.tagName.toLowerCase(),w=o.getBoundingClientRect(),x=_.getBoundingClientRect(),k=window.getComputedStyle(_,null),C=parseInt(k.borderLeftWidth,10),D=parseInt(k.borderTopWidth,10),S=k.getPropertyValue("position"),A=i.clientX||0===i.clientX||i.touches[0].clientX,E=i.clientY||0===i.clientY||i.touches[0].clientY,M=A/E,T=i.target.classList,j=o.getScaleFactor(),N=w.width/w.height,F=o.content.getBoundingClientRect(),O=F.width/F.height,I=o.header.getBoundingClientRect().height,z=o.footer.getBoundingClientRect().height||0;let $=w.left,q=w.top,R=1e4,P=1e4,L=1e4,B=1e4;c=w.width,d=w.height,"body"!==b&&($=w.left-x.left+_.scrollLeft,q=w.top-x.top+_.scrollTop),"body"===b&&f.containment?(R=document.documentElement.clientWidth-w.left,L=document.documentElement.clientHeight-w.top,P=w.width+w.left,B=w.height+w.top):f.containment&&("static"===S?(R=x.width-w.left+C,L=x.height+x.top-w.top+D,P=w.width+(w.left-x.left)-C,B=w.height+(w.top-x.top)-D):(R=_.clientWidth-(w.left-x.left)/j.x+C,L=_.clientHeight-(w.top-x.top)/j.y+D,P=(w.width+w.left-x.left)/j.x-C,B=o.clientHeight+(w.top-x.top)/j.y-D)),f.containment&&(P-=f.containment[3],B-=f.containment[0],R-=f.containment[1],L-=f.containment[2]);const U=window.getComputedStyle(o),V=parseFloat(U.width)-w.width,H=parseFloat(U.height)-w.height;let W=parseFloat(U.left)-w.left,G=parseFloat(U.top)-w.top;_!==document.body&&(W+=x.left,G+=x.top);let Y=parseInt(U.borderTopWidth,10),Q=parseInt(U.borderRightWidth,10),K=parseInt(U.borderBottomWidth,10),Z=parseInt(U.borderLeftWidth,10);a=e=>{e.preventDefault(),s||(document.dispatchEvent(t),f.start.length&&r.processCallbacks(o,f.start,!1,{width:c,height:d,left:$,top:q},e),o.front(),"maximized"===o.status&&(o.status="normalized",o.controlbar.querySelector(".jsPanel-btn-maximize")&&o.setControlStatus("maximize","show"),o.controlbar.querySelector(".jsPanel-btn-normalize")&&o.setControlStatus("normalize","hide")),w.height>d+5&&(o.status="normalized",o.setControls([".jsPanel-btn-normalize"]))),s=1,document.dispatchEvent(n);let i,a=e.touches?e.touches[0].clientX:e.clientX,h=e.touches?e.touches[0].clientY:e.clientY;T.contains("jsPanel-resizeit-e")?((l=c+(a-A)*p/j.x+V)>=R&&(l=R),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",2===p&&(o.style.left=$-(a-A)+"px"),"content"===f.aspectRatio?(o.style.height=(l-Q-Z)/O+I+z+Y+K+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*O+"px")):"panel"===f.aspectRatio&&(o.style.height=l/N+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*N+"px"))):T.contains("jsPanel-resizeit-s")?((u=d+(h-E)*p/j.y+H)>=L&&(u=L),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px",2===p&&(o.style.top=q-(h-E)+"px"),"content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-w")?((l=c+(A-a)*p/j.x+V)<=g&&l>=v&&l<=P&&(o.style.left=$+(a-A)/j.x+W+"px"),l>=P&&(l=P),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px","content"===f.aspectRatio?(o.style.height=(l-Q-Z)/O+I+z+Y+K+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*O+"px")):"panel"===f.aspectRatio&&(o.style.height=l/N+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*N+"px"))):T.contains("jsPanel-resizeit-n")?((u=d+(E-h)*p/j.y+H)<=m&&u>=y&&u<=B&&(o.style.top=q+(h-E)/j.y+G+"px"),u>=B&&(u=B),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px","content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-se")?((l=c+(a-A)*p/j.x+V)>=R&&(l=R),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",2===p&&(o.style.left=$-(a-A)+"px"),f.aspectRatio&&(o.style.height=l/N+"px"),(u=d+(h-E)*p/j.y+H)>=L&&(u=L),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px",2===p&&(o.style.top=q-(h-E)+"px"),"content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-sw")?((u=d+(h-E)*p/j.y+H)>=L&&(u=L),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px",2===p&&(o.style.top=q-(h-E)+"px"),f.aspectRatio&&(o.style.width=u*N+"px"),(l=c+(A-a)*p/j.x+V)<=g&&l>=v&&l<=P&&(o.style.left=$+(a-A)/j.x+W+"px"),l>=P&&(l=P),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px","content"===f.aspectRatio?(o.style.height=(l-Q-Z)/O+I+z+Y+K+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*O+"px")):"panel"===f.aspectRatio&&(o.style.height=l/N+"px",f.containment&&(i=o.overlaps(_)).bottom<=f.containment[2]&&(o.style.height=L+"px",o.style.width=L*N+"px"))):T.contains("jsPanel-resizeit-ne")?((l=c+(a-A)*p/j.x+V)>=R&&(l=R),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",2===p&&(o.style.left=$-(a-A)+"px"),f.aspectRatio&&(o.style.height=l/N+"px"),(u=d+(E-h)*p/j.y+H)<=m&&u>=y&&u<=B&&(o.style.top=q+(h-E)/j.y+G+"px"),u>=B&&(u=B),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px","content"===f.aspectRatio?(o.style.width=(u-I-z-Y-K)*O+Y+K+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/O+"px")):"panel"===f.aspectRatio&&(o.style.width=u*N+"px",f.containment&&(i=o.overlaps(_)).right<=f.containment[1]&&(o.style.width=R+"px",o.style.height=R/N+"px"))):T.contains("jsPanel-resizeit-nw")&&(f.aspectRatio&&T.contains("jsPanel-resizeit-nw")&&(h=(a=h*M)/M),(l=c+(A-a)*p/j.x+V)<=g&&l>=v&&l<=P&&(o.style.left=$+(a-A)/j.x+W+"px"),l>=P&&(l=P),l>=g&&(l=g),l<=v&&(l=v),o.style.width=l+"px",f.aspectRatio&&(o.style.height=l/N+"px"),(u=d+(E-h)*p/j.y+H)<=m&&u>=y&&u<=B&&(o.style.top=q+(h-E)/j.y+G+"px"),u>=B&&(u=B),u>=m&&(u=m),u<=y&&(u=y),o.style.height=u+"px","content"===f.aspectRatio?o.style.width=(u-I-z-Y-K)*O+Y+K+"px":"panel"===f.aspectRatio&&(o.style.width=u*N+"px")),window.getSelection().removeAllRanges();const b=window.getComputedStyle(o),x={left:parseFloat(b.left),top:parseFloat(b.top),right:parseFloat(b.right),bottom:parseFloat(b.bottom),width:parseFloat(b.width),height:parseFloat(b.height)};f.resize.length&&r.processCallbacks(o,f.resize,!1,x,e)},r.pointermove.forEach(e=>document.addEventListener(e,a,!1)),window.addEventListener("mouseout",h,!1)})}),r.pointerup.forEach(function(e){document.addEventListener(e,g),window.removeEventListener("mouseout",h)}),e.disable&&(i.style.pointerEvents="none")}),o},o.resizeit=e=>{const t=o.querySelectorAll(".jsPanel-resizeit-handle");return"disable"===e?t.forEach(e=>e.style.pointerEvents="none"):t.forEach(e=>e.style.pointerEvents="auto"),o},o.getScaleFactor=()=>{const e=o.getBoundingClientRect();return{x:e.width/o.offsetWidth,y:e.height/o.offsetHeight}},o.calcSizeFactors=()=>{const t=window.getComputedStyle(o);if("window"===e.container)o.hf=parseFloat(t.left)/(window.innerWidth-parseFloat(t.width)),o.vf=parseFloat(t.top)/(window.innerHeight-parseFloat(t.height));else if(o.parentElement){let e=o.parentElement.getBoundingClientRect();o.hf=parseFloat(t.left)/(e.width-parseFloat(t.width)),o.vf=parseFloat(t.top)/(e.height-parseFloat(t.height))}},o.saveCurrentDimensions=()=>{const e=window.getComputedStyle(o);o.currentData.width=e.width,o.currentData.height=e.height},o.saveCurrentPosition=()=>{const e=window.getComputedStyle(o);o.currentData.left=e.left,o.currentData.top=e.top},o.reposition=(...t)=>{let n,i=e.position,a=!0;return t.forEach(e=>{"string"==typeof e||"object"==typeof e?i=e:"boolean"==typeof e?a=e:"function"==typeof e&&(n=e)}),r.position(o,i),o.slaves&&o.slaves.size>0&&o.slaves.forEach(e=>e.reposition()),a&&o.saveCurrentPosition(),n&&n.call(o,o),o},o.repositionOnSnap=t=>{let n="0",i="0",a=r.pOcontainment(e.dragit.containment);if(e.dragit.snap.containment)switch(t){case"left-top":n=a[3],i=a[0];break;case"right-top":n=-a[1],i=a[0];break;case"right-bottom":n=-a[1],i=-a[2];break;case"left-bottom":n=a[3],i=-a[2];break;case"center-top":n=a[3]/2-a[1]/2,i=a[0];break;case"center-bottom":n=a[3]/2-a[1]/2,i=-a[2];break;case"left-center":n=a[3],i=a[0]/2-a[2]/2;break;case"right-center":n=-a[1],i=a[0]/2-a[2]/2}r.position(o,t),r.setStyles(o,{left:`calc(${o.style.left} + ${n}px)`,top:`calc(${o.style.top} + ${i}px)`})},o.overlaps=(e,t,n)=>{let r,i=o.getBoundingClientRect(),a=getComputedStyle(o.parentElement),s=o.getScaleFactor(),l={top:0,right:0,bottom:0,left:0},u=0,c=0,d=0,f=0;"window"!==o.options.container&&"paddingbox"===t&&(l.top=parseInt(a.borderTopWidth,10)*s.y,l.right=parseInt(a.borderRightWidth,10)*s.x,l.bottom=parseInt(a.borderBottomWidth,10)*s.y,l.left=parseInt(a.borderLeftWidth,10)*s.x),r="string"==typeof e?"window"===e?{left:0,top:0,right:window.innerWidth,bottom:window.innerHeight}:"parent"===e?o.parentElement.getBoundingClientRect():document.querySelector(e).getBoundingClientRect():e.getBoundingClientRect(),n&&(u=n.touches?n.touches[0].clientX:n.clientX,c=n.touches?n.touches[0].clientY:n.clientY,d=u-r.left,f=c-r.top);let p=i.left<r.right&&i.right>r.left,h=i.top<r.bottom&&i.bottom>r.top;return{overlaps:p&&h,top:i.top-r.top-l.top,right:r.right-i.right-l.right,bottom:r.bottom-i.bottom-l.bottom,left:i.left-r.left-l.left,parentBorderWidth:l,panelRect:i,referenceRect:r,pointer:{clientX:u,clientY:c,left:d-l.left,top:f-l.top,right:r.width-d-l.right,bottom:r.height-f-l.bottom}}},o.setSize=()=>{if(e.panelSize){const t=r.pOsize(o,e.panelSize);o.style.width=t.width,o.style.height=t.height}else if(e.contentSize){const t=r.pOsize(o,e.contentSize);o.content.style.width=t.width,o.content.style.height=t.height,o.style.width=t.width,o.content.style.width="100%"}return o},o.resize=(...e)=>{let t,n=window.getComputedStyle(o),i={width:n.width,height:n.height},a=!0;e.forEach(e=>{"string"==typeof e?i=e:"object"==typeof e?i=Object.assign(i,e):"boolean"==typeof e?a=e:"function"==typeof e&&(t=e)});let s=r.pOsize(o,i);o.style.width=s.width,o.style.height=s.height,o.slaves&&o.slaves.size>0&&o.slaves.forEach(e=>e.reposition()),a&&o.saveCurrentDimensions(),o.status="normalized";let l=o.controlbar.querySelector(".jsPanel-btn-smallify");return l&&(l.style.transform="rotate(0deg)"),t&&t.call(o,o),o.calcSizeFactors(),o},o.windowResizeHandler=t=>{if(t.target===window){let n,r,i=o.status,a=e.onwindowresize;if("maximized"===i&&a)o.maximize(!1,!0);else if(o.snapped&&"minimized"!==i)o.snap(o.snapped,!0);else if("normalized"===i||"smallified"===i||"maximized"===i){let e=typeof a;"boolean"===e?(n=(window.innerWidth-o.offsetWidth)*o.hf,o.style.left=n<=0?0:n+"px",r=(window.innerHeight-o.offsetHeight)*o.vf,o.style.top=r<=0?0:r+"px"):"function"===e?a.call(o,t,o):"object"===e&&(!0===a.preset?(n=(window.innerWidth-o.offsetWidth)*o.hf,o.style.left=n<=0?0:n+"px",r=(window.innerHeight-o.offsetHeight)*o.vf,o.style.top=r<=0?0:r+"px",a.callback.call(o,t,o)):a.callback.call(o,t,o))}else"smallifiedmax"===i&&a&&o.maximize(!1,!0).smallify();o.slaves&&o.slaves.size>0&&o.slaves.forEach(e=>e.reposition())}},o.setControls=(e,t)=>(o.header.querySelectorAll(".jsPanel-btn").forEach(e=>{const t=e.className.split("-"),n=t[t.length-1];"hidden"!==o.getAttribute(`data-btn${n}`)&&(e.style.display="block")}),e.forEach(e=>{const t=o.controlbar.querySelector(e);t&&(t.style.display="none")}),t&&t.call(o,o),o),o.setControlStatus=(e,t="enable",n)=>{const r=o.controlbar.querySelector(`.jsPanel-btn-${e}`);switch(t){case"disable":"removed"!==o.getAttribute(`data-btn${e}`)&&(o.setAttribute(`data-btn${e}`,"disabled"),r.style.pointerEvents="none",r.style.opacity=.4,r.style.cursor="default");break;case"hide":"removed"!==o.getAttribute(`data-btn${e}`)&&(o.setAttribute(`data-btn${e}`,"hidden"),r.style.display="none");break;case"show":"removed"!==o.getAttribute(`data-btn${e}`)&&(o.setAttribute(`data-btn${e}`,"enabled"),r.style.display="block",r.style.pointerEvents="auto",r.style.opacity=1,r.style.cursor="pointer");break;case"enable":"removed"!==o.getAttribute(`data-btn${e}`)&&("hidden"===o.getAttribute(`data-btn${e}`)&&(r.style.display="block"),o.setAttribute(`data-btn${e}`,"enabled"),r.style.pointerEvents="auto",r.style.opacity=1,r.style.cursor="pointer");break;case"remove":o.controlbar.removeChild(r),o.setAttribute(`data-btn${e}`,"removed")}return n&&n.call(o,o),o},o.setControlSize=e=>{const t=e.toLowerCase();o.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{["jsPanel-btn-xl","jsPanel-btn-lg","jsPanel-btn-md","jsPanel-btn-sm","jsPanel-btn-xs"].forEach(t=>e.classList.remove(t)),e.classList.add(`jsPanel-btn-${t}`)}),"xl"===t?o.titlebar.style.fontSize="1.5rem":"lg"===t?o.titlebar.style.fontSize="1.25rem":"md"===t?o.titlebar.style.fontSize="1.05rem":"sm"===t?o.titlebar.style.fontSize=".9rem":"xs"===t&&(o.titlebar.style.fontSize=".8rem")},o.setHeaderControls=t=>{if(o.options.headerControls.add){let e=o.options.headerControls.add;Array.isArray(e)||(e=[e]),e.forEach(e=>o.addControl(e))}let n=[];o.controlbar.querySelectorAll(".jsPanel-btn").forEach(e=>{let t=e.className.match(/jsPanel-btn-[a-z\d]{3,}/i)[0].substring(12);n.push(t)});const i=r.pOheaderControls(e.headerControls);return e.headerControls=i,n.forEach(e=>{i[e]&&o.setControlStatus(e,i[e])}),o.setControlSize(i.size),t&&t.call(o,o),o},o.setHeaderLogo=(e,t)=>{let n=[o.headerlogo],i=document.querySelector("#"+o.id+"-min");return i&&n.push(i.querySelector(".jsPanel-headerlogo")),"string"==typeof e?e.startsWith("<")?n.forEach(t=>t.innerHTML=e):n.forEach(t=>{r.emptyNode(t);let n=document.createElement("img");n.src=e,t.append(n)}):n.forEach(t=>{r.emptyNode(t),t.append(e)}),o.headerlogo.childNodes.forEach(e=>{e.nodeName&&"IMG"===e.nodeName&&e.setAttribute("draggable","false")}),t&&t.call(o,o),o},o.setHeaderRemove=e=>(o.removeChild(o.header),o.content.classList.add("jsPanel-content-noheader"),["close","maximize","normalize","minimize","smallify"].forEach(e=>o.setAttribute(`data-btn${e}`,"removed")),e&&e.call(o,o),o),o.setHeaderTitle=(e,t)=>{let n=[o.headertitle],i=document.querySelector("#"+o.id+"-min");return i&&n.push(i.querySelector(".jsPanel-title")),"string"==typeof e?n.forEach(t=>t.innerHTML=e):"function"==typeof e?n.forEach(t=>{r.emptyNode(t),t.innerHTML=e()}):n.forEach(t=>{r.emptyNode(t),t.append(e)}),t&&t.call(o,o),o},o.setIconfont=(e,t=o,n)=>{if(e){let n,i;if("fa"===e||"far"===e||"fal"===e||"fas"===e||"fad"===e)n=[`${e} fa-window-close`,`${e} fa-window-maximize`,`${e} fa-window-restore`,`${e} fa-window-minimize`,`${e} fa-chevron-up`];else if("material-icons"===e)n=[e,e,e,e,e,e],i=["close","fullscreen","fullscreen_exit","call_received","expand_less"];else if(Array.isArray(e))n=[`custom-control-icon ${e[4]}`,`custom-control-icon ${e[3]}`,`custom-control-icon ${e[2]}`,`custom-control-icon ${e[1]}`,`custom-control-icon ${e[0]}`];else{if("bootstrap"!==e&&"glyphicon"!==e)return t;n=["glyphicon glyphicon-remove","glyphicon glyphicon-fullscreen","glyphicon glyphicon-resize-full","glyphicon glyphicon-minus","glyphicon glyphicon-chevron-up"]}t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn").forEach(e=>r.emptyNode(e).innerHTML="<span></span>"),Array.prototype.slice.call(t.querySelectorAll(".jsPanel-controlbar .jsPanel-btn > span")).reverse().forEach((t,r)=>{t.className=n[r],"material-icons"===e&&(t.textContent=i[r])})}return n&&n.call(t,t),t},o.addToolbar=(e,t,n)=>{if("header"===e?e=o.headertoolbar:"footer"===e&&(e=o.footer),"string"==typeof t)e.innerHTML=t;else if(Array.isArray(t))t.forEach(t=>{"string"==typeof t?e.innerHTML+=t:e.append(t)});else if("function"==typeof t){let n=t.call(o,o);"string"==typeof n?e.innerHTML=n:e.append(n)}else e.append(t);return e.classList.add("active"),n&&n.call(o,o),o},o.addCloseControl=()=>{let e=document.createElement("button"),t=o.content.style.color;return e.classList.add("jsPanel-addCloseCtrl"),e.innerHTML=r.icons.close,e.style.color=t,o.options.rtl&&e.classList.add("rtl"),o.appendChild(e),r.pointerup.forEach(t=>{e.addEventListener(t,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;o.close(null,!0)})}),r.pointerdown.forEach(t=>{e.addEventListener(t,e=>e.preventDefault())}),o},o.addControl=t=>{if(!t.html)return o;t.position||(t.position=1);const n=o.controlbar.querySelectorAll(".jsPanel-btn").length;let i=document.createElement("button");i.innerHTML=t.html,i.className=`jsPanel-btn jsPanel-btn-${t.name} jsPanel-btn-${e.headerControls.size}`,i.style.color=o.header.style.color,t.position>n?o.controlbar.append(i):o.controlbar.insertBefore(i,o.querySelector(`.jsPanel-controlbar .jsPanel-btn:nth-child(${t.position})`));const a=t.ariaLabel||t.name;return a&&i.setAttribute("aria-label",a),r.pointerup.forEach(e=>{i.addEventListener(e,e=>{if(e.preventDefault(),e.button&&e.button>0)return!1;t.handler.call(o,o,i)})}),t.afterInsert&&t.afterInsert.call(i,i),o},o.setRtl=()=>{[o.header,o.content,o.footer].forEach(t=>{t.dir="rtl",e.rtl.lang&&(t.lang=e.rtl.lang)})},o.id=e.id,o.classList.add("jsPanel-"+e.paneltype),"standard"===e.paneltype&&(o.style.zIndex=this.zi.next()),i.append(o),o.front(!1,!1),o.setTheme(e.theme),e.boxShadow&&o.classList.add(`jsPanel-depth-${e.boxShadow}`),e.header){if(e.headerLogo&&o.setHeaderLogo(e.headerLogo),o.setIconfont(e.iconfont),o.setHeaderTitle(e.headerTitle),o.setHeaderControls(),r.isIE){let e=[o.headerbar,o.controlbar];switch(o.options.headerControls.size){case"md":e.forEach(e=>{e.style.height="34px"});break;case"xs":e.forEach(e=>{e.style.height="26px"});break;case"sm":e.forEach(e=>{e.style.height="30px"});break;case"lg":e.forEach(e=>{e.style.height="38px"});break;case"xl":e.forEach(e=>{e.style.height="42px"})}}if("auto-show-hide"===e.header){let t="jsPanel-depth-"+e.boxShadow;o.header.style.opacity=0,o.style.backgroundColor="transparent",this.remClass(o,t),this.setClass(o.content,t),o.header.addEventListener("mouseenter",()=>{o.header.style.opacity=1,r.setClass(o,t),r.remClass(o.content,t)}),o.header.addEventListener("mouseleave",()=>{o.header.style.opacity=0,r.remClass(o,t),r.setClass(o.content,t)})}}else o.setHeaderRemove(),e.addCloseControl&&o.addCloseControl();if(e.headerToolbar&&o.addToolbar(o.headertoolbar,e.headerToolbar),e.footerToolbar&&o.addToolbar(o.footer,e.footerToolbar),e.border&&o.setBorder(e.border),e.borderRadius&&o.setBorderRadius(e.borderRadius),e.css)for(const[t,n]of Object.entries(e.css))if("panel"===t)o.className+=` ${n}`;else{let e=o.querySelector(`.jsPanel-${t}`);e&&(e.className+=` ${n}`)}if(e.content&&("function"==typeof e.content?e.content.call(o,o):"string"==typeof e.content?o.content.innerHTML=e.content:o.content.append(e.content)),e.contentAjax&&this.ajax(e.contentAjax,o),e.contentFetch&&this.fetch(e.contentFetch,o),e.contentOverflow){const t=e.contentOverflow.split(" ");1===t.length?o.content.style.overflow=t[0]:2===t.length&&(o.content.style.overflowX=t[0],o.content.style.overflowY=t[1])}if(e.autoclose){"number"==typeof e.autoclose?e.autoclose={time:e.autoclose+"ms"}:"string"==typeof e.autoclose&&(e.autoclose={time:e.autoclose});let t=Object.assign({},r.defaultAutocloseConfig,e.autoclose);t.time&&"number"==typeof t.time&&(t.time+="ms");let n=o.progressbar.querySelector("div");n.addEventListener("animationend",e=>{e.stopPropagation(),o.progressbar.classList.remove("active"),o.close()}),t.progressbar&&(o.progressbar.classList.add("active"),t.background?r.colorNames[t.background]?o.progressbar.style.background="#"+r.colorNames[t.background]:o.progressbar.style.background=t.background:o.progressbar.classList.add("success-bg")),n.style.animation=`${t.time} progressbar`}if(e.rtl&&o.setRtl(),o.setSize(),o.status="normalized",e.position?this.position(o,e.position):o.style.opacity=1,document.dispatchEvent(u),o.calcSizeFactors(),e.animateIn&&(o.addEventListener("animationend",()=>{this.remClass(o,e.animateIn)}),this.setClass(o,e.animateIn)),e.syncMargins){let t=this.pOcontainment(e.maximizedMargin);e.dragit&&(e.dragit.containment=t,!0===e.dragit.snap?(e.dragit.snap=r.defaultSnapConfig,e.dragit.snap.containment=!0):e.dragit.snap&&(e.dragit.snap.containment=!0)),e.resizeit&&(e.resizeit.containment=t)}if(e.dragit?(["start","drag","stop"].forEach(t=>{e.dragit[t]?"function"==typeof e.dragit[t]&&(e.dragit[t]=[e.dragit[t]]):e.dragit[t]=[]}),o.drag(e.dragit),o.addEventListener("jspaneldragstop",e=>{e.panel===o&&o.calcSizeFactors()},!1)):o.titlebar.style.cursor="default",e.resizeit){let t;["start","resize","stop"].forEach(t=>{e.resizeit[t]?"function"==typeof e.resizeit[t]&&(e.resizeit[t]=[e.resizeit[t]]):e.resizeit[t]=[]}),o.sizeit(e.resizeit),o.addEventListener("jspanelresizestart",e=>{e.panel===o&&(t=o.status)},!1),o.addEventListener("jspanelresizestop",n=>{n.panel===o&&("smallified"===t||"smallifiedmax"===t||"maximized"===t)&&parseFloat(o.style.height)>parseFloat(window.getComputedStyle(o.header).height)&&(o.setControls([".jsPanel-btn-normalize"]),o.status="normalized",document.dispatchEvent(u),document.dispatchEvent(s),e.onstatuschange&&r.processCallbacks(o,e.onstatuschange,"every"),o.calcSizeFactors())},!1)}if(o.saveCurrentDimensions(),o.saveCurrentPosition(),e.setStatus&&("smallifiedmax"===e.setStatus?o.maximize().smallify():"smallified"===e.setStatus?o.smallify():o[e.setStatus.slice(0,-1)]()),this.pointerdown.forEach(t=>{o.addEventListener(t,t=>{t.target.closest(".jsPanel-btn-close")||t.target.closest(".jsPanel-btn-minimize")||"standard"!==e.paneltype||o.front()},!1)}),e.onwindowresize&&"window"===o.options.container&&window.addEventListener("resize",o.windowResizeHandler,!1),e.onparentresize){let t=e.onparentresize,n=typeof t,r=o.isChildpanel();if(r){const e=r.content;let i=[];o.parentResizeHandler=a=>{if(a.panel===r){i[0]=e.offsetWidth,i[1]=e.offsetHeight;let r,a,s=o.status;"maximized"===s&&t?o.maximize():o.snapped&&"minimized"!==s?o.snap(o.snapped,!0):"normalized"===s||"smallified"===s||"maximized"===s?"function"===n?t.call(o,o,{width:i[0],height:i[1]}):"object"===n&&!0===t.preset?(r=(i[0]-o.offsetWidth)*o.hf,o.style.left=r<=0?0:r+"px",a=(i[1]-o.offsetHeight)*o.vf,o.style.top=a<=0?0:a+"px",t.callback.call(o,o,{width:i[0],height:i[1]})):"boolean"===n&&(r=(i[0]-o.offsetWidth)*o.hf,o.style.left=r<=0?0:r+"px",a=(i[1]-o.offsetHeight)*o.vf,o.style.top=a<=0?0:a+"px"):"smallifiedmax"===s&&t&&o.maximize().smallify()}},document.addEventListener("jspanelresize",o.parentResizeHandler,!1)}}return this.globalCallbacks&&(Array.isArray(this.globalCallbacks)?this.globalCallbacks.forEach(e=>e.call(o,o)):this.globalCallbacks.call(o,o)),e.callback&&(Array.isArray(e.callback)?e.callback.forEach(e=>e.call(o,o)):e.callback.call(o,o)),t&&(Array.isArray(t)?t.forEach(e=>e.call(o,o)):t.call(o,o)),document.dispatchEvent(a),o}}},7694:function(e,t,n){"use strict";n.r(t)},3513:function(e,t,n){"use strict";n.r(t)},281:function(e,t,n){"use strict";n.r(t)},2526:function(e,t,n){"use strict";n.r(t)},367:function(e,t,n){"use strict";n.r(t)},9648:function(e,t,n){"use strict";n.r(t)},800:function(e,t,n){"use strict";n.r(t)},4672:function(e,t,n){"use strict";n.r(t)},2019:function(e,t,n){"use strict";n.r(t)},5525:function(){},9050:function(e,t,n){"use strict";n.r(t),n.d(t,{VERSION:function(){return i},after:function(){return Ot},all:function(){return en},allKeys:function(){return me},any:function(){return tn},assign:function(){return Oe},before:function(){return It},bind:function(){return xt},bindAll:function(){return Dt},chain:function(){return yt},chunk:function(){return qn},clone:function(){return qe},collect:function(){return Yt},compact:function(){return An},compose:function(){return Ft},constant:function(){return X},contains:function(){return nn},countBy:function(){return vn},create:function(){return $e},debounce:function(){return Tt},default:function(){return Un},defaults:function(){return Ie},defer:function(){return Et},delay:function(){return At},detect:function(){return Ht},difference:function(){return Mn},drop:function(){return Dn},each:function(){return Gt},escape:function(){return at},every:function(){return en},extend:function(){return Fe},extendOwn:function(){return Oe},filter:function(){return Xt},find:function(){return Ht},findIndex:function(){return Rt},findKey:function(){return $t},findLastIndex:function(){return Pt},findWhere:function(){return Wt},first:function(){return Cn},flatten:function(){return En},foldl:function(){return Kt},foldr:function(){return Zt},forEach:function(){return Gt},functions:function(){return je},get:function(){return Ue},groupBy:function(){return gn},has:function(){return Ve},head:function(){return Cn},identity:function(){return He},include:function(){return nn},includes:function(){return nn},indexBy:function(){return mn},indexOf:function(){return Ut},initial:function(){return kn},inject:function(){return Kt},intersection:function(){return Fn},invert:function(){return Te},invoke:function(){return rn},isArguments:function(){return Q},isArray:function(){return W},isArrayBuffer:function(){return $},isBoolean:function(){return E},isDataView:function(){return H},isDate:function(){return F},isElement:function(){return M},isEmpty:function(){return le},isEqual:function(){return ge},isError:function(){return I},isFinite:function(){return K},isFunction:function(){return P},isMap:function(){return Ce},isMatch:function(){return ue},isNaN:function(){return Z},isNull:function(){return S},isNumber:function(){return N},isObject:function(){return D},isRegExp:function(){return O},isSet:function(){return Se},isString:function(){return j},isSymbol:function(){return z},isTypedArray:function(){return ie},isUndefined:function(){return A},isWeakMap:function(){return De},isWeakSet:function(){return Ae},iteratee:function(){return Ke},keys:function(){return se},last:function(){return Sn},lastIndexOf:function(){return Vt},map:function(){return Yt},mapObject:function(){return Xe},matcher:function(){return We},matches:function(){return We},max:function(){return sn},memoize:function(){return St},methods:function(){return je},min:function(){return ln},mixin:function(){return Pn},negate:function(){return Nt},noop:function(){return Je},now:function(){return rt},object:function(){return zn},omit:function(){return xn},once:function(){return zt},pairs:function(){return Me},partial:function(){return wt},partition:function(){return yn},pick:function(){return wn},pluck:function(){return on},property:function(){return Ge},propertyOf:function(){return et},random:function(){return nt},range:function(){return $n},reduce:function(){return Kt},reduceRight:function(){return Zt},reject:function(){return Jt},rest:function(){return Dn},restArguments:function(){return C},result:function(){return gt},sample:function(){return dn},select:function(){return Xt},shuffle:function(){return fn},size:function(){return _n},some:function(){return tn},sortBy:function(){return pn},sortedIndex:function(){return Lt},tail:function(){return Dn},take:function(){return Cn},tap:function(){return Re},template:function(){return ht},templateSettings:function(){return lt},throttle:function(){return Mt},times:function(){return tt},toArray:function(){return cn},toPath:function(){return Pe},transpose:function(){return On},unescape:function(){return st},union:function(){return Nn},uniq:function(){return jn},unique:function(){return jn},uniqueId:function(){return vt},unzip:function(){return On},values:function(){return Ee},where:function(){return an},without:function(){return Tn},wrap:function(){return jt},zip:function(){return In}});var r={};n.r(r),n.d(r,{VERSION:function(){return i},after:function(){return Ot},all:function(){return en},allKeys:function(){return me},any:function(){return tn},assign:function(){return Oe},before:function(){return It},bind:function(){return xt},bindAll:function(){return Dt},chain:function(){return yt},chunk:function(){return qn},clone:function(){return qe},collect:function(){return Yt},compact:function(){return An},compose:function(){return Ft},constant:function(){return X},contains:function(){return nn},countBy:function(){return vn},create:function(){return $e},debounce:function(){return Tt},default:function(){return Ln},defaults:function(){return Ie},defer:function(){return Et},delay:function(){return At},detect:function(){return Ht},difference:function(){return Mn},drop:function(){return Dn},each:function(){return Gt},escape:function(){return at},every:function(){return en},extend:function(){return Fe},extendOwn:function(){return Oe},filter:function(){return Xt},find:function(){return Ht},findIndex:function(){return Rt},findKey:function(){return $t},findLastIndex:function(){return Pt},findWhere:function(){return Wt},first:function(){return Cn},flatten:function(){return En},foldl:function(){return Kt},foldr:function(){return Zt},forEach:function(){return Gt},functions:function(){return je},get:function(){return Ue},groupBy:function(){return gn},has:function(){return Ve},head:function(){return Cn},identity:function(){return He},include:function(){return nn},includes:function(){return nn},indexBy:function(){return mn},indexOf:function(){return Ut},initial:function(){return kn},inject:function(){return Kt},intersection:function(){return Fn},invert:function(){return Te},invoke:function(){return rn},isArguments:function(){return Q},isArray:function(){return W},isArrayBuffer:function(){return $},isBoolean:function(){return E},isDataView:function(){return H},isDate:function(){return F},isElement:function(){return M},isEmpty:function(){return le},isEqual:function(){return ge},isError:function(){return I},isFinite:function(){return K},isFunction:function(){return P},isMap:function(){return Ce},isMatch:function(){return ue},isNaN:function(){return Z},isNull:function(){return S},isNumber:function(){return N},isObject:function(){return D},isRegExp:function(){return O},isSet:function(){return Se},isString:function(){return j},isSymbol:function(){return z},isTypedArray:function(){return ie},isUndefined:function(){return A},isWeakMap:function(){return De},isWeakSet:function(){return Ae},iteratee:function(){return Ke},keys:function(){return se},last:function(){return Sn},lastIndexOf:function(){return Vt},map:function(){return Yt},mapObject:function(){return Xe},matcher:function(){return We},matches:function(){return We},max:function(){return sn},memoize:function(){return St},methods:function(){return je},min:function(){return ln},mixin:function(){return Pn},negate:function(){return Nt},noop:function(){return Je},now:function(){return rt},object:function(){return zn},omit:function(){return xn},once:function(){return zt},pairs:function(){return Me},partial:function(){return wt},partition:function(){return yn},pick:function(){return wn},pluck:function(){return on},property:function(){return Ge},propertyOf:function(){return et},random:function(){return nt},range:function(){return $n},reduce:function(){return Kt},reduceRight:function(){return Zt},reject:function(){return Jt},rest:function(){return Dn},restArguments:function(){return C},result:function(){return gt},sample:function(){return dn},select:function(){return Xt},shuffle:function(){return fn},size:function(){return _n},some:function(){return tn},sortBy:function(){return pn},sortedIndex:function(){return Lt},tail:function(){return Dn},take:function(){return Cn},tap:function(){return Re},template:function(){return ht},templateSettings:function(){return lt},throttle:function(){return Mt},times:function(){return tt},toArray:function(){return cn},toPath:function(){return Pe},transpose:function(){return On},unescape:function(){return st},union:function(){return Nn},uniq:function(){return jn},unique:function(){return jn},uniqueId:function(){return vt},unzip:function(){return On},values:function(){return Ee},where:function(){return an},without:function(){return Tn},wrap:function(){return jt},zip:function(){return In}});var i="1.13.7",o="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},a=Array.prototype,s=Object.prototype,l="undefined"!=typeof Symbol?Symbol.prototype:null,u=a.push,c=a.slice,d=s.toString,f=s.hasOwnProperty,p="undefined"!=typeof ArrayBuffer,h="undefined"!=typeof DataView,g=Array.isArray,m=Object.keys,v=Object.create,y=p&&ArrayBuffer.isView,_=isNaN,b=isFinite,w=!{toString:null}.propertyIsEnumerable("toString"),x=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],k=Math.pow(2,53)-1;function C(e,t){return t=null==t?e.length-1:+t,function(){for(var n=Math.max(arguments.length-t,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+t];switch(t){case 0:return e.call(this,r);case 1:return e.call(this,arguments[0],r);case 2:return e.call(this,arguments[0],arguments[1],r)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=r,e.apply(this,o)}}function D(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function S(e){return null===e}function A(e){return void 0===e}function E(e){return!0===e||!1===e||"[object Boolean]"===d.call(e)}function M(e){return!(!e||1!==e.nodeType)}function T(e){var t="[object "+e+"]";return function(e){return d.call(e)===t}}var j=T("String"),N=T("Number"),F=T("Date"),O=T("RegExp"),I=T("Error"),z=T("Symbol"),$=T("ArrayBuffer"),q=T("Function"),R=o.document&&o.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof R&&(q=function(e){return"function"==typeof e||!1});var P=q,L=T("Object"),B=h&&(!/\[native code\]/.test(String(DataView))||L(new DataView(new ArrayBuffer(8)))),U="undefined"!=typeof Map&&L(new Map),V=T("DataView"),H=B?function(e){return null!=e&&P(e.getInt8)&&$(e.buffer)}:V,W=g||T("Array");function G(e,t){return null!=e&&f.call(e,t)}var Y=T("Arguments");!function(){Y(arguments)||(Y=function(e){return G(e,"callee")})}();var Q=Y;function K(e){return!z(e)&&b(e)&&!isNaN(parseFloat(e))}function Z(e){return N(e)&&_(e)}function X(e){return function(){return e}}function J(e){return function(t){var n=e(t);return"number"==typeof n&&n>=0&&n<=k}}function ee(e){return function(t){return null==t?void 0:t[e]}}var te=ee("byteLength"),ne=J(te),re=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,ie=p?function(e){return y?y(e)&&!H(e):ne(e)&&re.test(d.call(e))}:X(!1),oe=ee("length");function ae(e,t){t=function(e){for(var t={},n=e.length,r=0;r<n;++r)t[e[r]]=!0;return{contains:function(e){return!0===t[e]},push:function(n){return t[n]=!0,e.push(n)}}}(t);var n=x.length,r=e.constructor,i=P(r)&&r.prototype||s,o="constructor";for(G(e,o)&&!t.contains(o)&&t.push(o);n--;)(o=x[n])in e&&e[o]!==i[o]&&!t.contains(o)&&t.push(o)}function se(e){if(!D(e))return[];if(m)return m(e);var t=[];for(var n in e)G(e,n)&&t.push(n);return w&&ae(e,t),t}function le(e){if(null==e)return!0;var t=oe(e);return"number"==typeof t&&(W(e)||j(e)||Q(e))?0===t:0===oe(se(e))}function ue(e,t){var n=se(t),r=n.length;if(null==e)return!r;for(var i=Object(e),o=0;o<r;o++){var a=n[o];if(t[a]!==i[a]||!(a in i))return!1}return!0}function ce(e){return e instanceof ce?e:this instanceof ce?void(this._wrapped=e):new ce(e)}function de(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,te(e))}ce.VERSION=i,ce.prototype.value=function(){return this._wrapped},ce.prototype.valueOf=ce.prototype.toJSON=ce.prototype.value,ce.prototype.toString=function(){return String(this._wrapped)};var fe="[object DataView]";function pe(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var i=typeof e;return("function"===i||"object"===i||"object"==typeof t)&&he(e,t,n,r)}function he(e,t,n,r){e instanceof ce&&(e=e._wrapped),t instanceof ce&&(t=t._wrapped);var i=d.call(e);if(i!==d.call(t))return!1;if(B&&"[object Object]"==i&&H(e)){if(!H(t))return!1;i=fe}switch(i){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0===+e?1/+e==1/t:+e===+t;case"[object Date]":case"[object Boolean]":return+e===+t;case"[object Symbol]":return l.valueOf.call(e)===l.valueOf.call(t);case"[object ArrayBuffer]":case fe:return he(de(e),de(t),n,r)}var o="[object Array]"===i;if(!o&&ie(e)){if(te(e)!==te(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(P(a)&&a instanceof a&&P(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}r=r||[];for(var u=(n=n||[]).length;u--;)if(n[u]===e)return r[u]===t;if(n.push(e),r.push(t),o){if((u=e.length)!==t.length)return!1;for(;u--;)if(!pe(e[u],t[u],n,r))return!1}else{var c,f=se(e);if(u=f.length,se(t).length!==u)return!1;for(;u--;)if(!G(t,c=f[u])||!pe(e[c],t[c],n,r))return!1}return n.pop(),r.pop(),!0}function ge(e,t){return pe(e,t)}function me(e){if(!D(e))return[];var t=[];for(var n in e)t.push(n);return w&&ae(e,t),t}function ve(e){var t=oe(e);return function(n){if(null==n)return!1;var r=me(n);if(oe(r))return!1;for(var i=0;i<t;i++)if(!P(n[e[i]]))return!1;return e!==xe||!P(n[ye])}}var ye="forEach",_e=["clear","delete"],be=["get","has","set"],we=_e.concat(ye,be),xe=_e.concat(be),ke=["add"].concat(_e,ye,"has"),Ce=U?ve(we):T("Map"),De=U?ve(xe):T("WeakMap"),Se=U?ve(ke):T("Set"),Ae=T("WeakSet");function Ee(e){for(var t=se(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=e[t[i]];return r}function Me(e){for(var t=se(e),n=t.length,r=Array(n),i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r}function Te(e){for(var t={},n=se(e),r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t}function je(e){var t=[];for(var n in e)P(e[n])&&t.push(n);return t.sort()}function Ne(e,t){return function(n){var r=arguments.length;if(t&&(n=Object(n)),r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=e(o),s=a.length,l=0;l<s;l++){var u=a[l];t&&void 0!==n[u]||(n[u]=o[u])}return n}}var Fe=Ne(me),Oe=Ne(se),Ie=Ne(me,!0);function ze(e){if(!D(e))return{};if(v)return v(e);var t=function(){};t.prototype=e;var n=new t;return t.prototype=null,n}function $e(e,t){var n=ze(e);return t&&Oe(n,t),n}function qe(e){return D(e)?W(e)?e.slice():Fe({},e):e}function Re(e,t){return t(e),e}function Pe(e){return W(e)?e:[e]}function Le(e){return ce.toPath(e)}function Be(e,t){for(var n=t.length,r=0;r<n;r++){if(null==e)return;e=e[t[r]]}return n?e:void 0}function Ue(e,t,n){var r=Be(e,Le(t));return A(r)?n:r}function Ve(e,t){for(var n=(t=Le(t)).length,r=0;r<n;r++){var i=t[r];if(!G(e,i))return!1;e=e[i]}return!!n}function He(e){return e}function We(e){return e=Oe({},e),function(t){return ue(t,e)}}function Ge(e){return e=Le(e),function(t){return Be(t,e)}}function Ye(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 3:return function(n,r,i){return e.call(t,n,r,i)};case 4:return function(n,r,i,o){return e.call(t,n,r,i,o)}}return function(){return e.apply(t,arguments)}}function Qe(e,t,n){return null==e?He:P(e)?Ye(e,t,n):D(e)&&!W(e)?We(e):Ge(e)}function Ke(e,t){return Qe(e,t,1/0)}function Ze(e,t,n){return ce.iteratee!==Ke?ce.iteratee(e,t):Qe(e,t,n)}function Xe(e,t,n){t=Ze(t,n);for(var r=se(e),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=t(e[s],s,e)}return o}function Je(){}function et(e){return null==e?Je:function(t){return Ue(e,t)}}function tt(e,t,n){var r=Array(Math.max(0,e));t=Ye(t,n,1);for(var i=0;i<e;i++)r[i]=t(i);return r}function nt(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ce.toPath=Pe,ce.iteratee=Ke;var rt=Date.now||function(){return(new Date).getTime()};function it(e){var t=function(t){return e[t]},n="(?:"+se(e).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(e){return e=null==e?"":""+e,r.test(e)?e.replace(i,t):e}}var ot={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},at=it(ot),st=it(Te(ot)),lt=ce.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},ut=/(.)^/,ct={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},dt=/\\|'|\r|\n|\u2028|\u2029/g;function ft(e){return"\\"+ct[e]}var pt=/^\s*(\w|\$)+\s*$/;function ht(e,t,n){!t&&n&&(t=n),t=Ie({},t,ce.templateSettings);var r=RegExp([(t.escape||ut).source,(t.interpolate||ut).source,(t.evaluate||ut).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(r,function(t,n,r,a,s){return o+=e.slice(i,s).replace(dt,ft),i=s+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n";var a,s=t.variable;if(s){if(!pt.test(s))throw new Error("variable is not a bare identifier: "+s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(e){throw e.source=o,e}var l=function(e){return a.call(this,e,ce)};return l.source="function("+s+"){\n"+o+"}",l}function gt(e,t,n){var r=(t=Le(t)).length;if(!r)return P(n)?n.call(e):n;for(var i=0;i<r;i++){var o=null==e?void 0:e[t[i]];void 0===o&&(o=n,i=r),e=P(o)?o.call(e):o}return e}var mt=0;function vt(e){var t=++mt+"";return e?e+t:t}function yt(e){var t=ce(e);return t._chain=!0,t}function _t(e,t,n,r,i){if(!(r instanceof t))return e.apply(n,i);var o=ze(e.prototype),a=e.apply(o,i);return D(a)?a:o}var bt=C(function(e,t){var n=bt.placeholder,r=function(){for(var i=0,o=t.length,a=Array(o),s=0;s<o;s++)a[s]=t[s]===n?arguments[i++]:t[s];for(;i<arguments.length;)a.push(arguments[i++]);return _t(e,r,this,this,a)};return r});bt.placeholder=ce;var wt=bt,xt=C(function(e,t,n){if(!P(e))throw new TypeError("Bind must be called on a function");var r=C(function(i){return _t(e,r,t,this,n.concat(i))});return r}),kt=J(oe);function Ct(e,t,n,r){if(r=r||[],t||0===t){if(t<=0)return r.concat(e)}else t=1/0;for(var i=r.length,o=0,a=oe(e);o<a;o++){var s=e[o];if(kt(s)&&(W(s)||Q(s)))if(t>1)Ct(s,t-1,n,r),i=r.length;else for(var l=0,u=s.length;l<u;)r[i++]=s[l++];else n||(r[i++]=s)}return r}var Dt=C(function(e,t){var n=(t=Ct(t,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=t[n];e[r]=xt(e[r],e)}return e});function St(e,t){var n=function(r){var i=n.cache,o=""+(t?t.apply(this,arguments):r);return G(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return n.cache={},n}var At=C(function(e,t,n){return setTimeout(function(){return e.apply(null,n)},t)}),Et=wt(At,ce,1);function Mt(e,t,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=!1===n.leading?0:rt(),r=null,a=e.apply(i,o),r||(i=o=null)},u=function(){var u=rt();s||!1!==n.leading||(s=u);var c=t-(u-s);return i=this,o=arguments,c<=0||c>t?(r&&(clearTimeout(r),r=null),s=u,a=e.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(l,c)),a};return u.cancel=function(){clearTimeout(r),s=0,r=i=o=null},u}function Tt(e,t,n){var r,i,o,a,s,l=function(){var u=rt()-i;t>u?r=setTimeout(l,t-u):(r=null,n||(a=e.apply(s,o)),r||(o=s=null))},u=C(function(u){return s=this,o=u,i=rt(),r||(r=setTimeout(l,t),n&&(a=e.apply(s,o))),a});return u.cancel=function(){clearTimeout(r),r=o=s=null},u}function jt(e,t){return wt(t,e)}function Nt(e){return function(){return!e.apply(this,arguments)}}function Ft(){var e=arguments,t=e.length-1;return function(){for(var n=t,r=e[t].apply(this,arguments);n--;)r=e[n].call(this,r);return r}}function Ot(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function It(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=null),n}}var zt=wt(It,2);function $t(e,t,n){t=Ze(t,n);for(var r,i=se(e),o=0,a=i.length;o<a;o++)if(t(e[r=i[o]],r,e))return r}function qt(e){return function(t,n,r){n=Ze(n,r);for(var i=oe(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(n(t[o],o,t))return o;return-1}}var Rt=qt(1),Pt=qt(-1);function Lt(e,t,n,r){for(var i=(n=Ze(n,r,1))(t),o=0,a=oe(e);o<a;){var s=Math.floor((o+a)/2);n(e[s])<i?o=s+1:a=s}return o}function Bt(e,t,n){return function(r,i,o){var a=0,s=oe(r);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return r[o=n(r,i)]===i?o:-1;if(i!=i)return(o=t(c.call(r,a,s),Z))>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&o<s;o+=e)if(r[o]===i)return o;return-1}}var Ut=Bt(1,Rt,Lt),Vt=Bt(-1,Pt);function Ht(e,t,n){var r=(kt(e)?Rt:$t)(e,t,n);if(void 0!==r&&-1!==r)return e[r]}function Wt(e,t){return Ht(e,We(t))}function Gt(e,t,n){var r,i;if(t=Ye(t,n),kt(e))for(r=0,i=e.length;r<i;r++)t(e[r],r,e);else{var o=se(e);for(r=0,i=o.length;r<i;r++)t(e[o[r]],o[r],e)}return e}function Yt(e,t,n){t=Ze(t,n);for(var r=!kt(e)&&se(e),i=(r||e).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=t(e[s],s,e)}return o}function Qt(e){return function(t,n,r,i){var o=arguments.length>=3;return function(t,n,r,i){var o=!kt(t)&&se(t),a=(o||t).length,s=e>0?0:a-1;for(i||(r=t[o?o[s]:s],s+=e);s>=0&&s<a;s+=e){var l=o?o[s]:s;r=n(r,t[l],l,t)}return r}(t,Ye(n,i,4),r,o)}}var Kt=Qt(1),Zt=Qt(-1);function Xt(e,t,n){var r=[];return t=Ze(t,n),Gt(e,function(e,n,i){t(e,n,i)&&r.push(e)}),r}function Jt(e,t,n){return Xt(e,Nt(Ze(t)),n)}function en(e,t,n){t=Ze(t,n);for(var r=!kt(e)&&se(e),i=(r||e).length,o=0;o<i;o++){var a=r?r[o]:o;if(!t(e[a],a,e))return!1}return!0}function tn(e,t,n){t=Ze(t,n);for(var r=!kt(e)&&se(e),i=(r||e).length,o=0;o<i;o++){var a=r?r[o]:o;if(t(e[a],a,e))return!0}return!1}function nn(e,t,n,r){return kt(e)||(e=Ee(e)),("number"!=typeof n||r)&&(n=0),Ut(e,t,n)>=0}var rn=C(function(e,t,n){var r,i;return P(t)?i=t:(t=Le(t),r=t.slice(0,-1),t=t[t.length-1]),Yt(e,function(e){var o=i;if(!o){if(r&&r.length&&(e=Be(e,r)),null==e)return;o=e[t]}return null==o?o:o.apply(e,n)})});function on(e,t){return Yt(e,Ge(t))}function an(e,t){return Xt(e,We(t))}function sn(e,t,n){var r,i,o=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=kt(e)?e:Ee(e)).length;s<l;s++)null!=(r=e[s])&&r>o&&(o=r);else t=Ze(t,n),Gt(e,function(e,n,r){((i=t(e,n,r))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o}function ln(e,t,n){var r,i,o=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,l=(e=kt(e)?e:Ee(e)).length;s<l;s++)null!=(r=e[s])&&r<o&&(o=r);else t=Ze(t,n),Gt(e,function(e,n,r){((i=t(e,n,r))<a||i===1/0&&o===1/0)&&(o=e,a=i)});return o}var un=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function cn(e){return e?W(e)?c.call(e):j(e)?e.match(un):kt(e)?Yt(e,He):Ee(e):[]}function dn(e,t,n){if(null==t||n)return kt(e)||(e=Ee(e)),e[nt(e.length-1)];var r=cn(e),i=oe(r);t=Math.max(Math.min(t,i),0);for(var o=i-1,a=0;a<t;a++){var s=nt(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,t)}function fn(e){return dn(e,1/0)}function pn(e,t,n){var r=0;return t=Ze(t,n),on(Yt(e,function(e,n,i){return{value:e,index:r++,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return e.index-t.index}),"value")}function hn(e,t){return function(n,r,i){var o=t?[[],[]]:{};return r=Ze(r,i),Gt(n,function(t,i){var a=r(t,i,n);e(o,t,a)}),o}}var gn=hn(function(e,t,n){G(e,n)?e[n].push(t):e[n]=[t]}),mn=hn(function(e,t,n){e[n]=t}),vn=hn(function(e,t,n){G(e,n)?e[n]++:e[n]=1}),yn=hn(function(e,t,n){e[n?0:1].push(t)},!0);function _n(e){return null==e?0:kt(e)?e.length:se(e).length}function bn(e,t,n){return t in n}var wn=C(function(e,t){var n={},r=t[0];if(null==e)return n;P(r)?(t.length>1&&(r=Ye(r,t[1])),t=me(e)):(r=bn,t=Ct(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i<o;i++){var a=t[i],s=e[a];r(s,a,e)&&(n[a]=s)}return n}),xn=C(function(e,t){var n,r=t[0];return P(r)?(r=Nt(r),t.length>1&&(n=t[1])):(t=Yt(Ct(t,!1,!1),String),r=function(e,n){return!nn(t,n)}),wn(e,r,n)});function kn(e,t,n){return c.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))}function Cn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[0]:kn(e,e.length-t)}function Dn(e,t,n){return c.call(e,null==t||n?1:t)}function Sn(e,t,n){return null==e||e.length<1?null==t||n?void 0:[]:null==t||n?e[e.length-1]:Dn(e,Math.max(0,e.length-t))}function An(e){return Xt(e,Boolean)}function En(e,t){return Ct(e,t,!1)}var Mn=C(function(e,t){return t=Ct(t,!0,!0),Xt(e,function(e){return!nn(t,e)})}),Tn=C(function(e,t){return Mn(e,t)});function jn(e,t,n,r){E(t)||(r=n,n=t,t=!1),null!=n&&(n=Ze(n,r));for(var i=[],o=[],a=0,s=oe(e);a<s;a++){var l=e[a],u=n?n(l,a,e):l;t&&!n?(a&&o===u||i.push(l),o=u):n?nn(o,u)||(o.push(u),i.push(l)):nn(i,l)||i.push(l)}return i}var Nn=C(function(e){return jn(Ct(e,!0,!0))});function Fn(e){for(var t=[],n=arguments.length,r=0,i=oe(e);r<i;r++){var o=e[r];if(!nn(t,o)){var a;for(a=1;a<n&&nn(arguments[a],o);a++);a===n&&t.push(o)}}return t}function On(e){for(var t=e&&sn(e,oe).length||0,n=Array(t),r=0;r<t;r++)n[r]=on(e,r);return n}var In=C(On);function zn(e,t){for(var n={},r=0,i=oe(e);r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n}function $n(e,t,n){null==t&&(t=e||0,e=0),n||(n=t<e?-1:1);for(var r=Math.max(Math.ceil((t-e)/n),0),i=Array(r),o=0;o<r;o++,e+=n)i[o]=e;return i}function qn(e,t){if(null==t||t<1)return[];for(var n=[],r=0,i=e.length;r<i;)n.push(c.call(e,r,r+=t));return n}function Rn(e,t){return e._chain?ce(t).chain():t}function Pn(e){return Gt(je(e),function(t){var n=ce[t]=e[t];ce.prototype[t]=function(){var e=[this._wrapped];return u.apply(e,arguments),Rn(this,n.apply(ce,e))}}),ce}Gt(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];ce.prototype[e]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0]),Rn(this,n)}}),Gt(["concat","join","slice"],function(e){var t=a[e];ce.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Rn(this,e)}});var Ln=ce,Bn=Pn(r);Bn._=Bn;var Un=Bn}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e=n(9983);window.jQuery=e,window.$=e,n(7694),n(2526),n(281),n(3513),n(800),n(367),n(9648),n(7915),n(4672),n(2019);var t=n(3110);Math.log10=Math.log10||function(e){return Math.log(e)/Math.LN10},window.hivtrace=t}()}();
3
3
  //# sourceMappingURL=hivtrace.js.map